mono_gc_alloc_obj (struct MonoVTable * vtable, size_t size)
{
  int has_per_allocation_action.0;
  _Bool D.21678;
  long int D.21679;
  long int D.21680;
  unsigned int verify_before_allocs.1;
  unsigned int current_alloc.2;
  unsigned int D.21687;
  unsigned int collect_before_allocs.3;
  unsigned int D.21693;
  struct GCMemSection * nursery_section.4;
  struct SgenThreadInfo * sgen_thread_info.5;
  void * D.21702;
  _Bool D.21703;
  long int D.21704;
  long int D.21705;
  void * res;

  has_per_allocation_action.0 = has_per_allocation_action;
  D.21678 = has_per_allocation_action.0 != 0;
  D.21679 = (long int) D.21678;
  D.21680 = __builtin_expect (D.21679, 0);
  if (D.21680 != 0) goto <D.21681>; else goto <D.21682>;
  <D.21681>:
  {
    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.21684>; else goto <D.21685>;
    <D.21684>:
    current_alloc.2 = (unsigned int) current_alloc;
    verify_before_allocs.1 = verify_before_allocs;
    D.21687 = current_alloc.2 % verify_before_allocs.1;
    if (D.21687 == 0) goto <D.21688>; else goto <D.21689>;
    <D.21688>:
    sgen_check_whole_heap_stw ();
    <D.21689>:
    <D.21685>:
    collect_before_allocs.3 = collect_before_allocs;
    if (collect_before_allocs.3 != 0) goto <D.21691>; else goto <D.21692>;
    <D.21691>:
    current_alloc.2 = (unsigned int) current_alloc;
    collect_before_allocs.3 = collect_before_allocs;
    D.21693 = current_alloc.2 % collect_before_allocs.3;
    if (D.21693 == 0) goto <D.21694>; else goto <D.21695>;
    <D.21694>:
    nursery_section.4 = nursery_section;
    if (nursery_section.4 != 0B) goto <D.21697>; else goto <D.21698>;
    <D.21697>:
    pthread_mutex_lock (&gc_mutex);
    sgen_perform_collection (0, 0, "collect-before-alloc-triggered", 1);
    sgen_gc_unlock ();
    <D.21698>:
    <D.21695>:
    <D.21692>:
  }
  <D.21682>:
  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.21700>; else goto <D.21701>;
  <D.21700>:
  mono_memory_barrier ();
  sgen_thread_info.5 = sgen_thread_info;
  sgen_thread_info.5->in_critical_region = 0;
  D.21702 = res;
  return D.21702;
  <D.21701>:
  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.21703 = res == 0B;
  D.21704 = (long int) D.21703;
  D.21705 = __builtin_expect (D.21704, 0);
  if (D.21705 != 0) goto <D.21706>; else goto <D.21707>;
  <D.21706>:
  D.21702 = mono_gc_out_of_memory (size);
  return D.21702;
  <D.21707>:
  D.21702 = res;
  return D.21702;
}


InterlockedIncrement (volatile gint32 * val)
{
  gint32 D.21709;
  unsigned int D.21710;

  D.21710 = __sync_add_and_fetch_4 (val, 1);
  D.21709 = (gint32) D.21710;
  return D.21709;
}


mono_gc_try_alloc_obj_nolock (struct MonoVTable * vtable, size_t size)
{
  unsigned int D.21712;
  void * D.21715;
  _Bool D.21716;
  long int D.21717;
  long int D.21718;
  void * D.21723;
  unsigned int tlab_size.6;
  _Bool D.21725;
  long int D.21726;
  long int D.21727;
  <unnamed type> nursery_clear_policy.7;
  int real_end.8;
  int p.9;
  _Bool D.21738;
  long int D.21739;
  long int D.21740;
  char * tlab_temp_end.10;
  _Bool D.21744;
  long int D.21745;
  long int D.21746;
  char * tlab_next.11;
  char * D.21750;
  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.21769;
  char * tlab_temp_end.18;
  struct MonoClass * D.21775;
  const char * D.21776;
  void * D.21779;
  _Bool D.21780;
  long int D.21781;
  long int D.21782;
  void * * p;
  char * new_next;

  D.21712 = size + 7;
  size = D.21712 & 4294967288;
  if (0 != 0) goto <D.21713>; else goto <D.21714>;
  <D.21713>:
  monoeg_g_log (0B, 4, "Object too small");
  <D.21550>:
  goto <D.21550>;
  <D.21714>:
  D.21715 = vtable->gc_descr;
  D.21716 = D.21715 == 0B;
  D.21717 = (long int) D.21716;
  D.21718 = __builtin_expect (D.21717, 0);
  if (D.21718 != 0) goto <D.21719>; else goto <D.21720>;
  <D.21719>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 352, "vtable->gc_descr");
  <D.21720>:
  if (size > 8000) goto <D.21721>; else goto <D.21722>;
  <D.21721>:
  D.21723 = 0B;
  return D.21723;
  <D.21722>:
  tlab_size.6 = tlab_size;
  D.21725 = size > tlab_size.6;
  D.21726 = (long int) D.21725;
  D.21727 = __builtin_expect (D.21726, 0);
  if (D.21727 != 0) goto <D.21728>; else goto <D.21729>;
  <D.21728>:
  p = sgen_nursery_alloc (size);
  if (p == 0B) goto <D.21730>; else goto <D.21731>;
  <D.21730>:
  D.21723 = 0B;
  return D.21723;
  <D.21731>:
  sgen_set_nursery_scan_start (p);
  nursery_clear_policy.7 = nursery_clear_policy;
  if (nursery_clear_policy.7 == 1) goto <D.21733>; else goto <D.21734>;
  <D.21733>:
  memset (p, 0, size);
  <D.21734>:
  goto <D.21735>;
  <D.21729>:
  {
    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.21738 = new_next < real_end;
    D.21739 = (long int) D.21738;
    D.21740 = __builtin_expect (D.21739, 1);
    if (D.21740 != 0) goto <D.21741>; else goto <D.21742>;
    <D.21741>:
    tlab_next = new_next;
    tlab_temp_end.10 = tlab_temp_end;
    D.21744 = new_next >= tlab_temp_end.10;
    D.21745 = (long int) D.21744;
    D.21746 = __builtin_expect (D.21745, 0);
    if (D.21746 != 0) goto <D.21747>; else goto <D.21748>;
    <D.21747>:
    sgen_set_nursery_scan_start (new_next);
    tlab_next.11 = tlab_next;
    D.21750 = tlab_next.11 + 8192;
    tlab_real_end.12 = tlab_real_end;
    tlab_temp_end.13 = MIN_EXPR <D.21750, tlab_real_end.12>;
    tlab_temp_end = tlab_temp_end.13;
    if (0 != 0) goto <D.21753>; else goto <D.21754>;
    <D.21753>:
    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.21754>:
    <D.21748>:
    goto <D.21756>;
    <D.21742>:
    if (available_in_tlab > 512) goto <D.21757>; else goto <D.21758>;
    <D.21757>:
    p = sgen_nursery_alloc (size);
    if (p == 0B) goto <D.21759>; else goto <D.21760>;
    <D.21759>:
    D.21723 = 0B;
    return D.21723;
    <D.21760>:
    nursery_clear_policy.7 = nursery_clear_policy;
    if (nursery_clear_policy.7 == 1) goto <D.21761>; else goto <D.21762>;
    <D.21761>:
    memset (p, 0, size);
    <D.21762>:
    goto <D.21763>;
    <D.21758>:
    {
      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.21764>; else goto <D.21765>;
          <D.21764>:
          D.21723 = 0B;
          return D.21723;
          <D.21765>:
          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.21769 = MIN_EXPR <alloc_size.16, 8192>;
          tlab_temp_end.18 = new_next + D.21769;
          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.21771>; else goto <D.21772>;
          <D.21771>:
          alloc_size.16 = alloc_size;
          memset (new_next, 0, alloc_size.16);
          <D.21772>:
        }
      finally
        {
          alloc_size = {CLOBBER};
        }
    }
    <D.21763>:
    <D.21756>:
  }
  <D.21735>:
  if (0 != 0) goto <D.21773>; else goto <D.21774>;
  <D.21773>:
  gc_debug_file.14 = gc_debug_file;
  D.21775 = vtable->klass;
  D.21776 = D.21775->name;
  fprintf (gc_debug_file.14, "Allocated object %p, vtable: %p (%s), size: %zd\n", p, vtable, D.21776, size);
  gc_debug_file.14 = gc_debug_file;
  fflush (gc_debug_file.14);
  <D.21774>:
  if (0 != 0) goto <D.21777>; else goto <D.21778>;
  <D.21777>:
  <D.21778>:
  D.21779 = *p;
  D.21780 = D.21779 != 0B;
  D.21781 = (long int) D.21780;
  D.21782 = __builtin_expect (D.21781, 0);
  if (D.21782 != 0) goto <D.21783>; else goto <D.21784>;
  <D.21783>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 425, "*p == NULL");
  <D.21784>:
  mono_memory_write_barrier ();
  *p = vtable;
  D.21723 = p;
  return D.21723;
}


