package J0;

import I0.C0294g0;
import android.os.Build;
import android.view.ViewParent;
import m3.AbstractC2478m;
import o0.C2631b;
import p0.AbstractC2686D;
import p0.C2692J;
import p0.InterfaceC2684B;
import r0.C2863b;

/* JADX INFO: loaded from: classes.dex */
public final class F0 implements I0.r0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public s0.b f2819a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final InterfaceC2684B f2820b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final A f2821c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public J4.e f2822d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public C0294g0 f2823e;

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

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public boolean f2825j;
    public float[] l;

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

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

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public p0.N f2833s;

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

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

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

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final float[] f2826k = C2692J.a();

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public h1.c f2828n = W.a.J();

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public h1.m f2829o = h1.m.f16628a;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public final C2863b f2830p = new C2863b();

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public long f2832r = p0.c0.f22905b;

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

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public final C0.Z f2838x = new C0.Z(this, 9);

    public F0(s0.b bVar, InterfaceC2684B interfaceC2684B, A a6, J4.e eVar, C0294g0 c0294g0) {
        this.f2819a = bVar;
        this.f2820b = interfaceC2684B;
        this.f2821c = a6;
        this.f2822d = eVar;
        this.f2823e = c0294g0;
        long j4 = Integer.MAX_VALUE;
        this.f2824f = (j4 & 4294967295L) | (j4 << 32);
    }

    public final float[] a() {
        float[] fArrA = this.l;
        if (fArrA == null) {
            fArrA = C2692J.a();
            this.l = fArrA;
        }
        if (this.f2835u) {
            this.f2835u = false;
            float[] fArrB = b();
            if (this.f2836v) {
                return fArrB;
            }
            if (!O.p(fArrB, fArrA)) {
                fArrA[0] = Float.NaN;
                return null;
            }
        } else if (Float.isNaN(fArrA[0])) {
            return null;
        }
        return fArrA;
    }

    public final float[] b() {
        boolean z6 = this.f2834t;
        float[] fArr = this.f2826k;
        if (z6) {
            s0.b bVar = this.f2819a;
            long jK = bVar.f24041v;
            if ((9223372034707292159L & jK) == 9205357640488583168L) {
                jK = AbstractC2478m.k(W0.e.K(this.f2824f));
            }
            float fIntBitsToFloat = Float.intBitsToFloat((int) (jK >> 32));
            float fIntBitsToFloat2 = Float.intBitsToFloat((int) (jK & 4294967295L));
            s0.d dVar = bVar.f24021a;
            float fA = dVar.A();
            float fU = dVar.u();
            float fC = dVar.C();
            float fO = dVar.o();
            float fQ = dVar.q();
            float fB = dVar.b();
            float fK = dVar.K();
            double d6 = ((double) fC) * 0.017453292519943295d;
            float fSin = (float) Math.sin(d6);
            float fCos = (float) Math.cos(d6);
            float f6 = -fSin;
            float f7 = (fU * fCos) - (0.0f * fSin);
            float f8 = (0.0f * fCos) + (fU * fSin);
            double d7 = ((double) fO) * 0.017453292519943295d;
            float fSin2 = (float) Math.sin(d7);
            float fCos2 = (float) Math.cos(d7);
            float f9 = -fSin2;
            float f10 = fSin * fSin2;
            float f11 = fSin * fCos2;
            float f12 = fCos * fSin2;
            float f13 = fCos * fCos2;
            float f14 = (f8 * fSin2) + (fA * fCos2);
            float f15 = (f8 * fCos2) + ((-fA) * fSin2);
            double d8 = ((double) fQ) * 0.017453292519943295d;
            float fSin3 = (float) Math.sin(d8);
            float fCos3 = (float) Math.cos(d8);
            float f16 = -fSin3;
            float f17 = (fCos3 * f10) + (f16 * fCos2);
            float f18 = (f10 * fSin3) + (fCos2 * fCos3);
            float f19 = fSin3 * fCos;
            float f20 = f18 * fB;
            float f21 = f19 * fB;
            float f22 = ((fSin3 * f11) + (fCos3 * f9)) * fB;
            float f23 = f17 * fK;
            float f24 = fCos * fCos3 * fK;
            float f25 = ((fCos3 * f11) + (f16 * f9)) * fK;
            float f26 = f12 * 1.0f;
            float f27 = f6 * 1.0f;
            float f28 = f13 * 1.0f;
            if (fArr.length >= 16) {
                fArr[0] = f20;
                fArr[1] = f21;
                fArr[2] = f22;
                fArr[3] = 0.0f;
                fArr[4] = f23;
                fArr[5] = f24;
                fArr[6] = f25;
                fArr[7] = 0.0f;
                fArr[8] = f26;
                fArr[9] = f27;
                fArr[10] = f28;
                fArr[11] = 0.0f;
                float f29 = -fIntBitsToFloat;
                fArr[12] = ((f20 * f29) - (fIntBitsToFloat2 * f23)) + f14 + fIntBitsToFloat;
                fArr[13] = ((f21 * f29) - (fIntBitsToFloat2 * f24)) + f7 + fIntBitsToFloat2;
                fArr[14] = ((f29 * f22) - (fIntBitsToFloat2 * f25)) + f15;
                fArr[15] = 1.0f;
            }
            this.f2834t = false;
            this.f2836v = AbstractC2686D.x(fArr);
        }
        return fArr;
    }

    public final long c(long j4, boolean z6) {
        float[] fArrB;
        if (z6) {
            fArrB = a();
            if (fArrB == null) {
                return 9187343241974906880L;
            }
        } else {
            fArrB = b();
        }
        return this.f2836v ? j4 : C2692J.b(j4, fArrB);
    }

    public final void d(long j4) {
        A a6 = this.f2821c;
        if (a6.f2754o) {
            a6.M(-4.0f);
        }
        s0.b bVar = this.f2819a;
        if (!h1.j.a(bVar.f24039t, j4)) {
            bVar.f24039t = j4;
            long j6 = bVar.f24040u;
            bVar.f24021a.n((int) (j4 >> 32), (int) (j4 & 4294967295L), j6);
        }
        if (Build.VERSION.SDK_INT < 26) {
            a6.invalidate();
            return;
        }
        ViewParent parent = a6.getParent();
        if (parent != null) {
            parent.onDescendantInvalidated(a6, a6);
        }
    }

    public final void e(long j4) {
        if (h1.l.a(j4, this.f2824f)) {
            return;
        }
        A a6 = this.f2821c;
        if (a6.f2754o) {
            a6.M(-4.0f);
        }
        this.f2824f = j4;
        if (this.f2827m || this.f2825j) {
            return;
        }
        a6.invalidate();
        if (true != this.f2827m) {
            this.f2827m = true;
            a6.w(this, true);
        }
    }

    public final void f() {
        A a6 = this.f2821c;
        boolean z6 = a6.f2754o;
        if (this.f2827m) {
            if (!p0.c0.a(this.f2832r, p0.c0.f22905b) && !h1.l.a(this.f2819a.f24040u, this.f2824f)) {
                s0.b bVar = this.f2819a;
                float fB = p0.c0.b(this.f2832r) * ((int) (this.f2824f >> 32));
                long jFloatToRawIntBits = (((long) Float.floatToRawIntBits(p0.c0.c(this.f2832r) * ((int) (this.f2824f & 4294967295L)))) & 4294967295L) | (Float.floatToRawIntBits(fB) << 32);
                if (!C2631b.b(bVar.f24041v, jFloatToRawIntBits)) {
                    bVar.f24041v = jFloatToRawIntBits;
                    bVar.f24021a.r(jFloatToRawIntBits);
                }
            }
            s0.b bVar2 = this.f2819a;
            h1.c cVar = this.f2828n;
            h1.m mVar = this.f2829o;
            long j4 = this.f2824f;
            boolean zA = h1.l.a(bVar2.f24040u, j4);
            s0.d dVar = bVar2.f24021a;
            if (!zA) {
                bVar2.f24040u = j4;
                long j6 = bVar2.f24039t;
                dVar.n((int) (j6 >> 32), (int) (4294967295L & j6), j4);
                if (bVar2.f24029i == 9205357640488583168L) {
                    bVar2.f24027g = true;
                    bVar2.a();
                }
            }
            bVar2.f24022b = cVar;
            bVar2.f24023c = mVar;
            bVar2.f24024d = this.f2838x;
            dVar.l(cVar, mVar, bVar2, bVar2.f24025e);
            if (this.f2827m) {
                this.f2827m = false;
                a6.w(this, false);
            }
        }
    }

    @Override // I0.r0
    public final void invalidate() {
        if (this.f2827m || this.f2825j) {
            return;
        }
        A a6 = this.f2821c;
        a6.invalidate();
        if (true != this.f2827m) {
            this.f2827m = true;
            a6.w(this, true);
        }
    }
}
