mono_gc_alloc_obj (struct MonoVTable * vtable, size_t size)
{
  int has_per_allocation_action.0;
  _Bool D.19093;
  long int D.19094;
  long int D.19095;
  unsigned int verify_before_allocs.1;
  unsigned int current_alloc.2;
  unsigned int D.19102;
  unsigned int collect_before_allocs.3;
  unsigned int D.19108;
  struct GCMemSection * nursery_section.4;
  struct SgenThreadInfo * sgen_thread_info.5;
  void * D.19117;
  _Bool D.19118;
  long int D.19119;
  long int D.19120;
  void * res;

  has_per_allocation_action.0 = has_per_allocation_action;
  D.19093 = has_per_allocation_action.0 != 0;
  D.19094 = (long int) D.19093;
  D.19095 = __builtin_expect (D.19094, 0);
  if (D.19095 != 0) goto <D.19096>; else goto <D.19097>;
  <D.19096>:
  {
    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.19099>; else goto <D.19100>;
    <D.19099>:
    current_alloc.2 = (unsigned int) current_alloc;
    verify_before_allocs.1 = verify_before_allocs;
    D.19102 = current_alloc.2 % verify_before_allocs.1;
    if (D.19102 == 0) goto <D.19103>; else goto <D.19104>;
    <D.19103>:
    sgen_check_whole_heap_stw ();
    <D.19104>:
    <D.19100>:
    collect_before_allocs.3 = collect_before_allocs;
    if (collect_before_allocs.3 != 0) goto <D.19106>; else goto <D.19107>;
    <D.19106>:
    current_alloc.2 = (unsigned int) current_alloc;
    collect_before_allocs.3 = collect_before_allocs;
    D.19108 = current_alloc.2 % collect_before_allocs.3;
    if (D.19108 == 0) goto <D.19109>; else goto <D.19110>;
    <D.19109>:
    nursery_section.4 = nursery_section;
    if (nursery_section.4 != 0B) goto <D.19112>; else goto <D.19113>;
    <D.19112>:
    pthread_mutex_lock (&gc_mutex);
    sgen_perform_collection (0, 0, "collect-before-alloc-triggered", 1);
    sgen_gc_unlock ();
    <D.19113>:
    <D.19110>:
    <D.19107>:
  }
  <D.19097>:
  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.19115>; else goto <D.19116>;
  <D.19115>:
  mono_memory_barrier ();
  sgen_thread_info.5 = sgen_thread_info;
  sgen_thread_info.5->in_critical_region = 0;
  D.19117 = res;
  return D.19117;
  <D.19116>:
  mono_memory_barrier ();
  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.19118 = res == 0B;
  D.19119 = (long int) D.19118;
  D.19120 = __builtin_expect (D.19119, 0);
  if (D.19120 != 0) goto <D.19121>; else goto <D.19122>;
  <D.19121>:
  D.19117 = mono_gc_out_of_memory (size);
  return D.19117;
  <D.19122>:
  D.19117 = res;
  return D.19117;
}


InterlockedIncrement (volatile gint32 * val)
{
  gint32 D.19124;
  unsigned int D.19125;

  D.19125 = __sync_add_and_fetch_4 (val, 1);
  D.19124 = (gint32) D.19125;
  return D.19124;
}


mono_gc_try_alloc_obj_nolock (struct MonoVTable * vtable, size_t size)
{
  unsigned int D.19127;
  void * D.19130;
  _Bool D.19131;
  long int D.19132;
  long int D.19133;
  void * D.19138;
  unsigned int tlab_size.6;
  _Bool D.19140;
  long int D.19141;
  long int D.19142;
  <unnamed type> nursery_clear_policy.7;
  int real_end.8;
  int p.9;
  _Bool D.19153;
  long int D.19154;
  long int D.19155;
  char * tlab_temp_end.10;
  _Bool D.19159;
  long int D.19160;
  long int D.19161;
  char * tlab_next.11;
  char * D.19165;
  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.19184;
  char * tlab_temp_end.18;
  struct MonoClass * D.19190;
  const char * D.19191;
  void * D.19194;
  _Bool D.19195;
  long int D.19196;
  long int D.19197;
  void * * p;
  char * new_next;

  D.19127 = size + 7;
  size = D.19127 & 4294967288;
  if (0 != 0) goto <D.19128>; else goto <D.19129>;
  <D.19128>:
  monoeg_g_log (0B, 4, "Object too small");
  <D.18967>:
  goto <D.18967>;
  <D.19129>:
  D.19130 = vtable->gc_descr;
  D.19131 = D.19130 == 0B;
  D.19132 = (long int) D.19131;
  D.19133 = __builtin_expect (D.19132, 0);
  if (D.19133 != 0) goto <D.19134>; else goto <D.19135>;
  <D.19134>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 352, "vtable->gc_descr");
  <D.19135>:
  if (size > 8000) goto <D.19136>; else goto <D.19137>;
  <D.19136>:
  D.19138 = 0B;
  return D.19138;
  <D.19137>:
  tlab_size.6 = tlab_size;
  D.19140 = size > tlab_size.6;
  D.19141 = (long int) D.19140;
  D.19142 = __builtin_expect (D.19141, 0);
  if (D.19142 != 0) goto <D.19143>; else goto <D.19144>;
  <D.19143>:
  p = sgen_nursery_alloc (size);
  if (p == 0B) goto <D.19145>; else goto <D.19146>;
  <D.19145>:
  D.19138 = 0B;
  return D.19138;
  <D.19146>:
  sgen_set_nursery_scan_start (p);
  nursery_clear_policy.7 = nursery_clear_policy;
  if (nursery_clear_policy.7 == 1) goto <D.19148>; else goto <D.19149>;
  <D.19148>:
  memset (p, 0, size);
  <D.19149>:
  goto <D.19150>;
  <D.19144>:
  {
    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.19153 = new_next < real_end;
    D.19154 = (long int) D.19153;
    D.19155 = __builtin_expect (D.19154, 1);
    if (D.19155 != 0) goto <D.19156>; else goto <D.19157>;
    <D.19156>:
    tlab_next = new_next;
    tlab_temp_end.10 = tlab_temp_end;
    D.19159 = new_next >= tlab_temp_end.10;
    D.19160 = (long int) D.19159;
    D.19161 = __builtin_expect (D.19160, 0);
    if (D.19161 != 0) goto <D.19162>; else goto <D.19163>;
    <D.19162>:
    sgen_set_nursery_scan_start (new_next);
    tlab_next.11 = tlab_next;
    D.19165 = tlab_next.11 + 8192;
    tlab_real_end.12 = tlab_real_end;
    tlab_temp_end.13 = MIN_EXPR <D.19165, tlab_real_end.12>;
    tlab_temp_end = tlab_temp_end.13;
    if (0 != 0) goto <D.19168>; else goto <D.19169>;
    <D.19168>:
    gc_debug_file.14 = gc_debug_file;
    tlab_next.11 = tlab_next;
    tlab_temp_end.10 = tlab_temp_end;
    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.19169>:
    <D.19163>:
    goto <D.19171>;
    <D.19157>:
    if (available_in_tlab > 512) goto <D.19172>; else goto <D.19173>;
    <D.19172>:
    p = sgen_nursery_alloc (size);
    if (p == 0B) goto <D.19174>; else goto <D.19175>;
    <D.19174>:
    D.19138 = 0B;
    return D.19138;
    <D.19175>:
    nursery_clear_policy.7 = nursery_clear_policy;
    if (nursery_clear_policy.7 == 1) goto <D.19176>; else goto <D.19177>;
    <D.19176>:
    memset (p, 0, size);
    <D.19177>:
    goto <D.19178>;
    <D.19173>:
    {
      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.19179>; else goto <D.19180>;
          <D.19179>:
          D.19138 = 0B;
          return D.19138;
          <D.19180>:
          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.19184 = MIN_EXPR <alloc_size.16, 8192>;
          tlab_temp_end.18 = new_next + D.19184;
          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.19186>; else goto <D.19187>;
          <D.19186>:
          alloc_size.16 = alloc_size;
          memset (new_next, 0, alloc_size.16);
          <D.19187>:
        }
      finally
        {
          alloc_size = {CLOBBER};
        }
    }
    <D.19178>:
    <D.19171>:
  }
  <D.19150>:
  if (0 != 0) goto <D.19188>; else goto <D.19189>;
  <D.19188>:
  gc_debug_file.14 = gc_debug_file;
  D.19190 = vtable->klass;
  D.19191 = D.19190->name;
  fprintf (gc_debug_file.14, "Allocated object %p, vtable: %p (%s), size: %zd\n", p, vtable, D.19191, size);
  gc_debug_file.14 = gc_debug_file;
  fflush (gc_debug_file.14);
  <D.19189>:
  if (0 != 0) goto <D.19192>; else goto <D.19193>;
  <D.19192>:
  <D.19193>:
  D.19194 = *p;
  D.19195 = D.19194 != 0B;
  D.19196 = (long int) D.19195;
  D.19197 = __builtin_expect (D.19196, 0);
  if (D.19197 != 0) goto <D.19198>; else goto <D.19199>;
  <D.19198>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 425, "*p == NULL");
  <D.19199>:
  mono_memory_write_barrier ();
  *p = vtable;
  D.19138 = p;
  return D.19138;
}


