package androidx.appcompat.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.LinearLayout;
import androidx.annotation.GravityInt;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.core.view.s1;
import d.j;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import l.f4;
import l.p3;
import l.z1;

/* JADX INFO: loaded from: classes.dex */
public class LinearLayoutCompat extends ViewGroup {
    public int Q;
    public int R;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public boolean f711a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int f712b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f713c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public int f714d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public int f715e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public int f716f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public float f717g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public boolean f718h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public int[] f719i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public int[] f720j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public Drawable f721k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public int f722l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public int f723m;

    @Retention(RetentionPolicy.SOURCE)
    @RestrictTo({RestrictTo.Scope.f557c})
    public @interface DividerMode {
    }

    @Retention(RetentionPolicy.SOURCE)
    @RestrictTo({RestrictTo.Scope.f557c})
    public @interface OrientationMode {
    }

    public LinearLayoutCompat(@NonNull Context context) {
        this(context, null);
    }

    @Override // android.view.ViewGroup
    public boolean checkLayoutParams(ViewGroup.LayoutParams layoutParams) {
        return layoutParams instanceof z1;
    }

    public final void f(Canvas canvas, int i10) {
        this.f721k.setBounds(getPaddingLeft() + this.R, i10, (getWidth() - getPaddingRight()) - this.R, this.f723m + i10);
        this.f721k.draw(canvas);
    }

    public final void g(Canvas canvas, int i10) {
        this.f721k.setBounds(i10, getPaddingTop() + this.R, this.f722l + i10, (getHeight() - getPaddingBottom()) - this.R);
        this.f721k.draw(canvas);
    }

    @Override // android.view.View
    public int getBaseline() {
        int i10;
        if (this.f712b < 0) {
            return super.getBaseline();
        }
        int childCount = getChildCount();
        int i11 = this.f712b;
        if (childCount <= i11) {
            throw new RuntimeException("mBaselineAlignedChildIndex of LinearLayout set to an index that is out of bounds.");
        }
        View childAt = getChildAt(i11);
        int baseline = childAt.getBaseline();
        if (baseline == -1) {
            if (this.f712b == 0) {
                return -1;
            }
            throw new RuntimeException("mBaselineAlignedChildIndex of LinearLayout points to a View that doesn't know how to get its baseline.");
        }
        int bottom = this.f713c;
        if (this.f714d == 1 && (i10 = this.f715e & 112) != 48) {
            if (i10 == 16) {
                bottom += ((((getBottom() - getTop()) - getPaddingTop()) - getPaddingBottom()) - this.f716f) / 2;
            } else if (i10 == 80) {
                bottom = ((getBottom() - getTop()) - getPaddingBottom()) - this.f716f;
            }
        }
        return bottom + ((LinearLayout.LayoutParams) ((z1) childAt.getLayoutParams())).topMargin + baseline;
    }

    public int getBaselineAlignedChildIndex() {
        return this.f712b;
    }

    public Drawable getDividerDrawable() {
        return this.f721k;
    }

    public int getDividerPadding() {
        return this.R;
    }

    @RestrictTo({RestrictTo.Scope.f557c})
    public int getDividerWidth() {
        return this.f722l;
    }

    @GravityInt
    public int getGravity() {
        return this.f715e;
    }

    public int getOrientation() {
        return this.f714d;
    }

    public int getShowDividers() {
        return this.Q;
    }

    public int getVirtualChildCount() {
        return getChildCount();
    }

    public float getWeightSum() {
        return this.f717g;
    }

    @Override // android.view.ViewGroup
    /* JADX INFO: renamed from: h, reason: merged with bridge method [inline-methods] */
    public z1 generateDefaultLayoutParams() {
        int i10 = this.f714d;
        if (i10 == 0) {
            return new z1(-2, -2);
        }
        if (i10 == 1) {
            return new z1(-1, -2);
        }
        return null;
    }

    @Override // android.view.ViewGroup
    /* JADX INFO: renamed from: i, reason: merged with bridge method [inline-methods] */
    public z1 generateLayoutParams(AttributeSet attributeSet) {
        return new z1(getContext(), attributeSet);
    }

    @Override // android.view.ViewGroup
    /* JADX INFO: renamed from: j, reason: merged with bridge method [inline-methods] */
    public z1 generateLayoutParams(ViewGroup.LayoutParams layoutParams) {
        return layoutParams instanceof z1 ? new z1((z1) layoutParams) : layoutParams instanceof ViewGroup.MarginLayoutParams ? new z1((ViewGroup.MarginLayoutParams) layoutParams) : new z1(layoutParams);
    }

    public final boolean k(int i10) {
        if (i10 == 0) {
            return (this.Q & 1) != 0;
        }
        if (i10 == getChildCount()) {
            return (this.Q & 4) != 0;
        }
        if ((this.Q & 2) == 0) {
            return false;
        }
        for (int i11 = i10 - 1; i11 >= 0; i11--) {
            if (getChildAt(i11).getVisibility() != 8) {
                return true;
            }
        }
        return false;
    }

    @Override // android.view.View
    public final void onDraw(Canvas canvas) {
        int right;
        int left;
        int i10;
        if (this.f721k == null) {
            return;
        }
        int i11 = 0;
        if (this.f714d == 1) {
            int virtualChildCount = getVirtualChildCount();
            while (i11 < virtualChildCount) {
                View childAt = getChildAt(i11);
                if (childAt != null && childAt.getVisibility() != 8 && k(i11)) {
                    f(canvas, (childAt.getTop() - ((LinearLayout.LayoutParams) ((z1) childAt.getLayoutParams())).topMargin) - this.f723m);
                }
                i11++;
            }
            if (k(virtualChildCount)) {
                View childAt2 = getChildAt(virtualChildCount - 1);
                f(canvas, childAt2 == null ? (getHeight() - getPaddingBottom()) - this.f723m : childAt2.getBottom() + ((LinearLayout.LayoutParams) ((z1) childAt2.getLayoutParams())).bottomMargin);
                return;
            }
            return;
        }
        int virtualChildCount2 = getVirtualChildCount();
        boolean z10 = f4.f29682a;
        boolean z11 = getLayoutDirection() == 1;
        while (i11 < virtualChildCount2) {
            View childAt3 = getChildAt(i11);
            if (childAt3 != null && childAt3.getVisibility() != 8 && k(i11)) {
                z1 z1Var = (z1) childAt3.getLayoutParams();
                g(canvas, z11 ? childAt3.getRight() + ((LinearLayout.LayoutParams) z1Var).rightMargin : (childAt3.getLeft() - ((LinearLayout.LayoutParams) z1Var).leftMargin) - this.f722l);
            }
            i11++;
        }
        if (k(virtualChildCount2)) {
            View childAt4 = getChildAt(virtualChildCount2 - 1);
            if (childAt4 != null) {
                z1 z1Var2 = (z1) childAt4.getLayoutParams();
                if (z11) {
                    left = childAt4.getLeft() - ((LinearLayout.LayoutParams) z1Var2).leftMargin;
                    i10 = this.f722l;
                    right = left - i10;
                } else {
                    right = childAt4.getRight() + ((LinearLayout.LayoutParams) z1Var2).rightMargin;
                }
            } else if (z11) {
                right = getPaddingLeft();
            } else {
                left = getWidth() - getPaddingRight();
                i10 = this.f722l;
                right = left - i10;
            }
            g(canvas, right);
        }
    }

