package o;

import java.util.ArrayList;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.uE, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2604uE extends C0530Ul {
    public float q0 = -1.0f;
    public int r0 = -1;
    public int s0 = -1;
    public C3123zl t0 = this.J;
    public int u0 = 0;
    public boolean v0;

    public C2604uE() {
        this.R.clear();
        this.R.add(this.t0);
        int length = this.Q.length;
        for (int i = 0; i < length; i++) {
            this.Q[i] = this.t0;
        }
    }

    @Override // o.C0530Ul
    public final boolean A() {
        return this.v0;
    }

    @Override // o.C0530Ul
    public final boolean B() {
        return this.v0;
    }

    @Override // o.C0530Ul
    public final void Q(C2991yL c2991yL, boolean z) {
        if (this.T == null) {
            return;
        }
        C3123zl c3123zl = this.t0;
        c2991yL.getClass();
        int iN = C2991yL.n(c3123zl);
        if (this.u0 == 1) {
            this.Y = iN;
            this.Z = 0;
            L(this.T.k());
            O(0);
            return;
        }
        this.Y = 0;
        this.Z = iN;
        O(this.T.q());
        L(0);
    }

    public final void R(int i) {
        this.t0.l(i);
        this.v0 = true;
    }

    public final void S(int i) {
        if (this.u0 == i) {
            return;
        }
        this.u0 = i;
        ArrayList arrayList = this.R;
        arrayList.clear();
        if (this.u0 == 1) {
            this.t0 = this.I;
        } else {
            this.t0 = this.J;
        }
        arrayList.add(this.t0);
        C3123zl[] c3123zlArr = this.Q;
        int length = c3123zlArr.length;
        for (int i2 = 0; i2 < length; i2++) {
            c3123zlArr[i2] = this.t0;
        }
    }

    @Override // o.C0530Ul
    public final void b(C2991yL c2991yL, boolean z) {
        C0556Vl c0556Vl = (C0556Vl) this.T;
        if (c0556Vl == null) {
            return;
        }
        Object objI = c0556Vl.i(2);
        Object objI2 = c0556Vl.i(4);
        C0530Ul c0530Ul = this.T;
        boolean z2 = c0530Ul != null && c0530Ul.p0[0] == 2;
        if (this.u0 == 0) {
            objI = c0556Vl.i(3);
            objI2 = c0556Vl.i(5);
            C0530Ul c0530Ul2 = this.T;
            z2 = c0530Ul2 != null && c0530Ul2.p0[1] == 2;
        }
        if (this.v0) {
            C3123zl c3123zl = this.t0;
            if (c3123zl.c) {
                R90 r90K = c2991yL.k(c3123zl);
                c2991yL.d(r90K, this.t0.d());
                if (this.r0 != -1) {
                    if (z2) {
                        c2991yL.f(c2991yL.k(objI2), r90K, 0, 5);
                    }
                } else if (this.s0 != -1 && z2) {
                    R90 r90K2 = c2991yL.k(objI2);
                    c2991yL.f(r90K, c2991yL.k(objI), 0, 5);
                    c2991yL.f(r90K2, r90K, 0, 5);
                }
                this.v0 = false;
                return;
            }
        }
        if (this.r0 != -1) {
            R90 r90K3 = c2991yL.k(this.t0);
            c2991yL.e(r90K3, c2991yL.k(objI), this.r0, 8);
            if (z2) {
                c2991yL.f(c2991yL.k(objI2), r90K3, 0, 5);
                return;
            }
            return;
        }
        if (this.s0 != -1) {
            R90 r90K4 = c2991yL.k(this.t0);
            R90 r90K5 = c2991yL.k(objI2);
            c2991yL.e(r90K4, r90K5, -this.s0, 8);
            if (z2) {
                c2991yL.f(r90K4, c2991yL.k(objI), 0, 5);
                c2991yL.f(r90K5, r90K4, 0, 5);
                return;
            }
            return;
        }
        if (this.q0 != -1.0f) {
            R90 r90K6 = c2991yL.k(this.t0);
            R90 r90K7 = c2991yL.k(objI2);
            float f = this.q0;
            C2029o9 c2029o9L = c2991yL.l();
            c2029o9L.d.g(r90K6, -1.0f);
            c2029o9L.d.g(r90K7, f);
            c2991yL.c(c2029o9L);
        }
    }

    @Override // o.C0530Ul
    public final boolean c() {
        return true;
    }

    @Override // o.C0530Ul
    public final C3123zl i(int i) {
        int iW = AbstractC2462sn.w(i);
        if (iW != 1) {
            if (iW != 2) {
                if (iW != 3) {
                    if (iW != 4) {
                        return null;
                    }
                }
            }
            if (this.u0 == 0) {
                return this.t0;
            }
            return null;
        }
        if (this.u0 == 1) {
            return this.t0;
        }
        return null;
    }
}
