package d.f.a.j;

import d.f.a.j.c;
import d.f.a.j.l.m;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;

/* JADX INFO: loaded from: classes.dex */
public class d {
    public float A;
    public int[] B;
    public float C;
    public boolean D;
    public boolean E;
    public boolean F;
    public int G;
    public int H;
    public c I;
    public c J;
    public c K;
    public c L;
    public c M;
    public c N;
    public c O;
    public c P;
    public c[] Q;
    public ArrayList<c> R;
    public boolean[] S;
    public int[] T;
    public d U;
    public int V;
    public int W;
    public float X;
    public int Y;
    public int Z;

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public d.f.a.j.l.c f2323b;

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public d.f.a.j.l.c f2325c;

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

    /* JADX INFO: renamed from: d0, reason: collision with root package name */
    public int f2328d0;
    public float e0;
    public float f0;
    public Object g0;
    public int h0;
    public String i0;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public boolean f2334j;
    public int j0;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public boolean f2335k;
    public int k0;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public boolean f2336l;
    public float[] l0;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public boolean f2337m;
    public d[] m0;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public int f2338n;
    public d[] n0;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public int f2339o;
    public int o0;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public int f2340p;
    public int p0;

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

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

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

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

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

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

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

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

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

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    public int f2350z;
    public boolean a = false;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public d.f.a.j.l.k f2327d = null;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public m f2329e = null;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public boolean[] f2330f = {true, true};

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public boolean f2331g = true;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public int f2332h = -1;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public int f2333i = -1;

    public d() {
        new HashMap();
        this.f2334j = false;
        this.f2335k = false;
        this.f2336l = false;
        this.f2337m = false;
        this.f2338n = -1;
        this.f2339o = -1;
        this.f2340p = 0;
        this.f2341q = 0;
        this.f2342r = 0;
        this.f2343s = new int[2];
        this.f2344t = 0;
        this.f2345u = 0;
        this.f2346v = 1.0f;
        this.f2347w = 0;
        this.f2348x = 0;
        this.f2349y = 1.0f;
        this.f2350z = -1;
        this.A = 1.0f;
        this.B = new int[]{Integer.MAX_VALUE, Integer.MAX_VALUE};
        this.C = 0.0f;
        this.D = false;
        this.F = false;
        this.G = 0;
        this.H = 0;
        c cVar = new c(this, c.a.LEFT);
        this.I = cVar;
        c cVar2 = new c(this, c.a.TOP);
        this.J = cVar2;
        c cVar3 = new c(this, c.a.RIGHT);
        this.K = cVar3;
        c cVar4 = new c(this, c.a.BOTTOM);
        this.L = cVar4;
        c cVar5 = new c(this, c.a.BASELINE);
        this.M = cVar5;
        this.N = new c(this, c.a.CENTER_X);
        this.O = new c(this, c.a.CENTER_Y);
        c cVar6 = new c(this, c.a.CENTER);
        this.P = cVar6;
        this.Q = new c[]{cVar, cVar3, cVar2, cVar4, cVar5, cVar6};
        ArrayList<c> arrayList = new ArrayList<>();
        this.R = arrayList;
        this.S = new boolean[2];
        this.T = new int[]{1, 1};
        this.U = null;
        this.V = 0;
        this.W = 0;
        this.X = 0.0f;
        this.Y = -1;
        this.Z = 0;
        this.f2322a0 = 0;
        this.f2324b0 = 0;
        this.e0 = 0.5f;
        this.f0 = 0.5f;
        this.h0 = 0;
        this.i0 = null;
        this.j0 = 0;
        this.k0 = 0;
        this.l0 = new float[]{-1.0f, -1.0f};
        this.m0 = new d[]{null, null};
        this.n0 = new d[]{null, null};
        this.o0 = -1;
        this.p0 = -1;
        arrayList.add(this.I);
        this.R.add(this.J);
        this.R.add(this.K);
        this.R.add(this.L);
        this.R.add(this.N);
        this.R.add(this.O);
        this.R.add(this.P);
        this.R.add(this.M);
    }

    public boolean A() {
        return this.f2334j || (this.I.f2305c && this.K.f2305c);
    }

    public boolean B() {
        return this.f2335k || (this.J.f2305c && this.L.f2305c);
    }

