mutex_is_owned (void * handle)
{
  gboolean D.10460;
  struct _WapiHandle_mutex * mutex_handle.0;
  unsigned int D.10463;
  int D.10465;
  int D.10466;
  long unsigned int D.10468;
  long unsigned int D.10469;
  int D.10470;
  struct _WapiHandle_mutex * mutex_handle;
  gboolean ok;
  static const char __func__[15] = "mutex_is_owned";

  try
    {
      ok = _wapi_lookup_handle (handle, 5, &mutex_handle);
      if (ok == 0) goto <D.10458>; else goto <D.10459>;
      <D.10458>:
      monoeg_g_log (0B, 16, "%s: error looking up mutex handle %p", &__func__, handle);
      D.10460 = 0;
      return D.10460;
      <D.10459>:
      mutex_handle.0 = mutex_handle;
      D.10463 = mutex_handle.0->recursion;
      if (D.10463 != 0) goto <D.10464>; else goto <D.10461>;
      <D.10464>:
      mutex_handle.0 = mutex_handle;
      D.10465 = mutex_handle.0->pid;
      D.10466 = _wapi_getpid ();
      if (D.10465 == D.10466) goto <D.10467>; else goto <D.10461>;
      <D.10467>:
      D.10468 = pthread_self ();
      mutex_handle.0 = mutex_handle;
      D.10469 = mutex_handle.0->tid;
      D.10470 = pthread_equal (D.10469, D.10468);
      if (D.10470 != 0) goto <D.10471>; else goto <D.10461>;
      <D.10471>:
      D.10460 = 1;
      return D.10460;
      <D.10461>:
      D.10460 = 0;
      return D.10460;
    }
  finally
    {
      mutex_handle = {CLOBBER};
    }
}


pthread_equal (pthread_t __thread1, pthread_t __thread2)
{
  int D.10474;
  _Bool D.10475;

  D.10475 = __thread1 == __thread2;
  D.10474 = (int) D.10475;
  return D.10474;
}


mutex_own (void * handle)
{
  gboolean D.10479;
  struct _WapiHandle_mutex * mutex_handle.1;
  int D.10481;
  long unsigned int D.10482;
  unsigned int D.10483;
  unsigned int D.10484;
  struct _WapiHandle_mutex * mutex_handle;
  gboolean ok;
  static const char __func__[10] = "mutex_own";

  try
    {
      ok = _wapi_lookup_handle (handle, 5, &mutex_handle);
      if (ok == 0) goto <D.10477>; else goto <D.10478>;
      <D.10477>:
      monoeg_g_log (0B, 16, "%s: error looking up mutex handle %p", &__func__, handle);
      D.10479 = 0;
      return D.10479;
      <D.10478>:
      _wapi_thread_own_mutex (handle);
      _wapi_handle_set_signal_state (handle, 0, 0);
      mutex_handle.1 = mutex_handle;
      D.10481 = _wapi_getpid ();
      mutex_handle.1->pid = D.10481;
      mutex_handle.1 = mutex_handle;
      D.10482 = pthread_self ();
      mutex_handle.1->tid = D.10482;
      mutex_handle.1 = mutex_handle;
      D.10483 = mutex_handle.1->recursion;
      D.10484 = D.10483 + 1;
      mutex_handle.1->recursion = D.10484;
      D.10479 = 1;
      return D.10479;
    }
  finally
    {
      mutex_handle = {CLOBBER};
    }
}


