package f5;

import Z6.AbstractC0385z;
import Z6.C0369i;
import Z6.InterfaceC0382w;
import b5.C0543d;
import com.google.android.gms.internal.measurement.C1;
import java.util.List;
import java.util.concurrent.RejectedExecutionException;

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

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

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public final /* synthetic */ C0926C f12706v;

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

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C0924A(C0926C c0926c, List list, E6.d dVar) {
        super(2, dVar);
        this.f12706v = c0926c;
        this.f12707w = list;
    }

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

    /* JADX WARN: Type inference failed for: r0v0, types: [java.lang.Object, java.util.List] */
    @Override // G6.a
    public final E6.d m(E6.d dVar, Object obj) {
        return new C0924A(this.f12706v, this.f12707w, dVar);
    }

    @Override // G6.a
    public final Object p(Object obj) throws Throwable {
        Object objC;
        O1.F f3;
        F6.a aVar = F6.a.f2580q;
        int i = this.f12705u;
        A6.n nVar = A6.n.f457a;
        if (i == 0) {
            C1.N(obj);
            C0543d c0543d = this.f12706v.f12717e;
            this.f12705u = 1;
            T1.c cVar = new T1.c(c0543d, this.f12707w, null, 2);
            O1.A a3 = c0543d.f9207a;
            if (a3.g()) {
                O1.D d8 = new O1.D(null, new T1.c(a3, cVar, null, 0));
                E6.i iVar = this.f3016r;
                P6.g.b(iVar);
                O1.E e8 = (O1.E) iVar.K(O1.E.f4936s);
                E6.f fVar = e8 != null ? e8.f4937q : null;
                if (fVar != null) {
                    objC = AbstractC0385z.C(fVar, d8, this);
                } else {
                    P6.g.b(iVar);
                    C0369i c0369i = new C0369i(1, C1.A(this));
                    c0369i.v();
                    try {
                        f3 = a3.f4917d;
                    } catch (RejectedExecutionException e9) {
                        c0369i.q(new IllegalStateException("Unable to acquire a thread to perform the database transaction.", e9));
                    }
                    if (f3 == null) {
                        P6.g.h("internalTransactionExecutor");
                        throw null;
                    }
                    f3.execute(new O1.C(iVar, c0369i, a3, d8, 0));
                    objC = c0369i.u();
                }
            } else {
                e7.c cVar2 = a3.f4914a;
                if (cVar2 == null) {
                    P6.g.h("coroutineScope");
                    throw null;
                }
                objC = AbstractC0385z.C(cVar2.f12542q, new T1.f(null, a3, cVar), this);
            }
            if (objC != aVar) {
                objC = nVar;
            }
            if (objC == aVar) {
                return aVar;
            }
        } else {
            if (i != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            C1.N(obj);
        }
        return new X4.b(nVar);
    }
}
