package o;

import android.view.ViewTreeObserver;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.q50, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2212q50 {
    public InterfaceC1547j50 a;
    public C1734l4 b;
    public C3031ym0 c;
    public OU d;
    public boolean e;
    public JR f;
    public final C1453i50 g;
    public final C0667Zs h;
    public boolean i;
    public int j = 1;
    public X40 k = androidx.compose.foundation.gestures.a.b;
    public final C2022o50 l = new C2022o50(this);
    public final S1 m = new S1(18, this);

    public C2212q50(InterfaceC1547j50 interfaceC1547j50, C1734l4 c1734l4, C3031ym0 c3031ym0, OU ou, boolean z, JR jr, C1453i50 c1453i50, C0667Zs c0667Zs) {
        this.a = interfaceC1547j50;
        this.b = c1734l4;
        this.c = c3031ym0;
        this.d = ou;
        this.e = z;
        this.f = jr;
        this.g = c1453i50;
        this.h = c0667Zs;
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final java.lang.Object a(long r11, o.AbstractC0298Lm r13) {
        /*
            r10 = this;
            boolean r0 = r13 instanceof o.C1737l50
            if (r0 == 0) goto L13
            r0 = r13
            o.l50 r0 = (o.C1737l50) r0
            int r1 = r0.r
            r2 = -2147483648(0xffffffff80000000, float:-0.0)
            r3 = r1 & r2
            if (r3 == 0) goto L13
            int r1 = r1 - r2
            r0.r = r1
            goto L18
        L13:
            o.l50 r0 = new o.l50
            r0.<init>(r10, r13)
        L18:
            java.lang.Object r13 = r0.p
            int r1 = r0.r
            r2 = 0
            r3 = 1
            if (r1 == 0) goto L35
            if (r1 != r3) goto L2d
            o.A10 r11 = r0.f619o
            o.IJ.H(r13)     // Catch: java.lang.Throwable -> L29
            r5 = r10
            goto L57
        L29:
            r0 = move-exception
            r11 = r0
            r5 = r10
            goto L67
        L2d:
            java.lang.IllegalStateException r11 = new java.lang.IllegalStateException
            java.lang.String r12 = "call to 'resume' before 'invoke' with coroutine"
            r11.<init>(r12)
            throw r11
        L35:
            o.IJ.H(r13)
            o.A10 r6 = new o.A10
            r6.<init>()
            r6.l = r11
            r10.i = r3
            o.n50 r4 = new o.n50     // Catch: java.lang.Throwable -> L64
            r9 = 0
            r5 = r10
            r7 = r11
            r4.<init>(r5, r6, r7, r9)     // Catch: java.lang.Throwable -> L61
            r0.f619o = r6     // Catch: java.lang.Throwable -> L61
            r0.r = r3     // Catch: java.lang.Throwable -> L61
            java.lang.Object r11 = r10.f(r3, r4, r0)     // Catch: java.lang.Throwable -> L61
            o.Dn r12 = o.EnumC0091Dn.l
            if (r11 != r12) goto L56
            return r12
        L56:
            r11 = r6
        L57:
            r5.i = r2
            long r11 = r11.l
            o.lj0 r13 = new o.lj0
            r13.<init>(r11)
            return r13
        L61:
            r0 = move-exception
        L62:
            r11 = r0
            goto L67
        L64:
            r0 = move-exception
            r5 = r10
            goto L62
        L67:
            r5.i = r2
            throw r11
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C2212q50.a(long, o.Lm):java.lang.Object");
    }

    /* JADX WARN: Removed duplicated region for block: B:6:0x000a  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final java.lang.Object b(long r5, boolean r7, o.Sb0 r8) {
        /*
            r4 = this;
            o.Oh0 r0 = o.Oh0.a
            if (r7 == 0) goto La
            o.ym0 r7 = r4.c
            o.r40 r1 = androidx.compose.foundation.gestures.a.a
            if (r7 != 0) goto L4a
        La:
            o.OU r7 = r4.d
            o.OU r1 = o.OU.m
            r2 = 0
            if (r7 != r1) goto L17
            r7 = 1
        L12:
            long r5 = o.C1791lj0.a(r5, r2, r2, r7)
            goto L19
        L17:
            r7 = 2
            goto L12
        L19:
            o.p50 r7 = new o.p50
            r1 = 0
            r7.<init>(r4, r1)
            o.l4 r1 = r4.b
            o.Dn r2 = o.EnumC0091Dn.l
            if (r1 == 0) goto L3c
            o.j50 r3 = r4.a
            boolean r3 = r3.c()
            if (r3 != 0) goto L35
            o.j50 r3 = r4.a
            boolean r3 = r3.a()
            if (r3 == 0) goto L3c
        L35:
            java.lang.Object r5 = r1.b(r5, r7, r8)
            if (r5 != r2) goto L4a
            return r5
        L3c:
            o.p50 r7 = new o.p50
            r7.<init>(r4, r8)
            r7.r = r5
            java.lang.Object r5 = r7.n(r0)
            if (r5 != r2) goto L4a
            return r5
        L4a:
            return r0
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C2212q50.b(long, boolean, o.Sb0):java.lang.Object");
    }

    public final long c(X40 x40, long j, int i) throws IllegalAccessException, NoSuchMethodException, SecurityException, IllegalArgumentException, InvocationTargetException {
        NR nr = this.f.a;
        NR nr2 = null;
        NR nr3 = (nr == null || !nr.y) ? null : (NR) YT.v(nr);
        long jF0 = nr3 != null ? nr3.f0(i, j) : 0L;
        long jD = C1765lT.d(j, jF0);
        long jE = e(h(x40.a(g(e(this.d == OU.m ? C1765lT.a(jD, 0.0f, 1) : C1765lT.a(jD, 0.0f, 2))))));
        C1453i50 c1453i50 = this.g;
        if (c1453i50.y) {
            ViewTreeObserver viewTreeObserver = ((C2207q3) AbstractC2539te.T(c1453i50)).getViewTreeObserver();
            try {
                if (C2207q3.X0 == null) {
                    Method declaredMethod = viewTreeObserver.getClass().getDeclaredMethod("dispatchOnScrollChanged", null);
                    declaredMethod.setAccessible(true);
                    C2207q3.X0 = declaredMethod;
                }
                Method method = C2207q3.X0;
                if (method != null) {
                    method.invoke(viewTreeObserver, null);
                }
            } catch (Exception unused) {
            }
        }
        long jD2 = C1765lT.d(jD, jE);
        NR nr4 = this.f.a;
        if (nr4 != null && nr4.y) {
            nr2 = (NR) YT.v(nr4);
        }
        NR nr5 = nr2;
        return C1765lT.e(C1765lT.e(jF0, jE), nr5 != null ? nr5.L(i, jE, jD2) : 0L);
    }

    public final float d(float f) {
        return this.e ? f * (-1) : f;
    }

    public final long e(long j) {
        return this.e ? C1765lT.f(-1.0f, j) : j;
    }

    public final Object f(int i, SC sc, AbstractC0298Lm abstractC0298Lm) {
        Object objD = this.a.d(i, new C2484t(this, sc, (InterfaceC0220Im) null, 18), abstractC0298Lm);
        return objD == EnumC0091Dn.l ? objD : Oh0.a;
    }

    public final float g(long j) {
        return Float.intBitsToFloat((int) (this.d == OU.m ? j >> 32 : j & 4294967295L));
    }

    public final long h(float f) {
        long jFloatToRawIntBits;
        long j;
        if (f == 0.0f) {
            return 0L;
        }
        if (this.d == OU.m) {
            long jFloatToRawIntBits2 = Float.floatToRawIntBits(f);
            jFloatToRawIntBits = Float.floatToRawIntBits(0.0f);
            j = jFloatToRawIntBits2 << 32;
        } else {
            long jFloatToRawIntBits3 = Float.floatToRawIntBits(0.0f);
            jFloatToRawIntBits = Float.floatToRawIntBits(f);
            j = jFloatToRawIntBits3 << 32;
        }
        return j | (jFloatToRawIntBits & 4294967295L);
    }
}
