package C6;

import java.util.Iterator;
import java.util.NoSuchElementException;
import n4.u0;

/* JADX INFO: loaded from: classes.dex */
public final class d extends f implements Iterator, Q6.a {

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

    public d(g gVar, int i) {
        this.f1386u = i;
        P6.g.e(gVar, "map");
        this.f1393t = gVar;
        this.f1391r = -1;
        this.f1392s = gVar.f1404x;
        e();
    }

    @Override // java.util.Iterator
    public final Object next() {
        switch (this.f1386u) {
            case u0.f15495q /* 0 */:
                b();
                int i = this.f1390q;
                g gVar = (g) this.f1393t;
                if (i >= gVar.f1402v) {
                    throw new NoSuchElementException();
                }
                this.f1390q = i + 1;
                this.f1391r = i;
                e eVar = new e(gVar, i);
                e();
                return eVar;
            case 1:
                b();
                int i5 = this.f1390q;
                g gVar2 = (g) this.f1393t;
                if (i5 >= gVar2.f1402v) {
                    throw new NoSuchElementException();
                }
                this.f1390q = i5 + 1;
                this.f1391r = i5;
                Object obj = gVar2.f1397q[i5];
                e();
                return obj;
            default:
                b();
                int i8 = this.f1390q;
                g gVar3 = (g) this.f1393t;
                if (i8 >= gVar3.f1402v) {
                    throw new NoSuchElementException();
                }
                this.f1390q = i8 + 1;
                this.f1391r = i8;
                Object[] objArr = gVar3.f1398r;
                P6.g.b(objArr);
                Object obj2 = objArr[this.f1391r];
                e();
                return obj2;
        }
    }
}