sgen_set_nursery_scan_start (char * p)
{
  int p.19;
  struct GCMemSection * nursery_section.20;
  char * D.21790;
  int D.21791;
  int D.21792;
  char * * D.21793;
  unsigned int idx.21;
  unsigned int D.21795;
  char * * D.21796;
  _Bool D.21797;
  _Bool D.21798;
  _Bool D.21799;
  int idx;
  char * old;

  p.19 = (int) p;
  nursery_section.20 = nursery_section;
  D.21790 = nursery_section.20->data;
  D.21791 = (int) D.21790;
  D.21792 = p.19 - D.21791;
  idx = D.21792 / 8192;
  nursery_section.20 = nursery_section;
  D.21793 = nursery_section.20->scan_starts;
  idx.21 = (unsigned int) idx;
  D.21795 = idx.21 * 4;
  D.21796 = D.21793 + D.21795;
  old = *D.21796;
  D.21797 = old == 0B;
  D.21798 = old > p;
  D.21799 = D.21797 | D.21798;
  if (D.21799 != 0) goto <D.21800>; else goto <D.21801>;
  <D.21800>:
  nursery_section.20 = nursery_section;
  D.21793 = nursery_section.20->scan_starts;
  idx.21 = (unsigned int) idx;
  D.21795 = idx.21 * 4;
  D.21796 = D.21793 + D.21795;
  *D.21796 = p;
  <D.21801>:
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.21804;
  int D.21809;
  void * D.21811;
  unsigned int D.21812;

  D.21804 = __builtin_constant_p (__len);
  if (D.21804 != 0) goto <D.21805>; else goto <D.21806>;
  <D.21805>:
  if (__len == 0) goto <D.21807>; else goto <D.21808>;
  <D.21807>:
  D.21809 = __builtin_constant_p (__ch);
  if (D.21809 == 0) goto <D.21802>; else goto <D.21810>;
  <D.21810>:
  if (__ch != 0) goto <D.21802>; else goto <D.21803>;
  <D.21802>:
  __warn_memset_zero_len ();
  D.21811 = __dest;
  return D.21811;
  <D.21803>:
  <D.21808>:
  <D.21806>:
  D.21812 = __builtin_object_size (__dest, 0);
  D.21811 = __builtin___memset_chk (__dest, __ch, __len, D.21812);
  return D.21811;
}


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.21817;
  void * D.21818;
  _Bool D.21819;
  long int D.21820;
  long int D.21821;
  int has_per_allocation_action.22;
  _Bool D.21825;
  long int D.21826;
  long int D.21827;
  unsigned int collect_before_allocs.23;
  unsigned int current_alloc.24;
  unsigned int D.21834;
  struct GCMemSection * nursery_section.25;
  int degraded_mode.26;
  int D.21843;
  unsigned int verify_before_allocs.27;
  unsigned int D.21852;
  char * tlab_temp_end.28;
  _Bool D.21859;
  long int D.21860;
  long int D.21861;
  struct FILE * gc_debug_file.29;
  struct MonoClass * D.21867;
  const char * D.21868;
  void * D.21871;
  _Bool D.21872;
  long int D.21873;
  long int D.21874;
  void * D.21877;
  char * tlab_next.30;
  char * tlab_real_end.31;
  sizetype D.21882;
  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.21912;
  unsigned int D.21913;
  unsigned int D.21914;
  long int D.21915;
  unsigned int alloc_size.39;
  char * tlab_real_end.40;
  unsigned int D.21926;
  char * tlab_temp_end.41;
  char * tlab_next.42;
  char * D.21932;
  char * tlab_temp_end.43;
  _Bool D.21936;
  long int D.21937;
  long int D.21938;
  void * * p;
  char * new_next;

  if (size <= 8000) goto <D.21814>; else goto <D.21815>;
  <D.21814>:
  goto <D.21816>;
  <D.21815>:
  <D.21816>:
  D.21817 = size + 7;
  size = D.21817 & 4294967288;
  D.21818 = vtable->gc_descr;
  D.21819 = D.21818 == 0B;
  D.21820 = (long int) D.21819;
  D.21821 = __builtin_expect (D.21820, 0);
  if (D.21821 != 0) goto <D.21822>; else goto <D.21823>;
  <D.21822>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 172, "vtable->gc_descr");
  <D.21823>:
  has_per_allocation_action.22 = has_per_allocation_action;
  D.21825 = has_per_allocation_action.22 != 0;
  D.21826 = (long int) D.21825;
  D.21827 = __builtin_expect (D.21826, 0);
  if (D.21827 != 0) goto <D.21828>; else goto <D.21829>;
  <D.21828>:
  {
    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.21831>; else goto <D.21832>;
    <D.21831>:
    current_alloc.24 = (unsigned int) current_alloc;
    collect_before_allocs.23 = collect_before_allocs;
    D.21834 = current_alloc.24 % collect_before_allocs.23;
    if (D.21834 == 0) goto <D.21835>; else goto <D.21836>;
    <D.21835>:
    nursery_section.25 = nursery_section;
    if (nursery_section.25 != 0B) goto <D.21838>; else goto <D.21839>;
    <D.21838>:
    sgen_perform_collection (0, 0, "collect-before-alloc-triggered", 1);
    degraded_mode.26 = degraded_mode;
    if (degraded_mode.26 == 0) goto <D.21841>; else goto <D.21842>;
    <D.21841>:
    D.21843 = sgen_can_alloc_size (size);
    if (D.21843 != 0) goto <D.21844>; else goto <D.21845>;
    <D.21844>:
    if (size <= 8000) goto <D.21846>; else goto <D.21847>;
    <D.21846>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "sgen-alloc.c", 183);
    <D.21847>:
    <D.21845>:
    <D.21842>:
    <D.21839>:
    <D.21836>:
    goto <D.21848>;
    <D.21832>:
    verify_before_allocs.27 = verify_before_allocs;
    if (verify_before_allocs.27 != 0) goto <D.21850>; else goto <D.21851>;
    <D.21850>:
    current_alloc.24 = (unsigned int) current_alloc;
    verify_before_allocs.27 = verify_before_allocs;
    D.21852 = current_alloc.24 % verify_before_allocs.27;
    if (D.21852 == 0) goto <D.21853>; else goto <D.21854>;
    <D.21853>:
    sgen_check_whole_heap_stw ();
    <D.21854>:
    <D.21851>:
    <D.21848>:
  }
  <D.21829>:
  if (size > 8000) goto <D.21855>; else goto <D.21856>;
  <D.21855>:
  p = sgen_los_alloc_large_inner (vtable, size);
  goto <D.21857>;
  <D.21856>:
  p = tlab_next;
  new_next = p + size;
  tlab_next = new_next;
  tlab_temp_end.28 = tlab_temp_end;
  D.21859 = new_next < tlab_temp_end.28;
  D.21860 = (long int) D.21859;
  D.21861 = __builtin_expect (D.21860, 1);
  if (D.21861 != 0) goto <D.21862>; else goto <D.21863>;
  <D.21862>:
  if (0 != 0) goto <D.21864>; else goto <D.21865>;
  <D.21864>:
  gc_debug_file.29 = gc_debug_file;
  D.21867 = vtable->klass;
  D.21868 = D.21867->name;
  fprintf (gc_debug_file.29, "Allocated object %p, vtable: %p (%s), size: %zd\n", p, vtable, D.21868, size);
  gc_debug_file.29 = gc_debug_file;
  fflush (gc_debug_file.29);
  <D.21865>:
  if (0 != 0) goto <D.21869>; else goto <D.21870>;
  <D.21869>:
  <D.21870>:
  D.21871 = *p;
  D.21872 = D.21871 != 0B;
  D.21873 = (long int) D.21872;
  D.21874 = __builtin_expect (D.21873, 0);
  if (D.21874 != 0) goto <D.21875>; else goto <D.21876>;
  <D.21875>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 225, "*p == NULL");
  <D.21876>:
  mono_memory_write_barrier ();
  *p = vtable;
  D.21877 = p;
  return D.21877;
  <D.21863>:
  tlab_next.30 = tlab_next;
  tlab_real_end.31 = tlab_real_end;
  if (tlab_next.30 >= tlab_real_end.31) goto <D.21880>; else goto <D.21881>;
  <D.21880>:
  {
    int available_in_tlab;

    tlab_next.30 = tlab_next;
    D.21882 = -size;
    tlab_next.32 = tlab_next.30 + D.21882;
    tlab_next = tlab_next.32;
    degraded_mode.26 = degraded_mode;
    if (degraded_mode.26 != 0) goto <D.21884>; else goto <D.21885>;
    <D.21884>:
    degraded_mode.26 = degraded_mode;
    sgen_nursery_size.33 = sgen_nursery_size;
    if (degraded_mode.26 < sgen_nursery_size.33) goto <D.21887>; else goto <D.21888>;
    <D.21887>:
    D.21877 = alloc_degraded (vtable, size, 0);
    return D.21877;
    <D.21888>:
    <D.21885>:
    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.21891>; else goto <D.21895>;
    <D.21895>:
    if (available_in_tlab > 512) goto <D.21891>; else goto <D.21892>;
    <D.21891>:
    <D.21539>:
    p = sgen_nursery_alloc (size);
    if (p == 0B) goto <D.21896>; else goto <D.21897>;
    <D.21896>:
    sgen_ensure_free_space (size);
    degraded_mode.26 = degraded_mode;
    if (degraded_mode.26 != 0) goto <D.21898>; else goto <D.21899>;
    <D.21898>:
    D.21877 = alloc_degraded (vtable, size, 0);
    return D.21877;
    <D.21899>:
    p = sgen_nursery_alloc (size);
    <D.21897>:
    if (p == 0B) goto <D.21539>; else goto <D.21540>;
    <D.21540>:
    if (p == 0B) goto <D.21900>; else goto <D.21901>;
    <D.21900>:
    if (1 != 0) goto <D.21902>; else goto <D.21903>;
    <D.21902>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 273, "0");
    <D.21903>:
    <D.21901>:
    nursery_clear_policy.37 = nursery_clear_policy;
    if (nursery_clear_policy.37 == 1) goto <D.21905>; else goto <D.21906>;
    <D.21905>:
    memset (p, 0, size);
    <D.21906>:
    goto <D.21893>;
    <D.21892>:
    {
      size_t alloc_size;

      try
        {
          alloc_size = 0;
          tlab_start.38 = tlab_start;
          if (tlab_start.38 != 0B) goto <D.21908>; else goto <D.21909>;
          <D.21908>:
          if (0 != 0) goto <D.21910>; else goto <D.21911>;
          <D.21910>:
          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.21912 = tlab_real_end.34 - tlab_next.35;
          D.21913 = (unsigned int) D.21912;
          D.21914 = D.21913 - size;
          D.21915 = (long int) D.21914;
          fprintf (gc_debug_file.29, "Retire TLAB: %p-%p [%ld]\n", tlab_start.38, tlab_real_end.31, D.21915);
          gc_debug_file.29 = gc_debug_file;
          fflush (gc_debug_file.29);
          <D.21911>:
          <D.21909>:
          sgen_nursery_retire_region (p, available_in_tlab);
          <D.21542>:
          tlab_size.36 = tlab_size;
          p = sgen_nursery_alloc_range (tlab_size.36, size, &alloc_size);
          if (p == 0B) goto <D.21916>; else goto <D.21917>;
          <D.21916>:
          tlab_size.36 = tlab_size;
          sgen_ensure_free_space (tlab_size.36);
          degraded_mode.26 = degraded_mode;
          if (degraded_mode.26 != 0) goto <D.21918>; else goto <D.21919>;
          <D.21918>:
          D.21877 = alloc_degraded (vtable, size, 0);
          return D.21877;
          <D.21919>:
          tlab_size.36 = tlab_size;
          p = sgen_nursery_alloc_range (tlab_size.36, size, &alloc_size);
          <D.21917>:
          if (p == 0B) goto <D.21542>; else goto <D.21543>;
          <D.21543>:
          if (p == 0B) goto <D.21920>; else goto <D.21921>;
          <D.21920>:
          if (1 != 0) goto <D.21922>; else goto <D.21923>;
          <D.21922>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 298, "0");
          <D.21923>:
          <D.21921>:
          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.21926 = MIN_EXPR <alloc_size.39, 8192>;
          tlab_temp_end.41 = tlab_start.38 + D.21926;
          tlab_temp_end = tlab_temp_end.41;
          nursery_clear_policy.37 = nursery_clear_policy;
          if (nursery_clear_policy.37 == 1) goto <D.21928>; else goto <D.21929>;
          <D.21928>:
          tlab_start.38 = tlab_start;
          alloc_size.39 = alloc_size;
          memset (tlab_start.38, 0, alloc_size.39);
          <D.21929>:
          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.21893>:
  }
  goto <D.21931>;
  <D.21881>:
  sgen_set_nursery_scan_start (p);
  tlab_next.30 = tlab_next;
  D.21932 = tlab_next.30 + 8192;
  tlab_real_end.31 = tlab_real_end;
  tlab_temp_end.43 = MIN_EXPR <D.21932, tlab_real_end.31>;
  tlab_temp_end = tlab_temp_end.43;
  if (0 != 0) goto <D.21934>; else goto <D.21935>;
  <D.21934>:
  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.21935>:
  <D.21931>:
  <D.21857>:
  D.21936 = p != 0B;
  D.21937 = (long int) D.21936;
  D.21938 = __builtin_expect (D.21937, 1);
  if (D.21938 != 0) goto <D.21939>; else goto <D.21940>;
  <D.21939>:
  if (0 != 0) goto <D.21941>; else goto <D.21942>;
  <D.21941>:
  gc_debug_file.29 = gc_debug_file;
  D.21867 = vtable->klass;
  D.21868 = D.21867->name;
  fprintf (gc_debug_file.29, "Allocated object %p, vtable: %p (%s), size: %zd\n", p, vtable, D.21868, size);
  gc_debug_file.29 = gc_debug_file;
  fflush (gc_debug_file.29);
  <D.21942>:
  if (0 != 0) goto <D.21943>; else goto <D.21944>;
  <D.21943>:
  if (size > 8000) goto <D.21945>; else goto <D.21946>;
  <D.21945>:
  goto <D.21947>;
  <D.21946>:
  <D.21947>:
  <D.21944>:
  mono_memory_write_barrier ();
  *p = vtable;
  <D.21940>:
  D.21877 = p;
  return D.21877;
}


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.21960;
  _Bool D.21961;
  _Bool D.21962;
  struct _IO_FILE * stderr.49;
  int size.50;
  int D.21971;
  _Bool D.21974;
  int D.21975;
  void * (*<T36a1>) (struct MonoVTable *, size_t) D.21976;
  void * D.21980;
  static int last_major_gc_warned = -1;
  static int num_degraded = 0;
  void * p;

  if (for_mature == 0) goto <D.21951>; else goto <D.21952>;
  <D.21951>:
  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.21955>; else goto <D.21956>;
  <D.21955>:
  num_degraded.46 = num_degraded;
  num_degraded.47 = num_degraded.46 + 1;
  num_degraded = num_degraded.47;
  num_degraded.48 = num_degraded;
  D.21960 = num_degraded.48 == 1;
  D.21961 = num_degraded.48 == 3;
  D.21962 = D.21960 | D.21961;
  if (D.21962 != 0) goto <D.21963>; else goto <D.21964>;
  <D.21963>:
  stderr.49 = stderr;
  fprintf (stderr.49, "Warning: Degraded allocation.  Consider increasing nursery-size if the warning persists.\n");
  goto <D.21966>;
  <D.21964>:
  num_degraded.46 = num_degraded;
  if (num_degraded.46 == 10) goto <D.21967>; else goto <D.21968>;
  <D.21967>:
  stderr.49 = stderr;
  fprintf (stderr.49, "Warning: Repeated degraded allocation.  Consider increasing nursery-size.\n");
  <D.21968>:
  <D.21966>:
  stat_major_gcs.45 = stat_major_gcs;
  last_major_gc_warned = stat_major_gcs.45;
  <D.21956>:
  size.50 = (int) size;
  InterlockedExchangeAdd (&degraded_mode, size.50);
  sgen_ensure_free_space (size);
  goto <D.21970>;
  <D.21952>:
  D.21971 = sgen_need_major_collection (size);
  if (D.21971 != 0) goto <D.21972>; else goto <D.21973>;
  <D.21972>:
  D.21974 = for_mature == 0;
  D.21975 = (int) D.21974;
  sgen_perform_collection (size, 1, "mature allocation failure", D.21975);
  <D.21973>:
  <D.21970>:
  D.21976 = major_collector.alloc_degraded;
  p = D.21976 (vtable, size);
  if (for_mature != 0) goto <D.21977>; else goto <D.21978>;
  <D.21977>:
  goto <D.21979>;
  <D.21978>:
  <D.21979>:
  D.21980 = p;
  return D.21980;
}


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

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


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

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


