package a0;

import V4.C0772m;
import a.AbstractC0872a;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.SnapshotStateKt__SnapshotStateKt;
import m3.AbstractC2467b;

/* JADX INFO: loaded from: classes.dex */
public final class Q1 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final e5.c f9600a = e5.d.a();

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final MutableState f9601b = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(null, null, 2, null);

    public static Object b(Q1 q12, String str, C4.j jVar) {
        J1 j12 = J1.f9445a;
        q12.getClass();
        return q12.a(new O1(str, j12), jVar);
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object a(O1 o12, C4.c cVar) {
        P1 p12;
        e5.a aVar;
        O1 o13;
        Throwable th;
        e5.a aVar2;
        if (cVar instanceof P1) {
            p12 = (P1) cVar;
            int i6 = p12.f9591e;
            if ((i6 & Integer.MIN_VALUE) != 0) {
                p12.f9591e = i6 - Integer.MIN_VALUE;
            } else {
                p12 = new P1(this, cVar);
            }
        }
        Object obj = p12.f9589c;
        B4.a aVar3 = B4.a.f492a;
        int i7 = p12.f9591e;
        MutableState mutableState = this.f9601b;
        try {
            try {
                if (i7 == 0) {
                    AbstractC2467b.l(obj);
                    p12.f9587a = o12;
                    e5.c cVar2 = this.f9600a;
                    p12.f9588b = cVar2;
                    p12.f9591e = 1;
                    Object objE = cVar2.e(p12);
                    o13 = o12;
                    aVar = cVar2;
                    if (objE != aVar3) {
                    }
                    return aVar3;
                }
                if (i7 != 1) {
                    if (i7 != 2) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    e5.a aVar4 = p12.f9588b;
                    try {
                        AbstractC2467b.l(obj);
                        aVar2 = aVar4;
                        mutableState.setValue(null);
                        ((e5.c) aVar2).g(null);
                        return obj;
                    } catch (Throwable th2) {
                        th = th2;
                        mutableState.setValue(null);
                        throw th;
                    }
                }
                e5.a aVar5 = p12.f9588b;
                O1 o14 = p12.f9587a;
                AbstractC2467b.l(obj);
                aVar = aVar5;
                o13 = o14;
                p12.f9587a = o13;
                p12.f9588b = aVar;
                p12.f9591e = 2;
                C0772m c0772m = new C0772m(1, AbstractC0872a.V(p12));
                c0772m.s();
                mutableState.setValue(new N1(o13, c0772m));
                Object objR = c0772m.r();
                if (objR != aVar3) {
                    e5.a aVar6 = aVar;
                    obj = objR;
                    aVar2 = aVar6;
                    mutableState.setValue(null);
                    ((e5.c) aVar2).g(null);
                    return obj;
                }
                return aVar3;
            } catch (Throwable th3) {
                th = th3;
                mutableState.setValue(null);
                throw th;
            }
        } catch (Throwable th4) {
            ((e5.c) o12).g(null);
            throw th4;
        }
    }
}
