__attribute__((visibility ("hidden")))
mono_gc_alloc_obj (struct MonoVTable * vtable, size_t size)
{
  int has_per_allocation_action.0;
  _Bool D.19626;
  long int D.19627;
  long int D.19628;
  unsigned int verify_before_allocs.1;
  unsigned int current_alloc.2;
  unsigned int D.19635;
  unsigned int collect_before_allocs.3;
  unsigned int D.19641;
  struct GCMemSection * nursery_section.4;
  struct SgenThreadInfo * sgen_thread_info.5;
  void * D.19650;
  _Bool D.19651;
  long int D.19652;
  long int D.19653;
  void * res;

  has_per_allocation_action.0 = has_per_allocation_action;
  D.19626 = has_per_allocation_action.0 != 0;
  D.19627 = (long int) D.19626;
  D.19628 = __builtin_expect (D.19627, 0);
  if (D.19628 != 0) goto <D.19629>; else goto <D.19630>;
  <D.19629>:
  {
    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.19632>; else goto <D.19633>;
    <D.19632>:
    current_alloc.2 = (unsigned int) current_alloc;
    verify_before_allocs.1 = verify_before_allocs;
    D.19635 = current_alloc.2 % verify_before_allocs.1;
    if (D.19635 == 0) goto <D.19636>; else goto <D.19637>;
    <D.19636>:
    sgen_check_whole_heap_stw ();
    <D.19637>:
    <D.19633>:
    collect_before_allocs.3 = collect_before_allocs;
    if (collect_before_allocs.3 != 0) goto <D.19639>; else goto <D.19640>;
    <D.19639>:
    current_alloc.2 = (unsigned int) current_alloc;
    collect_before_allocs.3 = collect_before_allocs;
    D.19641 = current_alloc.2 % collect_before_allocs.3;
    if (D.19641 == 0) goto <D.19642>; else goto <D.19643>;
    <D.19642>:
    nursery_section.4 = nursery_section;
    if (nursery_section.4 != 0B) goto <D.19645>; else goto <D.19646>;
    <D.19645>:
    pthread_mutex_lock (&gc_mutex);
    sgen_perform_collection (0, 0, "collect-before-alloc-triggered", 1);
    sgen_gc_unlock ();
    <D.19646>:
    <D.19643>:
    <D.19640>:
  }
  <D.19630>:
  sgen_thread_info.5 = sgen_thread_info;
  sgen_thread_info.5->in_critical_region = 1;
  res = mono_gc_try_alloc_obj_nolock (vtable, size);
  if (res != 0B) goto <D.19648>; else goto <D.19649>;
  <D.19648>:
  sgen_thread_info.5 = sgen_thread_info;
  sgen_thread_info.5->in_critical_region = 0;
  D.19650 = res;
  return D.19650;
  <D.19649>:
  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.19651 = res == 0B;
  D.19652 = (long int) D.19651;
  D.19653 = __builtin_expect (D.19652, 0);
  if (D.19653 != 0) goto <D.19654>; else goto <D.19655>;
  <D.19654>:
  D.19650 = mono_gc_out_of_memory (size);
  return D.19650;
  <D.19655>:
  D.19650 = res;
  return D.19650;
}


InterlockedIncrement (volatile gint32 * val)
{
  gint32 D.19657;
  unsigned int D.19658;

  D.19658 = __sync_add_and_fetch_4 (val, 1);
  D.19657 = (gint32) D.19658;
  return D.19657;
}


mono_gc_try_alloc_obj_nolock (struct MonoVTable * vtable, size_t size)
{
  long unsigned int D.19660;
  void * D.19663;
  _Bool D.19664;
  long int D.19665;
  long int D.19666;
  void * D.19671;
  unsigned int tlab_size.6;
  long unsigned int D.19673;
  _Bool D.19674;
  long int D.19675;
  long int D.19676;
  <unnamed type> nursery_clear_policy.7;
  long int real_end.8;
  long int p.9;
  long int D.19687;
  _Bool D.19688;
  long int D.19689;
  long int D.19690;
  char * tlab_temp_end.10;
  _Bool D.19694;
  long int D.19695;
  long int D.19696;
  char * tlab_next.11;
  char * D.19700;
  char * tlab_real_end.12;
  char * D.19702;
  struct FILE * gc_debug_file.13;
  long int D.19714;
  char * D.19717;
  long unsigned int alloc_size.14;
  char * D.19719;
  long unsigned int D.19720;
  char * D.19721;
  struct MonoClass * D.19726;
  const char * D.19727;
  void * D.19730;
  _Bool D.19731;
  long int D.19732;
  long int D.19733;
  void * * p;
  char * new_next;

  D.19660 = size + 7;
  size = D.19660 & 18446744073709551608;
  if (0 != 0) goto <D.19661>; else goto <D.19662>;
  <D.19661>:
  monoeg_g_log (0B, 4, "Object too small");
  <D.19494>:
  goto <D.19494>;
  <D.19662>:
  D.19663 = vtable->gc_descr;
  D.19664 = D.19663 == 0B;
  D.19665 = (long int) D.19664;
  D.19666 = __builtin_expect (D.19665, 0);
  if (D.19666 != 0) goto <D.19667>; else goto <D.19668>;
  <D.19667>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 352, "vtable->gc_descr");
  <D.19668>:
  if (size > 8000) goto <D.19669>; else goto <D.19670>;
  <D.19669>:
  D.19671 = 0B;
  return D.19671;
  <D.19670>:
  tlab_size.6 = tlab_size;
  D.19673 = (long unsigned int) tlab_size.6;
  D.19674 = D.19673 < size;
  D.19675 = (long int) D.19674;
  D.19676 = __builtin_expect (D.19675, 0);
  if (D.19676 != 0) goto <D.19677>; else goto <D.19678>;
  <D.19677>:
  p = sgen_nursery_alloc (size);
  if (p == 0B) goto <D.19679>; else goto <D.19680>;
  <D.19679>:
  D.19671 = 0B;
  return D.19671;
  <D.19680>:
  sgen_set_nursery_scan_start (p);
  nursery_clear_policy.7 = nursery_clear_policy;
  if (nursery_clear_policy.7 == 1) goto <D.19682>; else goto <D.19683>;
  <D.19682>:
  memset (p, 0, size);
  <D.19683>:
  goto <D.19684>;
  <D.19678>:
  {
    int available_in_tlab;
    char * real_end;

    p = tlab_next;
    new_next = p + size;
    real_end = tlab_real_end;
    real_end.8 = (long int) real_end;
    p.9 = (long int) p;
    D.19687 = real_end.8 - p.9;
    available_in_tlab = (int) D.19687;
    D.19688 = new_next < real_end;
    D.19689 = (long int) D.19688;
    D.19690 = __builtin_expect (D.19689, 1);
    if (D.19690 != 0) goto <D.19691>; else goto <D.19692>;
    <D.19691>:
    tlab_next = new_next;
    tlab_temp_end.10 = tlab_temp_end;
    D.19694 = new_next >= tlab_temp_end.10;
    D.19695 = (long int) D.19694;
    D.19696 = __builtin_expect (D.19695, 0);
    if (D.19696 != 0) goto <D.19697>; else goto <D.19698>;
    <D.19697>:
    sgen_set_nursery_scan_start (new_next);
    tlab_next.11 = tlab_next;
    D.19700 = tlab_next.11 + 8192;
    tlab_real_end.12 = tlab_real_end;
    D.19702 = MIN_EXPR <D.19700, tlab_real_end.12>;
    tlab_temp_end = D.19702;
    if (0 != 0) goto <D.19703>; else goto <D.19704>;
    <D.19703>:
    gc_debug_file.13 = gc_debug_file;
    tlab_next.11 = tlab_next;
    tlab_temp_end.10 = tlab_temp_end;
    fprintf (gc_debug_file.13, "Expanding local alloc: %p-%p\n", tlab_next.11, tlab_temp_end.10);
    gc_debug_file.13 = gc_debug_file;
    fflush (gc_debug_file.13);
    <D.19704>:
    <D.19698>:
    goto <D.19706>;
    <D.19692>:
    if (available_in_tlab > 512) goto <D.19707>; else goto <D.19708>;
    <D.19707>:
    p = sgen_nursery_alloc (size);
    if (p == 0B) goto <D.19709>; else goto <D.19710>;
    <D.19709>:
    D.19671 = 0B;
    return D.19671;
    <D.19710>:
    nursery_clear_policy.7 = nursery_clear_policy;
    if (nursery_clear_policy.7 == 1) goto <D.19711>; else goto <D.19712>;
    <D.19711>:
    memset (p, 0, size);
    <D.19712>:
    goto <D.19713>;
    <D.19708>:
    {
      size_t alloc_size;

      try
        {
          alloc_size = 0;
          D.19714 = (long int) available_in_tlab;
          sgen_nursery_retire_region (p, D.19714);
          tlab_size.6 = tlab_size;
          D.19673 = (long unsigned int) tlab_size.6;
          new_next = sgen_nursery_alloc_range (D.19673, size, &alloc_size);
          p = new_next;
          if (p == 0B) goto <D.19715>; else goto <D.19716>;
          <D.19715>:
          D.19671 = 0B;
          return D.19671;
          <D.19716>:
          tlab_start = new_next;
          D.19717 = new_next + size;
          tlab_next = D.19717;
          alloc_size.14 = alloc_size;
          D.19719 = new_next + alloc_size.14;
          tlab_real_end = D.19719;
          alloc_size.14 = alloc_size;
          D.19720 = MIN_EXPR <alloc_size.14, 8192>;
          D.19721 = new_next + D.19720;
          tlab_temp_end = D.19721;
          sgen_set_nursery_scan_start (p);
          nursery_clear_policy.7 = nursery_clear_policy;
          if (nursery_clear_policy.7 == 1) goto <D.19722>; else goto <D.19723>;
          <D.19722>:
          alloc_size.14 = alloc_size;
          memset (new_next, 0, alloc_size.14);
          <D.19723>:
        }
      finally
        {
          alloc_size = {CLOBBER};
        }
    }
    <D.19713>:
    <D.19706>:
  }
  <D.19684>:
  if (0 != 0) goto <D.19724>; else goto <D.19725>;
  <D.19724>:
  gc_debug_file.13 = gc_debug_file;
  D.19726 = vtable->klass;
  D.19727 = D.19726->name;
  fprintf (gc_debug_file.13, "Allocated object %p, vtable: %p (%s), size: %zd\n", p, vtable, D.19727, size);
  gc_debug_file.13 = gc_debug_file;
  fflush (gc_debug_file.13);
  <D.19725>:
  if (0 != 0) goto <D.19728>; else goto <D.19729>;
  <D.19728>:
  <D.19729>:
  D.19730 = *p;
  D.19731 = D.19730 != 0B;
  D.19732 = (long int) D.19731;
  D.19733 = __builtin_expect (D.19732, 0);
  if (D.19733 != 0) goto <D.19734>; else goto <D.19735>;
  <D.19734>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 425, "*p == NULL");
  <D.19735>:
  *p = vtable;
  D.19671 = p;
  return D.19671;
}