mono_gc_alloc_vector (struct MonoVTable * vtable, size_t size, uintptr_t max_length)
{
  struct SgenThreadInfo * sgen_thread_info.52;
  void * D.21991;
  _Bool D.21992;
  long int D.21993;
  long int D.21994;
  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.21989>; else goto <D.21990>;
  <D.21989>:
  arr->max_length = max_length;
  mono_memory_barrier ();
  sgen_thread_info.52 = sgen_thread_info;
  sgen_thread_info.52->in_critical_region = 0;
  D.21991 = arr;
  return D.21991;
  <D.21990>:
  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.21992 = arr == 0B;
  D.21993 = (long int) D.21992;
  D.21994 = __builtin_expect (D.21993, 0);
  if (D.21994 != 0) goto <D.21995>; else goto <D.21996>;
  <D.21995>:
  sgen_gc_unlock ();
  D.21991 = mono_gc_out_of_memory (size);
  return D.21991;
  <D.21996>:
  arr->max_length = max_length;
  sgen_gc_unlock ();
  D.21991 = arr;
  return D.21991;
}


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.22001;
  void * D.22002;
  _Bool D.22003;
  long int D.22004;
  long int D.22005;
  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.21999>; else goto <D.22000>;
  <D.21999>:
  arr->max_length = max_length;
  D.22001 = size - bounds_size;
  bounds = arr + D.22001;
  arr->bounds = bounds;
  mono_memory_barrier ();
  sgen_thread_info.53 = sgen_thread_info;
  sgen_thread_info.53->in_critical_region = 0;
  D.22002 = arr;
  return D.22002;
  <D.22000>:
  mono_memory_barrier ();
  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.22003 = arr == 0B;
  D.22004 = (long int) D.22003;
  D.22005 = __builtin_expect (D.22004, 0);
  if (D.22005 != 0) goto <D.22006>; else goto <D.22007>;
  <D.22006>:
  sgen_gc_unlock ();
  D.22002 = mono_gc_out_of_memory (size);
  return D.22002;
  <D.22007>:
  arr->max_length = max_length;
  D.22001 = size - bounds_size;
  bounds = arr + D.22001;
  arr->bounds = bounds;
  sgen_gc_unlock ();
  D.22002 = arr;
  return D.22002;
}


