package W;

import a.AbstractC0212a;
import d4.C0545d;
import d4.C0550i;
import i4.EnumC0643a;
import j4.AbstractC0806h;

/* JADX INFO: loaded from: classes.dex */
public final class C extends AbstractC0806h implements q4.l {

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public Throwable f3016k;

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

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

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C(O o5, h4.c cVar) {
        super(1, cVar);
        this.f3018m = o5;
    }

    @Override // j4.AbstractC0799a
    public final h4.c create(h4.c cVar) {
        return new C(this.f3018m, cVar);
    }

    @Override // q4.l
    public final Object invoke(Object obj) {
        return ((C) create((h4.c) obj)).invokeSuspend(C0550i.f6143a);
    }

    @Override // j4.AbstractC0799a
    public final Object invokeSuspend(Object obj) throws Throwable {
        Throwable th;
        m0 e0Var;
        EnumC0643a enumC0643a = EnumC0643a.f6670k;
        int i = this.f3017l;
        O o5 = this.f3018m;
        try {
        } catch (Throwable th2) {
            l0 l0VarH = o5.h();
            this.f3016k = th2;
            this.f3017l = 2;
            Integer numA = l0VarH.a();
            if (numA != enumC0643a) {
                th = th2;
                obj = numA;
            }
            return enumC0643a;
        }
        if (i == 0) {
            AbstractC0212a.H(obj);
            this.f3017l = 1;
            obj = O.g(o5, true, this);
            if (obj == enumC0643a) {
                return enumC0643a;
            }
        } else {
            if (i != 1) {
                if (i != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                th = this.f3016k;
                AbstractC0212a.H(obj);
                e0Var = new e0(th, ((Number) obj).intValue());
                return new C0545d(e0Var, Boolean.TRUE);
            }
            AbstractC0212a.H(obj);
        }
        e0Var = (m0) obj;
        return new C0545d(e0Var, Boolean.TRUE);
    }
}
