package u1;

import m1.AbstractC2464a;
import n1.C2608b;
import n1.C2609c;

/* JADX INFO: loaded from: classes.dex */
public final class h extends d {

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

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

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

    /* JADX INFO: renamed from: q0, reason: collision with root package name */
    public C2962c f24548q0;

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

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

    @Override // u1.d
    public final void M(C2609c c2609c, boolean z6) {
        if (this.f24447Q == null) {
            return;
        }
        C2962c c2962c = this.f24548q0;
        c2609c.getClass();
        int iN = C2609c.n(c2962c);
        if (this.f24549r0 == 1) {
            this.f24452V = iN;
            this.f24453W = 0;
            H(this.f24447Q.l());
            K(0);
            return;
        }
        this.f24452V = 0;
        this.f24453W = iN;
        K(this.f24447Q.o());
        H(0);
    }

    public final void N(int i6) {
        this.f24548q0.l(i6);
        this.f24550s0 = true;
    }

    @Override // u1.d
    public final void c(C2609c c2609c, boolean z6) {
        e eVar = this.f24447Q;
        if (eVar == null) {
            return;
        }
        Object objJ = eVar.j(2);
        Object objJ2 = eVar.j(4);
        e eVar2 = this.f24447Q;
        boolean z7 = eVar2 != null && eVar2.f24475m0[0] == 2;
        if (this.f24549r0 == 0) {
            objJ = eVar.j(3);
            objJ2 = eVar.j(5);
            e eVar3 = this.f24447Q;
            z7 = eVar3 != null && eVar3.f24475m0[1] == 2;
        }
        if (this.f24550s0) {
            C2962c c2962c = this.f24548q0;
            if (c2962c.f24424c) {
                n1.e eVarK = c2609c.k(c2962c);
                c2609c.d(eVarK, this.f24548q0.d());
                if (this.f24546o0 != -1) {
                    if (z7) {
                        c2609c.f(c2609c.k(objJ2), eVarK, 0, 5);
                    }
                } else if (this.f24547p0 != -1 && z7) {
                    n1.e eVarK2 = c2609c.k(objJ2);
                    c2609c.f(eVarK, c2609c.k(objJ), 0, 5);
                    c2609c.f(eVarK2, eVarK, 0, 5);
                }
                this.f24550s0 = false;
                return;
            }
        }
        if (this.f24546o0 != -1) {
            n1.e eVarK3 = c2609c.k(this.f24548q0);
            c2609c.e(eVarK3, c2609c.k(objJ), this.f24546o0, 8);
            if (z7) {
                c2609c.f(c2609c.k(objJ2), eVarK3, 0, 5);
                return;
            }
            return;
        }
        if (this.f24547p0 != -1) {
            n1.e eVarK4 = c2609c.k(this.f24548q0);
            n1.e eVarK5 = c2609c.k(objJ2);
            c2609c.e(eVarK4, eVarK5, -this.f24547p0, 8);
            if (z7) {
                c2609c.f(eVarK4, c2609c.k(objJ), 0, 5);
                c2609c.f(eVarK5, eVarK4, 0, 5);
                return;
            }
            return;
        }
        if (this.f24545n0 != -1.0f) {
            n1.e eVarK6 = c2609c.k(this.f24548q0);
            n1.e eVarK7 = c2609c.k(objJ2);
            float f6 = this.f24545n0;
            C2608b c2608bL = c2609c.l();
            c2608bL.f21574d.g(eVarK6, -1.0f);
            c2608bL.f21574d.g(eVarK7, f6);
            c2609c.c(c2608bL);
        }
    }

    @Override // u1.d
    public final boolean d() {
        return true;
    }

    @Override // u1.d
    public final C2962c j(int i6) {
        int iC = AbstractC2464a.c(i6);
        if (iC != 1) {
            if (iC != 2) {
                if (iC != 3) {
                    if (iC != 4) {
                        return null;
                    }
                }
            }
            if (this.f24549r0 == 0) {
                return this.f24548q0;
            }
            return null;
        }
        if (this.f24549r0 == 1) {
            return this.f24548q0;
        }
        return null;
    }

    @Override // u1.d
    public final boolean y() {
        return this.f24550s0;
    }

    @Override // u1.d
    public final boolean z() {
        return this.f24550s0;
    }
}
