package o;

import android.content.Context;
import android.os.Build;
import android.widget.EdgeEffect;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.l4, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1734l4 {
    public final InterfaceC2281qr a;
    public long b = 9205357640488583168L;
    public final C0643Yu c;
    public final MV d;
    public final boolean e;
    public boolean f;
    public long g;
    public long h;
    public final AbstractC0561Vq i;

    public C1734l4(Context context, InterfaceC2281qr interfaceC2281qr, long j, C2147pV c2147pV) {
        this.a = interfaceC2281qr;
        C0643Yu c0643Yu = new C0643Yu(context, AbstractC0752ap.g0(j));
        this.c = c0643Yu;
        this.d = new MV(Oh0.a, C0669Zu.O);
        this.e = true;
        this.g = 0L;
        this.h = -1L;
        C1639k4 c1639k4 = new C1639k4(0, this);
        CX cx = Tb0.a;
        Wb0 wb0 = new Wb0(null, null, c1639k4);
        this.i = Build.VERSION.SDK_INT >= 31 ? new ZD(wb0, this, c0643Yu) : new ZD(wb0, this, c0643Yu, c2147pV);
    }

    public final void a() {
        boolean z;
        C0643Yu c0643Yu = this.c;
        EdgeEffect edgeEffect = c0643Yu.d;
        boolean z2 = true;
        if (edgeEffect != null) {
            edgeEffect.onRelease();
            z = !edgeEffect.isFinished();
        } else {
            z = false;
        }
        EdgeEffect edgeEffect2 = c0643Yu.e;
        if (edgeEffect2 != null) {
            edgeEffect2.onRelease();
            z = !edgeEffect2.isFinished() || z;
        }
        EdgeEffect edgeEffect3 = c0643Yu.f;
        if (edgeEffect3 != null) {
            edgeEffect3.onRelease();
            z = !edgeEffect3.isFinished() || z;
        }
        EdgeEffect edgeEffect4 = c0643Yu.g;
        if (edgeEffect4 != null) {
            edgeEffect4.onRelease();
            if (edgeEffect4.isFinished() && !z) {
                z2 = false;
            }
            z = z2;
        }
        if (z) {
            d();
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:50:0x0138, code lost:
    
        if (r4 == r6) goto L51;
     */
    /* JADX WARN: Removed duplicated region for block: B:7:0x001b  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final java.lang.Object b(long r19, o.C2117p50 r21, o.AbstractC0298Lm r22) {
        /*
            Method dump skipped, instructions count: 484
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C1734l4.b(long, o.p50, o.Lm):java.lang.Object");
    }

    public final long c() {
        long jY = this.b;
        if ((9223372034707292159L & jY) == 9205357640488583168L) {
            jY = C1884mi0.y(this.g);
        }
        float fIntBitsToFloat = Float.intBitsToFloat((int) (jY >> 32)) / Float.intBitsToFloat((int) (this.g >> 32));
        float fIntBitsToFloat2 = Float.intBitsToFloat((int) (jY & 4294967295L)) / Float.intBitsToFloat((int) (this.g & 4294967295L));
        return (Float.floatToRawIntBits(fIntBitsToFloat2) & 4294967295L) | (Float.floatToRawIntBits(fIntBitsToFloat) << 32);
    }

    public final void d() {
        if (this.e) {
            this.d.setValue(Oh0.a);
        }
    }

    public final float e(long j) {
        float fIntBitsToFloat = Float.intBitsToFloat((int) (c() >> 32));
        int i = (int) (j & 4294967295L);
        float fIntBitsToFloat2 = Float.intBitsToFloat(i) / Float.intBitsToFloat((int) (this.g & 4294967295L));
        EdgeEffect edgeEffectB = this.c.b();
        float fC = -fIntBitsToFloat2;
        float f = 1 - fIntBitsToFloat;
        int i2 = Build.VERSION.SDK_INT;
        if (i2 >= 31) {
            fC = AbstractC1930n7.c(edgeEffectB, fC, f);
        } else {
            edgeEffectB.onPull(fC, f);
        }
        return (i2 >= 31 ? AbstractC1930n7.b(edgeEffectB) : 0.0f) == 0.0f ? Float.intBitsToFloat((int) (4294967295L & this.g)) * (-fC) : Float.intBitsToFloat(i);
    }

    public final float f(long j) {
        float fIntBitsToFloat = Float.intBitsToFloat((int) (c() & 4294967295L));
        int i = (int) (j >> 32);
        float fIntBitsToFloat2 = Float.intBitsToFloat(i) / Float.intBitsToFloat((int) (this.g >> 32));
        EdgeEffect edgeEffectC = this.c.c();
        float f = 1 - fIntBitsToFloat;
        int i2 = Build.VERSION.SDK_INT;
        if (i2 >= 31) {
            fIntBitsToFloat2 = AbstractC1930n7.c(edgeEffectC, fIntBitsToFloat2, f);
        } else {
            edgeEffectC.onPull(fIntBitsToFloat2, f);
        }
        return (i2 >= 31 ? AbstractC1930n7.b(edgeEffectC) : 0.0f) == 0.0f ? Float.intBitsToFloat((int) (this.g >> 32)) * fIntBitsToFloat2 : Float.intBitsToFloat(i);
    }

    public final float g(long j) {
        float fIntBitsToFloat = Float.intBitsToFloat((int) (c() & 4294967295L));
        int i = (int) (j >> 32);
        float fIntBitsToFloat2 = Float.intBitsToFloat(i) / Float.intBitsToFloat((int) (this.g >> 32));
        EdgeEffect edgeEffectD = this.c.d();
        float fC = -fIntBitsToFloat2;
        int i2 = Build.VERSION.SDK_INT;
        if (i2 >= 31) {
            fC = AbstractC1930n7.c(edgeEffectD, fC, fIntBitsToFloat);
        } else {
            edgeEffectD.onPull(fC, fIntBitsToFloat);
        }
        return (i2 >= 31 ? AbstractC1930n7.b(edgeEffectD) : 0.0f) == 0.0f ? Float.intBitsToFloat((int) (this.g >> 32)) * (-fC) : Float.intBitsToFloat(i);
    }

    public final float h(long j) {
        float fIntBitsToFloat = Float.intBitsToFloat((int) (c() >> 32));
        int i = (int) (j & 4294967295L);
        float fIntBitsToFloat2 = Float.intBitsToFloat(i) / Float.intBitsToFloat((int) (this.g & 4294967295L));
        EdgeEffect edgeEffectE = this.c.e();
        int i2 = Build.VERSION.SDK_INT;
        if (i2 >= 31) {
            fIntBitsToFloat2 = AbstractC1930n7.c(edgeEffectE, fIntBitsToFloat2, fIntBitsToFloat);
        } else {
            edgeEffectE.onPull(fIntBitsToFloat2, fIntBitsToFloat);
        }
        return (i2 >= 31 ? AbstractC1930n7.b(edgeEffectE) : 0.0f) == 0.0f ? Float.intBitsToFloat((int) (this.g & 4294967295L)) * fIntBitsToFloat2 : Float.intBitsToFloat(i);
    }

    public final void i(long j) {
        boolean zA = T80.a(this.g, 0L);
        boolean zA2 = T80.a(j, this.g);
        this.g = j;
        if (!zA2) {
            long jD = (C2887xC.D(Float.intBitsToFloat((int) (j & 4294967295L))) & 4294967295L) | (C2887xC.D(Float.intBitsToFloat((int) (j >> 32))) << 32);
            C0643Yu c0643Yu = this.c;
            c0643Yu.c = jD;
            EdgeEffect edgeEffect = c0643Yu.d;
            if (edgeEffect != null) {
                edgeEffect.setSize((int) (jD >> 32), (int) (jD & 4294967295L));
            }
            EdgeEffect edgeEffect2 = c0643Yu.e;
            if (edgeEffect2 != null) {
                edgeEffect2.setSize((int) (jD >> 32), (int) (jD & 4294967295L));
            }
            EdgeEffect edgeEffect3 = c0643Yu.f;
            if (edgeEffect3 != null) {
                edgeEffect3.setSize((int) (jD & 4294967295L), (int) (jD >> 32));
            }
            EdgeEffect edgeEffect4 = c0643Yu.g;
            if (edgeEffect4 != null) {
                edgeEffect4.setSize((int) (jD & 4294967295L), (int) (jD >> 32));
            }
            EdgeEffect edgeEffect5 = c0643Yu.h;
            if (edgeEffect5 != null) {
                edgeEffect5.setSize((int) (jD >> 32), (int) (jD & 4294967295L));
            }
            EdgeEffect edgeEffect6 = c0643Yu.i;
            if (edgeEffect6 != null) {
                edgeEffect6.setSize((int) (jD >> 32), (int) (jD & 4294967295L));
            }
            EdgeEffect edgeEffect7 = c0643Yu.j;
            if (edgeEffect7 != null) {
                edgeEffect7.setSize((int) (jD & 4294967295L), (int) (jD >> 32));
            }
            EdgeEffect edgeEffect8 = c0643Yu.k;
            if (edgeEffect8 != null) {
                edgeEffect8.setSize((int) (4294967295L & jD), (int) (jD >> 32));
            }
        }
        if (zA || zA2) {
            return;
        }
        a();
    }
}