sgen_set_nursery_scan_start (char * p)
{
  int p.19;
  struct GCMemSection * nursery_section.20;
  char * D.19205;
  int D.19206;
  int D.19207;
  char * * D.19208;
  unsigned int idx.21;
  unsigned int D.19210;
  char * * D.19211;
  int idx;
  char * old;

  p.19 = (int) p;
  nursery_section.20 = nursery_section;
  D.19205 = nursery_section.20->data;
  D.19206 = (int) D.19205;
  D.19207 = p.19 - D.19206;
  idx = D.19207 / 8192;
  nursery_section.20 = nursery_section;
  D.19208 = nursery_section.20->scan_starts;
  idx.21 = (unsigned int) idx;
  D.19210 = idx.21 * 4;
  D.19211 = D.19208 + D.19210;
  old = *D.19211;
  if (old == 0B) goto <D.19212>; else goto <D.19214>;
  <D.19214>:
  if (old > p) goto <D.19212>; else goto <D.19213>;
  <D.19212>:
  nursery_section.20 = nursery_section;
  D.19208 = nursery_section.20->scan_starts;
  idx.21 = (unsigned int) idx;
  D.19210 = idx.21 * 4;
  D.19211 = D.19208 + D.19210;
  *D.19211 = p;
  <D.19213>:
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.19217;
  int D.19222;
  void * D.19224;
  unsigned int D.19225;

  D.19217 = __builtin_constant_p (__len);
  if (D.19217 != 0) goto <D.19218>; else goto <D.19219>;
  <D.19218>:
  if (__len == 0) goto <D.19220>; else goto <D.19221>;
  <D.19220>:
  D.19222 = __builtin_constant_p (__ch);
  if (D.19222 == 0) goto <D.19215>; else goto <D.19223>;
  <D.19223>:
  if (__ch != 0) goto <D.19215>; else goto <D.19216>;
  <D.19215>:
  __warn_memset_zero_len ();
  D.19224 = __dest;
  return D.19224;
  <D.19216>:
  <D.19221>:
  <D.19219>:
  D.19225 = __builtin_object_size (__dest, 0);
  D.19224 = __builtin___memset_chk (__dest, __ch, __len, D.19225);
  return D.19224;
}


mono_memory_write_barrier ()
{
  mono_memory_barrier ();
}


mono_memory_barrier ()
{
  __sync_synchronize ();
}


