mono_gc_alloc_obj (struct MonoVTable * vtable, size_t size)
{
  int has_per_allocation_action.0;
  _Bool D.19113;
  long int D.19114;
  long int D.19115;
  unsigned int verify_before_allocs.1;
  unsigned int current_alloc.2;
  unsigned int D.19122;
  unsigned int collect_before_allocs.3;
  unsigned int D.19128;
  struct GCMemSection * nursery_section.4;
  struct SgenThreadInfo * sgen_thread_info.5;
  void * D.19137;
  _Bool D.19138;
  long int D.19139;
  long int D.19140;
  void * res;

  has_per_allocation_action.0 = has_per_allocation_action;
  D.19113 = has_per_allocation_action.0 != 0;
  D.19114 = (long int) D.19113;
  D.19115 = __builtin_expect (D.19114, 0);
  if (D.19115 != 0) goto <D.19116>; else goto <D.19117>;
  <D.19116>:
  {
    static int alloc_count;
    int current_alloc;

    current_alloc = InterlockedIncrement (&alloc_count);
    verify_before_allocs.1 = verify_before_allocs;
    if (verify_before_allocs.1 != 0) goto <D.19119>; else goto <D.19120>;
    <D.19119>:
    current_alloc.2 = (unsigned int) current_alloc;
    verify_before_allocs.1 = verify_before_allocs;
    D.19122 = current_alloc.2 % verify_before_allocs.1;
    if (D.19122 == 0) goto <D.19123>; else goto <D.19124>;
    <D.19123>:
    sgen_check_whole_heap_stw ();
    <D.19124>:
    <D.19120>:
    collect_before_allocs.3 = collect_before_allocs;
    if (collect_before_allocs.3 != 0) goto <D.19126>; else goto <D.19127>;
    <D.19126>:
    current_alloc.2 = (unsigned int) current_alloc;
    collect_before_allocs.3 = collect_before_allocs;
    D.19128 = current_alloc.2 % collect_before_allocs.3;
    if (D.19128 == 0) goto <D.19129>; else goto <D.19130>;
    <D.19129>:
    nursery_section.4 = nursery_section;
    if (nursery_section.4 != 0B) goto <D.19132>; else goto <D.19133>;
    <D.19132>:
    pthread_mutex_lock (&gc_mutex);
    sgen_perform_collection (0, 0, "collect-before-alloc-triggered", 1);
    sgen_gc_unlock ();
    <D.19133>:
    <D.19130>:
    <D.19127>:
  }
  <D.19117>:
  sgen_thread_info.5 = sgen_thread_info;
  sgen_thread_info.5->in_critical_region = 1;
  mono_memory_barrier ();
  res = mono_gc_try_alloc_obj_nolock (vtable, size);
  if (res != 0B) goto <D.19135>; else goto <D.19136>;
  <D.19135>:
  sgen_thread_info.5 = sgen_thread_info;
  sgen_thread_info.5->in_critical_region = 0;
  D.19137 = res;
  return D.19137;
  <D.19136>:
  sgen_thread_info.5 = sgen_thread_info;
  sgen_thread_info.5->in_critical_region = 0;
  pthread_mutex_lock (&gc_mutex);
  res = mono_gc_alloc_obj_nolock (vtable, size);
  sgen_gc_unlock ();
  D.19138 = res == 0B;
  D.19139 = (long int) D.19138;
  D.19140 = __builtin_expect (D.19139, 0);
  if (D.19140 != 0) goto <D.19141>; else goto <D.19142>;
  <D.19141>:
  D.19137 = mono_gc_out_of_memory (size);
  return D.19137;
  <D.19142>:
  D.19137 = res;
  return D.19137;
}


InterlockedIncrement (volatile gint32 * val)
{
  gint32 D.19144;
  unsigned int D.19145;

  D.19145 = __sync_add_and_fetch_4 (val, 1);
  D.19144 = (gint32) D.19145;
  return D.19144;
}


mono_memory_barrier ()
{
  __sync_synchronize ();
}


mono_gc_try_alloc_obj_nolock (struct MonoVTable * vtable, size_t size)
{
  unsigned int D.19147;
  void * D.19150;
  _Bool D.19151;
  long int D.19152;
  long int D.19153;
  void * D.19158;
  unsigned int tlab_size.6;
  _Bool D.19160;
  long int D.19161;
  long int D.19162;
  <unnamed type> nursery_clear_policy.7;
  int real_end.8;
  int p.9;
  _Bool D.19173;
  long int D.19174;
  long int D.19175;
  char * tlab_temp_end.10;
  _Bool D.19179;
  long int D.19180;
  long int D.19181;
  char * tlab_next.11;
  char * D.19185;
  char * tlab_real_end.12;
  char * tlab_temp_end.13;
  struct FILE * gc_debug_file.14;
  char * tlab_next.15;
  unsigned int alloc_size.16;
  char * tlab_real_end.17;
  unsigned int D.19204;
  char * tlab_temp_end.18;
  struct MonoClass * D.19210;
  const char * D.19211;
  void * D.19214;
  _Bool D.19215;
  long int D.19216;
  long int D.19217;
  void * * p;
  char * new_next;

  D.19147 = size + 7;
  size = D.19147 & 4294967288;
  if (0 != 0) goto <D.19148>; else goto <D.19149>;
  <D.19148>:
  monoeg_g_log (0B, 4, "Object too small");
  <D.18987>:
  goto <D.18987>;
  <D.19149>:
  D.19150 = vtable->gc_descr;
  D.19151 = D.19150 == 0B;
  D.19152 = (long int) D.19151;
  D.19153 = __builtin_expect (D.19152, 0);
  if (D.19153 != 0) goto <D.19154>; else goto <D.19155>;
  <D.19154>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 352, "vtable->gc_descr");
  <D.19155>:
  if (size > 8000) goto <D.19156>; else goto <D.19157>;
  <D.19156>:
  D.19158 = 0B;
  return D.19158;
  <D.19157>:
  tlab_size.6 = tlab_size;
  D.19160 = size > tlab_size.6;
  D.19161 = (long int) D.19160;
  D.19162 = __builtin_expect (D.19161, 0);
  if (D.19162 != 0) goto <D.19163>; else goto <D.19164>;
  <D.19163>:
  p = sgen_nursery_alloc (size);
  if (p == 0B) goto <D.19165>; else goto <D.19166>;
  <D.19165>:
  D.19158 = 0B;
  return D.19158;
  <D.19166>:
  sgen_set_nursery_scan_start (p);
  nursery_clear_policy.7 = nursery_clear_policy;
  if (nursery_clear_policy.7 == 1) goto <D.19168>; else goto <D.19169>;
  <D.19168>:
  memset (p, 0, size);
  <D.19169>:
  goto <D.19170>;
  <D.19164>:
  {
    int available_in_tlab;
    char * real_end;

    p = tlab_next;
    new_next = p + size;
    real_end = tlab_real_end;
    real_end.8 = (int) real_end;
    p.9 = (int) p;
    available_in_tlab = real_end.8 - p.9;
    D.19173 = new_next < real_end;
    D.19174 = (long int) D.19173;
    D.19175 = __builtin_expect (D.19174, 1);
    if (D.19175 != 0) goto <D.19176>; else goto <D.19177>;
    <D.19176>:
    tlab_next = new_next;
    tlab_temp_end.10 = tlab_temp_end;
    D.19179 = new_next >= tlab_temp_end.10;
    D.19180 = (long int) D.19179;
    D.19181 = __builtin_expect (D.19180, 0);
    if (D.19181 != 0) goto <D.19182>; else goto <D.19183>;
    <D.19182>:
    sgen_set_nursery_scan_start (new_next);
    tlab_next.11 = tlab_next;
    D.19185 = tlab_next.11 + 8192;
    tlab_real_end.12 = tlab_real_end;
    tlab_temp_end.13 = MIN_EXPR <D.19185, tlab_real_end.12>;
    tlab_temp_end = tlab_temp_end.13;
    if (0 != 0) goto <D.19188>; else goto <D.19189>;
    <D.19188>:
    tlab_temp_end.10 = tlab_temp_end;
    tlab_next.11 = tlab_next;
    gc_debug_file.14 = gc_debug_file;
    fprintf (gc_debug_file.14, "Expanding local alloc: %p-%p\n", tlab_next.11, tlab_temp_end.10);
    gc_debug_file.14 = gc_debug_file;
    fflush (gc_debug_file.14);
    <D.19189>:
    <D.19183>:
    goto <D.19191>;
    <D.19177>:
    if (available_in_tlab > 512) goto <D.19192>; else goto <D.19193>;
    <D.19192>:
    p = sgen_nursery_alloc (size);
    if (p == 0B) goto <D.19194>; else goto <D.19195>;
    <D.19194>:
    D.19158 = 0B;
    return D.19158;
    <D.19195>:
    nursery_clear_policy.7 = nursery_clear_policy;
    if (nursery_clear_policy.7 == 1) goto <D.19196>; else goto <D.19197>;
    <D.19196>:
    memset (p, 0, size);
    <D.19197>:
    goto <D.19198>;
    <D.19193>:
    {
      size_t alloc_size;

      try
        {
          alloc_size = 0;
          sgen_nursery_retire_region (p, available_in_tlab);
          tlab_size.6 = tlab_size;
          new_next = sgen_nursery_alloc_range (tlab_size.6, size, &alloc_size);
          p = new_next;
          if (p == 0B) goto <D.19199>; else goto <D.19200>;
          <D.19199>:
          D.19158 = 0B;
          return D.19158;
          <D.19200>:
          tlab_start = new_next;
          tlab_next.15 = new_next + size;
          tlab_next = tlab_next.15;
          alloc_size.16 = alloc_size;
          tlab_real_end.17 = new_next + alloc_size.16;
          tlab_real_end = tlab_real_end.17;
          alloc_size.16 = alloc_size;
          D.19204 = MIN_EXPR <alloc_size.16, 8192>;
          tlab_temp_end.18 = new_next + D.19204;
          tlab_temp_end = tlab_temp_end.18;
          sgen_set_nursery_scan_start (p);
          nursery_clear_policy.7 = nursery_clear_policy;
          if (nursery_clear_policy.7 == 1) goto <D.19206>; else goto <D.19207>;
          <D.19206>:
          alloc_size.16 = alloc_size;
          memset (new_next, 0, alloc_size.16);
          <D.19207>:
        }
      finally
        {
          alloc_size = {CLOBBER};
        }
    }
    <D.19198>:
    <D.19191>:
  }
  <D.19170>:
  if (0 != 0) goto <D.19208>; else goto <D.19209>;
  <D.19208>:
  D.19210 = vtable->klass;
  D.19211 = D.19210->name;
  gc_debug_file.14 = gc_debug_file;
  fprintf (gc_debug_file.14, "Allocated object %p, vtable: %p (%s), size: %zd\n", p, vtable, D.19211, size);
  gc_debug_file.14 = gc_debug_file;
  fflush (gc_debug_file.14);
  <D.19209>:
  if (0 != 0) goto <D.19212>; else goto <D.19213>;
  <D.19212>:
  <D.19213>:
  D.19214 = *p;
  D.19215 = D.19214 != 0B;
  D.19216 = (long int) D.19215;
  D.19217 = __builtin_expect (D.19216, 0);
  if (D.19217 != 0) goto <D.19218>; else goto <D.19219>;
  <D.19218>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 425, "*p == NULL");
  <D.19219>:
  *p = vtable;
  D.19158 = p;
  return D.19158;
}