mono_gc_alloc_string (struct MonoVTable * vtable, size_t size, gint32 len)
{
  struct SgenThreadInfo * sgen_thread_info.54;
  void * D.22012;
  _Bool D.22013;
  long int D.22014;
  long int D.22015;
  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.22010>; else goto <D.22011>;
  <D.22010>:
  str->length = len;
  mono_memory_barrier ();
  sgen_thread_info.54 = sgen_thread_info;
  sgen_thread_info.54->in_critical_region = 0;
  D.22012 = str;
  return D.22012;
  <D.22011>:
  mono_memory_barrier ();
  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.22013 = str == 0B;
  D.22014 = (long int) D.22013;
  D.22015 = __builtin_expect (D.22014, 0);
  if (D.22015 != 0) goto <D.22016>; else goto <D.22017>;
  <D.22016>:
  sgen_gc_unlock ();
  D.22012 = mono_gc_out_of_memory (size);
  return D.22012;
  <D.22017>:
  str->length = len;
  sgen_gc_unlock ();
  D.22012 = str;
  return D.22012;
}


mono_gc_alloc_pinned_obj (struct MonoVTable * vtable, size_t size)
{
  unsigned int D.22019;
  struct MonoClass * D.22025;
  const char * D.22026;
  const char * D.22027;
  void * (*<T369d>) (struct MonoVTable *, size_t, gboolean) D.22028;
  void * D.22029;
  unsigned int D.22030;
  int D.22031;
  _Bool D.22032;
  long int D.22033;
  long int D.22034;
  struct FILE * gc_debug_file.55;
  void * D.22043;
  void * * p;

  D.22019 = size + 7;
  size = D.22019 & 4294967288;
  pthread_mutex_lock (&gc_mutex);
  if (size > 8000) goto <D.22020>; else goto <D.22021>;
  <D.22020>:
  p = sgen_los_alloc_large_inner (vtable, size);
  goto <D.22022>;
  <D.22021>:
  if (0 != 0) goto <D.22023>; else goto <D.22024>;
  <D.22023>:
  D.22025 = vtable->klass;
  D.22026 = D.22025->name_space;
  D.22025 = vtable->klass;
  D.22027 = D.22025->name;
  monoeg_g_log (0B, 4, "class %s:%s is not initialized", D.22026, D.22027);
  <D.21586>:
  goto <D.21586>;
  <D.22024>:
  D.22028 = major_collector.alloc_small_pinned_obj;
  D.22029 = vtable->gc_descr;
  D.22030 = (unsigned int) D.22029;
  D.22031 = sgen_gc_descr_has_references (D.22030);
  p = D.22028 (vtable, size, D.22031);
  <D.22022>:
  D.22032 = p != 0B;
  D.22033 = (long int) D.22032;
  D.22034 = __builtin_expect (D.22033, 1);
  if (D.22034 != 0) goto <D.22035>; else goto <D.22036>;
  <D.22035>:
  if (0 != 0) goto <D.22037>; else goto <D.22038>;
  <D.22037>:
  gc_debug_file.55 = gc_debug_file;
  D.22025 = vtable->klass;
  D.22027 = D.22025->name;
  fprintf (gc_debug_file.55, "Allocated pinned object %p, vtable: %p (%s), size: %zd\n", p, vtable, D.22027, size);
  gc_debug_file.55 = gc_debug_file;
  fflush (gc_debug_file.55);
  <D.22038>:
  if (size > 8000) goto <D.22040>; else goto <D.22041>;
  <D.22040>:
  goto <D.22042>;
  <D.22041>:
  <D.22042>:
  <D.22036>:
  sgen_gc_unlock ();
  D.22043 = p;
  return D.22043;
}


