package C3;

import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;

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

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

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public Object f1235r = null;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public Collection f1236s = null;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public Iterator f1237t = L.f1208q;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public final /* synthetic */ T f1238u;

    public C0039a(T t6) {
        this.f1238u = t6;
        this.f1234q = t6.f1219t.entrySet().iterator();
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        return this.f1234q.hasNext() || this.f1237t.hasNext();
    }

    @Override // java.util.Iterator
    public final Object next() {
        if (!this.f1237t.hasNext()) {
            Map.Entry entry = (Map.Entry) this.f1234q.next();
            this.f1235r = entry.getKey();
            Collection collection = (Collection) entry.getValue();
            this.f1236s = collection;
            this.f1237t = collection.iterator();
        }
        return this.f1237t.next();
    }

    @Override // java.util.Iterator
    public final void remove() {
        this.f1237t.remove();
        Collection collection = this.f1236s;
        Objects.requireNonNull(collection);
        if (collection.isEmpty()) {
            this.f1234q.remove();
        }
        T t6 = this.f1238u;
        t6.f1220u--;
    }
}
