package o;

import java.lang.reflect.InvocationTargetException;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public abstract class A extends C1375hJ implements InterfaceC0220Im, InterfaceC0065Cn {
    public final InterfaceC2747vn n;

    public A(InterfaceC2747vn interfaceC2747vn, boolean z) {
        super(z);
        U((TI) interfaceC2747vn.m(C0669Zu.K));
        this.n = interfaceC2747vn.M(this);
    }

    @Override // o.C1375hJ
    public final String F() {
        return getClass().getSimpleName().concat(" was cancelled");
    }

    @Override // o.C1375hJ
    public final void T(C2170pj c2170pj) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
        AbstractC1155f00.t(c2170pj, this.n);
    }

    @Override // o.C1375hJ
    public final void c0(Object obj) {
        if (!(obj instanceof C2075oj)) {
            l0(obj);
        } else {
            C2075oj c2075oj = (C2075oj) obj;
            k0(c2075oj.a, C2075oj.b.get(c2075oj) != 0);
        }
    }

    @Override // o.InterfaceC0220Im
    public final InterfaceC2747vn h() {
        return this.n;
    }

    @Override // o.InterfaceC0065Cn
    public final InterfaceC2747vn i() {
        return this.n;
    }

    public final void m0(int i, A a, SC sc) {
        Object objF;
        int iW = AbstractC2462sn.w(i);
        Oh0 oh0 = Oh0.a;
        if (iW == 0) {
            try {
                C1884mi0.I(oh0, AbstractC2539te.G(AbstractC2539te.u(a, this, sc)));
                return;
            } finally {
                resumeWith(new H20(th));
            }
        }
        if (iW != 1) {
            if (iW == 2) {
                AbstractC2539te.G(AbstractC2539te.u(a, this, sc)).resumeWith(oh0);
                return;
            }
            if (iW != 3) {
                throw new C2170pj();
            }
            try {
                InterfaceC2747vn interfaceC2747vn = this.n;
                Object objI = AbstractC1155f00.I(interfaceC2747vn, null);
                try {
                    if (sc instanceof AbstractC0728ad) {
                        AbstractC1692kh0.l(2, sc);
                        objF = sc.f(a, this);
                    } else {
                        objF = AbstractC2539te.Y(sc, a, this);
                    }
                    AbstractC1155f00.C(interfaceC2747vn, objI);
                    if (objF != EnumC0091Dn.l) {
                        resumeWith(objF);
                    }
                } catch (Throwable th) {
                    AbstractC1155f00.C(interfaceC2747vn, objI);
                    throw th;
                }
            } catch (Throwable th2) {
            }
        }
    }

    @Override // o.InterfaceC0220Im
    public final void resumeWith(Object obj) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
        Throwable thA = I20.a(obj);
        if (thA != null) {
            obj = new C2075oj(thA, false);
        }
        Object objY = Y(obj);
        if (objY == AbstractC2841wm0.d) {
            return;
        }
        x(objY);
    }

    public void l0(Object obj) {
    }

    public void k0(Throwable th, boolean z) {
    }
}