_wapi_handle_set_signal_state (void * handle, gboolean state, gboolean broadcast)
{
  long int handle.2;
  int iftmp.3;
  <unnamed type> D.10494;
  <unnamed type> D.10496;
  <unnamed type> D.10498;
  <unnamed type> D.10500;
  _Bool D.10501;
  long int D.10502;
  long int D.10503;
  unsigned int D.10506;
  struct _WapiHandleUnshared * D.10507;
  long unsigned int D.10508;
  long unsigned int D.10509;
  long unsigned int D.10510;
  long int D.10513;
  long int D.10514;
  union mono_mutex_t * _wapi_global_signal_mutex.4;
  _Bool D.10520;
  long int D.10521;
  long int D.10522;
  union pthread_cond_t * D.10527;
  union pthread_cond_t * _wapi_global_signal_cond.5;
  guint32 idx;
  struct _WapiHandleUnshared * handle_data;
  int thr_ret;

  handle.2 = (long int) handle;
  idx = (guint32) handle.2;
  if (idx > 4194303) goto <D.10488>; else goto <D.10489>;
  <D.10488>:
  return;
  <D.10489>:
  D.10494 = _wapi_handle_type (handle);
  if (D.10494 == 9) goto <D.10491>; else goto <D.10495>;
  <D.10495>:
  D.10496 = _wapi_handle_type (handle);
  if (D.10496 == 11) goto <D.10491>; else goto <D.10497>;
  <D.10497>:
  D.10498 = _wapi_handle_type (handle);
  if (D.10498 == 12) goto <D.10491>; else goto <D.10499>;
  <D.10499>:
  D.10500 = _wapi_handle_type (handle);
  if (D.10500 == 13) goto <D.10491>; else goto <D.10492>;
  <D.10491>:
  iftmp.3 = 1;
  goto <D.10493>;
  <D.10492>:
  iftmp.3 = 0;
  <D.10493>:
  D.10501 = iftmp.3 != 0;
  D.10502 = (long int) D.10501;
  D.10503 = __builtin_expect (D.10502, 0);
  if (D.10503 != 0) goto <D.10504>; else goto <D.10505>;
  <D.10504>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "../../mono/io-layer/handles-private.h", 132, "!_WAPI_SHARED_HANDLE(_wapi_handle_type (handle))");
  <D.10505>:
  D.10506 = idx / 256;
  D.10507 = _wapi_private_handles[D.10506];
  D.10508 = (long unsigned int) idx;
  D.10509 = D.10508 & 255;
  D.10510 = D.10509 * 200;
  handle_data = D.10507 + D.10510;
  if (state == 1) goto <D.10511>; else goto <D.10512>;
  <D.10511>:
  {
    struct __pthread_unwind_buf_t __cancel_buf;
    void (*<Tc2>) (void *) __cancel_routine;
    void * __cancel_arg;
    int __not_first_call;

    try
      {
        __cancel_routine = mono_mutex_unlock_in_cleanup;
        __cancel_arg = _wapi_global_signal_mutex;
        __not_first_call = __sigsetjmp (&__cancel_buf.__cancel_jmp_buf, 0);
        D.10513 = (long int) __not_first_call;
        D.10514 = __builtin_expect (D.10513, 0);
        if (D.10514 != 0) goto <D.10515>; else goto <D.10516>;
        <D.10515>:
        __cancel_routine (__cancel_arg);
        __pthread_unwind_next (&__cancel_buf);
        <D.10516>:
        __pthread_register_cancel (&__cancel_buf);
        _wapi_global_signal_mutex.4 = _wapi_global_signal_mutex;
        thr_ret = pthread_mutex_lock (_wapi_global_signal_mutex.4);
        if (thr_ret != 0) goto <D.10518>; else goto <D.10519>;
        <D.10518>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d for global signal mutex", thr_ret);
        <D.10519>:
        D.10520 = thr_ret != 0;
        D.10521 = (long int) D.10520;
        D.10522 = __builtin_expect (D.10521, 0);
        if (D.10522 != 0) goto <D.10523>; else goto <D.10524>;
        <D.10523>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "../../mono/io-layer/handles-private.h", 151, "thr_ret == 0");
        <D.10524>:
        handle_data->signalled = state;
        if (broadcast == 1) goto <D.10525>; else goto <D.10526>;
        <D.10525>:
        D.10527 = &handle_data->signal_cond;
        thr_ret = pthread_cond_broadcast (D.10527);
        if (thr_ret != 0) goto <D.10528>; else goto <D.10529>;
        <D.10528>:
        monoeg_g_log (0B, 16, "Bad call to pthread_cond_broadcast result %d for handle %p", thr_ret, handle);
        <D.10529>:
        D.10520 = thr_ret != 0;
        D.10521 = (long int) D.10520;
        D.10522 = __builtin_expect (D.10521, 0);
        if (D.10522 != 0) goto <D.10530>; else goto <D.10531>;
        <D.10530>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "../../mono/io-layer/handles-private.h", 162, "thr_ret == 0");
        <D.10531>:
        goto <D.10532>;
        <D.10526>:
        D.10527 = &handle_data->signal_cond;
        thr_ret = pthread_cond_signal (D.10527);
        if (thr_ret != 0) goto <D.10533>; else goto <D.10534>;
        <D.10533>:
        monoeg_g_log (0B, 16, "Bad call to pthread_cond_signal result %d for handle %p", thr_ret, handle);
        <D.10534>:
        D.10520 = thr_ret != 0;
        D.10521 = (long int) D.10520;
        D.10522 = __builtin_expect (D.10521, 0);
        if (D.10522 != 0) goto <D.10535>; else goto <D.10536>;
        <D.10535>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "../../mono/io-layer/handles-private.h", 167, "thr_ret == 0");
        <D.10536>:
        <D.10532>:
        _wapi_global_signal_cond.5 = _wapi_global_signal_cond;
        thr_ret = pthread_cond_broadcast (_wapi_global_signal_cond.5);
        if (thr_ret != 0) goto <D.10538>; else goto <D.10539>;
        <D.10538>:
        monoeg_g_log (0B, 16, "Bad call to pthread_cond_broadcast result %d for handle %p", thr_ret, handle);
        <D.10539>:
        D.10520 = thr_ret != 0;
        D.10521 = (long int) D.10520;
        D.10522 = __builtin_expect (D.10521, 0);
        if (D.10522 != 0) goto <D.10540>; else goto <D.10541>;
        <D.10540>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "../../mono/io-layer/handles-private.h", 176, "thr_ret == 0");
        <D.10541>:
        _wapi_global_signal_mutex.4 = _wapi_global_signal_mutex;
        thr_ret = pthread_mutex_unlock (_wapi_global_signal_mutex.4);
        if (thr_ret != 0) goto <D.10542>; else goto <D.10543>;
        <D.10542>:
        monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d for global signal mutex", thr_ret);
        <D.10543>:
        D.10520 = thr_ret != 0;
        D.10521 = (long int) D.10520;
        D.10522 = __builtin_expect (D.10521, 0);
        if (D.10522 != 0) goto <D.10544>; else goto <D.10545>;
        <D.10544>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "../../mono/io-layer/handles-private.h", 181, "thr_ret == 0");
        <D.10545>:
        __pthread_unregister_cancel (&__cancel_buf);
        if (0 != 0) goto <D.10546>; else goto <D.10547>;
        <D.10546>:
        __cancel_routine (__cancel_arg);
        <D.10547>:
      }
    finally
      {
        __cancel_buf = {CLOBBER};
      }
  }
  goto <D.10548>;
  <D.10512>:
  handle_data->signalled = state;
  <D.10548>:
}


mono_mutex_unlock_in_cleanup (union mono_mutex_t * mutex)
{
  int D.10559;

  D.10559 = pthread_mutex_unlock (mutex);
  return D.10559;
}


_wapi_handle_type (void * handle)
{
  long int handle.6;
  unsigned int D.10565;
  struct _WapiHandleUnshared * D.10566;
  WapiHandleType D.10567;
  unsigned int D.10568;
  struct _WapiHandleUnshared * D.10569;
  long unsigned int D.10570;
  long unsigned int D.10571;
  long unsigned int D.10572;
  struct _WapiHandleUnshared * D.10573;
  guint32 idx;

  handle.6 = (long int) handle;
  idx = (guint32) handle.6;
  if (idx > 4194303) goto <D.10562>; else goto <D.10564>;
  <D.10564>:
  D.10565 = idx / 256;
  D.10566 = _wapi_private_handles[D.10565];
  if (D.10566 == 0B) goto <D.10562>; else goto <D.10563>;
  <D.10562>:
  D.10567 = 0;
  return D.10567;
  <D.10563>:
  D.10568 = idx / 256;
  D.10569 = _wapi_private_handles[D.10568];
  D.10570 = (long unsigned int) idx;
  D.10571 = D.10570 & 255;
  D.10572 = D.10571 * 200;
  D.10573 = D.10569 + D.10572;
  D.10567 = D.10573->type;
  return D.10567;
}


mutex_signal (void * handle)
{
  ReleaseMutex (handle);
}


