content: package kotlinx.coroutines;
  
  import kotlin.Metadata;
  import kotlin.Unit;
  import kotlin.coroutines.Continuation;
  import kotlin.coroutines.ContinuationInterceptor;
  import kotlin.coroutines.CoroutineContext;
  import kotlin.coroutines.intrinsics.IntrinsicsKt;
  import kotlin.coroutines.jvm.internal.DebugProbesKt;
  import kotlin.ranges.RangesKt;
  import kotlin.time.Duration;
  
  @Metadata(d1 = {"\u0000*\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0001\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\u001a\u0011\u0010\u0005\u001a\u00020\u0006H@ø\u0001\u0000¢\u0006\u0002\u0010\u0007\u001a\u0019\u0010\u0000\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\nH@ø\u0001\u0000¢\u0006\u0002\u0010\u000b\u001a!\u0010\u0000\u001a\u00020\b2\u0006\u0010\f\u001a\u00020\rH@ø\u0001\u0000ø\u0001\u0000ø\u0001\u0001¢\u0006\u0004\b\u000e\u0010\u000b\u001a\u0019\u0010\u000f\u001a\u00020\n*\u00020\rH\u0000ø\u0001\u0000ø\u0001\u0001¢\u0006\u0004\b\u0010\u0010\u0011\"\u0018\u0010\u0000\u001a\u00020\u0001*\u00020\u00028@X\u0004¢\u0006\u0006\u001a\u0004\b\u0003\u0010\u0004\u0002\u000b\n\u0002\b\u0019\n\u0005\b¡\u001e0\u0001¨\u0006\u0012"}, d2 = {"delay", "Lkotlinx/coroutines/Delay;", "Lkotlin/coroutines/CoroutineContext;", "getDelay", "(Lkotlin/coroutines/CoroutineContext;)Lkotlinx/coroutines/Delay;", "awaitCancellation", "", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "", "timeMillis", "", "(JLkotlin/coroutines/Continuation;)Ljava/lang/Object;", "duration", "Lkotlin/time/Duration;", "delay-VtjQ1oo", "toDelayMillis", "toDelayMillis-LRDsOJo", "(J)J", "kotlinx-coroutines-core"}, k = 2, mv = {1, 6, 0}, xi = 48)
  /* compiled from: Delay.kt */
  public final class DelayKt {
      /* JADX WARNING: Removed duplicated region for block: B:10:0x002d  */
      /* JADX WARNING: Removed duplicated region for block: B:11:0x0032  */
      /* JADX WARNING: Removed duplicated region for block: B:8:0x0025  */
      /* Code decompiled incorrectly, please refer to instructions dump. */
      public static final java.lang.Object awaitCancellation(kotlin.coroutines.Continuation<?> r8) {
          /*
              boolean r0 = r8 instanceof kotlinx.coroutines.DelayKt$awaitCancellation$1
              if (r0 == 0) goto L_0x0014
              r0 = r8
              kotlinx.coroutines.DelayKt$awaitCancellation$1 r0 = (kotlinx.coroutines.DelayKt$awaitCancellation$1) r0
              int r1 = r0.label
              r2 = -2147483648(0xffffffff80000000, float:-0.0)
              r1 = r1 & r2
              if (r1 == 0) goto L_0x0014
              int r8 = r0.label
              int r8 = r8 - r2
              r0.label = r8
              goto L_0x0019
          L_0x0014:
              kotlinx.coroutines.DelayKt$awaitCancellation$1 r0 = new kotlinx.coroutines.DelayKt$awaitCancellation$1
              r0.<init>(r8)
          L_0x0019:
              r8 = r0
              java.lang.Object r0 = r8.result
              java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
              int r2 = r8.label
              switch(r2) {
                  case 0: goto L_0x0032;
                  case 1: goto L_0x002d;
                  default: goto L_0x0025;
              }
          L_0x0025:
              java.lang.IllegalStateException r8 = new java.lang.IllegalStateException
              java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
              r8.<init>(r0)
              throw r8
          L_0x002d:
              r1 = 0
              kotlin.ResultKt.throwOnFailure(r0)
              goto L_0x0063
          L_0x0032:
              kotlin.ResultKt.throwOnFailure(r0)
              r2 = 0
              r3 = 1
              r8.label = r3
              r4 = r8
              kotlin.coroutines.Continuation r4 = (kotlin.coroutines.Continuation) r4
              r5 = 0
              kotlinx.coroutines.CancellableContinuationImpl r6 = new kotlinx.coroutines.CancellableContinuationImpl
              kotlin.coroutines.Continuation r7 = kotlin.coroutines.intrinsics.IntrinsicsKt.intercepted(r4)
              r6.<init>(r7, r3)
              r3 = r6
              r3.initCancellability()
              r6 = r3
              kotlinx.coroutines.CancellableContinuation r6 = (kotlinx.coroutines.CancellableContinuation) r6
              r6 = 0
              java.lang.Object r3 = r3.getResult()
              java.lang.Object r4 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
              if (r3 != r4) goto L_0x005f
              r4 = r8
              kotlin.coroutines.Continuation r4 = (kotlin.coroutines.Continuation) r4
              kotlin.coroutines.jvm.internal.DebugProbesKt.probeCoroutineSuspended(r4)
          L_0x005f:
              if (r3 != r1) goto L_0x0062
              return r1
          L_0x0062:
              r1 = r2
          L_0x0063:
              kotlin.KotlinNothingValueException r1 = new kotlin.KotlinNothingValueException
              r1.<init>()
              throw r1
          */
          throw new UnsupportedOperationException("Method not decompiled: kotlinx.coroutines.DelayKt.awaitCancellation(kotlin.coroutines.Continuation):java.lang.Object");
      }
  
      public static final Object delay(long timeMillis, Continuation<? super Unit> $completion) {
          if (timeMillis <= 0) {
              return Unit.INSTANCE;
          }
          CancellableContinuationImpl cancellableContinuationImpl = new CancellableContinuationImpl(IntrinsicsKt.intercepted($completion), 1);
          cancellableContinuationImpl.initCancellability();
          CancellableContinuation cancellableContinuation = cancellableContinuationImpl;
          if (timeMillis < Long.MAX_VALUE) {
              getDelay(cancellableContinuation.getContext()).scheduleResumeAfterDelay(timeMillis, cancellableContinuation);
          }
          Object result = cancellableContinuationImpl.getResult();
          if (result == IntrinsicsKt.getCOROUTINE_SUSPENDED()) {
              DebugProbesKt.probeCoroutineSuspended($completion);
          }
          return result == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? result : Unit.INSTANCE;
      }
  
      /* renamed from: delay-VtjQ1oo  reason: not valid java name */
      public static final Object m1513delayVtjQ1oo(long duration, Continuation<? super Unit> $completion) {
          Object delay = delay(m1514toDelayMillisLRDsOJo(duration), $completion);
          return delay == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? delay : Unit.INSTANCE;
      }
  
      public static final Delay getDelay(CoroutineContext $this$delay) {
          CoroutineContext.Element element = $this$delay.get(ContinuationInterceptor.Key);
          Delay delay = element instanceof Delay ? (Delay) element : null;
          return delay == null ? DefaultExecutorKt.getDefaultDelay() : delay;
      }
  
      /* renamed from: toDelayMillis-LRDsOJo  reason: not valid java name */
      public static final long m1514toDelayMillisLRDsOJo(long $this$toDelayMillis) {
          if (Duration.m1348compareToLRDsOJo($this$toDelayMillis, Duration.Companion.m1451getZEROUwyO8pc()) > 0) {
              return RangesKt.coerceAtLeast(Duration.m1367getInWholeMillisecondsimpl($this$toDelayMillis), 1);
          }
          return 0;
      }
  }
  