sgen_gc_descr_has_references (mword desc)
{
  unsigned int D.22045;
  gboolean D.22048;
  unsigned int D.22049;
  unsigned int D.22052;

  D.22045 = desc & 4294901767;
  if (D.22045 == 1) goto <D.22046>; else goto <D.22047>;
  <D.22046>:
  D.22048 = 0;
  return D.22048;
  <D.22047>:
  D.22049 = desc & 49159;
  if (D.22049 == 4) goto <D.22050>; else goto <D.22051>;
  <D.22050>:
  D.22048 = 0;
  return D.22048;
  <D.22051>:
  D.22052 = desc & 7;
  if (D.22052 == 7) goto <D.22053>; else goto <D.22054>;
  <D.22053>:
  D.22048 = 0;
  return D.22048;
  <D.22054>:
  D.22048 = 1;
  return D.22048;
}


mono_gc_alloc_mature (struct MonoVTable * vtable)
{
  struct MonoClass * D.22056;
  int D.22057;
  int D.22058;
  unsigned int D.22059;
  unsigned char D.22060;
  unsigned char D.22061;
  _Bool D.22062;
  long int D.22063;
  long int D.22064;
  void * D.22067;
  void * * res;
  size_t size;

  D.22056 = vtable->klass;
  D.22057 = D.22056->instance_size;
  D.22058 = D.22057 + 7;
  D.22059 = (unsigned int) D.22058;
  size = D.22059 & 4294967288;
  pthread_mutex_lock (&gc_mutex);
  res = alloc_degraded (vtable, size, 1);
  sgen_gc_unlock ();
  D.22056 = vtable->klass;
  D.22060 = BIT_FIELD_REF <*D.22056, 8, 176>;
  D.22061 = D.22060 & 32;
  D.22062 = D.22061 != 0;
  D.22063 = (long int) D.22062;
  D.22064 = __builtin_expect (D.22063, 0);
  if (D.22064 != 0) goto <D.22065>; else goto <D.22066>;
  <D.22065>:
  mono_object_register_finalizer (res);
  <D.22066>:
  D.22067 = res;
  return D.22067;
}


mono_gc_alloc_fixed (size_t size, void * descr)
{
  void * D.22071;
  int D.22072;
  void * res;

  res = calloc (1, size);
  if (res == 0B) goto <D.22069>; else goto <D.22070>;
  <D.22069>:
  D.22071 = 0B;
  return D.22071;
  <D.22070>:
  D.22072 = mono_gc_register_root (res, size, descr);
  if (D.22072 == 0) goto <D.22073>; else goto <D.22074>;
  <D.22073>:
  free (res);
  res = 0B;
  <D.22074>:
  D.22071 = res;
  return D.22071;
}


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.22076;
  struct MonoLinkedListSetNode * D.22077;
  unsigned int D.22078;
  char * * D.22081;
  char * * D.22082;
  char * * D.22083;
  char * * D.22084;
  struct SgenThreadInfo * info;

  {
    struct MonoLinkedListSetNode * __cur;

    D.22076 = mono_thread_info_list_head ();
    __cur = D.22076->head;
    goto <D.21609>;
    <D.21608>:
    D.22077 = __cur->next;
    D.22078 = mono_lls_pointer_get_mark (D.22077);
    if (D.22078 == 0) goto <D.22079>; else goto <D.22080>;
    <D.22079>:
    info = __cur;
    D.22081 = info->tlab_start_addr;
    *D.22081 = 0B;
    D.22082 = info->tlab_next_addr;
    *D.22082 = 0B;
    D.22083 = info->tlab_temp_end_addr;
    *D.22083 = 0B;
    D.22084 = info->tlab_real_end_addr;
    *D.22084 = 0B;
    <D.22080>:
    D.22077 = __cur->next;
    __cur = mono_lls_pointer_unmask (D.22077);
    <D.21609>:
    if (__cur != 0B) goto <D.21608>; else goto <D.21610>;
    <D.21610>:
  }
}


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

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


