package x;

import java.util.concurrent.CancellationException;
import m3.AbstractC2467b;
import w4.C3137A;

/* JADX INFO: loaded from: classes.dex */
public final class N extends C4.j implements J4.e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public kotlin.jvm.internal.C f25637a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public kotlin.jvm.internal.C f25638b;

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public /* synthetic */ Object f25640d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ O f25641e;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public N(O o6, A4.d dVar) {
        super(2, dVar);
        this.f25641e = o6;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        N n6 = new N(this.f25641e, dVar);
        n6.f25640d = obj;
        return n6;
    }

    @Override // J4.e
    public final Object invoke(Object obj, Object obj2) {
        return ((N) create((V4.C) obj, (A4.d) obj2)).invokeSuspend(C3137A.f25453a);
    }

    /* JADX WARN: Code restructure failed: missing block: B:50:0x00e5, code lost:
    
        if (x.O.w0(r3, r6) != r0) goto L11;
     */
    /* JADX WARN: Path cross not found for [B:44:0x00c8, B:40:0x00b1], limit reached: 56 */
    /* JADX WARN: Path cross not found for [B:46:0x00cc, B:19:0x0056], limit reached: 56 */
    /* JADX WARN: Removed duplicated region for block: B:14:0x0032 A[PHI: r1 r4
      0x0032: PHI (r1v11 kotlin.jvm.internal.C) = (r1v3 kotlin.jvm.internal.C), (r1v16 kotlin.jvm.internal.C) binds: [B:13:0x002f, B:36:0x00a8] A[DONT_GENERATE, DONT_INLINE]
      0x0032: PHI (r4v6 V4.C) = (r4v4 V4.C), (r4v7 V4.C) binds: [B:13:0x002f, B:36:0x00a8] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:19:0x0056 A[PHI: r5
      0x0056: PHI (r5v7 V4.C) = (r5v0 V4.C), (r5v3 V4.C), (r5v3 V4.C), (r5v3 V4.C), (r5v5 V4.C), (r5v8 V4.C) binds: [B:18:0x004e, B:45:0x00ca, B:47:0x00d7, B:41:0x00c3, B:30:0x0082, B:11:0x0027] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:21:0x005c  */
    /* JADX WARN: Removed duplicated region for block: B:31:0x0084  */
    /* JADX WARN: Removed duplicated region for block: B:40:0x00b1 A[Catch: CancellationException -> 0x00c6, TryCatch #2 {CancellationException -> 0x00c6, blocks: (B:38:0x00ab, B:40:0x00b1, B:44:0x00c8, B:46:0x00cc), top: B:59:0x00ab }] */
    /* JADX WARN: Removed duplicated region for block: B:44:0x00c8 A[Catch: CancellationException -> 0x00c6, TryCatch #2 {CancellationException -> 0x00c6, blocks: (B:38:0x00ab, B:40:0x00b1, B:44:0x00c8, B:46:0x00cc), top: B:59:0x00ab }] */
    /* JADX WARN: Removed duplicated region for block: B:52:0x00e8  */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:30:0x0082 -> B:19:0x0056). Please report as a decompilation issue!!! */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:41:0x00c3 -> B:19:0x0056). Please report as a decompilation issue!!! */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:45:0x00ca -> B:19:0x0056). Please report as a decompilation issue!!! */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:47:0x00d7 -> B:19:0x0056). Please report as a decompilation issue!!! */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:50:0x00e5 -> B:11:0x0027). Please report as a decompilation issue!!! */
    @Override // C4.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        V4.C c6;
        kotlin.jvm.internal.C c7;
        kotlin.jvm.internal.C c8;
        kotlin.jvm.internal.C c9;
        V4.C c10;
        V4.C c11;
        Object obj2;
        M m6;
        A a6;
        Object obj3;
        B4.a aVar = B4.a.f492a;
        int i6 = this.f25639c;
        O o6 = this.f25641e;
        switch (i6) {
            case 0:
                AbstractC2467b.l(obj);
                c6 = (V4.C) this.f25640d;
                if (!V4.E.v(c6)) {
                    c7 = new kotlin.jvm.internal.C();
                    X4.e eVar = o6.f25651j;
                    if (eVar == null) {
                        c8 = c7;
                        a6 = null;
                        c7.f20115a = a6;
                        obj3 = c8.f20115a;
                        if (obj3 instanceof C3204y) {
                        }
                        return aVar;
                    }
                    this.f25640d = c6;
                    this.f25637a = c7;
                    this.f25638b = c7;
                    this.f25639c = 1;
                    obj = eVar.e(this);
                    if (obj != aVar) {
                        c8 = c7;
                        a6 = (A) obj;
                        c7.f20115a = a6;
                        obj3 = c8.f20115a;
                        if (obj3 instanceof C3204y) {
                            this.f25640d = c6;
                            this.f25637a = c8;
                            this.f25638b = null;
                            this.f25639c = 2;
                            if (O.x0(o6, (C3204y) obj3, this) != aVar) {
                                c9 = c8;
                                c10 = c6;
                                m6 = new M(c9, o6, null);
                                this.f25640d = c10;
                                this.f25637a = c9;
                                this.f25639c = 3;
                                if (o6.A0(m6, this) != aVar) {
                                    c6 = c10;
                                    try {
                                    } catch (CancellationException unused) {
                                        c11 = c6;
                                        this.f25640d = c11;
                                        this.f25637a = null;
                                        this.f25639c = 6;
                                        break;
                                    }
                                    obj2 = c9.f20115a;
                                    if (obj2 instanceof C3206z) {
                                        kotlin.jvm.internal.o.f(obj2, "null cannot be cast to non-null type androidx.compose.foundation.gestures.DragEvent.DragStopped");
                                        this.f25640d = c6;
                                        this.f25637a = null;
                                        this.f25639c = 4;
                                        if (O.y0(o6, (C3206z) obj2, this) != aVar) {
                                            if (!V4.E.v(c6)) {
                                            }
                                        }
                                    } else {
                                        if (obj2 instanceof C3200w) {
                                            this.f25640d = c6;
                                            this.f25637a = null;
                                            this.f25639c = 5;
                                            if (O.w0(o6, this) != aVar) {
                                            }
                                        }
                                        if (!V4.E.v(c6)) {
                                            return C3137A.f25453a;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    return aVar;
                }
                break;
            case 1:
                c7 = this.f25638b;
                c8 = this.f25637a;
                c6 = (V4.C) this.f25640d;
                AbstractC2467b.l(obj);
                a6 = (A) obj;
                c7.f20115a = a6;
                obj3 = c8.f20115a;
                if (obj3 instanceof C3204y) {
                }
                return aVar;
            case 2:
                c9 = this.f25637a;
                c10 = (V4.C) this.f25640d;
                AbstractC2467b.l(obj);
                m6 = new M(c9, o6, null);
                this.f25640d = c10;
                this.f25637a = c9;
                this.f25639c = 3;
                if (o6.A0(m6, this) != aVar) {
                }
                return aVar;
            case 3:
                c9 = this.f25637a;
                c10 = (V4.C) this.f25640d;
                try {
                    AbstractC2467b.l(obj);
                } catch (CancellationException unused2) {
                    c11 = c10;
                    this.f25640d = c11;
                    this.f25637a = null;
                    this.f25639c = 6;
                }
                c6 = c10;
                obj2 = c9.f20115a;
                if (obj2 instanceof C3206z) {
                }
                break;
            case 4:
                c11 = (V4.C) this.f25640d;
                try {
                    AbstractC2467b.l(obj);
                } catch (CancellationException unused3) {
                    this.f25640d = c11;
                    this.f25637a = null;
                    this.f25639c = 6;
                }
                c6 = c11;
                if (!V4.E.v(c6)) {
                }
                break;
            case 5:
                c11 = (V4.C) this.f25640d;
                AbstractC2467b.l(obj);
                c6 = c11;
                if (!V4.E.v(c6)) {
                }
                break;
            case 6:
                c11 = (V4.C) this.f25640d;
                AbstractC2467b.l(obj);
                c6 = c11;
                if (!V4.E.v(c6)) {
                }
                break;
            default:
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
        }
    }
}
