package defpackage;

import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;

/* JADX INFO: renamed from: bx0, reason: from Kotlin metadata and case insensitive filesystem */
/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u0002\"\u0004\b\u0000\u0010\u0000*\b\u0012\u0004\u0012\u00028\u00000\u0001H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"R", "Lyi7;", "Le6a;", "<anonymous>", "(Lyi7;)V"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt$map$1", f = "Deprecated.kt", i = {0, 0, 1, 1, 2, 2}, l = {514, 363, 363}, m = "invokeSuspend", n = {"$this$produce", "$this$consume$iv$iv", "$this$produce", "$this$consume$iv$iv", "$this$produce", "$this$consume$iv$iv"}, s = {"L$0", "L$2", "L$0", "L$2", "L$0", "L$2"})
@vx8
final class C0249bx0 extends SuspendLambda implements gr3<yi7<Object>, Continuation<? super e6a>, Object> {
    public gr3 a;
    public bv7 b;
    public lv0 c;
    public yi7 d;
    public int e;
    public /* synthetic */ Object f;

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation create(Object obj, Continuation continuation) {
        throw null;
    }

    @Override // defpackage.gr3
    public final Object invoke(Object obj, Object obj2) {
        return ((C0249bx0) create((yi7) obj, (Continuation) obj2)).invokeSuspend(e6a.a);
    }

    /* JADX WARN: Removed duplicated region for block: B:22:0x004a A[Catch: all -> 0x001f, PHI: r1 r6 r7 r8 r11
      0x004a: PHI (r1v4 lv0) = (r1v1 lv0), (r1v6 lv0) binds: [B:21:0x0047, B:33:0x0093] A[DONT_GENERATE, DONT_INLINE]
      0x004a: PHI (r6v6 bv7) = (r6v2 bv7), (r6v8 bv7) binds: [B:21:0x0047, B:33:0x0093] A[DONT_GENERATE, DONT_INLINE]
      0x004a: PHI (r7v4 gr3) = (r7v0 gr3), (r7v6 gr3) binds: [B:21:0x0047, B:33:0x0093] A[DONT_GENERATE, DONT_INLINE]
      0x004a: PHI (r8v4 yi7) = (r8v1 yi7), (r8v6 yi7) binds: [B:21:0x0047, B:33:0x0093] A[DONT_GENERATE, DONT_INLINE]
      0x004a: PHI (r11v8 java.lang.Object) = (r11v0 java.lang.Object), (r11v14 java.lang.Object) binds: [B:21:0x0047, B:33:0x0093] A[DONT_GENERATE, DONT_INLINE], TryCatch #2 {all -> 0x001f, blocks: (B:9:0x001a, B:32:0x0085, B:22:0x004a, B:24:0x0052, B:21:0x0047), top: B:47:0x000a }] */
    /* JADX WARN: Removed duplicated region for block: B:24:0x0052 A[Catch: all -> 0x001f, TRY_LEAVE, TryCatch #2 {all -> 0x001f, blocks: (B:9:0x001a, B:32:0x0085, B:22:0x004a, B:24:0x0052, B:21:0x0047), top: B:47:0x000a }] */
    /* JADX WARN: Removed duplicated region for block: B:31:0x0081  */
    /* JADX WARN: Removed duplicated region for block: B:35:0x0096  */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:31:0x0081 -> B:32:0x0085). Please report as a decompilation issue!!! */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        bv7 bv7Var;
        lv0 lv0Var;
        gr3 gr3Var;
        yi7 yi7Var;
        bv7 bv7Var2;
        yi7 yi7Var2;
        gr3 gr3Var2;
        lv0 lv0Var2;
        yi7 yi7Var3;
        ck1 ck1Var = ck1.a;
        int i = this.e;
        if (i == 0) {
            s38.b(obj);
            throw null;
        }
        try {
            if (i != 1) {
                if (i == 2) {
                    yi7Var3 = this.d;
                    lv0Var2 = this.c;
                    bv7Var2 = this.b;
                    gr3Var2 = this.a;
                    yi7Var2 = (yi7) this.f;
                    try {
                        s38.b(obj);
                        this.f = yi7Var2;
                        this.a = gr3Var2;
                        this.b = bv7Var2;
                        this.c = lv0Var2;
                        this.d = null;
                        this.e = 3;
                        if (yi7Var3.s(obj, this) != ck1Var) {
                        }
                        return ck1Var;
                    } catch (Throwable th) {
                        th = th;
                        bv7Var = bv7Var2;
                        try {
                            throw th;
                        } catch (Throwable th2) {
                            yv0.a(bv7Var, th);
                            throw th2;
                        }
                    }
                }
                if (i != 3) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                lv0Var = this.c;
                bv7Var = this.b;
                gr3Var = this.a;
                yi7Var = (yi7) this.f;
                s38.b(obj);
                this.f = yi7Var;
                this.a = gr3Var;
                this.b = bv7Var;
                this.c = lv0Var;
                this.e = 1;
                obj = lv0Var.b(this);
                if (obj != ck1Var) {
                    if (((Boolean) obj).booleanValue()) {
                        bv7Var.h(null);
                        return e6a.a;
                    }
                    Object next = lv0Var.next();
                    this.f = yi7Var;
                    this.a = gr3Var;
                    this.b = bv7Var;
                    this.c = lv0Var;
                    this.d = yi7Var;
                    this.e = 2;
                    obj = gr3Var.invoke(next, this);
                    if (obj != ck1Var) {
                        yi7Var2 = yi7Var;
                        gr3Var2 = gr3Var;
                        bv7Var2 = bv7Var;
                        lv0Var2 = lv0Var;
                        yi7Var3 = yi7Var2;
                        this.f = yi7Var2;
                        this.a = gr3Var2;
                        this.b = bv7Var2;
                        this.c = lv0Var2;
                        this.d = null;
                        this.e = 3;
                        if (yi7Var3.s(obj, this) != ck1Var) {
                            lv0Var = lv0Var2;
                            bv7Var = bv7Var2;
                            gr3Var = gr3Var2;
                            yi7Var = yi7Var2;
                            this.f = yi7Var;
                            this.a = gr3Var;
                            this.b = bv7Var;
                            this.c = lv0Var;
                            this.e = 1;
                            obj = lv0Var.b(this);
                            if (obj != ck1Var) {
                            }
                        }
                    }
                }
                return ck1Var;
            }
            lv0Var = this.c;
            bv7Var = this.b;
            gr3Var = this.a;
            yi7Var = (yi7) this.f;
            s38.b(obj);
            if (((Boolean) obj).booleanValue()) {
            }
        } catch (Throwable th3) {
            th = th3;
        }
    }
}
