package defpackage;

import kotlin.Metadata;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(k = 3, mv = {2, 0, 0}, xi = 176)
@DebugMetadata(c = "kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt", f = "Deprecated.kt", i = {0, 0}, l = {41}, m = "consumeEach", n = {"action", "channel$iv"}, s = {"L$0", "L$1"})
final class gw0<E> extends ContinuationImpl {
    public sq3 a;
    public bv7 b;
    public lv0 c;
    public /* synthetic */ Object d;
    public int e;

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Object invokeSuspend(Object obj) {
        this.d = obj;
        int i = (this.e | Integer.MIN_VALUE) - Integer.MIN_VALUE;
        this.e = i;
        ck1 ck1Var = ck1.a;
        if (i == 0) {
            s38.b(obj);
            throw null;
        }
        if (i != 1) {
            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
        }
        lv0 lv0Var = this.c;
        bv7 bv7Var = this.b;
        sq3 sq3Var = this.a;
        try {
            s38.b(obj);
            while (((Boolean) obj).booleanValue()) {
                sq3Var.invoke(lv0Var.next());
                this.a = sq3Var;
                this.b = bv7Var;
                this.c = lv0Var;
                this.e = 1;
                obj = lv0Var.b(this);
                if (obj == ck1Var) {
                    return ck1Var;
                }
            }
            bv7Var.h(null);
            return e6a.a;
        } catch (Throwable th) {
            bv7Var.h(null);
            throw th;
        }
    }
}
