package r;

import java.util.Iterator;
import java.util.NoSuchElementException;
import s4.InterfaceC1015a;

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

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public int f9587k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public int f9588l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public boolean f9589m;

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

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

    public C0962a(int i) {
        this.f9587k = i;
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        return this.f9588l < this.f9587k;
    }

    @Override // java.util.Iterator
    public final Object next() {
        Object objF;
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        int i = this.f9588l;
        switch (this.f9590n) {
            case 0:
                objF = ((C0966e) this.f9591o).f(i);
                break;
            case 1:
                objF = ((C0966e) this.f9591o).i(i);
                break;
            default:
                objF = ((C0967f) this.f9591o).f9601l[i];
                break;
        }
        this.f9588l++;
        this.f9589m = true;
        return objF;
    }

    @Override // java.util.Iterator
    public final void remove() {
        if (!this.f9589m) {
            throw new IllegalStateException("Call next() before removing an element.");
        }
        int i = this.f9588l - 1;
        this.f9588l = i;
        switch (this.f9590n) {
            case 0:
                ((C0966e) this.f9591o).g(i);
                break;
            case 1:
                ((C0966e) this.f9591o).g(i);
                break;
            default:
                ((C0967f) this.f9591o).a(i);
                break;
        }
        this.f9587k--;
        this.f9589m = false;
    }

    /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
    public C0962a(C0967f c0967f) {
        this(c0967f.f9602m);
        this.f9590n = 2;
        this.f9591o = c0967f;
    }

    /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
    public C0962a(C0966e c0966e, int i) {
        this(c0966e.f9618m);
        this.f9590n = i;
        switch (i) {
            case 1:
                this.f9591o = c0966e;
                this(c0966e.f9618m);
                break;
            default:
                this.f9591o = c0966e;
                break;
        }
    }
}
