package defpackage;

import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;

/* JADX INFO: renamed from: ᵘᵫᵡ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public class C2588 implements Iterator {

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

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

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public final Iterator f9995;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public final /* synthetic */ Object f9996;

    public C2588(C0896 c0896, Iterator it) {
        this.f9995 = it;
        this.f9996 = c0896;
    }

    public C2588(C1415 c1415) {
        this.f9996 = c1415;
        this.f9995 = c1415.f5830.entrySet().iterator();
    }

    public C2588(C2285 c2285) {
        this.f9996 = c2285;
        Collection collection = c2285.f8989;
        this.f9994 = collection;
        this.f9995 = collection instanceof List ? ((List) collection).listIterator() : collection.iterator();
    }

    public C2588(C2285 c2285, ListIterator listIterator) {
        this.f9996 = c2285;
        this.f9994 = c2285.f8989;
        this.f9995 = listIterator;
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        switch (this.f9993) {
            case 0:
                break;
            case 1:
                break;
            default:
                m6312();
                break;
        }
        return this.f9995.hasNext();
    }

    @Override // java.util.Iterator
    public final Object next() {
        int i = this.f9993;
        Iterator it = this.f9995;
        switch (i) {
            case 0:
                Map.Entry entry = (Map.Entry) it.next();
                this.f9994 = (Collection) entry.getValue();
                return ((C1415) this.f9996).m4083(entry);
            case 1:
                Map.Entry entry2 = (Map.Entry) it.next();
                this.f9994 = entry2;
                return entry2.getKey();
            default:
                m6312();
                return it.next();
        }
    }

    @Override // java.util.Iterator
    public final void remove() {
        int i = this.f9993;
        Object obj = this.f9996;
        Iterator it = this.f9995;
        switch (i) {
            case 0:
                ᵻᵪ.ˊᵨᵧ("no calls to next() since the last call to remove()", ((Collection) this.f9994) != null);
                it.remove();
                ((C1415) obj).f5832.f12014 -= ((Collection) this.f9994).size();
                ((Collection) this.f9994).clear();
                this.f9994 = null;
                break;
            case 1:
                ᵻᵪ.ˊᵨᵧ("no calls to next() since the last call to remove()", ((Map.Entry) this.f9994) != null);
                Collection collection = (Collection) ((Map.Entry) this.f9994).getValue();
                it.remove();
                ((C0896) obj).f3959.f12014 -= collection.size();
                collection.clear();
                this.f9994 = null;
                break;
            default:
                it.remove();
                C2285 c2285 = (C2285) obj;
                c2285.f8991.f12014--;
                c2285.m5899();
                break;
        }
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public void m6312() {
        C2285 c2285 = (C2285) this.f9996;
        c2285.m5898();
        if (c2285.f8989 != ((Collection) this.f9994)) {
            throw new ConcurrentModificationException();
        }
    }
}