mono_gc_alloc_obj_nolock (struct MonoVTable * vtable, size_t size)
{
  unsigned int D.19230;
  void * D.19231;
  _Bool D.19232;
  long int D.19233;
  long int D.19234;
  int has_per_allocation_action.22;
  _Bool D.19238;
  long int D.19239;
  long int D.19240;
  unsigned int collect_before_allocs.23;
  unsigned int current_alloc.24;
  unsigned int D.19247;
  struct GCMemSection * nursery_section.25;
  int degraded_mode.26;
  int D.19256;
  unsigned int verify_before_allocs.27;
  unsigned int D.19265;
  char * tlab_temp_end.28;
  _Bool D.19272;
  long int D.19273;
  long int D.19274;
  struct FILE * gc_debug_file.29;
  struct MonoClass * D.19280;
  const char * D.19281;
  void * D.19284;
  _Bool D.19285;
  long int D.19286;
  long int D.19287;
  void * D.19290;
  char * tlab_next.30;
  char * tlab_real_end.31;
  sizetype D.19295;
  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.19325;
  unsigned int D.19326;
  unsigned int D.19327;
  long int D.19328;
  unsigned int alloc_size.39;
  char * tlab_real_end.40;
  unsigned int D.19339;
  char * tlab_temp_end.41;
  char * tlab_next.42;
  char * D.19345;
  char * tlab_temp_end.43;
  _Bool D.19349;
  long int D.19350;
  long int D.19351;
  void * * p;
  char * new_next;

  if (size <= 8000) goto <D.19227>; else goto <D.19228>;
  <D.19227>:
  goto <D.19229>;
  <D.19228>:
  <D.19229>:
  D.19230 = size + 7;
  size = D.19230 & 4294967288;
  D.19231 = vtable->gc_descr;
  D.19232 = D.19231 == 0B;
  D.19233 = (long int) D.19232;
  D.19234 = __builtin_expect (D.19233, 0);
  if (D.19234 != 0) goto <D.19235>; else goto <D.19236>;
  <D.19235>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 172, "vtable->gc_descr");
  <D.19236>:
  has_per_allocation_action.22 = has_per_allocation_action;
  D.19238 = has_per_allocation_action.22 != 0;
  D.19239 = (long int) D.19238;
  D.19240 = __builtin_expect (D.19239, 0);
  if (D.19240 != 0) goto <D.19241>; else goto <D.19242>;
  <D.19241>:
  {
    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.19244>; else goto <D.19245>;
    <D.19244>:
    current_alloc.24 = (unsigned int) current_alloc;
    collect_before_allocs.23 = collect_before_allocs;
    D.19247 = current_alloc.24 % collect_before_allocs.23;
    if (D.19247 == 0) goto <D.19248>; else goto <D.19249>;
    <D.19248>:
    nursery_section.25 = nursery_section;
    if (nursery_section.25 != 0B) goto <D.19251>; else goto <D.19252>;
    <D.19251>:
    sgen_perform_collection (0, 0, "collect-before-alloc-triggered", 1);
    degraded_mode.26 = degraded_mode;
    if (degraded_mode.26 == 0) goto <D.19254>; else goto <D.19255>;
    <D.19254>:
    D.19256 = sgen_can_alloc_size (size);
    if (D.19256 != 0) goto <D.19257>; else goto <D.19258>;
    <D.19257>:
    if (size <= 8000) goto <D.19259>; else goto <D.19260>;
    <D.19259>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "sgen-alloc.c", 183);
    <D.19260>:
    <D.19258>:
    <D.19255>:
    <D.19252>:
    <D.19249>:
    goto <D.19261>;
    <D.19245>:
    verify_before_allocs.27 = verify_before_allocs;
    if (verify_before_allocs.27 != 0) goto <D.19263>; else goto <D.19264>;
    <D.19263>:
    current_alloc.24 = (unsigned int) current_alloc;
    verify_before_allocs.27 = verify_before_allocs;
    D.19265 = current_alloc.24 % verify_before_allocs.27;
    if (D.19265 == 0) goto <D.19266>; else goto <D.19267>;
    <D.19266>:
    sgen_check_whole_heap_stw ();
    <D.19267>:
    <D.19264>:
    <D.19261>:
  }
  <D.19242>:
  if (size > 8000) goto <D.19268>; else goto <D.19269>;
  <D.19268>:
  p = sgen_los_alloc_large_inner (vtable, size);
  goto <D.19270>;
  <D.19269>:
  p = tlab_next;
  new_next = p + size;
  tlab_next = new_next;
  tlab_temp_end.28 = tlab_temp_end;
  D.19272 = new_next < tlab_temp_end.28;
  D.19273 = (long int) D.19272;
  D.19274 = __builtin_expect (D.19273, 1);
  if (D.19274 != 0) goto <D.19275>; else goto <D.19276>;
  <D.19275>:
  if (0 != 0) goto <D.19277>; else goto <D.19278>;
  <D.19277>:
  gc_debug_file.29 = gc_debug_file;
  D.19280 = vtable->klass;
  D.19281 = D.19280->name;
  fprintf (gc_debug_file.29, "Allocated object %p, vtable: %p (%s), size: %zd\n", p, vtable, D.19281, size);
  gc_debug_file.29 = gc_debug_file;
  fflush (gc_debug_file.29);
  <D.19278>:
  if (0 != 0) goto <D.19282>; else goto <D.19283>;
  <D.19282>:
  <D.19283>:
  D.19284 = *p;
  D.19285 = D.19284 != 0B;
  D.19286 = (long int) D.19285;
  D.19287 = __builtin_expect (D.19286, 0);
  if (D.19287 != 0) goto <D.19288>; else goto <D.19289>;
  <D.19288>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 225, "*p == NULL");
  <D.19289>:
  mono_memory_write_barrier ();
  *p = vtable;
  D.19290 = p;
  return D.19290;
  <D.19276>:
  tlab_next.30 = tlab_next;
  tlab_real_end.31 = tlab_real_end;
  if (tlab_next.30 >= tlab_real_end.31) goto <D.19293>; else goto <D.19294>;
  <D.19293>:
  {
    int available_in_tlab;

    tlab_next.30 = tlab_next;
    D.19295 = -size;
    tlab_next.32 = tlab_next.30 + D.19295;
    tlab_next = tlab_next.32;
    degraded_mode.26 = degraded_mode;
    if (degraded_mode.26 != 0) goto <D.19297>; else goto <D.19298>;
    <D.19297>:
    degraded_mode.26 = degraded_mode;
    sgen_nursery_size.33 = sgen_nursery_size;
    if (degraded_mode.26 < sgen_nursery_size.33) goto <D.19300>; else goto <D.19301>;
    <D.19300>:
    D.19290 = alloc_degraded (vtable, size, 0);
    return D.19290;
    <D.19301>:
    <D.19298>:
    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.19304>; else goto <D.19308>;
    <D.19308>:
    if (available_in_tlab > 512) goto <D.19304>; else goto <D.19305>;
    <D.19304>:
    <D.18956>:
    p = sgen_nursery_alloc (size);
    if (p == 0B) goto <D.19309>; else goto <D.19310>;
    <D.19309>:
    sgen_ensure_free_space (size);
    degraded_mode.26 = degraded_mode;
    if (degraded_mode.26 != 0) goto <D.19311>; else goto <D.19312>;
    <D.19311>:
    D.19290 = alloc_degraded (vtable, size, 0);
    return D.19290;
    <D.19312>:
    p = sgen_nursery_alloc (size);
    <D.19310>:
    if (p == 0B) goto <D.18956>; else goto <D.18957>;
    <D.18957>:
    if (p == 0B) goto <D.19313>; else goto <D.19314>;
    <D.19313>:
    if (1 != 0) goto <D.19315>; else goto <D.19316>;
    <D.19315>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 273, "0");
    <D.19316>:
    <D.19314>:
    nursery_clear_policy.37 = nursery_clear_policy;
    if (nursery_clear_policy.37 == 1) goto <D.19318>; else goto <D.19319>;
    <D.19318>:
    memset (p, 0, size);
    <D.19319>:
    goto <D.19306>;
    <D.19305>:
    {
      size_t alloc_size;

      try
        {
          alloc_size = 0;
          tlab_start.38 = tlab_start;
          if (tlab_start.38 != 0B) goto <D.19321>; else goto <D.19322>;
          <D.19321>:
          if (0 != 0) goto <D.19323>; else goto <D.19324>;
          <D.19323>:
          gc_debug_file.29 = gc_debug_file;
          tlab_start.38 = tlab_start;
          tlab_real_end.31 = tlab_real_end;
          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.19325 = tlab_real_end.34 - tlab_next.35;
          D.19326 = (unsigned int) D.19325;
          D.19327 = D.19326 - size;
          D.19328 = (long int) D.19327;
          fprintf (gc_debug_file.29, "Retire TLAB: %p-%p [%ld]\n", tlab_start.38, tlab_real_end.31, D.19328);
          gc_debug_file.29 = gc_debug_file;
          fflush (gc_debug_file.29);
          <D.19324>:
          <D.19322>:
          sgen_nursery_retire_region (p, available_in_tlab);
          <D.18959>:
          tlab_size.36 = tlab_size;
          p = sgen_nursery_alloc_range (tlab_size.36, size, &alloc_size);
          if (p == 0B) goto <D.19329>; else goto <D.19330>;
          <D.19329>:
          tlab_size.36 = tlab_size;
          sgen_ensure_free_space (tlab_size.36);
          degraded_mode.26 = degraded_mode;
          if (degraded_mode.26 != 0) goto <D.19331>; else goto <D.19332>;
          <D.19331>:
          D.19290 = alloc_degraded (vtable, size, 0);
          return D.19290;
          <D.19332>:
          tlab_size.36 = tlab_size;
          p = sgen_nursery_alloc_range (tlab_size.36, size, &alloc_size);
          <D.19330>:
          if (p == 0B) goto <D.18959>; else goto <D.18960>;
          <D.18960>:
          if (p == 0B) goto <D.19333>; else goto <D.19334>;
          <D.19333>:
          if (1 != 0) goto <D.19335>; else goto <D.19336>;
          <D.19335>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 298, "0");
          <D.19336>:
          <D.19334>:
          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.19339 = MIN_EXPR <alloc_size.39, 8192>;
          tlab_temp_end.41 = tlab_start.38 + D.19339;
          tlab_temp_end = tlab_temp_end.41;
          nursery_clear_policy.37 = nursery_clear_policy;
          if (nursery_clear_policy.37 == 1) goto <D.19341>; else goto <D.19342>;
          <D.19341>:
          tlab_start.38 = tlab_start;
          alloc_size.39 = alloc_size;
          memset (tlab_start.38, 0, alloc_size.39);
          <D.19342>:
          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.19306>:
  }
  goto <D.19344>;
  <D.19294>:
  sgen_set_nursery_scan_start (p);
  tlab_next.30 = tlab_next;
  D.19345 = tlab_next.30 + 8192;
  tlab_real_end.31 = tlab_real_end;
  tlab_temp_end.43 = MIN_EXPR <D.19345, tlab_real_end.31>;
  tlab_temp_end = tlab_temp_end.43;
  if (0 != 0) goto <D.19347>; else goto <D.19348>;
  <D.19347>:
  gc_debug_file.29 = gc_debug_file;
  tlab_next.30 = tlab_next;
  tlab_temp_end.28 = tlab_temp_end;
  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.19348>:
  <D.19344>:
  <D.19270>:
  D.19349 = p != 0B;
  D.19350 = (long int) D.19349;
  D.19351 = __builtin_expect (D.19350, 1);
  if (D.19351 != 0) goto <D.19352>; else goto <D.19353>;
  <D.19352>:
  if (0 != 0) goto <D.19354>; else goto <D.19355>;
  <D.19354>:
  gc_debug_file.29 = gc_debug_file;
  D.19280 = vtable->klass;
  D.19281 = D.19280->name;
  fprintf (gc_debug_file.29, "Allocated object %p, vtable: %p (%s), size: %zd\n", p, vtable, D.19281, size);
  gc_debug_file.29 = gc_debug_file;
  fflush (gc_debug_file.29);
  <D.19355>:
  if (0 != 0) goto <D.19356>; else goto <D.19357>;
  <D.19356>:
  if (size > 8000) goto <D.19358>; else goto <D.19359>;
  <D.19358>:
  goto <D.19360>;
  <D.19359>:
  <D.19360>:
  <D.19357>:
  mono_memory_write_barrier ();
  *p = vtable;
  <D.19353>:
  D.19290 = p;
  return D.19290;
}


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;
  struct _IO_FILE * stderr.48;
  int size.49;
  int D.19381;
  _Bool D.19384;
  int D.19385;
  void * (*<T2c30>) (struct MonoVTable *, size_t) D.19386;
  void * D.19390;
  static int last_major_gc_warned = -1;
  static int num_degraded = 0;
  void * p;

  if (for_mature == 0) goto <D.19364>; else goto <D.19365>;
  <D.19364>:
  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.19368>; else goto <D.19369>;
  <D.19368>:
  num_degraded.46 = num_degraded;
  num_degraded.47 = num_degraded.46 + 1;
  num_degraded = num_degraded.47;
  num_degraded.46 = num_degraded;
  if (num_degraded.46 == 1) goto <D.19372>; else goto <D.19375>;
  <D.19375>:
  num_degraded.46 = num_degraded;
  if (num_degraded.46 == 3) goto <D.19372>; else goto <D.19373>;
  <D.19372>:
  stderr.48 = stderr;
  fprintf (stderr.48, "Warning: Degraded allocation.  Consider increasing nursery-size if the warning persists.\n");
  goto <D.19374>;
  <D.19373>:
  num_degraded.46 = num_degraded;
  if (num_degraded.46 == 10) goto <D.19377>; else goto <D.19378>;
  <D.19377>:
  stderr.48 = stderr;
  fprintf (stderr.48, "Warning: Repeated degraded allocation.  Consider increasing nursery-size.\n");
  <D.19378>:
  <D.19374>:
  stat_major_gcs.45 = stat_major_gcs;
  last_major_gc_warned = stat_major_gcs.45;
  <D.19369>:
  size.49 = (int) size;
  InterlockedExchangeAdd (&degraded_mode, size.49);
  sgen_ensure_free_space (size);
  goto <D.19380>;
  <D.19365>:
  D.19381 = sgen_need_major_collection (size);
  if (D.19381 != 0) goto <D.19382>; else goto <D.19383>;
  <D.19382>:
  D.19384 = for_mature == 0;
  D.19385 = (int) D.19384;
  sgen_perform_collection (size, 1, "mature allocation failure", D.19385);
  <D.19383>:
  <D.19380>:
  D.19386 = major_collector.alloc_degraded;
  p = D.19386 (vtable, size);
  if (for_mature != 0) goto <D.19387>; else goto <D.19388>;
  <D.19387>:
  goto <D.19389>;
  <D.19388>:
  <D.19389>:
  D.19390 = p;
  return D.19390;
}


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

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