sgen_set_nursery_scan_start (char * p)
{
  long int p.15;
  struct GCMemSection * nursery_section.16;
  char * D.19741;
  long int D.19742;
  long int D.19743;
  long int D.19744;
  char * * D.19745;
  long unsigned int D.19746;
  long unsigned int D.19747;
  char * * D.19748;
  int idx;
  char * old;

  p.15 = (long int) p;
  nursery_section.16 = nursery_section;
  D.19741 = nursery_section.16->data;
  D.19742 = (long int) D.19741;
  D.19743 = p.15 - D.19742;
  D.19744 = D.19743 / 8192;
  idx = (int) D.19744;
  nursery_section.16 = nursery_section;
  D.19745 = nursery_section.16->scan_starts;
  D.19746 = (long unsigned int) idx;
  D.19747 = D.19746 * 8;
  D.19748 = D.19745 + D.19747;
  old = *D.19748;
  if (old == 0B) goto <D.19749>; else goto <D.19751>;
  <D.19751>:
  if (old > p) goto <D.19749>; else goto <D.19750>;
  <D.19749>:
  nursery_section.16 = nursery_section;
  D.19745 = nursery_section.16->scan_starts;
  D.19746 = (long unsigned int) idx;
  D.19747 = D.19746 * 8;
  D.19748 = D.19745 + D.19747;
  *D.19748 = p;
  <D.19750>:
}


__attribute__((__artificial__, __gnu_inline__, __always_inline__, __nothrow__, __leaf__))
memset (void * __dest, int __ch, size_t __len)
{
  void * D.19752;
  long unsigned int D.19753;

  D.19753 = __builtin_object_size (__dest, 0);
  D.19752 = __builtin___memset_chk (__dest, __ch, __len, D.19753);
  return D.19752;
}


