package x;

import G.C0237l;
import I0.AbstractC0303l;
import I0.InterfaceC0297i;
import I0.InterfaceC0314x;
import androidx.compose.runtime.collection.MutableVector;
import i0.AbstractC2254r;
import o0.C2632c;

/* JADX INFO: renamed from: x.j, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C3171j extends AbstractC2254r implements InterfaceC0297i, InterfaceC0314x {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public EnumC3207z0 f25834a;

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public C0237l f25837d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final Q0 f25838e;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public boolean f25840j;
    public boolean l;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final C3144a f25839f = new C3144a();

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public long f25841k = 0;

    public C3171j(EnumC3207z0 enumC3207z0, C3167h1 c3167h1, boolean z6, C0237l c0237l, Q0 q02) {
        this.f25834a = enumC3207z0;
        this.f25835b = c3167h1;
        this.f25836c = z6;
        this.f25837d = c0237l;
        this.f25838e = q02;
    }

    public static final float t0(C3171j c3171j, InterfaceC3153d interfaceC3153d, long j4) {
        C2632c c2632c;
        int iCompare;
        if (h1.l.a(c3171j.f25841k, 0L)) {
            return 0.0f;
        }
        MutableVector mutableVector = c3171j.f25839f.f25742a;
        int size = mutableVector.getSize() - 1;
        Object[] objArr = mutableVector.content;
        if (size < objArr.length) {
            c2632c = null;
            while (true) {
                if (size < 0) {
                    break;
                }
                C2632c c2632c2 = (C2632c) ((C3162g) objArr[size]).f25784a.invoke();
                if (c2632c2 != null) {
                    long jC = c2632c2.c();
                    long jK = W0.e.K(c3171j.f25841k);
                    int iOrdinal = c3171j.f25834a.ordinal();
                    if (iOrdinal == 0) {
                        iCompare = Float.compare(Float.intBitsToFloat((int) (jC & 4294967295L)), Float.intBitsToFloat((int) (jK & 4294967295L)));
                    } else {
                        if (iOrdinal != 1) {
                            throw new E3.v();
                        }
                        iCompare = Float.compare(Float.intBitsToFloat((int) (jC >> 32)), Float.intBitsToFloat((int) (jK >> 32)));
                    }
                    if (iCompare <= 0) {
                        c2632c = c2632c2;
                    } else if (c2632c == null) {
                        c2632c = c2632c2;
                    }
                }
                size--;
            }
        } else {
            c2632c = null;
        }
        if (c2632c == null) {
            C2632c c2632c3 = c3171j.f25840j ? (C2632c) c3171j.f25838e.invoke() : null;
            if (c2632c3 == null) {
                return 0.0f;
            }
            c2632c = c2632c3;
        }
        long jK2 = W0.e.K(c3171j.f25841k);
        int iOrdinal2 = c3171j.f25834a.ordinal();
        if (iOrdinal2 == 0) {
            float f6 = c2632c.f21788b;
            return interfaceC3153d.a(f6 - ((int) (j4 & 4294967295L)), c2632c.f21790d - f6, Float.intBitsToFloat((int) (jK2 & 4294967295L)));
        }
        if (iOrdinal2 != 1) {
            throw new E3.v();
        }
        float f7 = c2632c.f21787a;
        return interfaceC3153d.a(f7 - ((int) (j4 >> 32)), c2632c.f21789c - f7, Float.intBitsToFloat((int) (jK2 >> 32)));
    }

    public static boolean u0(C3171j c3171j, C2632c c2632c, long j4, long j6, int i6) {
        if ((i6 & 1) != 0) {
            j4 = c3171j.f25841k;
        }
        long j7 = j4;
        if ((i6 & 2) != 0) {
            j6 = 0;
        }
        long jW0 = c3171j.w0(c2632c, j7, j6);
        return Math.abs(Float.intBitsToFloat((int) (jW0 >> 32))) <= 0.5f && Math.abs(Float.intBitsToFloat((int) (jW0 & 4294967295L))) <= 0.5f;
    }

    @Override // i0.AbstractC2254r
    public final boolean getShouldAutoInvalidate() {
        return false;
    }

    @Override // I0.InterfaceC0314x
    public final void m(long j4) {
        int i6;
        long j6;
        long j7;
        long j8;
        long j9 = this.f25841k;
        this.f25841k = j4;
        int iOrdinal = this.f25834a.ordinal();
        if (iOrdinal == 0) {
            i6 = kotlin.jvm.internal.o.i((int) (j4 & 4294967295L), (int) (j9 & 4294967295L));
        } else {
            if (iOrdinal != 1) {
                throw new E3.v();
            }
            i6 = kotlin.jvm.internal.o.i((int) (j4 >> 32), (int) (j9 >> 32));
        }
        if (i6 >= 0) {
            return;
        }
        if (this.f25836c) {
            j6 = 0;
        } else {
            if (this.f25834a == EnumC3207z0.f25984a) {
                j7 = ((long) 0) << 32;
                j8 = ((int) (j9 & 4294967295L)) - ((int) (j4 & 4294967295L));
            } else {
                j7 = ((long) (((int) (j9 >> 32)) - ((int) (j4 >> 32)))) << 32;
                j8 = 0;
            }
            j6 = j7 | (j8 & 4294967295L);
        }
        long j10 = j6;
        C2632c c2632c = (C2632c) this.f25838e.invoke();
        if (c2632c == null || this.l || this.f25840j || !u0(this, c2632c, j9, 0L, 2) || u0(this, c2632c, 0L, j10, 1)) {
            return;
        }
        this.f25840j = true;
        v0(j10);
    }

    public final void v0(long j4) {
        InterfaceC3153d interfaceC3153d = this.f25837d;
        if (interfaceC3153d == null) {
            interfaceC3153d = (InterfaceC3153d) AbstractC0303l.h(this, AbstractC3159f.f25777a);
        }
        InterfaceC3153d interfaceC3153d2 = interfaceC3153d;
        if (this.l) {
            A.b.c("launchAnimation called when previous animation was running");
        }
        InterfaceC3153d interfaceC3153d3 = this.f25837d;
        if (interfaceC3153d3 == null) {
            interfaceC3153d3 = (InterfaceC3153d) AbstractC0303l.h(this, AbstractC3159f.f25777a);
        }
        V4.E.y(getCoroutineScope(), null, V4.D.f8228d, new C3168i(this, new L1(interfaceC3153d3.b()), interfaceC3153d2, j4, null), 1);
    }

    public final long w0(C2632c c2632c, long j4, long j6) {
        long jFloatToRawIntBits;
        long jFloatToRawIntBits2;
        long jK = W0.e.K(j4);
        int iOrdinal = this.f25834a.ordinal();
        if (iOrdinal == 0) {
            InterfaceC3153d interfaceC3153d = this.f25837d;
            if (interfaceC3153d == null) {
                interfaceC3153d = (InterfaceC3153d) AbstractC0303l.h(this, AbstractC3159f.f25777a);
            }
            float f6 = c2632c.f21788b;
            float fA = interfaceC3153d.a(f6 - ((int) (j6 & 4294967295L)), c2632c.f21790d - f6, Float.intBitsToFloat((int) (jK & 4294967295L)));
            long jFloatToRawIntBits3 = Float.floatToRawIntBits(0.0f);
            long jFloatToRawIntBits4 = Float.floatToRawIntBits(fA);
            jFloatToRawIntBits = jFloatToRawIntBits3 << 32;
            jFloatToRawIntBits2 = jFloatToRawIntBits4 & 4294967295L;
        } else {
            if (iOrdinal != 1) {
                throw new E3.v();
            }
            InterfaceC3153d interfaceC3153d2 = this.f25837d;
            if (interfaceC3153d2 == null) {
                interfaceC3153d2 = (InterfaceC3153d) AbstractC0303l.h(this, AbstractC3159f.f25777a);
            }
            float f7 = c2632c.f21787a;
            jFloatToRawIntBits = ((long) Float.floatToRawIntBits(interfaceC3153d2.a(f7 - ((int) (j6 >> 32)), c2632c.f21789c - f7, Float.intBitsToFloat((int) (jK >> 32))))) << 32;
            jFloatToRawIntBits2 = ((long) Float.floatToRawIntBits(0.0f)) & 4294967295L;
        }
        return jFloatToRawIntBits | jFloatToRawIntBits2;
    }
}