InterlockedExchangeAdd (volatile gint32 * val, gint32 add)
{
  gint32 D.19394;
  unsigned int add.50;
  unsigned int D.19396;

  add.50 = (unsigned int) add;
  D.19396 = __sync_fetch_and_add_4 (val, add.50);
  D.19394 = (gint32) D.19396;
  return D.19394;
}


mono_gc_alloc_vector (struct MonoVTable * vtable, size_t size, uintptr_t max_length)
{
  struct SgenThreadInfo * sgen_thread_info.51;
  void * D.19401;
  _Bool D.19402;
  long int D.19403;
  long int D.19404;
  struct MonoArray * arr;

  sgen_thread_info.51 = sgen_thread_info;
  sgen_thread_info.51->in_critical_region = 1;
  mono_memory_barrier ();
  arr = mono_gc_try_alloc_obj_nolock (vtable, size);
  if (arr != 0B) goto <D.19399>; else goto <D.19400>;
  <D.19399>:
  arr->max_length = max_length;
  mono_memory_barrier ();
  sgen_thread_info.51 = sgen_thread_info;
  sgen_thread_info.51->in_critical_region = 0;
  D.19401 = arr;
  return D.19401;
  <D.19400>:
  mono_memory_barrier ();
  sgen_thread_info.51 = sgen_thread_info;
  sgen_thread_info.51->in_critical_region = 0;
  pthread_mutex_lock (&gc_mutex);
  arr = mono_gc_alloc_obj_nolock (vtable, size);
  D.19402 = arr == 0B;
  D.19403 = (long int) D.19402;
  D.19404 = __builtin_expect (D.19403, 0);
  if (D.19404 != 0) goto <D.19405>; else goto <D.19406>;
  <D.19405>:
  sgen_gc_unlock ();
  D.19401 = mono_gc_out_of_memory (size);
  return D.19401;
  <D.19406>:
  arr->max_length = max_length;
  sgen_gc_unlock ();
  D.19401 = arr;
  return D.19401;
}


mono_gc_alloc_array (struct MonoVTable * vtable, size_t size, uintptr_t max_length, uintptr_t bounds_size)
{
  struct SgenThreadInfo * sgen_thread_info.52;
  sizetype D.19411;
  void * D.19412;
  _Bool D.19413;
  long int D.19414;
  long int D.19415;
  struct MonoArray * arr;
  struct MonoArrayBounds * bounds;

  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.19409>; else goto <D.19410>;
  <D.19409>:
  arr->max_length = max_length;
  D.19411 = size - bounds_size;
  bounds = arr + D.19411;
  arr->bounds = bounds;
  mono_memory_barrier ();
  sgen_thread_info.52 = sgen_thread_info;
  sgen_thread_info.52->in_critical_region = 0;
  D.19412 = arr;
  return D.19412;
  <D.19410>:
  mono_memory_barrier ();
  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.19413 = arr == 0B;
  D.19414 = (long int) D.19413;
  D.19415 = __builtin_expect (D.19414, 0);
  if (D.19415 != 0) goto <D.19416>; else goto <D.19417>;
  <D.19416>:
  sgen_gc_unlock ();
  D.19412 = mono_gc_out_of_memory (size);
  return D.19412;
  <D.19417>:
  arr->max_length = max_length;
  D.19411 = size - bounds_size;
  bounds = arr + D.19411;
  arr->bounds = bounds;
  sgen_gc_unlock ();
  D.19412 = arr;
  return D.19412;
}


mono_gc_alloc_string (struct MonoVTable * vtable, size_t size, gint32 len)
{
  struct SgenThreadInfo * sgen_thread_info.53;
  void * D.19422;
  _Bool D.19423;
  long int D.19424;
  long int D.19425;
  struct MonoString * str;

  sgen_thread_info.53 = sgen_thread_info;
  sgen_thread_info.53->in_critical_region = 1;
  mono_memory_barrier ();
  str = mono_gc_try_alloc_obj_nolock (vtable, size);
  if (str != 0B) goto <D.19420>; else goto <D.19421>;
  <D.19420>:
  str->length = len;
  mono_memory_barrier ();
  sgen_thread_info.53 = sgen_thread_info;
  sgen_thread_info.53->in_critical_region = 0;
  D.19422 = str;
  return D.19422;
  <D.19421>:
  mono_memory_barrier ();
  sgen_thread_info.53 = sgen_thread_info;
  sgen_thread_info.53->in_critical_region = 0;
  pthread_mutex_lock (&gc_mutex);
  str = mono_gc_alloc_obj_nolock (vtable, size);
  D.19423 = str == 0B;
  D.19424 = (long int) D.19423;
  D.19425 = __builtin_expect (D.19424, 0);
  if (D.19425 != 0) goto <D.19426>; else goto <D.19427>;
  <D.19426>:
  sgen_gc_unlock ();
  D.19422 = mono_gc_out_of_memory (size);
  return D.19422;
  <D.19427>:
  str->length = len;
  sgen_gc_unlock ();
  D.19422 = str;
  return D.19422;
}


