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: classes.dex */
@Metadata(d1 = {"\u0000\b\n\u0002\u0018\u0002\n\u0002\b\u0003\u0010\u0002\u001a\u00020\u00002\u0006\u0010\u0001\u001a\u00020\u0000H\u008a@¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"Lkg7;", "it", "<anonymous>", "(Lkg7;)Lkg7;"}, k = 3, mv = {1, 5, 1})
@DebugMetadata(c = "androidx.datastore.preferences.core.PreferenceDataStore$updateData$2", f = "PreferenceDataStoreFactory.kt", i = {}, l = {85}, m = "invokeSuspend", n = {}, s = {})
final class ag7 extends SuspendLambda implements gr3<kg7, Continuation<? super kg7>, Object> {
    public int a;
    public /* synthetic */ Object b;
    public final /* synthetic */ SuspendLambda c;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    /* JADX WARN: Multi-variable type inference failed */
    public ag7(gr3 gr3Var, Continuation continuation) {
        super(2, continuation);
        this.c = (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) {
        ag7 ag7Var = new ag7(this.c, continuation);
        ag7Var.b = obj;
        return ag7Var;
    }

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

    /* JADX WARN: Type inference failed for: r1v1, types: [gr3, kotlin.coroutines.jvm.internal.SuspendLambda] */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Object invokeSuspend(Object obj) {
        ck1 ck1Var = ck1.a;
        int i = this.a;
        if (i == 0) {
            s38.b(obj);
            kg7 kg7Var = (kg7) this.b;
            this.a = 1;
            obj = this.c.invoke(kg7Var, this);
            if (obj == ck1Var) {
                return ck1Var;
            }
        } else {
            if (i != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
        }
        kg7 kg7Var2 = (kg7) obj;
        ((lf6) kg7Var2).b.set(true);
        return kg7Var2;
    }
}