_wapi_mutex_details (void * handle_info)
{
  unsigned int D.10575;
  long unsigned int D.10576;
  int D.10577;
  struct _WapiHandle_mutex * mut;

  mut = handle_info;
  D.10575 = mut->recursion;
  D.10576 = mut->tid;
  D.10577 = mut->pid;
  monoeg_g_print ("own: %5d:%5ld, count: %5u", D.10577, D.10576, D.10575);
}


namedmutex_prewait (void * handle)
{
  struct _WapiHandle_namedmutex * namedmutex_handle.7;
  unsigned int D.10581;
  int D.10585;
  int D.10586;
  unsigned int D.10590;
  _Bool D.10593;
  long int D.10594;
  long int D.10595;
  struct _WapiHandle_namedmutex * namedmutex_handle;
  gboolean ok;
  static const char __func__[19] = "namedmutex_prewait";

  try
    {
      ok = _wapi_lookup_handle (handle, 11, &namedmutex_handle);
      if (ok == 0) goto <D.10578>; else goto <D.10579>;
      <D.10578>:
      monoeg_g_log (0B, 16, "%s: error looking up named mutex handle %p", &__func__, handle);
      return;
      <D.10579>:
      namedmutex_handle.7 = namedmutex_handle;
      D.10581 = namedmutex_handle.7->recursion;
      if (D.10581 == 0) goto <D.10582>; else goto <D.10583>;
      <D.10582>:
      goto <D.10584>;
      <D.10583>:
      namedmutex_handle.7 = namedmutex_handle;
      D.10585 = namedmutex_handle.7->pid;
      D.10586 = _wapi_getpid ();
      if (D.10585 == D.10586) goto <D.10587>; else goto <D.10588>;
      <D.10587>:
      goto <D.10589>;
      <D.10588>:
      {
        int thr_ret;
        void * proc_handle;

        namedmutex_handle.7 = namedmutex_handle;
        D.10585 = namedmutex_handle.7->pid;
        D.10590 = (unsigned int) D.10585;
        proc_handle = OpenProcess (0, 0, D.10590);
        if (proc_handle == 0B) goto <D.10591>; else goto <D.10592>;
        <D.10591>:
        thr_ret = _wapi_handle_lock_shared_handles ();
        D.10593 = thr_ret != 0;
        D.10594 = (long int) D.10593;
        D.10595 = __builtin_expect (D.10594, 0);
        if (D.10595 != 0) goto <D.10596>; else goto <D.10597>;
        <D.10596>:
        monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mutexes.c", 274, "thr_ret == 0");
        <D.10597>:
        namedmutex_handle.7 = namedmutex_handle;
        namedmutex_handle.7->pid = 0;
        namedmutex_handle.7 = namedmutex_handle;
        namedmutex_handle.7->tid = 0;
        namedmutex_handle.7 = namedmutex_handle;
        namedmutex_handle.7->recursion = 0;
        _wapi_shared_handle_set_signal_state (handle, 1);
        _wapi_handle_unlock_shared_handles ();
        goto <D.10598>;
        <D.10592>:
        <D.10598>:
        if (proc_handle != 0B) goto <D.10599>; else goto <D.10600>;
        <D.10599>:
        CloseProcess (proc_handle);
        <D.10600>:
      }
      <D.10589>:
      <D.10584>:
    }
  finally
    {
      namedmutex_handle = {CLOBBER};
    }
}


_wapi_handle_lock_shared_handles ()
{
  int D.10604;

  D.10604 = _wapi_shm_sem_lock (3);
  return D.10604;
}


_wapi_shared_handle_set_signal_state (void * handle, gboolean state)
{
  long int handle.8;
  int iftmp.9;
  <unnamed type> D.10612;
  <unnamed type> D.10614;
  <unnamed type> D.10616;
  <unnamed type> D.10618;
  _Bool D.10620;
  long int D.10621;
  long int D.10622;
  unsigned int D.10625;
  struct _WapiHandleUnshared * D.10626;
  long unsigned int D.10627;
  long unsigned int D.10628;
  long unsigned int D.10629;
  struct _WapiHandleSharedLayout * _wapi_shared_layout.10;
  unsigned int D.10631;
  guint32 idx;
  struct _WapiHandleUnshared * handle_data;
  struct _WapiHandle_shared_ref * ref;
  struct _WapiHandleShared * shared_data;

  handle.8 = (long int) handle;
  idx = (guint32) handle.8;
  if (idx > 4194303) goto <D.10607>; else goto <D.10608>;
  <D.10607>:
  return;
  <D.10608>:
  D.10612 = _wapi_handle_type (handle);
  if (D.10612 != 9) goto <D.10613>; else goto <D.10610>;
  <D.10613>:
  D.10614 = _wapi_handle_type (handle);
  if (D.10614 != 11) goto <D.10615>; else goto <D.10610>;
  <D.10615>:
  D.10616 = _wapi_handle_type (handle);
  if (D.10616 != 12) goto <D.10617>; else goto <D.10610>;
  <D.10617>:
  D.10618 = _wapi_handle_type (handle);
  if (D.10618 != 13) goto <D.10619>; else goto <D.10610>;
  <D.10619>:
  iftmp.9 = 1;
  goto <D.10611>;
  <D.10610>:
  iftmp.9 = 0;
  <D.10611>:
  D.10620 = iftmp.9 != 0;
  D.10621 = (long int) D.10620;
  D.10622 = __builtin_expect (D.10621, 0);
  if (D.10622 != 0) goto <D.10623>; else goto <D.10624>;
  <D.10623>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "../../mono/io-layer/handles-private.h", 201, "_WAPI_SHARED_HANDLE(_wapi_handle_type (handle))");
  <D.10624>:
  D.10625 = idx / 256;
  D.10626 = _wapi_private_handles[D.10625];
  D.10627 = (long unsigned int) idx;
  D.10628 = D.10627 & 255;
  D.10629 = D.10628 * 200;
  handle_data = D.10626 + D.10629;
  ref = &handle_data->u.shared;
  _wapi_shared_layout.10 = _wapi_shared_layout;
  D.10631 = ref->offset;
  shared_data = &_wapi_shared_layout.10->handles[D.10631];
  shared_data->signalled = state;
}


_wapi_handle_unlock_shared_handles ()
{
  int D.10633;

  D.10633 = _wapi_shm_sem_unlock (3);
  return D.10633;
}