mono_gc_alloc_obj_nolock (struct MonoVTable * vtable, size_t size)
{
  long unsigned int D.19758;
  void * D.19759;
  _Bool D.19760;
  long int D.19761;
  long int D.19762;
  int has_per_allocation_action.17;
  _Bool D.19766;
  long int D.19767;
  long int D.19768;
  unsigned int collect_before_allocs.18;
  unsigned int current_alloc.19;
  unsigned int D.19775;
  struct GCMemSection * nursery_section.20;
  int degraded_mode.21;
  int D.19784;
  unsigned int verify_before_allocs.22;
  unsigned int D.19793;
  char * tlab_temp_end.23;
  _Bool D.19800;
  long int D.19801;
  long int D.19802;
  struct FILE * gc_debug_file.24;
  struct MonoClass * D.19808;
  const char * D.19809;
  void * D.19812;
  _Bool D.19813;
  long int D.19814;
  long int D.19815;
  void * D.19818;
  char * tlab_next.25;
  char * tlab_real_end.26;
  sizetype D.19823;
  char * D.19824;
  int sgen_nursery_size.27;
  long int tlab_real_end.28;
  long int tlab_next.29;
  long int D.19832;
  unsigned int tlab_size.30;
  long unsigned int D.19837;
  <unnamed type> nursery_clear_policy.31;
  char * tlab_start.32;
  long unsigned int D.19855;
  long unsigned int D.19856;
  long int D.19857;
  long int D.19858;
  long unsigned int alloc_size.33;
  char * D.19868;
  long unsigned int D.19869;
  char * D.19870;
  char * D.19873;
  char * D.19875;
  char * D.19876;
  _Bool D.19879;
  long int D.19880;
  long int D.19881;
  void * * p;
  char * new_next;

  if (size <= 8000) goto <D.19755>; else goto <D.19756>;
  <D.19755>:
  goto <D.19757>;
  <D.19756>:
  <D.19757>:
  D.19758 = size + 7;
  size = D.19758 & 18446744073709551608;
  D.19759 = vtable->gc_descr;
  D.19760 = D.19759 == 0B;
  D.19761 = (long int) D.19760;
  D.19762 = __builtin_expect (D.19761, 0);
  if (D.19762 != 0) goto <D.19763>; else goto <D.19764>;
  <D.19763>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 172, "vtable->gc_descr");
  <D.19764>:
  has_per_allocation_action.17 = has_per_allocation_action;
  D.19766 = has_per_allocation_action.17 != 0;
  D.19767 = (long int) D.19766;
  D.19768 = __builtin_expect (D.19767, 0);
  if (D.19768 != 0) goto <D.19769>; else goto <D.19770>;
  <D.19769>:
  {
    static int alloc_count;
    int current_alloc;

    current_alloc = InterlockedIncrement (&alloc_count);
    collect_before_allocs.18 = collect_before_allocs;
    if (collect_before_allocs.18 != 0) goto <D.19772>; else goto <D.19773>;
    <D.19772>:
    current_alloc.19 = (unsigned int) current_alloc;
    collect_before_allocs.18 = collect_before_allocs;
    D.19775 = current_alloc.19 % collect_before_allocs.18;
    if (D.19775 == 0) goto <D.19776>; else goto <D.19777>;
    <D.19776>:
    nursery_section.20 = nursery_section;
    if (nursery_section.20 != 0B) goto <D.19779>; else goto <D.19780>;
    <D.19779>:
    sgen_perform_collection (0, 0, "collect-before-alloc-triggered", 1);
    degraded_mode.21 = degraded_mode;
    if (degraded_mode.21 == 0) goto <D.19782>; else goto <D.19783>;
    <D.19782>:
    D.19784 = sgen_can_alloc_size (size);
    if (D.19784 != 0) goto <D.19785>; else goto <D.19786>;
    <D.19785>:
    if (size <= 8000) goto <D.19787>; else goto <D.19788>;
    <D.19787>:
    monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "sgen-alloc.c", 183);
    <D.19788>:
    <D.19786>:
    <D.19783>:
    <D.19780>:
    <D.19777>:
    goto <D.19789>;
    <D.19773>:
    verify_before_allocs.22 = verify_before_allocs;
    if (verify_before_allocs.22 != 0) goto <D.19791>; else goto <D.19792>;
    <D.19791>:
    current_alloc.19 = (unsigned int) current_alloc;
    verify_before_allocs.22 = verify_before_allocs;
    D.19793 = current_alloc.19 % verify_before_allocs.22;
    if (D.19793 == 0) goto <D.19794>; else goto <D.19795>;
    <D.19794>:
    sgen_check_whole_heap_stw ();
    <D.19795>:
    <D.19792>:
    <D.19789>:
  }
  <D.19770>:
  if (size > 8000) goto <D.19796>; else goto <D.19797>;
  <D.19796>:
  p = sgen_los_alloc_large_inner (vtable, size);
  goto <D.19798>;
  <D.19797>:
  p = tlab_next;
  new_next = p + size;
  tlab_next = new_next;
  tlab_temp_end.23 = tlab_temp_end;
  D.19800 = new_next < tlab_temp_end.23;
  D.19801 = (long int) D.19800;
  D.19802 = __builtin_expect (D.19801, 1);
  if (D.19802 != 0) goto <D.19803>; else goto <D.19804>;
  <D.19803>:
  if (0 != 0) goto <D.19805>; else goto <D.19806>;
  <D.19805>:
  gc_debug_file.24 = gc_debug_file;
  D.19808 = vtable->klass;
  D.19809 = D.19808->name;
  fprintf (gc_debug_file.24, "Allocated object %p, vtable: %p (%s), size: %zd\n", p, vtable, D.19809, size);
  gc_debug_file.24 = gc_debug_file;
  fflush (gc_debug_file.24);
  <D.19806>:
  if (0 != 0) goto <D.19810>; else goto <D.19811>;
  <D.19810>:
  <D.19811>:
  D.19812 = *p;
  D.19813 = D.19812 != 0B;
  D.19814 = (long int) D.19813;
  D.19815 = __builtin_expect (D.19814, 0);
  if (D.19815 != 0) goto <D.19816>; else goto <D.19817>;
  <D.19816>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 225, "*p == NULL");
  <D.19817>:
  *p = vtable;
  D.19818 = p;
  return D.19818;
  <D.19804>:
  tlab_next.25 = tlab_next;
  tlab_real_end.26 = tlab_real_end;
  if (tlab_next.25 >= tlab_real_end.26) goto <D.19821>; else goto <D.19822>;
  <D.19821>:
  {
    int available_in_tlab;

    tlab_next.25 = tlab_next;
    D.19823 = -size;
    D.19824 = tlab_next.25 + D.19823;
    tlab_next = D.19824;
    degraded_mode.21 = degraded_mode;
    if (degraded_mode.21 != 0) goto <D.19825>; else goto <D.19826>;
    <D.19825>:
    degraded_mode.21 = degraded_mode;
    sgen_nursery_size.27 = sgen_nursery_size;
    if (degraded_mode.21 < sgen_nursery_size.27) goto <D.19828>; else goto <D.19829>;
    <D.19828>:
    D.19818 = alloc_degraded (vtable, size, 0);
    return D.19818;
    <D.19829>:
    <D.19826>:
    tlab_real_end.26 = tlab_real_end;
    tlab_real_end.28 = (long int) tlab_real_end.26;
    tlab_next.25 = tlab_next;
    tlab_next.29 = (long int) tlab_next.25;
    D.19832 = tlab_real_end.28 - tlab_next.29;
    available_in_tlab = (int) D.19832;
    tlab_size.30 = tlab_size;
    D.19837 = (long unsigned int) tlab_size.30;
    if (D.19837 < size) goto <D.19833>; else goto <D.19838>;
    <D.19838>:
    if (available_in_tlab > 512) goto <D.19833>; else goto <D.19834>;
    <D.19833>:
    <D.19483>:
    p = sgen_nursery_alloc (size);
    if (p == 0B) goto <D.19839>; else goto <D.19840>;
    <D.19839>:
    sgen_ensure_free_space (size);
    degraded_mode.21 = degraded_mode;
    if (degraded_mode.21 != 0) goto <D.19841>; else goto <D.19842>;
    <D.19841>:
    D.19818 = alloc_degraded (vtable, size, 0);
    return D.19818;
    <D.19842>:
    p = sgen_nursery_alloc (size);
    <D.19840>:
    if (p == 0B) goto <D.19483>; else goto <D.19484>;
    <D.19484>:
    if (p == 0B) goto <D.19843>; else goto <D.19844>;
    <D.19843>:
    if (1 != 0) goto <D.19845>; else goto <D.19846>;
    <D.19845>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 273, "0");
    <D.19846>:
    <D.19844>:
    nursery_clear_policy.31 = nursery_clear_policy;
    if (nursery_clear_policy.31 == 1) goto <D.19848>; else goto <D.19849>;
    <D.19848>:
    memset (p, 0, size);
    <D.19849>:
    goto <D.19835>;
    <D.19834>:
    {
      size_t alloc_size;

      try
        {
          alloc_size = 0;
          tlab_start.32 = tlab_start;
          if (tlab_start.32 != 0B) goto <D.19851>; else goto <D.19852>;
          <D.19851>:
          if (0 != 0) goto <D.19853>; else goto <D.19854>;
          <D.19853>:
          gc_debug_file.24 = gc_debug_file;
          tlab_start.32 = tlab_start;
          tlab_real_end.26 = tlab_real_end;
          tlab_real_end.26 = tlab_real_end;
          tlab_real_end.28 = (long int) tlab_real_end.26;
          tlab_next.25 = tlab_next;
          tlab_next.29 = (long int) tlab_next.25;
          D.19832 = tlab_real_end.28 - tlab_next.29;
          D.19855 = (long unsigned int) D.19832;
          D.19856 = D.19855 - size;
          D.19857 = (long int) D.19856;
          fprintf (gc_debug_file.24, "Retire TLAB: %p-%p [%ld]\n", tlab_start.32, tlab_real_end.26, D.19857);
          gc_debug_file.24 = gc_debug_file;
          fflush (gc_debug_file.24);
          <D.19854>:
          <D.19852>:
          D.19858 = (long int) available_in_tlab;
          sgen_nursery_retire_region (p, D.19858);
          <D.19486>:
          tlab_size.30 = tlab_size;
          D.19837 = (long unsigned int) tlab_size.30;
          p = sgen_nursery_alloc_range (D.19837, size, &alloc_size);
          if (p == 0B) goto <D.19859>; else goto <D.19860>;
          <D.19859>:
          tlab_size.30 = tlab_size;
          D.19837 = (long unsigned int) tlab_size.30;
          sgen_ensure_free_space (D.19837);
          degraded_mode.21 = degraded_mode;
          if (degraded_mode.21 != 0) goto <D.19861>; else goto <D.19862>;
          <D.19861>:
          D.19818 = alloc_degraded (vtable, size, 0);
          return D.19818;
          <D.19862>:
          tlab_size.30 = tlab_size;
          D.19837 = (long unsigned int) tlab_size.30;
          p = sgen_nursery_alloc_range (D.19837, size, &alloc_size);
          <D.19860>:
          if (p == 0B) goto <D.19486>; else goto <D.19487>;
          <D.19487>:
          if (p == 0B) goto <D.19863>; else goto <D.19864>;
          <D.19863>:
          if (1 != 0) goto <D.19865>; else goto <D.19866>;
          <D.19865>:
          monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 298, "0");
          <D.19866>:
          <D.19864>:
          tlab_start = p;
          tlab_start.32 = tlab_start;
          tlab_next = tlab_start.32;
          tlab_start.32 = tlab_start;
          alloc_size.33 = alloc_size;
          D.19868 = tlab_start.32 + alloc_size.33;
          tlab_real_end = D.19868;
          tlab_start.32 = tlab_start;
          alloc_size.33 = alloc_size;
          D.19869 = MIN_EXPR <alloc_size.33, 8192>;
          D.19870 = tlab_start.32 + D.19869;
          tlab_temp_end = D.19870;
          nursery_clear_policy.31 = nursery_clear_policy;
          if (nursery_clear_policy.31 == 1) goto <D.19871>; else goto <D.19872>;
          <D.19871>:
          tlab_start.32 = tlab_start;
          alloc_size.33 = alloc_size;
          memset (tlab_start.32, 0, alloc_size.33);
          <D.19872>:
          p = tlab_next;
          tlab_next.25 = tlab_next;
          D.19873 = tlab_next.25 + size;
          tlab_next = D.19873;
          sgen_set_nursery_scan_start (p);
        }
      finally
        {
          alloc_size = {CLOBBER};
        }
    }
    <D.19835>:
  }
  goto <D.19874>;
  <D.19822>:
  sgen_set_nursery_scan_start (p);
  tlab_next.25 = tlab_next;
  D.19875 = tlab_next.25 + 8192;
  tlab_real_end.26 = tlab_real_end;
  D.19876 = MIN_EXPR <D.19875, tlab_real_end.26>;
  tlab_temp_end = D.19876;
  if (0 != 0) goto <D.19877>; else goto <D.19878>;
  <D.19877>:
  gc_debug_file.24 = gc_debug_file;
  tlab_next.25 = tlab_next;
  tlab_temp_end.23 = tlab_temp_end;
  fprintf (gc_debug_file.24, "Expanding local alloc: %p-%p\n", tlab_next.25, tlab_temp_end.23);
  gc_debug_file.24 = gc_debug_file;
  fflush (gc_debug_file.24);
  <D.19878>:
  <D.19874>:
  <D.19798>:
  D.19879 = p != 0B;
  D.19880 = (long int) D.19879;
  D.19881 = __builtin_expect (D.19880, 1);
  if (D.19881 != 0) goto <D.19882>; else goto <D.19883>;
  <D.19882>:
  if (0 != 0) goto <D.19884>; else goto <D.19885>;
  <D.19884>:
  gc_debug_file.24 = gc_debug_file;
  D.19808 = vtable->klass;
  D.19809 = D.19808->name;
  fprintf (gc_debug_file.24, "Allocated object %p, vtable: %p (%s), size: %zd\n", p, vtable, D.19809, size);
  gc_debug_file.24 = gc_debug_file;
  fflush (gc_debug_file.24);
  <D.19885>:
  if (0 != 0) goto <D.19886>; else goto <D.19887>;
  <D.19886>:
  if (size > 8000) goto <D.19888>; else goto <D.19889>;
  <D.19888>:
  goto <D.19890>;
  <D.19889>:
  <D.19890>:
  <D.19887>:
  *p = vtable;
  <D.19883>:
  D.19818 = p;
  return D.19818;
}


