package defpackage;

import java.util.concurrent.CancellationException;
import kotlinx.coroutines.DispatchException;

/* renamed from: ᵷᵷˆᵰ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public abstract class AbstractC4927 extends AbstractRunnableC2488 {

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public int f18326;

    public AbstractC4927(int i) {
        super(false, 0L);
        this.f18326 = i;
    }

    @Override // java.lang.Runnable
    public final void run() {
        try {
            C2869 c2869 = (C2869) mo7010();
            AbstractC1989 abstractC1989 = c2869.f11120;
            Object obj = c2869.f11118;
            InterfaceC2262 interfaceC2262Mo2135 = abstractC1989.mo2135();
            Object objM6058 = AbstractC2338.m6058(interfaceC2262Mo2135, obj);
            InterfaceC3506 interfaceC3506 = null;
            C0189 c0189M2154 = objM6058 != AbstractC2338.f9165 ? AbstractC0494.m2154(abstractC1989, interfaceC2262Mo2135, objM6058) : null;
            try {
                InterfaceC2262 interfaceC2262Mo21352 = abstractC1989.mo2135();
                Object objMo7014 = mo7014();
                Throwable thMo9397 = mo9397(objMo7014);
                if (thMo9397 == null) {
                    int i = this.f18326;
                    boolean z = true;
                    if (i != 1 && i != 2) {
                        z = false;
                    }
                    if (z) {
                        interfaceC3506 = (InterfaceC3506) interfaceC2262Mo21352.mo1764(ʾᵠᵦ.ᵾᵬ);
                    }
                }
                if (interfaceC3506 != null && !interfaceC3506.mo2236()) {
                    CancellationException cancellationExceptionMo2238 = interfaceC3506.mo2238();
                    mo9408(cancellationExceptionMo2238);
                    abstractC1989.mo2134(new C2952(cancellationExceptionMo2238));
                } else if (thMo9397 != null) {
                    abstractC1989.mo2134(new C2952(thMo9397));
                } else {
                    abstractC1989.mo2134(mo9412(objMo7014));
                }
                if (c0189M2154 == null || c0189M2154.m1420()) {
                    AbstractC2338.m6057(interfaceC2262Mo2135, objM6058);
                }
            } catch (Throwable th) {
                if (c0189M2154 == null || c0189M2154.m1420()) {
                    AbstractC2338.m6057(interfaceC2262Mo2135, objM6058);
                }
                throw th;
            }
        } catch (DispatchException e) {
            ᵭʝʜ.ᵸʓᵠ(mo7010().mo2135(), e.f1143);
        } catch (Throwable th2) {
            m10364(th2);
        }
    }

    /* renamed from: ˏˋٴ */
    public Throwable mo9397(Object obj) {
        C1411 c1411 = obj instanceof C1411 ? (C1411) obj : null;
        if (c1411 != null) {
            return c1411.f5777;
        }
        return null;
    }

    /* renamed from: ˏᵙ */
    public abstract InterfaceC4943 mo7010();

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final void m10364(Throwable th) {
        ᵭʝʜ.ᵸʓᵠ(mo7010().mo2135(), new C0840("Fatal exception in coroutines machinery for " + this + ". Please read KDoc to 'handleFatalException' method and report this incident to maintainers", th));
    }

    /* renamed from: ᵴᵳ */
    public void mo9408(CancellationException cancellationException) {
    }

    /* renamed from: ᵶᵷᵕ */
    public abstract Object mo7014();

    /* renamed from: ᵹᵝᵶ */
    public Object mo9412(Object obj) {
        return obj;
    }
}