mono_lls_pointer_unmask (void * p)
{
  void * D.22088;
  unsigned int p.57;
  unsigned int D.22090;

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


mono_gc_get_managed_allocator (struct MonoClass * klass, gboolean for_box)
{
  _Bool D.22092;
  _Bool D.22093;
  _Bool D.22094;
  struct MonoMethod * D.22097;
  unsigned int collect_before_allocs.58;
  int D.22101;
  int D.22104;
  unsigned int D.22105;
  unsigned int tlab_size.59;
  unsigned char D.22111;
  unsigned char D.22112;
  <unnamed type> D.22114;
  unsigned int D.22115;
  unsigned char D.22116;
  unsigned char D.22119;
  long long unsigned int D.22123;
  long long unsigned int D.22124;
  long long unsigned int D.22125;
  struct MonoType * D.22127;
  int D.22128;
  int tlab_next_offset;
  int tlab_temp_end_offset;

  tlab_next_offset = -1;
  tlab_temp_end_offset = -1;
  __asm__("	ldr	%0, 1f; b 2f; 1: .word tlab_next(tpoff); 2:" : "=r" tlab_next_offset);
  __asm__("	ldr	%0, 1f; b 2f; 1: .word tlab_temp_end(tpoff); 2:" : "=r" tlab_temp_end_offset);
  D.22092 = tlab_next_offset == -1;
  D.22093 = tlab_temp_end_offset == -1;
  D.22094 = D.22092 | D.22093;
  if (D.22094 != 0) goto <D.22095>; else goto <D.22096>;
  <D.22095>:
  D.22097 = 0B;
  return D.22097;
  <D.22096>:
  collect_before_allocs.58 = collect_before_allocs;
  if (collect_before_allocs.58 != 0) goto <D.22099>; else goto <D.22100>;
  <D.22099>:
  D.22097 = 0B;
  return D.22097;
  <D.22100>:
  D.22101 = mono_runtime_has_tls_get ();
  if (D.22101 == 0) goto <D.22102>; else goto <D.22103>;
  <D.22102>:
  D.22097 = 0B;
  return D.22097;
  <D.22103>:
  D.22104 = klass->instance_size;
  D.22105 = (unsigned int) D.22104;
  tlab_size.59 = tlab_size;
  if (D.22105 > tlab_size.59) goto <D.22107>; else goto <D.22108>;
  <D.22107>:
  D.22097 = 0B;
  return D.22097;
  <D.22108>:
  D.22111 = BIT_FIELD_REF <*klass, 8, 176>;
  D.22112 = D.22111 & 96;
  if (D.22112 != 0) goto <D.22109>; else goto <D.22113>;
  <D.22113>:
  D.22114 = mono_profiler_get_events ();
  D.22115 = D.22114 & 128;
  if (D.22115 != 0) goto <D.22109>; else goto <D.22110>;
  <D.22109>:
  D.22097 = 0B;
  return D.22097;
  <D.22110>:
  D.22116 = klass->rank;
  if (D.22116 != 0) goto <D.22117>; else goto <D.22118>;
  <D.22117>:
  D.22097 = 0B;
  return D.22097;
  <D.22118>:
  D.22119 = klass->byval_arg.type;
  if (D.22119 == 14) goto <D.22120>; else goto <D.22121>;
  <D.22120>:
  D.22097 = mono_gc_get_managed_allocator_by_type (3);
  return D.22097;
  <D.22121>:
  D.22104 = klass->instance_size;
  D.22123 = (long long unsigned int) D.22104;
  D.22124 = D.22123 + 7;
  D.22125 = D.22124 & 18446744073709551608;
  if (D.22125 <= 7999) goto <D.22126>; else goto <D.22122>;
  <D.22126>:
  D.22127 = &klass->byval_arg;
  D.22128 = mono_class_is_open_constructed_type (D.22127);
  if (D.22128 == 0) goto <D.22129>; else goto <D.22122>;
  <D.22129>:
  D.22097 = mono_gc_get_managed_allocator_by_type (2);
  return D.22097;
  <D.22122>:
  D.22097 = mono_gc_get_managed_allocator_by_type (0);
  return D.22097;
}


mono_gc_get_managed_array_allocator (struct MonoClass * klass)
{
  _Bool D.22131;
  _Bool D.22132;
  _Bool D.22133;
  struct MonoMethod * D.22136;
  unsigned char D.22137;
  int D.22140;
  <unnamed type> D.22143;
  unsigned int D.22144;
  int has_per_allocation_action.60;
  int iftmp.61;
  int D.22154;
  unsigned char D.22156;
  unsigned char D.22157;
  _Bool D.22158;
  long int D.22159;
  long int D.22160;
  int tlab_next_offset;
  int tlab_temp_end_offset;

  tlab_next_offset = -1;
  tlab_temp_end_offset = -1;
  __asm__("	ldr	%0, 1f; b 2f; 1: .word tlab_next(tpoff); 2:" : "=r" tlab_next_offset);
  __asm__("	ldr	%0, 1f; b 2f; 1: .word tlab_temp_end(tpoff); 2:" : "=r" tlab_temp_end_offset);
  D.22131 = tlab_next_offset == -1;
  D.22132 = tlab_temp_end_offset == -1;
  D.22133 = D.22131 | D.22132;
  if (D.22133 != 0) goto <D.22134>; else goto <D.22135>;
  <D.22134>:
  D.22136 = 0B;
  return D.22136;
  <D.22135>:
  D.22137 = klass->rank;
  if (D.22137 != 1) goto <D.22138>; else goto <D.22139>;
  <D.22138>:
  D.22136 = 0B;
  return D.22136;
  <D.22139>:
  D.22140 = mono_runtime_has_tls_get ();
  if (D.22140 == 0) goto <D.22141>; else goto <D.22142>;
  <D.22141>:
  D.22136 = 0B;
  return D.22136;
  <D.22142>:
  D.22143 = mono_profiler_get_events ();
  D.22144 = D.22143 & 128;
  if (D.22144 != 0) goto <D.22145>; else goto <D.22146>;
  <D.22145>:
  D.22136 = 0B;
  return D.22136;
  <D.22146>:
  has_per_allocation_action.60 = has_per_allocation_action;
  if (has_per_allocation_action.60 != 0) goto <D.22148>; else goto <D.22149>;
  <D.22148>:
  D.22136 = 0B;
  return D.22136;
  <D.22149>:
  D.22154 = mono_class_has_finalizer (klass);
  if (D.22154 != 0) goto <D.22151>; else goto <D.22155>;
  <D.22155>:
  D.22156 = BIT_FIELD_REF <*klass, 8, 176>;
  D.22157 = D.22156 & 64;
  if (D.22157 != 0) goto <D.22151>; else goto <D.22152>;
  <D.22151>:
  iftmp.61 = 1;
  goto <D.22153>;
  <D.22152>:
  iftmp.61 = 0;
  <D.22153>:
  D.22158 = iftmp.61 != 0;
  D.22159 = (long int) D.22158;
  D.22160 = __builtin_expect (D.22159, 0);
  if (D.22160 != 0) goto <D.22161>; else goto <D.22162>;
  <D.22161>:
  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.22162>:
  D.22136 = mono_gc_get_managed_allocator_by_type (1);
  return D.22136;
}


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.22167;
  int D.22168;
  struct MonoMethod * D.22173;
  struct MonoMethod * res;

  use_managed_allocator.62 = use_managed_allocator;
  if (use_managed_allocator.62 == 0) goto <D.22165>; else goto <D.22166>;
  <D.22165>:
  D.22167 = 0B;
  return D.22167;
  <D.22166>:
  D.22168 = mono_runtime_has_tls_get ();
  if (D.22168 == 0) goto <D.22169>; else goto <D.22170>;
  <D.22169>:
  D.22167 = 0B;
  return D.22167;
  <D.22170>:
  res = alloc_method_cache[atype];
  if (res != 0B) goto <D.22171>; else goto <D.22172>;
  <D.22171>:
  D.22167 = res;
  return D.22167;
  <D.22172>:
  res = create_allocator (atype);
  pthread_mutex_lock (&gc_mutex);
  D.22173 = alloc_method_cache[atype];
  if (D.22173 != 0B) goto <D.22174>; else goto <D.22175>;
  <D.22174>:
  mono_free_method (res);
  res = alloc_method_cache[atype];
  goto <D.22176>;
  <D.22175>:
  mono_memory_barrier ();
  alloc_method_cache[atype] = res;
  <D.22176>:
  sgen_gc_unlock ();
  D.22167 = res;
  return D.22167;
}


