package i3;

import com.google.android.gms.common.api.Api;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import i3.d;
import j3.l;
import j3.n;
import j3.p;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;

/* loaded from: classes.dex */
public class e {
    public static float K0 = 0.5f;
    int A0;
    boolean B0;
    boolean C0;
    public float[] D0;
    protected e[] E0;
    protected e[] F0;
    e G0;
    e H0;
    public int I0;
    public int J0;
    private boolean K;
    public d V;
    public d[] W;
    protected ArrayList X;
    private boolean[] Y;
    public b[] Z;

    /* renamed from: a0, reason: collision with root package name */
    public e f22334a0;

    /* renamed from: b0, reason: collision with root package name */
    int f22336b0;

    /* renamed from: c, reason: collision with root package name */
    public j3.c f22337c;

    /* renamed from: c0, reason: collision with root package name */
    int f22338c0;

    /* renamed from: d, reason: collision with root package name */
    public j3.c f22339d;

    /* renamed from: d0, reason: collision with root package name */
    public float f22340d0;

    /* renamed from: e0, reason: collision with root package name */
    protected int f22342e0;

    /* renamed from: f0, reason: collision with root package name */
    protected int f22344f0;

    /* renamed from: g0, reason: collision with root package name */
    protected int f22346g0;

    /* renamed from: h0, reason: collision with root package name */
    int f22348h0;

    /* renamed from: i0, reason: collision with root package name */
    int f22350i0;

    /* renamed from: j0, reason: collision with root package name */
    protected int f22352j0;

    /* renamed from: k0, reason: collision with root package name */
    protected int f22354k0;

    /* renamed from: l0, reason: collision with root package name */
    int f22356l0;

    /* renamed from: m0, reason: collision with root package name */
    protected int f22358m0;

    /* renamed from: n0, reason: collision with root package name */
    protected int f22360n0;

    /* renamed from: o, reason: collision with root package name */
    public String f22361o;

    /* renamed from: o0, reason: collision with root package name */
    float f22362o0;

    /* renamed from: p0, reason: collision with root package name */
    float f22364p0;

    /* renamed from: q0, reason: collision with root package name */
    private Object f22366q0;

    /* renamed from: r0, reason: collision with root package name */
    private int f22368r0;

    /* renamed from: s0, reason: collision with root package name */
    private int f22370s0;

    /* renamed from: t0, reason: collision with root package name */
    private boolean f22372t0;

    /* renamed from: u0, reason: collision with root package name */
    private String f22374u0;

    /* renamed from: v0, reason: collision with root package name */
    private String f22376v0;

    /* renamed from: w0, reason: collision with root package name */
    boolean f22378w0;

    /* renamed from: x0, reason: collision with root package name */
    boolean f22380x0;

    /* renamed from: y0, reason: collision with root package name */
    boolean f22382y0;

    /* renamed from: z0, reason: collision with root package name */
    int f22384z0;

    /* renamed from: a, reason: collision with root package name */
    public boolean f22333a = false;

    /* renamed from: b, reason: collision with root package name */
    public p[] f22335b = new p[2];

    /* renamed from: e, reason: collision with root package name */
    public l f22341e = null;

    /* renamed from: f, reason: collision with root package name */
    public n f22343f = null;

    /* renamed from: g, reason: collision with root package name */
    public boolean[] f22345g = {true, true};

    /* renamed from: h, reason: collision with root package name */
    boolean f22347h = false;

    /* renamed from: i, reason: collision with root package name */
    private boolean f22349i = true;

    /* renamed from: j, reason: collision with root package name */
    private boolean f22351j = false;

    /* renamed from: k, reason: collision with root package name */
    private boolean f22353k = true;

    /* renamed from: l, reason: collision with root package name */
    private int f22355l = -1;

    /* renamed from: m, reason: collision with root package name */
    private int f22357m = -1;

    /* renamed from: n, reason: collision with root package name */
    public h3.a f22359n = new h3.a(this);

    /* renamed from: p, reason: collision with root package name */
    private boolean f22363p = false;

    /* renamed from: q, reason: collision with root package name */
    private boolean f22365q = false;

    /* renamed from: r, reason: collision with root package name */
    private boolean f22367r = false;

    /* renamed from: s, reason: collision with root package name */
    private boolean f22369s = false;

    /* renamed from: t, reason: collision with root package name */
    public int f22371t = -1;

    /* renamed from: u, reason: collision with root package name */
    public int f22373u = -1;

    /* renamed from: v, reason: collision with root package name */
    private int f22375v = 0;

    /* renamed from: w, reason: collision with root package name */
    public int f22377w = 0;

    /* renamed from: x, reason: collision with root package name */
    public int f22379x = 0;

    /* renamed from: y, reason: collision with root package name */
    public int[] f22381y = new int[2];