namedmutex_is_owned (void * handle)
{
  gboolean D.10637;
  struct _WapiHandle_namedmutex * namedmutex_handle.11;
  unsigned int D.10640;
  int D.10642;
  int D.10643;
  long unsigned int D.10645;
  long unsigned int D.10646;
  int D.10647;
  struct _WapiHandle_namedmutex * namedmutex_handle;
  gboolean ok;
  static const char __func__[20] = "namedmutex_is_owned";

  try
    {
      ok = _wapi_lookup_handle (handle, 11, &namedmutex_handle);
      if (ok == 0) goto <D.10635>; else goto <D.10636>;
      <D.10635>:
      monoeg_g_log (0B, 16, "%s: error looking up mutex handle %p", &__func__, handle);
      D.10637 = 0;
      return D.10637;
      <D.10636>:
      namedmutex_handle.11 = namedmutex_handle;
      D.10640 = namedmutex_handle.11->recursion;
      if (D.10640 != 0) goto <D.10641>; else goto <D.10638>;
      <D.10641>:
      namedmutex_handle.11 = namedmutex_handle;
      D.10642 = namedmutex_handle.11->pid;
      D.10643 = _wapi_getpid ();
      if (D.10642 == D.10643) goto <D.10644>; else goto <D.10638>;
      <D.10644>:
      D.10645 = pthread_self ();
      namedmutex_handle.11 = namedmutex_handle;
      D.10646 = namedmutex_handle.11->tid;
      D.10647 = pthread_equal (D.10646, D.10645);
      if (D.10647 != 0) goto <D.10648>; else goto <D.10638>;
      <D.10648>:
      D.10637 = 1;
      return D.10637;
      <D.10638>:
      D.10637 = 0;
      return D.10637;
    }
  finally
    {
      namedmutex_handle = {CLOBBER};
    }
}


namedmutex_own (void * handle)
{
  gboolean D.10653;
  struct _WapiHandle_namedmutex * namedmutex_handle.12;
  int D.10655;
  long unsigned int D.10656;
  unsigned int D.10657;
  unsigned int D.10658;
  struct _WapiHandle_namedmutex * namedmutex_handle;
  gboolean ok;
  static const char __func__[15] = "namedmutex_own";

  try
    {
      ok = _wapi_lookup_handle (handle, 11, &namedmutex_handle);
      if (ok == 0) goto <D.10651>; else goto <D.10652>;
      <D.10651>:
      monoeg_g_log (0B, 16, "%s: error looking up named mutex handle %p", &__func__, handle);
      D.10653 = 0;
      return D.10653;
      <D.10652>:
      _wapi_thread_own_mutex (handle);
      namedmutex_handle.12 = namedmutex_handle;
      D.10655 = _wapi_getpid ();
      namedmutex_handle.12->pid = D.10655;
      namedmutex_handle.12 = namedmutex_handle;
      D.10656 = pthread_self ();
      namedmutex_handle.12->tid = D.10656;
      namedmutex_handle.12 = namedmutex_handle;
      D.10657 = namedmutex_handle.12->recursion;
      D.10658 = D.10657 + 1;
      namedmutex_handle.12->recursion = D.10658;
      _wapi_shared_handle_set_signal_state (handle, 0);
      D.10653 = 1;
      return D.10653;
    }
  finally
    {
      namedmutex_handle = {CLOBBER};
    }
}


namedmutex_signal (void * handle)
{
  ReleaseMutex (handle);
}


_wapi_mutex_abandon (void * data, pid_t pid, pthread_t tid)
{
  WapiHandleType type;

  type = _wapi_handle_type (data);
  if (type == 5) goto <D.10661>; else goto <D.10662>;
  <D.10661>:
  mutex_abandon (data, pid, tid);
  goto <D.10663>;
  <D.10662>:
  if (type == 11) goto <D.10664>; else goto <D.10665>;
  <D.10664>:
  namedmutex_abandon (data, pid, tid);
  goto <D.10666>;
  <D.10665>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "mutexes.c", 369);
  <D.10666>:
  <D.10663>:
}


mutex_abandon (void * handle, pid_t pid, pthread_t tid)
{
  long int D.10669;
  long int D.10670;
  _Bool D.10673;
  long int D.10674;
  long int D.10675;
  struct _WapiHandle_mutex * mutex_handle.13;
  int D.10679;
  long unsigned int D.10682;
  int D.10683;
  struct _WapiHandle_mutex * mutex_handle;
  gboolean ok;
  int thr_ret;
  static const char __func__[14] = "mutex_abandon";

  try
    {
      ok = _wapi_lookup_handle (handle, 5, &mutex_handle);
      if (ok == 0) goto <D.10667>; else goto <D.10668>;
      <D.10667>:
      monoeg_g_log (0B, 16, "%s: error looking up mutex handle %p", &__func__, handle);
      return;
      <D.10668>:
      {
        struct __pthread_unwind_buf_t __cancel_buf;
        void (*<Tc2>) (void *) __cancel_routine;
        void * __cancel_arg;
        int __not_first_call;

        try
          {
            __cancel_routine = _wapi_handle_unlock_handle;
            __cancel_arg = handle;
            __not_first_call = __sigsetjmp (&__cancel_buf.__cancel_jmp_buf, 0);
            D.10669 = (long int) __not_first_call;
            D.10670 = __builtin_expect (D.10669, 0);
            if (D.10670 != 0) goto <D.10671>; else goto <D.10672>;
            <D.10671>:
            __cancel_routine (__cancel_arg);
            __pthread_unwind_next (&__cancel_buf);
            <D.10672>:
            __pthread_register_cancel (&__cancel_buf);
            thr_ret = _wapi_handle_lock_handle (handle);
            D.10673 = thr_ret != 0;
            D.10674 = (long int) D.10673;
            D.10675 = __builtin_expect (D.10674, 0);
            if (D.10675 != 0) goto <D.10676>; else goto <D.10677>;
            <D.10676>:
            monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mutexes.c", 307, "thr_ret == 0");
            <D.10677>:
            mutex_handle.13 = mutex_handle;
            D.10679 = mutex_handle.13->pid;
            if (D.10679 == pid) goto <D.10680>; else goto <D.10681>;
            <D.10680>:
            mutex_handle.13 = mutex_handle;
            D.10682 = mutex_handle.13->tid;
            D.10683 = pthread_equal (D.10682, tid);
            if (D.10683 != 0) goto <D.10684>; else goto <D.10685>;
            <D.10684>:
            mutex_handle.13 = mutex_handle;
            mutex_handle.13->recursion = 0;
            mutex_handle.13 = mutex_handle;
            mutex_handle.13->pid = 0;
            mutex_handle.13 = mutex_handle;
            mutex_handle.13->tid = 0;
            _wapi_handle_set_signal_state (handle, 1, 0);
            <D.10685>:
            <D.10681>:
            thr_ret = _wapi_handle_unlock_handle (handle);
            D.10673 = thr_ret != 0;
            D.10674 = (long int) D.10673;
            D.10675 = __builtin_expect (D.10674, 0);
            if (D.10675 != 0) goto <D.10686>; else goto <D.10687>;
            <D.10686>:
            monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mutexes.c", 321, "thr_ret == 0");
            <D.10687>:
            __pthread_unregister_cancel (&__cancel_buf);
            if (0 != 0) goto <D.10688>; else goto <D.10689>;
            <D.10688>:
            __cancel_routine (__cancel_arg);
            <D.10689>:
          }
        finally
          {
            __cancel_buf = {CLOBBER};
          }
      }
    }
  finally
    {
      mutex_handle = {CLOBBER};
    }
}