sgen_set_nursery_scan_start (char * p)
{
  int p.19;
  struct GCMemSection * nursery_section.20;
  char * D.19225;
  int D.19226;
  int D.19227;
  char * * D.19228;
  unsigned int idx.21;
  unsigned int D.19230;
  char * * D.19231;
  _Bool D.19232;
  _Bool D.19233;
  _Bool D.19234;
  int idx;
  char * old;

  p.19 = (int) p;
  nursery_section.20 = nursery_section;
  D.19225 = nursery_section.20->data;
  D.19226 = (int) D.19225;
  D.19227 = p.19 - D.19226;
  idx = D.19227 / 8192;
  nursery_section.20 = nursery_section;
  D.19228 = nursery_section.20->scan_starts;
  idx.21 = (unsigned int) idx;
  D.19230 = idx.21 * 4;
  D.19231 = D.19228 + D.19230;
  old = *D.19231;
  D.19232 = old == 0B;
  D.19233 = old > p;
  D.19234 = D.19232 | D.19233;
  if (D.19234 != 0) goto <D.19235>; else goto <D.19236>;
  <D.19235>:
  nursery_section.20 = nursery_section;
  D.19228 = nursery_section.20->scan_starts;
  idx.21 = (unsigned int) idx;
  D.19230 = idx.21 * 4;
  D.19231 = D.19228 + D.19230;
  *D.19231 = p;
  <D.19236>:
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.19239;
  int D.19244;
  void * D.19246;
  unsigned int D.19247;

  D.19239 = __builtin_constant_p (__len);
  if (D.19239 != 0) goto <D.19240>; else goto <D.19241>;
  <D.19240>:
  if (__len == 0) goto <D.19242>; else goto <D.19243>;
  <D.19242>:
  D.19244 = __builtin_constant_p (__ch);
  if (D.19244 == 0) goto <D.19237>; else goto <D.19245>;
  <D.19245>:
  if (__ch != 0) goto <D.19237>; else goto <D.19238>;
  <D.19237>:
  __warn_memset_zero_len ();
  D.19246 = __dest;
  return D.19246;
  <D.19238>:
  <D.19243>:
  <D.19241>:
  D.19247 = __builtin_object_size (__dest, 0);
  D.19246 = __builtin___memset_chk (__dest, __ch, __len, D.19247);
  return D.19246;
}


