package O1;

import m3.AbstractC2467b;
import w4.C3137A;

/* JADX INFO: loaded from: classes.dex */
public final class B extends C4.j implements J4.c {

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

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

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

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

    @Override // C4.a
    public final A4.d create(A4.d dVar) {
        return new B(this.f5300c, dVar);
    }

    @Override // J4.c
    public final Object invoke(Object obj) {
        return ((B) create((A4.d) obj)).invokeSuspend(C3137A.f25453a);
    }

    @Override // C4.a
    public final Object invokeSuspend(Object obj) {
        Throwable th;
        Z s6;
        B4.a aVar = B4.a.f492a;
        int i6 = this.f5299b;
        O o6 = this.f5300c;
        try {
        } catch (Throwable th2) {
            Y yE = o6.e();
            this.f5298a = th2;
            this.f5299b = 2;
            Integer numA = yE.a();
            if (numA != aVar) {
                th = th2;
                obj = numA;
            }
            return aVar;
        }
        if (i6 == 0) {
            AbstractC2467b.l(obj);
            this.f5299b = 1;
            obj = O.d(o6, true, this);
            if (obj == aVar) {
                return aVar;
            }
        } else {
            if (i6 != 1) {
                if (i6 != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                th = this.f5298a;
                AbstractC2467b.l(obj);
                s6 = new S(th, ((Number) obj).intValue());
                return new w4.k(s6, Boolean.TRUE);
            }
            AbstractC2467b.l(obj);
        }
        s6 = (Z) obj;
        return new w4.k(s6, Boolean.TRUE);
    }
}
