package d2;

/* loaded from: classes.dex */
public final class c0 {

    /* renamed from: a, reason: collision with root package name */
    private final j2.g0 f15781a;

    /* renamed from: b, reason: collision with root package name */
    private final f f15782b;

    /* renamed from: c, reason: collision with root package name */
    private final z f15783c = new z();

    /* renamed from: d, reason: collision with root package name */
    private final j2.u f15784d = new j2.u();

    /* renamed from: e, reason: collision with root package name */
    private boolean f15785e;

    public c0(j2.g0 g0Var) {
        this.f15781a = g0Var;
        this.f15782b = new f(g0Var.r());
    }

    public final void a() {
        this.f15782b.b();
    }

    public final int b(a0 a0Var, n0 n0Var, boolean z10) {
        boolean z11;
        if (this.f15785e) {
            return d0.a(false, false);
        }
        boolean z12 = true;
        try {
            this.f15785e = true;
            g b10 = this.f15783c.b(a0Var, n0Var);
            int n10 = b10.b().n();
            for (int i10 = 0; i10 < n10; i10++) {
                y yVar = (y) b10.b().o(i10);
                if (!yVar.i() && !yVar.l()) {
                }
                z11 = false;
                break;
            }
            z11 = true;
            int n11 = b10.b().n();
            for (int i11 = 0; i11 < n11; i11++) {
                y yVar2 = (y) b10.b().o(i11);
                if (z11 || n.b(yVar2)) {
                    j2.g0.y0(this.f15781a, yVar2.h(), this.f15784d, m0.g(yVar2.n(), m0.f15832a.d()), false, 8, null);
                    if (!this.f15784d.isEmpty()) {
                        this.f15782b.a(yVar2.f(), this.f15784d, n.b(yVar2));
                        this.f15784d.clear();
                    }
                }
            }
            this.f15782b.e();
            boolean c10 = this.f15782b.c(b10, z10);
            if (!b10.d()) {
                int n12 = b10.b().n();
                for (int i12 = 0; i12 < n12; i12++) {
                    y yVar3 = (y) b10.b().o(i12);
                    if (n.j(yVar3) && yVar3.p()) {
                        break;
                    }
                }
            }
            z12 = false;
            return d0.a(c10, z12);
        } finally {
            this.f15785e = false;
        }
    }

    public final void c() {
        if (this.f15785e) {
            return;
        }
        this.f15783c.a();
        this.f15782b.d();
    }
}