    public void C() {
        this.I.h();
        this.J.h();
        this.K.h();
        this.L.h();
        this.M.h();
        this.N.h();
        this.O.h();
        this.P.h();
        this.U = null;
        this.C = 0.0f;
        this.V = 0;
        this.W = 0;
        this.X = 0.0f;
        this.Y = -1;
        this.Z = 0;
        this.f2322a0 = 0;
        this.f2324b0 = 0;
        this.f2326c0 = 0;
        this.f2328d0 = 0;
        this.e0 = 0.5f;
        this.f0 = 0.5f;
        int[] iArr = this.T;
        iArr[0] = 1;
        iArr[1] = 1;
        this.g0 = null;
        this.h0 = 0;
        this.j0 = 0;
        this.k0 = 0;
        float[] fArr = this.l0;
        fArr[0] = -1.0f;
        fArr[1] = -1.0f;
        this.f2338n = -1;
        this.f2339o = -1;
        int[] iArr2 = this.B;
        iArr2[0] = Integer.MAX_VALUE;
        iArr2[1] = Integer.MAX_VALUE;
        this.f2341q = 0;
        this.f2342r = 0;
        this.f2346v = 1.0f;
        this.f2349y = 1.0f;
        this.f2345u = Integer.MAX_VALUE;
        this.f2348x = Integer.MAX_VALUE;
        this.f2344t = 0;
        this.f2347w = 0;
        this.f2350z = -1;
        this.A = 1.0f;
        boolean[] zArr = this.f2330f;
        zArr[0] = true;
        zArr[1] = true;
        this.F = false;
        boolean[] zArr2 = this.S;
        zArr2[0] = false;
        zArr2[1] = false;
        this.f2331g = true;
        int[] iArr3 = this.f2343s;
        iArr3[0] = 0;
        iArr3[1] = 0;
        this.f2332h = -1;
        this.f2333i = -1;
    }

    public void D() {
        this.f2334j = false;
        this.f2335k = false;
        this.f2336l = false;
        this.f2337m = false;
        int size = this.R.size();
        for (int i2 = 0; i2 < size; i2++) {
            c cVar = this.R.get(i2);
            cVar.f2305c = false;
            cVar.f2304b = 0;
        }
    }

    public void E(d.f.a.c cVar) {
        this.I.i();
        this.J.i();
        this.K.i();
        this.L.i();
        this.M.i();
        this.P.i();
        this.N.i();
        this.O.i();
    }

    public void F(int i2) {
        this.f2324b0 = i2;
        this.D = i2 > 0;
    }

    public void G(int i2, int i3) {
        if (this.f2334j) {
            return;
        }
        c cVar = this.I;
        cVar.f2304b = i2;
        cVar.f2305c = true;
        c cVar2 = this.K;
        cVar2.f2304b = i3;
        cVar2.f2305c = true;
        this.Z = i2;
        this.V = i3 - i2;
        this.f2334j = true;
    }

    public void H(int i2, int i3) {
        if (this.f2335k) {
            return;
        }
        c cVar = this.J;
        cVar.f2304b = i2;
        cVar.f2305c = true;
        c cVar2 = this.L;
        cVar2.f2304b = i3;
        cVar2.f2305c = true;
        this.f2322a0 = i2;
        this.W = i3 - i2;
        if (this.D) {
            this.M.j(i2 + this.f2324b0);
        }
        this.f2335k = true;
    }

    public void I(int i2) {
        this.W = i2;
        int i3 = this.f2328d0;
        if (i2 < i3) {
            this.W = i3;
        }
    }

    public void J(int i2) {
        this.T[0] = i2;
    }

    public void K(int i2) {
        if (i2 < 0) {
            i2 = 0;
        }
        this.f2328d0 = i2;
    }

    public void L(int i2) {
        if (i2 < 0) {
            i2 = 0;
        }
        this.f2326c0 = i2;
    }

    public void M(int i2) {
        this.T[1] = i2;
    }

    public void N(int i2) {
        this.V = i2;
        int i3 = this.f2326c0;
        if (i2 < i3) {
            this.V = i3;
        }
    }

