package androidx.lifecycle;

import defpackage.ak1;
import defpackage.bk1;
import defpackage.ck1;
import defpackage.e6a;
import defpackage.gr3;
import defpackage.mg6;
import defpackage.ng6;
import defpackage.s38;
import defpackage.vx8;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;

/* JADX INFO: loaded from: classes.dex */
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\u008a@¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"Lak1;", "Le6a;", "<anonymous>", "(Lak1;)V"}, k = 3, mv = {1, 8, 0})
@DebugMetadata(c = "androidx.lifecycle.RepeatOnLifecycleKt$repeatOnLifecycle$3$1$1$1$1", f = "RepeatOnLifecycle.kt", i = {0, 1}, l = {171, 110}, m = "invokeSuspend", n = {"$this$withLock_u24default$iv", "$this$withLock_u24default$iv"}, s = {"L$0", "L$0"})
@vx8
final class ae extends SuspendLambda implements gr3<ak1, Continuation<? super e6a>, Object> {
    public mg6 a;
    public SuspendLambda b;
    public int c;
    public final /* synthetic */ ng6 d;
    public final /* synthetic */ SuspendLambda e;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    /* JADX WARN: Multi-variable type inference failed */
    public ae(ng6 ng6Var, gr3 gr3Var, Continuation continuation) {
        super(2, continuation);
        this.d = ng6Var;
        this.e = (SuspendLambda) gr3Var;
    }

    /* JADX WARN: Type inference failed for: r1v0, types: [gr3, kotlin.coroutines.jvm.internal.SuspendLambda] */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation create(Object obj, Continuation continuation) {
        return new ae(this.d, this.e, continuation);
    }

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

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r1v2, types: [gr3] */
    /* JADX WARN: Type inference failed for: r1v6 */
    /* JADX WARN: Type inference failed for: r1v7 */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Object invokeSuspend(Object obj) throws Throwable {
        mg6 mg6Var;
        ?? r1;
        mg6 mg6Var2;
        Throwable th;
        ck1 ck1Var = ck1.a;
        int i = this.c;
        try {
            if (i == 0) {
                s38.b(obj);
                mg6Var = this.d;
                this.a = mg6Var;
                SuspendLambda suspendLambda = this.e;
                this.b = suspendLambda;
                this.c = 1;
                r1 = suspendLambda;
                if (mg6Var.a(this) != ck1Var) {
                }
                return ck1Var;
            }
            if (i != 1) {
                if (i != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                mg6Var2 = this.a;
                try {
                    s38.b(obj);
                    mg6Var2.c(null);
                    return e6a.a;
                } catch (Throwable th2) {
                    th = th2;
                    mg6Var2.c(null);
                    throw th;
                }
            }
            gr3 gr3Var = (gr3) this.b;
            mg6 mg6Var3 = this.a;
            s38.b(obj);
            mg6Var = mg6Var3;
            r1 = gr3Var;
            ad adVar = new ad(r1, null);
            this.a = mg6Var;
            this.b = null;
            this.c = 2;
            if (bk1.c(adVar, this) != ck1Var) {
                mg6Var2 = mg6Var;
                mg6Var2.c(null);
                return e6a.a;
            }
            return ck1Var;
        } catch (Throwable th3) {
            mg6Var2 = mg6Var;
            th = th3;
            mg6Var2.c(null);
            throw th;
        }
    }
}