alloc_degraded (struct MonoVTable * vtable, size_t size, gboolean for_mature)
{
  int last_major_gc_warned.34;
  int stat_major_gcs.35;
  int num_degraded.36;
  int num_degraded.37;
  struct _IO_FILE * stderr.38;
  int D.19909;
  int D.19911;
  _Bool D.19914;
  int D.19915;
  void * (*<T2e26>) (struct MonoVTable *, size_t) D.19916;
  void * D.19920;
  static int last_major_gc_warned = -1;
  static int num_degraded = 0;
  void * p;

  if (for_mature == 0) goto <D.19894>; else goto <D.19895>;
  <D.19894>:
  last_major_gc_warned.34 = last_major_gc_warned;
  stat_major_gcs.35 = stat_major_gcs;
  if (last_major_gc_warned.34 < stat_major_gcs.35) goto <D.19898>; else goto <D.19899>;
  <D.19898>:
  num_degraded.36 = num_degraded;
  num_degraded.37 = num_degraded.36 + 1;
  num_degraded = num_degraded.37;
  num_degraded.36 = num_degraded;
  if (num_degraded.36 == 1) goto <D.19902>; else goto <D.19905>;
  <D.19905>:
  num_degraded.36 = num_degraded;
  if (num_degraded.36 == 3) goto <D.19902>; else goto <D.19903>;
  <D.19902>:
  stderr.38 = stderr;
  fprintf (stderr.38, "Warning: Degraded allocation.  Consider increasing nursery-size if the warning persists.\n");
  goto <D.19904>;
  <D.19903>:
  num_degraded.36 = num_degraded;
  if (num_degraded.36 == 10) goto <D.19907>; else goto <D.19908>;
  <D.19907>:
  stderr.38 = stderr;
  fprintf (stderr.38, "Warning: Repeated degraded allocation.  Consider increasing nursery-size.\n");
  <D.19908>:
  <D.19904>:
  stat_major_gcs.35 = stat_major_gcs;
  last_major_gc_warned = stat_major_gcs.35;
  <D.19899>:
  D.19909 = (int) size;
  InterlockedExchangeAdd (&degraded_mode, D.19909);
  sgen_ensure_free_space (size);
  goto <D.19910>;
  <D.19895>:
  D.19911 = sgen_need_major_collection (size);
  if (D.19911 != 0) goto <D.19912>; else goto <D.19913>;
  <D.19912>:
  D.19914 = for_mature == 0;
  D.19915 = (int) D.19914;
  sgen_perform_collection (size, 1, "mature allocation failure", D.19915);
  <D.19913>:
  <D.19910>:
  D.19916 = major_collector.alloc_degraded;
  p = D.19916 (vtable, size);
  if (for_mature != 0) goto <D.19917>; else goto <D.19918>;
  <D.19917>:
  goto <D.19919>;
  <D.19918>:
  <D.19919>:
  D.19920 = p;
  return D.19920;
}