    public void O(boolean z2, boolean z3) {
        int i2;
        int i3;
        d.f.a.j.l.k kVar = this.f2327d;
        boolean z4 = z2 & kVar.f2409g;
        m mVar = this.f2329e;
        boolean z5 = z3 & mVar.f2409g;
        int i4 = kVar.f2410h.f2376g;
        int i5 = mVar.f2410h.f2376g;
        int i6 = kVar.f2411i.f2376g;
        int i7 = mVar.f2411i.f2376g;
        int i8 = i7 - i5;
        if (i6 - i4 < 0 || i8 < 0 || i4 == Integer.MIN_VALUE || i4 == Integer.MAX_VALUE || i5 == Integer.MIN_VALUE || i5 == Integer.MAX_VALUE || i6 == Integer.MIN_VALUE || i6 == Integer.MAX_VALUE || i7 == Integer.MIN_VALUE || i7 == Integer.MAX_VALUE) {
            i6 = 0;
            i7 = 0;
            i4 = 0;
            i5 = 0;
        }
        int i9 = i6 - i4;
        int i10 = i7 - i5;
        if (z4) {
            this.Z = i4;
        }
        if (z5) {
            this.f2322a0 = i5;
        }
        if (this.h0 == 8) {
            this.V = 0;
            this.W = 0;
            return;
        }
        if (z4) {
            if (this.T[0] == 1 && i9 < (i3 = this.V)) {
                i9 = i3;
            }
            this.V = i9;
            int i11 = this.f2326c0;
            if (i9 < i11) {
                this.V = i11;
            }
        }
        if (z5) {
            if (this.T[1] == 1 && i10 < (i2 = this.W)) {
                i10 = i2;
            }
            this.W = i10;
            int i12 = this.f2328d0;
            if (i10 < i12) {
                this.W = i12;
            }
        }
    }

    public void P(d.f.a.d dVar, boolean z2) {
        int i2;
        int i3;
        m mVar;
        d.f.a.j.l.k kVar;
        int iO = dVar.o(this.I);
        int iO2 = dVar.o(this.J);
        int iO3 = dVar.o(this.K);
        int iO4 = dVar.o(this.L);
        if (z2 && (kVar = this.f2327d) != null) {
            d.f.a.j.l.f fVar = kVar.f2410h;
            if (fVar.f2379j) {
                d.f.a.j.l.f fVar2 = kVar.f2411i;
                if (fVar2.f2379j) {
                    iO = fVar.f2376g;
                    iO3 = fVar2.f2376g;
                }
            }
        }
        if (z2 && (mVar = this.f2329e) != null) {
            d.f.a.j.l.f fVar3 = mVar.f2410h;
            if (fVar3.f2379j) {
                d.f.a.j.l.f fVar4 = mVar.f2411i;
                if (fVar4.f2379j) {
                    iO2 = fVar3.f2376g;
                    iO4 = fVar4.f2376g;
                }
            }
        }
        int i4 = iO4 - iO2;
        if (iO3 - iO < 0 || i4 < 0 || iO == Integer.MIN_VALUE || iO == Integer.MAX_VALUE || iO2 == Integer.MIN_VALUE || iO2 == Integer.MAX_VALUE || iO3 == Integer.MIN_VALUE || iO3 == Integer.MAX_VALUE || iO4 == Integer.MIN_VALUE || iO4 == Integer.MAX_VALUE) {
            iO4 = 0;
            iO = 0;
            iO2 = 0;
            iO3 = 0;
        }
        int i5 = iO3 - iO;
        int i6 = iO4 - iO2;
        this.Z = iO;
        this.f2322a0 = iO2;
        if (this.h0 == 8) {
            this.V = 0;
            this.W = 0;
            return;
        }
        int[] iArr = this.T;
        if (iArr[0] == 1 && i5 < (i3 = this.V)) {
            i5 = i3;
        }
        if (iArr[1] == 1 && i6 < (i2 = this.W)) {
            i6 = i2;
        }
        this.V = i5;
        this.W = i6;
        int i7 = this.f2328d0;
        if (i6 < i7) {
            this.W = i7;
        }
        int i8 = this.f2326c0;
        if (i5 < i8) {
            this.V = i8;
        }
        int i9 = this.f2345u;
        if (i9 > 0 && iArr[0] == 3) {
            this.V = Math.min(this.V, i9);
        }
        int i10 = this.f2348x;
        if (i10 > 0 && this.T[1] == 3) {
            this.W = Math.min(this.W, i10);
        }
        int i11 = this.V;
        if (i5 != i11) {
            this.f2332h = i11;
        }
        int i12 = this.W;
        if (i6 != i12) {
            this.f2333i = i12;
        }
    }

