mono_debugger_lock ()
{
  int initialized.0;
  _Bool D.19073;
  long int D.19074;
  long int D.19075;
  _Bool D.19080;
  long int D.19081;
  long int D.19082;
  unsigned int debugger_lock_level.1;
  unsigned int debugger_lock_level.2;

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

    ret = pthread_mutex_lock (&debugger_lock_mutex.mutex);
    if (ret != 0) goto <D.19078>; else goto <D.19079>;
    <D.19078>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.19079>:
    D.19080 = ret != 0;
    D.19081 = (long int) D.19080;
    D.19082 = __builtin_expect (D.19081, 0);
    if (D.19082 != 0) goto <D.19083>; else goto <D.19084>;
    <D.19083>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-debug-debugger.c", 46, "ret == 0");
    <D.19084>:
  }
  debugger_lock_level.1 = debugger_lock_level;
  debugger_lock_level.2 = debugger_lock_level.1 + 1;
  debugger_lock_level = debugger_lock_level.2;
}


mono_debugger_unlock ()
{
  int initialized.3;
  _Bool D.19088;
  long int D.19089;
  long int D.19090;
  unsigned int debugger_lock_level.4;
  unsigned int debugger_lock_level.5;
  _Bool D.19097;
  long int D.19098;
  long int D.19099;

  initialized.3 = initialized;
  D.19088 = initialized.3 == 0;
  D.19089 = (long int) D.19088;
  D.19090 = __builtin_expect (D.19089, 0);
  if (D.19090 != 0) goto <D.19091>; else goto <D.19092>;
  <D.19091>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-debug-debugger.c", 53, "initialized");
  <D.19092>:
  debugger_lock_level.4 = debugger_lock_level;
  debugger_lock_level.5 = debugger_lock_level.4 + 4294967295;
  debugger_lock_level = debugger_lock_level.5;
  {
    int ret;

    ret = pthread_mutex_unlock (&debugger_lock_mutex.mutex);
    if (ret != 0) goto <D.19095>; else goto <D.19096>;
    <D.19095>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.19096>:
    D.19097 = ret != 0;
    D.19098 = (long int) D.19097;
    D.19099 = __builtin_expect (D.19098, 0);
    if (D.19099 != 0) goto <D.19100>; else goto <D.19101>;
    <D.19100>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-debug-debugger.c", 55, "ret == 0");
    <D.19101>:
  }
}


mono_debugger_initialize ()
{
  InitializeCriticalSection (&debugger_lock_mutex);
  initialized = 1;
}


mono_debugger_insert_method_breakpoint (struct MonoMethod * method, guint64 index)
{
  unsigned int D.19102;
  struct MonoDebugMethodAddressList * D.19103;
  struct GPtrArray * method_breakpoints.6;
  struct GPtrArray * method_breakpoints.7;
  struct MonoDebugMethodAddressList * D.19108;
  struct MethodBreakpointInfo * info;

  info = monoeg_malloc0 (12);
  info->method = method;
  D.19102 = (unsigned int) index;
  info->index = D.19102;
  D.19103 = mono_debug_lookup_method_addresses (method);
  info->address_list = D.19103;
  method_breakpoints.6 = method_breakpoints;
  if (method_breakpoints.6 == 0B) goto <D.19105>; else goto <D.19106>;
  <D.19105>:
  method_breakpoints.7 = monoeg_g_ptr_array_new ();
  method_breakpoints = method_breakpoints.7;
  <D.19106>:
  method_breakpoints.6 = method_breakpoints;
  monoeg_g_ptr_array_add (method_breakpoints.6, info);
  D.19108 = info->address_list;
  return D.19108;
}


mono_debugger_remove_method_breakpoint (guint64 index)
{
  struct GPtrArray * method_breakpoints.8;
  int D.19113;
  void * * D.19114;
  unsigned int i.9;
  unsigned int D.19116;
  void * * D.19117;
  unsigned int D.19118;
  long long unsigned int D.19119;
  struct MonoDebugMethodAddressList * D.19122;
  unsigned int i.10;
  unsigned int D.19124;
  int i;

  method_breakpoints.8 = method_breakpoints;
  if (method_breakpoints.8 == 0B) goto <D.19111>; else goto <D.19112>;
  <D.19111>:
  D.19113 = 0;
  return D.19113;
  <D.19112>:
  i = 0;
  goto <D.19067>;
  <D.19066>:
  {
    struct MethodBreakpointInfo * info;

    method_breakpoints.8 = method_breakpoints;
    D.19114 = method_breakpoints.8->pdata;
    i.9 = (unsigned int) i;
    D.19116 = i.9 * 4;
    D.19117 = D.19114 + D.19116;
    info = *D.19117;
    D.19118 = info->index;
    D.19119 = (long long unsigned int) D.19118;
    if (D.19119 != index) goto <D.19120>; else goto <D.19121>;
    <D.19120>:
    // predicted unlikely by continue predictor.
    goto <D.19065>;
    <D.19121>:
    method_breakpoints.8 = method_breakpoints;
    monoeg_g_ptr_array_remove (method_breakpoints.8, info);
    D.19122 = info->address_list;
    monoeg_g_free (D.19122);
    monoeg_g_free (info);
    D.19113 = 1;
    return D.19113;
  }
  <D.19065>:
  i = i + 1;
  <D.19067>:
  i.10 = (unsigned int) i;
  method_breakpoints.8 = method_breakpoints;
  D.19124 = method_breakpoints.8->len;
  if (i.10 < D.19124) goto <D.19066>; else goto <D.19068>;
  <D.19068>:
  D.19113 = 0;
  return D.19113;
}