mono_gc_alloc_obj_nolock (struct MonoVTable * vtable, size_t size)
{
  unsigned int D.19252;
  void * D.19253;
  _Bool D.19254;
  long int D.19255;
  long int D.19256;
  int has_per_allocation_action.22;
  _Bool D.19260;
  long int D.19261;
  long int D.19262;
  unsigned int collect_before_allocs.23;
  unsigned int current_alloc.24;
  unsigned int D.19269;
  struct GCMemSection * nursery_section.25;
  int degraded_mode.26;
  int D.19278;
  unsigned int verify_before_allocs.27;
  unsigned int D.19287;
  char * tlab_temp_end.28;
  _Bool D.19294;
  long int D.19295;
  long int D.19296;
  struct MonoClass * D.19301;
  const char * D.19302;
  struct FILE * gc_debug_file.29;
  void * D.19306;
  _Bool D.19307;
  long int D.19308;
  long int D.19309;
  void * D.19312;
  char * tlab_next.30;
  char * tlab_real_end.31;
  sizetype D.19317;
  char * tlab_next.32;
  int sgen_nursery_size.33;
  int tlab_real_end.34;
  int tlab_next.35;
  unsigned int tlab_size.36;
  <unnamed type> nursery_clear_policy.37;
  char * tlab_start.38;
  int D.19347;
  unsigned int D.19348;
  unsigned int D.19349;
  long int D.19350;
  unsigned int alloc_size.39;
  char * tlab_real_end.40;
  unsigned int D.19361;
  char * tlab_temp_end.41;
  char * tlab_next.42;
  char * D.19367;
  char * tlab_temp_end.43;
  _Bool D.19371;
  long int D.19372;
  long int D.19373;
  void * * p;
  char * new_next;

  if (size <= 8000) goto <D.19249>; else goto <D.19250>;
  <D.19249>:
  goto <D.19251>;
  <D.19250>:
  <D.19251>:
  D.19252 = size + 7;
  size = D.19252 & 4294967288;
  D.19253 = vtable->gc_descr;
  D.19254 = D.19253 == 0B;
  D.19255 = (long int) D.19254;
  D.19256 = __builtin_expect (D.19255, 0);
  if (D.19256 != 0) goto <D.19257>; else goto <D.19258>;
  <D.19257>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 172, "vtable->gc_descr");
  <D.19258>:
  has_per_allocation_action.22 = has_per_allocation_action;
  D.19260 = has_per_allocation_action.22 != 0;
  D.19261 = (long int) D.19260;
  D.19262 = __builtin_expect (D.19261, 0);
  if (D.19262 != 0) goto <D.19263>; else goto <D.19264>;
  <D.19263>:
  {
    static int alloc_count;
    int current_alloc;

    current_alloc = InterlockedIncrement (&alloc_count);
    collect_before_allocs.23 = collect_before_allocs;
    if (collect_before_allocs.23 != 0) goto <D.19266>; else goto <D.19267>;
    <D.19266>:
    current_alloc.24 = (unsigned int) current_alloc;
    collect_before_allocs.23 = collect_before_allocs;
    D.19269 = current_alloc.24 % collect_before_allocs.23;
    if (D.19269 == 0) goto <D.19270>; else goto <D.19271>;
    <D.19270>:
    nursery_section.25 = nursery_section;
    if (nursery_section.25 != 0B) goto <D.19273>; else goto <D.19274>;
    <D.19273>:
    sgen_perform_collection (0, 0, "collect-before-alloc-triggered", 1);
    degraded_mode.26 = degraded_mode;
    if (degraded_mode.26 == 0) goto <D.19276>; else goto <D.19277>;
    <D.19276>:
    D.19278 = sgen_can_alloc_size (size);
    if (D.19278 != 0) goto <D.19279>; else goto <D.19280>;
    <D.19279>:
    if (size <= 8000) goto <D.19281>; else goto <D.19282>;
    <D.19281>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "sgen-alloc.c", 183);
    <D.19282>:
    <D.19280>:
    <D.19277>:
    <D.19274>:
    <D.19271>:
    goto <D.19283>;
    <D.19267>:
    verify_before_allocs.27 = verify_before_allocs;
    if (verify_before_allocs.27 != 0) goto <D.19285>; else goto <D.19286>;
    <D.19285>:
    current_alloc.24 = (unsigned int) current_alloc;
    verify_before_allocs.27 = verify_before_allocs;
    D.19287 = current_alloc.24 % verify_before_allocs.27;
    if (D.19287 == 0) goto <D.19288>; else goto <D.19289>;
    <D.19288>:
    sgen_check_whole_heap_stw ();
    <D.19289>:
    <D.19286>:
    <D.19283>:
  }
  <D.19264>:
  if (size > 8000) goto <D.19290>; else goto <D.19291>;
  <D.19290>:
  p = sgen_los_alloc_large_inner (vtable, size);
  goto <D.19292>;
  <D.19291>:
  p = tlab_next;
  new_next = p + size;
  tlab_next = new_next;
  tlab_temp_end.28 = tlab_temp_end;
  D.19294 = new_next < tlab_temp_end.28;
  D.19295 = (long int) D.19294;
  D.19296 = __builtin_expect (D.19295, 1);
  if (D.19296 != 0) goto <D.19297>; else goto <D.19298>;
  <D.19297>:
  if (0 != 0) goto <D.19299>; else goto <D.19300>;
  <D.19299>:
  D.19301 = vtable->klass;
  D.19302 = D.19301->name;
  gc_debug_file.29 = gc_debug_file;
  fprintf (gc_debug_file.29, "Allocated object %p, vtable: %p (%s), size: %zd\n", p, vtable, D.19302, size);
  gc_debug_file.29 = gc_debug_file;
  fflush (gc_debug_file.29);
  <D.19300>:
  if (0 != 0) goto <D.19304>; else goto <D.19305>;
  <D.19304>:
  <D.19305>:
  D.19306 = *p;
  D.19307 = D.19306 != 0B;
  D.19308 = (long int) D.19307;
  D.19309 = __builtin_expect (D.19308, 0);
  if (D.19309 != 0) goto <D.19310>; else goto <D.19311>;
  <D.19310>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 225, "*p == NULL");
  <D.19311>:
  *p = vtable;
  D.19312 = p;
  return D.19312;
  <D.19298>:
  tlab_next.30 = tlab_next;
  tlab_real_end.31 = tlab_real_end;
  if (tlab_next.30 >= tlab_real_end.31) goto <D.19315>; else goto <D.19316>;
  <D.19315>:
  {
    int available_in_tlab;

    tlab_next.30 = tlab_next;
    D.19317 = -size;
    tlab_next.32 = tlab_next.30 + D.19317;
    tlab_next = tlab_next.32;
    degraded_mode.26 = degraded_mode;
    if (degraded_mode.26 != 0) goto <D.19319>; else goto <D.19320>;
    <D.19319>:
    degraded_mode.26 = degraded_mode;
    sgen_nursery_size.33 = sgen_nursery_size;
    if (degraded_mode.26 < sgen_nursery_size.33) goto <D.19322>; else goto <D.19323>;
    <D.19322>:
    D.19312 = alloc_degraded (vtable, size, 0);
    return D.19312;
    <D.19323>:
    <D.19320>:
    tlab_real_end.31 = tlab_real_end;
    tlab_real_end.34 = (int) tlab_real_end.31;
    tlab_next.30 = tlab_next;
    tlab_next.35 = (int) tlab_next.30;
    available_in_tlab = tlab_real_end.34 - tlab_next.35;
    tlab_size.36 = tlab_size;
    if (size > tlab_size.36) goto <D.19326>; else goto <D.19330>;
    <D.19330>:
    if (available_in_tlab > 512) goto <D.19326>; else goto <D.19327>;
    <D.19326>:
    <D.18976>:
    p = sgen_nursery_alloc (size);
    if (p == 0B) goto <D.19331>; else goto <D.19332>;
    <D.19331>:
    sgen_ensure_free_space (size);
    degraded_mode.26 = degraded_mode;
    if (degraded_mode.26 != 0) goto <D.19333>; else goto <D.19334>;
    <D.19333>:
    D.19312 = alloc_degraded (vtable, size, 0);
    return D.19312;
    <D.19334>:
    p = sgen_nursery_alloc (size);
    <D.19332>:
    if (p == 0B) goto <D.18976>; else goto <D.18977>;
    <D.18977>:
    if (p == 0B) goto <D.19335>; else goto <D.19336>;
    <D.19335>:
    if (1 != 0) goto <D.19337>; else goto <D.19338>;
    <D.19337>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 273, "0");
    <D.19338>:
    <D.19336>:
    nursery_clear_policy.37 = nursery_clear_policy;
    if (nursery_clear_policy.37 == 1) goto <D.19340>; else goto <D.19341>;
    <D.19340>:
    memset (p, 0, size);
    <D.19341>:
    goto <D.19328>;
    <D.19327>:
    {
      size_t alloc_size;

      try
        {
          alloc_size = 0;
          tlab_start.38 = tlab_start;
          if (tlab_start.38 != 0B) goto <D.19343>; else goto <D.19344>;
          <D.19343>:
          if (0 != 0) goto <D.19345>; else goto <D.19346>;
          <D.19345>:
          tlab_real_end.31 = tlab_real_end;
          tlab_real_end.34 = (int) tlab_real_end.31;
          tlab_next.30 = tlab_next;
          tlab_next.35 = (int) tlab_next.30;
          D.19347 = tlab_real_end.34 - tlab_next.35;
          D.19348 = (unsigned int) D.19347;
          D.19349 = D.19348 - size;
          D.19350 = (long int) D.19349;
          tlab_real_end.31 = tlab_real_end;
          tlab_start.38 = tlab_start;
          gc_debug_file.29 = gc_debug_file;
          fprintf (gc_debug_file.29, "Retire TLAB: %p-%p [%ld]\n", tlab_start.38, tlab_real_end.31, D.19350);
          gc_debug_file.29 = gc_debug_file;
          fflush (gc_debug_file.29);
          <D.19346>:
          <D.19344>:
          sgen_nursery_retire_region (p, available_in_tlab);
          <D.18979>:
          tlab_size.36 = tlab_size;
          p = sgen_nursery_alloc_range (tlab_size.36, size, &alloc_size);
          if (p == 0B) goto <D.19351>; else goto <D.19352>;
          <D.19351>:
          tlab_size.36 = tlab_size;
          sgen_ensure_free_space (tlab_size.36);
          degraded_mode.26 = degraded_mode;
          if (degraded_mode.26 != 0) goto <D.19353>; else goto <D.19354>;
          <D.19353>:
          D.19312 = alloc_degraded (vtable, size, 0);
          return D.19312;
          <D.19354>:
          tlab_size.36 = tlab_size;
          p = sgen_nursery_alloc_range (tlab_size.36, size, &alloc_size);
          <D.19352>:
          if (p == 0B) goto <D.18979>; else goto <D.18980>;
          <D.18980>:
          if (p == 0B) goto <D.19355>; else goto <D.19356>;
          <D.19355>:
          if (1 != 0) goto <D.19357>; else goto <D.19358>;
          <D.19357>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 298, "0");
          <D.19358>:
          <D.19356>:
          tlab_start = p;
          tlab_start.38 = tlab_start;
          tlab_next = tlab_start.38;
          tlab_start.38 = tlab_start;
          alloc_size.39 = alloc_size;
          tlab_real_end.40 = tlab_start.38 + alloc_size.39;
          tlab_real_end = tlab_real_end.40;
          tlab_start.38 = tlab_start;
          alloc_size.39 = alloc_size;
          D.19361 = MIN_EXPR <alloc_size.39, 8192>;
          tlab_temp_end.41 = tlab_start.38 + D.19361;
          tlab_temp_end = tlab_temp_end.41;
          nursery_clear_policy.37 = nursery_clear_policy;
          if (nursery_clear_policy.37 == 1) goto <D.19363>; else goto <D.19364>;
          <D.19363>:
          alloc_size.39 = alloc_size;
          tlab_start.38 = tlab_start;
          memset (tlab_start.38, 0, alloc_size.39);
          <D.19364>:
          p = tlab_next;
          tlab_next.30 = tlab_next;
          tlab_next.42 = tlab_next.30 + size;
          tlab_next = tlab_next.42;
          sgen_set_nursery_scan_start (p);
        }
      finally
        {
          alloc_size = {CLOBBER};
        }
    }
    <D.19328>:
  }
  goto <D.19366>;
  <D.19316>:
  sgen_set_nursery_scan_start (p);
  tlab_next.30 = tlab_next;
  D.19367 = tlab_next.30 + 8192;
  tlab_real_end.31 = tlab_real_end;
  tlab_temp_end.43 = MIN_EXPR <D.19367, tlab_real_end.31>;
  tlab_temp_end = tlab_temp_end.43;
  if (0 != 0) goto <D.19369>; else goto <D.19370>;
  <D.19369>:
  tlab_temp_end.28 = tlab_temp_end;
  tlab_next.30 = tlab_next;
  gc_debug_file.29 = gc_debug_file;
  fprintf (gc_debug_file.29, "Expanding local alloc: %p-%p\n", tlab_next.30, tlab_temp_end.28);
  gc_debug_file.29 = gc_debug_file;
  fflush (gc_debug_file.29);
  <D.19370>:
  <D.19366>:
  <D.19292>:
  D.19371 = p != 0B;
  D.19372 = (long int) D.19371;
  D.19373 = __builtin_expect (D.19372, 1);
  if (D.19373 != 0) goto <D.19374>; else goto <D.19375>;
  <D.19374>:
  if (0 != 0) goto <D.19376>; else goto <D.19377>;
  <D.19376>:
  D.19301 = vtable->klass;
  D.19302 = D.19301->name;
  gc_debug_file.29 = gc_debug_file;
  fprintf (gc_debug_file.29, "Allocated object %p, vtable: %p (%s), size: %zd\n", p, vtable, D.19302, size);
  gc_debug_file.29 = gc_debug_file;
  fflush (gc_debug_file.29);
  <D.19377>:
  if (0 != 0) goto <D.19378>; else goto <D.19379>;
  <D.19378>:
  if (size > 8000) goto <D.19380>; else goto <D.19381>;
  <D.19380>:
  goto <D.19382>;
  <D.19381>:
  <D.19382>:
  <D.19379>:
  *p = vtable;
  <D.19375>:
  D.19312 = p;
  return D.19312;
}