    public void b(e eVar, d.f.a.d dVar, HashSet<d> hashSet, int i2, boolean z2) {
        if (z2) {
            if (!hashSet.contains(this)) {
                return;
            }
            i.a(eVar, dVar, this);
            hashSet.remove(this);
            d(dVar, eVar.a0(64));
        }
        if (i2 == 0) {
            HashSet<c> hashSet2 = this.I.a;
            if (hashSet2 != null) {
                Iterator<c> it = hashSet2.iterator();
                while (it.hasNext()) {
                    it.next().f2306d.b(eVar, dVar, hashSet, i2, true);
                }
            }
            HashSet<c> hashSet3 = this.K.a;
            if (hashSet3 != null) {
                Iterator<c> it2 = hashSet3.iterator();
                while (it2.hasNext()) {
                    it2.next().f2306d.b(eVar, dVar, hashSet, i2, true);
                }
                return;
            }
            return;
        }
        HashSet<c> hashSet4 = this.J.a;
        if (hashSet4 != null) {
            Iterator<c> it3 = hashSet4.iterator();
            while (it3.hasNext()) {
                it3.next().f2306d.b(eVar, dVar, hashSet, i2, true);
            }
        }
        HashSet<c> hashSet5 = this.L.a;
        if (hashSet5 != null) {
            Iterator<c> it4 = hashSet5.iterator();
            while (it4.hasNext()) {
                it4.next().f2306d.b(eVar, dVar, hashSet, i2, true);
            }
        }
        HashSet<c> hashSet6 = this.M.a;
        if (hashSet6 != null) {
            Iterator<c> it5 = hashSet6.iterator();
            while (it5.hasNext()) {
                it5.next().f2306d.b(eVar, dVar, hashSet, i2, true);
            }
        }
    }

