package w8; import c9.p; import d9.t; import kotlin.coroutines.jvm.internal.h; import kotlin.coroutines.jvm.internal.j; import s8.o; import v8.g; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes2.dex */ public abstract class c { public static final class a extends j { /* renamed from: a, reason: collision with root package name */ private int f15202a; /* renamed from: b, reason: collision with root package name */ final /* synthetic */ p f15203b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ Object f15204c; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public a(v8.d dVar, p pVar, Object obj) { super(dVar); this.f15203b = pVar; this.f15204c = obj; d9.j.c(dVar, "null cannot be cast to non-null type kotlin.coroutines.Continuation"); } @Override // kotlin.coroutines.jvm.internal.a protected Object invokeSuspend(Object obj) { int i10 = this.f15202a; if (i10 == 0) { this.f15202a = 1; o.b(obj); d9.j.c(this.f15203b, "null cannot be cast to non-null type kotlin.Function2, kotlin.Any?>"); return ((p) t.a(this.f15203b, 2)).invoke(this.f15204c, this); } if (i10 != 1) { throw new IllegalStateException("This coroutine had already completed".toString()); } this.f15202a = 2; o.b(obj); return obj; } } public static final class b extends kotlin.coroutines.jvm.internal.d { /* renamed from: a, reason: collision with root package name */ private int f15205a; /* renamed from: b, reason: collision with root package name */ final /* synthetic */ p f15206b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ Object f15207c; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public b(v8.d dVar, g gVar, p pVar, Object obj) { super(dVar, gVar); this.f15206b = pVar; this.f15207c = obj; d9.j.c(dVar, "null cannot be cast to non-null type kotlin.coroutines.Continuation"); } @Override // kotlin.coroutines.jvm.internal.a protected Object invokeSuspend(Object obj) { int i10 = this.f15205a; if (i10 == 0) { this.f15205a = 1; o.b(obj); d9.j.c(this.f15206b, "null cannot be cast to non-null type kotlin.Function2, kotlin.Any?>"); return ((p) t.a(this.f15206b, 2)).invoke(this.f15207c, this); } if (i10 != 1) { throw new IllegalStateException("This coroutine had already completed".toString()); } this.f15205a = 2; o.b(obj); return obj; } } /* JADX WARN: Multi-variable type inference failed */ public static v8.d a(p pVar, Object obj, v8.d dVar) { d9.j.e(pVar, ""); d9.j.e(dVar, "completion"); v8.d a10 = h.a(dVar); if (pVar instanceof kotlin.coroutines.jvm.internal.a) { return ((kotlin.coroutines.jvm.internal.a) pVar).create(obj, a10); } g context = a10.getContext(); return context == v8.h.f14943a ? new a(a10, pVar, obj) : new b(a10, context, pVar, obj); } public static v8.d b(v8.d dVar) { v8.d intercepted; d9.j.e(dVar, ""); kotlin.coroutines.jvm.internal.d dVar2 = dVar instanceof kotlin.coroutines.jvm.internal.d ? (kotlin.coroutines.jvm.internal.d) dVar : null; return (dVar2 == null || (intercepted = dVar2.intercepted()) == null) ? dVar : intercepted; } }