package defpackage;

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\b\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0001\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0001\u0010\u0002"}, d2 = {"Le6a;", "<anonymous>", "()V"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "io.ktor.http.content.OutputStreamContent$writeTo$2", f = "OutputStreamContent.kt", i = {}, l = {28}, m = "invokeSuspend", n = {}, s = {})
final class bz6 extends SuspendLambda implements sq3<Continuation<? super e6a>, Object> {
    public hc0 a;
    public int b;
    public final /* synthetic */ gp0 c;
    public final /* synthetic */ cz6 d;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public bz6(gp0 gp0Var, cz6 cz6Var, Continuation continuation) {
        super(1, continuation);
        this.c = gp0Var;
        this.d = cz6Var;
    }

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

    @Override // defpackage.sq3
    public final Object invoke(Object obj) {
        bz6 bz6Var = (bz6) create((Continuation) obj);
        e6a e6aVar = e6a.a;
        bz6Var.invokeSuspend(e6aVar);
        return e6aVar;
    }

    /* JADX WARN: Type inference failed for: r0v1, types: [int, java.io.Closeable] */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Object invokeSuspend(Object obj) {
        ck1 ck1Var = ck1.a;
        ?? r0 = this.b;
        try {
            if (r0 == 0) {
                s38.b(obj);
                this.a = new hc0(this.c);
                this.b = 1;
                throw null;
            }
            if (r0 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            hc0 hc0Var = this.a;
            s38.b(obj);
            f21.a(hc0Var, null);
            return e6a.a;
        } catch (Throwable th) {
            try {
                throw th;
            } catch (Throwable th2) {
                f21.a(r0, th);
                throw th2;
            }
        }
    }
}
