package x4;

import java.util.Iterator;
import java.util.NoSuchElementException;

/* JADX INFO: renamed from: x4.H, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes3.dex */
public final class C3231H implements Iterator, K4.a {

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

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

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

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

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

    public C3231H(C3232I c3232i) {
        this.f26041e = c3232i;
        this.f26039c = c3232i.size();
        this.f26040d = c3232i.f26044c;
    }

    public final boolean a() {
        this.f26037a = 3;
        int i6 = this.f26039c;
        if (i6 == 0) {
            this.f26037a = 2;
        } else {
            C3232I c3232i = this.f26041e;
            Object[] objArr = c3232i.f26042a;
            int i7 = this.f26040d;
            this.f26038b = objArr[i7];
            this.f26037a = 1;
            this.f26040d = (i7 + 1) % c3232i.f26043b;
            this.f26039c = i6 - 1;
        }
        return this.f26037a == 1;
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        int i6 = this.f26037a;
        if (i6 == 0) {
            return a();
        }
        if (i6 == 1) {
            return true;
        }
        if (i6 == 2) {
            return false;
        }
        throw new IllegalArgumentException("hasNext called when the iterator is in the FAILED state.");
    }

    @Override // java.util.Iterator
    public final Object next() {
        int i6 = this.f26037a;
        if (i6 == 1) {
            this.f26037a = 0;
            return this.f26038b;
        }
        if (i6 == 2 || !a()) {
            throw new NoSuchElementException();
        }
        this.f26037a = 0;
        return this.f26038b;
    }

    @Override // java.util.Iterator
    public final void remove() {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }
}
