mono_debugger_lock ()
{
  int initialized.0;
  _Bool D.17410;
  long int D.17411;
  long int D.17412;
  _Bool D.17417;
  long int D.17418;
  long int D.17419;
  unsigned int debugger_lock_level.1;
  unsigned int debugger_lock_level.2;

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

    ret = pthread_mutex_lock (&debugger_lock_mutex.mutex);
    if (ret != 0) goto <D.17415>; else goto <D.17416>;
    <D.17415>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_lock result %d", ret);
    <D.17416>:
    D.17417 = ret != 0;
    D.17418 = (long int) D.17417;
    D.17419 = __builtin_expect (D.17418, 0);
    if (D.17419 != 0) goto <D.17420>; else goto <D.17421>;
    <D.17420>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-debug-debugger.c", 46, "ret == 0");
    <D.17421>:
  }
  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.17425;
  long int D.17426;
  long int D.17427;
  unsigned int debugger_lock_level.4;
  unsigned int debugger_lock_level.5;
  _Bool D.17434;
  long int D.17435;
  long int D.17436;

  initialized.3 = initialized;
  D.17425 = initialized.3 == 0;
  D.17426 = (long int) D.17425;
  D.17427 = __builtin_expect (D.17426, 0);
  if (D.17427 != 0) goto <D.17428>; else goto <D.17429>;
  <D.17428>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-debug-debugger.c", 53, "initialized");
  <D.17429>:
  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.17432>; else goto <D.17433>;
    <D.17432>:
    monoeg_g_log (0B, 16, "Bad call to mono_mutex_unlock result %d", ret);
    <D.17433>:
    D.17434 = ret != 0;
    D.17435 = (long int) D.17434;
    D.17436 = __builtin_expect (D.17435, 0);
    if (D.17436 != 0) goto <D.17437>; else goto <D.17438>;
    <D.17437>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-debug-debugger.c", 55, "ret == 0");
    <D.17438>:
  }
}


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


mono_debugger_insert_method_breakpoint (struct MonoMethod * method, guint64 index)
{
  unsigned int D.17439;
  struct MonoDebugMethodAddressList * D.17440;
  struct GPtrArray * method_breakpoints.6;
  struct GPtrArray * method_breakpoints.7;
  struct MonoDebugMethodAddressList * D.17445;
  struct MethodBreakpointInfo * info;

  info = monoeg_malloc0 (24);
  info->method = method;
  D.17439 = (unsigned int) index;
  info->index = D.17439;
  D.17440 = mono_debug_lookup_method_addresses (method);
  info->address_list = D.17440;
  method_breakpoints.6 = method_breakpoints;
  if (method_breakpoints.6 == 0B) goto <D.17442>; else goto <D.17443>;
  <D.17442>:
  method_breakpoints.7 = monoeg_g_ptr_array_new ();
  method_breakpoints = method_breakpoints.7;
  <D.17443>:
  method_breakpoints.6 = method_breakpoints;
  monoeg_g_ptr_array_add (method_breakpoints.6, info);
  D.17445 = info->address_list;
  return D.17445;
}


mono_debugger_remove_method_breakpoint (guint64 index)
{
  struct GPtrArray * method_breakpoints.8;
  int D.17450;
  void * * D.17451;
  long unsigned int D.17452;
  long unsigned int D.17453;
  void * * D.17454;
  unsigned int D.17455;
  long unsigned int D.17456;
  struct MonoDebugMethodAddressList * D.17459;
  unsigned int i.9;
  unsigned int D.17461;
  int i;

  method_breakpoints.8 = method_breakpoints;
  if (method_breakpoints.8 == 0B) goto <D.17448>; else goto <D.17449>;
  <D.17448>:
  D.17450 = 0;
  return D.17450;
  <D.17449>:
  i = 0;
  goto <D.17406>;
  <D.17405>:
  {
    struct MethodBreakpointInfo * info;

    method_breakpoints.8 = method_breakpoints;
    D.17451 = method_breakpoints.8->pdata;
    D.17452 = (long unsigned int) i;
    D.17453 = D.17452 * 8;
    D.17454 = D.17451 + D.17453;
    info = *D.17454;
    D.17455 = info->index;
    D.17456 = (long unsigned int) D.17455;
    if (D.17456 != index) goto <D.17457>; else goto <D.17458>;
    <D.17457>:
    // predicted unlikely by continue predictor.
    goto <D.17404>;
    <D.17458>:
    method_breakpoints.8 = method_breakpoints;
    monoeg_g_ptr_array_remove (method_breakpoints.8, info);
    D.17459 = info->address_list;
    monoeg_g_free (D.17459);
    monoeg_g_free (info);
    D.17450 = 1;
    return D.17450;
  }
  <D.17404>:
  i = i + 1;
  <D.17406>:
  i.9 = (unsigned int) i;
  method_breakpoints.8 = method_breakpoints;
  D.17461 = method_breakpoints.8->len;
  if (i.9 < D.17461) goto <D.17405>; else goto <D.17407>;
  <D.17407>:
  D.17450 = 0;
  return D.17450;
}


