package T1;

import O1.A;
import W.K;
import W.N;
import W.U;
import W.V;
import b5.C0543d;
import c7.InterfaceC0597e;
import com.google.android.gms.internal.measurement.C1;
import n4.u0;

/* JADX INFO: loaded from: classes.dex */
public final class c extends G6.i implements O6.l {

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

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

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

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

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

    @Override // O6.l
    public final Object b(Object obj) {
        E6.d dVar = (E6.d) obj;
        switch (this.f6492u) {
            case u0.f15495q /* 0 */:
                return new c((A) this.f6494w, (c) this.f6495x, dVar, 0).p(A6.n.f457a);
            case 1:
                return new c((K) this.f6495x, dVar).p(A6.n.f457a);
            case 2:
                return new c((C0543d) this.f6494w, this.f6495x, dVar, 2).p(A6.n.f457a);
            default:
                return new c((InterfaceC0597e) this.f6494w, (P6.m) this.f6495x, dVar, 3).p(A6.n.f457a);
        }
    }

    /* JADX WARN: Type inference failed for: r1v10, types: [java.lang.Object, java.util.List] */
    @Override // G6.a
    public final Object p(Object obj) throws Throwable {
        Throwable th;
        V n8;
        switch (this.f6492u) {
            case u0.f15495q /* 0 */:
                F6.a aVar = F6.a.f2580q;
                int i = this.f6493v;
                if (i != 0) {
                    if (i != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    C1.N(obj);
                    return obj;
                }
                C1.N(obj);
                c cVar = (c) this.f6495x;
                A a3 = (A) this.f6494w;
                b bVar = new b(null, a3, cVar);
                this.f6493v = 1;
                Object objI = a3.i(false, bVar, this);
                return objI == aVar ? aVar : objI;
            case 1:
                F6.a aVar2 = F6.a.f2580q;
                int i5 = this.f6493v;
                K k8 = (K) this.f6495x;
                try {
                } catch (Throwable th2) {
                    U uH = k8.h();
                    this.f6494w = th2;
                    this.f6493v = 2;
                    Integer numA = uH.a();
                    if (numA == aVar2) {
                        return aVar2;
                    }
                    th = th2;
                    obj = numA;
                }
                if (i5 == 0) {
                    C1.N(obj);
                    this.f6493v = 1;
                    obj = K.g(k8, true, this);
                    if (obj == aVar2) {
                        return aVar2;
                    }
                } else {
                    if (i5 != 1) {
                        if (i5 != 2) {
                            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                        }
                        th = (Throwable) this.f6494w;
                        C1.N(obj);
                        n8 = new N(th, ((Number) obj).intValue());
                        return new A6.h(n8, Boolean.TRUE);
                    }
                    C1.N(obj);
                }
                n8 = (V) obj;
                return new A6.h(n8, Boolean.TRUE);
            case 2:
                F6.a aVar3 = F6.a.f2580q;
                int i8 = this.f6493v;
                if (i8 == 0) {
                    C1.N(obj);
                    this.f6493v = 1;
                    if (C0543d.a((C0543d) this.f6494w, this.f6495x, this) == aVar3) {
                        return aVar3;
                    }
                } else {
                    if (i8 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    C1.N(obj);
                }
                return A6.n.f457a;
            default:
                F6.a aVar4 = F6.a.f2580q;
                int i9 = this.f6493v;
                P6.m mVar = (P6.m) this.f6495x;
                if (i9 == 0) {
                    C1.N(obj);
                    B3.f fVar = d7.c.f12346b;
                    Object obj2 = mVar.f5535q;
                    if (obj2 == fVar) {
                        obj2 = null;
                    }
                    this.f6493v = 1;
                    if (((InterfaceC0597e) this.f6494w).l(obj2, this) == aVar4) {
                        return aVar4;
                    }
                } else {
                    if (i9 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    C1.N(obj);
                }
                mVar.f5535q = null;
                return A6.n.f457a;
        }
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public /* synthetic */ c(Object obj, Object obj2, E6.d dVar, int i) {
        super(1, dVar);
        this.f6492u = i;
        this.f6494w = obj;
        this.f6495x = obj2;
    }
}
