package defpackage;

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

/* renamed from: ᵧʾᵸᵕ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3625 implements Iterator, InterfaceC4943, InterfaceC3996 {

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public Object f13510;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public int f13511;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public InterfaceC4943 f13512;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public Iterator f13513;

    @Override // java.util.Iterator
    public final boolean hasNext() {
        while (true) {
            int i = this.f13511;
            if (i != 0) {
                if (i != 1) {
                    if (i == 2 || i == 3) {
                        return true;
                    }
                    if (i == 4) {
                        return false;
                    }
                    throw m8225();
                }
                if (this.f13513.hasNext()) {
                    this.f13511 = 2;
                    return true;
                }
                this.f13513 = null;
            }
            this.f13511 = 5;
            InterfaceC4943 interfaceC4943 = this.f13512;
            this.f13512 = null;
            interfaceC4943.mo2134(C3637.f13536);
        }
    }

    @Override // java.util.Iterator
    public final Object next() {
        int i = this.f13511;
        if (i == 0 || i == 1) {
            if (hasNext()) {
                return next();
            }
            C0190.m1427();
            return null;
        }
        if (i == 2) {
            this.f13511 = 1;
            return this.f13513.next();
        }
        if (i != 3) {
            throw m8225();
        }
        this.f13511 = 0;
        Object obj = this.f13510;
        this.f13510 = null;
        return obj;
    }

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

    @Override // defpackage.InterfaceC4943
    /* renamed from: ˇʼʤˎ */
    public final void mo2134(Object obj) {
        ʼٴ.ᵺᵠ(obj);
        this.f13511 = 4;
    }

    @Override // defpackage.InterfaceC4943
    /* renamed from: ˌᵜᵹᵩ */
    public final InterfaceC2262 mo2135() {
        return C4555.f16926;
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final RuntimeException m8225() {
        int i = this.f13511;
        if (i == 4) {
            return new NoSuchElementException();
        }
        if (i == 5) {
            return new IllegalStateException("Iterator has failed.");
        }
        return new IllegalStateException("Unexpected state of the iterator: " + this.f13511);
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final void m8226(Object obj, AbstractC2544 abstractC2544) {
        this.f13510 = obj;
        this.f13511 = 3;
        this.f13512 = abstractC2544;
    }
}
