package o;

import java.util.Iterator;
import java.util.NoSuchElementException;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.nr, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1996nr implements Iterator, InterfaceC2989yJ {
    public int l = -1;
    public int m;
    public int n;

    /* renamed from: o, reason: collision with root package name */
    public C0991dI f652o;
    public int p;
    public final /* synthetic */ C2091or q;

    public C1996nr(C2091or c2091or) {
        this.q = c2091or;
        int iK = AbstractC0940cn0.k(0, 0, c2091or.a.length());
        this.m = iK;
        this.n = iK;
    }

    /* JADX WARN: Removed duplicated region for block: B:10:0x001c  */
    /* JADX WARN: Type inference failed for: r0v1, types: [o.SC, o.aK] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void a() {
        /*
            r8 = this;
            o.or r0 = r8.q
            java.lang.CharSequence r1 = r0.a
            int r2 = r8.n
            r3 = 0
            if (r2 >= 0) goto Lf
            r8.l = r3
            r0 = 0
            r8.f652o = r0
            return
        Lf:
            int r4 = r0.b
            r5 = -1
            r6 = 1
            if (r4 <= 0) goto L1c
            int r7 = r8.p
            int r7 = r7 + r6
            r8.p = r7
            if (r7 >= r4) goto L22
        L1c:
            int r4 = r1.length()
            if (r2 <= r4) goto L32
        L22:
            o.dI r0 = new o.dI
            int r2 = r8.m
            int r1 = o.Za0.S(r1)
            r0.<init>(r2, r1, r6)
            r8.f652o = r0
            r8.n = r5
            goto L73
        L32:
            o.aK r0 = r0.c
            int r2 = r8.n
            java.lang.Integer r2 = java.lang.Integer.valueOf(r2)
            java.lang.Object r0 = r0.f(r1, r2)
            o.yV r0 = (o.C3001yV) r0
            if (r0 != 0) goto L52
            o.dI r0 = new o.dI
            int r2 = r8.m
            int r1 = o.Za0.S(r1)
            r0.<init>(r2, r1, r6)
            r8.f652o = r0
            r8.n = r5
            goto L73
        L52:
            java.lang.Object r1 = r0.l
            java.lang.Number r1 = (java.lang.Number) r1
            int r1 = r1.intValue()
            java.lang.Object r0 = r0.m
            java.lang.Number r0 = (java.lang.Number) r0
            int r0 = r0.intValue()
            int r2 = r8.m
            o.dI r2 = o.AbstractC0940cn0.K(r2, r1)
            r8.f652o = r2
            int r1 = r1 + r0
            r8.m = r1
            if (r0 != 0) goto L70
            r3 = r6
        L70:
            int r1 = r1 + r3
            r8.n = r1
        L73:
            r8.l = r6
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C1996nr.a():void");
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        if (this.l == -1) {
            a();
        }
        return this.l == 1;
    }

    @Override // java.util.Iterator
    public final Object next() {
        if (this.l == -1) {
            a();
        }
        if (this.l == 0) {
            throw new NoSuchElementException();
        }
        C0991dI c0991dI = this.f652o;
        this.f652o = null;
        this.l = -1;
        return c0991dI;
    }

    @Override // java.util.Iterator
    public final void remove() {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }
}
