package o;

import androidx.compose.ui.semantics.AppendedSemanticsElement;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.rS, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public abstract class AbstractC2333rS {
    public static final QQ a;

    static {
        QQ qq = AbstractC1097eT.a;
        a = new QQ();
    }

    public static final void a(LP lp, int i, int i2) {
        if (!(lp instanceof AbstractC0561Vq)) {
            b(lp, i & lp.n, i2);
            return;
        }
        AbstractC0561Vq abstractC0561Vq = (AbstractC0561Vq) lp;
        int i3 = abstractC0561Vq.z;
        b(lp, i3 & i, i2);
        int i4 = (~i3) & i;
        for (LP lp2 = abstractC0561Vq.A; lp2 != null; lp2 = lp2.q) {
            a(lp2, i4, i2);
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    public static final void b(LP lp, int i, int i2) {
        if (i2 != 0 || lp.w0()) {
            if ((i & 2) != 0 && (lp instanceof InterfaceC1851mK)) {
                Co0.G((InterfaceC1851mK) lp);
                if (i2 == 2) {
                    AbstractC2539te.Q(lp, 2).c1();
                }
            }
            if ((i & 128) != 0 && (lp instanceof InterfaceC0993dK) && i2 != 2) {
                AbstractC2539te.S(lp).B();
            }
            if ((i & 256) != 0 && (lp instanceof SD)) {
                if (i2 == 1) {
                    C2420sK c2420sKS = AbstractC2539te.S(lp);
                    c2420sKS.W(c2420sKS.W + 1);
                } else if (i2 == 2) {
                    AbstractC2539te.S(lp).W(r0.W - 1);
                }
                if (i2 != 2) {
                    C2420sK c2420sKS2 = AbstractC2539te.S(lp);
                    if (c2420sKS2.W != 0 && !c2420sKS2.n() && !c2420sKS2.o() && !c2420sKS2.V) {
                        C2207q3 c2207q3 = (C2207q3) AbstractC2705vK.a(c2420sKS2);
                        Gm0 gm0 = c2207q3.c0.e;
                        gm0.getClass();
                        if (c2420sKS2.W > 0) {
                            ((C1479iR) gm0.m).b(c2420sKS2);
                            c2420sKS2.V = true;
                        }
                        c2207q3.F(null);
                    }
                }
            }
            if ((i & 4) != 0 && (lp instanceof InterfaceC1905mt)) {
                AbstractC2461sm0.A((InterfaceC1905mt) lp);
            }
            if ((i & 8) != 0 && (lp instanceof P50)) {
                AbstractC2539te.S(lp).B = true;
            }
            if ((i & 64) != 0 && (lp instanceof NV)) {
                C2800wK c2800wK = AbstractC2539te.S((NV) lp).O;
                c2800wK.f773o.z = true;
                C1091eN c1091eN = c2800wK.p;
                if (c1091eN != null) {
                    c1091eN.F = true;
                }
            }
            if ((i & 2048) != 0 && (lp instanceof InterfaceC0887cA)) {
                InterfaceC0887cA interfaceC0887cA = (InterfaceC0887cA) lp;
                C1404hg.b = null;
                interfaceC0887cA.S(C1404hg.a);
                if (C1404hg.b != null) {
                    LP lp2 = (LP) interfaceC0887cA;
                    if (!lp2.l.y) {
                        AbstractC2133pH.b("visitChildren called on an unattached node");
                    }
                    C1479iR c1479iR = new C1479iR(new LP[16]);
                    LP lp3 = lp2.l;
                    LP lp4 = lp3.q;
                    if (lp4 == null) {
                        AbstractC2539te.g(c1479iR, lp3);
                    } else {
                        c1479iR.b(lp4);
                    }
                    while (true) {
                        int i3 = c1479iR.n;
                        if (i3 == 0) {
                            break;
                        }
                        LP lpI = (LP) c1479iR.k(i3 - 1);
                        if ((lpI.f209o & 1024) == 0) {
                            AbstractC2539te.g(c1479iR, lpI);
                        } else {
                            while (true) {
                                if (lpI == null) {
                                    break;
                                }
                                if ((lpI.n & 1024) != 0) {
                                    C1479iR c1479iR2 = null;
                                    while (lpI != null) {
                                        if (lpI instanceof C1556jA) {
                                            C1556jA c1556jA = (C1556jA) lpI;
                                            C0596Wz c0596Wz = ((C0674Zz) ((C2207q3) AbstractC2539te.T(c1556jA)).getFocusOwner()).d;
                                            if (c0596Wz.c.a(c1556jA)) {
                                                c0596Wz.a();
                                            }
                                        } else if ((lpI.n & 1024) != 0 && (lpI instanceof AbstractC0561Vq)) {
                                            int i4 = 0;
                                            for (LP lp5 = ((AbstractC0561Vq) lpI).A; lp5 != null; lp5 = lp5.q) {
                                                if ((lp5.n & 1024) != 0) {
                                                    i4++;
                                                    if (i4 == 1) {
                                                        lpI = lp5;
                                                    } else {
                                                        if (c1479iR2 == null) {
                                                            c1479iR2 = new C1479iR(new LP[16]);
                                                        }
                                                        if (lpI != null) {
                                                            c1479iR2.b(lpI);
                                                            lpI = null;
                                                        }
                                                        c1479iR2.b(lp5);
                                                    }
                                                }
                                            }
                                            if (i4 == 1) {
                                            }
                                        }
                                        lpI = AbstractC2539te.i(c1479iR2);
                                    }
                                } else {
                                    lpI = lpI.q;
                                }
                            }
                        }
                    }
                }
            }
            if ((i & 4096) == 0 || !(lp instanceof InterfaceC0414Pz)) {
                return;
            }
            InterfaceC0414Pz interfaceC0414Pz = (InterfaceC0414Pz) lp;
            C0596Wz c0596Wz2 = ((C0674Zz) ((C2207q3) AbstractC2539te.T(interfaceC0414Pz)).getFocusOwner()).d;
            if (c0596Wz2.d.a(interfaceC0414Pz)) {
                c0596Wz2.a();
            }
        }
    }

    public static final void c(LP lp) {
        if (!lp.y) {
            AbstractC2133pH.b("autoInvalidateUpdatedNode called on unattached node");
        }
        a(lp, -1, 0);
    }

    public static final int d(KP kp) {
        int i = kp instanceof InterfaceC1661kK ? 3 : 1;
        if (kp instanceof C2365rm) {
            i |= 4;
        }
        if (kp instanceof AppendedSemanticsElement) {
            i |= 8;
        }
        if (kp instanceof NX) {
            i |= 16;
        }
        if ((kp instanceof QH) || (kp instanceof QH)) {
            i |= 32;
        }
        if (kp instanceof C2877x6) {
            i |= 64;
        }
        return kp instanceof InterfaceC0134Fe ? 524288 | i : i;
    }

    public static final int e(LP lp) {
        int i = lp.n;
        if (i != 0) {
            return i;
        }
        Class<?> cls = lp.getClass();
        QQ qq = a;
        int iD = qq.d(cls);
        if (iD >= 0) {
            return qq.c[iD];
        }
        int i2 = lp instanceof InterfaceC1851mK ? 3 : 1;
        if (lp instanceof InterfaceC1905mt) {
            i2 |= 4;
        }
        if (lp instanceof P50) {
            i2 |= 8;
        }
        if (lp instanceof LX) {
            i2 |= 16;
        }
        if (lp instanceof OP) {
            i2 |= 32;
        }
        if (lp instanceof NV) {
            i2 |= 64;
        }
        if (lp instanceof InterfaceC0993dK) {
            i2 |= 128;
        }
        if (lp instanceof SD) {
            i2 |= 256;
        }
        if (lp instanceof C1556jA) {
            i2 |= 1024;
        }
        if (lp instanceof InterfaceC0887cA) {
            i2 |= 2048;
        }
        if (lp instanceof InterfaceC0414Pz) {
            i2 |= 4096;
        }
        if (lp instanceof KJ) {
            i2 |= 8192;
        }
        if (lp instanceof C1828m30) {
            i2 |= 16384;
        }
        if (lp instanceof InterfaceC0581Wk) {
            i2 |= 32768;
        }
        if (lp instanceof Xg0) {
            i2 |= 262144;
        }
        if (lp instanceof InterfaceC0134Fe) {
            i2 |= 524288;
        }
        qq.h(i2, cls);
        return i2;
    }

    public static final int f(LP lp) {
        if (!(lp instanceof AbstractC0561Vq)) {
            return e(lp);
        }
        AbstractC0561Vq abstractC0561Vq = (AbstractC0561Vq) lp;
        int iF = abstractC0561Vq.z;
        for (LP lp2 = abstractC0561Vq.A; lp2 != null; lp2 = lp2.q) {
            iF |= f(lp2);
        }
        return iF;
    }

    public static final boolean g(int i) {
        return (i & 128) != 0;
    }
}