_wapi_handle_lock_handle (void * handle)
{
  long int handle.14;
  int D.10699;
  <unnamed type> D.10702;
  <unnamed type> D.10704;
  <unnamed type> D.10706;
  <unnamed type> D.10708;
  unsigned int D.10709;
  struct _WapiHandleUnshared * D.10710;
  long unsigned int D.10711;
  long unsigned int D.10712;
  long unsigned int D.10713;
  struct _WapiHandleUnshared * D.10714;
  union mono_mutex_t * D.10715;
  guint32 idx;

  handle.14 = (long int) handle;
  idx = (guint32) handle.14;
  if (idx > 4194303) goto <D.10697>; else goto <D.10698>;
  <D.10697>:
  D.10699 = 0;
  return D.10699;
  <D.10698>:
  _wapi_handle_ref (handle);
  D.10702 = _wapi_handle_type (handle);
  if (D.10702 == 9) goto <D.10700>; else goto <D.10703>;
  <D.10703>:
  D.10704 = _wapi_handle_type (handle);
  if (D.10704 == 11) goto <D.10700>; else goto <D.10705>;
  <D.10705>:
  D.10706 = _wapi_handle_type (handle);
  if (D.10706 == 12) goto <D.10700>; else goto <D.10707>;
  <D.10707>:
  D.10708 = _wapi_handle_type (handle);
  if (D.10708 == 13) goto <D.10700>; else goto <D.10701>;
  <D.10700>:
  D.10699 = 0;
  return D.10699;
  <D.10701>:
  D.10709 = idx / 256;
  D.10710 = _wapi_private_handles[D.10709];
  D.10711 = (long unsigned int) idx;
  D.10712 = D.10711 & 255;
  D.10713 = D.10712 * 200;
  D.10714 = D.10710 + D.10713;
  D.10715 = &D.10714->signal_mutex;
  D.10699 = pthread_mutex_lock (D.10715);
  return D.10699;
}


_wapi_handle_unlock_handle (void * handle)
{
  long int handle.15;
  int D.10720;
  <unnamed type> D.10723;
  <unnamed type> D.10725;
  <unnamed type> D.10727;
  <unnamed type> D.10729;
  unsigned int D.10730;
  struct _WapiHandleUnshared * D.10731;
  long unsigned int D.10732;
  long unsigned int D.10733;
  long unsigned int D.10734;
  struct _WapiHandleUnshared * D.10735;
  union mono_mutex_t * D.10736;
  guint32 idx;
  int ret;

  handle.15 = (long int) handle;
  idx = (guint32) handle.15;
  if (idx > 4194303) goto <D.10718>; else goto <D.10719>;
  <D.10718>:
  D.10720 = 0;
  return D.10720;
  <D.10719>:
  D.10723 = _wapi_handle_type (handle);
  if (D.10723 == 9) goto <D.10721>; else goto <D.10724>;
  <D.10724>:
  D.10725 = _wapi_handle_type (handle);
  if (D.10725 == 11) goto <D.10721>; else goto <D.10726>;
  <D.10726>:
  D.10727 = _wapi_handle_type (handle);
  if (D.10727 == 12) goto <D.10721>; else goto <D.10728>;
  <D.10728>:
  D.10729 = _wapi_handle_type (handle);
  if (D.10729 == 13) goto <D.10721>; else goto <D.10722>;
  <D.10721>:
  _wapi_handle_unref (handle);
  D.10720 = 0;
  return D.10720;
  <D.10722>:
  D.10730 = idx / 256;
  D.10731 = _wapi_private_handles[D.10730];
  D.10732 = (long unsigned int) idx;
  D.10733 = D.10732 & 255;
  D.10734 = D.10733 * 200;
  D.10735 = D.10731 + D.10734;
  D.10736 = &D.10735->signal_mutex;
  ret = pthread_mutex_unlock (D.10736);
  _wapi_handle_unref (handle);
  D.10720 = ret;
  return D.10720;
}


