package v0;

import java.util.ArrayList;
import java.util.List;
import p.C2646H;
import p0.AbstractC2704j;
import p0.AbstractC2711q;
import p0.C2692J;
import p0.C2702h;
import p0.C2714u;
import q.AbstractC2761L;
import r0.InterfaceC2866e;

/* JADX INFO: renamed from: v0.c, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C3065c extends AbstractC3061C {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public float[] f25104b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final ArrayList f25105c = new ArrayList();

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

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public long f25107e = C2714u.f22945m;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public List f25108f;

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

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public C2702h f25110h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public kotlin.jvm.internal.p f25111i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final C2646H f25112j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public String f25113k;
    public float l;

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

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

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

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

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

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

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

    public C3065c() {
        int i6 = M.f25065a;
        this.f25108f = x4.y.f26065a;
        this.f25109g = true;
        this.f25112j = new C2646H(this, 4);
        this.f25113k = "";
        this.f25116o = 1.0f;
        this.f25117p = 1.0f;
        this.f25120s = true;
    }

    @Override // v0.AbstractC3061C
    public final void a(InterfaceC2866e interfaceC2866e) {
        if (this.f25120s) {
            float[] fArrA = this.f25104b;
            if (fArrA == null) {
                fArrA = C2692J.a();
                this.f25104b = fArrA;
            } else {
                C2692J.d(fArrA);
            }
            C2692J.f(fArrA, this.f25118q + this.f25114m, this.f25119r + this.f25115n);
            float f6 = this.l;
            if (fArrA.length >= 16) {
                double d6 = ((double) f6) * 0.017453292519943295d;
                float fSin = (float) Math.sin(d6);
                float fCos = (float) Math.cos(d6);
                float f7 = fArrA[0];
                float f8 = fArrA[4];
                float f9 = (fSin * f8) + (fCos * f7);
                float f10 = -fSin;
                float f11 = (f8 * fCos) + (f7 * f10);
                float f12 = fArrA[1];
                float f13 = fArrA[5];
                float f14 = (fSin * f13) + (fCos * f12);
                float f15 = (f13 * fCos) + (f12 * f10);
                float f16 = fArrA[2];
                float f17 = fArrA[6];
                float f18 = (fSin * f17) + (fCos * f16);
                float f19 = (f17 * fCos) + (f16 * f10);
                float f20 = fArrA[3];
                float f21 = fArrA[7];
                float f22 = (fSin * f21) + (fCos * f20);
                fArrA[0] = f9;
                fArrA[1] = f14;
                fArrA[2] = f18;
                fArrA[3] = f22;
                fArrA[4] = f11;
                fArrA[5] = f15;
                fArrA[6] = f19;
                fArrA[7] = (fCos * f21) + (f10 * f20);
            }
            float f23 = this.f25116o;
            float f24 = this.f25117p;
            if (fArrA.length >= 16) {
                fArrA[0] = fArrA[0] * f23;
                fArrA[1] = fArrA[1] * f23;
                fArrA[2] = fArrA[2] * f23;
                fArrA[3] = fArrA[3] * f23;
                fArrA[4] = fArrA[4] * f24;
                fArrA[5] = fArrA[5] * f24;
                fArrA[6] = fArrA[6] * f24;
                fArrA[7] = fArrA[7] * f24;
                fArrA[8] = fArrA[8] * 1.0f;
                fArrA[9] = fArrA[9] * 1.0f;
                fArrA[10] = fArrA[10] * 1.0f;
                fArrA[11] = fArrA[11] * 1.0f;
            }
            C2692J.f(fArrA, -this.f25114m, -this.f25115n);
            this.f25120s = false;
        }
        if (this.f25109g) {
            if (!this.f25108f.isEmpty()) {
                C2702h c2702hA = this.f25110h;
                if (c2702hA == null) {
                    c2702hA = AbstractC2704j.a();
                    this.f25110h = c2702hA;
                }
                AbstractC3064b.j(this.f25108f, c2702hA);
            }
            this.f25109g = false;
        }
        o4.f fVarA0 = interfaceC2866e.a0();
        long jF = fVarA0.f();
        fVarA0.c().f();
        try {
            l2.c cVar = (l2.c) fVarA0.f21850c;
            float[] fArr = this.f25104b;
            o4.f fVar = (o4.f) cVar.f20267b;
            if (fArr != null) {
                fVar.c().j(fArr);
            }
            C2702h c2702h = this.f25110h;
            if (!this.f25108f.isEmpty() && c2702h != null) {
                fVar.c().q(c2702h, 1);
            }
            ArrayList arrayList = this.f25105c;
            int size = arrayList.size();
            for (int i6 = 0; i6 < size; i6++) {
                ((AbstractC3061C) arrayList.get(i6)).a(interfaceC2866e);
            }
        } finally {
            AbstractC2761L.o(fVarA0, jF);
        }
    }

    /* JADX WARN: Type inference failed for: r0v0, types: [J4.c, kotlin.jvm.internal.p] */
    @Override // v0.AbstractC3061C
    public final J4.c b() {
        return this.f25111i;
    }

    @Override // v0.AbstractC3061C
    public final void d(C2646H c2646h) {
        this.f25111i = c2646h;
    }

    public final void e(int i6, AbstractC3061C abstractC3061C) {
        ArrayList arrayList = this.f25105c;
        if (i6 < arrayList.size()) {
            arrayList.set(i6, abstractC3061C);
        } else {
            arrayList.add(abstractC3061C);
        }
        g(abstractC3061C);
        abstractC3061C.d(this.f25112j);
        c();
    }

    public final void f(long j4) {
        if (this.f25106d && j4 != 16) {
            long j6 = this.f25107e;
            if (j6 == 16) {
                this.f25107e = j4;
                return;
            }
            int i6 = M.f25065a;
            if (C2714u.i(j6) == C2714u.i(j4) && C2714u.h(j6) == C2714u.h(j4) && C2714u.f(j6) == C2714u.f(j4)) {
                return;
            }
            this.f25106d = false;
            this.f25107e = C2714u.f22945m;
        }
    }

    public final void g(AbstractC3061C abstractC3061C) {
        if (!(abstractC3061C instanceof C3070h)) {
            if (abstractC3061C instanceof C3065c) {
                C3065c c3065c = (C3065c) abstractC3061C;
                if (c3065c.f25106d && this.f25106d) {
                    f(c3065c.f25107e);
                    return;
                } else {
                    this.f25106d = false;
                    this.f25107e = C2714u.f22945m;
                    return;
                }
            }
            return;
        }
        C3070h c3070h = (C3070h) abstractC3061C;
        AbstractC2711q abstractC2711q = c3070h.f25163b;
        if (this.f25106d && abstractC2711q != null) {
            if (abstractC2711q instanceof p0.Z) {
                f(((p0.Z) abstractC2711q).f22898a);
            } else {
                this.f25106d = false;
                this.f25107e = C2714u.f22945m;
            }
        }
        AbstractC2711q abstractC2711q2 = c3070h.f25168g;
        if (this.f25106d && abstractC2711q2 != null) {
            if (abstractC2711q2 instanceof p0.Z) {
                f(((p0.Z) abstractC2711q2).f22898a);
            } else {
                this.f25106d = false;
                this.f25107e = C2714u.f22945m;
            }
        }
    }

    public final void h(int i6, int i7) {
        for (int i8 = 0; i8 < i7; i8++) {
            ArrayList arrayList = this.f25105c;
            if (i6 < arrayList.size()) {
                ((AbstractC3061C) arrayList.get(i6)).d(null);
                arrayList.remove(i6);
            }
        }
        c();
    }

    public final String toString() {
        StringBuilder sb = new StringBuilder("VGroup: ");
        sb.append(this.f25113k);
        ArrayList arrayList = this.f25105c;
        int size = arrayList.size();
        for (int i6 = 0; i6 < size; i6++) {
            AbstractC3061C abstractC3061C = (AbstractC3061C) arrayList.get(i6);
            sb.append("\t");
            sb.append(abstractC3061C.toString());
            sb.append("\n");
        }
        return sb.toString();
    }
}
