package o;

import android.view.View;
import com.google.android.gms.common.api.Api;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.Ul, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public class C0530Ul {
    public int A;
    public float B;
    public final int[] C;
    public float D;
    public boolean E;
    public boolean F;
    public int G;
    public int H;
    public final C3123zl I;
    public final C3123zl J;
    public final C3123zl K;
    public final C3123zl L;
    public final C3123zl M;
    public final C3123zl N;
    public final C3123zl O;
    public final C3123zl P;
    public final C3123zl[] Q;
    public final ArrayList R;
    public final boolean[] S;
    public C0530Ul T;
    public int U;
    public int V;
    public float W;
    public int X;
    public int Y;
    public int Z;
    public int a0;
    public C0447Rg b;
    public int b0;
    public C0447Rg c;
    public int c0;
    public float d0;
    public float e0;
    public View f0;
    public int g0;
    public String h0;
    public int i0;
    public String j;
    public int j0;
    public boolean k;
    public final float[] k0;
    public boolean l;
    public final C0530Ul[] l0;
    public boolean m;
    public final C0530Ul[] m0;
    public boolean n;
    public int n0;

    /* renamed from: o, reason: collision with root package name */
    public int f360o;
    public int o0;
    public int p;
    public final int[] p0;
    public int q;
    public int r;
    public int s;
    public final int[] t;
    public int u;
    public int v;
    public float w;
    public int x;
    public int y;
    public float z;
    public boolean a = false;
    public C1941nF d = null;
    public C3120zj0 e = null;
    public final boolean[] f = {true, true};
    public boolean g = true;
    public int h = -1;
    public int i = -1;

    public C0530Ul() {
        new HashMap();
        this.k = false;
        this.l = false;
        this.m = false;
        this.n = false;
        this.f360o = -1;
        this.p = -1;
        this.q = 0;
        this.r = 0;
        this.s = 0;
        this.t = new int[2];
        this.u = 0;
        this.v = 0;
        this.w = 1.0f;
        this.x = 0;
        this.y = 0;
        this.z = 1.0f;
        this.A = -1;
        this.B = 1.0f;
        this.C = new int[]{Api.BaseClientBuilder.API_PRIORITY_OTHER, Api.BaseClientBuilder.API_PRIORITY_OTHER};
        this.D = Float.NaN;
        this.E = false;
        this.F = false;
        this.G = 0;
        this.H = 0;
        C3123zl c3123zl = new C3123zl(this, 2);
        this.I = c3123zl;
        C3123zl c3123zl2 = new C3123zl(this, 3);
        this.J = c3123zl2;
        C3123zl c3123zl3 = new C3123zl(this, 4);
        this.K = c3123zl3;
        C3123zl c3123zl4 = new C3123zl(this, 5);
        this.L = c3123zl4;
        C3123zl c3123zl5 = new C3123zl(this, 6);
        this.M = c3123zl5;
        C3123zl c3123zl6 = new C3123zl(this, 8);
        this.N = c3123zl6;
        C3123zl c3123zl7 = new C3123zl(this, 9);
        this.O = c3123zl7;
        C3123zl c3123zl8 = new C3123zl(this, 7);
        this.P = c3123zl8;
        this.Q = new C3123zl[]{c3123zl, c3123zl3, c3123zl2, c3123zl4, c3123zl5, c3123zl8};
        ArrayList arrayList = new ArrayList();
        this.R = arrayList;
        this.S = new boolean[2];
        this.p0 = new int[]{1, 1};
        this.T = null;
        this.U = 0;
        this.V = 0;
        this.W = 0.0f;
        this.X = -1;
        this.Y = 0;
        this.Z = 0;
        this.a0 = 0;
        this.d0 = 0.5f;
        this.e0 = 0.5f;
        this.g0 = 0;
        this.h0 = null;
        this.i0 = 0;
        this.j0 = 0;
        this.k0 = new float[]{-1.0f, -1.0f};
        this.l0 = new C0530Ul[]{null, null};
        this.m0 = new C0530Ul[]{null, null};
        this.n0 = -1;
        this.o0 = -1;
        arrayList.add(c3123zl);
        arrayList.add(c3123zl2);
        arrayList.add(c3123zl3);
        arrayList.add(c3123zl4);
        arrayList.add(c3123zl6);
        arrayList.add(c3123zl7);
        arrayList.add(c3123zl8);
        arrayList.add(c3123zl5);
    }

    public static void G(int i, int i2, String str, StringBuilder sb) {
        if (i == i2) {
            return;
        }
        sb.append(str);
        sb.append(" :   ");
        sb.append(i);
        sb.append(",\n");
    }

    public static void H(StringBuilder sb, String str, float f, float f2) {
        if (f == f2) {
            return;
        }
        sb.append(str);
        sb.append(" :   ");
        sb.append(f);
        sb.append(",\n");
    }

    public static void o(StringBuilder sb, String str, int i, int i2, int i3, int i4, int i5, float f, int i6) {
        String str2;
        sb.append(str);
        sb.append(" :  {\n");
        if (i6 == 1) {
            str2 = "FIXED";
        } else if (i6 == 2) {
            str2 = "WRAP_CONTENT";
        } else if (i6 == 3) {
            str2 = "MATCH_CONSTRAINT";
        } else {
            if (i6 != 4) {
                throw null;
            }
            str2 = "MATCH_PARENT";
        }
        if (!"FIXED".equals(str2)) {
            sb.append("      behavior");
            sb.append(" :   ");
            sb.append(str2);
            sb.append(",\n");
        }
        G(i, 0, "      size", sb);
        G(i2, 0, "      min", sb);
        G(i3, Api.BaseClientBuilder.API_PRIORITY_OTHER, "      max", sb);
        G(i4, 0, "      matchMin", sb);
        G(i5, 0, "      matchDef", sb);
        H(sb, "      matchPercent", f, 1.0f);
        sb.append("    },\n");
    }

    public static void p(StringBuilder sb, String str, C3123zl c3123zl) {
        if (c3123zl.f == null) {
            return;
        }
        sb.append("    ");
        sb.append(str);
        sb.append(" : [ '");
        sb.append(c3123zl.f);
        sb.append("'");
        if (c3123zl.h != Integer.MIN_VALUE || c3123zl.g != 0) {
            sb.append(",");
            sb.append(c3123zl.g);
            if (c3123zl.h != Integer.MIN_VALUE) {
                sb.append(",");
                sb.append(c3123zl.h);
                sb.append(",");
            }
        }
        sb.append(" ] ,\n");
    }

    public boolean A() {
        if (this.k) {
            return true;
        }
        return this.I.c && this.K.c;
    }

    public boolean B() {
        if (this.l) {
            return true;
        }
        return this.J.c && this.L.c;
    }

    public void C() {
        this.I.j();
        this.J.j();
        this.K.j();
        this.L.j();
        this.M.j();
        this.N.j();
        this.O.j();
        this.P.j();
        this.T = null;
        this.D = Float.NaN;
        this.U = 0;
        this.V = 0;
        this.W = 0.0f;
        this.X = -1;
        this.Y = 0;
        this.Z = 0;
        this.a0 = 0;
        this.b0 = 0;
        this.c0 = 0;
        this.d0 = 0.5f;
        this.e0 = 0.5f;
        int[] iArr = this.p0;
        iArr[0] = 1;
        iArr[1] = 1;
        this.f0 = null;
        this.g0 = 0;
        this.i0 = 0;
        this.j0 = 0;
        float[] fArr = this.k0;
        fArr[0] = -1.0f;
        fArr[1] = -1.0f;
        this.f360o = -1;
        this.p = -1;
        int[] iArr2 = this.C;
        iArr2[0] = Integer.MAX_VALUE;
        iArr2[1] = Integer.MAX_VALUE;
        this.r = 0;
        this.s = 0;
        this.w = 1.0f;
        this.z = 1.0f;
        this.v = Api.BaseClientBuilder.API_PRIORITY_OTHER;
        this.y = Api.BaseClientBuilder.API_PRIORITY_OTHER;
        this.u = 0;
        this.x = 0;
        this.A = -1;
        this.B = 1.0f;
        boolean[] zArr = this.f;
        zArr[0] = true;
        zArr[1] = true;
        this.F = false;
        boolean[] zArr2 = this.S;
        zArr2[0] = false;
        zArr2[1] = false;
        this.g = true;
        int[] iArr3 = this.t;
        iArr3[0] = 0;
        iArr3[1] = 0;
        this.h = -1;
        this.i = -1;
    }

    public final void D() {
        C0530Ul c0530Ul = this.T;
        if (c0530Ul != null && (c0530Ul instanceof C0556Vl)) {
            ((C0556Vl) c0530Ul).getClass();
        }
        ArrayList arrayList = this.R;
        int size = arrayList.size();
        for (int i = 0; i < size; i++) {
            ((C3123zl) arrayList.get(i)).j();
        }
    }

    public final void E() {
        this.k = false;
        this.l = false;
        this.m = false;
        this.n = false;
        ArrayList arrayList = this.R;
        int size = arrayList.size();
        for (int i = 0; i < size; i++) {
            C3123zl c3123zl = (C3123zl) arrayList.get(i);
            c3123zl.c = false;
            c3123zl.b = 0;
        }
    }

    public void F(C3126zm0 c3126zm0) {
        this.I.k();
        this.J.k();
        this.K.k();
        this.L.k();
        this.M.k();
        this.P.k();
        this.N.k();
        this.O.k();
    }

    public final void I(int i) {
        this.a0 = i;
        this.E = i > 0;
    }

    public final void J(int i, int i2) {
        if (this.k) {
            return;
        }
        this.I.l(i);
        this.K.l(i2);
        this.Y = i;
        this.U = i2 - i;
        this.k = true;
    }

    public final void K(int i, int i2) {
        if (this.l) {
            return;
        }
        this.J.l(i);
        this.L.l(i2);
        this.Z = i;
        this.V = i2 - i;
        if (this.E) {
            this.M.l(i + this.a0);
        }
        this.l = true;
    }

    public final void L(int i) {
        this.V = i;
        int i2 = this.c0;
        if (i < i2) {
            this.V = i2;
        }
    }

    public final void M(int i) {
        this.p0[0] = i;
    }

    public final void N(int i) {
        this.p0[1] = i;
    }

    public final void O(int i) {
        this.U = i;
        int i2 = this.b0;
        if (i < i2) {
            this.U = i2;
        }
    }

    public void P(boolean z, boolean z2) {
        int i;
        int i2;
        C1941nF c1941nF = this.d;
        boolean z3 = z & c1941nF.g;
        C3120zj0 c3120zj0 = this.e;
        boolean z4 = z2 & c3120zj0.g;
        int i3 = c1941nF.h.g;
        int i4 = c3120zj0.h.g;
        int i5 = c1941nF.i.g;
        int i6 = c3120zj0.i.g;
        int i7 = i6 - i4;
        if (i5 - i3 < 0 || i7 < 0 || i3 == Integer.MIN_VALUE || i3 == Integer.MAX_VALUE || i4 == Integer.MIN_VALUE || i4 == Integer.MAX_VALUE || i5 == Integer.MIN_VALUE || i5 == Integer.MAX_VALUE || i6 == Integer.MIN_VALUE || i6 == Integer.MAX_VALUE) {
            i5 = 0;
            i6 = 0;
            i3 = 0;
            i4 = 0;
        }
        int i8 = i5 - i3;
        int i9 = i6 - i4;
        if (z3) {
            this.Y = i3;
        }
        if (z4) {
            this.Z = i4;
        }
        if (this.g0 == 8) {
            this.U = 0;
            this.V = 0;
            return;
        }
        int[] iArr = this.p0;
        if (z3) {
            if (iArr[0] == 1 && i8 < (i2 = this.U)) {
                i8 = i2;
            }
            this.U = i8;
            int i10 = this.b0;
            if (i8 < i10) {
                this.U = i10;
            }
        }
        if (z4) {
            if (iArr[1] == 1 && i9 < (i = this.V)) {
                i9 = i;
            }
            this.V = i9;
            int i11 = this.c0;
            if (i9 < i11) {
                this.V = i11;
            }
        }
    }

    public void Q(C2991yL c2991yL, boolean z) {
        int i;
        int i2;
        C3120zj0 c3120zj0;
        C1941nF c1941nF;
        c2991yL.getClass();
        int iN = C2991yL.n(this.I);
        int iN2 = C2991yL.n(this.J);
        int iN3 = C2991yL.n(this.K);
        int iN4 = C2991yL.n(this.L);
        if (z && (c1941nF = this.d) != null) {
            C0017Ar c0017Ar = c1941nF.h;
            if (c0017Ar.j) {
                C0017Ar c0017Ar2 = c1941nF.i;
                if (c0017Ar2.j) {
                    iN = c0017Ar.g;
                    iN3 = c0017Ar2.g;
                }
            }
        }
        if (z && (c3120zj0 = this.e) != null) {
            C0017Ar c0017Ar3 = c3120zj0.h;
            if (c0017Ar3.j) {
                C0017Ar c0017Ar4 = c3120zj0.i;
                if (c0017Ar4.j) {
                    iN2 = c0017Ar3.g;
                    iN4 = c0017Ar4.g;
                }
            }
        }
        int i3 = iN4 - iN2;
        if (iN3 - iN < 0 || i3 < 0 || iN == Integer.MIN_VALUE || iN == Integer.MAX_VALUE || iN2 == Integer.MIN_VALUE || iN2 == Integer.MAX_VALUE || iN3 == Integer.MIN_VALUE || iN3 == Integer.MAX_VALUE || iN4 == Integer.MIN_VALUE || iN4 == Integer.MAX_VALUE) {
            iN = 0;
            iN2 = 0;
            iN3 = 0;
            iN4 = 0;
        }
        int i4 = iN3 - iN;
        int i5 = iN4 - iN2;
        this.Y = iN;
        this.Z = iN2;
        if (this.g0 == 8) {
            this.U = 0;
            this.V = 0;
            return;
        }
        int[] iArr = this.p0;
        int i6 = iArr[0];
        if (i6 == 1 && i4 < (i2 = this.U)) {
            i4 = i2;
        }
        if (iArr[1] == 1 && i5 < (i = this.V)) {
            i5 = i;
        }
        this.U = i4;
        this.V = i5;
        int i7 = this.c0;
        if (i5 < i7) {
            this.V = i7;
        }
        int i8 = this.b0;
        if (i4 < i8) {
            this.U = i8;
        }
        int i9 = this.v;
        if (i9 > 0 && i6 == 3) {
            this.U = Math.min(this.U, i9);
        }
        int i10 = this.y;
        if (i10 > 0 && iArr[1] == 3) {
            this.V = Math.min(this.V, i10);
        }
        int i11 = this.U;
        if (i4 != i11) {
            this.h = i11;
        }
        int i12 = this.V;
        if (i5 != i12) {
            this.i = i12;
        }
    }

    public final void a(C0556Vl c0556Vl, C2991yL c2991yL, HashSet hashSet, int i, boolean z) {
        if (z) {
            if (!hashSet.contains(this)) {
                return;
            }
            AbstractC2539te.s(c0556Vl, c2991yL, this);
            hashSet.remove(this);
            b(c2991yL, c0556Vl.W(64));
        }
        if (i == 0) {
            HashSet hashSet2 = this.I.a;
            if (hashSet2 != null) {
                Iterator it = hashSet2.iterator();
                while (it.hasNext()) {
                    ((C3123zl) it.next()).d.a(c0556Vl, c2991yL, hashSet, i, true);
                }
            }
            HashSet hashSet3 = this.K.a;
            if (hashSet3 != null) {
                Iterator it2 = hashSet3.iterator();
                while (it2.hasNext()) {
                    ((C3123zl) it2.next()).d.a(c0556Vl, c2991yL, hashSet, i, true);
                }
                return;
            }
            return;
        }
        HashSet hashSet4 = this.J.a;
        if (hashSet4 != null) {
            Iterator it3 = hashSet4.iterator();
            while (it3.hasNext()) {
                ((C3123zl) it3.next()).d.a(c0556Vl, c2991yL, hashSet, i, true);
            }
        }
        HashSet hashSet5 = this.L.a;
        if (hashSet5 != null) {
            Iterator it4 = hashSet5.iterator();
            while (it4.hasNext()) {
                ((C3123zl) it4.next()).d.a(c0556Vl, c2991yL, hashSet, i, true);
            }
        }
        HashSet hashSet6 = this.M.a;
        if (hashSet6 != null) {
            Iterator it5 = hashSet6.iterator();
            while (it5.hasNext()) {
                ((C3123zl) it5.next()).d.a(c0556Vl, c2991yL, hashSet, i, true);
            }
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:121:0x0204  */
    /* JADX WARN: Removed duplicated region for block: B:125:0x020c  */
    /* JADX WARN: Removed duplicated region for block: B:128:0x0215  */
    /* JADX WARN: Removed duplicated region for block: B:157:0x028b  */
    /* JADX WARN: Removed duplicated region for block: B:161:0x029a  */
    /* JADX WARN: Removed duplicated region for block: B:164:0x02a3  */
    /* JADX WARN: Removed duplicated region for block: B:165:0x02a6  */
    /* JADX WARN: Removed duplicated region for block: B:168:0x02b5  */
    /* JADX WARN: Removed duplicated region for block: B:170:0x02bc  */
    /* JADX WARN: Removed duplicated region for block: B:173:0x02c3  */
    /* JADX WARN: Removed duplicated region for block: B:174:0x02c6  */
    /* JADX WARN: Removed duplicated region for block: B:177:0x02e4  */
    /* JADX WARN: Removed duplicated region for block: B:24:0x0062  */
    /* JADX WARN: Removed duplicated region for block: B:268:0x03f5  */
    /* JADX WARN: Removed duplicated region for block: B:272:0x040d  */
    /* JADX WARN: Removed duplicated region for block: B:276:0x0416  */
    /* JADX WARN: Removed duplicated region for block: B:279:0x041a  */
    /* JADX WARN: Removed duplicated region for block: B:284:0x0426  */
    /* JADX WARN: Removed duplicated region for block: B:287:0x042e  */
    /* JADX WARN: Removed duplicated region for block: B:290:0x0434  */
    /* JADX WARN: Removed duplicated region for block: B:292:0x0437  */
    /* JADX WARN: Removed duplicated region for block: B:295:0x0453  */
    /* JADX WARN: Removed duplicated region for block: B:314:0x049a  */
    /* JADX WARN: Removed duplicated region for block: B:330:0x0537  */
    /* JADX WARN: Removed duplicated region for block: B:346:0x058a  */
    /* JADX WARN: Removed duplicated region for block: B:349:0x059c  */
    /* JADX WARN: Removed duplicated region for block: B:352:0x05a0  */
    /* JADX WARN: Removed duplicated region for block: B:374:0x05d5  */
    /* JADX WARN: Removed duplicated region for block: B:389:0x0661  */
    /* JADX WARN: Removed duplicated region for block: B:38:0x0092  */
    /* JADX WARN: Removed duplicated region for block: B:391:0x0667  */
    /* JADX WARN: Removed duplicated region for block: B:397:0x06c5  */
    /* JADX WARN: Removed duplicated region for block: B:43:0x009c  */
    /* JADX WARN: Removed duplicated region for block: B:44:0x009e  */
    /* JADX WARN: Removed duplicated region for block: B:64:0x00fd  */
    /* JADX WARN: Type inference failed for: r17v10, types: [boolean] */
    /* JADX WARN: Type inference failed for: r17v16 */
    /* JADX WARN: Type inference failed for: r17v17 */
    /* JADX WARN: Type inference failed for: r17v2 */
    /* JADX WARN: Type inference failed for: r17v20 */
    /* JADX WARN: Type inference failed for: r18v25 */
    /* JADX WARN: Type inference failed for: r18v6, types: [boolean] */
    /* JADX WARN: Type inference failed for: r18v7 */
    /* JADX WARN: Type inference failed for: r27v3 */
    /* JADX WARN: Type inference failed for: r27v4, types: [boolean] */
    /* JADX WARN: Type inference failed for: r27v6 */
    /* JADX WARN: Type inference failed for: r27v7 */
    /* JADX WARN: Type inference failed for: r27v8 */
    /* JADX WARN: Type inference failed for: r58v0, types: [o.Ul] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void b(o.C2991yL r59, boolean r60) {
        /*
            Method dump skipped, instructions count: 1912
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C0530Ul.b(o.yL, boolean):void");
    }

    public boolean c() {
        return this.g0 != 8;
    }

    /* JADX WARN: Removed duplicated region for block: B:217:0x03bc A[ADDED_TO_REGION] */
    /* JADX WARN: Removed duplicated region for block: B:220:0x03c5  */
    /* JADX WARN: Removed duplicated region for block: B:222:0x03c9  */
    /* JADX WARN: Removed duplicated region for block: B:231:0x0402  */
    /* JADX WARN: Removed duplicated region for block: B:240:0x041f  */
    /* JADX WARN: Removed duplicated region for block: B:257:0x0452  */
    /* JADX WARN: Removed duplicated region for block: B:259:0x0458  */
    /* JADX WARN: Removed duplicated region for block: B:287:0x0493 A[PHI: r3
      0x0493: PHI (r3v17 int) = (r3v16 int), (r3v21 int), (r3v21 int), (r3v21 int) binds: [B:280:0x0483, B:282:0x0489, B:283:0x048b, B:285:0x048f] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:290:0x04a5  */
    /* JADX WARN: Removed duplicated region for block: B:303:0x04c6  */
    /* JADX WARN: Removed duplicated region for block: B:308:0x04d4 A[ADDED_TO_REGION] */
    /* JADX WARN: Removed duplicated region for block: B:337:0x0521  */
    /* JADX WARN: Removed duplicated region for block: B:345:? A[ADDED_TO_REGION, RETURN, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void d(o.C2991yL r30, boolean r31, boolean r32, boolean r33, boolean r34, o.R90 r35, o.R90 r36, int r37, boolean r38, o.C3123zl r39, o.C3123zl r40, int r41, int r42, int r43, int r44, float r45, boolean r46, boolean r47, boolean r48, boolean r49, boolean r50, int r51, int r52, int r53, int r54, float r55, boolean r56) {
        /*
            Method dump skipped, instructions count: 1323
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C0530Ul.d(o.yL, boolean, boolean, boolean, boolean, o.R90, o.R90, int, boolean, o.zl, o.zl, int, int, int, int, float, boolean, boolean, boolean, boolean, boolean, int, int, int, int, float, boolean):void");
    }

    public final void e(int i, C0530Ul c0530Ul, int i2, int i3) {
        boolean z;
        if (i == 7) {
            if (i2 != 7) {
                if (i2 == 2 || i2 == 4) {
                    e(2, c0530Ul, i2, 0);
                    e(4, c0530Ul, i2, 0);
                    i(7).a(c0530Ul.i(i2), 0);
                    return;
                } else {
                    if (i2 == 3 || i2 == 5) {
                        e(3, c0530Ul, i2, 0);
                        e(5, c0530Ul, i2, 0);
                        i(7).a(c0530Ul.i(i2), 0);
                        return;
                    }
                    return;
                }
            }
            C3123zl c3123zlI = i(2);
            C3123zl c3123zlI2 = i(4);
            C3123zl c3123zlI3 = i(3);
            C3123zl c3123zlI4 = i(5);
            boolean z2 = true;
            if ((c3123zlI == null || !c3123zlI.h()) && (c3123zlI2 == null || !c3123zlI2.h())) {
                e(2, c0530Ul, 2, 0);
                e(4, c0530Ul, 4, 0);
                z = true;
            } else {
                z = false;
            }
            if ((c3123zlI3 == null || !c3123zlI3.h()) && (c3123zlI4 == null || !c3123zlI4.h())) {
                e(3, c0530Ul, 3, 0);
                e(5, c0530Ul, 5, 0);
            } else {
                z2 = false;
            }
            if (z && z2) {
                i(7).a(c0530Ul.i(7), 0);
                return;
            } else if (z) {
                i(8).a(c0530Ul.i(8), 0);
                return;
            } else {
                if (z2) {
                    i(9).a(c0530Ul.i(9), 0);
                    return;
                }
                return;
            }
        }
        if (i == 8 && (i2 == 2 || i2 == 4)) {
            C3123zl c3123zlI5 = i(2);
            C3123zl c3123zlI6 = c0530Ul.i(i2);
            C3123zl c3123zlI7 = i(4);
            c3123zlI5.a(c3123zlI6, 0);
            c3123zlI7.a(c3123zlI6, 0);
            i(8).a(c3123zlI6, 0);
            return;
        }
        if (i == 9 && (i2 == 3 || i2 == 5)) {
            C3123zl c3123zlI8 = c0530Ul.i(i2);
            i(3).a(c3123zlI8, 0);
            i(5).a(c3123zlI8, 0);
            i(9).a(c3123zlI8, 0);
            return;
        }
        if (i == 8 && i2 == 8) {
            i(2).a(c0530Ul.i(2), 0);
            i(4).a(c0530Ul.i(4), 0);
            i(8).a(c0530Ul.i(i2), 0);
            return;
        }
        if (i == 9 && i2 == 9) {
            i(3).a(c0530Ul.i(3), 0);
            i(5).a(c0530Ul.i(5), 0);
            i(9).a(c0530Ul.i(i2), 0);
            return;
        }
        C3123zl c3123zlI9 = i(i);
        C3123zl c3123zlI10 = c0530Ul.i(i2);
        if (c3123zlI9.i(c3123zlI10)) {
            if (i == 6) {
                C3123zl c3123zlI11 = i(3);
                C3123zl c3123zlI12 = i(5);
                if (c3123zlI11 != null) {
                    c3123zlI11.j();
                }
                if (c3123zlI12 != null) {
                    c3123zlI12.j();
                }
            } else if (i == 3 || i == 5) {
                C3123zl c3123zlI13 = i(6);
                if (c3123zlI13 != null) {
                    c3123zlI13.j();
                }
                C3123zl c3123zlI14 = i(7);
                if (c3123zlI14.f != c3123zlI10) {
                    c3123zlI14.j();
                }
                C3123zl c3123zlF = i(i).f();
                C3123zl c3123zlI15 = i(9);
                if (c3123zlI15.h()) {
                    c3123zlF.j();
                    c3123zlI15.j();
                }
            } else if (i == 2 || i == 4) {
                C3123zl c3123zlI16 = i(7);
                if (c3123zlI16.f != c3123zlI10) {
                    c3123zlI16.j();
                }
                C3123zl c3123zlF2 = i(i).f();
                C3123zl c3123zlI17 = i(8);
                if (c3123zlI17.h()) {
                    c3123zlF2.j();
                    c3123zlI17.j();
                }
            }
            c3123zlI9.a(c3123zlI10, i3);
        }
    }

    public final void f(C3123zl c3123zl, C3123zl c3123zl2, int i) {
        if (c3123zl.d == this) {
            e(c3123zl.e, c3123zl2.d, c3123zl2.e, i);
        }
    }

    public final void g(C2991yL c2991yL) {
        c2991yL.k(this.I);
        c2991yL.k(this.J);
        c2991yL.k(this.K);
        c2991yL.k(this.L);
        if (this.a0 > 0) {
            c2991yL.k(this.M);
        }
    }

    public final void h() {
        if (this.d == null) {
            C1941nF c1941nF = new C1941nF(this);
            c1941nF.h.e = 4;
            c1941nF.i.e = 5;
            c1941nF.f = 0;
            this.d = c1941nF;
        }
        if (this.e == null) {
            C3120zj0 c3120zj0 = new C3120zj0(this);
            C0017Ar c0017Ar = new C0017Ar(c3120zj0);
            c3120zj0.k = c0017Ar;
            c3120zj0.l = null;
            c3120zj0.h.e = 6;
            c3120zj0.i.e = 7;
            c0017Ar.e = 8;
            c3120zj0.f = 1;
            this.e = c3120zj0;
        }
    }

    public C3123zl i(int i) {
        switch (AbstractC2462sn.w(i)) {
            case 0:
                return null;
            case 1:
                return this.I;
            case 2:
                return this.J;
            case 3:
                return this.K;
            case 4:
                return this.L;
            case 5:
                return this.M;
            case 6:
                return this.P;
            case 7:
                return this.N;
            case 8:
                return this.O;
            default:
                throw new AssertionError(AbstractC2462sn.v(i));
        }
    }

    public final int j(int i) {
        int[] iArr = this.p0;
        if (i == 0) {
            return iArr[0];
        }
        if (i == 1) {
            return iArr[1];
        }
        return 0;
    }

    public final int k() {
        if (this.g0 == 8) {
            return 0;
        }
        return this.V;
    }

    public final C0530Ul l(int i) {
        C3123zl c3123zl;
        C3123zl c3123zl2;
        if (i != 0) {
            if (i == 1 && (c3123zl2 = (c3123zl = this.L).f) != null && c3123zl2.f == c3123zl) {
                return c3123zl2.d;
            }
            return null;
        }
        C3123zl c3123zl3 = this.K;
        C3123zl c3123zl4 = c3123zl3.f;
        if (c3123zl4 == null || c3123zl4.f != c3123zl3) {
            return null;
        }
        return c3123zl4.d;
    }

    public final C0530Ul m(int i) {
        C3123zl c3123zl;
        C3123zl c3123zl2;
        if (i != 0) {
            if (i == 1 && (c3123zl2 = (c3123zl = this.J).f) != null && c3123zl2.f == c3123zl) {
                return c3123zl2.d;
            }
            return null;
        }
        C3123zl c3123zl3 = this.I;
        C3123zl c3123zl4 = c3123zl3.f;
        if (c3123zl4 == null || c3123zl4.f != c3123zl3) {
            return null;
        }
        return c3123zl4.d;
    }

    public void n(StringBuilder sb) {
        sb.append("  " + this.j + ":{\n");
        StringBuilder sb2 = new StringBuilder("    actualWidth:");
        sb2.append(this.U);
        sb.append(sb2.toString());
        sb.append("\n");
        sb.append("    actualHeight:" + this.V);
        sb.append("\n");
        sb.append("    actualLeft:" + this.Y);
        sb.append("\n");
        sb.append("    actualTop:" + this.Z);
        sb.append("\n");
        p(sb, "left", this.I);
        p(sb, "top", this.J);
        p(sb, "right", this.K);
        p(sb, "bottom", this.L);
        p(sb, "baseline", this.M);
        p(sb, "centerX", this.N);
        p(sb, "centerY", this.O);
        int i = this.U;
        int i2 = this.b0;
        int[] iArr = this.C;
        int i3 = iArr[0];
        int i4 = this.u;
        int i5 = this.r;
        float f = this.w;
        int[] iArr2 = this.p0;
        int i6 = iArr2[0];
        float[] fArr = this.k0;
        float f2 = fArr[0];
        o(sb, "    width", i, i2, i3, i4, i5, f, i6);
        int i7 = this.V;
        int i8 = this.c0;
        int i9 = iArr[1];
        int i10 = this.x;
        int i11 = this.s;
        float f3 = this.z;
        int i12 = iArr2[1];
        float f4 = fArr[1];
        o(sb, "    height", i7, i8, i9, i10, i11, f3, i12);
        float f5 = this.W;
        int i13 = this.X;
        if (f5 != 0.0f) {
            sb.append("    dimensionRatio");
            sb.append(" :  [");
            sb.append(f5);
            sb.append(",");
            sb.append(i13);
            sb.append("");
            sb.append("],\n");
        }
        H(sb, "    horizontalBias", this.d0, 0.5f);
        H(sb, "    verticalBias", this.e0, 0.5f);
        G(this.i0, 0, "    horizontalChainStyle", sb);
        G(this.j0, 0, "    verticalChainStyle", sb);
        sb.append("  }");
    }

    public final int q() {
        if (this.g0 == 8) {
            return 0;
        }
        return this.U;
    }

    public final int r() {
        C0530Ul c0530Ul = this.T;
        return (c0530Ul == null || !(c0530Ul instanceof C0556Vl)) ? this.Y : ((C0556Vl) c0530Ul).x0 + this.Y;
    }

    public final int s() {
        C0530Ul c0530Ul = this.T;
        return (c0530Ul == null || !(c0530Ul instanceof C0556Vl)) ? this.Z : ((C0556Vl) c0530Ul).y0 + this.Z;
    }

    /* JADX WARN: Removed duplicated region for block: B:29:0x003a A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:30:0x003b A[RETURN] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean t(int r5) {
        /*
            r4 = this;
            r0 = 2
            r1 = 0
            r2 = 1
            if (r5 != 0) goto L1b
            o.zl r5 = r4.I
            o.zl r5 = r5.f
            if (r5 == 0) goto Ld
            r5 = r2
            goto Le
        Ld:
            r5 = r1
        Le:
            o.zl r3 = r4.K
            o.zl r3 = r3.f
            if (r3 == 0) goto L16
            r3 = r2
            goto L17
        L16:
            r3 = r1
        L17:
            int r5 = r5 + r3
            if (r5 >= r0) goto L3b
            goto L3a
        L1b:
            o.zl r5 = r4.J
            o.zl r5 = r5.f
            if (r5 == 0) goto L23
            r5 = r2
            goto L24
        L23:
            r5 = r1
        L24:
            o.zl r3 = r4.L
            o.zl r3 = r3.f
            if (r3 == 0) goto L2c
            r3 = r2
            goto L2d
        L2c:
            r3 = r1
        L2d:
            int r5 = r5 + r3
            o.zl r3 = r4.M
            o.zl r3 = r3.f
            if (r3 == 0) goto L36
            r3 = r2
            goto L37
        L36:
            r3 = r1
        L37:
            int r5 = r5 + r3
            if (r5 >= r0) goto L3b
        L3a:
            return r2
        L3b:
            return r1
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C0530Ul.t(int):boolean");
    }

    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("");
        sb.append(this.h0 != null ? AbstractC2462sn.n(new StringBuilder("id: "), this.h0, " ") : "");
        sb.append("(");
        sb.append(this.Y);
        sb.append(", ");
        sb.append(this.Z);
        sb.append(") - (");
        sb.append(this.U);
        sb.append(" x ");
        sb.append(this.V);
        sb.append(")");
        return sb.toString();
    }

    public final boolean u(int i, int i2) {
        C3123zl c3123zl;
        C3123zl c3123zl2;
        C3123zl c3123zl3;
        C3123zl c3123zl4;
        if (i == 0) {
            C3123zl c3123zl5 = this.I;
            C3123zl c3123zl6 = c3123zl5.f;
            if (c3123zl6 == null || !c3123zl6.c || (c3123zl4 = (c3123zl3 = this.K).f) == null || !c3123zl4.c) {
                return false;
            }
            return (c3123zl4.d() - c3123zl3.e()) - (c3123zl5.e() + c3123zl5.f.d()) >= i2;
        }
        C3123zl c3123zl7 = this.J;
        C3123zl c3123zl8 = c3123zl7.f;
        if (c3123zl8 == null || !c3123zl8.c || (c3123zl2 = (c3123zl = this.L).f) == null || !c3123zl2.c) {
            return false;
        }
        return (c3123zl2.d() - c3123zl.e()) - (c3123zl7.e() + c3123zl7.f.d()) >= i2;
    }

    public final void v(int i, int i2, int i3, int i4, C0530Ul c0530Ul) {
        i(i).b(c0530Ul.i(i2), i3, i4, true);
    }

    public final boolean w(int i) {
        C3123zl c3123zl;
        C3123zl c3123zl2;
        int i2 = i * 2;
        C3123zl[] c3123zlArr = this.Q;
        C3123zl c3123zl3 = c3123zlArr[i2];
        C3123zl c3123zl4 = c3123zl3.f;
        return (c3123zl4 == null || c3123zl4.f == c3123zl3 || (c3123zl2 = (c3123zl = c3123zlArr[i2 + 1]).f) == null || c3123zl2.f != c3123zl) ? false : true;
    }

    public final boolean x() {
        C3123zl c3123zl = this.I;
        C3123zl c3123zl2 = c3123zl.f;
        if (c3123zl2 != null && c3123zl2.f == c3123zl) {
            return true;
        }
        C3123zl c3123zl3 = this.K;
        C3123zl c3123zl4 = c3123zl3.f;
        return c3123zl4 != null && c3123zl4.f == c3123zl3;
    }

    public final boolean y() {
        C3123zl c3123zl = this.J;
        C3123zl c3123zl2 = c3123zl.f;
        if (c3123zl2 != null && c3123zl2.f == c3123zl) {
            return true;
        }
        C3123zl c3123zl3 = this.L;
        C3123zl c3123zl4 = c3123zl3.f;
        return c3123zl4 != null && c3123zl4.f == c3123zl3;
    }

    public final boolean z() {
        return this.g && this.g0 != 8;
    }
}
