package androidx.datastore.core;

import java.util.List;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.CoroutineSingletons;

/* JADX INFO: loaded from: classes.dex */
public final class j extends y {

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public List f1925c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ n f1926d;

    public j(n nVar, List list) {
        this.f1926d = nVar;
        this.f1925c = kotlin.collections.n.q1(list);
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    @Override // androidx.datastore.core.y
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object a(Continuation continuation) throws CorruptionException {
        DataStoreImpl$InitDataStore$doRun$1 dataStoreImpl$InitDataStore$doRun$1;
        j jVar;
        d dVar;
        if (continuation instanceof DataStoreImpl$InitDataStore$doRun$1) {
            dataStoreImpl$InitDataStore$doRun$1 = (DataStoreImpl$InitDataStore$doRun$1) continuation;
            int i10 = dataStoreImpl$InitDataStore$doRun$1.label;
            if ((i10 & Integer.MIN_VALUE) != 0) {
                dataStoreImpl$InitDataStore$doRun$1.label = i10 - Integer.MIN_VALUE;
            } else {
                dataStoreImpl$InitDataStore$doRun$1 = new DataStoreImpl$InitDataStore$doRun$1(this, continuation);
            }
        }
        Object objF = dataStoreImpl$InitDataStore$doRun$1.result;
        CoroutineSingletons coroutineSingletons = CoroutineSingletons.f29226a;
        int i11 = dataStoreImpl$InitDataStore$doRun$1.label;
        if (i11 == 0) {
            kotlin.a.d(objF);
            List list = this.f1925c;
            n nVar = this.f1926d;
            if (list == null || list.isEmpty()) {
                dataStoreImpl$InitDataStore$doRun$1.L$0 = this;
                dataStoreImpl$InitDataStore$doRun$1.label = 1;
                objF = n.f(nVar, false, dataStoreImpl$InitDataStore$doRun$1);
                if (objF == coroutineSingletons) {
                    return coroutineSingletons;
                }
                jVar = this;
                dVar = (d) objF;
            } else {
                u uVarG = nVar.g();
                DataStoreImpl$InitDataStore$doRun$initData$1 dataStoreImpl$InitDataStore$doRun$initData$1 = new DataStoreImpl$InitDataStore$doRun$initData$1(nVar, this, null);
                dataStoreImpl$InitDataStore$doRun$1.L$0 = this;
                dataStoreImpl$InitDataStore$doRun$1.label = 2;
                objF = ((b0) uVarG).b(dataStoreImpl$InitDataStore$doRun$1, dataStoreImpl$InitDataStore$doRun$initData$1);
                if (objF == coroutineSingletons) {
                    return coroutineSingletons;
                }
                jVar = this;
                dVar = (d) objF;
            }
        } else if (i11 == 1) {
            jVar = (j) dataStoreImpl$InitDataStore$doRun$1.L$0;
            kotlin.a.d(objF);
            dVar = (d) objF;
        } else {
            if (i11 != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            jVar = (j) dataStoreImpl$InitDataStore$doRun$1.L$0;
            kotlin.a.d(objF);
            dVar = (d) objF;
        }
        jVar.f1926d.f1939h.c(dVar);
        return kd.e.f29109a;
    }
}