namedmutex_abandon (void * handle, pid_t pid, pthread_t tid)
{
  _Bool D.10740;
  long int D.10741;
  long int D.10742;
  struct _WapiHandle_namedmutex * mutex_handle.16;
  int D.10746;
  long unsigned int D.10749;
  int D.10750;
  struct _WapiHandle_namedmutex * mutex_handle;
  gboolean ok;
  int thr_ret;
  static const char __func__[19] = "namedmutex_abandon";

  try
    {
      ok = _wapi_lookup_handle (handle, 11, &mutex_handle);
      if (ok == 0) goto <D.10738>; else goto <D.10739>;
      <D.10738>:
      monoeg_g_log (0B, 16, "%s: error looking up named mutex handle %p", &__func__, handle);
      return;
      <D.10739>:
      thr_ret = _wapi_handle_lock_shared_handles ();
      D.10740 = thr_ret != 0;
      D.10741 = (long int) D.10740;
      D.10742 = __builtin_expect (D.10741, 0);
      if (D.10742 != 0) goto <D.10743>; else goto <D.10744>;
      <D.10743>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mutexes.c", 340, "thr_ret == 0");
      <D.10744>:
      mutex_handle.16 = mutex_handle;
      D.10746 = mutex_handle.16->pid;
      if (D.10746 == pid) goto <D.10747>; else goto <D.10748>;
      <D.10747>:
      mutex_handle.16 = mutex_handle;
      D.10749 = mutex_handle.16->tid;
      D.10750 = pthread_equal (D.10749, tid);
      if (D.10750 != 0) goto <D.10751>; else goto <D.10752>;
      <D.10751>:
      mutex_handle.16 = mutex_handle;
      mutex_handle.16->recursion = 0;
      mutex_handle.16 = mutex_handle;
      mutex_handle.16->pid = 0;
      mutex_handle.16 = mutex_handle;
      mutex_handle.16->tid = 0;
      _wapi_shared_handle_set_signal_state (handle, 1);
      <D.10752>:
      <D.10748>:
      _wapi_handle_unlock_shared_handles ();
    }
  finally
    {
      mutex_handle = {CLOBBER};
    }
}


CreateMutex (struct WapiSecurityAttributes * security, gboolean owned, const gunichar2 * name)
{
  void * D.10758;

  mono_once (&mutex_ops_once, mutex_ops_init);
  if (name == 0B) goto <D.10756>; else goto <D.10757>;
  <D.10756>:
  D.10758 = mutex_create (security, owned);
  return D.10758;
  <D.10757>:
  D.10758 = namedmutex_create (security, owned, name);
  return D.10758;
}


mutex_ops_init ()
{
  _wapi_handle_register_capabilities (5, 7);
  _wapi_handle_register_capabilities (11, 7);
}


mutex_create (struct WapiSecurityAttributes * security, gboolean owned)
{
  void * D.10762;
  long int D.10763;
  long int D.10764;
  _Bool D.10767;
  long int D.10768;
  long int D.10769;
  struct _WapiHandle_mutex mutex_handle;
  void * handle;
  int thr_ret;
  static const char __func__[13] = "mutex_create";

  try
    {
      mutex_handle = {};
      SetLastError (0);
      handle = _wapi_handle_new (5, &mutex_handle);
      if (handle == -1B) goto <D.10760>; else goto <D.10761>;
      <D.10760>:
      monoeg_g_log (0B, 16, "%s: error creating mutex handle", &__func__);
      SetLastError (31);
      D.10762 = 0B;
      return D.10762;
      <D.10761>:
      {
        struct __pthread_unwind_buf_t __cancel_buf;
        void (*<Tc2>) (void *) __cancel_routine;
        void * __cancel_arg;
        int __not_first_call;

        try
          {
            __cancel_routine = _wapi_handle_unlock_handle;
            __cancel_arg = handle;
            __not_first_call = __sigsetjmp (&__cancel_buf.__cancel_jmp_buf, 0);
            D.10763 = (long int) __not_first_call;
            D.10764 = __builtin_expect (D.10763, 0);
            if (D.10764 != 0) goto <D.10765>; else goto <D.10766>;
            <D.10765>:
            __cancel_routine (__cancel_arg);
            __pthread_unwind_next (&__cancel_buf);
            <D.10766>:
            __pthread_register_cancel (&__cancel_buf);
            thr_ret = _wapi_handle_lock_handle (handle);
            D.10767 = thr_ret != 0;
            D.10768 = (long int) D.10767;
            D.10769 = __builtin_expect (D.10768, 0);
            if (D.10769 != 0) goto <D.10770>; else goto <D.10771>;
            <D.10770>:
            monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mutexes.c", 398, "thr_ret == 0");
            <D.10771>:
            if (owned == 1) goto <D.10772>; else goto <D.10773>;
            <D.10772>:
            mutex_own (handle);
            goto <D.10774>;
            <D.10773>:
            _wapi_handle_set_signal_state (handle, 1, 0);
            <D.10774>:
            thr_ret = _wapi_handle_unlock_handle (handle);
            D.10767 = thr_ret != 0;
            D.10768 = (long int) D.10767;
            D.10769 = __builtin_expect (D.10768, 0);
            if (D.10769 != 0) goto <D.10775>; else goto <D.10776>;
            <D.10775>:
            monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mutexes.c", 409, "thr_ret == 0");
            <D.10776>:
            __pthread_unregister_cancel (&__cancel_buf);
            if (0 != 0) goto <D.10777>; else goto <D.10778>;
            <D.10777>:
            __cancel_routine (__cancel_arg);
            <D.10778>:
          }
        finally
          {
            __cancel_buf = {CLOBBER};
          }
      }
      D.10762 = handle;
      return D.10762;
    }
  finally
    {
      mutex_handle = {CLOBBER};
    }
}


