package kotlinx.coroutines; import kotlin.Unit; import kotlin.coroutines.Continuation; import kotlin.coroutines.ContinuationInterceptor; import kotlin.coroutines.CoroutineContext; import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt; import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt; import kotlin.coroutines.jvm.internal.DebugProbesKt; /* loaded from: classes5.dex */ public abstract class DelayKt { /* JADX WARN: Removed duplicated region for block: B:15:0x0031 */ /* JADX WARN: Removed duplicated region for block: B:8:0x0023 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public static final java.lang.Object awaitCancellation(kotlin.coroutines.Continuation r4) { /* boolean r0 = r4 instanceof kotlinx.coroutines.DelayKt$awaitCancellation$1 if (r0 == 0) goto L13 r0 = r4 kotlinx.coroutines.DelayKt$awaitCancellation$1 r0 = (kotlinx.coroutines.DelayKt$awaitCancellation$1) r0 int r1 = r0.label r2 = -2147483648(0xffffffff80000000, float:-0.0) r3 = r1 & r2 if (r3 == 0) goto L13 int r1 = r1 - r2 r0.label = r1 goto L18 L13: kotlinx.coroutines.DelayKt$awaitCancellation$1 r0 = new kotlinx.coroutines.DelayKt$awaitCancellation$1 r0.(r4) L18: java.lang.Object r4 = r0.result java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED() int r2 = r0.label r3 = 1 if (r2 == 0) goto L31 if (r2 == r3) goto L2d java.lang.IllegalStateException r4 = new java.lang.IllegalStateException java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine" r4.(r0) throw r4 L2d: kotlin.ResultKt.throwOnFailure(r4) goto L52 L31: kotlin.ResultKt.throwOnFailure(r4) r0.label = r3 kotlinx.coroutines.CancellableContinuationImpl r4 = new kotlinx.coroutines.CancellableContinuationImpl kotlin.coroutines.Continuation r2 = kotlin.coroutines.intrinsics.IntrinsicsKt.intercepted(r0) r4.(r2, r3) r4.initCancellability() java.lang.Object r4 = r4.getResult() java.lang.Object r2 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED() if (r4 != r2) goto L4f kotlin.coroutines.jvm.internal.DebugProbesKt.probeCoroutineSuspended(r0) L4f: if (r4 != r1) goto L52 return r1 L52: kotlin.KotlinNothingValueException r4 = new kotlin.KotlinNothingValueException r4.() throw r4 */ throw new UnsupportedOperationException("Method not decompiled: kotlinx.coroutines.DelayKt.awaitCancellation(kotlin.coroutines.Continuation):java.lang.Object"); } public static final Object delay(long j, Continuation continuation) { Continuation intercepted; Object coroutine_suspended; Object coroutine_suspended2; if (j <= 0) { return Unit.INSTANCE; } intercepted = IntrinsicsKt__IntrinsicsJvmKt.intercepted(continuation); CancellableContinuationImpl cancellableContinuationImpl = new CancellableContinuationImpl(intercepted, 1); cancellableContinuationImpl.initCancellability(); if (j < Long.MAX_VALUE) { getDelay(cancellableContinuationImpl.getContext()).mo4149scheduleResumeAfterDelay(j, cancellableContinuationImpl); } Object result = cancellableContinuationImpl.getResult(); coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED(); if (result == coroutine_suspended) { DebugProbesKt.probeCoroutineSuspended(continuation); } coroutine_suspended2 = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED(); return result == coroutine_suspended2 ? result : Unit.INSTANCE; } public static final Delay getDelay(CoroutineContext coroutineContext) { CoroutineContext.Element element = coroutineContext.get(ContinuationInterceptor.Key); Delay delay = element instanceof Delay ? (Delay) element : null; return delay == null ? DefaultExecutorKt.getDefaultDelay() : delay; } }