create_allocator (int atype)
{
  _Bool D.22178;
  long int D.22179;
  long int D.22180;
  _Bool D.22183;
  long int D.22184;
  long int D.22185;
  int registered.63;
  struct MonoMethodSignature * D.22191;
  struct MonoMethodSignature * D.22192;
  struct MonoMethodSignature * D.22193;
  struct MonoImage * D.22206;
  unsigned int num_params.64;
  struct MonoClass * D.22210;
  struct MonoType * D.22211;
  struct MonoClass * D.22212;
  struct MonoType * D.22213;
  struct MonoClass * D.22214;
  struct MonoType * D.22215;
  struct MonoClass * D.22217;
  struct MonoType * D.22218;
  _Bool D.22219;
  _Bool D.22220;
  _Bool D.22221;
  unsigned int size_var.65;
  unsigned int D.22228;
  unsigned int pos.66;
  int D.22230;
  unsigned int D.22231;
  unsigned int D.22232;
  int D.22233;
  unsigned int D.22234;
  unsigned int D.22235;
  unsigned int D.22236;
  struct MonoClass * D.22237;
  struct MonoClass * D.22238;
  _Bool D.22239;
  long int D.22240;
  long int D.22241;
  int D.22244;
  unsigned int D.22245;
  _Bool D.22246;
  long int D.22247;
  long int D.22248;
  _Bool D.22251;
  long int D.22252;
  long int D.22253;
  int D.22256;
  unsigned int D.22257;
  unsigned int D.22258;
  unsigned int D.22259;
  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.22286;
  struct MonoMethod * D.22287;
  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__("	ldr	%0, 1f; b 2f; 1: .word tlab_next_addr(tpoff); 2:" : "=r" tlab_next_addr_offset);
  __asm__("	ldr	%0, 1f; b 2f; 1: .word tlab_temp_end(tpoff); 2:" : "=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.22178 = tlab_next_addr_offset == -1;
  D.22179 = (long int) D.22178;
  D.22180 = __builtin_expect (D.22179, 0);
  if (D.22180 != 0) goto <D.22181>; else goto <D.22182>;
  <D.22181>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 710, "tlab_next_addr_offset != -1");
  <D.22182>:
  D.22183 = tlab_temp_end_offset == -1;
  D.22184 = (long int) D.22183;
  D.22185 = __builtin_expect (D.22184, 0);
  if (D.22185 != 0) goto <D.22186>; else goto <D.22187>;
  <D.22186>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 711, "tlab_temp_end_offset != -1");
  <D.22187>:
  registered.63 = registered;
  if (registered.63 == 0) goto <D.22189>; else goto <D.22190>;
  <D.22189>:
  D.22191 = mono_create_icall_signature ("object ptr int");
  mono_register_jit_icall (mono_gc_alloc_obj, "mono_gc_alloc_obj", D.22191, 0);
  D.22192 = mono_create_icall_signature ("object ptr int int");
  mono_register_jit_icall (mono_gc_alloc_vector, "mono_gc_alloc_vector", D.22192, 0);
  D.22193 = mono_create_icall_signature ("object ptr int int32");
  mono_register_jit_icall (mono_gc_alloc_string, "mono_gc_alloc_string", D.22193, 0);
  registered = 1;
  <D.22190>:
  if (atype == 2) goto <D.22194>; else goto <D.22195>;
  <D.22194>:
  num_params = 1;
  name = "AllocSmall";
  goto <D.22196>;
  <D.22195>:
  if (atype == 0) goto <D.22197>; else goto <D.22198>;
  <D.22197>:
  num_params = 1;
  name = "Alloc";
  goto <D.22199>;
  <D.22198>:
  if (atype == 1) goto <D.22200>; else goto <D.22201>;
  <D.22200>:
  num_params = 2;
  name = "AllocVector";
  goto <D.22202>;
  <D.22201>:
  if (atype == 3) goto <D.22203>; else goto <D.22204>;
  <D.22203>:
  num_params = 2;
  name = "AllocString";
  goto <D.22205>;
  <D.22204>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "sgen-alloc.c", 734);
  <D.22205>:
  <D.22202>:
  <D.22199>:
  <D.22196>:
  D.22206 = mono_defaults.corlib;
  num_params.64 = (unsigned int) num_params;
  csig = mono_metadata_signature_alloc (D.22206, num_params.64);
  if (atype == 3) goto <D.22208>; else goto <D.22209>;
  <D.22208>:
  D.22210 = mono_defaults.string_class;
  D.22211 = &D.22210->byval_arg;
  csig->ret = D.22211;
  D.22212 = mono_defaults.int_class;
  D.22213 = &D.22212->byval_arg;
  csig->params[0] = D.22213;
  D.22214 = mono_defaults.int32_class;
  D.22215 = &D.22214->byval_arg;
  csig->params[1] = D.22215;
  goto <D.22216>;
  <D.22209>:
  D.22217 = mono_defaults.object_class;
  D.22218 = &D.22217->byval_arg;
  csig->ret = D.22218;
  i = 0;
  goto <D.21632>;
  <D.21631>:
  D.22212 = mono_defaults.int_class;
  D.22213 = &D.22212->byval_arg;
  csig->params[i] = D.22213;
  i = i + 1;
  <D.21632>:
  if (i < num_params) goto <D.21631>; else goto <D.21633>;
  <D.21633>:
  <D.22216>:
  D.22217 = mono_defaults.object_class;
  mb = mono_mb_new (D.22217, name, 28);
  D.22214 = mono_defaults.int32_class;
  D.22215 = &D.22214->byval_arg;
  size_var = mono_mb_add_local (mb, D.22215);
  D.22219 = atype == 0;
  D.22220 = atype == 2;
  D.22221 = D.22219 | D.22220;
  if (D.22221 != 0) goto <D.22222>; else goto <D.22223>;
  <D.22222>:
  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.22225>;
  <D.22223>:
  if (atype == 1) goto <D.22226>; else goto <D.22227>;
  <D.22226>:
  {
    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.22228 = mono_mb_emit_short_branch (mb, 54);
    pos = (int) D.22228;
    mono_mb_emit_exception (mb, "OverflowException", 0B);
    pos.66 = (unsigned int) pos;
    mono_mb_patch_short_branch (mb, pos.66);
    D.22206 = mono_defaults.corlib;
    clause = mono_image_alloc0 (D.22206, 24);
    D.22230 = mono_mb_get_label (mb);
    D.22231 = (unsigned int) D.22230;
    clause->try_offset = D.22231;
    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.22232 = mono_mb_emit_branch (mb, 221);
    pos_leave = (int) D.22232;
    clause->flags = 0;
    D.22233 = mono_mb_get_pos (mb);
    D.22234 = (unsigned int) D.22233;
    D.22235 = clause->try_offset;
    D.22236 = D.22234 - D.22235;
    clause->try_len = D.22236;
    D.22206 = mono_defaults.corlib;
    D.22237 = mono_class_from_name (D.22206, "System", "OverflowException");
    clause->data.catch_class = D.22237;
    D.22238 = clause->data.catch_class;
    D.22239 = D.22238 == 0B;
    D.22240 = (long int) D.22239;
    D.22241 = __builtin_expect (D.22240, 0);
    if (D.22241 != 0) goto <D.22242>; else goto <D.22243>;
    <D.22242>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 803, "clause->data.catch_class");
    <D.22243>:
    D.22244 = mono_mb_get_label (mb);
    D.22245 = (unsigned int) D.22244;
    clause->handler_offset = D.22245;
    D.22206 = mono_defaults.corlib;
    oom_exc_class = mono_class_from_name (D.22206, "System", "OutOfMemoryException");
    D.22246 = oom_exc_class == 0B;
    D.22247 = (long int) D.22246;
    D.22248 = __builtin_expect (D.22247, 0);
    if (D.22248 != 0) goto <D.22249>; else goto <D.22250>;
    <D.22249>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 808, "oom_exc_class");
    <D.22250>:
    ctor = mono_class_get_method_from_name (oom_exc_class, ".ctor", 0);
    D.22251 = ctor == 0B;
    D.22252 = (long int) D.22251;
    D.22253 = __builtin_expect (D.22252, 0);
    if (D.22253 != 0) goto <D.22254>; else goto <D.22255>;
    <D.22254>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 810, "ctor");
    <D.22255>:
    mono_mb_emit_byte (mb, 38);
    mono_mb_emit_op (mb, 115, ctor);
    mono_mb_emit_byte (mb, 122);
    D.22256 = mono_mb_get_pos (mb);
    D.22257 = (unsigned int) D.22256;
    D.22258 = clause->handler_offset;
    D.22259 = D.22257 - D.22258;
    clause->handler_len = D.22259;
    mono_mb_set_clauses (mb, 1, clause);
    pos_leave.67 = (unsigned int) pos_leave;
    mono_mb_patch_branch (mb, pos_leave.67);
  }
  goto <D.22261>;
  <D.22227>:
  if (atype == 3) goto <D.22262>; else goto <D.22263>;
  <D.22262>:
  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.22264>;
  <D.22263>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "sgen-alloc.c", 831);
  <D.22264>:
  <D.22261>:
  <D.22225>:
  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.22265>; else goto <D.22266>;
  <D.22265>:
  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.22266>:
  D.22212 = mono_defaults.int_class;
  D.22213 = &D.22212->byval_arg;
  tlab_next_addr_var = mono_mb_add_local (mb, D.22213);
  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.22212 = mono_defaults.int_class;
  D.22213 = &D.22212->byval_arg;
  p_var = mono_mb_add_local (mb, D.22213);
  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.22212 = mono_defaults.int_class;
  D.22213 = &D.22212->byval_arg;
  new_next_var = mono_mb_add_local (mb, D.22213);
  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.22270>; else goto <D.22271>;
  <D.22270>:
  mono_mb_patch_short_branch (mb, max_size_branch);
  <D.22271>:
  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.22219 = atype == 0;
  D.22220 = atype == 2;
  D.22221 = D.22219 | D.22220;
  if (D.22221 != 0) goto <D.22272>; else goto <D.22273>;
  <D.22272>:
  mono_mb_emit_icall (mb, mono_gc_alloc_obj);
  goto <D.22274>;
  <D.22273>:
  if (atype == 1) goto <D.22275>; else goto <D.22276>;
  <D.22275>:
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icall (mb, mono_gc_alloc_vector);
  goto <D.22277>;
  <D.22276>:
  if (atype == 3) goto <D.22278>; else goto <D.22279>;
  <D.22278>:
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icall (mb, mono_gc_alloc_string);
  goto <D.22280>;
  <D.22279>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "sgen-alloc.c", 898);
  <D.22280>:
  <D.22277>:
  <D.22274>:
  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.22281>; else goto <D.22282>;
  <D.22281>:
  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.22283>;
  <D.22282>:
  if (atype == 3) goto <D.22284>; else goto <D.22285>;
  <D.22284>:
  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.22285>:
  <D.22283>:
  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.22286 = mono_method_get_header (res);
  D.22286->init_locals = 0;
  D.22206 = mono_defaults.corlib;
  info = mono_image_alloc0 (D.22206, 8);
  info->gc_name = "sgen";
  info->alloc_type = atype;
  mono_marshal_set_wrapper_info (res, info);
  D.22287 = res;
  return D.22287;
}


