package O1;

import M2.F1;
import Y4.C0841g;
import Y4.C0851q;
import Y4.InterfaceC0844j;
import Y4.e0;
import m3.AbstractC2467b;
import w4.C3137A;

/* JADX INFO: renamed from: O1.y, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0584y extends C4.j implements J4.e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public C0564d f5464a;

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

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

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

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C0584y(O o6, A4.d dVar) {
        super(2, dVar);
        this.f5467d = o6;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        C0584y c0584y = new C0584y(this.f5467d, dVar);
        c0584y.f5466c = obj;
        return c0584y;
    }

    @Override // J4.e
    public final Object invoke(Object obj, Object obj2) {
        return ((C0584y) create((InterfaceC0844j) obj, (A4.d) obj2)).invokeSuspend(C3137A.f25453a);
    }

    /* JADX WARN: Removed duplicated region for block: B:31:0x009b  */
    /* JADX WARN: Removed duplicated region for block: B:44:0x00bf  */
    @Override // C4.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) throws Throwable {
        InterfaceC0844j interfaceC0844j;
        Z z6;
        B4.a aVar = B4.a.f492a;
        int i6 = this.f5465b;
        C3137A c3137a = C3137A.f25453a;
        O o6 = this.f5467d;
        if (i6 == 0) {
            AbstractC2467b.l(obj);
            InterfaceC0844j interfaceC0844j2 = (InterfaceC0844j) this.f5466c;
            this.f5466c = interfaceC0844j2;
            this.f5465b = 1;
            Object objH = V4.E.H(o6.f5356c.getCoroutineContext(), new G(o6, null), this);
            if (objH != aVar) {
                interfaceC0844j = interfaceC0844j2;
                obj = objH;
            }
        }
        if (i6 != 1) {
            if (i6 != 2) {
                if (i6 != 3) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                AbstractC2467b.l(obj);
                return c3137a;
            }
            z6 = this.f5464a;
            interfaceC0844j = (InterfaceC0844j) this.f5466c;
            AbstractC2467b.l(obj);
            C0851q c0851q = new C0851q((Y4.c0) o6.f5360g.f506b, new C0581v(2, null));
            C0582w c0582w = new C0582w(z6, null);
            this.f5466c = null;
            this.f5464a = null;
            this.f5465b = 3;
            if (!(interfaceC0844j instanceof e0)) {
                throw ((e0) interfaceC0844j).f8939a;
            }
            Object objCollect = c0851q.collect(new C0841g(new kotlin.jvm.internal.y(), new F1(interfaceC0844j, 1), c0582w), this);
            if (objCollect != aVar) {
                objCollect = c3137a;
            }
            if (objCollect != aVar) {
                objCollect = c3137a;
            }
            if (objCollect != aVar) {
                objCollect = c3137a;
            }
            return objCollect == aVar ? aVar : c3137a;
        }
        InterfaceC0844j interfaceC0844j3 = (InterfaceC0844j) this.f5466c;
        AbstractC2467b.l(obj);
        interfaceC0844j = interfaceC0844j3;
        z6 = (Z) obj;
        if (z6 instanceof C0564d) {
            Object obj2 = ((C0564d) z6).f5397b;
            this.f5466c = interfaceC0844j;
            this.f5464a = (C0564d) z6;
            this.f5465b = 2;
            if (interfaceC0844j.emit(obj2, this) != aVar) {
            }
        }
        if (z6 instanceof b0) {
            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 (z6 instanceof S) {
            throw ((S) z6).f5370b;
        }
        if (!(z6 instanceof P)) {
        }
        C0851q c0851q2 = new C0851q((Y4.c0) o6.f5360g.f506b, new C0581v(2, null));
        C0582w c0582w2 = new C0582w(z6, null);
        this.f5466c = null;
        this.f5464a = null;
        this.f5465b = 3;
        if (!(interfaceC0844j instanceof e0)) {
        }
    }
}
