package o;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.mm, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1891mm extends LP implements InterfaceC0581Wk, InterfaceC0993dK {
    public final C2212q50 A;
    public boolean B;
    public InterfaceC1184fK D;
    public boolean E;
    public boolean F;
    public boolean H;
    public OU z;
    public final OD C = new OD(17);
    public long G = 0;

    public C1891mm(OU ou, C2212q50 c2212q50, boolean z) {
        this.z = ou;
        this.A = c2212q50;
        this.B = z;
    }

    public static final float H0(C1891mm c1891mm, InterfaceC0419Qe interfaceC0419Qe) {
        T00 t00;
        int iCompare;
        if (C1470iI.a(c1891mm.G, 0L)) {
            return 0.0f;
        }
        C1479iR c1479iR = (C1479iR) c1891mm.C.m;
        int i = c1479iR.n - 1;
        Object[] objArr = c1479iR.l;
        if (i < objArr.length) {
            t00 = null;
            while (true) {
                if (i < 0) {
                    break;
                }
                T00 t002 = (T00) ((C1796lm) objArr[i]).a.a();
                if (t002 != null) {
                    long jB = t002.b();
                    long jO = C1884mi0.O(c1891mm.G);
                    int iOrdinal = c1891mm.z.ordinal();
                    if (iOrdinal == 0) {
                        iCompare = Float.compare(Float.intBitsToFloat((int) (jB & 4294967295L)), Float.intBitsToFloat((int) (jO & 4294967295L)));
                    } else {
                        if (iOrdinal != 1) {
                            throw new C2170pj();
                        }
                        iCompare = Float.compare(Float.intBitsToFloat((int) (jB >> 32)), Float.intBitsToFloat((int) (jO >> 32)));
                    }
                    if (iCompare <= 0) {
                        t00 = t002;
                    } else if (t00 == null) {
                        t00 = t002;
                    }
                }
                i--;
            }
        } else {
            t00 = null;
        }
        if (t00 == null) {
            T00 t00I0 = c1891mm.E ? c1891mm.I0() : null;
            if (t00I0 == null) {
                return 0.0f;
            }
            t00 = t00I0;
        }
        long jO2 = C1884mi0.O(c1891mm.G);
        int iOrdinal2 = c1891mm.z.ordinal();
        if (iOrdinal2 == 0) {
            float f = t00.b;
            return interfaceC0419Qe.a(f, t00.d - f, Float.intBitsToFloat((int) (jO2 & 4294967295L)));
        }
        if (iOrdinal2 != 1) {
            throw new C2170pj();
        }
        float f2 = t00.a;
        return interfaceC0419Qe.a(f2, t00.c - f2, Float.intBitsToFloat((int) (jO2 >> 32)));
    }

    public final T00 I0() {
        if (this.y) {
            AbstractC2239qS abstractC2239qSR = AbstractC2539te.R(this);
            InterfaceC1184fK interfaceC1184fK = this.D;
            if (interfaceC1184fK != null) {
                if (!interfaceC1184fK.A()) {
                    interfaceC1184fK = null;
                }
                if (interfaceC1184fK != null) {
                    return abstractC2239qSR.h(interfaceC1184fK, false);
                }
            }
        }
        return null;
    }

    public final boolean J0(T00 t00, long j) {
        long jL0 = L0(t00, j);
        return Math.abs(Float.intBitsToFloat((int) (jL0 >> 32))) <= 0.5f && Math.abs(Float.intBitsToFloat((int) (jL0 & 4294967295L))) <= 0.5f;
    }

    public final void K0() {
        C0935cl c0935cl = AbstractC0471Se.a;
        InterfaceC0419Qe interfaceC0419Qe = (InterfaceC0419Qe) AbstractC2461sm0.j(this, c0935cl);
        if (this.H) {
            AbstractC2417sH.c("launchAnimation called when previous animation was running");
        }
        ((InterfaceC0419Qe) AbstractC2461sm0.j(this, c0935cl)).getClass();
        InterfaceC0419Qe.a.getClass();
        AbstractC1692kh0.C(v0(), null, new C3063z4(this, new C1217fi0(C0393Pe.b), interfaceC0419Qe, (InterfaceC0220Im) null, 4), 1);
    }

    public final long L0(T00 t00, long j) {
        long jFloatToRawIntBits;
        long j2;
        long jO = C1884mi0.O(j);
        int iOrdinal = this.z.ordinal();
        if (iOrdinal == 0) {
            InterfaceC0419Qe interfaceC0419Qe = (InterfaceC0419Qe) AbstractC2461sm0.j(this, AbstractC0471Se.a);
            float f = t00.b;
            float fA = interfaceC0419Qe.a(f, t00.d - f, Float.intBitsToFloat((int) (jO & 4294967295L)));
            long jFloatToRawIntBits2 = Float.floatToRawIntBits(0.0f);
            jFloatToRawIntBits = Float.floatToRawIntBits(fA);
            j2 = jFloatToRawIntBits2 << 32;
        } else {
            if (iOrdinal != 1) {
                throw new C2170pj();
            }
            InterfaceC0419Qe interfaceC0419Qe2 = (InterfaceC0419Qe) AbstractC2461sm0.j(this, AbstractC0471Se.a);
            float f2 = t00.a;
            long jFloatToRawIntBits3 = Float.floatToRawIntBits(interfaceC0419Qe2.a(f2, t00.c - f2, Float.intBitsToFloat((int) (jO >> 32))));
            jFloatToRawIntBits = Float.floatToRawIntBits(0.0f);
            j2 = jFloatToRawIntBits3 << 32;
        }
        return j2 | (jFloatToRawIntBits & 4294967295L);
    }

    @Override // o.InterfaceC0993dK
    public final void v(long j) {
        int iM;
        T00 t00I0;
        long j2 = this.G;
        this.G = j;
        int iOrdinal = this.z.ordinal();
        if (iOrdinal == 0) {
            iM = F3.m((int) (j & 4294967295L), (int) (4294967295L & j2));
        } else {
            if (iOrdinal != 1) {
                throw new C2170pj();
            }
            iM = F3.m((int) (j >> 32), (int) (j2 >> 32));
        }
        if (iM >= 0 || this.H || this.E || (t00I0 = I0()) == null || !J0(t00I0, j2)) {
            return;
        }
        this.F = true;
    }

    @Override // o.LP
    public final boolean w0() {
        return false;
    }
}
