package C3;

import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import n4.u0;
import v0.AbstractC1664c;

/* JADX INFO: renamed from: C3.c, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public class C0041c implements Iterator {

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final /* synthetic */ int f1250q = 0;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final Iterator f1251r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public Object f1252s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public final /* synthetic */ Object f1253t;

    public C0041c(C0050l c0050l) {
        this.f1253t = c0050l;
        Collection collection = c0050l.f1281r;
        this.f1252s = collection;
        this.f1251r = collection instanceof List ? ((List) collection).listIterator() : collection.iterator();
    }

    public void a() {
        C0050l c0050l = (C0050l) this.f1253t;
        c0050l.b();
        if (c0050l.f1281r != ((Collection) this.f1252s)) {
            throw new ConcurrentModificationException();
        }
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        switch (this.f1250q) {
            case u0.f15495q /* 0 */:
                break;
            case 1:
                break;
            default:
                a();
                break;
        }
        return this.f1251r.hasNext();
    }

    @Override // java.util.Iterator
    public final Object next() {
        switch (this.f1250q) {
            case u0.f15495q /* 0 */:
                Map.Entry entry = (Map.Entry) this.f1251r.next();
                this.f1252s = (Collection) entry.getValue();
                return ((C0042d) this.f1253t).a(entry);
            case 1:
                Map.Entry entry2 = (Map.Entry) this.f1251r.next();
                this.f1252s = entry2;
                return entry2.getKey();
            default:
                a();
                return this.f1251r.next();
        }
    }

    @Override // java.util.Iterator
    public final void remove() {
        switch (this.f1250q) {
            case u0.f15495q /* 0 */:
                AbstractC1664c.j("no calls to next() since the last call to remove()", ((Collection) this.f1252s) != null);
                this.f1251r.remove();
                C0042d c0042d = (C0042d) this.f1253t;
                c0042d.f1264t.f1220u -= ((Collection) this.f1252s).size();
                ((Collection) this.f1252s).clear();
                this.f1252s = null;
                break;
            case 1:
                AbstractC1664c.j("no calls to next() since the last call to remove()", ((Map.Entry) this.f1252s) != null);
                Collection collection = (Collection) ((Map.Entry) this.f1252s).getValue();
                this.f1251r.remove();
                C0043e c0043e = (C0043e) this.f1253t;
                c0043e.f1267r.f1220u -= collection.size();
                collection.clear();
                this.f1252s = null;
                break;
            default:
                this.f1251r.remove();
                C0050l c0050l = (C0050l) this.f1253t;
                T t6 = c0050l.f1284u;
                t6.f1220u--;
                c0050l.c();
                break;
        }
    }

    public C0041c(C0050l c0050l, ListIterator listIterator) {
        this.f1253t = c0050l;
        this.f1252s = c0050l.f1281r;
        this.f1251r = listIterator;
    }

    public C0041c(C0043e c0043e, Iterator it) {
        this.f1251r = it;
        this.f1253t = c0043e;
    }

    public C0041c(C0042d c0042d) {
        this.f1253t = c0042d;
        this.f1251r = c0042d.f1263s.entrySet().iterator();
    }
}
