__attribute__((visibility ("hidden")))
mono_debugger_lock ()
{
  int initialized.0;
  _Bool D.17024;
  long int D.17025;
  long int D.17026;
  _Bool D.17031;
  long int D.17032;
  long int D.17033;
  unsigned int debugger_lock_level.1;
  unsigned int D.17037;

  initialized.0 = initialized;
  D.17024 = initialized.0 == 0;
  D.17025 = (long int) D.17024;
  D.17026 = __builtin_expect (D.17025, 0);
  if (D.17026 != 0) goto <D.17027>; else goto <D.17028>;
  <D.17027>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-debug-debugger.c", 45, "initialized");
  <D.17028>:
  {
    int ret;

    ret = pthread_mutex_lock (&debugger_lock_mutex.mutex);
    if (ret != 0) goto <D.17029>; else goto <D.17030>;
    <D.17029>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.17030>:
    D.17031 = ret != 0;
    D.17032 = (long int) D.17031;
    D.17033 = __builtin_expect (D.17032, 0);
    if (D.17033 != 0) goto <D.17034>; else goto <D.17035>;
    <D.17034>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-debug-debugger.c", 46, "ret == 0");
    <D.17035>:
  }
  debugger_lock_level.1 = debugger_lock_level;
  D.17037 = debugger_lock_level.1 + 1;
  debugger_lock_level = D.17037;
}


__attribute__((visibility ("hidden")))
mono_debugger_unlock ()
{
  int initialized.2;
  _Bool D.17039;
  long int D.17040;
  long int D.17041;
  unsigned int debugger_lock_level.3;
  unsigned int D.17045;
  _Bool D.17048;
  long int D.17049;
  long int D.17050;

  initialized.2 = initialized;
  D.17039 = initialized.2 == 0;
  D.17040 = (long int) D.17039;
  D.17041 = __builtin_expect (D.17040, 0);
  if (D.17041 != 0) goto <D.17042>; else goto <D.17043>;
  <D.17042>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-debug-debugger.c", 53, "initialized");
  <D.17043>:
  debugger_lock_level.3 = debugger_lock_level;
  D.17045 = debugger_lock_level.3 + 4294967295;
  debugger_lock_level = D.17045;
  {
    int ret;

    ret = pthread_mutex_unlock (&debugger_lock_mutex.mutex);
    if (ret != 0) goto <D.17046>; else goto <D.17047>;
    <D.17046>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.17047>:
    D.17048 = ret != 0;
    D.17049 = (long int) D.17048;
    D.17050 = __builtin_expect (D.17049, 0);
    if (D.17050 != 0) goto <D.17051>; else goto <D.17052>;
    <D.17051>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-debug-debugger.c", 55, "ret == 0");
    <D.17052>:
  }
}


__attribute__((visibility ("hidden")))
mono_debugger_initialize ()
{
  InitializeCriticalSection (&debugger_lock_mutex);
  initialized = 1;
}


__attribute__((visibility ("hidden")))
mono_debugger_insert_method_breakpoint (struct MonoMethod * method, guint64 index)
{
  unsigned int D.17053;
  struct MonoDebugMethodAddressList * D.17054;
  struct GPtrArray * method_breakpoints.4;
  struct GPtrArray * D.17058;
  struct MonoDebugMethodAddressList * D.17059;
  struct MethodBreakpointInfo * info;

  info = monoeg_malloc0 (24);
  info->method = method;
  D.17053 = (unsigned int) index;
  info->index = D.17053;
  D.17054 = mono_debug_lookup_method_addresses (method);
  info->address_list = D.17054;
  method_breakpoints.4 = method_breakpoints;
  if (method_breakpoints.4 == 0B) goto <D.17056>; else goto <D.17057>;
  <D.17056>:
  D.17058 = monoeg_g_ptr_array_new ();
  method_breakpoints = D.17058;
  <D.17057>:
  method_breakpoints.4 = method_breakpoints;
  monoeg_g_ptr_array_add (method_breakpoints.4, info);
  D.17059 = info->address_list;
  return D.17059;
}


__attribute__((visibility ("hidden")))
mono_debugger_remove_method_breakpoint (guint64 index)
{
  struct GPtrArray * method_breakpoints.5;
  int D.17064;
  void * * D.17065;
  long unsigned int D.17066;
  long unsigned int D.17067;
  void * * D.17068;
  unsigned int D.17069;
  long unsigned int D.17070;
  struct MonoDebugMethodAddressList * D.17073;
  unsigned int D.17074;
  unsigned int i.6;
  int i;

  method_breakpoints.5 = method_breakpoints;
  if (method_breakpoints.5 == 0B) goto <D.17062>; else goto <D.17063>;
  <D.17062>:
  D.17064 = 0;
  return D.17064;
  <D.17063>:
  i = 0;
  goto <D.17020>;
  <D.17019>:
  {
    struct MethodBreakpointInfo * info;

    method_breakpoints.5 = method_breakpoints;
    D.17065 = method_breakpoints.5->pdata;
    D.17066 = (long unsigned int) i;
    D.17067 = D.17066 * 8;
    D.17068 = D.17065 + D.17067;
    info = *D.17068;
    D.17069 = info->index;
    D.17070 = (long unsigned int) D.17069;
    if (D.17070 != index) goto <D.17071>; else goto <D.17072>;
    <D.17071>:
    // predicted unlikely by continue predictor.
    goto <D.17018>;
    <D.17072>:
    method_breakpoints.5 = method_breakpoints;
    monoeg_g_ptr_array_remove (method_breakpoints.5, info);
    D.17073 = info->address_list;
    monoeg_g_free (D.17073);
    monoeg_g_free (info);
    D.17064 = 1;
    return D.17064;
  }
  <D.17018>:
  i = i + 1;
  <D.17020>:
  method_breakpoints.5 = method_breakpoints;
  D.17074 = method_breakpoints.5->len;
  i.6 = (unsigned int) i;
  if (D.17074 > i.6) goto <D.17019>; else goto <D.17021>;
  <D.17021>:
  D.17064 = 0;
  return D.17064;
}


