package defpackage;

import androidx.media3.container.NalUnitUtil;
import defpackage.fx4;
import defpackage.gj1;
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\u0002\n\u0000¨\u0006\u0000"}, d2 = {"ktor-client-core"}, k = 2, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
public final class ld4 {
    public static final jh5 a = oh5.b().a().a("io.ktor.client.plugins.HttpRequestLifecycle");
    public static final i11 b = tm1.a(new sy2(13), new od0(9), "RequestLifecycle");

    @Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\u0010\u0007\u001a\u00020\u00042\u0006\u0010\u0001\u001a\u00020\u00002\u001c\u0010\u0006\u001a\u0018\b\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00040\u0003\u0012\u0006\u0012\u0004\u0018\u00010\u00050\u0002H\n¢\u0006\u0004\b\u0007\u0010\b"}, d2 = {"Lfd4;", "request", "Lkotlin/Function1;", "Lkotlin/coroutines/Continuation;", "Le6a;", "", "proceed", "<anonymous>", "(Lfd4;Lsq3;)V"}, k = 3, mv = {2, 0, 0})
    @DebugMetadata(c = "io.ktor.client.plugins.HttpRequestLifecycleKt$HttpRequestLifecycle$1$1", f = "HttpRequestLifecycle.kt", i = {0}, l = {27}, m = "invokeSuspend", n = {"executionContext"}, s = {"L$0"})
    public static final class a extends SuspendLambda implements ir3<fd4, sq3<? super Continuation<? super e6a>, ? extends Object>, Continuation<? super e6a>, Object> {
        public int a;
        public /* synthetic */ Object b;
        public /* synthetic */ sq3 c;
        public final /* synthetic */ j11 d;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public a(j11 j11Var, Continuation continuation) {
            super(3, continuation);
            this.d = j11Var;
        }

        @Override // defpackage.ir3
        public final Object invoke(Object obj, Object obj2, Object obj3) {
            a aVar = new a(this.d, (Continuation) obj3);
            aVar.b = (fd4) obj;
            aVar.c = (sq3) obj2;
            return aVar.invokeSuspend(e6a.a);
        }

        /* JADX WARN: Multi-variable type inference failed */
        /* JADX WARN: Type inference failed for: r0v1 */
        /* JADX WARN: Type inference failed for: r0v2 */
        /* JADX WARN: Type inference failed for: r0v3, types: [u81] */
        /* JADX WARN: Type inference failed for: r0v4, types: [u81] */
        /* JADX WARN: Type inference failed for: r0v7, types: [u81] */
        /* JADX WARN: Type inference failed for: r0v8 */
        @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
        public final Object invokeSuspend(Object obj) {
            ?? r0;
            ?? r02;
            ck1 ck1Var = ck1.a;
            int i = this.a;
            if (i != 0) {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                r0 = (u81) this.b;
                try {
                    s38.b(obj);
                    r02 = r0;
                    r02.bw();
                    return e6a.a;
                } catch (Throwable th) {
                    th = th;
                    try {
                        r0.d(th);
                        throw th;
                    } catch (Throwable th2) {
                        r0.bw();
                        throw th2;
                    }
                }
            }
            s38.b(obj);
            fd4 fd4Var = (fd4) this.b;
            sq3 sq3Var = this.c;
            fx4 fx4VarA = zd9.a(fd4Var.e);
            gj1.b bVarCb = this.d.a.d.cb(fx4.b.a);
            cr4.d(bVarCb);
            jh5 jh5Var = ld4.a;
            ((rx4) fx4VarA).at(new co(((fx4) bVarCb).at(new co(fx4VarA, 15)), 16));
            try {
                fd4Var.e = fx4VarA;
                this.b = fx4VarA;
                this.a = 1;
                if (sq3Var.invoke(this) == ck1Var) {
                    return ck1Var;
                }
                r02 = fx4VarA;
                r02.bw();
                return e6a.a;
            } catch (Throwable th3) {
                th = th3;
                r0 = fx4VarA;
                r0.d(th);
                throw th;
            }
        }
    }
}
