package o;

import android.view.View;
import android.view.ViewGroup;
import java.util.List;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class R5 extends AbstractC2071oh {
    public final /* synthetic */ int n;

    /* renamed from: o, reason: collision with root package name */
    public final /* synthetic */ ViewGroup f308o;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public /* synthetic */ R5(ViewGroup viewGroup, int i) {
        super(1);
        this.n = i;
        this.f308o = viewGroup;
    }

    @Override // o.AbstractC2071oh
    public final Kl0 f(Kl0 kl0, List list) {
        switch (this.n) {
            case 0:
                return ((Tj0) this.f308o).m(kl0);
            default:
                C0380Or c0380Or = (C0380Or) this.f308o;
                if (c0380Or.w) {
                    return kl0;
                }
                View childAt = c0380Or.getChildAt(0);
                int iMax = Math.max(0, childAt.getLeft());
                int iMax2 = Math.max(0, childAt.getTop());
                int iMax3 = Math.max(0, c0380Or.getWidth() - childAt.getRight());
                int iMax4 = Math.max(0, c0380Or.getHeight() - childAt.getBottom());
                return (iMax == 0 && iMax2 == 0 && iMax3 == 0 && iMax4 == 0) ? kl0 : kl0.a.n(iMax, iMax2, iMax3, iMax4);
        }
    }

    @Override // o.AbstractC2071oh
    public final C3040yr g(C2554tl0 c2554tl0, C3040yr c3040yr) {
        switch (this.n) {
            case 0:
                C2702vH c2702vH = (C2702vH) ((Tj0) this.f308o).J.N.d;
                if (!c2702vH.Z.y) {
                    return c3040yr;
                }
                long jP = As0.P(c2702vH.L(0L));
                int i = (int) (jP >> 32);
                if (i < 0) {
                    i = 0;
                }
                int i2 = (int) (jP & 4294967295L);
                if (i2 < 0) {
                    i2 = 0;
                }
                long jK = AbstractC2841wm0.s(c2702vH).K();
                int i3 = (int) (jK >> 32);
                int i4 = (int) (jK & 4294967295L);
                long j = c2702vH.n;
                long jP2 = As0.P(c2702vH.L((Float.floatToRawIntBits((int) (j >> 32)) << 32) | (Float.floatToRawIntBits((int) (j & 4294967295L)) & 4294967295L)));
                int i5 = i3 - ((int) (jP2 >> 32));
                if (i5 < 0) {
                    i5 = 0;
                }
                int i6 = i4 - ((int) (4294967295L & jP2));
                int i7 = i6 >= 0 ? i6 : 0;
                return (i == 0 && i2 == 0 && i5 == 0 && i7 == 0) ? c3040yr : new C3040yr(14, Z5.l((LH) c3040yr.m, i, i2, i5, i7), Z5.l((LH) c3040yr.n, i, i2, i5, i7));
            default:
                C0380Or c0380Or = (C0380Or) this.f308o;
                if (c0380Or.w) {
                    return c3040yr;
                }
                View childAt = c0380Or.getChildAt(0);
                int iMax = Math.max(0, childAt.getLeft());
                int iMax2 = Math.max(0, childAt.getTop());
                int iMax3 = Math.max(0, c0380Or.getWidth() - childAt.getRight());
                int iMax4 = Math.max(0, c0380Or.getHeight() - childAt.getBottom());
                if (iMax == 0 && iMax2 == 0 && iMax3 == 0 && iMax4 == 0) {
                    return c3040yr;
                }
                LH lhB = LH.b(iMax, iMax2, iMax3, iMax4);
                int i8 = lhB.a;
                LH lh = (LH) c3040yr.m;
                int i9 = lhB.b;
                int i10 = lhB.c;
                int i11 = lhB.d;
                return new C3040yr(14, Kl0.e(lh, i8, i9, i10, i11), Kl0.e((LH) c3040yr.n, i8, i9, i10, i11));
        }
    }
}
