package o;

import java.util.ArrayList;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.wW, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2812wW {
    public final ArrayList a;
    public final int b;
    public int c;
    public final ArrayList d;
    public final IQ e;
    public final C1014dc0 f;

    public C2812wW(int i, ArrayList arrayList) {
        this.a = arrayList;
        this.b = i;
        if (i < 0) {
            AbstractC1102eY.a("Invalid start index");
        }
        this.d = new ArrayList();
        IQ iq = new IQ();
        int size = arrayList.size();
        int i2 = 0;
        for (int i3 = 0; i3 < size; i3++) {
            JJ jj = (JJ) this.a.get(i3);
            int i4 = jj.c;
            int i5 = jj.d;
            iq.h(i4, new C2225qE(i3, i2, i5));
            i2 += i5;
        }
        this.e = iq;
        this.f = new C1014dc0(new C0170Go(2, this));
    }

    public final boolean a(int i, int i2) {
        int i3;
        IQ iq = this.e;
        C2225qE c2225qE = (C2225qE) iq.b(i);
        if (c2225qE == null) {
            return false;
        }
        int i4 = c2225qE.b;
        int i5 = i2 - c2225qE.c;
        c2225qE.c = i2;
        if (i5 == 0) {
            return true;
        }
        Object[] objArr = iq.c;
        long[] jArr = iq.a;
        int length = jArr.length - 2;
        if (length < 0) {
            return true;
        }
        int i6 = 0;
        while (true) {
            long j = jArr[i6];
            if ((((~j) << 7) & j & (-9187201950435737472L)) != -9187201950435737472L) {
                int i7 = 8 - ((~(i6 - length)) >>> 31);
                for (int i8 = 0; i8 < i7; i8++) {
                    if ((255 & j) < 128) {
                        C2225qE c2225qE2 = (C2225qE) objArr[(i6 << 3) + i8];
                        if (c2225qE2.b >= i4 && !c2225qE2.equals(c2225qE) && (i3 = c2225qE2.b + i5) >= 0) {
                            c2225qE2.b = i3;
                        }
                    }
                    j >>= 8;
                }
                if (i7 != 8) {
                    return true;
                }
            }
            if (i6 == length) {
                return true;
            }
            i6++;
        }
    }
}