namedmutex_create (struct WapiSecurityAttributes * security, gboolean owned, const gunichar2 * name)
{
  _Bool D.10784;
  long int D.10785;
  long int D.10786;
  long unsigned int D.10795;
  long unsigned int D.10798;
  long unsigned int D.10800;
  unsigned int offset.17;
  void * D.10812;
  struct _WapiHandle_namedmutex namedmutex_handle;
  void * handle;
  gchar * utf8_name;
  int thr_ret;
  void * ret;
  guint32 namelen;
  gint32 offset;
  void cleanup = <<< error >>>;
  static const char __func__[18] = "namedmutex_create";

  try
    {
      namedmutex_handle = {};
      ret = 0B;
      thr_ret = _wapi_namespace_lock ();
      D.10784 = thr_ret != 0;
      D.10785 = (long int) D.10784;
      D.10786 = __builtin_expect (D.10785, 0);
      if (D.10786 != 0) goto <D.10787>; else goto <D.10788>;
      <D.10787>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mutexes.c", 430, "thr_ret == 0");
      <D.10788>:
      SetLastError (0);
      utf8_name = monoeg_g_utf16_to_utf8 (name, -1, 0B, 0B, 0B);
      offset = _wapi_search_handle_namespace (11, utf8_name);
      if (offset == -1) goto <D.10789>; else goto <D.10790>;
      <D.10789>:
      SetLastError (6);
      goto cleanup;
      <D.10790>:
      if (offset != 0) goto <D.10791>; else goto <D.10792>;
      <D.10791>:
      SetLastError (183);
      <D.10792>:
      if (offset == 0) goto <D.10793>; else goto <D.10794>;
      <D.10793>:
      D.10795 = strlen (utf8_name);
      if (D.10795 <= 259) goto <D.10796>; else goto <D.10797>;
      <D.10796>:
      D.10798 = strlen (utf8_name);
      namelen = (guint32) D.10798;
      goto <D.10799>;
      <D.10797>:
      namelen = 260;
      <D.10799>:
      D.10800 = (long unsigned int) namelen;
      memcpy (&namedmutex_handle.sharedns.name, utf8_name, D.10800);
      handle = _wapi_handle_new (11, &namedmutex_handle);
      goto <D.10801>;
      <D.10794>:
      offset.17 = (unsigned int) offset;
      handle = _wapi_handle_new_from_offset (11, offset.17, 1);
      <D.10801>:
      if (handle == -1B) goto <D.10803>; else goto <D.10804>;
      <D.10803>:
      monoeg_g_log (0B, 16, "%s: error creating mutex handle", &__func__);
      SetLastError (31);
      goto cleanup;
      <D.10804>:
      ret = handle;
      if (offset == 0) goto <D.10805>; else goto <D.10806>;
      <D.10805>:
      thr_ret = _wapi_handle_lock_shared_handles ();
      D.10784 = thr_ret != 0;
      D.10785 = (long int) D.10784;
      D.10786 = __builtin_expect (D.10785, 0);
      if (D.10786 != 0) goto <D.10807>; else goto <D.10808>;
      <D.10807>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mutexes.c", 493, "thr_ret == 0");
      <D.10808>:
      if (owned == 1) goto <D.10809>; else goto <D.10810>;
      <D.10809>:
      namedmutex_own (handle);
      goto <D.10811>;
      <D.10810>:
      _wapi_shared_handle_set_signal_state (handle, 1);
      <D.10811>:
      _wapi_handle_unlock_shared_handles ();
      <D.10806>:
      cleanup:
      monoeg_g_free (utf8_name);
      _wapi_namespace_unlock (0B);
      D.10812 = ret;
      return D.10812;
    }
  finally
    {
      namedmutex_handle = {CLOBBER};
    }
}


_wapi_namespace_lock ()
{
  int D.10815;

  D.10815 = _wapi_shm_sem_lock (0);
  return D.10815;
}


memcpy (void * restrict __dest, const void * restrict __src, size_t __len)
{
  void * D.10817;
  long unsigned int D.10818;

  D.10818 = __builtin_object_size (__dest, 0);
  D.10817 = __builtin___memcpy_chk (__dest, __src, __len, D.10818);
  return D.10817;
}


_wapi_namespace_unlock (void * data)
{
  int D.10820;

  D.10820 = _wapi_shm_sem_unlock (0);
  return D.10820;
}


ReleaseMutex (void * handle)
{
  gboolean D.10824;
  gboolean (*<T15e7>) (void *) D.10825;
  WapiHandleType type;

  if (handle == 0B) goto <D.10822>; else goto <D.10823>;
  <D.10822>:
  SetLastError (6);
  D.10824 = 0;
  return D.10824;
  <D.10823>:
  type = _wapi_handle_type (handle);
  D.10825 = mutex_ops[type].release;
  if (D.10825 == 0B) goto <D.10826>; else goto <D.10827>;
  <D.10826>:
  SetLastError (6);
  D.10824 = 0;
  return D.10824;
  <D.10827>:
  D.10825 = mutex_ops[type].release;
  D.10824 = D.10825 (handle);
  return D.10824;
}


namedmutex_release (void * handle)
{
  gboolean D.10831;
  _Bool D.10832;
  long int D.10833;
  long int D.10834;
  struct _WapiHandle_namedmutex * mutex_handle.18;
  long unsigned int D.10838;
  int D.10839;
  int D.10841;
  unsigned int D.10843;
  unsigned int D.10844;
  struct _WapiHandle_namedmutex * mutex_handle;
  gboolean ok;
  pthread_t tid;
  pid_t pid;
  int thr_ret;
  gboolean ret;
  static const char __func__[19] = "namedmutex_release";
  void cleanup = <<< error >>>;

  try
    {
      tid = pthread_self ();
      pid = _wapi_getpid ();
      ret = 0;
      ok = _wapi_lookup_handle (handle, 11, &mutex_handle);
      if (ok == 0) goto <D.10829>; else goto <D.10830>;
      <D.10829>:
      monoeg_g_log (0B, 16, "%s: error looking up named mutex handle %p", &__func__, handle);
      D.10831 = 0;
      return D.10831;
      <D.10830>:
      thr_ret = _wapi_handle_lock_shared_handles ();
      D.10832 = thr_ret != 0;
      D.10833 = (long int) D.10832;
      D.10834 = __builtin_expect (D.10833, 0);
      if (D.10834 != 0) goto <D.10835>; else goto <D.10836>;
      <D.10835>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mutexes.c", 616, "thr_ret == 0");
      <D.10836>:
      mutex_handle.18 = mutex_handle;
      D.10838 = mutex_handle.18->tid;
      D.10839 = pthread_equal (D.10838, tid);
      if (D.10839 == 0) goto cleanup; else goto <D.10840>;
      <D.10840>:
      mutex_handle.18 = mutex_handle;
      D.10841 = mutex_handle.18->pid;
      if (D.10841 != pid) goto cleanup; else goto <D.10842>;
      <D.10842>:
      ret = 1;
      mutex_handle.18 = mutex_handle;
      D.10843 = mutex_handle.18->recursion;
      D.10844 = D.10843 + 4294967295;
      mutex_handle.18->recursion = D.10844;
      mutex_handle.18 = mutex_handle;
      D.10843 = mutex_handle.18->recursion;
      if (D.10843 == 0) goto <D.10845>; else goto <D.10846>;
      <D.10845>:
      _wapi_thread_disown_mutex (handle);
      mutex_handle.18 = mutex_handle;
      mutex_handle.18->pid = 0;
      mutex_handle.18 = mutex_handle;
      mutex_handle.18->tid = 0;
      _wapi_shared_handle_set_signal_state (handle, 1);
      <D.10846>:
      cleanup:
      _wapi_handle_unlock_shared_handles ();
      D.10831 = ret;
      return D.10831;
    }
  finally
    {
      mutex_handle = {CLOBBER};
    }
}