    /* renamed from: z, reason: collision with root package name */
    public int f22383z = 0;
    public int A = 0;
    public float B = 1.0f;
    public int C = 0;
    public int D = 0;
    public float E = 1.0f;
    int F = -1;
    float G = 1.0f;
    private int[] H = {Api.BaseClientBuilder.API_PRIORITY_OTHER, Api.BaseClientBuilder.API_PRIORITY_OTHER};
    private float I = BitmapDescriptorFactory.HUE_RED;
    private boolean J = false;
    private boolean L = false;
    private int M = 0;
    private int N = 0;
    public d O = new d(this, d.b.LEFT);
    public d P = new d(this, d.b.TOP);
    public d Q = new d(this, d.b.RIGHT);
    public d R = new d(this, d.b.BOTTOM);
    public d S = new d(this, d.b.BASELINE);
    d T = new d(this, d.b.CENTER_X);
    d U = new d(this, d.b.CENTER_Y);

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static /* synthetic */ class a {

        /* renamed from: a, reason: collision with root package name */
        static final /* synthetic */ int[] f22385a;

        /* renamed from: b, reason: collision with root package name */
        static final /* synthetic */ int[] f22386b;

        static {
            int[] iArr = new int[b.values().length];
            f22386b = iArr;
            try {
                iArr[b.FIXED.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                f22386b[b.WRAP_CONTENT.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                f22386b[b.MATCH_PARENT.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                f22386b[b.MATCH_CONSTRAINT.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            int[] iArr2 = new int[d.b.values().length];
            f22385a = iArr2;
            try {
                iArr2[d.b.LEFT.ordinal()] = 1;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                f22385a[d.b.TOP.ordinal()] = 2;
            } catch (NoSuchFieldError unused6) {
            }
            try {
                f22385a[d.b.RIGHT.ordinal()] = 3;
            } catch (NoSuchFieldError unused7) {
            }
            try {
                f22385a[d.b.BOTTOM.ordinal()] = 4;
            } catch (NoSuchFieldError unused8) {
            }
            try {
                f22385a[d.b.BASELINE.ordinal()] = 5;
            } catch (NoSuchFieldError unused9) {
            }
            try {
                f22385a[d.b.CENTER.ordinal()] = 6;
            } catch (NoSuchFieldError unused10) {
            }
            try {
                f22385a[d.b.CENTER_X.ordinal()] = 7;
            } catch (NoSuchFieldError unused11) {
            }
            try {
                f22385a[d.b.CENTER_Y.ordinal()] = 8;
            } catch (NoSuchFieldError unused12) {
            }
            try {
                f22385a[d.b.NONE.ordinal()] = 9;
            } catch (NoSuchFieldError unused13) {
            }
        }
    }

    /* loaded from: classes.dex */
    public enum b {
        FIXED,
        WRAP_CONTENT,
        MATCH_CONSTRAINT,
        MATCH_PARENT
    }

    public e() {
        d dVar = new d(this, d.b.CENTER);
        this.V = dVar;
        this.W = new d[]{this.O, this.Q, this.P, this.R, this.S, dVar};
        this.X = new ArrayList();
        this.Y = new boolean[2];
        b bVar = b.FIXED;
        this.Z = new b[]{bVar, bVar};
        this.f22334a0 = null;
        this.f22336b0 = 0;
        this.f22338c0 = 0;
        this.f22340d0 = BitmapDescriptorFactory.HUE_RED;
        this.f22342e0 = -1;
        this.f22344f0 = 0;
        this.f22346g0 = 0;
        this.f22348h0 = 0;
        this.f22350i0 = 0;
        this.f22352j0 = 0;
        this.f22354k0 = 0;
        this.f22356l0 = 0;
        float f10 = K0;
        this.f22362o0 = f10;
        this.f22364p0 = f10;
        this.f22368r0 = 0;
        this.f22370s0 = 0;
        this.f22372t0 = false;
        this.f22374u0 = null;
        this.f22376v0 = null;
        this.f22382y0 = false;
        this.f22384z0 = 0;
        this.A0 = 0;
        this.D0 = new float[]{-1.0f, -1.0f};
        this.E0 = new e[]{null, null};
        this.F0 = new e[]{null, null};
        this.G0 = null;
        this.H0 = null;
        this.I0 = -1;
        this.J0 = -1;
        d();
    }

    private void N(StringBuilder sb2, String str, int i10, int i11, int i12, int i13, int i14, int i15, float f10, float f11) {
        sb2.append(str);
        sb2.append(" :  {\n");
        v0(sb2, "      size", i10, 0);
        v0(sb2, "      min", i11, 0);
        v0(sb2, "      max", i12, Api.BaseClientBuilder.API_PRIORITY_OTHER);
        v0(sb2, "      matchMin", i14, 0);
        v0(sb2, "      matchDef", i15, 0);
        u0(sb2, "      matchPercent", f10, 1.0f);
        sb2.append("    },\n");
    }

    private void O(StringBuilder sb2, String str, d dVar) {
        if (dVar.f22328f == null) {
            return;
        }
        sb2.append("    ");
        sb2.append(str);
        sb2.append(" : [ '");
        sb2.append(dVar.f22328f);
        sb2.append("'");
        if (dVar.f22330h != Integer.MIN_VALUE || dVar.f22329g != 0) {
            sb2.append(",");
            sb2.append(dVar.f22329g);
            if (dVar.f22330h != Integer.MIN_VALUE) {
                sb2.append(",");
                sb2.append(dVar.f22330h);
                sb2.append(",");
            }
        }
        sb2.append(" ] ,\n");
    }

    private void d() {
        this.X.add(this.O);
        this.X.add(this.P);
        this.X.add(this.Q);
        this.X.add(this.R);
        this.X.add(this.T);
        this.X.add(this.U);
        this.X.add(this.V);
        this.X.add(this.S);
    }

    private boolean d0(int i10) {
        d dVar;
        d dVar2;
        int i11 = i10 * 2;
        d[] dVarArr = this.W;
        d dVar3 = dVarArr[i11];
        d dVar4 = dVar3.f22328f;
        return (dVar4 == null || dVar4.f22328f == dVar3 || (dVar2 = (dVar = dVarArr[i11 + 1]).f22328f) == null || dVar2.f22328f != dVar) ? false : true;
    }

    /* JADX WARN: Code restructure failed: missing block: B:149:0x0484, code lost:
    
        if ((r4 instanceof i3.a) != false) goto L271;
     */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:125:0x03fc A[ADDED_TO_REGION] */
    /* JADX WARN: Removed duplicated region for block: B:129:0x0409  */
    /* JADX WARN: Removed duplicated region for block: B:138:0x0469  */
    /* JADX WARN: Removed duplicated region for block: B:143:0x0474  */
    /* JADX WARN: Removed duplicated region for block: B:153:0x04ae A[ADDED_TO_REGION] */
    /* JADX WARN: Removed duplicated region for block: B:162:0x04ca  */
    /* JADX WARN: Removed duplicated region for block: B:192:0x0515  */
    /* JADX WARN: Removed duplicated region for block: B:197:0x0527 A[ADDED_TO_REGION] */
    /* JADX WARN: Removed duplicated region for block: B:213:0x04a6  */
    /* JADX WARN: Removed duplicated region for block: B:215:0x0451  */
    /* JADX WARN: Removed duplicated region for block: B:251:0x0331  */
    /* JADX WARN: Removed duplicated region for block: B:253:0x0335  */
    /* JADX WARN: Removed duplicated region for block: B:293:0x057a A[ADDED_TO_REGION] */
    /* JADX WARN: Removed duplicated region for block: B:29:0x0092  */
    /* JADX WARN: Removed duplicated region for block: B:318:? A[ADDED_TO_REGION, RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:31:0x009a  */
    /* JADX WARN: Removed duplicated region for block: B:320:0x00e8  */
    /* JADX WARN: Removed duplicated region for block: B:378:0x00bb  */
    /* JADX WARN: Removed duplicated region for block: B:379:0x0096  */
    /* JADX WARN: Removed duplicated region for block: B:37:0x00c0  */
    /* JADX WARN: Removed duplicated region for block: B:47:0x01e8 A[ADDED_TO_REGION] */
    /* JADX WARN: Removed duplicated region for block: B:54:0x0543 A[ADDED_TO_REGION] */
    /* JADX WARN: Removed duplicated region for block: B:77:? A[ADDED_TO_REGION, RETURN, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    private void i(f3.d dVar, boolean z10, boolean z11, boolean z12, boolean z13, f3.i iVar, f3.i iVar2, b bVar, boolean z14, d dVar2, d dVar3, int i10, int i11, int i12, int i13, float f10, boolean z15, boolean z16, boolean z17, boolean z18, boolean z19, int i14, int i15, int i16, int i17, float f11, boolean z20) {
        int i18;
        boolean z21;
        int i19;
        int i20;
        int i21;
        f3.i iVar3;
        int i22;
        int i23;
        int i24;
        f3.i iVar4;
        f3.i iVar5;
        f3.i iVar6;
        int i25;
        boolean z22;
        boolean z23;
        f3.i q10;
        f3.i q11;
        d dVar4;
        int i26;
        f3.i iVar7;
        int i27;
        boolean z24;
        f3.i iVar8;
        char c10;
        int i28;
        boolean z25;
        boolean z26;
        int i29;
        int i30;
        f3.i iVar9;
        int i31;
        boolean z27;
        boolean z28;
        f3.i iVar10;
        e eVar;
        e eVar2;
        boolean z29;
        e eVar3;
        f3.i iVar11;
        int i32;
        int i33;
        boolean z30;
        boolean z31;
        e eVar4;
        e eVar5;
        f3.i iVar12;
        e eVar6;
        int i34;
        int i35;
        int i36;
        int i37;
        int i38;
        boolean z32;
        int i39;
        int i40;
        boolean z33;
        int i41;
        int i42;
        boolean z34;
        e eVar7;
        e eVar8;
        int i43 = i17;
        f3.i q12 = dVar.q(dVar2);
        f3.i q13 = dVar.q(dVar3);
        f3.i q14 = dVar.q(dVar2.i());
        f3.i q15 = dVar.q(dVar3.i());
        f3.d.w();
        boolean n10 = dVar2.n();
        boolean n11 = dVar3.n();
        boolean n12 = this.V.n();
        int i44 = n11 ? (n10 ? 1 : 0) + 1 : n10 ? 1 : 0;
        if (n12) {
            i44++;
        }
        int i45 = z15 ? 3 : i14;
        int i46 = a.f22386b[bVar.ordinal()];
        if (i46 == 1 || i46 == 2 || i46 == 3 || i46 != 4) {
            i18 = i45;
        } else {
            i18 = i45;
            if (i18 != 4) {
                z21 = true;
                i19 = this.f22355l;
                if (i19 != -1 && z10) {
                    this.f22355l = -1;
                    i11 = i19;
                    z21 = false;
                }
                i20 = this.f22357m;
                if (i20 != -1 || z10) {
                    i20 = i11;
                } else {
                    this.f22357m = -1;
                    z21 = false;
                }
                int i47 = i20;
                if (this.f22370s0 != 8) {
                    i21 = 0;
                    z21 = false;
                } else {
                    i21 = i47;
                }
                if (z20) {
                    iVar3 = q15;
                    i22 = 8;
                } else {
                    if (!n10 && !n11 && !n12) {
                        dVar.f(q12, i10);
                    } else if (n10 && !n11) {
                        iVar3 = q15;
                        i22 = 8;
                        dVar.e(q12, q14, dVar2.e(), 8);
                    }
                    iVar3 = q15;
                    i22 = 8;
                }
                if (z21) {
                    if (z14) {
                        dVar.e(q13, q12, 0, 3);
                        if (i12 > 0) {
                            dVar.h(q13, q12, i12, 8);
                        }
                        if (i13 < Integer.MAX_VALUE) {
                            dVar.j(q13, q12, i13, 8);
                        }
                    } else {
                        dVar.e(q13, q12, i21, i22);
                    }
                    i24 = i44;
                    iVar4 = q14;
                    iVar5 = q13;
                    z22 = z21;
                    iVar6 = iVar3;
                    z23 = z13;
                } else if (i44 == 2 || z15 || !(i18 == 1 || i18 == 0)) {
                    int i48 = i16 == -2 ? i21 : i16;
                    int i49 = i43 == -2 ? i21 : i43;
                    if (i21 > 0 && i18 != 1) {
                        i21 = 0;
                    }
                    if (i48 > 0) {
                        dVar.h(q13, q12, i48, 8);
                        i21 = Math.max(i21, i48);
                    }
                    if (i49 > 0) {
                        if ((z11 && i18 == 1) ? false : true) {
                            i23 = 8;
                            dVar.j(q13, q12, i49, 8);
                        } else {
                            i23 = 8;
                        }
                        i21 = Math.min(i21, i49);
                    } else {
                        i23 = 8;
                    }
                    if (i18 == 1) {
                        if (z11) {
                            dVar.e(q13, q12, i21, i23);
                        } else if (z17) {
                            dVar.e(q13, q12, i21, 5);
                            dVar.j(q13, q12, i21, i23);
                        } else {
                            dVar.e(q13, q12, i21, 5);
                            dVar.j(q13, q12, i21, i23);
                        }
                        i43 = i49;
                        i24 = i44;
                        iVar5 = q13;
                        z22 = z21;
                        iVar6 = iVar3;
                        z23 = z13;
                        i25 = i48;
                        iVar4 = q14;
                    } else if (i18 == 2) {
                        d.b j10 = dVar2.j();
                        d.b bVar2 = d.b.TOP;
                        if (j10 == bVar2 || dVar2.j() == d.b.BOTTOM) {
                            q10 = dVar.q(this.f22334a0.m(bVar2));
                            q11 = dVar.q(this.f22334a0.m(d.b.BOTTOM));
                        } else {
                            q10 = dVar.q(this.f22334a0.m(d.b.LEFT));
                            q11 = dVar.q(this.f22334a0.m(d.b.RIGHT));
                        }
                        int i50 = i49;
                        i24 = i44;
                        iVar6 = iVar3;
                        int i51 = i48;
                        iVar4 = q14;
                        iVar5 = q13;
                        dVar.d(dVar.r().k(q13, q12, q11, q10, f11));
                        if (z11) {
                            z21 = false;
                        }
                        i43 = i50;
                        i25 = i51;
                        z22 = z21;
                        z23 = z13;
                    } else {
                        int i52 = i49;
                        int i53 = i48;
                        i24 = i44;
                        iVar4 = q14;
                        iVar5 = q13;
                        iVar6 = iVar3;
                        i43 = i52;
                        i25 = i53;
                        z22 = z21;
                        z23 = true;
                    }
                    if (z20 || z17) {
                        if (i24 < 2 && z11 && z23) {
                            dVar.h(q12, iVar, 0, 8);
                            Object[] objArr = z10 || this.S.f22328f == null;
                            if (!z10 && (dVar4 = this.S.f22328f) != null) {
                                e eVar9 = dVar4.f22326d;
                                if (eVar9.f22340d0 != BitmapDescriptorFactory.HUE_RED) {
                                    b[] bVarArr = eVar9.Z;
                                    b bVar3 = bVarArr[0];
                                    b bVar4 = b.MATCH_CONSTRAINT;
                                    if (bVar3 == bVar4 && bVarArr[1] == bVar4) {
                                        objArr = true;
                                    }
                                }
                                objArr = false;
                            }
                            if (objArr == true) {
                                dVar.h(iVar2, iVar5, 0, 8);
                                return;
                            }
                            return;
                        }
                        return;
                    }
                    if (n10 || n11 || n12) {
                        if (!n10 || n11) {
                            if (n10 || !n11) {
                                i26 = 0;
                                if (n10 && n11) {
                                    e eVar10 = dVar2.f22328f.f22326d;
                                    e eVar11 = dVar3.f22328f.f22326d;
                                    e I = I();
                                    if (z22) {
                                        if (i18 == 0) {
                                            if (i43 != 0 || i25 != 0) {
                                                z33 = false;
                                                i41 = 5;
                                                i42 = 5;
                                                z34 = true;
                                                z26 = true;
                                            } else if (iVar4.f17615v && iVar6.f17615v) {
                                                dVar.e(q12, iVar4, dVar2.e(), 8);
                                                dVar.e(iVar5, iVar6, -dVar3.e(), 8);
                                                return;
                                            } else {
                                                i41 = 8;
                                                i42 = 8;
                                                z34 = false;
                                                z26 = false;
                                                z33 = true;
                                            }
                                            if ((eVar10 instanceof i3.a) || (eVar11 instanceof i3.a)) {
                                                i28 = i41;
                                                i29 = 6;
                                                z25 = z34;
                                                z27 = z33;
                                                c10 = 5;
                                                z24 = true;
                                                i30 = 4;
                                                iVar8 = iVar2;
                                                if (z26 || iVar4 != iVar6 || eVar10 == I) {
                                                    z28 = z24;
                                                } else {
                                                    z26 = false;
                                                    z28 = false;
                                                }
                                                if (z25) {
                                                    if (z22 || z16 || z18 || iVar4 != iVar || iVar6 != iVar8) {
                                                        i38 = i29;
                                                        z30 = z11;
                                                    } else {
                                                        z30 = false;
                                                        i28 = 8;
                                                        i38 = 8;
                                                        z28 = false;
                                                    }
                                                    iVar10 = iVar4;
                                                    i32 = 8;
                                                    z29 = z24;
                                                    i33 = 4;
                                                    eVar = I;
                                                    eVar2 = eVar11;
                                                    eVar3 = eVar10;
                                                    iVar11 = q12;
                                                    dVar.c(q12, iVar10, dVar2.e(), f10, iVar6, iVar5, dVar3.e(), i38);
                                                } else {
                                                    iVar10 = iVar4;
                                                    eVar = I;
                                                    eVar2 = eVar11;
                                                    z29 = z24;
                                                    eVar3 = eVar10;
                                                    iVar11 = q12;
                                                    i32 = 8;
                                                    i33 = 4;
                                                    z30 = z11;
                                                }
                                                z31 = z28;
                                                if (this.f22370s0 != i32 && !dVar3.l()) {
                                                    return;
                                                }
                                                f3.i iVar13 = iVar10;
                                                if (z26) {
                                                    if (!z30 || iVar13 == iVar6 || z22) {
                                                        eVar4 = eVar2;
                                                        eVar5 = eVar3;
                                                    } else {
                                                        eVar5 = eVar3;
                                                        if (eVar5 instanceof i3.a) {
                                                            eVar4 = eVar2;
                                                        } else {
                                                            eVar4 = eVar2;
                                                        }
                                                        i37 = 6;
                                                        iVar12 = iVar11;
                                                        dVar.h(iVar12, iVar13, dVar2.e(), i37);
                                                        dVar.j(iVar5, iVar6, -dVar3.e(), i37);
                                                        i28 = i37;
                                                    }
                                                    i37 = i28;
                                                    iVar12 = iVar11;
                                                    dVar.h(iVar12, iVar13, dVar2.e(), i37);
                                                    dVar.j(iVar5, iVar6, -dVar3.e(), i37);
                                                    i28 = i37;
                                                } else {
                                                    eVar4 = eVar2;
                                                    eVar5 = eVar3;
                                                    iVar12 = iVar11;
                                                }
                                                if (z30 || !z19 || (eVar5 instanceof i3.a) || (eVar4 instanceof i3.a)) {
                                                    eVar6 = eVar;
                                                } else {
                                                    eVar6 = eVar;
                                                    if (eVar4 != eVar6) {
                                                        i34 = 6;
                                                        i35 = 6;
                                                        z31 = z29;
                                                        if (z31) {
                                                            if (!z27 || (z18 && !z12)) {
                                                                i36 = i34;
                                                            } else {
                                                                int i54 = (eVar5 == eVar6 || eVar4 == eVar6) ? 6 : i34;
                                                                if ((eVar5 instanceof g) || (eVar4 instanceof g)) {
                                                                    i54 = 5;
                                                                }
                                                                if ((eVar5 instanceof i3.a) || (eVar4 instanceof i3.a)) {
                                                                    i54 = 5;
                                                                }
                                                                if (z18) {
                                                                    i54 = 5;
                                                                }
                                                                i36 = Math.max(i54, i34);
                                                            }
                                                            if (z30) {
                                                                i36 = Math.min(i35, i36);
                                                                if (z15 && !z18 && (eVar5 == eVar6 || eVar4 == eVar6)) {
                                                                    i36 = i33;
                                                                }
                                                            }
                                                            dVar.e(iVar12, iVar13, dVar2.e(), i36);
                                                            dVar.e(iVar5, iVar6, -dVar3.e(), i36);
                                                        }
                                                        if (z30) {
                                                            int e10 = iVar == iVar13 ? dVar2.e() : 0;
                                                            if (iVar13 != iVar) {
                                                                i27 = 5;
                                                                dVar.h(iVar12, iVar, e10, 5);
                                                                if (z30 && z22) {
                                                                    iVar7 = iVar6;
                                                                    if (i12 == 0 && i25 == 0) {
                                                                        if (z22 || i18 != 3) {
                                                                            i26 = 0;
                                                                            dVar.h(iVar5, iVar12, 0, i27);
                                                                        } else {
                                                                            i26 = 0;
                                                                            dVar.h(iVar5, iVar12, 0, i32);
                                                                        }
                                                                    }
                                                                    i26 = 0;
                                                                }
                                                            }
                                                        }
                                                        i27 = 5;
                                                        if (z30) {
                                                            iVar7 = iVar6;
                                                            if (i12 == 0) {
                                                                if (z22) {
                                                                }
                                                                i26 = 0;
                                                                dVar.h(iVar5, iVar12, 0, i27);
                                                            }
                                                            i26 = 0;
                                                        }
                                                    }
                                                }
                                                i34 = i30;
                                                i35 = i28;
                                                if (z31) {
                                                }
                                                if (z30) {
                                                }
                                                i27 = 5;
                                                if (z30) {
                                                }
                                            } else {
                                                i28 = i41;
                                                z25 = z34;
                                                z27 = z33;
                                                c10 = 5;
                                                z24 = true;
                                                iVar8 = iVar2;
                                                i30 = i42;
                                                i29 = 6;
                                                if (z26) {
                                                }
                                                z28 = z24;
                                                if (z25) {
                                                }
                                                z31 = z28;
                                                if (this.f22370s0 != i32) {
                                                }
                                                f3.i iVar132 = iVar10;
                                                if (z26) {
                                                }
                                                if (z30) {
                                                }
                                                eVar6 = eVar;
                                                i34 = i30;
                                                i35 = i28;
                                                if (z31) {
                                                }
                                                if (z30) {
                                                }
                                                i27 = 5;
                                                if (z30) {
                                                }
                                            }
                                        } else {
                                            if (i18 == 2) {
                                                if ((eVar10 instanceof i3.a) || (eVar11 instanceof i3.a)) {
                                                    iVar8 = iVar2;
                                                    z27 = false;
                                                    i29 = 6;
                                                    c10 = 5;
                                                    z24 = true;
                                                    i30 = 4;
                                                } else {
                                                    iVar8 = iVar2;
                                                    z27 = false;
                                                    i29 = 6;
                                                    c10 = 5;
                                                    z24 = true;
                                                    i30 = 5;
                                                }
                                                i28 = 5;
                                            } else if (i18 == 1) {
                                                iVar8 = iVar2;
                                                z27 = false;
                                                i29 = 6;
                                                c10 = 5;
                                                z24 = true;
                                                i30 = 4;
                                                i28 = 8;
                                            } else if (i18 == 3) {
                                                if (this.F == -1) {
                                                    if (z18) {
                                                        iVar8 = iVar2;
                                                        c10 = 5;
                                                        z24 = true;
                                                        i29 = z11 ? 5 : 4;
                                                    } else {
                                                        iVar8 = iVar2;
                                                        c10 = 5;
                                                        z24 = true;
                                                        i29 = 8;
                                                    }
                                                    i30 = 5;
                                                    i28 = 8;
                                                    z25 = true;
                                                    z26 = true;
                                                    z27 = true;
                                                } else if (z15) {
                                                    if (i15 != 2) {
                                                        z24 = true;
                                                        if (i15 != 1) {
                                                            z32 = false;
                                                            if (z32) {
                                                                i39 = 8;
                                                                i40 = 5;
                                                            } else {
                                                                i39 = 5;
                                                                i40 = 4;
                                                            }
                                                            i28 = i39;
                                                            i30 = i40;
                                                            z25 = z24;
                                                            z26 = z25;
                                                            z27 = z26;
                                                            i29 = 6;
                                                            c10 = 5;
                                                            iVar8 = iVar2;
                                                        }
                                                    } else {
                                                        z24 = true;
                                                    }
                                                    z32 = z24;
                                                    if (z32) {
                                                    }
                                                    i28 = i39;
                                                    i30 = i40;
                                                    z25 = z24;
                                                    z26 = z25;
                                                    z27 = z26;
                                                    i29 = 6;
                                                    c10 = 5;
                                                    iVar8 = iVar2;
                                                } else {
                                                    z24 = true;
                                                    if (i43 > 0) {
                                                        iVar8 = iVar2;
                                                        z25 = true;
                                                        z26 = true;
                                                        z27 = true;
                                                        i29 = 6;
                                                        c10 = 5;
                                                        i30 = 5;
                                                    } else if (i43 != 0 || i25 != 0) {
                                                        iVar8 = iVar2;
                                                        z25 = true;
                                                        z26 = true;
                                                        z27 = true;
                                                        i29 = 6;
                                                        c10 = 5;
                                                        i30 = 4;
                                                    } else if (z18) {
                                                        iVar8 = iVar2;
                                                        i28 = (eVar10 == I || eVar11 == I) ? 5 : 4;
                                                        z25 = true;
                                                        z26 = true;
                                                        z27 = true;
                                                        i29 = 6;
                                                        c10 = 5;
                                                        i30 = 4;
                                                    } else {
                                                        iVar8 = iVar2;
                                                        z25 = true;
                                                        z26 = true;
                                                        z27 = true;
                                                        i29 = 6;
                                                        c10 = 5;
                                                        i30 = 8;
                                                    }
                                                    i28 = 5;
                                                }
                                                if (z26) {
                                                }
                                                z28 = z24;
                                                if (z25) {
                                                }
                                                z31 = z28;
                                                if (this.f22370s0 != i32) {
                                                }
                                                f3.i iVar1322 = iVar10;
                                                if (z26) {
                                                }
                                                if (z30) {
                                                }
                                                eVar6 = eVar;
                                                i34 = i30;
                                                i35 = i28;
                                                if (z31) {
                                                }
                                                if (z30) {
                                                }
                                                i27 = 5;
                                                if (z30) {
                                                }
                                            } else {
                                                z24 = true;
                                                iVar8 = iVar2;
                                                i29 = 6;
                                                c10 = 5;
                                                i30 = 4;
                                                i28 = 5;
                                                z25 = false;
                                                z26 = false;
                                            }
                                            z25 = true;
                                            z26 = true;
                                            if (z26) {
                                            }
                                            z28 = z24;
                                            if (z25) {
                                            }
                                            z31 = z28;
                                            if (this.f22370s0 != i32) {
                                            }
                                            f3.i iVar13222 = iVar10;
                                            if (z26) {
                                            }
                                            if (z30) {
                                            }
                                            eVar6 = eVar;
                                            i34 = i30;
                                            i35 = i28;
                                            if (z31) {
                                            }
                                            if (z30) {
                                            }
                                            i27 = 5;
                                            if (z30) {
                                            }
                                        }
                                        if (z30 || !z23) {
                                            return;
                                        }
                                        if (dVar3.f22328f != null) {
                                            i26 = dVar3.e();
                                        }
                                        if (iVar7 != iVar2) {
                                            if (!this.f22351j || !iVar5.f17615v || (eVar8 = this.f22334a0) == null) {
                                                dVar.h(iVar2, iVar5, i26, i27);
                                                return;
                                            }
                                            f fVar = (f) eVar8;
                                            if (z10) {
                                                fVar.u1(dVar3);
                                                return;
                                            } else {
                                                fVar.z1(dVar3);
                                                return;
                                            }
                                        }
                                        return;
                                    }
                                    z24 = true;
                                    if (iVar4.f17615v && iVar6.f17615v) {
                                        dVar.c(q12, iVar4, dVar2.e(), f10, iVar6, iVar5, dVar3.e(), 8);
                                        if (z11 && z23) {
                                            if (dVar3.f22328f != null) {
                                                i31 = dVar3.e();
                                                iVar9 = iVar2;
                                            } else {
                                                iVar9 = iVar2;
                                                i31 = 0;
                                            }
                                            if (iVar6 != iVar9) {
                                                dVar.h(iVar9, iVar5, i31, 5);
                                                return;
                                            }
                                            return;
                                        }
                                        return;
                                    }
                                    iVar8 = iVar2;
                                    c10 = 5;
                                    i28 = 5;
                                    z25 = true;
                                    z26 = true;
                                    i29 = 6;
                                    i30 = 4;
                                    z27 = false;
                                    if (z26) {
                                    }
                                    z28 = z24;
                                    if (z25) {
                                    }
                                    z31 = z28;
                                    if (this.f22370s0 != i32) {
                                    }
                                    f3.i iVar132222 = iVar10;
                                    if (z26) {
                                    }
                                    if (z30) {
                                    }
                                    eVar6 = eVar;
                                    i34 = i30;
                                    i35 = i28;
                                    if (z31) {
                                    }
                                    if (z30) {
                                    }
                                    i27 = 5;
                                    if (z30) {
                                    }
                                } else {
                                    iVar7 = iVar6;
                                    i27 = 5;
                                }
                            } else {
                                dVar.e(iVar5, iVar6, -dVar3.e(), 8);
                                if (z11) {
                                    if (this.f22351j && q12.f17615v && (eVar7 = this.f22334a0) != null) {
                                        f fVar2 = (f) eVar7;
                                        if (z10) {
                                            fVar2.v1(dVar2);
                                        } else {
                                            fVar2.A1(dVar2);
                                        }
                                    } else {
                                        i27 = 5;
                                        i26 = 0;
                                        dVar.h(q12, iVar, 0, 5);
                                        iVar7 = iVar6;
                                    }
                                }
                            }
                            z30 = z11;
                            if (z30) {
                                return;
                            } else {
                                return;
                            }
                        }
                        z30 = z11;
                        i27 = (z11 && (dVar2.f22328f.f22326d instanceof i3.a)) ? 8 : 5;
                        iVar7 = iVar6;
                        i26 = 0;
                        if (z30) {
                        }
                    }
                    iVar7 = iVar6;
                    i27 = 5;
                    i26 = 0;
                    z30 = z11;
                    if (z30) {
                    }
                } else {
                    int max = Math.max(i16, i21);
                    if (i43 > 0) {
                        max = Math.min(i43, max);
                    }
                    dVar.e(q13, q12, max, 8);
                    z23 = z13;
                    i24 = i44;
                    iVar4 = q14;
                    iVar5 = q13;
                    iVar6 = iVar3;
                    z22 = false;
                }
                i25 = i16;
                if (z20) {
                }
                if (i24 < 2) {
                    return;
                } else {
                    return;
                }
            }
        }
        z21 = false;
        i19 = this.f22355l;
        if (i19 != -1) {
            this.f22355l = -1;
            i11 = i19;
            z21 = false;
        }
        i20 = this.f22357m;
        if (i20 != -1) {
        }
        i20 = i11;
        int i472 = i20;
        if (this.f22370s0 != 8) {
        }
        if (z20) {
        }
        if (z21) {
        }
        i25 = i16;
        if (z20) {
        }
        if (i24 < 2) {
        }
    }

    private void u0(StringBuilder sb2, String str, float f10, float f11) {
        if (f10 == f11) {
            return;
        }
        sb2.append(str);
        sb2.append(" :   ");
        sb2.append(f10);
        sb2.append(",\n");
    }

    private void v0(StringBuilder sb2, String str, int i10, int i11) {
        if (i10 == i11) {
            return;
        }
        sb2.append(str);
        sb2.append(" :   ");
        sb2.append(i10);
        sb2.append(",\n");
    }

    private void w0(StringBuilder sb2, String str, float f10, int i10) {
        if (f10 == BitmapDescriptorFactory.HUE_RED) {
            return;
        }
        sb2.append(str);
        sb2.append(" :  [");
        sb2.append(f10);
        sb2.append(",");
        sb2.append(i10);
        sb2.append("");
        sb2.append("],\n");
    }

    public int A() {
        return this.M;
    }

    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:38:0x0086 -> B:31:0x0087). Please report as a decompilation issue!!! */
    public void A0(String str) {
        float f10;
        int i10 = 0;
        if (str == null || str.length() == 0) {
            this.f22340d0 = BitmapDescriptorFactory.HUE_RED;
            return;
        }
        int length = str.length();
        int indexOf = str.indexOf(44);
        int i11 = -1;
        if (indexOf > 0 && indexOf < length - 1) {
            String substring = str.substring(0, indexOf);
            i11 = substring.equalsIgnoreCase("W") ? 0 : substring.equalsIgnoreCase("H") ? 1 : -1;
            r3 = indexOf + 1;
        }
        int indexOf2 = str.indexOf(58);
        if (indexOf2 < 0 || indexOf2 >= length - 1) {
            String substring2 = str.substring(r3);
            if (substring2.length() > 0) {
                f10 = Float.parseFloat(substring2);
            }
            f10 = i10;
        } else {
            String substring3 = str.substring(r3, indexOf2);
            String substring4 = str.substring(indexOf2 + 1);
            if (substring3.length() > 0 && substring4.length() > 0) {
                float parseFloat = Float.parseFloat(substring3);
                float parseFloat2 = Float.parseFloat(substring4);
                if (parseFloat > BitmapDescriptorFactory.HUE_RED && parseFloat2 > BitmapDescriptorFactory.HUE_RED) {
                    f10 = i11 == 1 ? Math.abs(parseFloat2 / parseFloat) : Math.abs(parseFloat / parseFloat2);
                }
            }
            f10 = i10;
        }
        i10 = (f10 > i10 ? 1 : (f10 == i10 ? 0 : -1));
        if (i10 > 0) {
            this.f22340d0 = f10;
            this.f22342e0 = i11;
        }
    }

    public int B() {
        return this.N;
    }

    public void B0(int i10) {
        if (this.J) {
            int i11 = i10 - this.f22356l0;
            int i12 = this.f22338c0 + i11;
            this.f22346g0 = i11;
            this.P.s(i11);
            this.R.s(i12);
            this.S.s(i10);
            this.f22365q = true;
        }
    }

    public int C(int i10) {
        if (i10 == 0) {
            return U();
        }
        if (i10 == 1) {
            return v();
        }
        return 0;
    }

    public void C0(int i10, int i11) {
        if (this.f22363p) {
            return;
        }
        this.O.s(i10);
        this.Q.s(i11);
        this.f22344f0 = i10;
        this.f22336b0 = i11 - i10;
        this.f22363p = true;
    }

    public int D() {
        return this.H[1];
    }

    public void D0(int i10) {
        this.O.s(i10);
        this.f22344f0 = i10;
    }

    public int E() {
        return this.H[0];
    }

    public void E0(int i10) {
        this.P.s(i10);
        this.f22346g0 = i10;
    }

    public int F() {
        return this.f22360n0;
    }

    public void F0(int i10, int i11) {
        if (this.f22365q) {
            return;
        }
        this.P.s(i10);
        this.R.s(i11);
        this.f22346g0 = i10;
        this.f22338c0 = i11 - i10;
        if (this.J) {
            this.S.s(i10 + this.f22356l0);
        }
        this.f22365q = true;
    }

    public int G() {
        return this.f22358m0;
    }

    public void G0(int i10, int i11, int i12, int i13) {
        int i14;
        int i15;
        int i16 = i12 - i10;
        int i17 = i13 - i11;
        this.f22344f0 = i10;
        this.f22346g0 = i11;
        if (this.f22370s0 == 8) {
            this.f22336b0 = 0;
            this.f22338c0 = 0;
            return;
        }
        b[] bVarArr = this.Z;
        b bVar = bVarArr[0];
        b bVar2 = b.FIXED;
        if (bVar == bVar2 && i16 < (i15 = this.f22336b0)) {
            i16 = i15;
        }
        if (bVarArr[1] == bVar2 && i17 < (i14 = this.f22338c0)) {
            i17 = i14;
        }
        this.f22336b0 = i16;
        this.f22338c0 = i17;
        int i18 = this.f22360n0;
        if (i17 < i18) {
            this.f22338c0 = i18;
        }
        int i19 = this.f22358m0;
        if (i16 < i19) {
            this.f22336b0 = i19;
        }
        int i20 = this.A;
        if (i20 > 0 && bVar == b.MATCH_CONSTRAINT) {
            this.f22336b0 = Math.min(this.f22336b0, i20);
        }
        int i21 = this.D;
        if (i21 > 0 && this.Z[1] == b.MATCH_CONSTRAINT) {
            this.f22338c0 = Math.min(this.f22338c0, i21);
        }
        int i22 = this.f22336b0;
        if (i16 != i22) {
            this.f22355l = i22;
        }
        int i23 = this.f22338c0;
        if (i17 != i23) {
            this.f22357m = i23;
        }
    }

    public e H(int i10) {
        d dVar;
        d dVar2;
        if (i10 != 0) {
            if (i10 == 1 && (dVar2 = (dVar = this.R).f22328f) != null && dVar2.f22328f == dVar) {
                return dVar2.f22326d;
            }
            return null;
        }
        d dVar3 = this.Q;
        d dVar4 = dVar3.f22328f;
        if (dVar4 == null || dVar4.f22328f != dVar3) {
            return null;
        }
        return dVar4.f22326d;
    }

    public void H0(boolean z10) {
        this.J = z10;
    }

    public e I() {
        return this.f22334a0;
    }

    public void I0(int i10) {
        this.f22338c0 = i10;
        int i11 = this.f22360n0;
        if (i10 < i11) {
            this.f22338c0 = i11;
        }
    }

    public e J(int i10) {
        d dVar;
        d dVar2;
        if (i10 != 0) {
            if (i10 == 1 && (dVar2 = (dVar = this.P).f22328f) != null && dVar2.f22328f == dVar) {
                return dVar2.f22326d;
            }
            return null;
        }
        d dVar3 = this.O;
        d dVar4 = dVar3.f22328f;
        if (dVar4 == null || dVar4.f22328f != dVar3) {
            return null;
        }
        return dVar4.f22326d;
    }

    public void J0(float f10) {
        this.f22362o0 = f10;
    }

    public int K() {
        return V() + this.f22336b0;
    }

    public void K0(int i10) {
        this.f22384z0 = i10;
    }

    public p L(int i10) {
        if (i10 == 0) {
            return this.f22341e;
        }
        if (i10 == 1) {
            return this.f22343f;
        }
        return null;
    }

    public void L0(int i10, int i11) {
        this.f22344f0 = i10;
        int i12 = i11 - i10;
        this.f22336b0 = i12;
        int i13 = this.f22358m0;
        if (i12 < i13) {
            this.f22336b0 = i13;
        }
    }

    public void M(StringBuilder sb2) {
        sb2.append("  " + this.f22361o + ":{\n");
        StringBuilder sb3 = new StringBuilder();
        sb3.append("    actualWidth:");
        sb3.append(this.f22336b0);
        sb2.append(sb3.toString());
        sb2.append("\n");
        sb2.append("    actualHeight:" + this.f22338c0);
        sb2.append("\n");
        sb2.append("    actualLeft:" + this.f22344f0);
        sb2.append("\n");
        sb2.append("    actualTop:" + this.f22346g0);
        sb2.append("\n");
        O(sb2, "left", this.O);
        O(sb2, "top", this.P);
        O(sb2, "right", this.Q);
        O(sb2, "bottom", this.R);
        O(sb2, "baseline", this.S);
        O(sb2, "centerX", this.T);
        O(sb2, "centerY", this.U);
        N(sb2, "    width", this.f22336b0, this.f22358m0, this.H[0], this.f22355l, this.f22383z, this.f22377w, this.B, this.D0[0]);
        N(sb2, "    height", this.f22338c0, this.f22360n0, this.H[1], this.f22357m, this.C, this.f22379x, this.E, this.D0[1]);
        w0(sb2, "    dimensionRatio", this.f22340d0, this.f22342e0);
        u0(sb2, "    horizontalBias", this.f22362o0, K0);
        u0(sb2, "    verticalBias", this.f22364p0, K0);
        v0(sb2, "    horizontalChainStyle", this.f22384z0, 0);
        v0(sb2, "    verticalChainStyle", this.A0, 0);
        sb2.append("  }");
    }

    public void M0(b bVar) {
        this.Z[0] = bVar;
    }

    public void N0(int i10, int i11, int i12, float f10) {
        this.f22377w = i10;
        this.f22383z = i11;
        if (i12 == Integer.MAX_VALUE) {
            i12 = 0;
        }
        this.A = i12;
        this.B = f10;
        if (f10 <= BitmapDescriptorFactory.HUE_RED || f10 >= 1.0f || i10 != 0) {
            return;
        }
        this.f22377w = 2;
    }

    public void O0(float f10) {
        this.D0[0] = f10;
    }

    public float P() {
        return this.f22364p0;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public void P0(int i10, boolean z10) {
        this.Y[i10] = z10;
    }

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

    public void Q0(boolean z10) {
        this.K = z10;
    }

    public b R() {
        return this.Z[1];
    }

    public void R0(int i10, int i11) {
        this.M = i10;
        this.N = i11;
        U0(false);
    }

    public int S() {
        int i10 = this.O != null ? 0 + this.P.f22329g : 0;
        return this.Q != null ? i10 + this.R.f22329g : i10;
    }

    public void S0(int i10) {
        this.H[1] = i10;
    }

    public int T() {
        return this.f22370s0;
    }

    public void T0(int i10) {
        this.H[0] = i10;
    }

    public int U() {
        if (this.f22370s0 == 8) {
            return 0;
        }
        return this.f22336b0;
    }

    public void U0(boolean z10) {
        this.f22349i = z10;
    }

    public int V() {
        e eVar = this.f22334a0;
        return (eVar == null || !(eVar instanceof f)) ? this.f22344f0 : ((f) eVar).S0 + this.f22344f0;
    }

    public void V0(int i10) {
        if (i10 < 0) {
            this.f22360n0 = 0;
        } else {
            this.f22360n0 = i10;
        }
    }

    public int W() {
        e eVar = this.f22334a0;
        return (eVar == null || !(eVar instanceof f)) ? this.f22346g0 : ((f) eVar).T0 + this.f22346g0;
    }

    public void W0(int i10) {
        if (i10 < 0) {
            this.f22358m0 = 0;
        } else {
            this.f22358m0 = i10;
        }
    }

    public boolean X() {
        return this.J;
    }

    public void X0(int i10, int i11) {
        this.f22344f0 = i10;
        this.f22346g0 = i11;
    }

    public boolean Y(int i10) {
        if (i10 == 0) {
            return (this.O.f22328f != null ? 1 : 0) + (this.Q.f22328f != null ? 1 : 0) < 2;
        }
        return ((this.P.f22328f != null ? 1 : 0) + (this.R.f22328f != null ? 1 : 0)) + (this.S.f22328f != null ? 1 : 0) < 2;
    }

    public void Y0(e eVar) {
        this.f22334a0 = eVar;
    }

    public boolean Z() {
        int size = this.X.size();
        for (int i10 = 0; i10 < size; i10++) {
            if (((d) this.X.get(i10)).l()) {
                return true;
            }
        }
        return false;
    }

    public void Z0(float f10) {
        this.f22364p0 = f10;
    }

    public boolean a0() {
        return (this.f22355l == -1 && this.f22357m == -1) ? false : true;
    }

    public void a1(int i10) {
        this.A0 = i10;
    }

    public boolean b0(int i10, int i11) {
        d dVar;
        d dVar2;
        if (i10 == 0) {
            d dVar3 = this.O.f22328f;
            return dVar3 != null && dVar3.m() && (dVar2 = this.Q.f22328f) != null && dVar2.m() && (this.Q.f22328f.d() - this.Q.e()) - (this.O.f22328f.d() + this.O.e()) >= i11;
        }
        d dVar4 = this.P.f22328f;
        return dVar4 != null && dVar4.m() && (dVar = this.R.f22328f) != null && dVar.m() && (this.R.f22328f.d() - this.R.e()) - (this.P.f22328f.d() + this.P.e()) >= i11;
        return false;
    }

    public void b1(int i10, int i11) {
        this.f22346g0 = i10;
        int i12 = i11 - i10;
        this.f22338c0 = i12;
        int i13 = this.f22360n0;
        if (i12 < i13) {
            this.f22338c0 = i13;
        }
    }

    public void c0(d.b bVar, e eVar, d.b bVar2, int i10, int i11) {
        m(bVar).a(eVar.m(bVar2), i10, i11, true);
    }

    public void c1(b bVar) {
        this.Z[1] = bVar;
    }

    public void d1(int i10, int i11, int i12, float f10) {
        this.f22379x = i10;
        this.C = i11;
        if (i12 == Integer.MAX_VALUE) {
            i12 = 0;
        }
        this.D = i12;
        this.E = f10;
        if (f10 <= BitmapDescriptorFactory.HUE_RED || f10 >= 1.0f || i10 != 0) {
            return;
        }
        this.f22379x = 2;
    }

    public void e(f fVar, f3.d dVar, HashSet hashSet, int i10, boolean z10) {
        if (z10) {
            if (!hashSet.contains(this)) {
                return;
            }
            j.a(fVar, dVar, this);
            hashSet.remove(this);
            g(dVar, fVar.O1(64));
        }
        if (i10 == 0) {
            HashSet c10 = this.O.c();
            if (c10 != null) {
                Iterator it = c10.iterator();
                while (it.hasNext()) {
                    ((d) it.next()).f22326d.e(fVar, dVar, hashSet, i10, true);
                }
            }
            HashSet c11 = this.Q.c();
            if (c11 != null) {
                Iterator it2 = c11.iterator();
                while (it2.hasNext()) {
                    ((d) it2.next()).f22326d.e(fVar, dVar, hashSet, i10, true);
                }
                return;
            }
            return;
        }
        HashSet c12 = this.P.c();
        if (c12 != null) {
            Iterator it3 = c12.iterator();
            while (it3.hasNext()) {
                ((d) it3.next()).f22326d.e(fVar, dVar, hashSet, i10, true);
            }
        }
        HashSet c13 = this.R.c();
        if (c13 != null) {
            Iterator it4 = c13.iterator();
            while (it4.hasNext()) {
                ((d) it4.next()).f22326d.e(fVar, dVar, hashSet, i10, true);
            }
        }
        HashSet c14 = this.S.c();
        if (c14 != null) {
            Iterator it5 = c14.iterator();
            while (it5.hasNext()) {
                ((d) it5.next()).f22326d.e(fVar, dVar, hashSet, i10, true);
            }
        }
    }

    public boolean e0() {
        return this.f22367r;
    }

    public void e1(float f10) {
        this.D0[1] = f10;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public boolean f() {
        return this instanceof g;
    }

    public boolean f0(int i10) {
        return this.Y[i10];
    }

    public void f1(int i10) {
        this.f22370s0 = i10;
    }

    /* JADX WARN: Removed duplicated region for block: B:102:0x021c  */
    /* JADX WARN: Removed duplicated region for block: B:124:0x02ba  */
    /* JADX WARN: Removed duplicated region for block: B:129:0x02c9  */
    /* JADX WARN: Removed duplicated region for block: B:135:0x02de  */
    /* JADX WARN: Removed duplicated region for block: B:139:0x02e7  */
    /* JADX WARN: Removed duplicated region for block: B:142:0x0303  */
    /* JADX WARN: Removed duplicated region for block: B:152:0x031c  */
    /* JADX WARN: Removed duplicated region for block: B:162:0x0429  */
    /* JADX WARN: Removed duplicated region for block: B:178:0x04a1  */
    /* JADX WARN: Removed duplicated region for block: B:180:0x04a6  */
    /* JADX WARN: Removed duplicated region for block: B:202:0x0541  */
    /* JADX WARN: Removed duplicated region for block: B:205:0x058a  */
    /* JADX WARN: Removed duplicated region for block: B:210:0x05bf  */
    /* JADX WARN: Removed duplicated region for block: B:214:0x05b5  */
    /* JADX WARN: Removed duplicated region for block: B:215:0x0544  */
    /* JADX WARN: Removed duplicated region for block: B:230:0x04a3  */
    /* JADX WARN: Removed duplicated region for block: B:235:0x048d  */
    /* JADX WARN: Removed duplicated region for block: B:236:0x0366  */
    /* JADX WARN: Removed duplicated region for block: B:239:0x0376  */
    /* JADX WARN: Removed duplicated region for block: B:242:0x0384  */
    /* JADX WARN: Removed duplicated region for block: B:245:0x03b1  */
    /* JADX WARN: Removed duplicated region for block: B:247:0x03b4  */
    /* JADX WARN: Removed duplicated region for block: B:248:0x038d  */
    /* JADX WARN: Removed duplicated region for block: B:249:0x037e  */
    /* JADX WARN: Removed duplicated region for block: B:251:0x02ea  */
    /* JADX WARN: Removed duplicated region for block: B:255:0x02c4  */
    /* JADX WARN: Removed duplicated region for block: B:275:0x021e  */
    /* JADX WARN: Removed duplicated region for block: B:276:0x0211  */
    /* JADX WARN: Removed duplicated region for block: B:279:0x01f1  */
    /* JADX WARN: Removed duplicated region for block: B:281:0x007d  */
    /* JADX WARN: Removed duplicated region for block: B:291:0x00ae  */
    /* JADX WARN: Removed duplicated region for block: B:48:0x0149  */
    /* JADX WARN: Removed duplicated region for block: B:64:0x0184  */
    /* JADX WARN: Removed duplicated region for block: B:93:0x01fc  */
    /* JADX WARN: Removed duplicated region for block: B:96:0x0204  */
    /* JADX WARN: Removed duplicated region for block: B:99:0x020f  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void g(f3.d dVar, boolean z10) {
        boolean z11;
        boolean z12;
        boolean z13;
        e eVar;
        e eVar2;
        boolean z14;
        boolean z15;
        int i10;
        int i11;
        int i12;
        int i13;
        int i14;
        int i15;
        float f10;
        int i16;
        int i17;
        int i18;
        int i19;
        int i20;
        int i21;
        boolean z16;
        int i22;
        boolean z17;
        b bVar;
        boolean z18;
        int i23;
        boolean z19;
        boolean z20;
        boolean z21;
        boolean z22;
        b bVar2;
        b bVar3;
        f3.i iVar;
        f3.i iVar2;
        f3.i iVar3;
        f3.i iVar4;
        f3.i iVar5;
        boolean z23;
        int i24;
        int i25;
        int i26;
        e eVar3;
        f3.d dVar2;
        f3.i iVar6;
        f3.i iVar7;
        f3.i iVar8;
        int i27;
        f3.i iVar9;
        f3.i iVar10;
        e eVar4;
        boolean z24;
        l lVar;
        j3.f fVar;
        int i28;
        int i29;
        boolean g02;
        boolean i02;
        l lVar2;
        n nVar;
        j3.f fVar2;
        boolean[] zArr;
        f3.i q10 = dVar.q(this.O);
        f3.i q11 = dVar.q(this.Q);
        f3.i q12 = dVar.q(this.P);
        f3.i q13 = dVar.q(this.R);
        f3.i q14 = dVar.q(this.S);
        e eVar5 = this.f22334a0;
        if (eVar5 != null) {
            boolean z25 = eVar5 != null && eVar5.Z[0] == b.WRAP_CONTENT;
            boolean z26 = eVar5 != null && eVar5.Z[1] == b.WRAP_CONTENT;
            int i30 = this.f22375v;
            if (i30 == 1) {
                z11 = z25;
                z12 = false;
            } else if (i30 == 2) {
                z12 = z26;
                z11 = false;
            } else if (i30 != 3) {
                z12 = z26;
                z11 = z25;
            }
            if (this.f22370s0 == 8 && !this.f22372t0 && !Z()) {
                zArr = this.Y;
                if (!zArr[0] && !zArr[1]) {
                    return;
                }
            }
            z13 = this.f22363p;
            if (!z13 || this.f22365q) {
                if (z13) {
                    dVar.f(q10, this.f22344f0);
                    dVar.f(q11, this.f22344f0 + this.f22336b0);
                    if (z11 && (eVar2 = this.f22334a0) != null) {
                        if (this.f22353k) {
                            f fVar3 = (f) eVar2;
                            fVar3.v1(this.O);
                            fVar3.u1(this.Q);
                        } else {
                            dVar.h(dVar.q(eVar2.Q), q11, 0, 5);
                        }
                    }
                }
                if (this.f22365q) {
                    dVar.f(q12, this.f22346g0);
                    dVar.f(q13, this.f22346g0 + this.f22338c0);
                    if (this.S.l()) {
                        dVar.f(q14, this.f22346g0 + this.f22356l0);
                    }
                    if (z12 && (eVar = this.f22334a0) != null) {
                        if (this.f22353k) {
                            f fVar4 = (f) eVar;
                            fVar4.A1(this.P);
                            fVar4.z1(this.R);
                        } else {
                            dVar.h(dVar.q(eVar.R), q13, 0, 5);
                        }
                    }
                }
                if (this.f22363p && this.f22365q) {
                    this.f22363p = false;
                    this.f22365q = false;
                    return;
                }
            }
            boolean z27 = f3.d.f17571r;
            if (z10 && (lVar2 = this.f22341e) != null && (nVar = this.f22343f) != null) {
                fVar2 = lVar2.f23956h;
                if (fVar2.f23914j && lVar2.f23957i.f23914j && nVar.f23956h.f23914j && nVar.f23957i.f23914j) {
                    dVar.f(q10, fVar2.f23911g);
                    dVar.f(q11, this.f22341e.f23957i.f23911g);
                    dVar.f(q12, this.f22343f.f23956h.f23911g);
                    dVar.f(q13, this.f22343f.f23957i.f23911g);
                    dVar.f(q14, this.f22343f.f23931k.f23911g);
                    if (this.f22334a0 != null) {
                        if (z11 && this.f22345g[0] && !g0()) {
                            dVar.h(dVar.q(this.f22334a0.Q), q11, 0, 8);
                        }
                        if (z12 && this.f22345g[1] && !i0()) {
                            dVar.h(dVar.q(this.f22334a0.R), q13, 0, 8);
                        }
                    }
                    this.f22363p = false;
                    this.f22365q = false;
                    return;
                }
            }
            if (this.f22334a0 == null) {
                if (d0(0)) {
                    ((f) this.f22334a0).r1(this, 0);
                    g02 = true;
                } else {
                    g02 = g0();
                }
                if (d0(1)) {
                    ((f) this.f22334a0).r1(this, 1);
                    i02 = true;
                } else {
                    i02 = i0();
                }
                if (!g02 && z11 && this.f22370s0 != 8 && this.O.f22328f == null && this.Q.f22328f == null) {
                    dVar.h(dVar.q(this.f22334a0.Q), q11, 0, 1);
                }
                if (!i02 && z12 && this.f22370s0 != 8 && this.P.f22328f == null && this.R.f22328f == null && this.S == null) {
                    dVar.h(dVar.q(this.f22334a0.R), q13, 0, 1);
                }
                z15 = g02;
                z14 = i02;
            } else {
                z14 = false;
                z15 = false;
            }
            i10 = this.f22336b0;
            i11 = this.f22358m0;
            if (i10 >= i11) {
                i11 = i10;
            }
            i12 = this.f22338c0;
            i13 = this.f22360n0;
            if (i12 >= i13) {
                i13 = i12;
            }
            b[] bVarArr = this.Z;
            b bVar4 = bVarArr[0];
            b bVar5 = b.MATCH_CONSTRAINT;
            i14 = i11;
            boolean z28 = bVar4 == bVar5;
            b bVar6 = bVarArr[1];
            i15 = i13;
            boolean z29 = bVar6 == bVar5;
            int i31 = this.f22342e0;
            this.F = i31;
            f10 = this.f22340d0;
            this.G = f10;
            i16 = this.f22377w;
            i17 = this.f22379x;
            if (f10 <= BitmapDescriptorFactory.HUE_RED && this.f22370s0 != 8) {
                if (bVar4 == bVar5 && i16 == 0) {
                    i16 = 3;
                }
                if (bVar6 == bVar5 && i17 == 0) {
                    i17 = 3;
                }
                if (bVar4 == bVar5 && bVar6 == bVar5) {
                    i29 = 3;
                    if (i16 == 3 && i17 == 3) {
                        k1(z11, z12, z28, z29);
                        i18 = i16;
                        i19 = i17;
                        i20 = i14;
                        i21 = i15;
                        z16 = true;
                        int[] iArr = this.f22381y;
                        iArr[0] = i18;
                        iArr[1] = i19;
                        this.f22347h = z16;
                        if (z16) {
                            int i32 = this.F;
                            i22 = -1;
                            if (i32 == 0 || i32 == -1) {
                                z17 = true;
                                boolean z30 = !z16 && ((i28 = this.F) == 1 || i28 == i22);
                                b bVar7 = this.Z[0];
                                bVar = b.WRAP_CONTENT;
                                z18 = bVar7 != bVar && (this instanceof f);
                                i23 = !z18 ? 0 : i20;
                                z19 = !this.V.n();
                                boolean[] zArr2 = this.Y;
                                z20 = zArr2[0];
                                boolean z31 = zArr2[1];
                                if (this.f22371t != 2 && !this.f22363p) {
                                    if (z10 && (lVar = this.f22341e) != null) {
                                        fVar = lVar.f23956h;
                                        if (fVar.f23914j && lVar.f23957i.f23914j) {
                                            if (!z10) {
                                                dVar.f(q10, fVar.f23911g);
                                                dVar.f(q11, this.f22341e.f23957i.f23911g);
                                                if (this.f22334a0 != null && z11 && this.f22345g[0] && !g0()) {
                                                    dVar.h(dVar.q(this.f22334a0.Q), q11, 0, 8);
                                                }
                                                z21 = z11;
                                                z22 = z12;
                                                bVar2 = bVar5;
                                                bVar3 = bVar;
                                                z23 = z16;
                                                iVar = q14;
                                                iVar2 = q13;
                                                iVar3 = q12;
                                                iVar4 = q11;
                                                iVar5 = q10;
                                                if (z10) {
                                                    eVar3 = this;
                                                    n nVar2 = eVar3.f22343f;
                                                    if (nVar2 != null) {
                                                        j3.f fVar5 = nVar2.f23956h;
                                                        if (fVar5.f23914j && nVar2.f23957i.f23914j) {
                                                            dVar2 = dVar;
                                                            iVar8 = iVar3;
                                                            dVar2.f(iVar8, fVar5.f23911g);
                                                            iVar7 = iVar2;
                                                            dVar2.f(iVar7, eVar3.f22343f.f23957i.f23911g);
                                                            iVar6 = iVar;
                                                            dVar2.f(iVar6, eVar3.f22343f.f23931k.f23911g);
                                                            e eVar6 = eVar3.f22334a0;
                                                            if (eVar6 == null || z14 || !z22) {
                                                                i24 = 8;
                                                                i25 = 0;
                                                                i26 = 1;
                                                            } else {
                                                                i26 = 1;
                                                                if (eVar3.f22345g[1]) {
                                                                    i24 = 8;
                                                                    i25 = 0;
                                                                    dVar2.h(dVar2.q(eVar6.R), iVar7, 0, 8);
                                                                } else {
                                                                    i24 = 8;
                                                                    i25 = 0;
                                                                }
                                                            }
                                                            i27 = i25;
                                                            if ((eVar3.f22373u != 2 ? i25 : i27) != 0 || eVar3.f22365q) {
                                                                iVar9 = iVar7;
                                                                iVar10 = iVar8;
                                                            } else {
                                                                boolean z32 = (eVar3.Z[i26] == bVar3 && (eVar3 instanceof f)) ? i26 : i25;
                                                                if (z32) {
                                                                    i21 = i25;
                                                                }
                                                                e eVar7 = eVar3.f22334a0;
                                                                f3.i q15 = eVar7 != null ? dVar2.q(eVar7.R) : null;
                                                                e eVar8 = eVar3.f22334a0;
                                                                f3.i q16 = eVar8 != null ? dVar2.q(eVar8.P) : null;
                                                                if (eVar3.f22356l0 > 0 || eVar3.f22370s0 == i24) {
                                                                    d dVar3 = eVar3.S;
                                                                    if (dVar3.f22328f != null) {
                                                                        dVar2.e(iVar6, iVar8, n(), i24);
                                                                        dVar2.e(iVar6, dVar2.q(eVar3.S.f22328f), eVar3.S.e(), i24);
                                                                        if (z22) {
                                                                            dVar2.h(q15, dVar2.q(eVar3.R), i25, 5);
                                                                        }
                                                                        z24 = i25;
                                                                        boolean z33 = eVar3.f22345g[i26];
                                                                        b[] bVarArr2 = eVar3.Z;
                                                                        iVar9 = iVar7;
                                                                        iVar10 = iVar8;
                                                                        i(dVar, false, z22, z21, z33, q16, q15, bVarArr2[i26], z32, eVar3.P, eVar3.R, eVar3.f22346g0, i21, eVar3.f22360n0, eVar3.H[i26], eVar3.f22364p0, z30, bVarArr2[0] != bVar2, z14, z15, z31, i19, i18, eVar3.C, eVar3.D, eVar3.E, z24);
                                                                    } else if (eVar3.f22370s0 == i24) {
                                                                        dVar2.e(iVar6, iVar8, dVar3.e(), i24);
                                                                    } else {
                                                                        dVar2.e(iVar6, iVar8, n(), i24);
                                                                    }
                                                                }
                                                                z24 = z19;
                                                                boolean z332 = eVar3.f22345g[i26];
                                                                b[] bVarArr22 = eVar3.Z;
                                                                iVar9 = iVar7;
                                                                iVar10 = iVar8;
                                                                i(dVar, false, z22, z21, z332, q16, q15, bVarArr22[i26], z32, eVar3.P, eVar3.R, eVar3.f22346g0, i21, eVar3.f22360n0, eVar3.H[i26], eVar3.f22364p0, z30, bVarArr22[0] != bVar2, z14, z15, z31, i19, i18, eVar3.C, eVar3.D, eVar3.E, z24);
                                                            }
                                                            if (z23) {
                                                                eVar4 = this;
                                                            } else {
                                                                eVar4 = this;
                                                                if (eVar4.F == 1) {
                                                                    dVar.k(iVar9, iVar10, iVar4, iVar5, eVar4.G, 8);
                                                                } else {
                                                                    dVar.k(iVar4, iVar5, iVar9, iVar10, eVar4.G, 8);
                                                                }
                                                            }
                                                            if (eVar4.V.n()) {
                                                                dVar.b(eVar4, eVar4.V.i().g(), (float) Math.toRadians(eVar4.I + 90.0f), eVar4.V.e());
                                                            }
                                                            eVar4.f22363p = false;
                                                            eVar4.f22365q = false;
                                                        }
                                                    }
                                                    dVar2 = dVar;
                                                    iVar6 = iVar;
                                                    iVar7 = iVar2;
                                                    iVar8 = iVar3;
                                                    i24 = 8;
                                                    i25 = 0;
                                                    i26 = 1;
                                                } else {
                                                    i24 = 8;
                                                    i25 = 0;
                                                    i26 = 1;
                                                    eVar3 = this;
                                                    dVar2 = dVar;
                                                    iVar6 = iVar;
                                                    iVar7 = iVar2;
                                                    iVar8 = iVar3;
                                                }
                                                i27 = i26;
                                                if ((eVar3.f22373u != 2 ? i25 : i27) != 0) {
                                                }
                                                iVar9 = iVar7;
                                                iVar10 = iVar8;
                                                if (z23) {
                                                }
                                                if (eVar4.V.n()) {
                                                }
                                                eVar4.f22363p = false;
                                                eVar4.f22365q = false;
                                            }
                                        }
                                    }
                                    e eVar9 = this.f22334a0;
                                    f3.i q17 = eVar9 == null ? dVar.q(eVar9.Q) : null;
                                    e eVar10 = this.f22334a0;
                                    f3.i q18 = eVar10 == null ? dVar.q(eVar10.O) : null;
                                    boolean z34 = this.f22345g[0];
                                    b[] bVarArr3 = this.Z;
                                    z21 = z11;
                                    z22 = z12;
                                    bVar2 = bVar5;
                                    iVar = q14;
                                    iVar2 = q13;
                                    iVar3 = q12;
                                    iVar4 = q11;
                                    bVar3 = bVar;
                                    iVar5 = q10;
                                    z23 = z16;
                                    i(dVar, true, z11, z12, z34, q18, q17, bVarArr3[0], z18, this.O, this.Q, this.f22344f0, i23, this.f22358m0, this.H[0], this.f22362o0, z17, bVarArr3[1] != bVar5, z15, z14, z20, i18, i19, this.f22383z, this.A, this.B, z19);
                                    if (z10) {
                                    }
                                    i27 = i26;
                                    if ((eVar3.f22373u != 2 ? i25 : i27) != 0) {
                                    }
                                    iVar9 = iVar7;
                                    iVar10 = iVar8;
                                    if (z23) {
                                    }
                                    if (eVar4.V.n()) {
                                    }
                                    eVar4.f22363p = false;
                                    eVar4.f22365q = false;
                                }
                                z21 = z11;
                                z22 = z12;
                                bVar2 = bVar5;
                                bVar3 = bVar;
                                iVar = q14;
                                iVar2 = q13;
                                iVar3 = q12;
                                iVar4 = q11;
                                iVar5 = q10;
                                z23 = z16;
                                if (z10) {
                                }
                                i27 = i26;
                                if ((eVar3.f22373u != 2 ? i25 : i27) != 0) {
                                }
                                iVar9 = iVar7;
                                iVar10 = iVar8;
                                if (z23) {
                                }
                                if (eVar4.V.n()) {
                                }
                                eVar4.f22363p = false;
                                eVar4.f22365q = false;
                            }
                        } else {
                            i22 = -1;
                        }
                        z17 = false;
                        if (z16) {
                        }
                        b bVar72 = this.Z[0];
                        bVar = b.WRAP_CONTENT;
                        if (bVar72 != bVar) {
                        }
                        if (!z18) {
                        }
                        z19 = !this.V.n();
                        boolean[] zArr22 = this.Y;
                        z20 = zArr22[0];
                        boolean z312 = zArr22[1];
                        if (this.f22371t != 2) {
                            if (z10) {
                                fVar = lVar.f23956h;
                                if (fVar.f23914j) {
                                    if (!z10) {
                                    }
                                }
                            }
                            e eVar92 = this.f22334a0;
                            if (eVar92 == null) {
                            }
                            e eVar102 = this.f22334a0;
                            if (eVar102 == null) {
                            }
                            boolean z342 = this.f22345g[0];
                            b[] bVarArr32 = this.Z;
                            z21 = z11;
                            z22 = z12;
                            bVar2 = bVar5;
                            iVar = q14;
                            iVar2 = q13;
                            iVar3 = q12;
                            iVar4 = q11;
                            bVar3 = bVar;
                            iVar5 = q10;
                            z23 = z16;
                            i(dVar, true, z11, z12, z342, q18, q17, bVarArr32[0], z18, this.O, this.Q, this.f22344f0, i23, this.f22358m0, this.H[0], this.f22362o0, z17, bVarArr32[1] != bVar5, z15, z14, z20, i18, i19, this.f22383z, this.A, this.B, z19);
                            if (z10) {
                            }
                            i27 = i26;
                            if ((eVar3.f22373u != 2 ? i25 : i27) != 0) {
                            }
                            iVar9 = iVar7;
                            iVar10 = iVar8;
                            if (z23) {
                            }
                            if (eVar4.V.n()) {
                            }
                            eVar4.f22363p = false;
                            eVar4.f22365q = false;
                        }
                        z21 = z11;
                        z22 = z12;
                        bVar2 = bVar5;
                        bVar3 = bVar;
                        iVar = q14;
                        iVar2 = q13;
                        iVar3 = q12;
                        iVar4 = q11;
                        iVar5 = q10;
                        z23 = z16;
                        if (z10) {
                        }
                        i27 = i26;
                        if ((eVar3.f22373u != 2 ? i25 : i27) != 0) {
                        }
                        iVar9 = iVar7;
                        iVar10 = iVar8;
                        if (z23) {
                        }
                        if (eVar4.V.n()) {
                        }
                        eVar4.f22363p = false;
                        eVar4.f22365q = false;
                    }
                } else {
                    i29 = 3;
                }
                if (bVar4 == bVar5 && i16 == i29) {
                    this.F = 0;
                    int i33 = (int) (f10 * i12);
                    if (bVar6 != bVar5) {
                        i18 = 4;
                        i19 = i17;
                        i21 = i15;
                        z16 = false;
                        i20 = i33;
                        int[] iArr2 = this.f22381y;
                        iArr2[0] = i18;
                        iArr2[1] = i19;
                        this.f22347h = z16;
                        if (z16) {
                        }
                        z17 = false;
                        if (z16) {
                        }
                        b bVar722 = this.Z[0];
                        bVar = b.WRAP_CONTENT;
                        if (bVar722 != bVar) {
                        }
                        if (!z18) {
                        }
                        z19 = !this.V.n();
                        boolean[] zArr222 = this.Y;
                        z20 = zArr222[0];
                        boolean z3122 = zArr222[1];
                        if (this.f22371t != 2) {
                        }
                        z21 = z11;
                        z22 = z12;
                        bVar2 = bVar5;
                        bVar3 = bVar;
                        iVar = q14;
                        iVar2 = q13;
                        iVar3 = q12;
                        iVar4 = q11;
                        iVar5 = q10;
                        z23 = z16;
                        if (z10) {
                        }
                        i27 = i26;
                        if ((eVar3.f22373u != 2 ? i25 : i27) != 0) {
                        }
                        iVar9 = iVar7;
                        iVar10 = iVar8;
                        if (z23) {
                        }
                        if (eVar4.V.n()) {
                        }
                        eVar4.f22363p = false;
                        eVar4.f22365q = false;
                    }
                    i20 = i33;
                    i18 = i16;
                    i19 = i17;
                    i21 = i15;
                    z16 = true;
                    int[] iArr22 = this.f22381y;
                    iArr22[0] = i18;
                    iArr22[1] = i19;
                    this.f22347h = z16;
                    if (z16) {
                    }
                    z17 = false;
                    if (z16) {
                    }
                    b bVar7222 = this.Z[0];
                    bVar = b.WRAP_CONTENT;
                    if (bVar7222 != bVar) {
                    }
                    if (!z18) {
                    }
                    z19 = !this.V.n();
                    boolean[] zArr2222 = this.Y;
                    z20 = zArr2222[0];
                    boolean z31222 = zArr2222[1];
                    if (this.f22371t != 2) {
                    }
                    z21 = z11;
                    z22 = z12;
                    bVar2 = bVar5;
                    bVar3 = bVar;
                    iVar = q14;
                    iVar2 = q13;
                    iVar3 = q12;
                    iVar4 = q11;
                    iVar5 = q10;
                    z23 = z16;
                    if (z10) {
                    }
                    i27 = i26;
                    if ((eVar3.f22373u != 2 ? i25 : i27) != 0) {
                    }
                    iVar9 = iVar7;
                    iVar10 = iVar8;
                    if (z23) {
                    }
                    if (eVar4.V.n()) {
                    }
                    eVar4.f22363p = false;
                    eVar4.f22365q = false;
                }
                if (bVar6 == bVar5 && i17 == i29) {
                    this.F = 1;
                    if (i31 == -1) {
                        this.G = 1.0f / f10;
                    }
                    int i34 = (int) (this.G * i10);
                    if (bVar4 == bVar5) {
                        i21 = i34;
                        i18 = i16;
                        i19 = i17;
                        i20 = i14;
                        z16 = true;
                        int[] iArr222 = this.f22381y;
                        iArr222[0] = i18;
                        iArr222[1] = i19;
                        this.f22347h = z16;
                        if (z16) {
                        }
                        z17 = false;
                        if (z16) {
                        }
                        b bVar72222 = this.Z[0];
                        bVar = b.WRAP_CONTENT;
                        if (bVar72222 != bVar) {
                        }
                        if (!z18) {
                        }
                        z19 = !this.V.n();
                        boolean[] zArr22222 = this.Y;
                        z20 = zArr22222[0];
                        boolean z312222 = zArr22222[1];
                        if (this.f22371t != 2) {
                        }
                        z21 = z11;
                        z22 = z12;
                        bVar2 = bVar5;
                        bVar3 = bVar;
                        iVar = q14;
                        iVar2 = q13;
                        iVar3 = q12;
                        iVar4 = q11;
                        iVar5 = q10;
                        z23 = z16;
                        if (z10) {
                        }
                        i27 = i26;
                        if ((eVar3.f22373u != 2 ? i25 : i27) != 0) {
                        }
                        iVar9 = iVar7;
                        iVar10 = iVar8;
                        if (z23) {
                        }
                        if (eVar4.V.n()) {
                        }
                        eVar4.f22363p = false;
                        eVar4.f22365q = false;
                    }
                    i19 = 4;
                    i21 = i34;
                    i18 = i16;
                    i20 = i14;
                }
                i18 = i16;
                i19 = i17;
                i20 = i14;
                i21 = i15;
                z16 = true;
                int[] iArr2222 = this.f22381y;
                iArr2222[0] = i18;
                iArr2222[1] = i19;
                this.f22347h = z16;
                if (z16) {
                }
                z17 = false;
                if (z16) {
                }
                b bVar722222 = this.Z[0];
                bVar = b.WRAP_CONTENT;
                if (bVar722222 != bVar) {
                }
                if (!z18) {
                }
                z19 = !this.V.n();
                boolean[] zArr222222 = this.Y;
                z20 = zArr222222[0];
                boolean z3122222 = zArr222222[1];
                if (this.f22371t != 2) {
                }
                z21 = z11;
                z22 = z12;
                bVar2 = bVar5;
                bVar3 = bVar;
                iVar = q14;
                iVar2 = q13;
                iVar3 = q12;
                iVar4 = q11;
                iVar5 = q10;
                z23 = z16;
                if (z10) {
                }
                i27 = i26;
                if ((eVar3.f22373u != 2 ? i25 : i27) != 0) {
                }
                iVar9 = iVar7;
                iVar10 = iVar8;
                if (z23) {
                }
                if (eVar4.V.n()) {
                }
                eVar4.f22363p = false;
                eVar4.f22365q = false;
            }
            i18 = i16;
            i19 = i17;
            i20 = i14;
            i21 = i15;
            z16 = false;
            int[] iArr22222 = this.f22381y;
            iArr22222[0] = i18;
            iArr22222[1] = i19;
            this.f22347h = z16;
            if (z16) {
            }
            z17 = false;
            if (z16) {
            }
            b bVar7222222 = this.Z[0];
            bVar = b.WRAP_CONTENT;
            if (bVar7222222 != bVar) {
            }
            if (!z18) {
            }
            z19 = !this.V.n();
            boolean[] zArr2222222 = this.Y;
            z20 = zArr2222222[0];
            boolean z31222222 = zArr2222222[1];
            if (this.f22371t != 2) {
            }
            z21 = z11;
            z22 = z12;
            bVar2 = bVar5;
            bVar3 = bVar;
            iVar = q14;
            iVar2 = q13;
            iVar3 = q12;
            iVar4 = q11;
            iVar5 = q10;
            z23 = z16;
            if (z10) {
            }
            i27 = i26;
            if ((eVar3.f22373u != 2 ? i25 : i27) != 0) {
            }
            iVar9 = iVar7;
            iVar10 = iVar8;
            if (z23) {
            }
            if (eVar4.V.n()) {
            }
            eVar4.f22363p = false;
            eVar4.f22365q = false;
        }
        z11 = false;
        z12 = false;
        if (this.f22370s0 == 8) {
            zArr = this.Y;
            if (!zArr[0]) {
                return;
            }
        }
        z13 = this.f22363p;
        if (!z13) {
        }
        if (z13) {
        }
        if (this.f22365q) {
        }
        if (this.f22363p) {
            this.f22363p = false;
            this.f22365q = false;
            return;
        }
        boolean z272 = f3.d.f17571r;
        if (z10) {
            fVar2 = lVar2.f23956h;
            if (fVar2.f23914j) {
                dVar.f(q10, fVar2.f23911g);
                dVar.f(q11, this.f22341e.f23957i.f23911g);
                dVar.f(q12, this.f22343f.f23956h.f23911g);
                dVar.f(q13, this.f22343f.f23957i.f23911g);
                dVar.f(q14, this.f22343f.f23931k.f23911g);
                if (this.f22334a0 != null) {
                }
                this.f22363p = false;
                this.f22365q = false;
                return;
            }
        }
        if (this.f22334a0 == null) {
        }
        i10 = this.f22336b0;
        i11 = this.f22358m0;
        if (i10 >= i11) {
        }
        i12 = this.f22338c0;
        i13 = this.f22360n0;
        if (i12 >= i13) {
        }
        b[] bVarArr4 = this.Z;
        b bVar42 = bVarArr4[0];
        b bVar52 = b.MATCH_CONSTRAINT;
        i14 = i11;
        if (bVar42 == bVar52) {
        }
        b bVar62 = bVarArr4[1];
        i15 = i13;
        if (bVar62 == bVar52) {
        }
        int i312 = this.f22342e0;
        this.F = i312;
        f10 = this.f22340d0;
        this.G = f10;
        i16 = this.f22377w;
        i17 = this.f22379x;
        if (f10 <= BitmapDescriptorFactory.HUE_RED) {
        }
        i18 = i16;
        i19 = i17;
        i20 = i14;
        i21 = i15;
        z16 = false;
        int[] iArr222222 = this.f22381y;
        iArr222222[0] = i18;
        iArr222222[1] = i19;
        this.f22347h = z16;
        if (z16) {
        }
        z17 = false;
        if (z16) {
        }
        b bVar72222222 = this.Z[0];
        bVar = b.WRAP_CONTENT;
        if (bVar72222222 != bVar) {
        }
        if (!z18) {
        }
        z19 = !this.V.n();
        boolean[] zArr22222222 = this.Y;
        z20 = zArr22222222[0];
        boolean z312222222 = zArr22222222[1];
        if (this.f22371t != 2) {
        }
        z21 = z11;
        z22 = z12;
        bVar2 = bVar52;
        bVar3 = bVar;
        iVar = q14;
        iVar2 = q13;
        iVar3 = q12;
        iVar4 = q11;
        iVar5 = q10;
        z23 = z16;
        if (z10) {
        }
        i27 = i26;
        if ((eVar3.f22373u != 2 ? i25 : i27) != 0) {
        }
        iVar9 = iVar7;
        iVar10 = iVar8;
        if (z23) {
        }
        if (eVar4.V.n()) {
        }
        eVar4.f22363p = false;
        eVar4.f22365q = false;
    }

    public boolean g0() {
        d dVar = this.O;
        d dVar2 = dVar.f22328f;
        if (dVar2 != null && dVar2.f22328f == dVar) {
            return true;
        }
        d dVar3 = this.Q;
        d dVar4 = dVar3.f22328f;
        return dVar4 != null && dVar4.f22328f == dVar3;
    }

    public void g1(int i10) {
        this.f22336b0 = i10;
        int i11 = this.f22358m0;
        if (i10 < i11) {
            this.f22336b0 = i11;
        }
    }

    public boolean h() {
        return this.f22370s0 != 8;
    }

    public boolean h0() {
        return this.K;
    }

    public void h1(int i10) {
        if (i10 < 0 || i10 > 3) {
            return;
        }
        this.f22375v = i10;
    }

    public boolean i0() {
        d dVar = this.P;
        d dVar2 = dVar.f22328f;
        if (dVar2 != null && dVar2.f22328f == dVar) {
            return true;
        }
        d dVar3 = this.R;
        d dVar4 = dVar3.f22328f;
        return dVar4 != null && dVar4.f22328f == dVar3;
    }

    public void i1(int i10) {
        this.f22344f0 = i10;
    }

    public void j(e eVar, float f10, int i10) {
        d.b bVar = d.b.CENTER;
        c0(bVar, eVar, bVar, i10, 0);
        this.I = f10;
    }

    public boolean j0() {
        return this.L;
    }

    public void j1(int i10) {
        this.f22346g0 = i10;
    }

    public void k(f3.d dVar) {
        dVar.q(this.O);
        dVar.q(this.P);
        dVar.q(this.Q);
        dVar.q(this.R);
        if (this.f22356l0 > 0) {
            dVar.q(this.S);
        }
    }

    public boolean k0() {
        return this.f22349i && this.f22370s0 != 8;
    }

    public void k1(boolean z10, boolean z11, boolean z12, boolean z13) {
        if (this.F == -1) {
            if (z12 && !z13) {
                this.F = 0;
            } else if (!z12 && z13) {
                this.F = 1;
                if (this.f22342e0 == -1) {
                    this.G = 1.0f / this.G;
                }
            }
        }
        if (this.F == 0 && (!this.P.n() || !this.R.n())) {
            this.F = 1;
        } else if (this.F == 1 && (!this.O.n() || !this.Q.n())) {
            this.F = 0;
        }
        if (this.F == -1 && (!this.P.n() || !this.R.n() || !this.O.n() || !this.Q.n())) {
            if (this.P.n() && this.R.n()) {
                this.F = 0;
            } else if (this.O.n() && this.Q.n()) {
                this.G = 1.0f / this.G;
                this.F = 1;
            }
        }
        if (this.F == -1) {
            int i10 = this.f22383z;
            if (i10 > 0 && this.C == 0) {
                this.F = 0;
            } else {
                if (i10 != 0 || this.C <= 0) {
                    return;
                }
                this.G = 1.0f / this.G;
                this.F = 1;
            }
        }
    }

    public void l() {
        if (this.f22341e == null) {
            this.f22341e = new l(this);
        }
        if (this.f22343f == null) {
            this.f22343f = new n(this);
        }
    }

    public boolean l0() {
        return this.f22363p || (this.O.m() && this.Q.m());
    }

    public void l1(boolean z10, boolean z11) {
        int i10;
        int i11;
        boolean k10 = z10 & this.f22341e.k();
        boolean k11 = z11 & this.f22343f.k();
        l lVar = this.f22341e;
        int i12 = lVar.f23956h.f23911g;
        n nVar = this.f22343f;
        int i13 = nVar.f23956h.f23911g;
        int i14 = lVar.f23957i.f23911g;
        int i15 = nVar.f23957i.f23911g;
        int i16 = i15 - i13;
        if (i14 - i12 < 0 || i16 < 0 || i12 == Integer.MIN_VALUE || i12 == Integer.MAX_VALUE || i13 == Integer.MIN_VALUE || i13 == Integer.MAX_VALUE || i14 == Integer.MIN_VALUE || i14 == Integer.MAX_VALUE || i15 == Integer.MIN_VALUE || i15 == Integer.MAX_VALUE) {
            i14 = 0;
            i12 = 0;
            i15 = 0;
            i13 = 0;
        }
        int i17 = i14 - i12;
        int i18 = i15 - i13;
        if (k10) {
            this.f22344f0 = i12;
        }
        if (k11) {
            this.f22346g0 = i13;
        }
        if (this.f22370s0 == 8) {
            this.f22336b0 = 0;
            this.f22338c0 = 0;
            return;
        }
        if (k10) {
            if (this.Z[0] == b.FIXED && i17 < (i11 = this.f22336b0)) {
                i17 = i11;
            }
            this.f22336b0 = i17;
            int i19 = this.f22358m0;
            if (i17 < i19) {
                this.f22336b0 = i19;
            }
        }
        if (k11) {
            if (this.Z[1] == b.FIXED && i18 < (i10 = this.f22338c0)) {
                i18 = i10;
            }
            this.f22338c0 = i18;
            int i20 = this.f22360n0;
            if (i18 < i20) {
                this.f22338c0 = i20;
            }
        }
    }

    public d m(d.b bVar) {
        switch (a.f22385a[bVar.ordinal()]) {
            case 1:
                return this.O;
            case 2:
                return this.P;
            case 3:
                return this.Q;
            case 4:
                return this.R;
            case 5:
                return this.S;
            case 6:
                return this.V;
            case 7:
                return this.T;
            case 8:
                return this.U;
            case 9:
                return null;
            default:
                throw new AssertionError(bVar.name());
        }
    }

    public boolean m0() {
        return this.f22365q || (this.P.m() && this.R.m());
    }

    public void m1(f3.d dVar, boolean z10) {
        n nVar;
        l lVar;
        int x10 = dVar.x(this.O);
        int x11 = dVar.x(this.P);
        int x12 = dVar.x(this.Q);
        int x13 = dVar.x(this.R);
        if (z10 && (lVar = this.f22341e) != null) {
            j3.f fVar = lVar.f23956h;
            if (fVar.f23914j) {
                j3.f fVar2 = lVar.f23957i;
                if (fVar2.f23914j) {
                    x10 = fVar.f23911g;
                    x12 = fVar2.f23911g;
                }
            }
        }
        if (z10 && (nVar = this.f22343f) != null) {
            j3.f fVar3 = nVar.f23956h;
            if (fVar3.f23914j) {
                j3.f fVar4 = nVar.f23957i;
                if (fVar4.f23914j) {
                    x11 = fVar3.f23911g;
                    x13 = fVar4.f23911g;
                }
            }
        }
        int i10 = x13 - x11;
        if (x12 - x10 < 0 || i10 < 0 || x10 == Integer.MIN_VALUE || x10 == Integer.MAX_VALUE || x11 == Integer.MIN_VALUE || x11 == Integer.MAX_VALUE || x12 == Integer.MIN_VALUE || x12 == Integer.MAX_VALUE || x13 == Integer.MIN_VALUE || x13 == Integer.MAX_VALUE) {
            x10 = 0;
            x13 = 0;
            x11 = 0;
            x12 = 0;
        }
        G0(x10, x11, x12, x13);
    }

    public int n() {
        return this.f22356l0;
    }

    public boolean n0() {
        return this.f22369s;
    }

    public float o(int i10) {
        if (i10 == 0) {
            return this.f22362o0;
        }
        if (i10 == 1) {
            return this.f22364p0;
        }
        return -1.0f;
    }

    public void o0() {
        this.f22367r = true;
    }

    public int p() {
        return W() + this.f22338c0;
    }

    public void p0() {
        this.f22369s = true;
    }

    public Object q() {
        return this.f22366q0;
    }

    public boolean q0() {
        b[] bVarArr = this.Z;
        b bVar = bVarArr[0];
        b bVar2 = b.MATCH_CONSTRAINT;
        return bVar == bVar2 && bVarArr[1] == bVar2;
    }

    public String r() {
        return this.f22374u0;
    }

    public void r0() {
        this.O.p();
        this.P.p();
        this.Q.p();
        this.R.p();
        this.S.p();
        this.T.p();
        this.U.p();
        this.V.p();
        this.f22334a0 = null;
        this.I = BitmapDescriptorFactory.HUE_RED;
        this.f22336b0 = 0;
        this.f22338c0 = 0;
        this.f22340d0 = BitmapDescriptorFactory.HUE_RED;
        this.f22342e0 = -1;
        this.f22344f0 = 0;
        this.f22346g0 = 0;
        this.f22352j0 = 0;
        this.f22354k0 = 0;
        this.f22356l0 = 0;
        this.f22358m0 = 0;
        this.f22360n0 = 0;
        float f10 = K0;
        this.f22362o0 = f10;
        this.f22364p0 = f10;
        b[] bVarArr = this.Z;
        b bVar = b.FIXED;
        bVarArr[0] = bVar;
        bVarArr[1] = bVar;
        this.f22366q0 = null;
        this.f22368r0 = 0;
        this.f22370s0 = 0;
        this.f22376v0 = null;
        this.f22378w0 = false;
        this.f22380x0 = false;
        this.f22384z0 = 0;
        this.A0 = 0;
        this.B0 = false;
        this.C0 = false;
        float[] fArr = this.D0;
        fArr[0] = -1.0f;
        fArr[1] = -1.0f;
        this.f22371t = -1;
        this.f22373u = -1;
        int[] iArr = this.H;
        iArr[0] = Integer.MAX_VALUE;
        iArr[1] = Integer.MAX_VALUE;
        this.f22377w = 0;
        this.f22379x = 0;
        this.B = 1.0f;
        this.E = 1.0f;
        this.A = Api.BaseClientBuilder.API_PRIORITY_OTHER;
        this.D = Api.BaseClientBuilder.API_PRIORITY_OTHER;
        this.f22383z = 0;
        this.C = 0;
        this.f22347h = false;
        this.F = -1;
        this.G = 1.0f;
        this.f22382y0 = false;
        boolean[] zArr = this.f22345g;
        zArr[0] = true;
        zArr[1] = true;
        this.L = false;
        boolean[] zArr2 = this.Y;
        zArr2[0] = false;
        zArr2[1] = false;
        this.f22349i = true;
        int[] iArr2 = this.f22381y;
        iArr2[0] = 0;
        iArr2[1] = 0;
        this.f22355l = -1;
        this.f22357m = -1;
    }

    public b s(int i10) {
        if (i10 == 0) {
            return y();
        }
        if (i10 == 1) {
            return R();
        }
        return null;
    }

    public void s0() {
        this.f22363p = false;
        this.f22365q = false;
        this.f22367r = false;
        this.f22369s = false;
        int size = this.X.size();
        for (int i10 = 0; i10 < size; i10++) {
            ((d) this.X.get(i10)).q();
        }
    }

    public float t() {
        return this.f22340d0;
    }

    public void t0(f3.c cVar) {
        this.O.r(cVar);
        this.P.r(cVar);
        this.Q.r(cVar);
        this.R.r(cVar);
        this.S.r(cVar);
        this.V.r(cVar);
        this.T.r(cVar);
        this.U.r(cVar);
    }

    public String toString() {
        String str;
        StringBuilder sb2 = new StringBuilder();
        String str2 = "";
        if (this.f22376v0 != null) {
            str = "type: " + this.f22376v0 + " ";
        } else {
            str = "";
        }
        sb2.append(str);
        if (this.f22374u0 != null) {
            str2 = "id: " + this.f22374u0 + " ";
        }
        sb2.append(str2);
        sb2.append("(");
        sb2.append(this.f22344f0);
        sb2.append(", ");
        sb2.append(this.f22346g0);
        sb2.append(") - (");
        sb2.append(this.f22336b0);
        sb2.append(" x ");
        sb2.append(this.f22338c0);
        sb2.append(")");
        return sb2.toString();
    }

    public int u() {
        return this.f22342e0;
    }

    public int v() {
        if (this.f22370s0 == 8) {
            return 0;
        }
        return this.f22338c0;
    }

    public float w() {
        return this.f22362o0;
    }

    public int x() {
        return this.f22384z0;
    }

    public void x0(int i10) {
        this.f22356l0 = i10;
        this.J = i10 > 0;
    }

    public b y() {
        return this.Z[0];
    }

    public void y0(Object obj) {
        this.f22366q0 = obj;
    }

    public int z() {
        d dVar = this.O;
        int i10 = dVar != null ? 0 + dVar.f22329g : 0;
        d dVar2 = this.Q;
        return dVar2 != null ? i10 + dVar2.f22329g : i10;
    }

    public void z0(String str) {
        this.f22374u0 = str;
    }
}
