content: package kotlinx.coroutines.sync;
  
  import kotlin.Metadata;
  import kotlin.coroutines.Continuation;
  import kotlin.jvm.functions.Function0;
  import kotlin.jvm.internal.InlineMarker;
  import kotlinx.coroutines.internal.Symbol;
  
  @Metadata(d1 = {"\u0000.\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a\u0010\u0010\u000f\u001a\u00020\u00102\b\b\u0002\u0010\u0011\u001a\u00020\u0012\u001aB\u0010\u0013\u001a\u0002H\u0014\"\u0004\b\u0000\u0010\u0014*\u00020\u00102\n\b\u0002\u0010\u0015\u001a\u0004\u0018\u00010\u00162\f\u0010\u0017\u001a\b\u0012\u0004\u0012\u0002H\u00140\u0018HHø\u0001\u0000\u0002\n\n\b\b\u0001\u0012\u0002\u0010\u0002 \u0001¢\u0006\u0002\u0010\u0019\"\u0016\u0010\u0000\u001a\u00020\u00018\u0002X\u0004¢\u0006\b\n\u0000\u0012\u0004\b\u0002\u0010\u0003\"\u0016\u0010\u0004\u001a\u00020\u00018\u0002X\u0004¢\u0006\b\n\u0000\u0012\u0004\b\u0005\u0010\u0003\"\u0016\u0010\u0006\u001a\u00020\u00078\u0002X\u0004¢\u0006\b\n\u0000\u0012\u0004\b\b\u0010\u0003\"\u0016\u0010\t\u001a\u00020\u00078\u0002X\u0004¢\u0006\b\n\u0000\u0012\u0004\b\n\u0010\u0003\"\u0016\u0010\u000b\u001a\u00020\u00078\u0002X\u0004¢\u0006\b\n\u0000\u0012\u0004\b\f\u0010\u0003\"\u0016\u0010\r\u001a\u00020\u00078\u0002X\u0004¢\u0006\b\n\u0000\u0012\u0004\b\u000e\u0010\u0003\u0002\u0004\n\u0002\b\u0019¨\u0006\u001a"}, d2 = {"EMPTY_LOCKED", "Lkotlinx/coroutines/sync/Empty;", "getEMPTY_LOCKED$annotations", "()V", "EMPTY_UNLOCKED", "getEMPTY_UNLOCKED$annotations", "LOCKED", "Lkotlinx/coroutines/internal/Symbol;", "getLOCKED$annotations", "LOCK_FAIL", "getLOCK_FAIL$annotations", "UNLOCKED", "getUNLOCKED$annotations", "UNLOCK_FAIL", "getUNLOCK_FAIL$annotations", "Mutex", "Lkotlinx/coroutines/sync/Mutex;", "locked", "", "withLock", "T", "owner", "", "action", "Lkotlin/Function0;", "(Lkotlinx/coroutines/sync/Mutex;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "kotlinx-coroutines-core"}, k = 2, mv = {1, 6, 0}, xi = 48)
  /* compiled from: Mutex.kt */
  public final class MutexKt {
      /* access modifiers changed from: private */
      public static final Empty EMPTY_LOCKED;
      /* access modifiers changed from: private */
      public static final Empty EMPTY_UNLOCKED;
      /* access modifiers changed from: private */
      public static final Symbol LOCKED;
      /* access modifiers changed from: private */
      public static final Symbol LOCK_FAIL = new Symbol("LOCK_FAIL");
      /* access modifiers changed from: private */
      public static final Symbol UNLOCKED;
      /* access modifiers changed from: private */
      public static final Symbol UNLOCK_FAIL = new Symbol("UNLOCK_FAIL");
  
      static {
          Symbol symbol = new Symbol("LOCKED");
          LOCKED = symbol;
          Symbol symbol2 = new Symbol("UNLOCKED");
          UNLOCKED = symbol2;
          EMPTY_LOCKED = new Empty(symbol);
          EMPTY_UNLOCKED = new Empty(symbol2);
      }
  
      public static final Mutex Mutex(boolean locked) {
          return new MutexImpl(locked);
      }
  
      public static /* synthetic */ Mutex Mutex$default(boolean z, int i, Object obj) {
          if ((i & 1) != 0) {
              z = false;
          }
          return Mutex(z);
      }
  
      private static /* synthetic */ void getEMPTY_LOCKED$annotations() {
      }
  
      private static /* synthetic */ void getEMPTY_UNLOCKED$annotations() {
      }
  
      private static /* synthetic */ void getLOCKED$annotations() {
      }
  
      private static /* synthetic */ void getLOCK_FAIL$annotations() {
      }
  
      private static /* synthetic */ void getUNLOCKED$annotations() {
      }
  
      private static /* synthetic */ void getUNLOCK_FAIL$annotations() {
      }
  
      /* JADX WARNING: Removed duplicated region for block: B:10:0x002e  */
      /* JADX WARNING: Removed duplicated region for block: B:11:0x003d  */
      /* JADX WARNING: Removed duplicated region for block: B:8:0x0026  */
      /* Code decompiled incorrectly, please refer to instructions dump. */
      public static final <T> java.lang.Object withLock(kotlinx.coroutines.sync.Mutex r6, java.lang.Object r7, kotlin.jvm.functions.Function0<? extends T> r8, kotlin.coroutines.Continuation<? super T> r9) {
          /*
              boolean r0 = r9 instanceof kotlinx.coroutines.sync.MutexKt$withLock$1
              if (r0 == 0) goto L_0x0014
              r0 = r9
              kotlinx.coroutines.sync.MutexKt$withLock$1 r0 = (kotlinx.coroutines.sync.MutexKt$withLock$1) r0
              int r1 = r0.label
              r2 = -2147483648(0xffffffff80000000, float:-0.0)
              r1 = r1 & r2
              if (r1 == 0) goto L_0x0014
              int r9 = r0.label
              int r9 = r9 - r2
              r0.label = r9
              goto L_0x0019
          L_0x0014:
              kotlinx.coroutines.sync.MutexKt$withLock$1 r0 = new kotlinx.coroutines.sync.MutexKt$withLock$1
              r0.<init>(r9)
          L_0x0019:
              r9 = r0
              java.lang.Object r0 = r9.result
              java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
              int r2 = r9.label
              r3 = 1
              switch(r2) {
                  case 0: goto L_0x003d;
                  case 1: goto L_0x002e;
                  default: goto L_0x0026;
              }
          L_0x0026:
              java.lang.IllegalStateException r6 = new java.lang.IllegalStateException
              java.lang.String r7 = "call to 'resume' before 'invoke' with coroutine"
              r6.<init>(r7)
              throw r6
          L_0x002e:
              r6 = 0
              java.lang.Object r7 = r9.L$2
              kotlin.jvm.functions.Function0 r7 = (kotlin.jvm.functions.Function0) r7
              java.lang.Object r8 = r9.L$1
              java.lang.Object r1 = r9.L$0
              kotlinx.coroutines.sync.Mutex r1 = (kotlinx.coroutines.sync.Mutex) r1
              kotlin.ResultKt.throwOnFailure(r0)
              goto L_0x0056
          L_0x003d:
              kotlin.ResultKt.throwOnFailure(r0)
              r2 = 0
              r9.L$0 = r6
              r9.L$1 = r7
              r9.L$2 = r8
              r9.label = r3
              java.lang.Object r4 = r6.lock(r7, r9)
              if (r4 != r1) goto L_0x0051
              return r1
          L_0x0051:
              r1 = r6
              r6 = r2
              r5 = r8
              r8 = r7
              r7 = r5
          L_0x0056:
              java.lang.Object r2 = r7.invoke()     // Catch:{ all -> 0x0065 }
              kotlin.jvm.internal.InlineMarker.finallyStart(r3)
              r1.unlock(r8)
              kotlin.jvm.internal.InlineMarker.finallyEnd(r3)
              return r2
          L_0x0065:
              r2 = move-exception
              kotlin.jvm.internal.InlineMarker.finallyStart(r3)
              r1.unlock(r8)
              kotlin.jvm.internal.InlineMarker.finallyEnd(r3)
              throw r2
          */
          throw new UnsupportedOperationException("Method not decompiled: kotlinx.coroutines.sync.MutexKt.withLock(kotlinx.coroutines.sync.Mutex, java.lang.Object, kotlin.jvm.functions.Function0, kotlin.coroutines.Continuation):java.lang.Object");
      }
  
      private static final <T> Object withLock$$forInline(Mutex $this$withLock, Object owner, Function0<? extends T> action, Continuation<? super T> $completion) {
          InlineMarker.mark(0);
          $this$withLock.lock(owner, $completion);
          InlineMarker.mark(1);
          try {
              return action.invoke();
          } finally {
              InlineMarker.finallyStart(1);
              $this$withLock.unlock(owner);
              InlineMarker.finallyEnd(1);
          }
      }
  
      public static /* synthetic */ Object withLock$default(Mutex $this$withLock_u24default, Object owner, Function0 action, Continuation $completion, int i, Object obj) {
          if ((i & 1) != 0) {
              owner = null;
          }
          InlineMarker.mark(0);
          $this$withLock_u24default.lock(owner, $completion);
          InlineMarker.mark(1);
          try {
              return action.invoke();
          } finally {
              InlineMarker.finallyStart(1);
              $this$withLock_u24default.unlock(owner);
              InlineMarker.finallyEnd(1);
          }
      }
  }
  