__attribute__((__artificial__, __gnu_inline__, __always_inline__))
fprintf (struct FILE * restrict __stream, const char * restrict __fmt)
{
  int D.19922;

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


InterlockedExchangeAdd (volatile gint32 * val, gint32 add)
{
  gint32 D.19924;
  unsigned int add.39;
  unsigned int D.19926;

  add.39 = (unsigned int) add;
  D.19926 = __sync_fetch_and_add_4 (val, add.39);
  D.19924 = (gint32) D.19926;
  return D.19924;
}


__attribute__((visibility ("hidden")))
mono_gc_alloc_vector (struct MonoVTable * vtable, size_t size, uintptr_t max_length)
{
  struct SgenThreadInfo * sgen_thread_info.40;
  unsigned int D.19931;
  void * D.19932;
  _Bool D.19933;
  long int D.19934;
  long int D.19935;
  struct MonoArray * arr;

  sgen_thread_info.40 = sgen_thread_info;
  sgen_thread_info.40->in_critical_region = 1;
  arr = mono_gc_try_alloc_obj_nolock (vtable, size);
  if (arr != 0B) goto <D.19929>; else goto <D.19930>;
  <D.19929>:
  D.19931 = (unsigned int) max_length;
  arr->max_length = D.19931;
  sgen_thread_info.40 = sgen_thread_info;
  sgen_thread_info.40->in_critical_region = 0;
  D.19932 = arr;
  return D.19932;
  <D.19930>:
  sgen_thread_info.40 = sgen_thread_info;
  sgen_thread_info.40->in_critical_region = 0;
  pthread_mutex_lock (&gc_mutex);
  arr = mono_gc_alloc_obj_nolock (vtable, size);
  D.19933 = arr == 0B;
  D.19934 = (long int) D.19933;
  D.19935 = __builtin_expect (D.19934, 0);
  if (D.19935 != 0) goto <D.19936>; else goto <D.19937>;
  <D.19936>:
  sgen_gc_unlock ();
  D.19932 = mono_gc_out_of_memory (size);
  return D.19932;
  <D.19937>:
  D.19931 = (unsigned int) max_length;
  arr->max_length = D.19931;
  sgen_gc_unlock ();
  D.19932 = arr;
  return D.19932;
}


__attribute__((visibility ("hidden")))
mono_gc_alloc_array (struct MonoVTable * vtable, size_t size, uintptr_t max_length, uintptr_t bounds_size)
{
  struct SgenThreadInfo * sgen_thread_info.41;
  unsigned int D.19942;
  sizetype D.19943;
  void * D.19944;
  _Bool D.19945;
  long int D.19946;
  long int D.19947;
  struct MonoArray * arr;
  struct MonoArrayBounds * bounds;

  sgen_thread_info.41 = sgen_thread_info;
  sgen_thread_info.41->in_critical_region = 1;
  arr = mono_gc_try_alloc_obj_nolock (vtable, size);
  if (arr != 0B) goto <D.19940>; else goto <D.19941>;
  <D.19940>:
  D.19942 = (unsigned int) max_length;
  arr->max_length = D.19942;
  D.19943 = size - bounds_size;
  bounds = arr + D.19943;
  arr->bounds = bounds;
  sgen_thread_info.41 = sgen_thread_info;
  sgen_thread_info.41->in_critical_region = 0;
  D.19944 = arr;
  return D.19944;
  <D.19941>:
  sgen_thread_info.41 = sgen_thread_info;
  sgen_thread_info.41->in_critical_region = 0;
  pthread_mutex_lock (&gc_mutex);
  arr = mono_gc_alloc_obj_nolock (vtable, size);
  D.19945 = arr == 0B;
  D.19946 = (long int) D.19945;
  D.19947 = __builtin_expect (D.19946, 0);
  if (D.19947 != 0) goto <D.19948>; else goto <D.19949>;
  <D.19948>:
  sgen_gc_unlock ();
  D.19944 = mono_gc_out_of_memory (size);
  return D.19944;
  <D.19949>:
  D.19942 = (unsigned int) max_length;
  arr->max_length = D.19942;
  D.19943 = size - bounds_size;
  bounds = arr + D.19943;
  arr->bounds = bounds;
  sgen_gc_unlock ();
  D.19944 = arr;
  return D.19944;
}


__attribute__((visibility ("hidden")))
mono_gc_alloc_string (struct MonoVTable * vtable, size_t size, gint32 len)
{
  struct SgenThreadInfo * sgen_thread_info.42;
  void * D.19954;
  _Bool D.19955;
  long int D.19956;
  long int D.19957;
  struct MonoString * str;

  sgen_thread_info.42 = sgen_thread_info;
  sgen_thread_info.42->in_critical_region = 1;
  str = mono_gc_try_alloc_obj_nolock (vtable, size);
  if (str != 0B) goto <D.19952>; else goto <D.19953>;
  <D.19952>:
  str->length = len;
  sgen_thread_info.42 = sgen_thread_info;
  sgen_thread_info.42->in_critical_region = 0;
  D.19954 = str;
  return D.19954;
  <D.19953>:
  sgen_thread_info.42 = sgen_thread_info;
  sgen_thread_info.42->in_critical_region = 0;
  pthread_mutex_lock (&gc_mutex);
  str = mono_gc_alloc_obj_nolock (vtable, size);
  D.19955 = str == 0B;
  D.19956 = (long int) D.19955;
  D.19957 = __builtin_expect (D.19956, 0);
  if (D.19957 != 0) goto <D.19958>; else goto <D.19959>;
  <D.19958>:
  sgen_gc_unlock ();
  D.19954 = mono_gc_out_of_memory (size);
  return D.19954;
  <D.19959>:
  str->length = len;
  sgen_gc_unlock ();
  D.19954 = str;
  return D.19954;
}


__attribute__((visibility ("hidden")))
mono_gc_alloc_pinned_obj (struct MonoVTable * vtable, size_t size)
{
  long unsigned int D.19961;
  struct MonoClass * D.19967;
  const char * D.19968;
  const char * D.19969;
  void * (*<T2e22>) (struct MonoVTable *, size_t, gboolean) D.19970;
  void * D.19971;
  long unsigned int D.19972;
  int D.19973;
  _Bool D.19974;
  long int D.19975;
  long int D.19976;
  struct FILE * gc_debug_file.43;
  void * D.19985;
  void * * p;

  D.19961 = size + 7;
  size = D.19961 & 18446744073709551608;
  pthread_mutex_lock (&gc_mutex);
  if (size > 8000) goto <D.19962>; else goto <D.19963>;
  <D.19962>:
  p = sgen_los_alloc_large_inner (vtable, size);
  goto <D.19964>;
  <D.19963>:
  if (0 != 0) goto <D.19965>; else goto <D.19966>;
  <D.19965>:
  D.19967 = vtable->klass;
  D.19968 = D.19967->name_space;
  D.19967 = vtable->klass;
  D.19969 = D.19967->name;
  monoeg_g_log (0B, 4, "class %s:%s is not initialized", D.19968, D.19969);
  <D.19530>:
  goto <D.19530>;
  <D.19966>:
  D.19970 = major_collector.alloc_small_pinned_obj;
  D.19971 = vtable->gc_descr;
  D.19972 = (long unsigned int) D.19971;
  D.19973 = sgen_gc_descr_has_references (D.19972);
  p = D.19970 (vtable, size, D.19973);
  <D.19964>:
  D.19974 = p != 0B;
  D.19975 = (long int) D.19974;
  D.19976 = __builtin_expect (D.19975, 1);
  if (D.19976 != 0) goto <D.19977>; else goto <D.19978>;
  <D.19977>:
  if (0 != 0) goto <D.19979>; else goto <D.19980>;
  <D.19979>:
  gc_debug_file.43 = gc_debug_file;
  D.19967 = vtable->klass;
  D.19969 = D.19967->name;
  fprintf (gc_debug_file.43, "Allocated pinned object %p, vtable: %p (%s), size: %zd\n", p, vtable, D.19969, size);
  gc_debug_file.43 = gc_debug_file;
  fflush (gc_debug_file.43);
  <D.19980>:
  if (size > 8000) goto <D.19982>; else goto <D.19983>;
  <D.19982>:
  goto <D.19984>;
  <D.19983>:
  <D.19984>:
  <D.19978>:
  sgen_gc_unlock ();
  D.19985 = p;
  return D.19985;
}


sgen_gc_descr_has_references (mword desc)
{
  long unsigned int D.19987;
  gboolean D.19990;
  long unsigned int D.19991;
  long unsigned int D.19994;

  D.19987 = desc & 4294901767;
  if (D.19987 == 1) goto <D.19988>; else goto <D.19989>;
  <D.19988>:
  D.19990 = 0;
  return D.19990;
  <D.19989>:
  D.19991 = desc & 49159;
  if (D.19991 == 4) goto <D.19992>; else goto <D.19993>;
  <D.19992>:
  D.19990 = 0;
  return D.19990;
  <D.19993>:
  D.19994 = desc & 7;
  if (D.19994 == 7) goto <D.19995>; else goto <D.19996>;
  <D.19995>:
  D.19990 = 0;
  return D.19990;
  <D.19996>:
  D.19990 = 1;
  return D.19990;
}


__attribute__((visibility ("hidden")))
mono_gc_alloc_mature (struct MonoVTable * vtable)
{
  struct MonoClass * D.19998;
  int D.19999;
  int D.20000;
  int D.20001;
  long unsigned int D.20002;
  long unsigned int D.20003;
  _Bool D.20004;
  long int D.20005;
  long int D.20006;
  void * D.20009;
  void * * res;
  size_t size;

  D.19998 = vtable->klass;
  D.19999 = D.19998->instance_size;
  D.20000 = D.19999 + 7;
  D.20001 = D.20000 & -8;
  size = (size_t) D.20001;
  pthread_mutex_lock (&gc_mutex);
  res = alloc_degraded (vtable, size, 1);
  sgen_gc_unlock ();
  D.19998 = vtable->klass;
  D.20002 = BIT_FIELD_REF <*D.19998, 64, 256>;
  D.20003 = D.20002 & 4398046511104;
  D.20004 = D.20003 != 0;
  D.20005 = (long int) D.20004;
  D.20006 = __builtin_expect (D.20005, 0);
  if (D.20006 != 0) goto <D.20007>; else goto <D.20008>;
  <D.20007>:
  mono_object_register_finalizer (res);
  <D.20008>:
  D.20009 = res;
  return D.20009;
}


__attribute__((visibility ("hidden")))
mono_gc_alloc_fixed (size_t size, void * descr)
{
  void * D.20013;
  int D.20014;
  void * res;

  res = calloc (1, size);
  if (res == 0B) goto <D.20011>; else goto <D.20012>;
  <D.20011>:
  D.20013 = 0B;
  return D.20013;
  <D.20012>:
  D.20014 = mono_gc_register_root (res, size, descr);
  if (D.20014 == 0) goto <D.20015>; else goto <D.20016>;
  <D.20015>:
  free (res);
  res = 0B;
  <D.20016>:
  D.20013 = res;
  return D.20013;
}


__attribute__((visibility ("hidden")))
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.20018;
  struct MonoLinkedListSetNode * D.20019;
  long unsigned int D.20020;
  char * * D.20023;
  char * * D.20024;
  char * * D.20025;
  char * * D.20026;
  struct SgenThreadInfo * info;

  {
    struct MonoLinkedListSetNode * __cur;

    D.20018 = mono_thread_info_list_head ();
    __cur = D.20018->head;
    goto <D.19553>;
    <D.19552>:
    D.20019 = __cur->next;
    D.20020 = mono_lls_pointer_get_mark (D.20019);
    if (D.20020 == 0) goto <D.20021>; else goto <D.20022>;
    <D.20021>:
    info = __cur;
    D.20023 = info->tlab_start_addr;
    *D.20023 = 0B;
    D.20024 = info->tlab_next_addr;
    *D.20024 = 0B;
    D.20025 = info->tlab_temp_end_addr;
    *D.20025 = 0B;
    D.20026 = info->tlab_real_end_addr;
    *D.20026 = 0B;
    <D.20022>:
    D.20019 = __cur->next;
    __cur = mono_lls_pointer_unmask (D.20019);
    <D.19553>:
    if (__cur != 0B) goto <D.19552>; else goto <D.19554>;
    <D.19554>:
  }
}


mono_lls_pointer_get_mark (void * n)
{
  uintptr_t D.20027;
  long unsigned int n.44;

  n.44 = (long unsigned int) n;
  D.20027 = n.44 & 1;
  return D.20027;
}


mono_lls_pointer_unmask (void * p)
{
  void * D.20030;
  long unsigned int p.45;
  long unsigned int D.20032;

  p.45 = (long unsigned int) p;
  D.20032 = p.45 & 18446744073709551612;
  D.20030 = (void *) D.20032;
  return D.20030;
}


