package W;

import B4.InterfaceC0027x;
import a.AbstractC0212a;
import d4.C0550i;
import i4.EnumC0643a;
import j4.AbstractC0806h;
import kotlin.jvm.functions.Function2;

/* JADX INFO: renamed from: W.x, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0209x extends AbstractC0806h implements Function2 {

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public int f3210k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public final /* synthetic */ O f3211l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final /* synthetic */ c0 f3212m;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C0209x(O o5, c0 c0Var, h4.c cVar) {
        super(2, cVar);
        this.f3211l = o5;
        this.f3212m = c0Var;
    }

    @Override // j4.AbstractC0799a
    public final h4.c create(Object obj, h4.c cVar) {
        return new C0209x(this.f3211l, this.f3212m, cVar);
    }

    @Override // kotlin.jvm.functions.Function2
    public final Object invoke(Object obj, Object obj2) {
        return ((C0209x) create((InterfaceC0027x) obj, (h4.c) obj2)).invokeSuspend(C0550i.f6143a);
    }

    /* JADX WARN: Type inference failed for: r9v11, types: [j4.h, kotlin.jvm.functions.Function2] */
    /* JADX WARN: Type inference failed for: r9v13, types: [j4.h, kotlin.jvm.functions.Function2] */
    @Override // j4.AbstractC0799a
    public final Object invokeSuspend(Object obj) throws Throwable {
        EnumC0643a enumC0643a = EnumC0643a.f6670k;
        int i = this.f3210k;
        c0 c0Var = this.f3212m;
        O o5 = this.f3211l;
        if (i == 0) {
            AbstractC0212a.H(obj);
            m0 m0VarE = o5.f3073h.E();
            if (m0VarE instanceof C0190d) {
                ?? r9 = c0Var.f3113a;
                this.f3210k = 1;
                Object objB = o5.h().b(new J(o5, c0Var.f3116d, r9, null), this);
                if (objB != enumC0643a) {
                    return objB;
                }
            } else {
                if (!(m0VarE instanceof e0) && !(m0VarE instanceof n0)) {
                    if (m0VarE instanceof b0) {
                        throw ((b0) m0VarE).f3112b;
                    }
                    if (m0VarE instanceof d0) {
                        throw new IllegalStateException("This is a bug in DataStore. Please file a bug at: https://issuetracker.google.com/issues/new?component=907884&template=1466542");
                    }
                    throw new A2.u();
                }
                if (m0VarE != c0Var.f3115c) {
                    throw ((e0) m0VarE).f3122b;
                }
                this.f3210k = 2;
                if (O.e(o5, this) != enumC0643a) {
                }
            }
        }
        if (i == 1) {
            AbstractC0212a.H(obj);
            return obj;
        }
        if (i != 2) {
            if (i != 3) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            AbstractC0212a.H(obj);
            return obj;
        }
        AbstractC0212a.H(obj);
        ?? r92 = c0Var.f3113a;
        this.f3210k = 3;
        Object objB2 = o5.h().b(new J(o5, c0Var.f3116d, r92, null), this);
        return objB2 == enumC0643a ? enumC0643a : objB2;
    }
}
