package defpackage;

import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.Boxing;
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;", "Le6a;", "<anonymous>", "(Lak1;)V"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "io.ktor.client.plugins.observer.ResponseObserverKt$ResponseObserver$2$1$1", f = "ResponseObserver.kt", i = {0}, l = {64, 68}, m = "invokeSuspend", n = {"$this$launch"}, s = {"L$0"})
@vx8
final class h38 extends SuspendLambda implements gr3<ak1, Continuation<? super e6a>, Object> {
    public int a;
    public /* synthetic */ Object b;
    public final /* synthetic */ rd4 c;
    public final /* synthetic */ gr3 d;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public h38(rd4 rd4Var, gr3 gr3Var, Continuation continuation) {
        super(2, continuation);
        this.c = rd4Var;
        this.d = gr3Var;
    }

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

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

    /* JADX WARN: Code restructure failed: missing block: B:19:0x0037, code lost:
    
        if (r1.invoke(r2, r5) == r0) goto L27;
     */
    /* JADX WARN: Code restructure failed: missing block: B:26:0x0055, code lost:
    
        if (r6 == r0) goto L27;
     */
    /* JADX WARN: Code restructure failed: missing block: B:27:0x0057, code lost:
    
        return r0;
     */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        ck1 ck1Var = ck1.a;
        int i = this.a;
        rd4 rd4Var = this.c;
        try {
            try {
            } catch (Throwable th) {
                s38.a(th);
            }
        } catch (Throwable th2) {
            s38.a(th2);
        }
        if (i == 0) {
            s38.b(obj);
            ak1 ak1Var = (ak1) this.b;
            gr3 gr3Var = this.d;
            this.b = ak1Var;
            this.a = 1;
        } else {
            if (i != 1) {
                if (i != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s38.b(obj);
                Boxing.boxLong(((Number) obj).longValue());
                return e6a.a;
            }
            s38.b(obj);
        }
        bn0 i2 = rd4Var.getI();
        if (!i2.i()) {
            this.b = null;
            this.a = 2;
            obj = go0.c(i2, Long.MAX_VALUE, this);
        }
        return e6a.a;
    }
}
