package o;

import android.os.Build;
import android.view.ViewParent;
import com.google.android.gms.common.api.Api;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.gE, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1274gE implements InterfaceC1483iV {
    public F3 A;
    public boolean B;
    public boolean C;
    public boolean D;
    public boolean E;
    public final C2769w F;
    public C1082eE l;
    public final InterfaceC0987dE m;
    public final C2207q3 n;

    /* renamed from: o, reason: collision with root package name */
    public SC f539o;
    public NC p;
    public long q;
    public boolean r;
    public final float[] s;
    public float[] t;
    public boolean u;
    public InterfaceC2281qr v;
    public EnumC1280gK w;
    public final C3113zg x;
    public int y;
    public long z;

    public C1274gE(C1082eE c1082eE, InterfaceC0987dE interfaceC0987dE, C2207q3 c2207q3, SC sc, NC nc) {
        this.l = c1082eE;
        this.m = interfaceC0987dE;
        this.n = c2207q3;
        this.f539o = sc;
        this.p = nc;
        long j = Api.BaseClientBuilder.API_PRIORITY_OTHER;
        this.q = (j & 4294967295L) | (j << 32);
        this.s = C1570jO.a();
        this.v = AbstractC0752ap.e();
        this.w = EnumC1280gK.l;
        this.x = new C3113zg();
        this.z = C1690kg0.b;
        this.D = true;
        this.F = new C2769w(19, this);
    }

    public final float[] a() {
        float[] fArrA = this.t;
        if (fArrA == null) {
            fArrA = C1570jO.a();
            this.t = fArrA;
        }
        if (this.C) {
            this.C = false;
            float[] fArrB = b();
            if (this.D) {
                return fArrB;
            }
            if (!AbstractC0662Zn.x(fArrB, fArrA)) {
                fArrA[0] = Float.NaN;
                return null;
            }
        } else if (Float.isNaN(fArrA[0])) {
            return null;
        }
        return fArrA;
    }

    public final float[] b() {
        boolean z = this.B;
        float[] fArr = this.s;
        if (z) {
            C1082eE c1082eE = this.l;
            long jY = c1082eE.v;
            InterfaceC1178fE interfaceC1178fE = c1082eE.a;
            if ((9223372034707292159L & jY) == 9205357640488583168L) {
                jY = C1884mi0.y(C1884mi0.O(this.q));
            }
            float fIntBitsToFloat = Float.intBitsToFloat((int) (jY >> 32));
            float fIntBitsToFloat2 = Float.intBitsToFloat((int) (jY & 4294967295L));
            float fR = interfaceC1178fE.r();
            float fG = interfaceC1178fE.g();
            float fV = interfaceC1178fE.v();
            float fE = interfaceC1178fE.E();
            float fJ = interfaceC1178fE.J();
            float fE2 = interfaceC1178fE.e();
            float fI = interfaceC1178fE.I();
            double d = fV * 0.017453292519943295d;
            float fSin = (float) Math.sin(d);
            float fCos = (float) Math.cos(d);
            float f = -fSin;
            float f2 = (fG * fCos) - (1.0f * fSin);
            float f3 = (1.0f * fCos) + (fG * fSin);
            double d2 = fE * 0.017453292519943295d;
            float fSin2 = (float) Math.sin(d2);
            float fCos2 = (float) Math.cos(d2);
            float f4 = -fSin2;
            float f5 = fSin * fSin2;
            float f6 = fSin * fCos2;
            float f7 = fCos * fSin2;
            float f8 = fCos * fCos2;
            float f9 = (f3 * fSin2) + (fR * fCos2);
            float f10 = (f3 * fCos2) + ((-fR) * fSin2);
            double d3 = fJ * 0.017453292519943295d;
            float fSin3 = (float) Math.sin(d3);
            float fCos3 = (float) Math.cos(d3);
            float f11 = -fSin3;
            float f12 = (fCos3 * f5) + (f11 * fCos2);
            float f13 = ((f5 * fSin3) + (fCos2 * fCos3)) * fE2;
            float f14 = fSin3 * fCos * fE2;
            float f15 = ((fSin3 * f6) + (fCos3 * f4)) * fE2;
            float f16 = f12 * fI;
            float f17 = fCos * fCos3 * fI;
            float f18 = ((fCos3 * f6) + (f11 * f4)) * fI;
            float f19 = f7 * 1.0f;
            float f20 = f * 1.0f;
            float f21 = f8 * 1.0f;
            if (fArr.length >= 16) {
                fArr[0] = f13;
                fArr[1] = f14;
                fArr[2] = f15;
                fArr[3] = 0.0f;
                fArr[4] = f16;
                fArr[5] = f17;
                fArr[6] = f18;
                fArr[7] = 0.0f;
                fArr[8] = f19;
                fArr[9] = f20;
                fArr[10] = f21;
                fArr[11] = 0.0f;
                float f22 = -fIntBitsToFloat;
                fArr[12] = ((f13 * f22) - (fIntBitsToFloat2 * f16)) + f9 + fIntBitsToFloat;
                fArr[13] = ((f14 * f22) - (fIntBitsToFloat2 * f17)) + f2 + fIntBitsToFloat2;
                fArr[14] = ((f22 * f15) - (fIntBitsToFloat2 * f18)) + f10;
                fArr[15] = 1.0f;
            }
            this.B = false;
            this.D = AbstractC1904ms0.o(fArr);
        }
        return fArr;
    }

    public final void c(YQ yq, boolean z) {
        float[] fArrA = z ? a() : b();
        if (this.D) {
            return;
        }
        if (fArrA != null) {
            C1570jO.c(fArrA, yq);
            return;
        }
        yq.a = 0.0f;
        yq.b = 0.0f;
        yq.c = 0.0f;
        yq.d = 0.0f;
    }

    public final long d(boolean z, long j) {
        float[] fArrB;
        if (z) {
            fArrB = a();
            if (fArrB == null) {
                return 9187343241974906880L;
            }
        } else {
            fArrB = b();
        }
        return this.D ? j : C1570jO.b(j, fArrB);
    }

    public final void e(long j) {
        C2207q3 c2207q3 = this.n;
        if (c2207q3.q) {
            c2207q3.L(-4.0f);
        }
        C1082eE c1082eE = this.l;
        if (!C0704aI.a(c1082eE.t, j)) {
            c1082eE.t = j;
            c1082eE.a.D((int) (j >> 32), (int) (j & 4294967295L), c1082eE.u);
        }
        if (Build.VERSION.SDK_INT < 26) {
            c2207q3.invalidate();
            return;
        }
        ViewParent parent = c2207q3.getParent();
        if (parent != null) {
            parent.onDescendantInvalidated(c2207q3, c2207q3);
        }
    }

    public final void f(long j) {
        if (C1470iI.a(j, this.q)) {
            return;
        }
        C2207q3 c2207q3 = this.n;
        if (c2207q3.q) {
            c2207q3.L(-4.0f);
        }
        this.q = j;
        if (this.u || this.r) {
            return;
        }
        c2207q3.invalidate();
        if (true != this.u) {
            this.u = true;
            c2207q3.w(this, true);
        }
    }

    public final void g() {
        if (this.u) {
            if (!C1690kg0.a(this.z, C1690kg0.b) && !C1470iI.a(this.l.u, this.q)) {
                C1082eE c1082eE = this.l;
                float fB = C1690kg0.b(this.z) * ((int) (this.q >> 32));
                float fC = C1690kg0.c(this.z) * ((int) (this.q & 4294967295L));
                long jFloatToRawIntBits = (Float.floatToRawIntBits(fC) & 4294967295L) | (Float.floatToRawIntBits(fB) << 32);
                if (!C1765lT.b(c1082eE.v, jFloatToRawIntBits)) {
                    c1082eE.v = jFloatToRawIntBits;
                    c1082eE.a.L(jFloatToRawIntBits);
                }
            }
            C1082eE c1082eE2 = this.l;
            InterfaceC2281qr interfaceC2281qr = this.v;
            EnumC1280gK enumC1280gK = this.w;
            long j = this.q;
            long j2 = c1082eE2.u;
            InterfaceC1178fE interfaceC1178fE = c1082eE2.a;
            if (!C1470iI.a(j2, j)) {
                c1082eE2.u = j;
                long j3 = c1082eE2.t;
                interfaceC1178fE.D((int) (j3 >> 32), (int) (4294967295L & j3), j);
                if (c1082eE2.i == 9205357640488583168L) {
                    c1082eE2.g = true;
                    c1082eE2.a();
                }
            }
            c1082eE2.b = interfaceC2281qr;
            c1082eE2.c = enumC1280gK;
            c1082eE2.d = this.F;
            interfaceC1178fE.d(interfaceC2281qr, enumC1280gK, c1082eE2, c1082eE2.e);
            if (this.u) {
                this.u = false;
                this.n.w(this, false);
            }
        }
    }

    @Override // o.InterfaceC1483iV
    public final void invalidate() {
        if (this.u || this.r) {
            return;
        }
        C2207q3 c2207q3 = this.n;
        c2207q3.invalidate();
        if (true != this.u) {
            this.u = true;
            c2207q3.w(this, true);
        }
    }
}