alloc_degraded (struct MonoVTable * vtable, size_t size, gboolean for_mature)
{
  int last_major_gc_warned.44;
  int stat_major_gcs.45;
  int num_degraded.46;
  int num_degraded.47;
  int num_degraded.48;
  _Bool D.19395;
  _Bool D.19396;
  _Bool D.19397;
  struct _IO_FILE * stderr.49;
  int size.50;
  int D.19406;
  _Bool D.19409;
  int D.19410;
  void * (*<T2c36>) (struct MonoVTable *, size_t) D.19411;
  void * D.19415;
  static int last_major_gc_warned = -1;
  static int num_degraded = 0;
  void * p;

  if (for_mature == 0) goto <D.19386>; else goto <D.19387>;
  <D.19386>:
  last_major_gc_warned.44 = last_major_gc_warned;
  stat_major_gcs.45 = stat_major_gcs;
  if (last_major_gc_warned.44 < stat_major_gcs.45) goto <D.19390>; else goto <D.19391>;
  <D.19390>:
  num_degraded.46 = num_degraded;
  num_degraded.47 = num_degraded.46 + 1;
  num_degraded = num_degraded.47;
  num_degraded.48 = num_degraded;
  D.19395 = num_degraded.48 == 1;
  D.19396 = num_degraded.48 == 3;
  D.19397 = D.19395 | D.19396;
  if (D.19397 != 0) goto <D.19398>; else goto <D.19399>;
  <D.19398>:
  stderr.49 = stderr;
  fprintf (stderr.49, "Warning: Degraded allocation.  Consider increasing nursery-size if the warning persists.\n");
  goto <D.19401>;
  <D.19399>:
  num_degraded.46 = num_degraded;
  if (num_degraded.46 == 10) goto <D.19402>; else goto <D.19403>;
  <D.19402>:
  stderr.49 = stderr;
  fprintf (stderr.49, "Warning: Repeated degraded allocation.  Consider increasing nursery-size.\n");
  <D.19403>:
  <D.19401>:
  stat_major_gcs.45 = stat_major_gcs;
  last_major_gc_warned = stat_major_gcs.45;
  <D.19391>:
  size.50 = (int) size;
  InterlockedExchangeAdd (&degraded_mode, size.50);
  sgen_ensure_free_space (size);
  goto <D.19405>;
  <D.19387>:
  D.19406 = sgen_need_major_collection (size);
  if (D.19406 != 0) goto <D.19407>; else goto <D.19408>;
  <D.19407>:
  D.19409 = for_mature == 0;
  D.19410 = (int) D.19409;
  sgen_perform_collection (size, 1, "mature allocation failure", D.19410);
  <D.19408>:
  <D.19405>:
  D.19411 = major_collector.alloc_degraded;
  p = D.19411 (vtable, size);
  if (for_mature != 0) goto <D.19412>; else goto <D.19413>;
  <D.19412>:
  goto <D.19414>;
  <D.19413>:
  <D.19414>:
  D.19415 = p;
  return D.19415;
}


fprintf (struct FILE * restrict __stream, const char * restrict __fmt)
{
  int D.19417;

  D.19417 = __fprintf_chk (__stream, 1, __fmt, __builtin_va_arg_pack ());
  return D.19417;
}


InterlockedExchangeAdd (volatile gint32 * val, gint32 add)
{
  gint32 D.19419;
  unsigned int add.51;
  unsigned int D.19421;

  add.51 = (unsigned int) add;
  D.19421 = __sync_fetch_and_add_4 (val, add.51);
  D.19419 = (gint32) D.19421;
  return D.19419;
}


mono_gc_alloc_vector (struct MonoVTable * vtable, size_t size, uintptr_t max_length)
{
  struct SgenThreadInfo * sgen_thread_info.52;
  void * D.19426;
  _Bool D.19427;
  long int D.19428;
  long int D.19429;
  struct MonoArray * arr;

  sgen_thread_info.52 = sgen_thread_info;
  sgen_thread_info.52->in_critical_region = 1;
  mono_memory_barrier ();
  arr = mono_gc_try_alloc_obj_nolock (vtable, size);
  if (arr != 0B) goto <D.19424>; else goto <D.19425>;
  <D.19424>:
  arr->max_length = max_length;
  sgen_thread_info.52 = sgen_thread_info;
  sgen_thread_info.52->in_critical_region = 0;
  D.19426 = arr;
  return D.19426;
  <D.19425>:
  sgen_thread_info.52 = sgen_thread_info;
  sgen_thread_info.52->in_critical_region = 0;
  pthread_mutex_lock (&gc_mutex);
  arr = mono_gc_alloc_obj_nolock (vtable, size);
  D.19427 = arr == 0B;
  D.19428 = (long int) D.19427;
  D.19429 = __builtin_expect (D.19428, 0);
  if (D.19429 != 0) goto <D.19430>; else goto <D.19431>;
  <D.19430>:
  sgen_gc_unlock ();
  D.19426 = mono_gc_out_of_memory (size);
  return D.19426;
  <D.19431>:
  arr->max_length = max_length;
  sgen_gc_unlock ();
  D.19426 = arr;
  return D.19426;
}


mono_gc_alloc_array (struct MonoVTable * vtable, size_t size, uintptr_t max_length, uintptr_t bounds_size)
{
  struct SgenThreadInfo * sgen_thread_info.53;
  sizetype D.19436;
  void * D.19437;
  _Bool D.19438;
  long int D.19439;
  long int D.19440;
  struct MonoArray * arr;
  struct MonoArrayBounds * bounds;

  sgen_thread_info.53 = sgen_thread_info;
  sgen_thread_info.53->in_critical_region = 1;
  mono_memory_barrier ();
  arr = mono_gc_try_alloc_obj_nolock (vtable, size);
  if (arr != 0B) goto <D.19434>; else goto <D.19435>;
  <D.19434>:
  arr->max_length = max_length;
  D.19436 = size - bounds_size;
  bounds = arr + D.19436;
  arr->bounds = bounds;
  sgen_thread_info.53 = sgen_thread_info;
  sgen_thread_info.53->in_critical_region = 0;
  D.19437 = arr;
  return D.19437;
  <D.19435>:
  sgen_thread_info.53 = sgen_thread_info;
  sgen_thread_info.53->in_critical_region = 0;
  pthread_mutex_lock (&gc_mutex);
  arr = mono_gc_alloc_obj_nolock (vtable, size);
  D.19438 = arr == 0B;
  D.19439 = (long int) D.19438;
  D.19440 = __builtin_expect (D.19439, 0);
  if (D.19440 != 0) goto <D.19441>; else goto <D.19442>;
  <D.19441>:
  sgen_gc_unlock ();
  D.19437 = mono_gc_out_of_memory (size);
  return D.19437;
  <D.19442>:
  arr->max_length = max_length;
  D.19436 = size - bounds_size;
  bounds = arr + D.19436;
  arr->bounds = bounds;
  sgen_gc_unlock ();
  D.19437 = arr;
  return D.19437;
}


