package hp;

/* loaded from: classes3.dex */
public final class d {

    /* renamed from: a, reason: collision with root package name */
    public static final d f21897a = new d();

    private d() {
    }

    private final boolean a(jp.o oVar, jp.j jVar, jp.j jVar2) {
        if (oVar.j0(jVar) == oVar.j0(jVar2) && oVar.p(jVar) == oVar.p(jVar2)) {
            if ((oVar.Z(jVar) == null) == (oVar.Z(jVar2) == null) && oVar.t0(oVar.d(jVar), oVar.d(jVar2))) {
                if (oVar.J(jVar, jVar2)) {
                    return true;
                }
                int j02 = oVar.j0(jVar);
                for (int i10 = 0; i10 < j02; i10++) {
                    jp.l T = oVar.T(jVar, i10);
                    jp.l T2 = oVar.T(jVar2, i10);
                    if (oVar.R(T) != oVar.R(T2)) {
                        return false;
                    }
                    if (!oVar.R(T) && (oVar.k0(T) != oVar.k0(T2) || !c(oVar, oVar.m0(T), oVar.m0(T2)))) {
                        return false;
                    }
                }
                return true;
            }
        }
        return false;
    }

    private final boolean c(jp.o oVar, jp.i iVar, jp.i iVar2) {
        if (iVar == iVar2) {
            return true;
        }
        jp.j c10 = oVar.c(iVar);
        jp.j c11 = oVar.c(iVar2);
        if (c10 != null && c11 != null) {
            return a(oVar, c10, c11);
        }
        jp.g n10 = oVar.n(iVar);
        jp.g n11 = oVar.n(iVar2);
        if (n10 == null || n11 == null) {
            return false;
        }
        return a(oVar, oVar.f(n10), oVar.f(n11)) && a(oVar, oVar.b(n10), oVar.b(n11));
    }

    public final boolean b(jp.o context, jp.i a10, jp.i b10) {
        kotlin.jvm.internal.t.g(context, "context");
        kotlin.jvm.internal.t.g(a10, "a");
        kotlin.jvm.internal.t.g(b10, "b");
        return c(context, a10, b10);
    }
}
