package retrofit2; import java.lang.reflect.Method; import kotlin.KotlinNullPointerException; import o.C13395fZS; import o.C14911gbm; import o.C14957gcv; import o.EnumC14910gbl; import o.InterfaceC14907gbi; import o.InterfaceC15027gev; import o.geA; /* loaded from: classes.dex */ public final class KotlinExtensions { public static final /* synthetic */ T create(Retrofit retrofit) { C14957gcv.b((Object) retrofit, ""); C14957gcv.a(); return (T) retrofit.create(Object.class); } public static final Object await(Call call, InterfaceC14907gbi interfaceC14907gbi) { geA gea = new geA(C14911gbm.a(interfaceC14907gbi), 1); final geA gea2 = gea; gea2.e(new KotlinExtensions$await$$inlined$suspendCancellableCoroutine$lambda$1(call)); call.enqueue(new Callback(gea2) { // from class: retrofit2.KotlinExtensions$await$2$2 final InterfaceC15027gev $continuation; /* JADX INFO: Access modifiers changed from: package-private */ { this.$continuation = gea2; } @Override // retrofit2.Callback public final void onResponse(Call call2, Response response) { C14957gcv.b((Object) call2, ""); C14957gcv.b((Object) response, ""); if (response.isSuccessful()) { T body = response.body(); if (body == null) { Object tag = call2.request().tag(Invocation.class); if (tag == null) { C14957gcv.b(); } C14957gcv.a(tag, ""); Method method = ((Invocation) tag).method(); StringBuilder sb = new StringBuilder("Response from "); C14957gcv.a(method, ""); Class declaringClass = method.getDeclaringClass(); C14957gcv.a(declaringClass, ""); sb.append(declaringClass.getName()); sb.append('.'); sb.append(method.getName()); sb.append(" was null but response body type was declared as non-null"); KotlinNullPointerException kotlinNullPointerException = new KotlinNullPointerException(sb.toString()); InterfaceC15027gev interfaceC15027gev = this.$continuation; C13395fZS.IeS ieS = C13395fZS.b; KotlinNullPointerException kotlinNullPointerException2 = kotlinNullPointerException; C14957gcv.e(kotlinNullPointerException2, ""); interfaceC15027gev.resumeWith(C13395fZS.a(new C13395fZS.LWm(kotlinNullPointerException2))); return; } InterfaceC15027gev interfaceC15027gev2 = this.$continuation; C13395fZS.IeS ieS2 = C13395fZS.b; interfaceC15027gev2.resumeWith(C13395fZS.a(body)); return; } InterfaceC15027gev interfaceC15027gev3 = this.$continuation; HttpException httpException = new HttpException(response); C13395fZS.IeS ieS3 = C13395fZS.b; C14957gcv.e(httpException, ""); interfaceC15027gev3.resumeWith(C13395fZS.a(new C13395fZS.LWm(httpException))); } @Override // retrofit2.Callback public final void onFailure(Call call2, Throwable th) { C14957gcv.b((Object) call2, ""); C14957gcv.b((Object) th, ""); InterfaceC15027gev interfaceC15027gev = this.$continuation; C13395fZS.IeS ieS = C13395fZS.b; C14957gcv.e(th, ""); interfaceC15027gev.resumeWith(C13395fZS.a(new C13395fZS.LWm(th))); } }); Object e = gea.e(); if (e == EnumC14910gbl.COROUTINE_SUSPENDED) { C14957gcv.e(interfaceC14907gbi, ""); } return e; } public static final Object awaitNullable(Call call, InterfaceC14907gbi interfaceC14907gbi) { geA gea = new geA(C14911gbm.a(interfaceC14907gbi), 1); final geA gea2 = gea; gea2.e(new KotlinExtensions$await$$inlined$suspendCancellableCoroutine$lambda$2(call)); call.enqueue(new Callback(gea2) { // from class: retrofit2.KotlinExtensions$await$4$2 final InterfaceC15027gev $continuation; /* JADX INFO: Access modifiers changed from: package-private */ { this.$continuation = gea2; } @Override // retrofit2.Callback public final void onResponse(Call call2, Response response) { C14957gcv.b((Object) call2, ""); C14957gcv.b((Object) response, ""); if (response.isSuccessful()) { InterfaceC15027gev interfaceC15027gev = this.$continuation; T body = response.body(); C13395fZS.IeS ieS = C13395fZS.b; interfaceC15027gev.resumeWith(C13395fZS.a(body)); return; } InterfaceC15027gev interfaceC15027gev2 = this.$continuation; HttpException httpException = new HttpException(response); C13395fZS.IeS ieS2 = C13395fZS.b; C14957gcv.e(httpException, ""); interfaceC15027gev2.resumeWith(C13395fZS.a(new C13395fZS.LWm(httpException))); } @Override // retrofit2.Callback public final void onFailure(Call call2, Throwable th) { C14957gcv.b((Object) call2, ""); C14957gcv.b((Object) th, ""); InterfaceC15027gev interfaceC15027gev = this.$continuation; C13395fZS.IeS ieS = C13395fZS.b; C14957gcv.e(th, ""); interfaceC15027gev.resumeWith(C13395fZS.a(new C13395fZS.LWm(th))); } }); Object e = gea.e(); if (e == EnumC14910gbl.COROUTINE_SUSPENDED) { C14957gcv.e(interfaceC14907gbi, ""); } return e; } public static final Object awaitResponse(Call call, InterfaceC14907gbi> interfaceC14907gbi) { geA gea = new geA(C14911gbm.a(interfaceC14907gbi), 1); final geA gea2 = gea; gea2.e(new KotlinExtensions$awaitResponse$$inlined$suspendCancellableCoroutine$lambda$1(call)); call.enqueue(new Callback(gea2) { // from class: retrofit2.KotlinExtensions$awaitResponse$2$2 final InterfaceC15027gev $continuation; /* JADX INFO: Access modifiers changed from: package-private */ { this.$continuation = gea2; } @Override // retrofit2.Callback public final void onResponse(Call call2, Response response) { C14957gcv.b((Object) call2, ""); C14957gcv.b((Object) response, ""); InterfaceC15027gev interfaceC15027gev = this.$continuation; C13395fZS.IeS ieS = C13395fZS.b; interfaceC15027gev.resumeWith(C13395fZS.a(response)); } @Override // retrofit2.Callback public final void onFailure(Call call2, Throwable th) { C14957gcv.b((Object) call2, ""); C14957gcv.b((Object) th, ""); InterfaceC15027gev interfaceC15027gev = this.$continuation; C13395fZS.IeS ieS = C13395fZS.b; C14957gcv.e(th, ""); interfaceC15027gev.resumeWith(C13395fZS.a(new C13395fZS.LWm(th))); } }); Object e = gea.e(); if (e == EnumC14910gbl.COROUTINE_SUSPENDED) { C14957gcv.e(interfaceC14907gbi, ""); } return e; } /* JADX WARN: Removed duplicated region for block: B:18:0x003a */ /* JADX WARN: Removed duplicated region for block: B:8:0x0022 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public static final java.lang.Object suspendAndThrow(final java.lang.Exception r4, o.InterfaceC14907gbi r5) { /* boolean r0 = r5 instanceof retrofit2.KotlinExtensions$suspendAndThrow$1 if (r0 == 0) goto L14 r0 = r5 retrofit2.KotlinExtensions$suspendAndThrow$1 r0 = (retrofit2.KotlinExtensions$suspendAndThrow$1) r0 int r1 = r0.label r2 = -2147483648(0xffffffff80000000, float:-0.0) r1 = r1 & r2 if (r1 == 0) goto L14 int r5 = r0.label int r5 = r5 + r2 r0.label = r5 goto L19 L14: retrofit2.KotlinExtensions$suspendAndThrow$1 r0 = new retrofit2.KotlinExtensions$suspendAndThrow$1 r0.(r5) L19: java.lang.Object r5 = r0.result o.gbl r1 = o.EnumC14910gbl.COROUTINE_SUSPENDED int r2 = r0.label r3 = 1 if (r2 == 0) goto L3a if (r2 != r3) goto L32 java.lang.Object r4 = r0.L$0 java.lang.Exception r4 = (java.lang.Exception) r4 boolean r4 = r5 instanceof o.C13395fZS.LWm if (r4 != 0) goto L2d goto L64 L2d: o.fZS$LWm r5 = (o.C13395fZS.LWm) r5 java.lang.Throwable r4 = r5.d throw r4 L32: java.lang.IllegalStateException r4 = new java.lang.IllegalStateException java.lang.String r5 = "call to 'resume' before 'invoke' with coroutine" r4.(r5) throw r4 L3a: boolean r2 = r5 instanceof o.C13395fZS.LWm if (r2 != 0) goto L67 r0.L$0 = r4 r0.label = r3 o.gbi r0 = (o.InterfaceC14907gbi) r0 o.geU r5 = o.C15055gfo.e() o.gbn r2 = r0.getContext() retrofit2.KotlinExtensions$suspendAndThrow$$inlined$suspendCoroutineUninterceptedOrReturn$lambda$1 r3 = new retrofit2.KotlinExtensions$suspendAndThrow$$inlined$suspendCoroutineUninterceptedOrReturn$lambda$1 r3.(r0, r4) java.lang.Runnable r3 = (java.lang.Runnable) r3 r5.d(r2, r3) o.gbl r4 = o.EnumC14910gbl.COROUTINE_SUSPENDED o.gbl r5 = o.EnumC14910gbl.COROUTINE_SUSPENDED if (r4 != r5) goto L61 java.lang.String r5 = "" o.C14957gcv.e(r0, r5) L61: if (r4 != r1) goto L64 return r1 L64: o.gag r4 = o.C14866gag.c return r4 L67: o.fZS$LWm r5 = (o.C13395fZS.LWm) r5 java.lang.Throwable r4 = r5.d throw r4 */ throw new UnsupportedOperationException("Method not decompiled: retrofit2.KotlinExtensions.suspendAndThrow(java.lang.Exception, o.gbi):java.lang.Object"); } }