mono_gc_alloc_string (struct MonoVTable * vtable, size_t size, gint32 len)
{
  struct SgenThreadInfo * sgen_thread_info.54;
  void * D.19447;
  _Bool D.19448;
  long int D.19449;
  long int D.19450;
  struct MonoString * str;

  sgen_thread_info.54 = sgen_thread_info;
  sgen_thread_info.54->in_critical_region = 1;
  mono_memory_barrier ();
  str = mono_gc_try_alloc_obj_nolock (vtable, size);
  if (str != 0B) goto <D.19445>; else goto <D.19446>;
  <D.19445>:
  str->length = len;
  sgen_thread_info.54 = sgen_thread_info;
  sgen_thread_info.54->in_critical_region = 0;
  D.19447 = str;
  return D.19447;
  <D.19446>:
  sgen_thread_info.54 = sgen_thread_info;
  sgen_thread_info.54->in_critical_region = 0;
  pthread_mutex_lock (&gc_mutex);
  str = mono_gc_alloc_obj_nolock (vtable, size);
  D.19448 = str == 0B;
  D.19449 = (long int) D.19448;
  D.19450 = __builtin_expect (D.19449, 0);
  if (D.19450 != 0) goto <D.19451>; else goto <D.19452>;
  <D.19451>:
  sgen_gc_unlock ();
  D.19447 = mono_gc_out_of_memory (size);
  return D.19447;
  <D.19452>:
  str->length = len;
  sgen_gc_unlock ();
  D.19447 = str;
  return D.19447;
}


mono_gc_alloc_pinned_obj (struct MonoVTable * vtable, size_t size)
{
  unsigned int D.19454;
  struct MonoClass * D.19460;
  const char * D.19461;
  const char * D.19462;
  void * (*<T2c32>) (struct MonoVTable *, size_t, gboolean) D.19463;
  void * D.19464;
  unsigned int D.19465;
  int D.19466;
  _Bool D.19467;
  long int D.19468;
  long int D.19469;
  struct FILE * gc_debug_file.55;
  void * D.19478;
  void * * p;

  D.19454 = size + 7;
  size = D.19454 & 4294967288;
  pthread_mutex_lock (&gc_mutex);
  if (size > 8000) goto <D.19455>; else goto <D.19456>;
  <D.19455>:
  p = sgen_los_alloc_large_inner (vtable, size);
  goto <D.19457>;
  <D.19456>:
  if (0 != 0) goto <D.19458>; else goto <D.19459>;
  <D.19458>:
  D.19460 = vtable->klass;
  D.19461 = D.19460->name;
  D.19460 = vtable->klass;
  D.19462 = D.19460->name_space;
  monoeg_g_log (0B, 4, "class %s:%s is not initialized", D.19462, D.19461);
  <D.19023>:
  goto <D.19023>;
  <D.19459>:
  D.19463 = major_collector.alloc_small_pinned_obj;
  D.19464 = vtable->gc_descr;
  D.19465 = (unsigned int) D.19464;
  D.19466 = sgen_gc_descr_has_references (D.19465);
  p = D.19463 (vtable, size, D.19466);
  <D.19457>:
  D.19467 = p != 0B;
  D.19468 = (long int) D.19467;
  D.19469 = __builtin_expect (D.19468, 1);
  if (D.19469 != 0) goto <D.19470>; else goto <D.19471>;
  <D.19470>:
  if (0 != 0) goto <D.19472>; else goto <D.19473>;
  <D.19472>:
  D.19460 = vtable->klass;
  D.19461 = D.19460->name;
  gc_debug_file.55 = gc_debug_file;
  fprintf (gc_debug_file.55, "Allocated pinned object %p, vtable: %p (%s), size: %zd\n", p, vtable, D.19461, size);
  gc_debug_file.55 = gc_debug_file;
  fflush (gc_debug_file.55);
  <D.19473>:
  if (size > 8000) goto <D.19475>; else goto <D.19476>;
  <D.19475>:
  goto <D.19477>;
  <D.19476>:
  <D.19477>:
  <D.19471>:
  sgen_gc_unlock ();
  D.19478 = p;
  return D.19478;
}


sgen_gc_descr_has_references (mword desc)
{
  unsigned int D.19480;
  gboolean D.19483;
  unsigned int D.19484;
  unsigned int D.19487;

  D.19480 = desc & 4294901767;
  if (D.19480 == 1) goto <D.19481>; else goto <D.19482>;
  <D.19481>:
  D.19483 = 0;
  return D.19483;
  <D.19482>:
  D.19484 = desc & 49159;
  if (D.19484 == 4) goto <D.19485>; else goto <D.19486>;
  <D.19485>:
  D.19483 = 0;
  return D.19483;
  <D.19486>:
  D.19487 = desc & 7;
  if (D.19487 == 7) goto <D.19488>; else goto <D.19489>;
  <D.19488>:
  D.19483 = 0;
  return D.19483;
  <D.19489>:
  D.19483 = 1;
  return D.19483;
}


mono_gc_alloc_mature (struct MonoVTable * vtable)
{
  struct MonoClass * D.19491;
  int D.19492;
  int D.19493;
  unsigned int D.19494;
  unsigned char D.19495;
  unsigned char D.19496;
  _Bool D.19497;
  long int D.19498;
  long int D.19499;
  void * D.19502;
  void * * res;
  size_t size;

  D.19491 = vtable->klass;
  D.19492 = D.19491->instance_size;
  D.19493 = D.19492 + 7;
  D.19494 = (unsigned int) D.19493;
  size = D.19494 & 4294967288;
  pthread_mutex_lock (&gc_mutex);
  res = alloc_degraded (vtable, size, 1);
  sgen_gc_unlock ();
  D.19491 = vtable->klass;
  D.19495 = BIT_FIELD_REF <*D.19491, 8, 176>;
  D.19496 = D.19495 & 32;
  D.19497 = D.19496 != 0;
  D.19498 = (long int) D.19497;
  D.19499 = __builtin_expect (D.19498, 0);
  if (D.19499 != 0) goto <D.19500>; else goto <D.19501>;
  <D.19500>:
  mono_object_register_finalizer (res);
  <D.19501>:
  D.19502 = res;
  return D.19502;
}


mono_gc_alloc_fixed (size_t size, void * descr)
{
  void * D.19506;
  int D.19507;
  void * res;

  res = calloc (1, size);
  if (res == 0B) goto <D.19504>; else goto <D.19505>;
  <D.19504>:
  D.19506 = 0B;
  return D.19506;
  <D.19505>:
  D.19507 = mono_gc_register_root (res, size, descr);
  if (D.19507 == 0) goto <D.19508>; else goto <D.19509>;
  <D.19508>:
  free (res);
  res = 0B;
  <D.19509>:
  D.19506 = res;
  return D.19506;
}


mono_gc_free_fixed (void * addr)
{
  mono_gc_deregister_root (addr);
  free (addr);
}


sgen_init_tlab_info (struct SgenThreadInfo * info)
{
  info->tlab_start_addr = &tlab_start;
  info->tlab_next_addr = &tlab_next;
  info->tlab_temp_end_addr = &tlab_temp_end;
  info->tlab_real_end_addr = &tlab_real_end;
  tlab_next_addr = &tlab_next;
}


sgen_clear_tlabs ()
{
  struct MonoLinkedListSet * D.19511;
  struct MonoLinkedListSetNode * D.19512;
  unsigned int D.19513;
  char * * D.19516;
  char * * D.19517;
  char * * D.19518;
  char * * D.19519;
  struct SgenThreadInfo * info;

  {
    struct MonoLinkedListSetNode * __cur;

    D.19511 = mono_thread_info_list_head ();
    __cur = D.19511->head;
    goto <D.19046>;
    <D.19045>:
    D.19512 = __cur->next;
    D.19513 = mono_lls_pointer_get_mark (D.19512);
    if (D.19513 == 0) goto <D.19514>; else goto <D.19515>;
    <D.19514>:
    info = __cur;
    D.19516 = info->tlab_start_addr;
    *D.19516 = 0B;
    D.19517 = info->tlab_next_addr;
    *D.19517 = 0B;
    D.19518 = info->tlab_temp_end_addr;
    *D.19518 = 0B;
    D.19519 = info->tlab_real_end_addr;
    *D.19519 = 0B;
    <D.19515>:
    D.19512 = __cur->next;
    __cur = mono_lls_pointer_unmask (D.19512);
    <D.19046>:
    if (__cur != 0B) goto <D.19045>; else goto <D.19047>;
    <D.19047>:
  }
}


mono_lls_pointer_get_mark (void * n)
{
  uintptr_t D.19520;
  unsigned int n.56;

  n.56 = (unsigned int) n;
  D.19520 = n.56 & 1;
  return D.19520;
}


mono_lls_pointer_unmask (void * p)
{
  void * D.19523;
  unsigned int p.57;
  unsigned int D.19525;

  p.57 = (unsigned int) p;
  D.19525 = p.57 & 4294967292;
  D.19523 = (void *) D.19525;
  return D.19523;
}