__attribute__((visibility ("hidden")))
mono_gc_get_managed_allocator (struct MonoClass * klass, gboolean for_box)
{
  struct MonoMethod * D.20037;
  unsigned int collect_before_allocs.46;
  int D.20041;
  int D.20044;
  unsigned int D.20045;
  unsigned int tlab_size.47;
  long unsigned int D.20051;
  long unsigned int D.20052;
  <unnamed type> D.20054;
  unsigned int D.20055;
  unsigned char D.20056;
  unsigned char D.20059;
  long unsigned int D.20063;
  long unsigned int D.20064;
  long unsigned int D.20065;
  struct MonoType * D.20067;
  int D.20068;
  int tlab_next_offset;
  int tlab_temp_end_offset;

  tlab_next_offset = -1;
  tlab_temp_end_offset = -1;
  {
    guint64 foo;

    __asm__("basr	%%r1,0
	j	0f
	.quad tlab_next@NTPOFF
0:
	lg	%0,4(%%r1)
	" : "=r" foo :  : "1");
    tlab_next_offset = (int) foo;
  }
  {
    guint64 foo;

    __asm__("basr	%%r1,0
	j	0f
	.quad tlab_temp_end@NTPOFF
0:
	lg	%0,4(%%r1)
	" : "=r" foo :  : "1");
    tlab_temp_end_offset = (int) foo;
  }
  if (tlab_next_offset == -1) goto <D.20034>; else goto <D.20036>;
  <D.20036>:
  if (tlab_temp_end_offset == -1) goto <D.20034>; else goto <D.20035>;
  <D.20034>:
  D.20037 = 0B;
  return D.20037;
  <D.20035>:
  collect_before_allocs.46 = collect_before_allocs;
  if (collect_before_allocs.46 != 0) goto <D.20039>; else goto <D.20040>;
  <D.20039>:
  D.20037 = 0B;
  return D.20037;
  <D.20040>:
  D.20041 = mono_runtime_has_tls_get ();
  if (D.20041 == 0) goto <D.20042>; else goto <D.20043>;
  <D.20042>:
  D.20037 = 0B;
  return D.20037;
  <D.20043>:
  D.20044 = klass->instance_size;
  D.20045 = (unsigned int) D.20044;
  tlab_size.47 = tlab_size;
  if (D.20045 > tlab_size.47) goto <D.20047>; else goto <D.20048>;
  <D.20047>:
  D.20037 = 0B;
  return D.20037;
  <D.20048>:
  D.20051 = BIT_FIELD_REF <*klass, 64, 256>;
  D.20052 = D.20051 & 6597069766656;
  if (D.20052 != 0) goto <D.20049>; else goto <D.20053>;
  <D.20053>:
  D.20054 = mono_profiler_get_events ();
  D.20055 = D.20054 & 128;
  if (D.20055 != 0) goto <D.20049>; else goto <D.20050>;
  <D.20049>:
  D.20037 = 0B;
  return D.20037;
  <D.20050>:
  D.20056 = klass->rank;
  if (D.20056 != 0) goto <D.20057>; else goto <D.20058>;
  <D.20057>:
  D.20037 = 0B;
  return D.20037;
  <D.20058>:
  D.20059 = klass->byval_arg.type;
  if (D.20059 == 14) goto <D.20060>; else goto <D.20061>;
  <D.20060>:
  D.20037 = mono_gc_get_managed_allocator_by_type (3);
  return D.20037;
  <D.20061>:
  D.20044 = klass->instance_size;
  D.20063 = (long unsigned int) D.20044;
  D.20064 = D.20063 + 7;
  D.20065 = D.20064 & 18446744073709551608;
  if (D.20065 <= 7999) goto <D.20066>; else goto <D.20062>;
  <D.20066>:
  D.20067 = &klass->byval_arg;
  D.20068 = mono_class_is_open_constructed_type (D.20067);
  if (D.20068 == 0) goto <D.20069>; else goto <D.20062>;
  <D.20069>:
  D.20037 = mono_gc_get_managed_allocator_by_type (2);
  return D.20037;
  <D.20062>:
  D.20037 = mono_gc_get_managed_allocator_by_type (0);
  return D.20037;
}


__attribute__((visibility ("hidden")))
mono_gc_get_managed_array_allocator (struct MonoClass * klass)
{
  struct MonoMethod * D.20074;
  unsigned char D.20075;
  int D.20078;
  <unnamed type> D.20081;
  unsigned int D.20082;
  int has_per_allocation_action.48;
  int iftmp.49;
  int D.20092;
  long unsigned int D.20094;
  long unsigned int D.20095;
  _Bool D.20096;
  long int D.20097;
  long int D.20098;
  int tlab_next_offset;
  int tlab_temp_end_offset;

  tlab_next_offset = -1;
  tlab_temp_end_offset = -1;
  {
    guint64 foo;

    __asm__("basr	%%r1,0
	j	0f
	.quad tlab_next@NTPOFF
0:
	lg	%0,4(%%r1)
	" : "=r" foo :  : "1");
    tlab_next_offset = (int) foo;
  }
  {
    guint64 foo;

    __asm__("basr	%%r1,0
	j	0f
	.quad tlab_temp_end@NTPOFF
0:
	lg	%0,4(%%r1)
	" : "=r" foo :  : "1");
    tlab_temp_end_offset = (int) foo;
  }
  if (tlab_next_offset == -1) goto <D.20071>; else goto <D.20073>;
  <D.20073>:
  if (tlab_temp_end_offset == -1) goto <D.20071>; else goto <D.20072>;
  <D.20071>:
  D.20074 = 0B;
  return D.20074;
  <D.20072>:
  D.20075 = klass->rank;
  if (D.20075 != 1) goto <D.20076>; else goto <D.20077>;
  <D.20076>:
  D.20074 = 0B;
  return D.20074;
  <D.20077>:
  D.20078 = mono_runtime_has_tls_get ();
  if (D.20078 == 0) goto <D.20079>; else goto <D.20080>;
  <D.20079>:
  D.20074 = 0B;
  return D.20074;
  <D.20080>:
  D.20081 = mono_profiler_get_events ();
  D.20082 = D.20081 & 128;
  if (D.20082 != 0) goto <D.20083>; else goto <D.20084>;
  <D.20083>:
  D.20074 = 0B;
  return D.20074;
  <D.20084>:
  has_per_allocation_action.48 = has_per_allocation_action;
  if (has_per_allocation_action.48 != 0) goto <D.20086>; else goto <D.20087>;
  <D.20086>:
  D.20074 = 0B;
  return D.20074;
  <D.20087>:
  D.20092 = mono_class_has_finalizer (klass);
  if (D.20092 != 0) goto <D.20089>; else goto <D.20093>;
  <D.20093>:
  D.20094 = BIT_FIELD_REF <*klass, 64, 256>;
  D.20095 = D.20094 & 2199023255552;
  if (D.20095 != 0) goto <D.20089>; else goto <D.20090>;
  <D.20089>:
  iftmp.49 = 1;
  goto <D.20091>;
  <D.20090>:
  iftmp.49 = 0;
  <D.20091>:
  D.20096 = iftmp.49 != 0;
  D.20097 = (long int) D.20096;
  D.20098 = __builtin_expect (D.20097, 0);
  if (D.20098 != 0) goto <D.20099>; else goto <D.20100>;
  <D.20099>:
  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.20100>:
  D.20074 = mono_gc_get_managed_allocator_by_type (1);
  return D.20074;
}


sgen_set_use_managed_allocator (gboolean flag)
{
  use_managed_allocator = flag;
}


__attribute__((visibility ("hidden")))
mono_gc_get_managed_allocator_by_type (int atype)
{
  int use_managed_allocator.50;
  struct MonoMethod * D.20105;
  int D.20106;
  struct MonoMethod * D.20111;
  struct MonoMethod * res;

  use_managed_allocator.50 = use_managed_allocator;
  if (use_managed_allocator.50 == 0) goto <D.20103>; else goto <D.20104>;
  <D.20103>:
  D.20105 = 0B;
  return D.20105;
  <D.20104>:
  D.20106 = mono_runtime_has_tls_get ();
  if (D.20106 == 0) goto <D.20107>; else goto <D.20108>;
  <D.20107>:
  D.20105 = 0B;
  return D.20105;
  <D.20108>:
  res = alloc_method_cache[atype];
  if (res != 0B) goto <D.20109>; else goto <D.20110>;
  <D.20109>:
  D.20105 = res;
  return D.20105;
  <D.20110>:
  res = create_allocator (atype);
  pthread_mutex_lock (&gc_mutex);
  D.20111 = alloc_method_cache[atype];
  if (D.20111 != 0B) goto <D.20112>; else goto <D.20113>;
  <D.20112>:
  mono_free_method (res);
  res = alloc_method_cache[atype];
  goto <D.20114>;
  <D.20113>:
  mono_memory_barrier ();
  alloc_method_cache[atype] = res;
  <D.20114>:
  sgen_gc_unlock ();
  D.20105 = res;
  return D.20105;
}


create_allocator (int atype)
{
  _Bool D.20116;
  long int D.20117;
  long int D.20118;
  _Bool D.20121;
  long int D.20122;
  long int D.20123;
  int registered.51;
  struct MonoMethodSignature * D.20129;
  struct MonoMethodSignature * D.20130;
  struct MonoMethodSignature * D.20131;
  struct MonoImage * D.20144;
  unsigned int num_params.52;
  struct MonoClass * D.20148;
  struct MonoType * D.20149;
  struct MonoClass * D.20150;
  struct MonoType * D.20151;
  struct MonoClass * D.20152;
  struct MonoType * D.20153;
  struct MonoClass * D.20155;
  struct MonoType * D.20156;
  unsigned int size_var.53;
  unsigned int D.20164;
  unsigned int pos.54;
  int D.20166;
  unsigned int D.20167;
  unsigned int D.20168;
  int D.20169;
  unsigned int D.20170;
  unsigned int D.20171;
  unsigned int D.20172;
  struct MonoClass * D.20173;
  struct MonoClass * D.20174;
  _Bool D.20175;
  long int D.20176;
  long int D.20177;
  int D.20180;
  unsigned int D.20181;
  _Bool D.20182;
  long int D.20183;
  long int D.20184;
  _Bool D.20187;
  long int D.20188;
  long int D.20189;
  int D.20192;
  unsigned int D.20193;
  unsigned int D.20194;
  unsigned int D.20195;
  unsigned int pos_leave.55;
  unsigned int tlab_next_addr_var.56;
  unsigned int p_var.57;
  unsigned int new_next_var.58;
  struct MonoMethodHeader * D.20223;
  struct MonoMethod * D.20224;
  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;
  {
    guint64 foo;

    __asm__("basr	%%r1,0
	j	0f
	.quad tlab_next_addr@NTPOFF
0:
	lg	%0,4(%%r1)
	" : "=r" foo :  : "1");
    tlab_next_addr_offset = (int) foo;
  }
  {
    guint64 foo;

    __asm__("basr	%%r1,0
	j	0f
	.quad tlab_temp_end@NTPOFF
0:
	lg	%0,4(%%r1)
	" : "=r" foo :  : "1");
    tlab_temp_end_offset = (int) foo;
  }
  mono_tls_key_set_offset (5, tlab_next_addr_offset);
  mono_tls_key_set_offset (6, tlab_temp_end_offset);
  D.20116 = tlab_next_addr_offset == -1;
  D.20117 = (long int) D.20116;
  D.20118 = __builtin_expect (D.20117, 0);
  if (D.20118 != 0) goto <D.20119>; else goto <D.20120>;
  <D.20119>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 710, "tlab_next_addr_offset != -1");
  <D.20120>:
  D.20121 = tlab_temp_end_offset == -1;
  D.20122 = (long int) D.20121;
  D.20123 = __builtin_expect (D.20122, 0);
  if (D.20123 != 0) goto <D.20124>; else goto <D.20125>;
  <D.20124>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 711, "tlab_temp_end_offset != -1");
  <D.20125>:
  registered.51 = registered;
  if (registered.51 == 0) goto <D.20127>; else goto <D.20128>;
  <D.20127>:
  D.20129 = mono_create_icall_signature ("object ptr int");
  mono_register_jit_icall (mono_gc_alloc_obj, "mono_gc_alloc_obj", D.20129, 0);
  D.20130 = mono_create_icall_signature ("object ptr int int");
  mono_register_jit_icall (mono_gc_alloc_vector, "mono_gc_alloc_vector", D.20130, 0);
  D.20131 = mono_create_icall_signature ("object ptr int int32");
  mono_register_jit_icall (mono_gc_alloc_string, "mono_gc_alloc_string", D.20131, 0);
  registered = 1;
  <D.20128>:
  if (atype == 2) goto <D.20132>; else goto <D.20133>;
  <D.20132>:
  num_params = 1;
  name = "AllocSmall";
  goto <D.20134>;
  <D.20133>:
  if (atype == 0) goto <D.20135>; else goto <D.20136>;
  <D.20135>:
  num_params = 1;
  name = "Alloc";
  goto <D.20137>;
  <D.20136>:
  if (atype == 1) goto <D.20138>; else goto <D.20139>;
  <D.20138>:
  num_params = 2;
  name = "AllocVector";
  goto <D.20140>;
  <D.20139>:
  if (atype == 3) goto <D.20141>; else goto <D.20142>;
  <D.20141>:
  num_params = 2;
  name = "AllocString";
  goto <D.20143>;
  <D.20142>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "sgen-alloc.c", 734);
  <D.20143>:
  <D.20140>:
  <D.20137>:
  <D.20134>:
  D.20144 = mono_defaults.corlib;
  num_params.52 = (unsigned int) num_params;
  csig = mono_metadata_signature_alloc (D.20144, num_params.52);
  if (atype == 3) goto <D.20146>; else goto <D.20147>;
  <D.20146>:
  D.20148 = mono_defaults.string_class;
  D.20149 = &D.20148->byval_arg;
  csig->ret = D.20149;
  D.20150 = mono_defaults.int_class;
  D.20151 = &D.20150->byval_arg;
  csig->params[0] = D.20151;
  D.20152 = mono_defaults.int32_class;
  D.20153 = &D.20152->byval_arg;
  csig->params[1] = D.20153;
  goto <D.20154>;
  <D.20147>:
  D.20155 = mono_defaults.object_class;
  D.20156 = &D.20155->byval_arg;
  csig->ret = D.20156;
  i = 0;
  goto <D.19578>;
  <D.19577>:
  D.20150 = mono_defaults.int_class;
  D.20151 = &D.20150->byval_arg;
  csig->params[i] = D.20151;
  i = i + 1;
  <D.19578>:
  if (i < num_params) goto <D.19577>; else goto <D.19579>;
  <D.19579>:
  <D.20154>:
  D.20155 = mono_defaults.object_class;
  mb = mono_mb_new (D.20155, name, 28);
  D.20152 = mono_defaults.int32_class;
  D.20153 = &D.20152->byval_arg;
  size_var = mono_mb_add_local (mb, D.20153);
  if (atype == 0) goto <D.20157>; else goto <D.20160>;
  <D.20160>:
  if (atype == 2) goto <D.20157>; else goto <D.20158>;
  <D.20157>:
  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, 28);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 75);
  size_var.53 = (unsigned int) size_var;
  mono_mb_emit_stloc (mb, size_var.53);
  goto <D.20159>;
  <D.20158>:
  if (atype == 1) goto <D.20162>; else goto <D.20163>;
  <D.20162>:
  {
    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.20164 = mono_mb_emit_short_branch (mb, 54);
    pos = (int) D.20164;
    mono_mb_emit_exception (mb, "OverflowException", 0B);
    pos.54 = (unsigned int) pos;
    mono_mb_patch_short_branch (mb, pos.54);
    D.20144 = mono_defaults.corlib;
    clause = mono_image_alloc0 (D.20144, 32);
    D.20166 = mono_mb_get_label (mb);
    D.20167 = (unsigned int) D.20166;
    clause->try_offset = D.20167;
    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, 128);
    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, 32);
    mono_mb_emit_byte (mb, 215);
    size_var.53 = (unsigned int) size_var;
    mono_mb_emit_stloc (mb, size_var.53);
    D.20168 = mono_mb_emit_branch (mb, 221);
    pos_leave = (int) D.20168;
    clause->flags = 0;
    D.20169 = mono_mb_get_pos (mb);
    D.20170 = (unsigned int) D.20169;
    D.20171 = clause->try_offset;
    D.20172 = D.20170 - D.20171;
    clause->try_len = D.20172;
    D.20144 = mono_defaults.corlib;
    D.20173 = mono_class_from_name (D.20144, "System", "OverflowException");
    clause->data.catch_class = D.20173;
    D.20174 = clause->data.catch_class;
    D.20175 = D.20174 == 0B;
    D.20176 = (long int) D.20175;
    D.20177 = __builtin_expect (D.20176, 0);
    if (D.20177 != 0) goto <D.20178>; else goto <D.20179>;
    <D.20178>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 803, "clause->data.catch_class");
    <D.20179>:
    D.20180 = mono_mb_get_label (mb);
    D.20181 = (unsigned int) D.20180;
    clause->handler_offset = D.20181;
    D.20144 = mono_defaults.corlib;
    oom_exc_class = mono_class_from_name (D.20144, "System", "OutOfMemoryException");
    D.20182 = oom_exc_class == 0B;
    D.20183 = (long int) D.20182;
    D.20184 = __builtin_expect (D.20183, 0);
    if (D.20184 != 0) goto <D.20185>; else goto <D.20186>;
    <D.20185>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 808, "oom_exc_class");
    <D.20186>:
    ctor = mono_class_get_method_from_name (oom_exc_class, ".ctor", 0);
    D.20187 = ctor == 0B;
    D.20188 = (long int) D.20187;
    D.20189 = __builtin_expect (D.20188, 0);
    if (D.20189 != 0) goto <D.20190>; else goto <D.20191>;
    <D.20190>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-alloc.c", 810, "ctor");
    <D.20191>:
    mono_mb_emit_byte (mb, 38);
    mono_mb_emit_op (mb, 115, ctor);
    mono_mb_emit_byte (mb, 122);
    D.20192 = mono_mb_get_pos (mb);
    D.20193 = (unsigned int) D.20192;
    D.20194 = clause->handler_offset;
    D.20195 = D.20193 - D.20194;
    clause->handler_len = D.20195;
    mono_mb_set_clauses (mb, 1, clause);
    pos_leave.55 = (unsigned int) pos_leave;
    mono_mb_patch_branch (mb, pos_leave.55);
  }
  goto <D.20197>;
  <D.20163>:
  if (atype == 3) goto <D.20198>; else goto <D.20199>;
  <D.20198>:
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icon (mb, 1);
  mono_mb_emit_byte (mb, 98);
  mono_mb_emit_icon (mb, 26);
  mono_mb_emit_byte (mb, 88);
  size_var.53 = (unsigned int) size_var;
  mono_mb_emit_stloc (mb, size_var.53);
  goto <D.20200>;
  <D.20199>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "sgen-alloc.c", 831);
  <D.20200>:
  <D.20197>:
  <D.20159>:
  size_var.53 = (unsigned int) size_var;
  mono_mb_emit_ldloc (mb, size_var.53);
  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.53 = (unsigned int) size_var;
  mono_mb_emit_stloc (mb, size_var.53);
  if (atype != 2) goto <D.20201>; else goto <D.20202>;
  <D.20201>:
  size_var.53 = (unsigned int) size_var;
  mono_mb_emit_ldloc (mb, size_var.53);
  mono_mb_emit_icon (mb, 8000);
  max_size_branch = mono_mb_emit_short_branch (mb, 53);
  <D.20202>:
  D.20150 = mono_defaults.int_class;
  D.20151 = &D.20150->byval_arg;
  tlab_next_addr_var = mono_mb_add_local (mb, D.20151);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 13);
  mono_mb_emit_i4 (mb, 5);
  tlab_next_addr_var.56 = (unsigned int) tlab_next_addr_var;
  mono_mb_emit_stloc (mb, tlab_next_addr_var.56);
  D.20150 = mono_defaults.int_class;
  D.20151 = &D.20150->byval_arg;
  p_var = mono_mb_add_local (mb, D.20151);
  tlab_next_addr_var.56 = (unsigned int) tlab_next_addr_var;
  mono_mb_emit_ldloc (mb, tlab_next_addr_var.56);
  mono_mb_emit_byte (mb, 77);
  p_var.57 = (unsigned int) p_var;
  mono_mb_emit_stloc (mb, p_var.57);
  D.20150 = mono_defaults.int_class;
  D.20151 = &D.20150->byval_arg;
  new_next_var = mono_mb_add_local (mb, D.20151);
  p_var.57 = (unsigned int) p_var;
  mono_mb_emit_ldloc (mb, p_var.57);
  size_var.53 = (unsigned int) size_var;
  mono_mb_emit_ldloc (mb, size_var.53);
  mono_mb_emit_byte (mb, 211);
  mono_mb_emit_byte (mb, 88);
  new_next_var.58 = (unsigned int) new_next_var;
  mono_mb_emit_stloc (mb, new_next_var.58);
  new_next_var.58 = (unsigned int) new_next_var;
  mono_mb_emit_ldloc (mb, new_next_var.58);
  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.20206>; else goto <D.20207>;
  <D.20206>:
  mono_mb_patch_short_branch (mb, max_size_branch);
  <D.20207>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 12);
  mono_mb_emit_ldarg (mb, 0);
  size_var.53 = (unsigned int) size_var;
  mono_mb_emit_ldloc (mb, size_var.53);
  if (atype == 0) goto <D.20208>; else goto <D.20211>;
  <D.20211>:
  if (atype == 2) goto <D.20208>; else goto <D.20209>;
  <D.20208>:
  mono_mb_emit_icall (mb, mono_gc_alloc_obj);
  goto <D.20210>;
  <D.20209>:
  if (atype == 1) goto <D.20212>; else goto <D.20213>;
  <D.20212>:
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icall (mb, mono_gc_alloc_vector);
  goto <D.20214>;
  <D.20213>:
  if (atype == 3) goto <D.20215>; else goto <D.20216>;
  <D.20215>:
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icall (mb, mono_gc_alloc_string);
  goto <D.20217>;
  <D.20216>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "sgen-alloc.c", 898);
  <D.20217>:
  <D.20214>:
  <D.20210>:
  mono_mb_emit_byte (mb, 42);
  mono_mb_patch_short_branch (mb, slowpath_branch);
  tlab_next_addr_var.56 = (unsigned int) tlab_next_addr_var;
  mono_mb_emit_ldloc (mb, tlab_next_addr_var.56);
  new_next_var.58 = (unsigned int) new_next_var;
  mono_mb_emit_ldloc (mb, new_next_var.58);
  mono_mb_emit_byte (mb, 223);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 16, 0B);
  p_var.57 = (unsigned int) p_var;
  mono_mb_emit_ldloc (mb, p_var.57);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 223);
  if (atype == 1) goto <D.20218>; else goto <D.20219>;
  <D.20218>:
  p_var.57 = (unsigned int) p_var;
  mono_mb_emit_ldloc (mb, p_var.57);
  mono_mb_emit_ldflda (mb, 24);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_byte (mb, 84);
  goto <D.20220>;
  <D.20219>:
  if (atype == 3) goto <D.20221>; else goto <D.20222>;
  <D.20221>:
  p_var.57 = (unsigned int) p_var;
  mono_mb_emit_ldloc (mb, p_var.57);
  mono_mb_emit_icon (mb, 16);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_byte (mb, 84);
  p_var.57 = (unsigned int) p_var;
  mono_mb_emit_ldloc (mb, p_var.57);
  size_var.53 = (unsigned int) size_var;
  mono_mb_emit_ldloc (mb, size_var.53);
  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.20222>:
  <D.20220>:
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_op (mb, 16, 0B);
  p_var.57 = (unsigned int) p_var;
  mono_mb_emit_ldloc (mb, p_var.57);
  mono_mb_emit_byte (mb, 42);
  res = mono_mb_create_method (mb, csig, 8);
  mono_mb_free (mb);
  D.20223 = mono_method_get_header (res);
  D.20223->init_locals = 0;
  D.20144 = mono_defaults.corlib;
  info = mono_image_alloc0 (D.20144, 16);
  info->gc_name = "sgen";
  info->alloc_type = atype;
  mono_marshal_set_wrapper_info (res, info);
  D.20224 = res;
  return D.20224;
}


