package ld;

import java.util.Iterator;
import java.util.NoSuchElementException;
import kotlin.collections.builders.MapBuilder;

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

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

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public b(MapBuilder mapBuilder, int i10) {
        super(mapBuilder);
        this.f30215d = i10;
        if (i10 == 1) {
            nb.g.i(mapBuilder, "map");
            super(mapBuilder);
        } else if (i10 != 2) {
            nb.g.i(mapBuilder, "map");
        } else {
            nb.g.i(mapBuilder, "map");
            super(mapBuilder);
        }
    }

    @Override // java.util.Iterator
    public final Object next() {
        int i10 = this.f30215d;
        MapBuilder mapBuilder = this.f30218a;
        switch (i10) {
            case 0:
                if (this.f30219b >= mapBuilder.length) {
                    throw new NoSuchElementException();
                }
                int i11 = this.f30219b;
                this.f30219b = i11 + 1;
                this.f30220c = i11;
                c cVar = new c(mapBuilder, i11);
                a();
                return cVar;
            case 1:
                if (this.f30219b >= mapBuilder.length) {
                    throw new NoSuchElementException();
                }
                int i12 = this.f30219b;
                this.f30219b = i12 + 1;
                this.f30220c = i12;
                Object obj = mapBuilder.keysArray[this.f30220c];
                a();
                return obj;
            default:
                if (this.f30219b >= mapBuilder.length) {
                    throw new NoSuchElementException();
                }
                int i13 = this.f30219b;
                this.f30219b = i13 + 1;
                this.f30220c = i13;
                Object[] objArr = mapBuilder.valuesArray;
                nb.g.f(objArr);
                Object obj2 = objArr[this.f30220c];
                a();
                return obj2;
        }
    }
}