    @Override // android.view.View
    public final void onInitializeAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
        super.onInitializeAccessibilityEvent(accessibilityEvent);
        accessibilityEvent.setClassName("androidx.appcompat.widget.LinearLayoutCompat");
    }

    @Override // android.view.View
    public final void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
        super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
        accessibilityNodeInfo.setClassName("androidx.appcompat.widget.LinearLayoutCompat");
    }

    /* JADX WARN: Removed duplicated region for block: B:29:0x0099  */
    /* JADX WARN: Removed duplicated region for block: B:62:0x0158  */
    /* JADX WARN: Removed duplicated region for block: B:65:0x0161  */
    /* JADX WARN: Removed duplicated region for block: B:77:0x0193  */
    /* JADX WARN: Removed duplicated region for block: B:80:0x01a7  */
    @Override // android.view.ViewGroup, android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void onLayout(boolean z10, int i10, int i11, int i12, int i13) {
        int i14;
        int i15;
        int i16;
        int i17;
        int i18;
        int i19;
        int i20;
        int i21;
        int measuredHeight;
        int i22;
        int i23;
        int i24;
        int i25 = 8;
        if (this.f714d == 1) {
            int paddingLeft = getPaddingLeft();
            int i26 = i12 - i10;
            int paddingRight = i26 - getPaddingRight();
            int paddingRight2 = (i26 - paddingLeft) - getPaddingRight();
            int virtualChildCount = getVirtualChildCount();
            int i27 = this.f715e;
            int i28 = i27 & 112;
            int i29 = 8388615 & i27;
            int paddingTop = i28 != 16 ? i28 != 80 ? getPaddingTop() : ((getPaddingTop() + i13) - i11) - this.f716f : getPaddingTop() + (((i13 - i11) - this.f716f) / 2);
            int i30 = 0;
            while (i30 < virtualChildCount) {
                View childAt = getChildAt(i30);
                if (childAt != null && childAt.getVisibility() != i25) {
                    int measuredWidth = childAt.getMeasuredWidth();
                    int measuredHeight2 = childAt.getMeasuredHeight();
                    z1 z1Var = (z1) childAt.getLayoutParams();
                    int i31 = ((LinearLayout.LayoutParams) z1Var).gravity;
                    if (i31 < 0) {
                        i31 = i29;
                    }
                    int absoluteGravity = Gravity.getAbsoluteGravity(i31, getLayoutDirection()) & 7;
                    if (absoluteGravity == 1) {
                        i22 = ((paddingRight2 - measuredWidth) / 2) + paddingLeft + ((LinearLayout.LayoutParams) z1Var).leftMargin;
                        i23 = ((LinearLayout.LayoutParams) z1Var).rightMargin;
                    } else if (absoluteGravity != 5) {
                        i24 = ((LinearLayout.LayoutParams) z1Var).leftMargin + paddingLeft;
                        if (k(i30)) {
                            paddingTop += this.f723m;
                        }
                        int i32 = paddingTop + ((LinearLayout.LayoutParams) z1Var).topMargin;
                        childAt.layout(i24, i32, measuredWidth + i24, i32 + measuredHeight2);
                        paddingTop = measuredHeight2 + ((LinearLayout.LayoutParams) z1Var).bottomMargin + i32;
                    } else {
                        i22 = paddingRight - measuredWidth;
                        i23 = ((LinearLayout.LayoutParams) z1Var).rightMargin;
                    }
                    i24 = i22 - i23;
                    if (k(i30)) {
                    }
                    int i322 = paddingTop + ((LinearLayout.LayoutParams) z1Var).topMargin;
                    childAt.layout(i24, i322, measuredWidth + i24, i322 + measuredHeight2);
                    paddingTop = measuredHeight2 + ((LinearLayout.LayoutParams) z1Var).bottomMargin + i322;
                }
                i30++;
                i25 = 8;
            }
            return;
        }
        boolean z11 = f4.f29682a;
        boolean z12 = getLayoutDirection() == 1;
        int paddingTop2 = getPaddingTop();
        int i33 = i13 - i11;
        int paddingBottom = i33 - getPaddingBottom();
        int paddingBottom2 = (i33 - paddingTop2) - getPaddingBottom();
        int virtualChildCount2 = getVirtualChildCount();
        int i34 = this.f715e;
        int i35 = 8388615 & i34;
        int i36 = i34 & 112;
        boolean z13 = this.f711a;
        int[] iArr = this.f719i;
        int[] iArr2 = this.f720j;
        int absoluteGravity2 = Gravity.getAbsoluteGravity(i35, getLayoutDirection());
        int paddingLeft2 = absoluteGravity2 != 1 ? absoluteGravity2 != 5 ? getPaddingLeft() : ((getPaddingLeft() + i12) - i10) - this.f716f : getPaddingLeft() + (((i12 - i10) - this.f716f) / 2);
        if (z12) {
            i15 = virtualChildCount2 - 1;
            i14 = -1;
        } else {
            i14 = 1;
            i15 = 0;
        }
        int i37 = 0;
        while (i37 < virtualChildCount2) {
            int i38 = (i14 * i37) + i15;
            View childAt2 = getChildAt(i38);
            if (childAt2 == null) {
                i16 = i15;
            } else {
                i16 = i15;
                if (childAt2.getVisibility() != 8) {
                    int measuredWidth2 = childAt2.getMeasuredWidth();
                    int measuredHeight3 = childAt2.getMeasuredHeight();
                    z1 z1Var2 = (z1) childAt2.getLayoutParams();
                    i17 = i14;
                    if (z13) {
                        i18 = virtualChildCount2;
                        int baseline = ((LinearLayout.LayoutParams) z1Var2).height != -1 ? childAt2.getBaseline() : -1;
                        i19 = ((LinearLayout.LayoutParams) z1Var2).gravity;
                        if (i19 < 0) {
                            i19 = i36;
                        }
                        i20 = i19 & 112;
                        i21 = i36;
                        if (i20 != 16) {
                            measuredHeight = ((((paddingBottom2 - measuredHeight3) / 2) + paddingTop2) + ((LinearLayout.LayoutParams) z1Var2).topMargin) - ((LinearLayout.LayoutParams) z1Var2).bottomMargin;
                        } else if (i20 == 48) {
                            measuredHeight = ((LinearLayout.LayoutParams) z1Var2).topMargin + paddingTop2;
                            if (baseline != -1) {
                                measuredHeight = (iArr[1] - baseline) + measuredHeight;
                            }
                        } else if (i20 != 80) {
                            measuredHeight = paddingTop2;
                        } else {
                            measuredHeight = (paddingBottom - measuredHeight3) - ((LinearLayout.LayoutParams) z1Var2).bottomMargin;
                            if (baseline != -1) {
                                measuredHeight -= iArr2[2] - (childAt2.getMeasuredHeight() - baseline);
                            }
                        }
                        if (k(i38)) {
                            paddingLeft2 += this.f722l;
                        }
                        int i39 = paddingLeft2 + ((LinearLayout.LayoutParams) z1Var2).leftMargin;
                        childAt2.layout(i39, measuredHeight, i39 + measuredWidth2, measuredHeight + measuredHeight3);
                        paddingLeft2 = measuredWidth2 + ((LinearLayout.LayoutParams) z1Var2).rightMargin + i39;
                    } else {
                        i18 = virtualChildCount2;
                    }
                    i19 = ((LinearLayout.LayoutParams) z1Var2).gravity;
                    if (i19 < 0) {
                    }
                    i20 = i19 & 112;
                    i21 = i36;
                    if (i20 != 16) {
                    }
                    if (k(i38)) {
                    }
                    int i392 = paddingLeft2 + ((LinearLayout.LayoutParams) z1Var2).leftMargin;
                    childAt2.layout(i392, measuredHeight, i392 + measuredWidth2, measuredHeight + measuredHeight3);
                    paddingLeft2 = measuredWidth2 + ((LinearLayout.LayoutParams) z1Var2).rightMargin + i392;
                }
                i37++;
                i15 = i16;
                i14 = i17;
                virtualChildCount2 = i18;
                i36 = i21;
            }
            i17 = i14;
            i18 = virtualChildCount2;
            i21 = i36;
            i37++;
            i15 = i16;
            i14 = i17;
            virtualChildCount2 = i18;
            i36 = i21;
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:153:0x02f4  */
    /* JADX WARN: Removed duplicated region for block: B:213:0x0486  */
    /* JADX WARN: Removed duplicated region for block: B:214:0x048b  */
    /* JADX WARN: Removed duplicated region for block: B:217:0x04b3  */
    /* JADX WARN: Removed duplicated region for block: B:218:0x04b8  */
    /* JADX WARN: Removed duplicated region for block: B:221:0x04c0  */
    /* JADX WARN: Removed duplicated region for block: B:222:0x04cc  */
    /* JADX WARN: Removed duplicated region for block: B:224:0x04de  */
    /* JADX WARN: Removed duplicated region for block: B:230:0x04f2  */
    /* JADX WARN: Removed duplicated region for block: B:240:0x0537  */
    /* JADX WARN: Removed duplicated region for block: B:246:0x0548  */
    /* JADX WARN: Removed duplicated region for block: B:249:0x0550  */
    /* JADX WARN: Removed duplicated region for block: B:252:0x055b  */
    /* JADX WARN: Removed duplicated region for block: B:280:0x05e4  */
    /* JADX WARN: Removed duplicated region for block: B:313:0x0691  */
    /* JADX WARN: Removed duplicated region for block: B:315:0x0698  */
    /* JADX WARN: Removed duplicated region for block: B:318:0x06b4  */
    /* JADX WARN: Removed duplicated region for block: B:368:0x07cb  */
    /* JADX WARN: Removed duplicated region for block: B:381:0x0806  */
    /* JADX WARN: Removed duplicated region for block: B:388:0x083d  */
    /* JADX WARN: Removed duplicated region for block: B:391:0x0860  */
    /* JADX WARN: Removed duplicated region for block: B:442:? A[RETURN, SYNTHETIC] */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void onMeasure(int i10, int i11) {
        char c6;
        int i12;
        int iMax;
        float f10;
        int i13;
        int i14;
        int i15;
        int i16;
        char c10;
        int i17;
        int i18;
        int i19;
        int i20;
        float f11;
        int i21;
        int i22;
        int baseline;
        int i23;
        int i24;
        float f12;
        int i25;
        int i26;
        int i27;
        int i28;
        int i29;
        boolean z10;
        boolean z11;
        z1 z1Var;
        boolean z12;
        int i30;
        boolean z13;
        int i31;
        int i32;
        int baseline2;
        int i33;
        int i34;
        int i35;
        int i36;
        int i37;
        int i38;
        int i39;
        int i40;
        int i41;
        int i42;
        boolean z14;
        z1 z1Var2;
        boolean z15;
        int i43;
        boolean z16;
        int iMax2;
        int i44 = -2;
        int i45 = 1073741824;
        int i46 = 8;
        int i47 = Integer.MIN_VALUE;
        float f13 = 0.0f;
        boolean z17 = true;
        if (this.f714d == 1) {
            this.f716f = 0;
            int virtualChildCount = getVirtualChildCount();
            int mode = View.MeasureSpec.getMode(i10);
            int mode2 = View.MeasureSpec.getMode(i11);
            int i48 = this.f712b;
            boolean z18 = this.f718h;
            boolean z19 = true;
            int i49 = 0;
            int iMax3 = 0;
            int iMax4 = 0;
            boolean z20 = false;
            int iMax5 = 0;
            int i50 = 0;
            int i51 = 0;
            boolean z21 = false;
            float f14 = 0.0f;
            while (i49 < virtualChildCount) {
                View childAt = getChildAt(i49);
                if (childAt == null) {
                    this.f716f = this.f716f;
                } else {
                    if (childAt.getVisibility() != i46) {
                        if (k(i49)) {
                            this.f716f += this.f723m;
                        }
                        z1 z1Var3 = (z1) childAt.getLayoutParams();
                        float f15 = ((LinearLayout.LayoutParams) z1Var3).weight;
                        f14 += f15;
                        if (mode2 == i45 && ((LinearLayout.LayoutParams) z1Var3).height == 0 && f15 > f13) {
                            int i52 = this.f716f;
                            this.f716f = Math.max(i52, ((LinearLayout.LayoutParams) z1Var3).topMargin + i52 + ((LinearLayout.LayoutParams) z1Var3).bottomMargin);
                            i38 = i48;
                            i40 = mode2;
                            i41 = mode;
                            i42 = virtualChildCount;
                            z1Var2 = z1Var3;
                            z15 = true;
                            z14 = true;
                        } else {
                            if (((LinearLayout.LayoutParams) z1Var3).height != 0 || f15 <= f13) {
                                i37 = i47;
                            } else {
                                ((LinearLayout.LayoutParams) z1Var3).height = i44;
                                i37 = 0;
                            }
                            if (f14 == f13) {
                                i39 = this.f716f;
                                i38 = i48;
                            } else {
                                i38 = i48;
                                i39 = 0;
                            }
                            i40 = mode2;
                            i41 = mode;
                            i42 = virtualChildCount;
                            z14 = true;
                            z1Var2 = z1Var3;
                            measureChildWithMargins(childAt, i10, 0, i11, i39);
                            if (i37 != i47) {
                                ((LinearLayout.LayoutParams) z1Var2).height = i37;
                            }
                            int measuredHeight = childAt.getMeasuredHeight();
                            int i53 = this.f716f;
                            this.f716f = Math.max(i53, i53 + measuredHeight + ((LinearLayout.LayoutParams) z1Var2).topMargin + ((LinearLayout.LayoutParams) z1Var2).bottomMargin);
                            int i54 = iMax5;
                            if (z18) {
                                iMax5 = Math.max(measuredHeight, i54);
                            }
                            z15 = z20;
                        }
                        if (i38 >= 0 && i38 == i49 + 1) {
                            this.f713c = this.f716f;
                        }
                        if (i49 < i38 && ((LinearLayout.LayoutParams) z1Var2).weight > 0.0f) {
                            throw new RuntimeException("A child of LinearLayout with index less than mBaselineAlignedChildIndex has weight > 0, which won't work.  Either remove the weight, or don't set mBaselineAlignedChildIndex.");
                        }
                        i43 = i41;
                        if (i43 == 1073741824 || ((LinearLayout.LayoutParams) z1Var2).width != -1) {
                            z16 = false;
                        } else {
                            z16 = z14;
                            z21 = z16;
                        }
                        int i55 = ((LinearLayout.LayoutParams) z1Var2).leftMargin + ((LinearLayout.LayoutParams) z1Var2).rightMargin;
                        int measuredWidth = childAt.getMeasuredWidth() + i55;
                        iMax2 = Math.max(i50, measuredWidth);
                        int iCombineMeasuredStates = View.combineMeasuredStates(i51, childAt.getMeasuredState());
                        boolean z22 = (z19 && ((LinearLayout.LayoutParams) z1Var2).width == -1) ? z14 : false;
                        if (((LinearLayout.LayoutParams) z1Var2).weight > 0.0f) {
                            if (!z16) {
                                i55 = measuredWidth;
                            }
                            iMax4 = Math.max(iMax4, i55);
                        } else {
                            int i56 = iMax4;
                            if (!z16) {
                                i55 = measuredWidth;
                            }
                            iMax3 = Math.max(iMax3, i55);
                            iMax4 = i56;
                        }
                        z20 = z15;
                        i51 = iCombineMeasuredStates;
                        z19 = z22;
                    }
                    i49++;
                    mode = i43;
                    i50 = iMax2;
                    i48 = i38;
                    z17 = z14;
                    mode2 = i40;
                    virtualChildCount = i42;
                    i44 = -2;
                    i45 = 1073741824;
                    i46 = 8;
                    i47 = Integer.MIN_VALUE;
                    f13 = 0.0f;
                }
                i38 = i48;
                i40 = mode2;
                i43 = mode;
                i42 = virtualChildCount;
                iMax2 = i50;
                z14 = true;
                i49++;
                mode = i43;
                i50 = iMax2;
                i48 = i38;
                z17 = z14;
                mode2 = i40;
                virtualChildCount = i42;
                i44 = -2;
                i45 = 1073741824;
                i46 = 8;
                i47 = Integer.MIN_VALUE;
                f13 = 0.0f;
            }
            int i57 = mode2;
            int i58 = mode;
            int i59 = virtualChildCount;
            boolean z23 = z17;
            int iMax6 = iMax3;
            int i60 = iMax4;
            int i61 = iMax5;
            int i62 = i50;
            int iCombineMeasuredStates2 = i51;
            if (this.f716f > 0 && k(i59)) {
                this.f716f += this.f723m;
            }
            int i63 = i57;
            if (z18 && (i63 == Integer.MIN_VALUE || i63 == 0)) {
                this.f716f = 0;
                for (int i64 = 0; i64 < i59; i64++) {
                    View childAt2 = getChildAt(i64);
                    if (childAt2 == null) {
                        this.f716f = this.f716f;
                    } else if (childAt2.getVisibility() != 8) {
                        z1 z1Var4 = (z1) childAt2.getLayoutParams();
                        int i65 = this.f716f;
                        this.f716f = Math.max(i65, i65 + i61 + ((LinearLayout.LayoutParams) z1Var4).topMargin + ((LinearLayout.LayoutParams) z1Var4).bottomMargin);
                    }
                }
            }
            int paddingBottom = getPaddingBottom() + getPaddingTop() + this.f716f;
            this.f716f = paddingBottom;
            int iResolveSizeAndState = View.resolveSizeAndState(Math.max(paddingBottom, getSuggestedMinimumHeight()), i11, 0);
            int i66 = (16777215 & iResolveSizeAndState) - this.f716f;
            if (z20 || (i66 != 0 && f14 > 0.0f)) {
                float f16 = this.f717g;
                if (f16 > 0.0f) {
                    f14 = f16;
                }
                this.f716f = 0;
                int i67 = 0;
                while (i67 < i59) {
                    View childAt3 = getChildAt(i67);
                    if (childAt3.getVisibility() == 8) {
                        i34 = i63;
                    } else {
                        z1 z1Var5 = (z1) childAt3.getLayoutParams();
                        float f17 = ((LinearLayout.LayoutParams) z1Var5).weight;
                        if (f17 > 0.0f) {
                            int i68 = (int) ((i66 * f17) / f14);
                            f14 -= f17;
                            int i69 = i66 - i68;
                            int childMeasureSpec = ViewGroup.getChildMeasureSpec(i10, getPaddingRight() + getPaddingLeft() + ((LinearLayout.LayoutParams) z1Var5).leftMargin + ((LinearLayout.LayoutParams) z1Var5).rightMargin, ((LinearLayout.LayoutParams) z1Var5).width);
                            if (((LinearLayout.LayoutParams) z1Var5).height == 0) {
                                i36 = 1073741824;
                                if (i63 == 1073741824) {
                                    if (i68 <= 0) {
                                        i68 = 0;
                                    }
                                    childAt3.measure(childMeasureSpec, View.MeasureSpec.makeMeasureSpec(i68, 1073741824));
                                }
                                iCombineMeasuredStates2 = View.combineMeasuredStates(iCombineMeasuredStates2, childAt3.getMeasuredState() & (-256));
                                i66 = i69;
                            } else {
                                i36 = 1073741824;
                            }
                            int measuredHeight2 = childAt3.getMeasuredHeight() + i68;
                            if (measuredHeight2 < 0) {
                                measuredHeight2 = 0;
                            }
                            childAt3.measure(childMeasureSpec, View.MeasureSpec.makeMeasureSpec(measuredHeight2, i36));
                            iCombineMeasuredStates2 = View.combineMeasuredStates(iCombineMeasuredStates2, childAt3.getMeasuredState() & (-256));
                            i66 = i69;
                        }
                        int i70 = ((LinearLayout.LayoutParams) z1Var5).leftMargin + ((LinearLayout.LayoutParams) z1Var5).rightMargin;
                        int measuredWidth2 = childAt3.getMeasuredWidth() + i70;
                        int iMax7 = Math.max(i62, measuredWidth2);
                        if (i58 != 1073741824) {
                            i34 = i63;
                            i35 = -1;
                            if (((LinearLayout.LayoutParams) z1Var5).width != -1) {
                            }
                            iMax6 = Math.max(iMax6, i70);
                            boolean z24 = (z19 || ((LinearLayout.LayoutParams) z1Var5).width != i35) ? false : z23;
                            int i71 = this.f716f;
                            this.f716f = Math.max(i71, childAt3.getMeasuredHeight() + i71 + ((LinearLayout.LayoutParams) z1Var5).topMargin + ((LinearLayout.LayoutParams) z1Var5).bottomMargin);
                            z19 = z24;
                            i62 = iMax7;
                        } else {
                            i34 = i63;
                            i35 = -1;
                        }
                        i70 = measuredWidth2;
                        iMax6 = Math.max(iMax6, i70);
                        if (z19) {
                            int i712 = this.f716f;
                            this.f716f = Math.max(i712, childAt3.getMeasuredHeight() + i712 + ((LinearLayout.LayoutParams) z1Var5).topMargin + ((LinearLayout.LayoutParams) z1Var5).bottomMargin);
                            z19 = z24;
                            i62 = iMax7;
                        }
                    }
                    i67++;
                    i63 = i34;
                }
                this.f716f = getPaddingBottom() + getPaddingTop() + this.f716f;
            } else {
                iMax6 = Math.max(iMax6, i60);
                if (z18 && i63 != 1073741824) {
                    for (int i72 = 0; i72 < i59; i72++) {
                        View childAt4 = getChildAt(i72);
                        if (childAt4 != null && childAt4.getVisibility() != 8 && ((LinearLayout.LayoutParams) ((z1) childAt4.getLayoutParams())).weight > 0.0f) {
                            childAt4.measure(View.MeasureSpec.makeMeasureSpec(childAt4.getMeasuredWidth(), 1073741824), View.MeasureSpec.makeMeasureSpec(i61, 1073741824));
                        }
                    }
                }
            }
            int i73 = i62;
            if (z19 || i58 == 1073741824) {
                iMax6 = i73;
            }
            setMeasuredDimension(View.resolveSizeAndState(Math.max(getPaddingRight() + getPaddingLeft() + iMax6, getSuggestedMinimumWidth()), i10, iCombineMeasuredStates2), iResolveSizeAndState);
            if (z21) {
                int iMakeMeasureSpec = View.MeasureSpec.makeMeasureSpec(getMeasuredWidth(), 1073741824);
                for (int i74 = 0; i74 < i59; i74++) {
                    View childAt5 = getChildAt(i74);
                    if (childAt5.getVisibility() != 8) {
                        z1 z1Var6 = (z1) childAt5.getLayoutParams();
                        if (((LinearLayout.LayoutParams) z1Var6).width == -1) {
                            int i75 = ((LinearLayout.LayoutParams) z1Var6).height;
                            ((LinearLayout.LayoutParams) z1Var6).height = childAt5.getMeasuredHeight();
                            measureChildWithMargins(childAt5, iMakeMeasureSpec, 0, i11, 0);
                            ((LinearLayout.LayoutParams) z1Var6).height = i75;
                        }
                    }
                }
                return;
            }
            return;
        }
        this.f716f = 0;
        int virtualChildCount2 = getVirtualChildCount();
        int mode3 = View.MeasureSpec.getMode(i10);
        int mode4 = View.MeasureSpec.getMode(i11);
        if (this.f719i == null || this.f720j == null) {
            this.f719i = new int[4];
            this.f720j = new int[4];
        }
        int[] iArr = this.f719i;
        int[] iArr2 = this.f720j;
        iArr[3] = -1;
        iArr[2] = -1;
        iArr[1] = -1;
        iArr[0] = -1;
        iArr2[3] = -1;
        iArr2[2] = -1;
        iArr2[1] = -1;
        iArr2[0] = -1;
        boolean z25 = this.f711a;
        boolean z26 = this.f718h;
        boolean z27 = mode3 == 1073741824;
        boolean z28 = true;
        int iMax8 = 0;
        float f18 = 0.0f;
        int i76 = 0;
        int i77 = 0;
        int i78 = 0;
        int iMax9 = 0;
        int iMax10 = 0;
        boolean z29 = false;
        boolean z30 = false;
        while (i77 < virtualChildCount2) {
            View childAt6 = getChildAt(i77);
            if (childAt6 == null) {
                this.f716f = this.f716f;
                i29 = i77;
                z10 = z26;
                z11 = z25;
            } else {
                int i79 = iMax8;
                int i80 = i76;
                if (childAt6.getVisibility() == 8) {
                    z11 = z25;
                    iMax8 = i79;
                    i76 = i80;
                    i29 = i77;
                    z10 = z26;
                } else {
                    if (k(i77)) {
                        this.f716f += this.f722l;
                    }
                    z1 z1Var7 = (z1) childAt6.getLayoutParams();
                    float f19 = ((LinearLayout.LayoutParams) z1Var7).weight;
                    float f20 = f18 + f19;
                    if (mode3 == 1073741824 && ((LinearLayout.LayoutParams) z1Var7).width == 0 && f19 > 0.0f) {
                        if (z27) {
                            i33 = i77;
                            this.f716f = ((LinearLayout.LayoutParams) z1Var7).leftMargin + ((LinearLayout.LayoutParams) z1Var7).rightMargin + this.f716f;
                        } else {
                            i33 = i77;
                            int i81 = this.f716f;
                            this.f716f = Math.max(i81, ((LinearLayout.LayoutParams) z1Var7).leftMargin + i81 + ((LinearLayout.LayoutParams) z1Var7).rightMargin);
                        }
                        if (z25) {
                            int iMakeMeasureSpec2 = View.MeasureSpec.makeMeasureSpec(0, 0);
                            childAt6.measure(iMakeMeasureSpec2, iMakeMeasureSpec2);
                            z1Var = z1Var7;
                            i26 = i79;
                            i27 = i80;
                            i29 = i33;
                            z10 = z26;
                            z11 = z25;
                        } else {
                            z1Var = z1Var7;
                            i26 = i79;
                            i27 = i80;
                            i29 = i33;
                            i30 = 1073741824;
                            z10 = z26;
                            z11 = z25;
                            z12 = true;
                            if (mode4 == i30 && ((LinearLayout.LayoutParams) z1Var).height == -1) {
                                z13 = true;
                                z30 = true;
                            } else {
                                z13 = false;
                            }
                            i31 = ((LinearLayout.LayoutParams) z1Var).topMargin + ((LinearLayout.LayoutParams) z1Var).bottomMargin;
                            int measuredHeight3 = childAt6.getMeasuredHeight() + i31;
                            int iCombineMeasuredStates3 = View.combineMeasuredStates(i78, childAt6.getMeasuredState());
                            if (z11 || (baseline2 = childAt6.getBaseline()) == -1) {
                                i32 = i31;
                            } else {
                                int i82 = ((LinearLayout.LayoutParams) z1Var).gravity;
                                if (i82 < 0) {
                                    i82 = this.f715e;
                                }
                                int i83 = (((i82 & 112) >> 4) & (-2)) >> 1;
                                i32 = i31;
                                iArr[i83] = Math.max(iArr[i83], baseline2);
                                iArr2[i83] = Math.max(iArr2[i83], measuredHeight3 - baseline2);
                            }
                            int iMax11 = Math.max(i27, measuredHeight3);
                            boolean z31 = !z28 && ((LinearLayout.LayoutParams) z1Var).height == -1;
                            if (((LinearLayout.LayoutParams) z1Var).weight <= 0.0f) {
                                if (z13) {
                                    measuredHeight3 = i32;
                                }
                                iMax10 = Math.max(iMax10, measuredHeight3);
                                iMax8 = i26;
                            } else {
                                if (z13) {
                                    measuredHeight3 = i32;
                                }
                                iMax8 = Math.max(i26, measuredHeight3);
                            }
                            i76 = iMax11;
                            i78 = iCombineMeasuredStates3;
                            z29 = z12;
                            z28 = z31;
                            f18 = f20;
                        }
                    } else {
                        int i84 = i77;
                        if (((LinearLayout.LayoutParams) z1Var7).width == 0) {
                            f12 = 0.0f;
                            if (f19 > 0.0f) {
                                ((LinearLayout.LayoutParams) z1Var7).width = -2;
                                i25 = 0;
                            }
                            i26 = i79;
                            i27 = i80;
                            i28 = i25;
                            i29 = i84;
                            z10 = z26;
                            z11 = z25;
                            measureChildWithMargins(childAt6, i10, f20 != f12 ? this.f716f : 0, i11, 0);
                            if (i28 == Integer.MIN_VALUE) {
                                z1Var = z1Var7;
                                ((LinearLayout.LayoutParams) z1Var).width = i28;
                            } else {
                                z1Var = z1Var7;
                            }
                            int measuredWidth3 = childAt6.getMeasuredWidth();
                            if (z27) {
                                int i85 = this.f716f;
                                this.f716f = Math.max(i85, i85 + measuredWidth3 + ((LinearLayout.LayoutParams) z1Var).leftMargin + ((LinearLayout.LayoutParams) z1Var).rightMargin);
                            } else {
                                this.f716f = ((LinearLayout.LayoutParams) z1Var).leftMargin + measuredWidth3 + ((LinearLayout.LayoutParams) z1Var).rightMargin + this.f716f;
                            }
                            if (z10) {
                                iMax9 = Math.max(measuredWidth3, iMax9);
                            }
                        } else {
                            f12 = 0.0f;
                        }
                        i25 = Integer.MIN_VALUE;
                        i26 = i79;
                        i27 = i80;
                        i28 = i25;
                        i29 = i84;
                        z10 = z26;
                        z11 = z25;
                        measureChildWithMargins(childAt6, i10, f20 != f12 ? this.f716f : 0, i11, 0);
                        if (i28 == Integer.MIN_VALUE) {
                        }
                        int measuredWidth32 = childAt6.getMeasuredWidth();
                        if (z27) {
                        }
                        if (z10) {
                        }
                    }
                    z12 = z29;
                    i30 = 1073741824;
                    if (mode4 == i30) {
                        z13 = false;
                        i31 = ((LinearLayout.LayoutParams) z1Var).topMargin + ((LinearLayout.LayoutParams) z1Var).bottomMargin;
                        int measuredHeight32 = childAt6.getMeasuredHeight() + i31;
                        int iCombineMeasuredStates32 = View.combineMeasuredStates(i78, childAt6.getMeasuredState());
                        if (z11) {
                            i32 = i31;
                            int iMax112 = Math.max(i27, measuredHeight32);
                            if (z28) {
                                if (((LinearLayout.LayoutParams) z1Var).weight <= 0.0f) {
                                }
                                i76 = iMax112;
                                i78 = iCombineMeasuredStates32;
                                z29 = z12;
                                z28 = z31;
                                f18 = f20;
                            }
                        }
                    }
                }
            }
            i77 = i29 + 1;
            z26 = z10;
            z25 = z11;
        }
        int i86 = i76;
        boolean z32 = z26;
        boolean z33 = z25;
        if (this.f716f > 0 && k(virtualChildCount2)) {
            this.f716f += this.f722l;
        }
        int i87 = iArr[1];
        if (i87 == -1 && iArr[0] == -1 && iArr[2] == -1) {
            c6 = 3;
            if (iArr[3] == -1) {
                iMax = i86;
                i12 = i78;
            }
            if (z32 && (mode3 == Integer.MIN_VALUE || mode3 == 0)) {
                this.f716f = 0;
                for (i24 = 0; i24 < virtualChildCount2; i24++) {
                    View childAt7 = getChildAt(i24);
                    if (childAt7 == null) {
                        this.f716f = this.f716f;
                    } else if (childAt7.getVisibility() != 8) {
                        z1 z1Var8 = (z1) childAt7.getLayoutParams();
                        if (z27) {
                            this.f716f = ((LinearLayout.LayoutParams) z1Var8).leftMargin + iMax9 + ((LinearLayout.LayoutParams) z1Var8).rightMargin + this.f716f;
                        } else {
                            int i88 = this.f716f;
                            this.f716f = Math.max(i88, i88 + iMax9 + ((LinearLayout.LayoutParams) z1Var8).leftMargin + ((LinearLayout.LayoutParams) z1Var8).rightMargin);
                        }
                    }
                }
            }
            int paddingRight = getPaddingRight() + getPaddingLeft() + this.f716f;
            this.f716f = paddingRight;
            int iResolveSizeAndState2 = View.resolveSizeAndState(Math.max(paddingRight, getSuggestedMinimumWidth()), i10, 0);
            int i89 = (16777215 & iResolveSizeAndState2) - this.f716f;
            if (!z29 || (i89 != 0 && f18 > 0.0f)) {
                f10 = this.f717g;
                if (f10 > 0.0f) {
                    f18 = f10;
                }
                iArr[3] = -1;
                iArr[2] = -1;
                iArr[1] = -1;
                iArr[0] = -1;
                iArr2[3] = -1;
                iArr2[2] = -1;
                iArr2[1] = -1;
                iArr2[0] = -1;
                this.f716f = 0;
                int iCombineMeasuredStates4 = i12;
                iMax = -1;
                i13 = 0;
                while (i13 < virtualChildCount2) {
                    View childAt8 = getChildAt(i13);
                    if (childAt8 == null || childAt8.getVisibility() == 8) {
                        i18 = i89;
                        i19 = virtualChildCount2;
                    } else {
                        z1 z1Var9 = (z1) childAt8.getLayoutParams();
                        float f21 = ((LinearLayout.LayoutParams) z1Var9).weight;
                        if (f21 > 0.0f) {
                            i19 = virtualChildCount2;
                            int i90 = (int) ((i89 * f21) / f18);
                            float f22 = f18 - f21;
                            int i91 = i89 - i90;
                            int childMeasureSpec2 = ViewGroup.getChildMeasureSpec(i11, getPaddingBottom() + getPaddingTop() + ((LinearLayout.LayoutParams) z1Var9).topMargin + ((LinearLayout.LayoutParams) z1Var9).bottomMargin, ((LinearLayout.LayoutParams) z1Var9).height);
                            if (((LinearLayout.LayoutParams) z1Var9).width == 0) {
                                i23 = 1073741824;
                                if (mode3 == 1073741824) {
                                    if (i90 <= 0) {
                                        i90 = 0;
                                    }
                                    childAt8.measure(View.MeasureSpec.makeMeasureSpec(i90, 1073741824), childMeasureSpec2);
                                }
                                iCombineMeasuredStates4 = View.combineMeasuredStates(iCombineMeasuredStates4, childAt8.getMeasuredState() & (-16777216));
                                f18 = f22;
                                i20 = i91;
                            } else {
                                i23 = 1073741824;
                            }
                            int measuredWidth4 = childAt8.getMeasuredWidth() + i90;
                            if (measuredWidth4 < 0) {
                                measuredWidth4 = 0;
                            }
                            childAt8.measure(View.MeasureSpec.makeMeasureSpec(measuredWidth4, i23), childMeasureSpec2);
                            iCombineMeasuredStates4 = View.combineMeasuredStates(iCombineMeasuredStates4, childAt8.getMeasuredState() & (-16777216));
                            f18 = f22;
                            i20 = i91;
                        } else {
                            i20 = i89;
                            i19 = virtualChildCount2;
                        }
                        if (z27) {
                            f11 = f18;
                            this.f716f = childAt8.getMeasuredWidth() + ((LinearLayout.LayoutParams) z1Var9).leftMargin + ((LinearLayout.LayoutParams) z1Var9).rightMargin + this.f716f;
                            i21 = i20;
                        } else {
                            f11 = f18;
                            int i92 = this.f716f;
                            i21 = i20;
                            this.f716f = Math.max(i92, childAt8.getMeasuredWidth() + i92 + ((LinearLayout.LayoutParams) z1Var9).leftMargin + ((LinearLayout.LayoutParams) z1Var9).rightMargin);
                        }
                        boolean z34 = mode4 != 1073741824 && ((LinearLayout.LayoutParams) z1Var9).height == -1;
                        int i93 = ((LinearLayout.LayoutParams) z1Var9).topMargin + ((LinearLayout.LayoutParams) z1Var9).bottomMargin;
                        int measuredHeight4 = childAt8.getMeasuredHeight() + i93;
                        iMax = Math.max(iMax, measuredHeight4);
                        if (!z34) {
                            i93 = measuredHeight4;
                        }
                        iMax8 = Math.max(iMax8, i93);
                        if (z28) {
                            i22 = -1;
                            boolean z35 = ((LinearLayout.LayoutParams) z1Var9).height == -1;
                            if (!z33 && (baseline = childAt8.getBaseline()) != i22) {
                                int i94 = ((LinearLayout.LayoutParams) z1Var9).gravity;
                                if (i94 < 0) {
                                    i94 = this.f715e;
                                }
                                int i95 = (((i94 & 112) >> 4) & (-2)) >> 1;
                                iArr[i95] = Math.max(iArr[i95], baseline);
                                iArr2[i95] = Math.max(iArr2[i95], measuredHeight4 - baseline);
                            }
                            z28 = z35;
                            i18 = i21;
                            f18 = f11;
                        } else {
                            i22 = -1;
                        }
                        if (!z33) {
                            z28 = z35;
                            i18 = i21;
                            f18 = f11;
                        }
                    }
                    i13++;
                    i89 = i18;
                    virtualChildCount2 = i19;
                }
                i14 = i11;
                i15 = virtualChildCount2;
                this.f716f = getPaddingRight() + getPaddingLeft() + this.f716f;
                i16 = iArr[1];
                if (i16 != -1 && iArr[0] == -1 && iArr[2] == -1) {
                    c10 = 3;
                    if (iArr[3] == -1) {
                        i17 = 0;
                    }
                    i12 = iCombineMeasuredStates4;
                } else {
                    c10 = 3;
                }
                i17 = 0;
                iMax = Math.max(iMax, Math.max(iArr2[c10], Math.max(iArr2[0], Math.max(iArr2[1], iArr2[2]))) + Math.max(iArr[c10], Math.max(iArr[0], Math.max(i16, iArr[2]))));
                i12 = iCombineMeasuredStates4;
            } else {
                iMax8 = Math.max(iMax8, iMax10);
                if (z32 && mode3 != 1073741824) {
                    for (int i96 = 0; i96 < virtualChildCount2; i96++) {
                        View childAt9 = getChildAt(i96);
                        if (childAt9 != null && childAt9.getVisibility() != 8 && ((LinearLayout.LayoutParams) ((z1) childAt9.getLayoutParams())).weight > 0.0f) {
                            childAt9.measure(View.MeasureSpec.makeMeasureSpec(iMax9, 1073741824), View.MeasureSpec.makeMeasureSpec(childAt9.getMeasuredHeight(), 1073741824));
                        }
                    }
                }
                i14 = i11;
                i15 = virtualChildCount2;
                i17 = 0;
            }
            if (!z28 || mode4 == 1073741824) {
                iMax8 = iMax;
            }
            setMeasuredDimension((i12 & (-16777216)) | iResolveSizeAndState2, View.resolveSizeAndState(Math.max(getPaddingBottom() + getPaddingTop() + iMax8, getSuggestedMinimumHeight()), i14, i12 << 16));
            if (z30) {
                return;
            }
            int iMakeMeasureSpec3 = View.MeasureSpec.makeMeasureSpec(getMeasuredHeight(), 1073741824);
            int i97 = i15;
            while (i17 < i97) {
                View childAt10 = getChildAt(i17);
                if (childAt10.getVisibility() != 8) {
                    z1 z1Var10 = (z1) childAt10.getLayoutParams();
                    if (((LinearLayout.LayoutParams) z1Var10).height == -1) {
                        int i98 = ((LinearLayout.LayoutParams) z1Var10).width;
                        ((LinearLayout.LayoutParams) z1Var10).width = childAt10.getMeasuredWidth();
                        measureChildWithMargins(childAt10, i10, 0, iMakeMeasureSpec3, 0);
                        ((LinearLayout.LayoutParams) z1Var10).width = i98;
                    }
                }
                i17++;
            }
            return;
        }
        c6 = 3;
        i12 = i78;
        iMax = Math.max(i86, Math.max(iArr2[3], Math.max(iArr2[0], Math.max(iArr2[1], iArr2[2]))) + Math.max(iArr[c6], Math.max(iArr[0], Math.max(i87, iArr[2]))));
        if (z32) {
            this.f716f = 0;
            while (i24 < virtualChildCount2) {
            }
        }
        int paddingRight2 = getPaddingRight() + getPaddingLeft() + this.f716f;
        this.f716f = paddingRight2;
        int iResolveSizeAndState22 = View.resolveSizeAndState(Math.max(paddingRight2, getSuggestedMinimumWidth()), i10, 0);
        int i892 = (16777215 & iResolveSizeAndState22) - this.f716f;
        if (z29) {
            f10 = this.f717g;
            if (f10 > 0.0f) {
            }
            iArr[3] = -1;
            iArr[2] = -1;
            iArr[1] = -1;
            iArr[0] = -1;
            iArr2[3] = -1;
            iArr2[2] = -1;
            iArr2[1] = -1;
            iArr2[0] = -1;
            this.f716f = 0;
            int iCombineMeasuredStates42 = i12;
            iMax = -1;
            i13 = 0;
            while (i13 < virtualChildCount2) {
            }
            i14 = i11;
            i15 = virtualChildCount2;
            this.f716f = getPaddingRight() + getPaddingLeft() + this.f716f;
            i16 = iArr[1];
            if (i16 != -1) {
                c10 = 3;
                i17 = 0;
                iMax = Math.max(iMax, Math.max(iArr2[c10], Math.max(iArr2[0], Math.max(iArr2[1], iArr2[2]))) + Math.max(iArr[c10], Math.max(iArr[0], Math.max(i16, iArr[2]))));
                i12 = iCombineMeasuredStates42;
            }
        }
        if (!z28) {
            iMax8 = iMax;
        }
        setMeasuredDimension((i12 & (-16777216)) | iResolveSizeAndState22, View.resolveSizeAndState(Math.max(getPaddingBottom() + getPaddingTop() + iMax8, getSuggestedMinimumHeight()), i14, i12 << 16));
        if (z30) {
        }
    }

    public void setBaselineAligned(boolean z10) {
        this.f711a = z10;
    }

    public void setBaselineAlignedChildIndex(int i10) {
        if (i10 >= 0 && i10 < getChildCount()) {
            this.f712b = i10;
            return;
        }
        throw new IllegalArgumentException("base aligned child index out of range (0, " + getChildCount() + ")");
    }

    public void setDividerDrawable(Drawable drawable) {
        if (drawable == this.f721k) {
            return;
        }
        this.f721k = drawable;
        if (drawable != null) {
            this.f722l = drawable.getIntrinsicWidth();
            this.f723m = drawable.getIntrinsicHeight();
        } else {
            this.f722l = 0;
            this.f723m = 0;
        }
        setWillNotDraw(drawable == null);
        requestLayout();
    }

    public void setDividerPadding(int i10) {
        this.R = i10;
    }

    public void setGravity(@GravityInt int i10) {
        if (this.f715e != i10) {
            if ((8388615 & i10) == 0) {
                i10 |= 8388611;
            }
            if ((i10 & 112) == 0) {
                i10 |= 48;
            }
            this.f715e = i10;
            requestLayout();
        }
    }

    public void setHorizontalGravity(int i10) {
        int i11 = i10 & 8388615;
        int i12 = this.f715e;
        if ((8388615 & i12) != i11) {
            this.f715e = i11 | ((-8388616) & i12);
            requestLayout();
        }
    }

    public void setMeasureWithLargestChildEnabled(boolean z10) {
        this.f718h = z10;
    }

    public void setOrientation(int i10) {
        if (this.f714d != i10) {
            this.f714d = i10;
            requestLayout();
        }
    }

    public void setShowDividers(int i10) {
        if (i10 != this.Q) {
            requestLayout();
        }
        this.Q = i10;
    }

    public void setVerticalGravity(int i10) {
        int i11 = i10 & 112;
        int i12 = this.f715e;
        if ((i12 & 112) != i11) {
            this.f715e = i11 | (i12 & (-113));
            requestLayout();
        }
    }

    public void setWeightSum(float f10) {
        this.f717g = Math.max(0.0f, f10);
    }

    @Override // android.view.ViewGroup
    public final boolean shouldDelayChildPressedState() {
        return false;
    }

    public LinearLayoutCompat(@NonNull Context context, @Nullable AttributeSet attributeSet) {
        this(context, attributeSet, 0);
    }

    public LinearLayoutCompat(@NonNull Context context, @Nullable AttributeSet attributeSet, int i10) {
        super(context, attributeSet, i10);
        this.f711a = true;
        this.f712b = -1;
        this.f713c = 0;
        this.f715e = 8388659;
        int[] iArr = j.LinearLayoutCompat;
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, iArr, i10, 0);
        p3 p3Var = new p3(context, typedArrayObtainStyledAttributes);
        s1.saveAttributeDataForStyleable(this, context, iArr, attributeSet, typedArrayObtainStyledAttributes, i10, 0);
        int i11 = typedArrayObtainStyledAttributes.getInt(j.LinearLayoutCompat_android_orientation, -1);
        if (i11 >= 0) {
            setOrientation(i11);
        }
        int i12 = typedArrayObtainStyledAttributes.getInt(j.LinearLayoutCompat_android_gravity, -1);
        if (i12 >= 0) {
            setGravity(i12);
        }
        boolean z10 = typedArrayObtainStyledAttributes.getBoolean(j.LinearLayoutCompat_android_baselineAligned, true);
        if (!z10) {
            setBaselineAligned(z10);
        }
        this.f717g = typedArrayObtainStyledAttributes.getFloat(j.LinearLayoutCompat_android_weightSum, -1.0f);
        this.f712b = typedArrayObtainStyledAttributes.getInt(j.LinearLayoutCompat_android_baselineAlignedChildIndex, -1);
        this.f718h = typedArrayObtainStyledAttributes.getBoolean(j.LinearLayoutCompat_measureWithLargestChild, false);
        setDividerDrawable(p3Var.b(j.LinearLayoutCompat_divider));
        this.Q = typedArrayObtainStyledAttributes.getInt(j.LinearLayoutCompat_showDividers, 0);
        this.R = typedArrayObtainStyledAttributes.getDimensionPixelSize(j.LinearLayoutCompat_dividerPadding, 0);
        p3Var.e();
    }
}
