package w;

import java.util.ArrayList;
import u.C1028b;

/* JADX INFO: renamed from: w.h, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1087h extends C1083d {

    /* JADX INFO: renamed from: q0, reason: collision with root package name */
    public float f10599q0 = -1.0f;

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

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

    /* JADX INFO: renamed from: t0, reason: collision with root package name */
    public C1082c f10602t0 = this.J;

    /* JADX INFO: renamed from: u0, reason: collision with root package name */
    public int f10603u0 = 0;

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

    public C1087h() {
        this.f10483R.clear();
        this.f10483R.add(this.f10602t0);
        int length = this.f10482Q.length;
        for (int i = 0; i < length; i++) {
            this.f10482Q[i] = this.f10602t0;
        }
    }

    @Override // w.C1083d
    public final boolean A() {
        return this.f10604v0;
    }

    @Override // w.C1083d
    public final boolean B() {
        return this.f10604v0;
    }

    @Override // w.C1083d
    public final void Q(u.c cVar, boolean z5) {
        if (this.f10485T == null) {
            return;
        }
        C1082c c1082c = this.f10602t0;
        cVar.getClass();
        int iN = u.c.n(c1082c);
        if (this.f10603u0 == 1) {
            this.f10489Y = iN;
            this.f10490Z = 0;
            L(this.f10485T.k());
            O(0);
            return;
        }
        this.f10489Y = 0;
        this.f10490Z = iN;
        O(this.f10485T.q());
        L(0);
    }

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

    public final void S(int i) {
        if (this.f10603u0 == i) {
            return;
        }
        this.f10603u0 = i;
        ArrayList arrayList = this.f10483R;
        arrayList.clear();
        if (this.f10603u0 == 1) {
            this.f10602t0 = this.I;
        } else {
            this.f10602t0 = this.J;
        }
        arrayList.add(this.f10602t0);
        C1082c[] c1082cArr = this.f10482Q;
        int length = c1082cArr.length;
        for (int i5 = 0; i5 < length; i5++) {
            c1082cArr[i5] = this.f10602t0;
        }
    }

    @Override // w.C1083d
    public final void b(u.c cVar, boolean z5) {
        C1084e c1084e = (C1084e) this.f10485T;
        if (c1084e == null) {
            return;
        }
        Object objI = c1084e.i(2);
        Object objI2 = c1084e.i(4);
        C1083d c1083d = this.f10485T;
        boolean z6 = c1083d != null && c1083d.f10519p0[0] == 2;
        if (this.f10603u0 == 0) {
            objI = c1084e.i(3);
            objI2 = c1084e.i(5);
            C1083d c1083d2 = this.f10485T;
            z6 = c1083d2 != null && c1083d2.f10519p0[1] == 2;
        }
        if (this.f10604v0) {
            C1082c c1082c = this.f10602t0;
            if (c1082c.f10463c) {
                u.f fVarK = cVar.k(c1082c);
                cVar.d(fVarK, this.f10602t0.d());
                if (this.f10600r0 != -1) {
                    if (z6) {
                        cVar.f(cVar.k(objI2), fVarK, 0, 5);
                    }
                } else if (this.f10601s0 != -1 && z6) {
                    u.f fVarK2 = cVar.k(objI2);
                    cVar.f(fVarK, cVar.k(objI), 0, 5);
                    cVar.f(fVarK2, fVarK, 0, 5);
                }
                this.f10604v0 = false;
                return;
            }
        }
        if (this.f10600r0 != -1) {
            u.f fVarK3 = cVar.k(this.f10602t0);
            cVar.e(fVarK3, cVar.k(objI), this.f10600r0, 8);
            if (z6) {
                cVar.f(cVar.k(objI2), fVarK3, 0, 5);
                return;
            }
            return;
        }
        if (this.f10601s0 != -1) {
            u.f fVarK4 = cVar.k(this.f10602t0);
            u.f fVarK5 = cVar.k(objI2);
            cVar.e(fVarK4, fVarK5, -this.f10601s0, 8);
            if (z6) {
                cVar.f(fVarK4, cVar.k(objI), 0, 5);
                cVar.f(fVarK5, fVarK4, 0, 5);
                return;
            }
            return;
        }
        if (this.f10599q0 != -1.0f) {
            u.f fVarK6 = cVar.k(this.f10602t0);
            u.f fVarK7 = cVar.k(objI2);
            float f6 = this.f10599q0;
            C1028b c1028bL = cVar.l();
            c1028bL.f10017d.g(fVarK6, -1.0f);
            c1028bL.f10017d.g(fVarK7, f6);
            cVar.c(c1028bL);
        }
    }

    @Override // w.C1083d
    public final boolean c() {
        return true;
    }

    @Override // w.C1083d
    public final C1082c i(int i) {
        int iC = u.e.c(i);
        if (iC != 1) {
            if (iC != 2) {
                if (iC != 3) {
                    if (iC != 4) {
                        return null;
                    }
                }
            }
            if (this.f10603u0 == 0) {
                return this.f10602t0;
            }
            return null;
        }
        if (this.f10603u0 == 1) {
            return this.f10602t0;
        }
        return null;
    }
}
