package j2;

/* loaded from: classes.dex */
public abstract class d0 {
    /* JADX INFO: Access modifiers changed from: private */
    public static final int b(p0 p0Var, h2.a aVar) {
        p0 r12 = p0Var.r1();
        if (!(r12 != null)) {
            g2.a.b("Child of " + p0Var + " cannot be null when calculating alignment line");
        }
        if (p0Var.A1().h().containsKey(aVar)) {
            Integer num = (Integer) p0Var.A1().h().get(aVar);
            if (num != null) {
                return num.intValue();
            }
            return Integer.MIN_VALUE;
        }
        int u02 = r12.u0(aVar);
        if (u02 == Integer.MIN_VALUE) {
            return Integer.MIN_VALUE;
        }
        r12.P1(true);
        p0Var.O1(true);
        p0Var.N1();
        r12.P1(false);
        p0Var.O1(false);
        return u02 + (aVar instanceof h2.m ? c3.n.i(r12.F1()) : c3.n.h(r12.F1()));
    }
}
