package o;

import java.util.ArrayList;
import java.util.List;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.pE, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2130pE extends AbstractC2738vi0 {
    public float[] b;
    public final ArrayList c = new ArrayList();
    public boolean d = true;
    public long e = C0190Hi.g;
    public List f;
    public boolean g;
    public O4 h;
    public OC i;
    public final C2769w j;
    public String k;
    public float l;
    public float m;
    public float n;

    /* renamed from: o, reason: collision with root package name */
    public float f675o;
    public float p;
    public float q;
    public float r;
    public boolean s;

    public C2130pE() {
        int i = Zi0.a;
        this.f = C0332Mv.l;
        this.g = true;
        this.j = new C2769w(20, this);
        this.k = "";
        this.f675o = 1.0f;
        this.p = 1.0f;
        this.s = true;
    }

    @Override // o.AbstractC2738vi0
    public final void a(InterfaceC2095ot interfaceC2095ot) {
        if (this.s) {
            float[] fArrA = this.b;
            if (fArrA == null) {
                fArrA = C1570jO.a();
                this.b = fArrA;
            } else {
                C1570jO.d(fArrA);
            }
            C1570jO.f(fArrA, this.q + this.m, this.r + this.n);
            float f = this.l;
            if (fArrA.length >= 16) {
                double d = f * 0.017453292519943295d;
                float fSin = (float) Math.sin(d);
                float fCos = (float) Math.cos(d);
                float f2 = fArrA[0];
                float f3 = fArrA[4];
                float f4 = (fSin * f3) + (fCos * f2);
                float f5 = -fSin;
                float f6 = (f3 * fCos) + (f2 * f5);
                float f7 = fArrA[1];
                float f8 = fArrA[5];
                float f9 = (fSin * f8) + (fCos * f7);
                float f10 = (f8 * fCos) + (f7 * f5);
                float f11 = fArrA[2];
                float f12 = fArrA[6];
                float f13 = (fSin * f12) + (fCos * f11);
                float f14 = (f12 * fCos) + (f11 * f5);
                float f15 = fArrA[3];
                float f16 = fArrA[7];
                fArrA[0] = f4;
                fArrA[1] = f9;
                fArrA[2] = f13;
                fArrA[3] = (fSin * f16) + (fCos * f15);
                fArrA[4] = f6;
                fArrA[5] = f10;
                fArrA[6] = f14;
                fArrA[7] = (fCos * f16) + (f5 * f15);
            }
            float f17 = this.f675o;
            float f18 = this.p;
            if (fArrA.length >= 16) {
                fArrA[0] = fArrA[0] * f17;
                fArrA[1] = fArrA[1] * f17;
                fArrA[2] = fArrA[2] * f17;
                fArrA[3] = fArrA[3] * f17;
                fArrA[4] = fArrA[4] * f18;
                fArrA[5] = fArrA[5] * f18;
                fArrA[6] = fArrA[6] * f18;
                fArrA[7] = fArrA[7] * f18;
                fArrA[8] = fArrA[8] * 1.0f;
                fArrA[9] = fArrA[9] * 1.0f;
                fArrA[10] = fArrA[10] * 1.0f;
                fArrA[11] = fArrA[11] * 1.0f;
            }
            C1570jO.f(fArrA, -this.m, -this.n);
            this.s = false;
        }
        if (this.g) {
            if (!this.f.isEmpty()) {
                O4 o4A = this.h;
                if (o4A == null) {
                    o4A = Q4.a();
                    this.h = o4A;
                }
                IJ.I(this.f, o4A);
            }
            this.g = false;
        }
        C3126zm0 c3126zm0E = interfaceC2095ot.E();
        long jD = c3126zm0E.D();
        c3126zm0E.x().n();
        try {
            C3126zm0 c3126zm0 = (C3126zm0) ((OD) c3126zm0E.m).m;
            float[] fArr = this.b;
            if (fArr != null) {
                c3126zm0.x().s(fArr);
            }
            O4 o4 = this.h;
            if (!this.f.isEmpty() && o4 != null) {
                c3126zm0.x().o(o4);
            }
            ArrayList arrayList = this.c;
            int size = arrayList.size();
            for (int i = 0; i < size; i++) {
                ((AbstractC2738vi0) arrayList.get(i)).a(interfaceC2095ot);
            }
        } finally {
            AbstractC2462sn.t(c3126zm0E, jD);
        }
    }

    @Override // o.AbstractC2738vi0
    public final OC b() {
        return this.i;
    }

    @Override // o.AbstractC2738vi0
    public final void d(C2769w c2769w) {
        this.i = c2769w;
    }

    public final void e(int i, AbstractC2738vi0 abstractC2738vi0) {
        ArrayList arrayList = this.c;
        if (i < arrayList.size()) {
            arrayList.set(i, abstractC2738vi0);
        } else {
            arrayList.add(abstractC2738vi0);
        }
        g(abstractC2738vi0);
        abstractC2738vi0.d(this.j);
        c();
    }

    public final void f(long j) {
        if (this.d && j != 16) {
            long j2 = this.e;
            if (j2 == 16) {
                this.e = j;
                return;
            }
            int i = Zi0.a;
            if (C0190Hi.h(j2) == C0190Hi.h(j) && C0190Hi.g(j2) == C0190Hi.g(j) && C0190Hi.e(j2) == C0190Hi.e(j)) {
                return;
            }
            this.d = false;
            this.e = C0190Hi.g;
        }
    }

    public final void g(AbstractC2738vi0 abstractC2738vi0) {
        if (!(abstractC2738vi0 instanceof TV)) {
            if (abstractC2738vi0 instanceof C2130pE) {
                C2130pE c2130pE = (C2130pE) abstractC2738vi0;
                if (c2130pE.d && this.d) {
                    f(c2130pE.e);
                    return;
                } else {
                    this.d = false;
                    this.e = C0190Hi.g;
                    return;
                }
            }
            return;
        }
        TV tv = (TV) abstractC2738vi0;
        AbstractC0601Xe abstractC0601Xe = tv.b;
        if (this.d && abstractC0601Xe != null) {
            if (abstractC0601Xe instanceof Q90) {
                f(((Q90) abstractC0601Xe).a);
            } else {
                this.d = false;
                this.e = C0190Hi.g;
            }
        }
        AbstractC0601Xe abstractC0601Xe2 = tv.g;
        if (this.d && abstractC0601Xe2 != null) {
            if (abstractC0601Xe2 instanceof Q90) {
                f(((Q90) abstractC0601Xe2).a);
            } else {
                this.d = false;
                this.e = C0190Hi.g;
            }
        }
    }

    public final String toString() {
        StringBuilder sb = new StringBuilder("VGroup: ");
        sb.append(this.k);
        ArrayList arrayList = this.c;
        int size = arrayList.size();
        for (int i = 0; i < size; i++) {
            AbstractC2738vi0 abstractC2738vi0 = (AbstractC2738vi0) arrayList.get(i);
            sb.append("\t");
            sb.append(abstractC2738vi0.toString());
            sb.append("\n");
        }
        return sb.toString();
    }
}