mono_gc_get_managed_allocator_types ()
{
  guint32 D.22289;

  D.22289 = 4;
  return D.22289;
}


sgen_is_managed_allocator (struct MonoMethod * method)
{
  struct MonoMethod * D.22291;
  gboolean D.22294;
  int i;

  i = 0;
  goto <D.21665>;
  <D.21664>:
  D.22291 = alloc_method_cache[i];
  if (D.22291 == method) goto <D.22292>; else goto <D.22293>;
  <D.22292>:
  D.22294 = 1;
  return D.22294;
  <D.22293>:
  i = i + 1;
  <D.21665>:
  if (i <= 3) goto <D.21664>; else goto <D.21666>;
  <D.21666>:
  D.22294 = 0;
  return D.22294;
}


sgen_has_managed_allocator ()
{
  struct MonoMethod * D.22296;
  gboolean D.22299;
  int i;

  i = 0;
  goto <D.21672>;
  <D.21671>:
  D.22296 = alloc_method_cache[i];
  if (D.22296 != 0B) goto <D.22297>; else goto <D.22298>;
  <D.22297>:
  D.22299 = 1;
  return D.22299;
  <D.22298>:
  i = i + 1;
  <D.21672>:
  if (i <= 3) goto <D.21671>; else goto <D.21673>;
  <D.21673>:
  D.22299 = 0;
  return D.22299;
}