mono_gc_get_managed_allocator (struct MonoClass * klass, gboolean for_box)
{
  _Bool D.19527;
  _Bool D.19528;
  _Bool D.19529;
  struct MonoMethod * D.19532;
  unsigned int collect_before_allocs.58;
  int D.19536;
  int D.19539;
  unsigned int D.19540;
  unsigned int tlab_size.59;
  unsigned char D.19546;
  unsigned char D.19547;
  <unnamed type> D.19549;
  unsigned int D.19550;
  unsigned char D.19551;
  unsigned char D.19554;
  long long unsigned int D.19558;
  long long unsigned int D.19559;
  long long unsigned int D.19560;
  struct MonoType * D.19562;
  int D.19563;
  int tlab_next_offset;
  int tlab_temp_end_offset;

  tlab_next_offset = -1;
  tlab_temp_end_offset = -1;
  __asm__("movl $tlab_next@ntpoff, %0" : "=r" tlab_next_offset);
  __asm__("movl $tlab_temp_end@ntpoff, %0" : "=r" tlab_temp_end_offset);
  D.19527 = tlab_next_offset == -1;
  D.19528 = tlab_temp_end_offset == -1;
  D.19529 = D.19527 | D.19528;
  if (D.19529 != 0) goto <D.19530>; else goto <D.19531>;
  <D.19530>:
  D.19532 = 0B;
  return D.19532;
  <D.19531>:
  collect_before_allocs.58 = collect_before_allocs;
  if (collect_before_allocs.58 != 0) goto <D.19534>; else goto <D.19535>;
  <D.19534>:
  D.19532 = 0B;
  return D.19532;
  <D.19535>:
  D.19536 = mono_runtime_has_tls_get ();
  if (D.19536 == 0) goto <D.19537>; else goto <D.19538>;
  <D.19537>:
  D.19532 = 0B;
  return D.19532;
  <D.19538>:
  D.19539 = klass->instance_size;
  D.19540 = (unsigned int) D.19539;
  tlab_size.59 = tlab_size;
  if (D.19540 > tlab_size.59) goto <D.19542>; else goto <D.19543>;
  <D.19542>:
  D.19532 = 0B;
  return D.19532;
  <D.19543>:
  D.19546 = BIT_FIELD_REF <*klass, 8, 176>;
  D.19547 = D.19546 & 96;
  if (D.19547 != 0) goto <D.19544>; else goto <D.19548>;
  <D.19548>:
  D.19549 = mono_profiler_get_events ();
  D.19550 = D.19549 & 128;
  if (D.19550 != 0) goto <D.19544>; else goto <D.19545>;
  <D.19544>:
  D.19532 = 0B;
  return D.19532;
  <D.19545>:
  D.19551 = klass->rank;
  if (D.19551 != 0) goto <D.19552>; else goto <D.19553>;
  <D.19552>:
  D.19532 = 0B;
  return D.19532;
  <D.19553>:
  D.19554 = klass->byval_arg.type;
  if (D.19554 == 14) goto <D.19555>; else goto <D.19556>;
  <D.19555>:
  D.19532 = mono_gc_get_managed_allocator_by_type (3);
  return D.19532;
  <D.19556>:
  D.19539 = klass->instance_size;
  D.19558 = (long long unsigned int) D.19539;
  D.19559 = D.19558 + 7;
  D.19560 = D.19559 & 18446744073709551608;
  if (D.19560 <= 7999) goto <D.19561>; else goto <D.19557>;
  <D.19561>:
  D.19562 = &klass->byval_arg;
  D.19563 = mono_class_is_open_constructed_type (D.19562);
  if (D.19563 == 0) goto <D.19564>; else goto <D.19557>;
  <D.19564>:
  D.19532 = mono_gc_get_managed_allocator_by_type (2);
  return D.19532;
  <D.19557>:
  D.19532 = mono_gc_get_managed_allocator_by_type (0);
  return D.19532;
}


mono_gc_get_managed_array_allocator (struct MonoClass * klass)
{
  _Bool D.19566;
  _Bool D.19567;
  _Bool D.19568;
  struct MonoMethod * D.19571;
  unsigned char D.19572;
  int D.19575;
  <unnamed type> D.19578;
  unsigned int D.19579;
  int has_per_allocation_action.60;
  int iftmp.61;
  int D.19589;
  unsigned char D.19591;
  unsigned char D.19592;
  _Bool D.19593;
  long int D.19594;
  long int D.19595;
  int tlab_next_offset;
  int tlab_temp_end_offset;

  tlab_next_offset = -1;
  tlab_temp_end_offset = -1;
  __asm__("movl $tlab_next@ntpoff, %0" : "=r" tlab_next_offset);
  __asm__("movl $tlab_temp_end@ntpoff, %0" : "=r" tlab_temp_end_offset);
  D.19566 = tlab_next_offset == -1;
  D.19567 = tlab_temp_end_offset == -1;
  D.19568 = D.19566 | D.19567;
  if (D.19568 != 0) goto <D.19569>; else goto <D.19570>;
  <D.19569>:
  D.19571 = 0B;
  return D.19571;
  <D.19570>:
  D.19572 = klass->rank;
  if (D.19572 != 1) goto <D.19573>; else goto <D.19574>;
  <D.19573>:
  D.19571 = 0B;
  return D.19571;
  <D.19574>:
  D.19575 = mono_runtime_has_tls_get ();
  if (D.19575 == 0) goto <D.19576>; else goto <D.19577>;
  <D.19576>:
  D.19571 = 0B;
  return D.19571;
  <D.19577>:
  D.19578 = mono_profiler_get_events ();
  D.19579 = D.19578 & 128;
  if (D.19579 != 0) goto <D.19580>; else goto <D.19581>;
  <D.19580>:
  D.19571 = 0B;
  return D.19571;
  <D.19581>:
  has_per_allocation_action.60 = has_per_allocation_action;
  if (has_per_allocation_action.60 != 0) goto <D.19583>; else goto <D.19584>;
  <D.19583>:
  D.19571 = 0B;
  return D.19571;
  <D.19584>:
  D.19589 = mono_class_has_finalizer (klass);
  if (D.19589 != 0) goto <D.19586>; else goto <D.19590>;
  <D.19590>:
  D.19591 = BIT_FIELD_REF <*klass, 8, 176>;
  D.19592 = D.19591 & 64;
  if (D.19592 != 0) goto <D.19586>; else goto <D.19587>;
  <D.19586>:
  iftmp.61 = 1;
  goto <D.19588>;
  <D.19587>:
  iftmp.61 = 0;
  <D.19588>:
  D.19593 = iftmp.61 != 0;
  D.19594 = (long int) D.19593;
  D.19595 = __builtin_expect (D.19594, 0);
  if (D.19595 != 0) goto <D.19596>; else goto <D.19597>;
  <D.19596>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 1037, "!mono_class_has_finalizer (klass) && !mono_class_is_marshalbyref (klass)");
  <D.19597>:
  D.19571 = mono_gc_get_managed_allocator_by_type (1);
  return D.19571;
}


sgen_set_use_managed_allocator (gboolean flag)
{
  use_managed_allocator = flag;
}


mono_gc_get_managed_allocator_by_type (int atype)
{
  int use_managed_allocator.62;
  struct MonoMethod * D.19602;
  int D.19603;
  struct MonoMethod * D.19608;
  struct MonoMethod * res;

  use_managed_allocator.62 = use_managed_allocator;
  if (use_managed_allocator.62 == 0) goto <D.19600>; else goto <D.19601>;
  <D.19600>:
  D.19602 = 0B;
  return D.19602;
  <D.19601>:
  D.19603 = mono_runtime_has_tls_get ();
  if (D.19603 == 0) goto <D.19604>; else goto <D.19605>;
  <D.19604>:
  D.19602 = 0B;
  return D.19602;
  <D.19605>:
  res = alloc_method_cache[atype];
  if (res != 0B) goto <D.19606>; else goto <D.19607>;
  <D.19606>:
  D.19602 = res;
  return D.19602;
  <D.19607>:
  res = create_allocator (atype);
  pthread_mutex_lock (&gc_mutex);
  D.19608 = alloc_method_cache[atype];
  if (D.19608 != 0B) goto <D.19609>; else goto <D.19610>;
  <D.19609>:
  mono_free_method (res);
  res = alloc_method_cache[atype];
  goto <D.19611>;
  <D.19610>:
  mono_memory_barrier ();
  alloc_method_cache[atype] = res;
  <D.19611>:
  sgen_gc_unlock ();
  D.19602 = res;
  return D.19602;
}