mutex_release (void * handle)
{
  gboolean D.10851;
  long int D.10852;
  long int D.10853;
  _Bool D.10856;
  long int D.10857;
  long int D.10858;
  struct _WapiHandle_mutex * mutex_handle.19;
  long unsigned int D.10862;
  int D.10863;
  int D.10865;
  unsigned int D.10867;
  unsigned int D.10868;
  struct _WapiHandle_mutex * mutex_handle;
  gboolean ok;
  pthread_t tid;
  pid_t pid;
  int thr_ret;
  gboolean ret;
  static const char __func__[14] = "mutex_release";
  void cleanup = <<< error >>>;

  try
    {
      tid = pthread_self ();
      pid = _wapi_getpid ();
      ret = 0;
      ok = _wapi_lookup_handle (handle, 5, &mutex_handle);
      if (ok == 0) goto <D.10849>; else goto <D.10850>;
      <D.10849>:
      monoeg_g_log (0B, 16, "%s: error looking up mutex handle %p", &__func__, handle);
      D.10851 = 0;
      return D.10851;
      <D.10850>:
      {
        struct __pthread_unwind_buf_t __cancel_buf;
        void (*<Tc2>) (void *) __cancel_routine;
        void * __cancel_arg;
        int __not_first_call;

        try
          {
            __cancel_routine = _wapi_handle_unlock_handle;
            __cancel_arg = handle;
            __not_first_call = __sigsetjmp (&__cancel_buf.__cancel_jmp_buf, 0);
            D.10852 = (long int) __not_first_call;
            D.10853 = __builtin_expect (D.10852, 0);
            if (D.10853 != 0) goto <D.10854>; else goto <D.10855>;
            <D.10854>:
            __cancel_routine (__cancel_arg);
            __pthread_unwind_next (&__cancel_buf);
            <D.10855>:
            __pthread_register_cancel (&__cancel_buf);
            thr_ret = _wapi_handle_lock_handle (handle);
            D.10856 = thr_ret != 0;
            D.10857 = (long int) D.10856;
            D.10858 = __builtin_expect (D.10857, 0);
            if (D.10858 != 0) goto <D.10859>; else goto <D.10860>;
            <D.10859>:
            monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mutexes.c", 565, "thr_ret == 0");
            <D.10860>:
            mutex_handle.19 = mutex_handle;
            D.10862 = mutex_handle.19->tid;
            D.10863 = pthread_equal (D.10862, tid);
            if (D.10863 == 0) goto cleanup; else goto <D.10864>;
            <D.10864>:
            mutex_handle.19 = mutex_handle;
            D.10865 = mutex_handle.19->pid;
            if (D.10865 != pid) goto cleanup; else goto <D.10866>;
            <D.10866>:
            ret = 1;
            mutex_handle.19 = mutex_handle;
            D.10867 = mutex_handle.19->recursion;
            D.10868 = D.10867 + 4294967295;
            mutex_handle.19->recursion = D.10868;
            mutex_handle.19 = mutex_handle;
            D.10867 = mutex_handle.19->recursion;
            if (D.10867 == 0) goto <D.10869>; else goto <D.10870>;
            <D.10869>:
            _wapi_thread_disown_mutex (handle);
            mutex_handle.19 = mutex_handle;
            mutex_handle.19->pid = 0;
            mutex_handle.19 = mutex_handle;
            mutex_handle.19->tid = 0;
            _wapi_handle_set_signal_state (handle, 1, 0);
            <D.10870>:
            cleanup:
            thr_ret = _wapi_handle_unlock_handle (handle);
            D.10856 = thr_ret != 0;
            D.10857 = (long int) D.10856;
            D.10858 = __builtin_expect (D.10857, 0);
            if (D.10858 != 0) goto <D.10871>; else goto <D.10872>;
            <D.10871>:
            monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mutexes.c", 592, "thr_ret == 0");
            <D.10872>:
            __pthread_unregister_cancel (&__cancel_buf);
            if (0 != 0) goto <D.10873>; else goto <D.10874>;
            <D.10873>:
            __cancel_routine (__cancel_arg);
            <D.10874>:
          }
        finally
          {
            __cancel_buf = {CLOBBER};
          }
      }
      D.10851 = ret;
      return D.10851;
    }
  finally
    {
      mutex_handle = {CLOBBER};
    }
}


OpenMutex (guint32 access, gboolean inherit, const gunichar2 * name)
{
  _Bool D.10881;
  long int D.10882;
  long int D.10883;
  unsigned int offset.20;
  void * D.10893;
  void * handle;
  gchar * utf8_name;
  int thr_ret;
  void * ret;
  gint32 offset;
  void cleanup = <<< error >>>;
  static const char __func__[10] = "OpenMutex";

  ret = 0B;
  mono_once (&mutex_ops_once, mutex_ops_init);
  thr_ret = _wapi_namespace_lock ();
  D.10881 = thr_ret != 0;
  D.10882 = (long int) D.10881;
  D.10883 = __builtin_expect (D.10882, 0);
  if (D.10883 != 0) goto <D.10884>; else goto <D.10885>;
  <D.10884>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mutexes.c", 689, "thr_ret == 0");
  <D.10885>:
  utf8_name = monoeg_g_utf16_to_utf8 (name, -1, 0B, 0B, 0B);
  offset = _wapi_search_handle_namespace (11, utf8_name);
  if (offset == -1) goto <D.10886>; else goto <D.10887>;
  <D.10886>:
  SetLastError (6);
  goto cleanup;
  <D.10887>:
  if (offset == 0) goto <D.10888>; else goto <D.10889>;
  <D.10888>:
  SetLastError (2);
  goto cleanup;
  <D.10889>:
  offset.20 = (unsigned int) offset;
  handle = _wapi_handle_new_from_offset (11, offset.20, 1);
  if (handle == -1B) goto <D.10891>; else goto <D.10892>;
  <D.10891>:
  monoeg_g_log (0B, 16, "%s: error opening named mutex handle", &__func__);
  SetLastError (31);
  goto cleanup;
  <D.10892>:
  ret = handle;
  cleanup:
  monoeg_g_free (utf8_name);
  _wapi_namespace_unlock (0B);
  D.10893 = ret;
  return D.10893;
}


