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: cx0, 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$mapIndexed$1", f = "Deprecated.kt", i = {0, 0, 1, 1, 2, 2}, l = {374, 375, 375}, m = "invokeSuspend", n = {"$this$produce", "index", "$this$produce", "index", "$this$produce", "index"}, s = {"L$0", "I$0", "L$0", "I$0", "L$0", "I$0"})
final class C0526cx0 extends SuspendLambda implements gr3<yi7<Object>, Continuation<? super e6a>, Object> {
    public lv0 a;
    public yi7 b;
    public int c;
    public int d;
    public /* synthetic */ Object e;

    @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 ((C0526cx0) create((yi7) obj, (Continuation) obj2)).invokeSuspend(e6a.a);
    }

    /* JADX WARN: Code restructure failed: missing block: B:17:0x0050, code lost:
    
        if (r9 == r0) goto L18;
     */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        lv0 lv0Var;
        int i;
        yi7 yi7Var;
        ck1 ck1Var = ck1.a;
        int i2 = this.d;
        if (i2 == 0) {
            s38.b(obj);
            throw null;
        }
        if (i2 != 1) {
            if (i2 == 2) {
                i = this.c;
                yi7 yi7Var2 = this.b;
                lv0 lv0Var2 = this.a;
                yi7 yi7Var3 = (yi7) this.e;
                s38.b(obj);
                this.e = yi7Var3;
                this.a = lv0Var2;
                this.b = null;
                this.c = i;
                this.d = 3;
                if (yi7Var2.s(obj, this) != ck1Var) {
                    lv0Var = lv0Var2;
                    yi7Var = yi7Var3;
                }
                return ck1Var;
            }
            if (i2 != 3) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            i = this.c;
            lv0Var = this.a;
            yi7Var = (yi7) this.e;
            s38.b(obj);
            this.e = yi7Var;
            this.a = lv0Var;
            this.c = i;
            this.d = 1;
            obj = lv0Var.b(this);
        } else {
            lv0Var = this.a;
            s38.b(obj);
        }
        if (!((Boolean) obj).booleanValue()) {
            return e6a.a;
        }
        lv0Var.next();
        throw null;
    }
}
