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: jx0, 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 = {"E", "Lyi7;", "Le6a;", "<anonymous>", "(Lyi7;)V"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt$take$1", f = "Deprecated.kt", i = {0, 0, 1, 1}, l = {284, 285}, m = "invokeSuspend", n = {"$this$produce", "remaining", "$this$produce", "remaining"}, s = {"L$0", "I$0", "L$0", "I$0"})
@vx8
final class C0590jx0 extends SuspendLambda implements gr3 {
    public lv0 a;
    public int b;
    public int c;
    public /* synthetic */ Object d;

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

    /* JADX WARN: Removed duplicated region for block: B:13:0x0033  */
    /* JADX WARN: Removed duplicated region for block: B:19:0x004b  */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:14:0x0043 -> B:16:0x0046). 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) {
        int i;
        lv0 lv0Var;
        yi7 yi7Var;
        ck1 ck1Var = ck1.a;
        int i2 = this.c;
        if (i2 == 0) {
            s38.b(obj);
            throw null;
        }
        if (i2 == 1) {
            i = this.b;
            lv0Var = this.a;
            yi7Var = (yi7) this.d;
            s38.b(obj);
            if (((Boolean) obj).booleanValue()) {
            }
            return e6a.a;
        }
        if (i2 != 2) {
            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
        }
        i = this.b;
        lv0Var = this.a;
        yi7Var = (yi7) this.d;
        s38.b(obj);
        i--;
        if (i != 0) {
            this.d = yi7Var;
            this.a = lv0Var;
            this.b = i;
            this.c = 1;
            obj = lv0Var.b(this);
            if (obj != ck1Var) {
                if (((Boolean) obj).booleanValue()) {
                    Object next = lv0Var.next();
                    this.d = yi7Var;
                    this.a = lv0Var;
                    this.b = i;
                    this.c = 2;
                    if (yi7Var.s(next, this) != ck1Var) {
                        i--;
                        if (i != 0) {
                        }
                    }
                }
            }
            return ck1Var;
        }
        return e6a.a;
    }
}
