package defpackage;

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

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"Lak1;", "Lud4;", "<anonymous>", "(Lak1;)Lud4;"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "io.ktor.client.engine.HttpClientEngine$executeWithinCallContext$2", f = "HttpClientEngine.kt", i = {}, l = {169}, m = "invokeSuspend", n = {}, s = {})
final class cb4 extends SuspendLambda implements gr3<ak1, Continuation<? super ud4>, Object> {
    public int a;
    public final /* synthetic */ ab4 b;
    public final /* synthetic */ gd4 c;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public cb4(ab4 ab4Var, gd4 gd4Var, Continuation continuation) {
        super(2, continuation);
        this.b = ab4Var;
        this.c = gd4Var;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation create(Object obj, Continuation continuation) {
        return new cb4(this.b, this.c, continuation);
    }

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

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Object invokeSuspend(Object obj) {
        ck1 ck1Var = ck1.a;
        int i = this.a;
        if (i != 0) {
            if (i != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
            return obj;
        }
        s38.b(obj);
        ab4 ab4Var = this.b;
        fx4 fx4Var = (fx4) ab4Var.getJ().cb(fx4.b.a);
        if (!(fx4Var != null ? fx4Var.isActive() : false)) {
            throw new c11("Client already closed");
        }
        this.a = 1;
        Object objBp = ab4Var.bp(this.c, this);
        return objBp == ck1Var ? ck1Var : objBp;
    }
}
