package U1;

import java.nio.ByteBuffer;
import java.util.ConcurrentModificationException;
import y4.C3277e;

/* JADX INFO: loaded from: classes.dex */
public abstract class c {

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

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

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

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

    public c() {
        if (u4.c.f24589b == null) {
            u4.c.f24589b = new u4.c(16);
        }
    }

    public int a(int i6) {
        if (i6 < this.f6863c) {
            return ((ByteBuffer) this.f6864d).getShort(this.f6862b + i6);
        }
        return 0;
    }

    public void b() {
        if (((C3277e) this.f6864d).f26223k != this.f6863c) {
            throw new ConcurrentModificationException();
        }
    }

    public void c() {
        while (true) {
            int i6 = this.f6861a;
            C3277e c3277e = (C3277e) this.f6864d;
            if (i6 >= c3277e.f26221f || c3277e.f26218c[i6] >= 0) {
                return;
            } else {
                this.f6861a = i6 + 1;
            }
        }
    }

    public boolean hasNext() {
        return this.f6861a < ((C3277e) this.f6864d).f26221f;
    }

    public void remove() {
        b();
        if (this.f6862b == -1) {
            throw new IllegalStateException("Call next() before removing element from the iterator.");
        }
        C3277e c3277e = (C3277e) this.f6864d;
        c3277e.c();
        c3277e.m(this.f6862b);
        this.f6862b = -1;
        this.f6863c = c3277e.f26223k;
    }
}