mono_gc_alloc_pinned_obj (struct MonoVTable * vtable, size_t size)
{
  unsigned int D.19429;
  struct MonoClass * D.19435;
  const char * D.19436;
  const char * D.19437;
  void * (*<T2c2c>) (struct MonoVTable *, size_t, gboolean) D.19438;
  void * D.19439;
  unsigned int D.19440;
  int D.19441;
  _Bool D.19442;
  long int D.19443;
  long int D.19444;
  struct FILE * gc_debug_file.54;
  void * D.19453;
  void * * p;

  D.19429 = size + 7;
  size = D.19429 & 4294967288;
  pthread_mutex_lock (&gc_mutex);
  if (size > 8000) goto <D.19430>; else goto <D.19431>;
  <D.19430>:
  p = sgen_los_alloc_large_inner (vtable, size);
  goto <D.19432>;
  <D.19431>:
  if (0 != 0) goto <D.19433>; else goto <D.19434>;
  <D.19433>:
  D.19435 = vtable->klass;
  D.19436 = D.19435->name_space;
  D.19435 = vtable->klass;
  D.19437 = D.19435->name;
  monoeg_g_log (0B, 4, "class %s:%s is not initialized", D.19436, D.19437);
  <D.19003>:
  goto <D.19003>;
  <D.19434>:
  D.19438 = major_collector.alloc_small_pinned_obj;
  D.19439 = vtable->gc_descr;
  D.19440 = (unsigned int) D.19439;
  D.19441 = sgen_gc_descr_has_references (D.19440);
  p = D.19438 (vtable, size, D.19441);
  <D.19432>:
  D.19442 = p != 0B;
  D.19443 = (long int) D.19442;
  D.19444 = __builtin_expect (D.19443, 1);
  if (D.19444 != 0) goto <D.19445>; else goto <D.19446>;
  <D.19445>:
  if (0 != 0) goto <D.19447>; else goto <D.19448>;
  <D.19447>:
  gc_debug_file.54 = gc_debug_file;
  D.19435 = vtable->klass;
  D.19437 = D.19435->name;
  fprintf (gc_debug_file.54, "Allocated pinned object %p, vtable: %p (%s), size: %zd\n", p, vtable, D.19437, size);
  gc_debug_file.54 = gc_debug_file;
  fflush (gc_debug_file.54);
  <D.19448>:
  if (size > 8000) goto <D.19450>; else goto <D.19451>;
  <D.19450>:
  goto <D.19452>;
  <D.19451>:
  <D.19452>:
  <D.19446>:
  sgen_gc_unlock ();
  D.19453 = p;
  return D.19453;
}


sgen_gc_descr_has_references (mword desc)
{
  unsigned int D.19455;
  gboolean D.19458;
  unsigned int D.19459;
  unsigned int D.19462;

  D.19455 = desc & 4294901767;
  if (D.19455 == 1) goto <D.19456>; else goto <D.19457>;
  <D.19456>:
  D.19458 = 0;
  return D.19458;
  <D.19457>:
  D.19459 = desc & 49159;
  if (D.19459 == 4) goto <D.19460>; else goto <D.19461>;
  <D.19460>:
  D.19458 = 0;
  return D.19458;
  <D.19461>:
  D.19462 = desc & 7;
  if (D.19462 == 7) goto <D.19463>; else goto <D.19464>;
  <D.19463>:
  D.19458 = 0;
  return D.19458;
  <D.19464>:
  D.19458 = 1;
  return D.19458;
}


mono_gc_alloc_mature (struct MonoVTable * vtable)
{
  struct MonoClass * D.19466;
  int D.19467;
  int D.19468;
  unsigned int D.19469;
  unsigned int D.19470;
  unsigned int D.19471;
  _Bool D.19472;
  long int D.19473;
  long int D.19474;
  void * D.19477;
  void * * res;
  size_t size;

  D.19466 = vtable->klass;
  D.19467 = D.19466->instance_size;
  D.19468 = D.19467 + 7;
  D.19469 = (unsigned int) D.19468;
  size = D.19469 & 4294967288;
  pthread_mutex_lock (&gc_mutex);
  res = alloc_degraded (vtable, size, 1);
  sgen_gc_unlock ();
  D.19466 = vtable->klass;
  D.19470 = BIT_FIELD_REF <*D.19466, 32, 160>;
  D.19471 = D.19470 & 2097152;
  D.19472 = D.19471 != 0;
  D.19473 = (long int) D.19472;
  D.19474 = __builtin_expect (D.19473, 0);
  if (D.19474 != 0) goto <D.19475>; else goto <D.19476>;
  <D.19475>:
  mono_object_register_finalizer (res);
  <D.19476>:
  D.19477 = res;
  return D.19477;
}


mono_gc_alloc_fixed (size_t size, void * descr)
{
  void * D.19481;
  int D.19482;
  void * res;

  res = calloc (1, size);
  if (res == 0B) goto <D.19479>; else goto <D.19480>;
  <D.19479>:
  D.19481 = 0B;
  return D.19481;
  <D.19480>:
  D.19482 = mono_gc_register_root (res, size, descr);
  if (D.19482 == 0) goto <D.19483>; else goto <D.19484>;
  <D.19483>:
  free (res);
  res = 0B;
  <D.19484>:
  D.19481 = res;
  return D.19481;
}


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.19486;
  struct MonoLinkedListSetNode * D.19487;
  unsigned int D.19488;
  char * * D.19491;
  char * * D.19492;
  char * * D.19493;
  char * * D.19494;
  struct SgenThreadInfo * info;

  {
    struct MonoLinkedListSetNode * __cur;

    D.19486 = mono_thread_info_list_head ();
    __cur = D.19486->head;
    goto <D.19026>;
    <D.19025>:
    D.19487 = __cur->next;
    D.19488 = mono_lls_pointer_get_mark (D.19487);
    if (D.19488 == 0) goto <D.19489>; else goto <D.19490>;
    <D.19489>:
    info = __cur;
    D.19491 = info->tlab_start_addr;
    *D.19491 = 0B;
    D.19492 = info->tlab_next_addr;
    *D.19492 = 0B;
    D.19493 = info->tlab_temp_end_addr;
    *D.19493 = 0B;
    D.19494 = info->tlab_real_end_addr;
    *D.19494 = 0B;
    <D.19490>:
    D.19487 = __cur->next;
    __cur = mono_lls_pointer_unmask (D.19487);
    <D.19026>:
    if (__cur != 0B) goto <D.19025>; else goto <D.19027>;
    <D.19027>:
  }
}


mono_lls_pointer_get_mark (void * n)
{
  uintptr_t D.19495;
  unsigned int n.55;

  n.55 = (unsigned int) n;
  D.19495 = n.55 & 1;
  return D.19495;
}


mono_lls_pointer_unmask (void * p)
{
  void * D.19498;
  unsigned int p.56;
  unsigned int D.19500;

  p.56 = (unsigned int) p;
  D.19500 = p.56 & 4294967292;
  D.19498 = (void *) D.19500;
  return D.19498;
}


