package defpackage;

import java.util.Iterator;

/* JADX INFO: renamed from: ᵝʩ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C2907 implements Iterator, InterfaceC5238 {

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final /* synthetic */ int f11188;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public int f11189;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public int f11190;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public int f11191;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public Object f11192;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public final /* synthetic */ Object f11193;

    public C2907(C1877 c1877) {
        this.f11188 = 1;
        this.f11193 = c1877;
        this.f11189 = c1877.f7436;
        this.f11191 = c1877.f7434;
    }

    public C2907(C4874 c4874) {
        this.f11188 = 0;
        this.f11193 = c4874;
        this.f11190 = -1;
        int i = ᵗʓ.ᵨᵣ(0, ((CharSequence) c4874.f18571).length());
        this.f11189 = i;
        this.f11191 = i;
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        switch (this.f11188) {
            case 0:
                if (this.f11190 == -1) {
                    m6974();
                }
                return this.f11190 == 1;
            default:
                int i = this.f11190;
                if (i == 0) {
                    return m6973();
                }
                if (i == 1) {
                    return true;
                }
                if (i != 2) {
                    ᵕᵩʽᵲ.ᵮᵣᵗˈ("hasNext called when the iterator is in the FAILED state.");
                }
                return false;
        }
    }

    @Override // java.util.Iterator
    public final Object next() {
        switch (this.f11188) {
            case 0:
                if (this.f11190 == -1) {
                    m6974();
                }
                if (this.f11190 == 0) {
                    C4468.m9518();
                } else {
                    C2187 c2187 = (C2187) this.f11192;
                    this.f11192 = null;
                    this.f11190 = -1;
                }
                break;
            default:
                int i = this.f11190;
                if (i == 1) {
                    this.f11190 = 0;
                } else if (i != 2 && m6973()) {
                    this.f11190 = 0;
                } else {
                    C4468.m9518();
                }
                break;
        }
        return null;
    }

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

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public boolean m6973() {
        this.f11190 = 3;
        int i = this.f11189;
        if (i == 0) {
            this.f11190 = 2;
        } else {
            C1877 c1877 = (C1877) this.f11193;
            Object[] objArr = c1877.f7433;
            int i2 = this.f11191;
            this.f11192 = objArr[i2];
            this.f11190 = 1;
            this.f11191 = (i2 + 1) % c1877.f7435;
            this.f11189 = i - 1;
        }
        return this.f11190 == 1;
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public void m6974() {
        C1081 c1081;
        C4874 c4874 = (C4874) this.f11193;
        CharSequence charSequence = (CharSequence) c4874.f18571;
        int i = this.f11191;
        if (i < 0) {
            this.f11190 = 0;
            this.f11192 = null;
            return;
        }
        if (i <= charSequence.length() && (c1081 = (C1081) ((InterfaceC0321) c4874.f18572).mo1564(charSequence, Integer.valueOf(this.f11191))) != null) {
            int iIntValue = ((Number) c1081.f4615).intValue();
            int iIntValue2 = ((Number) c1081.f4616).intValue();
            this.f11192 = ᵗʓ.ᵠˏˏ(this.f11189, iIntValue);
            int i2 = iIntValue + iIntValue2;
            this.f11189 = i2;
            this.f11191 = i2 + (iIntValue2 == 0 ? 1 : 0);
        } else {
            this.f11192 = new C2187(this.f11189, AbstractC3801.m8503(charSequence), 1);
            this.f11191 = -1;
        }
        this.f11190 = 1;
    }
}
