package defpackage;

import androidx.room.RoomDatabase;
import defpackage.gj1;
import defpackage.yg1;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;

/* JADX INFO: renamed from: k58, reason: from Kotlin metadata and case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
@Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u0002\"\u0004\b\u0000\u0010\u0000*\u00020\u0001H\u008a@¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"R", "Lak1;", "Le6a;", "<anonymous>", "(Lak1;)V"}, k = 3, mv = {1, 8, 0})
@DebugMetadata(c = "androidx.room.RoomDatabaseKt$startTransactionCoroutine$2$1$1", f = "RoomDatabaseExt.kt", i = {}, l = {103}, m = "invokeSuspend", n = {}, s = {})
final class C0594k58 extends SuspendLambda implements gr3<ak1, Continuation<? super e6a>, Object> {
    public int a;
    public /* synthetic */ Object b;
    public final /* synthetic */ RoomDatabase c;
    public final /* synthetic */ ts0 d;
    public final /* synthetic */ gr3 e;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C0594k58(RoomDatabase roomDatabase, ts0 ts0Var, gr3 gr3Var, Continuation continuation) {
        super(2, continuation);
        this.c = roomDatabase;
        this.d = ts0Var;
        this.e = gr3Var;
    }

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

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

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Object invokeSuspend(Object obj) throws Throwable {
        Continuation continuation;
        ck1 ck1Var = ck1.a;
        int i = this.a;
        if (i == 0) {
            s38.b(obj);
            gj1.b bVarCb = ((ak1) this.b).getJ().cb(yg1.b.a);
            cr4.d(bVarCb);
            yg1 yg1Var = (yg1) bVarCb;
            us9 us9Var = new us9(yg1Var);
            gj1 gj1VarBx = yg1Var.bx(us9Var).bx(new zl9(Integer.valueOf(System.identityHashCode(us9Var)), this.c.getSuspendingTransactionId()));
            ts0 ts0Var = this.d;
            this.b = ts0Var;
            this.a = 1;
            obj = wj0.f(gj1VarBx, this.e, this);
            if (obj == ck1Var) {
                return ck1Var;
            }
            continuation = ts0Var;
        } else {
            if (i != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            continuation = (Continuation) this.b;
            s38.b(obj);
        }
        continuation.resumeWith(obj);
        return e6a.a;
    }
}
