package W;

import O1.C0225a;
import Z6.AbstractC0385z;
import c7.InterfaceC0597e;
import com.google.android.gms.internal.measurement.C1;

/* JADX INFO: renamed from: W.s, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0351s extends G6.i implements O6.p {

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public C0336c f7032u;

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

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public /* synthetic */ Object f7034w;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public final /* synthetic */ K f7035x;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C0351s(K k8, E6.d dVar) {
        super(2, dVar);
        this.f7035x = k8;
    }

    @Override // O6.p
    public final Object k(Object obj, Object obj2) {
        return ((C0351s) m((E6.d) obj2, (InterfaceC0597e) obj)).p(A6.n.f457a);
    }

    @Override // G6.a
    public final E6.d m(E6.d dVar, Object obj) {
        C0351s c0351s = new C0351s(this.f7035x, dVar);
        c0351s.f7034w = obj;
        return c0351s;
    }

    /* JADX WARN: Removed duplicated region for block: B:31:0x00bf  */
    /* JADX WARN: Removed duplicated region for block: B:38:0x00cb  */
    @Override // G6.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object p(Object obj) throws Throwable {
        InterfaceC0597e interfaceC0597e;
        V v7;
        F6.a aVar = F6.a.f2580q;
        int i = this.f7033v;
        A6.n nVar = A6.n.f457a;
        K k8 = this.f7035x;
        if (i == 0) {
            C1.N(obj);
            InterfaceC0597e interfaceC0597e2 = (InterfaceC0597e) this.f7034w;
            this.f7034w = interfaceC0597e2;
            this.f7033v = 1;
            Object objC = AbstractC0385z.C(k8.f6937c.u(), new E(k8, null), this);
            if (objC != aVar) {
                interfaceC0597e = interfaceC0597e2;
                obj = objC;
            }
        }
        if (i != 1) {
            if (i != 2) {
                if (i != 3) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                C1.N(obj);
                return nVar;
            }
            v7 = this.f7032u;
            interfaceC0597e = (InterfaceC0597e) this.f7034w;
            C1.N(obj);
            c7.n nVar2 = new c7.n(new P.g(11, new C0225a(new C0225a(new C0225a(new C0347n(k8, null), k8.f6942h.f5073a), new C0348o(2, null), 25, false), new C0349p(v7, null), 24, false)), new C0350q(k8, (E6.d) null));
            this.f7034w = null;
            this.f7032u = null;
            this.f7033v = 3;
            if (!(interfaceC0597e instanceof c7.M)) {
                throw ((c7.M) interfaceC0597e).f9405q;
            }
            Object objO = nVar2.o(interfaceC0597e, this);
            if (objO != aVar) {
                objO = nVar;
            }
            return objO == aVar ? aVar : nVar;
        }
        InterfaceC0597e interfaceC0597e3 = (InterfaceC0597e) this.f7034w;
        C1.N(obj);
        interfaceC0597e = interfaceC0597e3;
        v7 = (V) obj;
        if (v7 instanceof C0336c) {
            Object obj2 = ((C0336c) v7).f6978b;
            this.f7034w = interfaceC0597e;
            this.f7032u = (C0336c) v7;
            this.f7033v = 2;
            if (interfaceC0597e.l(obj2, this) != aVar) {
            }
        }
        if (v7 instanceof W) {
            throw new IllegalStateException("This is a bug in DataStore. Please file a bug at: https://issuetracker.google.com/issues/new?component=907884&template=1466542");
        }
        if (v7 instanceof N) {
            throw ((N) v7).f6951b;
        }
        if (!(v7 instanceof L)) {
        }
        c7.n nVar22 = new c7.n(new P.g(11, new C0225a(new C0225a(new C0225a(new C0347n(k8, null), k8.f6942h.f5073a), new C0348o(2, null), 25, false), new C0349p(v7, null), 24, false)), new C0350q(k8, (E6.d) null));
        this.f7034w = null;
        this.f7032u = null;
        this.f7033v = 3;
        if (!(interfaceC0597e instanceof c7.M)) {
        }
    }
}
