package E;

/* JADX INFO: loaded from: classes.dex */
public final class p {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final T.p f1041a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final int f1042b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final int f1043c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final o f1044d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final y f1045e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final /* synthetic */ T.p f1046f;

    public p(T.p pVar, int i6, int i7, o oVar, y yVar) {
        this.f1046f = pVar;
        this.f1041a = pVar;
        this.f1042b = i6;
        this.f1043c = i7;
        this.f1044d = oVar;
        this.f1045e = yVar;
    }

    public final long a(int i6, int i7) {
        int i8;
        T.p pVar = this.f1041a;
        int[] iArr = (int[]) pVar.f6345b;
        if (i7 == 1) {
            i8 = iArr[i6];
        } else {
            int i9 = (i7 + i6) - 1;
            int[] iArr2 = (int[]) pVar.f6346c;
            i8 = (iArr2[i9] + iArr[i9]) - iArr2[i6];
        }
        if (i8 < 0) {
            i8 = 0;
        }
        if (i8 < 0) {
            h1.i.a("width must be >= 0");
        }
        return h1.b.h(i8, i8, 0, Integer.MAX_VALUE);
    }

    /* JADX WARN: Type inference failed for: r5v0, types: [java.lang.Object, java.util.List] */
    public final t b(int i6) {
        C1.k kVarB = this.f1045e.b(i6);
        ?? r5 = kVarB.f691c;
        int size = r5.size();
        int i7 = 0;
        int i8 = kVarB.f690b;
        int i9 = (size == 0 || i8 + size == this.f1042b) ? 0 : this.f1043c;
        s[] sVarArr = new s[size];
        int i10 = 0;
        while (i7 < size) {
            int i11 = (int) ((C0143d) r5.get(i7)).f989a;
            int i12 = i9;
            s sVarN = this.f1044d.n(i8 + i7, i10, i11, a(i10, i11), i12);
            i10 += i11;
            sVarArr[i7] = sVarN;
            i7++;
            i9 = i12;
        }
        return new t(i6, sVarArr, this.f1046f, r5, i9);
    }
}
