package F3;

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

/* JADX INFO: renamed from: F3.c, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes3.dex */
public final class C0201c implements Iterator {

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

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public Iterator f1542d = EnumC0202c0.f1545a;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ AbstractC0199b f1543e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final /* synthetic */ int f1544f;

    public C0201c(AbstractC0199b abstractC0199b, int i6) {
        this.f1544f = i6;
        this.f1543e = abstractC0199b;
        this.f1539a = abstractC0199b.f1535e.entrySet().iterator();
    }

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

    @Override // java.util.Iterator
    public final Object next() {
        if (!this.f1542d.hasNext()) {
            Map.Entry entry = (Map.Entry) this.f1539a.next();
            this.f1540b = entry.getKey();
            Collection collection = (Collection) entry.getValue();
            this.f1541c = collection;
            this.f1542d = collection.iterator();
        }
        Object obj = this.f1540b;
        Object next = this.f1542d.next();
        switch (this.f1544f) {
            case 0:
                return next;
            default:
                return new K(obj, next);
        }
    }

    @Override // java.util.Iterator
    public final void remove() {
        this.f1542d.remove();
        Collection collection = this.f1541c;
        Objects.requireNonNull(collection);
        if (collection.isEmpty()) {
            this.f1539a.remove();
        }
        AbstractC0199b abstractC0199b = this.f1543e;
        abstractC0199b.f1536f--;
    }
}