mono_gc_get_managed_allocator (struct MonoClass * klass, gboolean for_box)
{
  struct MonoMethod * D.19505;
  unsigned int collect_before_allocs.57;
  int D.19509;
  int D.19512;
  unsigned int D.19513;
  unsigned int tlab_size.58;
  unsigned int D.19519;
  unsigned int D.19520;
  <unnamed type> D.19522;
  unsigned int D.19523;
  unsigned char D.19524;
  unsigned char D.19527;
  long long unsigned int D.19531;
  long long unsigned int D.19532;
  long long unsigned int D.19533;
  struct MonoType * D.19535;
  int D.19536;
  int tlab_next_offset;
  int tlab_temp_end_offset;

  tlab_next_offset = -1;
  tlab_temp_end_offset = -1;
  tlab_next_offset = -1;
  tlab_temp_end_offset = -1;
  if (tlab_next_offset == -1) goto <D.19502>; else goto <D.19504>;
  <D.19504>:
  if (tlab_temp_end_offset == -1) goto <D.19502>; else goto <D.19503>;
  <D.19502>:
  D.19505 = 0B;
  return D.19505;
  <D.19503>:
  collect_before_allocs.57 = collect_before_allocs;
  if (collect_before_allocs.57 != 0) goto <D.19507>; else goto <D.19508>;
  <D.19507>:
  D.19505 = 0B;
  return D.19505;
  <D.19508>:
  D.19509 = mono_runtime_has_tls_get ();
  if (D.19509 == 0) goto <D.19510>; else goto <D.19511>;
  <D.19510>:
  D.19505 = 0B;
  return D.19505;
  <D.19511>:
  D.19512 = klass->instance_size;
  D.19513 = (unsigned int) D.19512;
  tlab_size.58 = tlab_size;
  if (D.19513 > tlab_size.58) goto <D.19515>; else goto <D.19516>;
  <D.19515>:
  D.19505 = 0B;
  return D.19505;
  <D.19516>:
  D.19519 = BIT_FIELD_REF <*klass, 32, 160>;
  D.19520 = D.19519 & 6291456;
  if (D.19520 != 0) goto <D.19517>; else goto <D.19521>;
  <D.19521>:
  D.19522 = mono_profiler_get_events ();
  D.19523 = D.19522 & 128;
  if (D.19523 != 0) goto <D.19517>; else goto <D.19518>;
  <D.19517>:
  D.19505 = 0B;
  return D.19505;
  <D.19518>:
  D.19524 = klass->rank;
  if (D.19524 != 0) goto <D.19525>; else goto <D.19526>;
  <D.19525>:
  D.19505 = 0B;
  return D.19505;
  <D.19526>:
  D.19527 = klass->byval_arg.type;
  if (D.19527 == 14) goto <D.19528>; else goto <D.19529>;
  <D.19528>:
  D.19505 = mono_gc_get_managed_allocator_by_type (3);
  return D.19505;
  <D.19529>:
  D.19512 = klass->instance_size;
  D.19531 = (long long unsigned int) D.19512;
  D.19532 = D.19531 + 7;
  D.19533 = D.19532 & 18446744073709551608;
  if (D.19533 <= 7999) goto <D.19534>; else goto <D.19530>;
  <D.19534>:
  D.19535 = &klass->byval_arg;
  D.19536 = mono_class_is_open_constructed_type (D.19535);
  if (D.19536 == 0) goto <D.19537>; else goto <D.19530>;
  <D.19537>:
  D.19505 = mono_gc_get_managed_allocator_by_type (2);
  return D.19505;
  <D.19530>:
  D.19505 = mono_gc_get_managed_allocator_by_type (0);
  return D.19505;
}


mono_gc_get_managed_array_allocator (struct MonoClass * klass)
{
  struct MonoMethod * D.19542;
  unsigned char D.19543;
  int D.19546;
  <unnamed type> D.19549;
  unsigned int D.19550;
  int has_per_allocation_action.59;
  int iftmp.60;
  int D.19560;
  unsigned int D.19562;
  unsigned int D.19563;
  _Bool D.19564;
  long int D.19565;
  long int D.19566;
  int tlab_next_offset;
  int tlab_temp_end_offset;

  tlab_next_offset = -1;
  tlab_temp_end_offset = -1;
  tlab_next_offset = -1;
  tlab_temp_end_offset = -1;
  if (tlab_next_offset == -1) goto <D.19539>; else goto <D.19541>;
  <D.19541>:
  if (tlab_temp_end_offset == -1) goto <D.19539>; else goto <D.19540>;
  <D.19539>:
  D.19542 = 0B;
  return D.19542;
  <D.19540>:
  D.19543 = klass->rank;
  if (D.19543 != 1) goto <D.19544>; else goto <D.19545>;
  <D.19544>:
  D.19542 = 0B;
  return D.19542;
  <D.19545>:
  D.19546 = mono_runtime_has_tls_get ();
  if (D.19546 == 0) goto <D.19547>; else goto <D.19548>;
  <D.19547>:
  D.19542 = 0B;
  return D.19542;
  <D.19548>:
  D.19549 = mono_profiler_get_events ();
  D.19550 = D.19549 & 128;
  if (D.19550 != 0) goto <D.19551>; else goto <D.19552>;
  <D.19551>:
  D.19542 = 0B;
  return D.19542;
  <D.19552>:
  has_per_allocation_action.59 = has_per_allocation_action;
  if (has_per_allocation_action.59 != 0) goto <D.19554>; else goto <D.19555>;
  <D.19554>:
  D.19542 = 0B;
  return D.19542;
  <D.19555>:
  D.19560 = mono_class_has_finalizer (klass);
  if (D.19560 != 0) goto <D.19557>; else goto <D.19561>;
  <D.19561>:
  D.19562 = BIT_FIELD_REF <*klass, 32, 160>;
  D.19563 = D.19562 & 4194304;
  if (D.19563 != 0) goto <D.19557>; else goto <D.19558>;
  <D.19557>:
  iftmp.60 = 1;
  goto <D.19559>;
  <D.19558>:
  iftmp.60 = 0;
  <D.19559>:
  D.19564 = iftmp.60 != 0;
  D.19565 = (long int) D.19564;
  D.19566 = __builtin_expect (D.19565, 0);
  if (D.19566 != 0) goto <D.19567>; else goto <D.19568>;
  <D.19567>:
  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.19568>:
  D.19542 = mono_gc_get_managed_allocator_by_type (1);
  return D.19542;
}


sgen_set_use_managed_allocator (gboolean flag)
{
  use_managed_allocator = flag;
}


mono_gc_get_managed_allocator_by_type (int atype)
{
  int use_managed_allocator.61;
  struct MonoMethod * D.19573;
  int D.19574;
  struct MonoMethod * D.19579;
  struct MonoMethod * res;

  use_managed_allocator.61 = use_managed_allocator;
  if (use_managed_allocator.61 == 0) goto <D.19571>; else goto <D.19572>;
  <D.19571>:
  D.19573 = 0B;
  return D.19573;
  <D.19572>:
  D.19574 = mono_runtime_has_tls_get ();
  if (D.19574 == 0) goto <D.19575>; else goto <D.19576>;
  <D.19575>:
  D.19573 = 0B;
  return D.19573;
  <D.19576>:
  res = alloc_method_cache[atype];
  if (res != 0B) goto <D.19577>; else goto <D.19578>;
  <D.19577>:
  D.19573 = res;
  return D.19573;
  <D.19578>:
  res = create_allocator (atype);
  pthread_mutex_lock (&gc_mutex);
  D.19579 = alloc_method_cache[atype];
  if (D.19579 != 0B) goto <D.19580>; else goto <D.19581>;
  <D.19580>:
  mono_free_method (res);
  res = alloc_method_cache[atype];
  goto <D.19582>;
  <D.19581>:
  mono_memory_barrier ();
  alloc_method_cache[atype] = res;
  <D.19582>:
  sgen_gc_unlock ();
  D.19573 = res;
  return D.19573;
}