mono_memory_barrier ()
{
  __sync_synchronize ();
}


__attribute__((visibility ("hidden")))
mono_gc_get_managed_allocator_types ()
{
  guint32 D.20226;

  D.20226 = 4;
  return D.20226;
}


sgen_is_managed_allocator (struct MonoMethod * method)
{
  struct MonoMethod * D.20228;
  gboolean D.20231;
  int i;

  i = 0;
  goto <D.19615>;
  <D.19614>:
  D.20228 = alloc_method_cache[i];
  if (D.20228 == method) goto <D.20229>; else goto <D.20230>;
  <D.20229>:
  D.20231 = 1;
  return D.20231;
  <D.20230>:
  i = i + 1;
  <D.19615>:
  if (i <= 3) goto <D.19614>; else goto <D.19616>;
  <D.19616>:
  D.20231 = 0;
  return D.20231;
}


sgen_has_managed_allocator ()
{
  struct MonoMethod * D.20233;
  gboolean D.20236;
  int i;

  i = 0;
  goto <D.19622>;
  <D.19621>:
  D.20233 = alloc_method_cache[i];
  if (D.20233 != 0B) goto <D.20234>; else goto <D.20235>;
  <D.20234>:
  D.20236 = 1;
  return D.20236;
  <D.20235>:
  i = i + 1;
  <D.19622>:
  if (i <= 3) goto <D.19621>; else goto <D.19623>;
  <D.19623>:
  D.20236 = 0;
  return D.20236;
}