    public boolean c() {
        return (this instanceof j) || (this instanceof f);
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:195:0x02cb  */
    /* JADX WARN: Removed duplicated region for block: B:19:0x0051  */
    /* JADX WARN: Removed duplicated region for block: B:203:0x02e9  */
    /* JADX WARN: Removed duplicated region for block: B:237:0x0375  */
    /* JADX WARN: Removed duplicated region for block: B:241:0x037f  */
    /* JADX WARN: Removed duplicated region for block: B:244:0x0384  */
    /* JADX WARN: Removed duplicated region for block: B:248:0x038e  */
    /* JADX WARN: Removed duplicated region for block: B:251:0x0398  */
    /* JADX WARN: Removed duplicated region for block: B:254:0x039e  */
    /* JADX WARN: Removed duplicated region for block: B:256:0x03a1  */
    /* JADX WARN: Removed duplicated region for block: B:257:0x03a4  */
    /* JADX WARN: Removed duplicated region for block: B:260:0x03bd  */
    /* JADX WARN: Removed duplicated region for block: B:280:0x0407  */
    /* JADX WARN: Removed duplicated region for block: B:295:0x04a7  */
    /* JADX WARN: Removed duplicated region for block: B:312:0x050b  */
    /* JADX WARN: Removed duplicated region for block: B:316:0x051f  */
    /* JADX WARN: Removed duplicated region for block: B:317:0x0521  */
    /* JADX WARN: Removed duplicated region for block: B:319:0x0524  */
    /* JADX WARN: Removed duplicated region for block: B:354:0x05b0  */
    /* JADX WARN: Removed duplicated region for block: B:355:0x05b3  */
    /* JADX WARN: Removed duplicated region for block: B:357:0x05f4  */
    /* JADX WARN: Removed duplicated region for block: B:360:0x05fc  */
    /* JADX WARN: Removed duplicated region for block: B:367:0x0623  */
    /* JADX WARN: Type inference failed for: r15v1 */
    /* JADX WARN: Type inference failed for: r15v2 */
    /* JADX WARN: Type inference failed for: r15v3, types: [d.f.a.j.d] */
    /* JADX WARN: Type inference failed for: r15v6, types: [d.f.a.j.d] */
    /* JADX WARN: Type inference failed for: r15v7 */
    /* JADX WARN: Type inference failed for: r15v8 */
    /* JADX WARN: Type inference failed for: r15v9 */
    /* JADX WARN: Type inference failed for: r27v1 */
    /* JADX WARN: Type inference failed for: r27v2, types: [boolean] */
    /* JADX WARN: Type inference failed for: r27v3 */
    /* JADX WARN: Type inference failed for: r48v0, types: [d.f.a.j.d] */
    /* JADX WARN: Type inference failed for: r9v4 */
    /* JADX WARN: Type inference failed for: r9v5, types: [boolean] */
    /* JADX WARN: Type inference failed for: r9v6 */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void d(d.f.a.d r49, boolean r50) {
        /*
            Method dump skipped, instruction units count: 1723
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: d.f.a.j.d.d(d.f.a.d, boolean):void");
    }

    public boolean e() {
        return this.h0 != 8;
    }

    /* JADX WARN: Removed duplicated region for block: B:108:0x0196  */
    /* JADX WARN: Removed duplicated region for block: B:188:0x02c5  */
    /* JADX WARN: Removed duplicated region for block: B:189:0x02c9  */
    /* JADX WARN: Removed duplicated region for block: B:228:0x037e  */
    /* JADX WARN: Removed duplicated region for block: B:230:0x0382  */
    /* JADX WARN: Removed duplicated region for block: B:238:0x03cc  */
    /* JADX WARN: Removed duplicated region for block: B:246:0x03f6  */
    /* JADX WARN: Removed duplicated region for block: B:256:0x041f  */
    /* JADX WARN: Removed duplicated region for block: B:265:0x0437  */
    /* JADX WARN: Removed duplicated region for block: B:267:0x043d  */
    /* JADX WARN: Removed duplicated region for block: B:295:0x0476 A[PHI: r3
      0x0476: PHI (r3v12 int) = (r3v11 int), (r3v16 int), (r3v16 int), (r3v16 int) binds: [B:288:0x0465, B:290:0x046b, B:291:0x046d, B:293:0x0471] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:298:0x0488  */
    /* JADX WARN: Removed duplicated region for block: B:313:0x04b1  */
    /* JADX WARN: Removed duplicated region for block: B:317:0x04b8 A[ADDED_TO_REGION] */
    /* JADX WARN: Removed duplicated region for block: B:31:0x007d  */
    /* JADX WARN: Removed duplicated region for block: B:325:0x04cc  */
    /* JADX WARN: Removed duplicated region for block: B:327:0x04dd A[ADDED_TO_REGION] */
    /* JADX WARN: Removed duplicated region for block: B:346:0x0510  */
    /* JADX WARN: Removed duplicated region for block: B:34:0x0087  */
    /* JADX WARN: Removed duplicated region for block: B:353:? A[ADDED_TO_REGION, RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:356:? A[ADDED_TO_REGION, RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:35:0x008b  */
    /* JADX WARN: Removed duplicated region for block: B:37:0x0091  */
    /* JADX WARN: Removed duplicated region for block: B:45:0x00b2  */
    /* JADX WARN: Removed duplicated region for block: B:47:0x00b7  */
    /* JADX WARN: Removed duplicated region for block: B:57:0x00d2  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void f(d.f.a.d r36, boolean r37, boolean r38, boolean r39, boolean r40, d.f.a.h r41, d.f.a.h r42, int r43, boolean r44, d.f.a.j.c r45, d.f.a.j.c r46, int r47, int r48, int r49, int r50, float r51, boolean r52, boolean r53, boolean r54, boolean r55, boolean r56, int r57, int r58, int r59, int r60, float r61, boolean r62) {
        /*
            Method dump skipped, instruction units count: 1303
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: d.f.a.j.d.f(d.f.a.d, boolean, boolean, boolean, boolean, d.f.a.h, d.f.a.h, int, boolean, d.f.a.j.c, d.f.a.j.c, int, int, int, int, float, boolean, boolean, boolean, boolean, boolean, int, int, int, int, float, boolean):void");
    }

    public void g(d.f.a.d dVar) {
        dVar.l(this.I);
        dVar.l(this.J);
        dVar.l(this.K);
        dVar.l(this.L);
        if (this.f2324b0 > 0) {
            dVar.l(this.M);
        }
    }

    public void h() {
        if (this.f2327d == null) {
            this.f2327d = new d.f.a.j.l.k(this);
        }
        if (this.f2329e == null) {
            this.f2329e = new m(this);
        }
    }

    public c i(c.a aVar) {
        switch (aVar) {
            case NONE:
                return null;
            case LEFT:
                return this.I;
            case TOP:
                return this.J;
            case RIGHT:
                return this.K;
            case BOTTOM:
                return this.L;
            case BASELINE:
                return this.M;
            case CENTER:
                return this.P;
            case CENTER_X:
                return this.N;
            case CENTER_Y:
                return this.O;
            default:
                throw new AssertionError(aVar.name());
        }
    }

    public int j() {
        return t() + this.W;
    }

    public int k(int i2) {
        if (i2 == 0) {
            return m();
        }
        if (i2 == 1) {
            return q();
        }
        return 0;
    }

    public int l() {
        if (this.h0 == 8) {
            return 0;
        }
        return this.W;
    }

    public int m() {
        return this.T[0];
    }

    public d n(int i2) {
        c cVar;
        c cVar2;
        if (i2 != 0) {
            if (i2 == 1 && (cVar2 = (cVar = this.L).f2308f) != null && cVar2.f2308f == cVar) {
                return cVar2.f2306d;
            }
            return null;
        }
        c cVar3 = this.K;
        c cVar4 = cVar3.f2308f;
        if (cVar4 == null || cVar4.f2308f != cVar3) {
            return null;
        }
        return cVar4.f2306d;
    }

    public d o(int i2) {
        c cVar;
        c cVar2;
        if (i2 != 0) {
            if (i2 == 1 && (cVar2 = (cVar = this.J).f2308f) != null && cVar2.f2308f == cVar) {
                return cVar2.f2306d;
            }
            return null;
        }
        c cVar3 = this.I;
        c cVar4 = cVar3.f2308f;
        if (cVar4 == null || cVar4.f2308f != cVar3) {
            return null;
        }
        return cVar4.f2306d;
    }

    public int p() {
        return s() + this.V;
    }

    public int q() {
        return this.T[1];
    }

    public int r() {
        if (this.h0 == 8) {
            return 0;
        }
        return this.V;
    }

    public int s() {
        d dVar = this.U;
        return (dVar == null || !(dVar instanceof e)) ? this.Z : ((e) dVar).x0 + this.Z;
    }

    public int t() {
        d dVar = this.U;
        return (dVar == null || !(dVar instanceof e)) ? this.f2322a0 : ((e) dVar).y0 + this.f2322a0;
    }

    public String toString() {
        StringBuilder sbF = g.a.a.a.a.F("");
        sbF.append(this.i0 != null ? g.a.a.a.a.A(g.a.a.a.a.F("id: "), this.i0, " ") : "");
        sbF.append("(");
        sbF.append(this.Z);
        sbF.append(", ");
        sbF.append(this.f2322a0);
        sbF.append(") - (");
        sbF.append(this.V);
        sbF.append(" x ");
        return g.a.a.a.a.y(sbF, this.W, ")");
    }

    public boolean u(int i2) {
        if (i2 == 0) {
            return (this.I.f2308f != null ? 1 : 0) + (this.K.f2308f != null ? 1 : 0) < 2;
        }
        return ((this.J.f2308f != null ? 1 : 0) + (this.L.f2308f != null ? 1 : 0)) + (this.M.f2308f != null ? 1 : 0) < 2;
    }

    public boolean v(int i2, int i3) {
        c cVar;
        c cVar2;
        if (i2 == 0) {
            c cVar3 = this.I.f2308f;
            if (cVar3 != null && cVar3.f2305c && (cVar2 = this.K.f2308f) != null && cVar2.f2305c) {
                return (cVar2.c() - this.K.d()) - (this.I.d() + this.I.f2308f.c()) >= i3;
            }
        } else {
            c cVar4 = this.J.f2308f;
            if (cVar4 != null && cVar4.f2305c && (cVar = this.L.f2308f) != null && cVar.f2305c) {
                return (cVar.c() - this.L.d()) - (this.J.d() + this.J.f2308f.c()) >= i3;
            }
        }
        return false;
    }

    public final boolean w(int i2) {
        int i3 = i2 * 2;
        c[] cVarArr = this.Q;
        if (cVarArr[i3].f2308f != null && cVarArr[i3].f2308f.f2308f != cVarArr[i3]) {
            int i4 = i3 + 1;
            if (cVarArr[i4].f2308f != null && cVarArr[i4].f2308f.f2308f == cVarArr[i4]) {
                return true;
            }
        }
        return false;
    }

    public boolean x() {
        c cVar = this.I;
        c cVar2 = cVar.f2308f;
        if (cVar2 != null && cVar2.f2308f == cVar) {
            return true;
        }
        c cVar3 = this.K;
        c cVar4 = cVar3.f2308f;
        return cVar4 != null && cVar4.f2308f == cVar3;
    }

    public boolean y() {
        c cVar = this.J;
        c cVar2 = cVar.f2308f;
        if (cVar2 != null && cVar2.f2308f == cVar) {
            return true;
        }
        c cVar3 = this.L;
        c cVar4 = cVar3.f2308f;
        return cVar4 != null && cVar4.f2308f == cVar3;
    }

    public boolean z() {
        return this.f2331g && this.h0 != 8;
    }
}