create_allocator (int atype)
{
  _Bool D.19584;
  long int D.19585;
  long int D.19586;
  _Bool D.19589;
  long int D.19590;
  long int D.19591;
  int registered.62;
  struct MonoMethodSignature * D.19597;
  struct MonoMethodSignature * D.19598;
  struct MonoMethodSignature * D.19599;
  struct MonoImage * D.19612;
  unsigned int num_params.63;
  struct MonoClass * D.19616;
  struct MonoType * D.19617;
  struct MonoClass * D.19618;
  struct MonoType * D.19619;
  struct MonoClass * D.19620;
  struct MonoType * D.19621;
  struct MonoClass * D.19623;
  struct MonoType * D.19624;
  unsigned int size_var.64;
  unsigned int D.19632;
  unsigned int pos.65;
  int D.19634;
  unsigned int D.19635;
  unsigned int D.19636;
  int D.19637;
  unsigned int D.19638;
  unsigned int D.19639;
  unsigned int D.19640;
  struct MonoClass * D.19641;
  struct MonoClass * D.19642;
  _Bool D.19643;
  long int D.19644;
  long int D.19645;
  int D.19648;
  unsigned int D.19649;
  _Bool D.19650;
  long int D.19651;
  long int D.19652;
  _Bool D.19655;
  long int D.19656;
  long int D.19657;
  int D.19660;
  unsigned int D.19661;
  unsigned int D.19662;
  unsigned int D.19663;
  unsigned int pos_leave.66;
  unsigned int tlab_next_addr_var.67;
  unsigned int p_var.68;
  unsigned int new_next_var.69;
  struct MonoMethodHeader * D.19691;
  struct MonoMethod * D.19692;
  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;
  tlab_next_addr_offset = -1;
  tlab_temp_end_offset = -1;
  mono_tls_key_set_offset (5, tlab_next_addr_offset);
  mono_tls_key_set_offset (6, tlab_temp_end_offset);
  D.19584 = tlab_next_addr_offset == -1;
  D.19585 = (long int) D.19584;
  D.19586 = __builtin_expect (D.19585, 0);
  if (D.19586 != 0) goto <D.19587>; else goto <D.19588>;
  <D.19587>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 710, "tlab_next_addr_offset != -1");
  <D.19588>:
  D.19589 = tlab_temp_end_offset == -1;
  D.19590 = (long int) D.19589;
  D.19591 = __builtin_expect (D.19590, 0);
  if (D.19591 != 0) goto <D.19592>; else goto <D.19593>;
  <D.19592>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 711, "tlab_temp_end_offset != -1");
  <D.19593>:
  registered.62 = registered;
  if (registered.62 == 0) goto <D.19595>; else goto <D.19596>;
  <D.19595>:
  D.19597 = mono_create_icall_signature ("object ptr int");
  mono_register_jit_icall (mono_gc_alloc_obj, "mono_gc_alloc_obj", D.19597, 0);
  D.19598 = mono_create_icall_signature ("object ptr int int");
  mono_register_jit_icall (mono_gc_alloc_vector, "mono_gc_alloc_vector", D.19598, 0);
  D.19599 = mono_create_icall_signature ("object ptr int int32");
  mono_register_jit_icall (mono_gc_alloc_string, "mono_gc_alloc_string", D.19599, 0);
  registered = 1;
  <D.19596>:
  if (atype == 2) goto <D.19600>; else goto <D.19601>;
  <D.19600>:
  num_params = 1;
  name = "AllocSmall";
  goto <D.19602>;
  <D.19601>:
  if (atype == 0) goto <D.19603>; else goto <D.19604>;
  <D.19603>:
  num_params = 1;
  name = "Alloc";
  goto <D.19605>;
  <D.19604>:
  if (atype == 1) goto <D.19606>; else goto <D.19607>;
  <D.19606>:
  num_params = 2;
  name = "AllocVector";
  goto <D.19608>;
  <D.19607>:
  if (atype == 3) goto <D.19609>; else goto <D.19610>;
  <D.19609>:
  num_params = 2;
  name = "AllocString";
  goto <D.19611>;
  <D.19610>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "sgen-alloc.c", 734);
  <D.19611>:
  <D.19608>:
  <D.19605>:
  <D.19602>:
  D.19612 = mono_defaults.corlib;
  num_params.63 = (unsigned int) num_params;
  csig = mono_metadata_signature_alloc (D.19612, num_params.63);
  if (atype == 3) goto <D.19614>; else goto <D.19615>;
  <D.19614>:
  D.19616 = mono_defaults.string_class;
  D.19617 = &D.19616->byval_arg;
  csig->ret = D.19617;
  D.19618 = mono_defaults.int_class;
  D.19619 = &D.19618->byval_arg;
  csig->params[0] = D.19619;
  D.19620 = mono_defaults.int32_class;
  D.19621 = &D.19620->byval_arg;
  csig->params[1] = D.19621;
  goto <D.19622>;
  <D.19615>:
  D.19623 = mono_defaults.object_class;
  D.19624 = &D.19623->byval_arg;
  csig->ret = D.19624;
  i = 0;
  goto <D.19049>;
  <D.19048>:
  D.19618 = mono_defaults.int_class;
  D.19619 = &D.19618->byval_arg;
  csig->params[i] = D.19619;
  i = i + 1;
  <D.19049>:
  if (i < num_params) goto <D.19048>; else goto <D.19050>;
  <D.19050>:
  <D.19622>:
  D.19623 = mono_defaults.object_class;
  mb = mono_mb_new (D.19623, name, 28);
  D.19620 = mono_defaults.int32_class;
  D.19621 = &D.19620->byval_arg;
  size_var = mono_mb_add_local (mb, D.19621);
  if (atype == 0) goto <D.19625>; else goto <D.19628>;
  <D.19628>:
  if (atype == 2) goto <D.19625>; else goto <D.19626>;
  <D.19625>:
  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.64 = (unsigned int) size_var;
  mono_mb_emit_stloc (mb, size_var.64);
  goto <D.19627>;
  <D.19626>:
  if (atype == 1) goto <D.19630>; else goto <D.19631>;
  <D.19630>:
  {
    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.19632 = mono_mb_emit_short_branch (mb, 54);
    pos = (int) D.19632;
    mono_mb_emit_exception (mb, "OverflowException", 0B);
    pos.65 = (unsigned int) pos;
    mono_mb_patch_short_branch (mb, pos.65);
    D.19612 = mono_defaults.corlib;
    clause = mono_image_alloc0 (D.19612, 24);
    D.19634 = mono_mb_get_label (mb);
    D.19635 = (unsigned int) D.19634;
    clause->try_offset = D.19635;
    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.64 = (unsigned int) size_var;
    mono_mb_emit_stloc (mb, size_var.64);
    D.19636 = mono_mb_emit_branch (mb, 221);
    pos_leave = (int) D.19636;
    clause->flags = 0;
    D.19637 = mono_mb_get_pos (mb);
    D.19638 = (unsigned int) D.19637;
    D.19639 = clause->try_offset;
    D.19640 = D.19638 - D.19639;
    clause->try_len = D.19640;
    D.19612 = mono_defaults.corlib;
    D.19641 = mono_class_from_name (D.19612, "System", "OverflowException");
    clause->data.catch_class = D.19641;
    D.19642 = clause->data.catch_class;
    D.19643 = D.19642 == 0B;
    D.19644 = (long int) D.19643;
    D.19645 = __builtin_expect (D.19644, 0);
    if (D.19645 != 0) goto <D.19646>; else goto <D.19647>;
    <D.19646>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 803, "clause->data.catch_class");
    <D.19647>:
    D.19648 = mono_mb_get_label (mb);
    D.19649 = (unsigned int) D.19648;
    clause->handler_offset = D.19649;
    D.19612 = mono_defaults.corlib;
    oom_exc_class = mono_class_from_name (D.19612, "System", "OutOfMemoryException");
    D.19650 = oom_exc_class == 0B;
    D.19651 = (long int) D.19650;
    D.19652 = __builtin_expect (D.19651, 0);
    if (D.19652 != 0) goto <D.19653>; else goto <D.19654>;
    <D.19653>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 808, "oom_exc_class");
    <D.19654>:
    ctor = mono_class_get_method_from_name (oom_exc_class, ".ctor", 0);
    D.19655 = ctor == 0B;
    D.19656 = (long int) D.19655;
    D.19657 = __builtin_expect (D.19656, 0);
    if (D.19657 != 0) goto <D.19658>; else goto <D.19659>;
    <D.19658>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 810, "ctor");
    <D.19659>:
    mono_mb_emit_byte (mb, 38);
    mono_mb_emit_op (mb, 115, ctor);
    mono_mb_emit_byte (mb, 122);
    D.19660 = mono_mb_get_pos (mb);
    D.19661 = (unsigned int) D.19660;
    D.19662 = clause->handler_offset;
    D.19663 = D.19661 - D.19662;
    clause->handler_len = D.19663;
    mono_mb_set_clauses (mb, 1, clause);
    pos_leave.66 = (unsigned int) pos_leave;
    mono_mb_patch_branch (mb, pos_leave.66);
  }
  goto <D.19665>;
  <D.19631>:
  if (atype == 3) goto <D.19666>; else goto <D.19667>;
  <D.19666>:
  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.64 = (unsigned int) size_var;
  mono_mb_emit_stloc (mb, size_var.64);
  goto <D.19668>;
  <D.19667>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "sgen-alloc.c", 831);
  <D.19668>:
  <D.19665>:
  <D.19627>:
  size_var.64 = (unsigned int) size_var;
  mono_mb_emit_ldloc (mb, size_var.64);
  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.64 = (unsigned int) size_var;
  mono_mb_emit_stloc (mb, size_var.64);
  if (atype != 2) goto <D.19669>; else goto <D.19670>;
  <D.19669>:
  size_var.64 = (unsigned int) size_var;
  mono_mb_emit_ldloc (mb, size_var.64);
  mono_mb_emit_icon (mb, 8000);
  max_size_branch = mono_mb_emit_short_branch (mb, 53);
  <D.19670>:
  D.19618 = mono_defaults.int_class;
  D.19619 = &D.19618->byval_arg;
  tlab_next_addr_var = mono_mb_add_local (mb, D.19619);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 13);
  mono_mb_emit_i4 (mb, 5);
  tlab_next_addr_var.67 = (unsigned int) tlab_next_addr_var;
  mono_mb_emit_stloc (mb, tlab_next_addr_var.67);
  D.19618 = mono_defaults.int_class;
  D.19619 = &D.19618->byval_arg;
  p_var = mono_mb_add_local (mb, D.19619);
  tlab_next_addr_var.67 = (unsigned int) tlab_next_addr_var;
  mono_mb_emit_ldloc (mb, tlab_next_addr_var.67);
  mono_mb_emit_byte (mb, 77);
  p_var.68 = (unsigned int) p_var;
  mono_mb_emit_stloc (mb, p_var.68);
  D.19618 = mono_defaults.int_class;
  D.19619 = &D.19618->byval_arg;
  new_next_var = mono_mb_add_local (mb, D.19619);
  p_var.68 = (unsigned int) p_var;
  mono_mb_emit_ldloc (mb, p_var.68);
  size_var.64 = (unsigned int) size_var;
  mono_mb_emit_ldloc (mb, size_var.64);
  mono_mb_emit_byte (mb, 211);
  mono_mb_emit_byte (mb, 88);
  new_next_var.69 = (unsigned int) new_next_var;
  mono_mb_emit_stloc (mb, new_next_var.69);
  new_next_var.69 = (unsigned int) new_next_var;
  mono_mb_emit_ldloc (mb, new_next_var.69);
  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.19674>; else goto <D.19675>;
  <D.19674>:
  mono_mb_patch_short_branch (mb, max_size_branch);
  <D.19675>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 12);
  mono_mb_emit_ldarg (mb, 0);
  size_var.64 = (unsigned int) size_var;
  mono_mb_emit_ldloc (mb, size_var.64);
  if (atype == 0) goto <D.19676>; else goto <D.19679>;
  <D.19679>:
  if (atype == 2) goto <D.19676>; else goto <D.19677>;
  <D.19676>:
  mono_mb_emit_icall (mb, mono_gc_alloc_obj);
  goto <D.19678>;
  <D.19677>:
  if (atype == 1) goto <D.19680>; else goto <D.19681>;
  <D.19680>:
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icall (mb, mono_gc_alloc_vector);
  goto <D.19682>;
  <D.19681>:
  if (atype == 3) goto <D.19683>; else goto <D.19684>;
  <D.19683>:
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icall (mb, mono_gc_alloc_string);
  goto <D.19685>;
  <D.19684>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "sgen-alloc.c", 898);
  <D.19685>:
  <D.19682>:
  <D.19678>:
  mono_mb_emit_byte (mb, 42);
  mono_mb_patch_short_branch (mb, slowpath_branch);
  tlab_next_addr_var.67 = (unsigned int) tlab_next_addr_var;
  mono_mb_emit_ldloc (mb, tlab_next_addr_var.67);
  new_next_var.69 = (unsigned int) new_next_var;
  mono_mb_emit_ldloc (mb, new_next_var.69);
  mono_mb_emit_byte (mb, 223);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 16, 0B);
  p_var.68 = (unsigned int) p_var;
  mono_mb_emit_ldloc (mb, p_var.68);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 223);
  if (atype == 1) goto <D.19686>; else goto <D.19687>;
  <D.19686>:
  p_var.68 = (unsigned int) p_var;
  mono_mb_emit_ldloc (mb, p_var.68);
  mono_mb_emit_ldflda (mb, 12);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_byte (mb, 84);
  goto <D.19688>;
  <D.19687>:
  if (atype == 3) goto <D.19689>; else goto <D.19690>;
  <D.19689>:
  p_var.68 = (unsigned int) p_var;
  mono_mb_emit_ldloc (mb, p_var.68);
  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.68 = (unsigned int) p_var;
  mono_mb_emit_ldloc (mb, p_var.68);
  size_var.64 = (unsigned int) size_var;
  mono_mb_emit_ldloc (mb, size_var.64);
  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.19690>:
  <D.19688>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 16, 0B);
  p_var.68 = (unsigned int) p_var;
  mono_mb_emit_ldloc (mb, p_var.68);
  mono_mb_emit_byte (mb, 42);
  res = mono_mb_create_method (mb, csig, 8);
  mono_mb_free (mb);
  D.19691 = mono_method_get_header (res);
  D.19691->init_locals = 0;
  D.19612 = mono_defaults.corlib;
  info = mono_image_alloc0 (D.19612, 8);
  info->gc_name = "sgen";
  info->alloc_type = atype;
  mono_marshal_set_wrapper_info (res, info);
  D.19692 = res;
  return D.19692;
}


