package defpackage;

import java.util.Iterator;

/* JADX INFO: renamed from: ᵸʽˋᵯ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C4953 implements Iterator {

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public int f18806;

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public final /* synthetic */ int f18808;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public final CharSequence f18809;

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

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public final AbstractC1351 f18811;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public final boolean f18812;

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public final /* synthetic */ InterfaceC1339 f18814;

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public int f18807 = 2;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public int f18813 = 0;

    public C4953(InterfaceC1339 interfaceC1339, C1886 c1886, CharSequence charSequence, int i) {
        this.f18808 = i;
        this.f18814 = interfaceC1339;
        this.f18811 = (AbstractC1351) c1886.f7482;
        this.f18812 = c1886.f7483;
        this.f18806 = c1886.f7481;
        this.f18809 = charSequence;
    }

    /* JADX WARN: Code restructure failed: missing block: B:21:0x004a, code lost:
    
        r3 = r3 + 1;
     */
    @Override // java.util.Iterator
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean hasNext() {
        int length;
        String string;
        CharSequence charSequence;
        int length2;
        AbstractC1351 abstractC1351;
        ᵻᵪ.ˌᴵ(this.f18807 != 4);
        int iM8218 = AbstractC3653.m8218(this.f18807);
        if (iM8218 == 0) {
            return true;
        }
        if (iM8218 != 2) {
            this.f18807 = 4;
            int i = this.f18813;
            while (true) {
                length = this.f18813;
                if (length != -1) {
                    int i2 = this.f18808;
                    ʽˎˇˌ r7 = this.f18814;
                    charSequence = this.f18809;
                    switch (i2) {
                        case 0:
                            C1692 c1692 = (C1692) r7.ᵜᵪʾ;
                            int length3 = charSequence.length();
                            ᵻᵪ.ˉᵲ(length, length3);
                            while (length < length3) {
                                if (!c1692.mo3871(charSequence.charAt(length))) {
                                    length++;
                                }
                                break;
                            }
                            length = -1;
                            break;
                        default:
                            String str = ((C1735) r7).f6963;
                            int length4 = str.length();
                            int length5 = charSequence.length() - length4;
                            while (length <= length5) {
                                for (int i3 = 0; i3 < length4; i3++) {
                                    if (charSequence.charAt(i3 + length) != str.charAt(i3)) {
                                    }
                                    break;
                                }
                                break;
                            }
                            length = -1;
                            break;
                    }
                    if (length == -1) {
                        length = charSequence.length();
                        this.f18813 = -1;
                    } else {
                        switch (i2) {
                            case 0:
                                length2 = length + 1;
                                break;
                            default:
                                length2 = ((C1735) r7).f6963.length() + length;
                                break;
                        }
                        this.f18813 = length2;
                    }
                    int i4 = this.f18813;
                    if (i4 == i) {
                        int i5 = i4 + 1;
                        this.f18813 = i5;
                        if (i5 > charSequence.length()) {
                            this.f18813 = -1;
                        }
                    } else {
                        while (true) {
                            abstractC1351 = this.f18811;
                            if (i < length && abstractC1351.mo3871(charSequence.charAt(i))) {
                                i++;
                            }
                        }
                        while (length > i && abstractC1351.mo3871(charSequence.charAt(length - 1))) {
                            length--;
                        }
                        if (this.f18812 && i == length) {
                            i = this.f18813;
                        }
                    }
                } else {
                    this.f18807 = 3;
                    string = null;
                }
            }
            int i6 = this.f18806;
            if (i6 == 1) {
                length = charSequence.length();
                this.f18813 = -1;
                while (length > i && abstractC1351.mo3871(charSequence.charAt(length - 1))) {
                    length--;
                }
            } else {
                this.f18806 = i6 - 1;
            }
            string = charSequence.subSequence(i, length).toString();
            this.f18810 = string;
            if (this.f18807 != 3) {
                this.f18807 = 1;
                return true;
            }
        }
        return false;
    }

    @Override // java.util.Iterator
    public final Object next() {
        if (!hasNext()) {
            C4468.m9518();
            return null;
        }
        this.f18807 = 2;
        String str = this.f18810;
        this.f18810 = null;
        return str;
    }

    @Override // java.util.Iterator
    public final void remove() {
        throw new UnsupportedOperationException();
    }
}
