package defpackage;

import j$.util.Objects;
import java.util.AbstractMap;
import java.util.Iterator;
import java.util.Map;

/* renamed from: ᵖʢʙᵸ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C2337 implements Iterator {

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

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final /* synthetic */ AbstractMap f9160;

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

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public Iterator f9162;

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

    public C2337(C0167 c0167) {
        this.f9161 = 0;
        this.f9160 = c0167;
        this.f9159 = -1;
    }

    public /* synthetic */ C2337(C1941 c1941) {
        this.f9161 = 1;
        Objects.requireNonNull(c1941);
        this.f9160 = c1941;
        this.f9159 = -1;
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        int i = this.f9161;
        AbstractMap abstractMap = this.f9160;
        switch (i) {
            case 0:
                C0167 c0167 = (C0167) abstractMap;
                if (this.f9159 + 1 >= c0167.f1586.size()) {
                    if (c0167.f1584.isEmpty() || !m6055().hasNext()) {
                        break;
                    }
                }
                break;
            default:
                C1941 c1941 = (C1941) abstractMap;
                if (this.f9159 + 1 >= c1941.f7819) {
                    if (c1941.f7823.isEmpty() || !m6056().hasNext()) {
                        break;
                    }
                }
                break;
        }
        return false;
    }

    @Override // java.util.Iterator
    public final Object next() {
        int i = this.f9161;
        AbstractMap abstractMap = this.f9160;
        switch (i) {
            case 0:
                this.f9163 = true;
                int i2 = this.f9159 + 1;
                this.f9159 = i2;
                C0167 c0167 = (C0167) abstractMap;
                return i2 < c0167.f1586.size() ? (Map.Entry) c0167.f1586.get(this.f9159) : (Map.Entry) m6055().next();
            default:
                this.f9163 = true;
                int i3 = this.f9159 + 1;
                this.f9159 = i3;
                C1941 c1941 = (C1941) abstractMap;
                return i3 < c1941.f7819 ? (C2072) c1941.f7821[i3] : (Map.Entry) m6056().next();
        }
    }

    @Override // java.util.Iterator
    public final void remove() {
        int i = this.f9161;
        AbstractMap abstractMap = this.f9160;
        switch (i) {
            case 0:
                C0167 c0167 = (C0167) abstractMap;
                if (!this.f9163) {
                    ᵹˉᵞ.ᵳٴᵶ("remove() was called before next()");
                    break;
                } else {
                    this.f9163 = false;
                    int i2 = C0167.f1583;
                    c0167.m1343();
                    if (this.f9159 >= c0167.f1586.size()) {
                        m6055().remove();
                        break;
                    } else {
                        int i3 = this.f9159;
                        this.f9159 = i3 - 1;
                        c0167.m1344(i3);
                        break;
                    }
                }
            default:
                if (!this.f9163) {
                    ᵹˉᵞ.ᵳٴᵶ("remove() was called before next()");
                    break;
                } else {
                    this.f9163 = false;
                    C1941 c1941 = (C1941) abstractMap;
                    c1941.m5459();
                    int i4 = this.f9159;
                    if (i4 >= c1941.f7819) {
                        m6056().remove();
                        break;
                    } else {
                        this.f9159 = i4 - 1;
                        c1941.m5463(i4);
                        break;
                    }
                }
        }
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public Iterator m6055() {
        if (this.f9162 == null) {
            this.f9162 = ((C0167) this.f9160).f1584.entrySet().iterator();
        }
        return this.f9162;
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public Iterator m6056() {
        if (this.f9162 == null) {
            this.f9162 = ((C1941) this.f9160).f7823.entrySet().iterator();
        }
        return this.f9162;
    }
}