create_allocator (int atype)
{
  _Bool D.19613;
  long int D.19614;
  long int D.19615;
  _Bool D.19618;
  long int D.19619;
  long int D.19620;
  int registered.63;
  struct MonoMethodSignature * D.19626;
  struct MonoMethodSignature * D.19627;
  struct MonoMethodSignature * D.19628;
  unsigned int num_params.64;
  struct MonoImage * D.19642;
  struct MonoClass * D.19645;
  struct MonoType * D.19646;
  struct MonoClass * D.19647;
  struct MonoType * D.19648;
  struct MonoClass * D.19649;
  struct MonoType * D.19650;
  struct MonoClass * D.19652;
  struct MonoType * D.19653;
  _Bool D.19654;
  _Bool D.19655;
  _Bool D.19656;
  unsigned int size_var.65;
  unsigned int D.19663;
  unsigned int pos.66;
  int D.19665;
  unsigned int D.19666;
  unsigned int D.19667;
  int D.19668;
  unsigned int D.19669;
  unsigned int D.19670;
  unsigned int D.19671;
  struct MonoClass * D.19672;
  struct MonoClass * D.19673;
  _Bool D.19674;
  long int D.19675;
  long int D.19676;
  int D.19679;
  unsigned int D.19680;
  _Bool D.19681;
  long int D.19682;
  long int D.19683;
  _Bool D.19686;
  long int D.19687;
  long int D.19688;
  int D.19691;
  unsigned int D.19692;
  unsigned int D.19693;
  unsigned int D.19694;
  unsigned int pos_leave.67;
  unsigned int tlab_next_addr_var.68;
  unsigned int p_var.69;
  unsigned int new_next_var.70;
  struct MonoMethodHeader * D.19721;
  struct MonoMethod * D.19722;
  int p_var;
  int size_var;
  guint32 slowpath_branch;
  guint32 max_size_branch;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct MonoMethodSignature * csig;
  static gboolean registered = 0;
  int tlab_next_addr_var;
  int new_next_var;
  int num_params;
  int i;
  const char * name;
  struct AllocatorWrapperInfo * info;
  int tlab_next_addr_offset;
  int tlab_temp_end_offset;

  name = 0B;
  tlab_next_addr_offset = -1;
  tlab_temp_end_offset = -1;
  __asm__("movl $tlab_next_addr@ntpoff, %0" : "=r" tlab_next_addr_offset);
  __asm__("movl $tlab_temp_end@ntpoff, %0" : "=r" tlab_temp_end_offset);
  mono_tls_key_set_offset (5, tlab_next_addr_offset);
  mono_tls_key_set_offset (6, tlab_temp_end_offset);
  D.19613 = tlab_next_addr_offset == -1;
  D.19614 = (long int) D.19613;
  D.19615 = __builtin_expect (D.19614, 0);
  if (D.19615 != 0) goto <D.19616>; else goto <D.19617>;
  <D.19616>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 710, "tlab_next_addr_offset != -1");
  <D.19617>:
  D.19618 = tlab_temp_end_offset == -1;
  D.19619 = (long int) D.19618;
  D.19620 = __builtin_expect (D.19619, 0);
  if (D.19620 != 0) goto <D.19621>; else goto <D.19622>;
  <D.19621>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 711, "tlab_temp_end_offset != -1");
  <D.19622>:
  registered.63 = registered;
  if (registered.63 == 0) goto <D.19624>; else goto <D.19625>;
  <D.19624>:
  D.19626 = mono_create_icall_signature ("object ptr int");
  mono_register_jit_icall (mono_gc_alloc_obj, "mono_gc_alloc_obj", D.19626, 0);
  D.19627 = mono_create_icall_signature ("object ptr int int");
  mono_register_jit_icall (mono_gc_alloc_vector, "mono_gc_alloc_vector", D.19627, 0);
  D.19628 = mono_create_icall_signature ("object ptr int int32");
  mono_register_jit_icall (mono_gc_alloc_string, "mono_gc_alloc_string", D.19628, 0);
  registered = 1;
  <D.19625>:
  if (atype == 2) goto <D.19629>; else goto <D.19630>;
  <D.19629>:
  num_params = 1;
  name = "AllocSmall";
  goto <D.19631>;
  <D.19630>:
  if (atype == 0) goto <D.19632>; else goto <D.19633>;
  <D.19632>:
  num_params = 1;
  name = "Alloc";
  goto <D.19634>;
  <D.19633>:
  if (atype == 1) goto <D.19635>; else goto <D.19636>;
  <D.19635>:
  num_params = 2;
  name = "AllocVector";
  goto <D.19637>;
  <D.19636>:
  if (atype == 3) goto <D.19638>; else goto <D.19639>;
  <D.19638>:
  num_params = 2;
  name = "AllocString";
  goto <D.19640>;
  <D.19639>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "sgen-alloc.c", 734);
  <D.19640>:
  <D.19637>:
  <D.19634>:
  <D.19631>:
  num_params.64 = (unsigned int) num_params;
  D.19642 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.19642, num_params.64);
  if (atype == 3) goto <D.19643>; else goto <D.19644>;
  <D.19643>:
  D.19645 = mono_defaults.string_class;
  D.19646 = &D.19645->byval_arg;
  csig->ret = D.19646;
  D.19647 = mono_defaults.int_class;
  D.19648 = &D.19647->byval_arg;
  csig->params[0] = D.19648;
  D.19649 = mono_defaults.int32_class;
  D.19650 = &D.19649->byval_arg;
  csig->params[1] = D.19650;
  goto <D.19651>;
  <D.19644>:
  D.19652 = mono_defaults.object_class;
  D.19653 = &D.19652->byval_arg;
  csig->ret = D.19653;
  i = 0;
  goto <D.19069>;
  <D.19068>:
  D.19647 = mono_defaults.int_class;
  D.19648 = &D.19647->byval_arg;
  csig->params[i] = D.19648;
  i = i + 1;
  <D.19069>:
  if (i < num_params) goto <D.19068>; else goto <D.19070>;
  <D.19070>:
  <D.19651>:
  D.19652 = mono_defaults.object_class;
  mb = mono_mb_new (D.19652, name, 28);
  D.19649 = mono_defaults.int32_class;
  D.19650 = &D.19649->byval_arg;
  size_var = mono_mb_add_local (mb, D.19650);
  D.19654 = atype == 0;
  D.19655 = atype == 2;
  D.19656 = D.19654 | D.19655;
  if (D.19656 != 0) goto <D.19657>; else goto <D.19658>;
  <D.19657>:
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_icon (mb, 0);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_icon (mb, 16);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 75);
  size_var.65 = (unsigned int) size_var;
  mono_mb_emit_stloc (mb, size_var.65);
  goto <D.19660>;
  <D.19658>:
  if (atype == 1) goto <D.19661>; else goto <D.19662>;
  <D.19661>:
  {
    struct MonoExceptionClause * clause;
    int pos;
    int pos_leave;
    struct MonoClass * oom_exc_class;
    struct MonoMethod * ctor;

    mono_mb_emit_ldarg (mb, 1);
    mono_mb_emit_icon (mb, 2147483647);
    D.19663 = mono_mb_emit_short_branch (mb, 54);
    pos = (int) D.19663;
    mono_mb_emit_exception (mb, "OverflowException", 0B);
    pos.66 = (unsigned int) pos;
    mono_mb_patch_short_branch (mb, pos.66);
    D.19642 = mono_defaults.corlib;
    clause = mono_image_alloc0 (D.19642, 24);
    D.19665 = mono_mb_get_label (mb);
    D.19666 = (unsigned int) D.19665;
    clause->try_offset = D.19666;
    mono_mb_emit_ldarg (mb, 0);
    mono_mb_emit_icon (mb, 0);
    mono_mb_emit_byte (mb, 88);
    mono_mb_emit_byte (mb, 77);
    mono_mb_emit_icon (mb, 80);
    mono_mb_emit_byte (mb, 88);
    mono_mb_emit_byte (mb, 75);
    mono_mb_emit_ldarg (mb, 1);
    mono_mb_emit_byte (mb, 217);
    mono_mb_emit_icon (mb, 16);
    mono_mb_emit_byte (mb, 215);
    size_var.65 = (unsigned int) size_var;
    mono_mb_emit_stloc (mb, size_var.65);
    D.19667 = mono_mb_emit_branch (mb, 221);
    pos_leave = (int) D.19667;
    clause->flags = 0;
    D.19668 = mono_mb_get_pos (mb);
    D.19669 = (unsigned int) D.19668;
    D.19670 = clause->try_offset;
    D.19671 = D.19669 - D.19670;
    clause->try_len = D.19671;
    D.19642 = mono_defaults.corlib;
    D.19672 = mono_class_from_name (D.19642, "System", "OverflowException");
    clause->data.catch_class = D.19672;
    D.19673 = clause->data.catch_class;
    D.19674 = D.19673 == 0B;
    D.19675 = (long int) D.19674;
    D.19676 = __builtin_expect (D.19675, 0);
    if (D.19676 != 0) goto <D.19677>; else goto <D.19678>;
    <D.19677>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 803, "clause->data.catch_class");
    <D.19678>:
    D.19679 = mono_mb_get_label (mb);
    D.19680 = (unsigned int) D.19679;
    clause->handler_offset = D.19680;
    D.19642 = mono_defaults.corlib;
    oom_exc_class = mono_class_from_name (D.19642, "System", "OutOfMemoryException");
    D.19681 = oom_exc_class == 0B;
    D.19682 = (long int) D.19681;
    D.19683 = __builtin_expect (D.19682, 0);
    if (D.19683 != 0) goto <D.19684>; else goto <D.19685>;
    <D.19684>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 808, "oom_exc_class");
    <D.19685>:
    ctor = mono_class_get_method_from_name (oom_exc_class, ".ctor", 0);
    D.19686 = ctor == 0B;
    D.19687 = (long int) D.19686;
    D.19688 = __builtin_expect (D.19687, 0);
    if (D.19688 != 0) goto <D.19689>; else goto <D.19690>;
    <D.19689>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 810, "ctor");
    <D.19690>:
    mono_mb_emit_byte (mb, 38);
    mono_mb_emit_op (mb, 115, ctor);
    mono_mb_emit_byte (mb, 122);
    D.19691 = mono_mb_get_pos (mb);
    D.19692 = (unsigned int) D.19691;
    D.19693 = clause->handler_offset;
    D.19694 = D.19692 - D.19693;
    clause->handler_len = D.19694;
    mono_mb_set_clauses (mb, 1, clause);
    pos_leave.67 = (unsigned int) pos_leave;
    mono_mb_patch_branch (mb, pos_leave.67);
  }
  goto <D.19696>;
  <D.19662>:
  if (atype == 3) goto <D.19697>; else goto <D.19698>;
  <D.19697>:
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icon (mb, 1);
  mono_mb_emit_byte (mb, 98);
  mono_mb_emit_icon (mb, 14);
  mono_mb_emit_byte (mb, 88);
  size_var.65 = (unsigned int) size_var;
  mono_mb_emit_stloc (mb, size_var.65);
  goto <D.19699>;
  <D.19698>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "sgen-alloc.c", 831);
  <D.19699>:
  <D.19696>:
  <D.19660>:
  size_var.65 = (unsigned int) size_var;
  mono_mb_emit_ldloc (mb, size_var.65);
  mono_mb_emit_icon (mb, 7);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_icon (mb, -8);
  mono_mb_emit_byte (mb, 95);
  size_var.65 = (unsigned int) size_var;
  mono_mb_emit_stloc (mb, size_var.65);
  if (atype != 2) goto <D.19700>; else goto <D.19701>;
  <D.19700>:
  size_var.65 = (unsigned int) size_var;
  mono_mb_emit_ldloc (mb, size_var.65);
  mono_mb_emit_icon (mb, 8000);
  max_size_branch = mono_mb_emit_short_branch (mb, 53);
  <D.19701>:
  D.19647 = mono_defaults.int_class;
  D.19648 = &D.19647->byval_arg;
  tlab_next_addr_var = mono_mb_add_local (mb, D.19648);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 13);
  mono_mb_emit_i4 (mb, 5);
  tlab_next_addr_var.68 = (unsigned int) tlab_next_addr_var;
  mono_mb_emit_stloc (mb, tlab_next_addr_var.68);
  D.19647 = mono_defaults.int_class;
  D.19648 = &D.19647->byval_arg;
  p_var = mono_mb_add_local (mb, D.19648);
  tlab_next_addr_var.68 = (unsigned int) tlab_next_addr_var;
  mono_mb_emit_ldloc (mb, tlab_next_addr_var.68);
  mono_mb_emit_byte (mb, 77);
  p_var.69 = (unsigned int) p_var;
  mono_mb_emit_stloc (mb, p_var.69);
  D.19647 = mono_defaults.int_class;
  D.19648 = &D.19647->byval_arg;
  new_next_var = mono_mb_add_local (mb, D.19648);
  p_var.69 = (unsigned int) p_var;
  mono_mb_emit_ldloc (mb, p_var.69);
  size_var.65 = (unsigned int) size_var;
  mono_mb_emit_ldloc (mb, size_var.65);
  mono_mb_emit_byte (mb, 211);
  mono_mb_emit_byte (mb, 88);
  new_next_var.70 = (unsigned int) new_next_var;
  mono_mb_emit_stloc (mb, new_next_var.70);
  new_next_var.70 = (unsigned int) new_next_var;
  mono_mb_emit_ldloc (mb, new_next_var.70);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 13);
  mono_mb_emit_i4 (mb, 6);
  slowpath_branch = mono_mb_emit_short_branch (mb, 55);
  if (atype != 2) goto <D.19705>; else goto <D.19706>;
  <D.19705>:
  mono_mb_patch_short_branch (mb, max_size_branch);
  <D.19706>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 12);
  mono_mb_emit_ldarg (mb, 0);
  size_var.65 = (unsigned int) size_var;
  mono_mb_emit_ldloc (mb, size_var.65);
  D.19654 = atype == 0;
  D.19655 = atype == 2;
  D.19656 = D.19654 | D.19655;
  if (D.19656 != 0) goto <D.19707>; else goto <D.19708>;
  <D.19707>:
  mono_mb_emit_icall (mb, mono_gc_alloc_obj);
  goto <D.19709>;
  <D.19708>:
  if (atype == 1) goto <D.19710>; else goto <D.19711>;
  <D.19710>:
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icall (mb, mono_gc_alloc_vector);
  goto <D.19712>;
  <D.19711>:
  if (atype == 3) goto <D.19713>; else goto <D.19714>;
  <D.19713>:
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icall (mb, mono_gc_alloc_string);
  goto <D.19715>;
  <D.19714>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "sgen-alloc.c", 898);
  <D.19715>:
  <D.19712>:
  <D.19709>:
  mono_mb_emit_byte (mb, 42);
  mono_mb_patch_short_branch (mb, slowpath_branch);
  tlab_next_addr_var.68 = (unsigned int) tlab_next_addr_var;
  mono_mb_emit_ldloc (mb, tlab_next_addr_var.68);
  new_next_var.70 = (unsigned int) new_next_var;
  mono_mb_emit_ldloc (mb, new_next_var.70);
  mono_mb_emit_byte (mb, 223);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 16, 0B);
  p_var.69 = (unsigned int) p_var;
  mono_mb_emit_ldloc (mb, p_var.69);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 223);
  if (atype == 1) goto <D.19716>; else goto <D.19717>;
  <D.19716>:
  p_var.69 = (unsigned int) p_var;
  mono_mb_emit_ldloc (mb, p_var.69);
  mono_mb_emit_ldflda (mb, 12);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_byte (mb, 84);
  goto <D.19718>;
  <D.19717>:
  if (atype == 3) goto <D.19719>; else goto <D.19720>;
  <D.19719>:
  p_var.69 = (unsigned int) p_var;
  mono_mb_emit_ldloc (mb, p_var.69);
  mono_mb_emit_icon (mb, 8);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_byte (mb, 84);
  p_var.69 = (unsigned int) p_var;
  mono_mb_emit_ldloc (mb, p_var.69);
  size_var.65 = (unsigned int) size_var;
  mono_mb_emit_ldloc (mb, size_var.65);
  mono_mb_emit_icon (mb, 2);
  mono_mb_emit_byte (mb, 89);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_icon (mb, 0);
  mono_mb_emit_byte (mb, 83);
  <D.19720>:
  <D.19718>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 16, 0B);
  p_var.69 = (unsigned int) p_var;
  mono_mb_emit_ldloc (mb, p_var.69);
  mono_mb_emit_byte (mb, 42);
  res = mono_mb_create_method (mb, csig, 8);
  mono_mb_free (mb);
  D.19721 = mono_method_get_header (res);
  D.19721->init_locals = 0;
  D.19642 = mono_defaults.corlib;
  info = mono_image_alloc0 (D.19642, 8);
  info->gc_name = "sgen";
  info->alloc_type = atype;
  mono_marshal_set_wrapper_info (res, info);
  D.19722 = res;
  return D.19722;
}


