package s.a; import c.q.a.k.a; import d0.k; import d0.l; import d0.w.e; import d0.w.g.c; import d0.w.h.a.g; import d0.z.d.e0; import kotlin.NoWhenBranchMatchedException; import kotlin.coroutines.Continuation; import kotlin.coroutines.CoroutineContext; import kotlin.jvm.functions.Function2; import kotlinx.coroutines.CoroutineScope; import kotlinx.coroutines.CoroutineStart; import kotlinx.coroutines.Job; /* compiled from: AbstractCoroutine.kt */ public abstract class b extends g1 implements Job, Continuation, CoroutineScope { public final CoroutineContext j; public final CoroutineContext k; public b(CoroutineContext coroutineContext, boolean z2) { super(z2); this.k = coroutineContext; this.j = coroutineContext.plus(this); } @Override // s.a.g1 public final void I(Throwable th) { a.x(this.j, th); } @Override // s.a.g1 public String N() { boolean z2 = y.a; return super.N(); } @Override // s.a.g1 public final void Q(Object obj) { if (obj instanceof v) { v vVar = (v) obj; Throwable th = vVar.b; int i = vVar._handled; } } @Override // s.a.g1 public final void R() { Z(); } public void X(Object obj) { m(obj); } public final void Y() { J((Job) this.k.get(Job.h)); } public void Z() { } @Override // s.a.g1, kotlinx.coroutines.Job public boolean a() { return super.a(); } /* JADX INFO: finally extract failed */ public final void a0(CoroutineStart coroutineStart, R r, Function2, ? extends Object> function2) { Y(); int ordinal = coroutineStart.ordinal(); if (ordinal == 0) { a.S(function2, r, this, null, 4); } else if (ordinal == 1) { } else { if (ordinal == 2) { e.startCoroutine(function2, r, this); } else if (ordinal == 3) { Continuation probeCoroutineCreated = g.probeCoroutineCreated(this); try { CoroutineContext coroutineContext = this.j; Object b = s.a.a.a.b(coroutineContext, null); if (function2 != null) { try { Object invoke = ((Function2) e0.beforeCheckcastToFunctionOfArity(function2, 2)).invoke(r, probeCoroutineCreated); s.a.a.a.a(coroutineContext, b); if (invoke != c.getCOROUTINE_SUSPENDED()) { k.a aVar = k.i; probeCoroutineCreated.resumeWith(k.m75constructorimpl(invoke)); } } catch (Throwable th) { s.a.a.a.a(coroutineContext, b); throw th; } } else { throw new NullPointerException("null cannot be cast to non-null type (R, kotlin.coroutines.Continuation) -> kotlin.Any?"); } } catch (Throwable th2) { k.a aVar2 = k.i; probeCoroutineCreated.resumeWith(k.m75constructorimpl(l.createFailure(th2))); } } else { throw new NoWhenBranchMatchedException(); } } } @Override // kotlin.coroutines.Continuation public final CoroutineContext getContext() { return this.j; } @Override // kotlinx.coroutines.CoroutineScope public CoroutineContext getCoroutineContext() { return this.j; } @Override // s.a.g1 public String q() { return getClass().getSimpleName() + " was cancelled"; } @Override // kotlin.coroutines.Continuation public final void resumeWith(Object obj) { Object L = L(a.f0(obj, null)); if (L != h1.b) { X(L); } } }