mono_gc_get_managed_allocator_types ()
{
  guint32 D.19694;

  D.19694 = 4;
  return D.19694;
}


sgen_is_managed_allocator (struct MonoMethod * method)
{
  struct MonoMethod * D.19696;
  gboolean D.19699;
  int i;

  i = 0;
  goto <D.19082>;
  <D.19081>:
  D.19696 = alloc_method_cache[i];
  if (D.19696 == method) goto <D.19697>; else goto <D.19698>;
  <D.19697>:
  D.19699 = 1;
  return D.19699;
  <D.19698>:
  i = i + 1;
  <D.19082>:
  if (i <= 3) goto <D.19081>; else goto <D.19083>;
  <D.19083>:
  D.19699 = 0;
  return D.19699;
}


sgen_has_managed_allocator ()
{
  struct MonoMethod * D.19701;
  gboolean D.19704;
  int i;

  i = 0;
  goto <D.19089>;
  <D.19088>:
  D.19701 = alloc_method_cache[i];
  if (D.19701 != 0B) goto <D.19702>; else goto <D.19703>;
  <D.19702>:
  D.19704 = 1;
  return D.19704;
  <D.19703>:
  i = i + 1;
  <D.19089>:
  if (i <= 3) goto <D.19088>; else goto <D.19090>;
  <D.19090>:
  D.19704 = 0;
  return D.19704;
}


