package o;

import java.util.HashSet;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class NP {
    public final C2207q3 a;
    public final C1479iR b = new C1479iR(new C0184Hc[16]);
    public final C1479iR c = new C1479iR(new C3100zZ[16]);
    public final C1479iR d = new C1479iR(new C2420sK[16]);
    public final C1479iR e = new C1479iR(new C3100zZ[16]);
    public boolean f;

    public NP(C2207q3 c2207q3) {
        this.a = c2207q3;
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r4v0 */
    /* JADX WARN: Type inference failed for: r4v1, types: [o.LP] */
    /* JADX WARN: Type inference failed for: r4v10 */
    /* JADX WARN: Type inference failed for: r4v11 */
    /* JADX WARN: Type inference failed for: r4v12 */
    /* JADX WARN: Type inference failed for: r4v13 */
    /* JADX WARN: Type inference failed for: r4v5 */
    /* JADX WARN: Type inference failed for: r4v6, types: [o.LP] */
    /* JADX WARN: Type inference failed for: r4v7, types: [java.lang.Object] */
    /* JADX WARN: Type inference failed for: r4v8 */
    /* JADX WARN: Type inference failed for: r4v9 */
    /* JADX WARN: Type inference failed for: r5v0 */
    /* JADX WARN: Type inference failed for: r5v1 */
    /* JADX WARN: Type inference failed for: r5v10 */
    /* JADX WARN: Type inference failed for: r5v11 */
    /* JADX WARN: Type inference failed for: r5v2 */
    /* JADX WARN: Type inference failed for: r5v3, types: [o.iR] */
    /* JADX WARN: Type inference failed for: r5v4 */
    /* JADX WARN: Type inference failed for: r5v5 */
    /* JADX WARN: Type inference failed for: r5v6, types: [o.iR] */
    /* JADX WARN: Type inference failed for: r5v8 */
    /* JADX WARN: Type inference failed for: r5v9 */
    public static void b(LP lp, C3100zZ c3100zZ, HashSet hashSet) {
        if (!lp.l.y) {
            AbstractC2133pH.b("visitSubtreeIf called on an unattached node");
        }
        C1479iR c1479iR = new C1479iR(new LP[16]);
        LP lp2 = lp.l;
        LP lp3 = lp2.q;
        if (lp3 == null) {
            AbstractC2539te.g(c1479iR, lp2);
        } else {
            c1479iR.b(lp3);
        }
        while (true) {
            int i = c1479iR.n;
            if (i == 0) {
                return;
            }
            LP lp4 = (LP) c1479iR.k(i - 1);
            if ((lp4.f209o & 32) != 0) {
                for (LP lp5 = lp4; lp5 != null; lp5 = lp5.q) {
                    if ((lp5.n & 32) != 0) {
                        AbstractC0561Vq abstractC0561VqI = lp5;
                        ?? c1479iR2 = 0;
                        while (abstractC0561VqI != 0) {
                            if (abstractC0561VqI instanceof OP) {
                                OP op = (OP) abstractC0561VqI;
                                if (op instanceof C0184Hc) {
                                    C0184Hc c0184Hc = (C0184Hc) op;
                                    if ((c0184Hc.z instanceof QH) && c0184Hc.B.contains(c3100zZ)) {
                                        hashSet.add(op);
                                    }
                                }
                                if (op.l().r(c3100zZ)) {
                                    break;
                                }
                            } else if ((abstractC0561VqI.n & 32) != 0 && (abstractC0561VqI instanceof AbstractC0561Vq)) {
                                LP lp6 = abstractC0561VqI.A;
                                int i2 = 0;
                                abstractC0561VqI = abstractC0561VqI;
                                c1479iR2 = c1479iR2;
                                while (lp6 != null) {
                                    if ((lp6.n & 32) != 0) {
                                        i2++;
                                        c1479iR2 = c1479iR2;
                                        if (i2 == 1) {
                                            abstractC0561VqI = lp6;
                                        } else {
                                            if (c1479iR2 == 0) {
                                                c1479iR2 = new C1479iR(new LP[16]);
                                            }
                                            if (abstractC0561VqI != 0) {
                                                c1479iR2.b(abstractC0561VqI);
                                                abstractC0561VqI = 0;
                                            }
                                            c1479iR2.b(lp6);
                                        }
                                    }
                                    lp6 = lp6.q;
                                    abstractC0561VqI = abstractC0561VqI;
                                    c1479iR2 = c1479iR2;
                                }
                                if (i2 == 1) {
                                }
                            }
                            abstractC0561VqI = AbstractC2539te.i(c1479iR2);
                        }
                    }
                }
            }
            AbstractC2539te.g(c1479iR, lp4);
        }
    }

    public final void a() {
        if (this.f) {
            return;
        }
        this.f = true;
        U4 u4 = new U4(14, this);
        UQ uq = this.a.G0;
        if (uq.f(u4) >= 0) {
            return;
        }
        uq.a(u4);
    }
}