mono_gc_get_managed_allocator_types ()
{
  guint32 D.19724;

  D.19724 = 4;
  return D.19724;
}


sgen_is_managed_allocator (struct MonoMethod * method)
{
  struct MonoMethod * D.19726;
  gboolean D.19729;
  int i;

  i = 0;
  goto <D.19102>;
  <D.19101>:
  D.19726 = alloc_method_cache[i];
  if (D.19726 == method) goto <D.19727>; else goto <D.19728>;
  <D.19727>:
  D.19729 = 1;
  return D.19729;
  <D.19728>:
  i = i + 1;
  <D.19102>:
  if (i <= 3) goto <D.19101>; else goto <D.19103>;
  <D.19103>:
  D.19729 = 0;
  return D.19729;
}


sgen_has_managed_allocator ()
{
  struct MonoMethod * D.19731;
  gboolean D.19734;
  int i;

  i = 0;
  goto <D.19109>;
  <D.19108>:
  D.19731 = alloc_method_cache[i];
  if (D.19731 != 0B) goto <D.19732>; else goto <D.19733>;
  <D.19732>:
  D.19734 = 1;
  return D.19734;
  <D.19733>:
  i = i + 1;
  <D.19109>:
  if (i <= 3) goto <D.19108>; else goto <D.19110>;
  <D.19110>:
  D.19734 = 0;
  return D.19734;
}


