package d2;

/* loaded from: classes.dex */
public class k {

    /* renamed from: b, reason: collision with root package name */
    public static final int f15824b = a1.b.f110s;

    /* renamed from: a, reason: collision with root package name */
    private final a1.b f15825a = new a1.b(new j[16], 0);

    public boolean a(androidx.collection.s sVar, h2.s sVar2, g gVar, boolean z10) {
        a1.b bVar = this.f15825a;
        int q10 = bVar.q();
        if (q10 <= 0) {
            return false;
        }
        Object[] p10 = bVar.p();
        int i10 = 0;
        boolean z11 = false;
        do {
            z11 = ((j) p10[i10]).a(sVar, sVar2, gVar, z10) || z11;
            i10++;
        } while (i10 < q10);
        return z11;
    }

    public void b(g gVar) {
        int q10 = this.f15825a.q();
        while (true) {
            q10--;
            if (-1 >= q10) {
                return;
            }
            if (((j) this.f15825a.p()[q10]).l().g()) {
                this.f15825a.z(q10);
            }
        }
    }

    public final void c() {
        this.f15825a.k();
    }

    public void d() {
        a1.b bVar = this.f15825a;
        int q10 = bVar.q();
        if (q10 > 0) {
            Object[] p10 = bVar.p();
            int i10 = 0;
            do {
                ((j) p10[i10]).d();
                i10++;
            } while (i10 < q10);
        }
    }

    public boolean e(g gVar) {
        a1.b bVar = this.f15825a;
        int q10 = bVar.q();
        boolean z10 = false;
        if (q10 > 0) {
            Object[] p10 = bVar.p();
            int i10 = 0;
            boolean z11 = false;
            do {
                z11 = ((j) p10[i10]).e(gVar) || z11;
                i10++;
            } while (i10 < q10);
            z10 = z11;
        }
        b(gVar);
        return z10;
    }

    public boolean f(androidx.collection.s sVar, h2.s sVar2, g gVar, boolean z10) {
        a1.b bVar = this.f15825a;
        int q10 = bVar.q();
        if (q10 <= 0) {
            return false;
        }
        Object[] p10 = bVar.p();
        int i10 = 0;
        boolean z11 = false;
        do {
            z11 = ((j) p10[i10]).f(sVar, sVar2, gVar, z10) || z11;
            i10++;
        } while (i10 < q10);
        return z11;
    }

    public final a1.b g() {
        return this.f15825a;
    }

    public final void h() {
        int i10 = 0;
        while (i10 < this.f15825a.q()) {
            j jVar = (j) this.f15825a.p()[i10];
            if (jVar.k().O1()) {
                i10++;
                jVar.h();
            } else {
                jVar.d();
                this.f15825a.z(i10);
            }
        }
    }

    public void i(long j10, androidx.collection.e0 e0Var) {
        a1.b bVar = this.f15825a;
        int q10 = bVar.q();
        if (q10 > 0) {
            Object[] p10 = bVar.p();
            int i10 = 0;
            do {
                ((j) p10[i10]).i(j10, e0Var);
                i10++;
            } while (i10 < q10);
        }
    }
}
