sgen_fragment_allocator_alloc ()
{
  struct SgenFragment * fragment_freelist.0;
  struct SgenFragment * D.21716;
  struct SgenFragment * frag;

  frag = fragment_freelist;
  if (frag != 0B) goto <D.21713>; else goto <D.21714>;
  <D.21713>:
  fragment_freelist.0 = frag->next_in_order;
  fragment_freelist = fragment_freelist.0;
  frag->next_in_order = 0B;
  fragment_freelist.0 = frag->next_in_order;
  frag->next = fragment_freelist.0;
  D.21716 = frag;
  return D.21716;
  <D.21714>:
  frag = sgen_alloc_internal (1);
  frag->next_in_order = 0B;
  fragment_freelist.0 = frag->next_in_order;
  frag->next = fragment_freelist.0;
  D.21716 = frag;
  return D.21716;
}


sgen_fragment_allocator_add (struct SgenFragmentAllocator * allocator, char * start, char * end)
{
  struct SgenFragment * D.21718;
  void * D.21719;
  struct SgenFragment * D.21720;
  struct SgenFragment * D.21721;
  char * D.21722;
  char * D.21723;
  _Bool D.21724;
  long int D.21725;
  long int D.21726;
  struct SgenFragment * fragment;

  fragment = sgen_fragment_allocator_alloc ();
  fragment->fragment_start = start;
  fragment->fragment_next = start;
  fragment->fragment_end = end;
  D.21718 = allocator->region_head;
  D.21719 = unmask (D.21718);
  fragment->next = D.21719;
  D.21720 = fragment->next;
  fragment->next_in_order = D.21720;
  allocator->alloc_head = fragment;
  D.21721 = allocator->alloc_head;
  allocator->region_head = D.21721;
  D.21722 = fragment->fragment_end;
  D.21723 = fragment->fragment_start;
  D.21724 = D.21722 <= D.21723;
  D.21725 = (long int) D.21724;
  D.21726 = __builtin_expect (D.21725, 0);
  if (D.21726 != 0) goto <D.21727>; else goto <D.21728>;
  <D.21727>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-nursery-allocator.c", 293, "fragment->fragment_end > fragment->fragment_start");
  <D.21728>:
}


unmask (void * p)
{
  void * D.21729;
  unsigned int p.1;
  unsigned int D.21731;

  p.1 = (unsigned int) p;
  D.21731 = p.1 & 4294967292;
  D.21729 = (void *) D.21731;
  return D.21729;
}


sgen_fragment_allocator_release (struct SgenFragmentAllocator * allocator)
{
  struct SgenFragment * D.21735;
  struct SgenFragment * fragment_freelist.2;
  struct SgenFragment * fragment_freelist.3;
  struct SgenFragment * last;

  last = allocator->region_head;
  if (last == 0B) goto <D.21733>; else goto <D.21734>;
  <D.21733>:
  return;
  <D.21734>:
  goto <D.21529>;
  <D.21528>:
  last = last->next_in_order;
  <D.21529>:
  D.21735 = last->next_in_order;
  if (D.21735 != 0B) goto <D.21528>; else goto <D.21530>;
  <D.21530>:
  fragment_freelist.2 = fragment_freelist;
  last->next_in_order = fragment_freelist.2;
  fragment_freelist.3 = allocator->region_head;
  fragment_freelist = fragment_freelist.3;
  allocator->region_head = 0B;
  fragment_freelist.3 = allocator->region_head;
  allocator->alloc_head = fragment_freelist.3;
}


sgen_fragment_allocator_par_alloc (struct SgenFragmentAllocator * allocator, size_t size)
{
  struct SgenFragment * D.21739;
  char * D.21740;
  int D.21741;
  char * D.21742;
  int D.21743;
  int D.21744;
  unsigned int D.21745;
  void * D.21749;
  struct SgenFragment * D.21750;
  void * D.21751;
  struct SgenFragment * frag;
  void restart = <<< error >>>;

  restart:
  D.21739 = allocator->alloc_head;
  frag = unmask (D.21739);
  goto <D.21571>;
  <D.21570>:
  D.21740 = frag->fragment_end;
  D.21741 = (int) D.21740;
  D.21742 = frag->fragment_next;
  D.21743 = (int) D.21742;
  D.21744 = D.21741 - D.21743;
  D.21745 = (unsigned int) D.21744;
  if (D.21745 >= size) goto <D.21746>; else goto <D.21747>;
  <D.21746>:
  {
    void * p;

    p = par_alloc_from_fragment (allocator, frag, size);
    if (p == 0B) goto restart; else goto <D.21748>;
    <D.21748>:
    D.21749 = p;
    return D.21749;
  }
  <D.21747>:
  D.21750 = frag->next;
  frag = unmask (D.21750);
  <D.21571>:
  D.21751 = unmask (frag);
  if (D.21751 != 0B) goto <D.21570>; else goto <D.21572>;
  <D.21572>:
  D.21749 = 0B;
  return D.21749;
}


par_alloc_from_fragment (struct SgenFragmentAllocator * allocator, struct SgenFragment * frag, size_t size)
{
  char * D.21753;
  void * D.21756;
  char * * D.21757;
  void * D.21758;
  int D.21761;
  int end.4;
  int D.21763;
  <unnamed type> D.21766;
  int D.21769;
  unsigned int D.21772;
  struct SgenFragment * * D.21775;
  void * D.21776;
  void * D.21777;
  void * D.21780;
  char * p;
  char * end;

  p = frag->fragment_next;
  end = p + size;
  D.21753 = frag->fragment_end;
  if (D.21753 < end) goto <D.21754>; else goto <D.21755>;
  <D.21754>:
  D.21756 = 0B;
  return D.21756;
  <D.21755>:
  mono_memory_barrier ();
  D.21757 = &frag->fragment_next;
  D.21758 = InterlockedCompareExchangePointer (D.21757, end, p);
  if (D.21758 != p) goto <D.21759>; else goto <D.21760>;
  <D.21759>:
  D.21756 = 0B;
  return D.21756;
  <D.21760>:
  D.21753 = frag->fragment_end;
  D.21761 = (int) D.21753;
  end.4 = (int) end;
  D.21763 = D.21761 - end.4;
  if (D.21763 <= 511) goto <D.21764>; else goto <D.21765>;
  <D.21764>:
  {
    struct SgenFragment * next;
    struct SgenFragment * * prev_ptr;

    D.21766 = sgen_get_nursery_clear_policy ();
    if (D.21766 == 1) goto <D.21767>; else goto <D.21768>;
    <D.21767>:
    D.21769 = claim_remaining_size (frag, end);
    if (D.21769 != 0) goto <D.21770>; else goto <D.21771>;
    <D.21770>:
    D.21753 = frag->fragment_end;
    sgen_clear_range (end, D.21753);
    <D.21771>:
    <D.21768>:
    prev_ptr = find_previous_pointer_fragment (allocator, frag);
    goto <D.21553>;
    <D.21555>:
    next = frag->next;
    D.21772 = get_mark (next);
    if (D.21772 == 0) goto <D.21773>; else goto <D.21774>;
    <D.21773>:
    mono_memory_write_barrier ();
    D.21775 = &frag->next;
    D.21776 = mask (next, 1);
    D.21777 = InterlockedCompareExchangePointer (D.21775, D.21776, next);
    if (D.21777 != next) goto <D.21778>; else goto <D.21779>;
    <D.21778>:
    // predicted unlikely by continue predictor.
    goto <D.21553>;
    <D.21779>:
    <D.21774>:
    mono_memory_write_barrier ();
    D.21780 = InterlockedCompareExchangePointer (prev_ptr, next, frag);
    if (D.21780 != frag) goto <D.21781>; else goto <D.21782>;
    <D.21781>:
    prev_ptr = find_previous_pointer_fragment (allocator, frag);
    // predicted unlikely by continue predictor.
    goto <D.21553>;
    <D.21782>:
    goto <D.21554>;
    <D.21553>:
    if (prev_ptr != 0B) goto <D.21555>; else goto <D.21554>;
    <D.21554>:
  }
  <D.21765>:
  D.21756 = p;
  return D.21756;
}


mono_memory_barrier ()
{
  __sync_synchronize ();
}


claim_remaining_size (struct SgenFragment * frag, char * alloc_end)
{
  char * D.21784;
  gboolean D.21787;
  char * * D.21788;
  void * D.21789;
  _Bool D.21790;

  D.21784 = frag->fragment_end;
  if (D.21784 <= alloc_end) goto <D.21785>; else goto <D.21786>;
  <D.21785>:
  D.21787 = 0;
  return D.21787;
  <D.21786>:
  D.21788 = &frag->fragment_next;
  D.21784 = frag->fragment_end;
  D.21789 = InterlockedCompareExchangePointer (D.21788, D.21784, alloc_end);
  D.21790 = D.21789 == alloc_end;
  D.21787 = (gboolean) D.21790;
  return D.21787;
}


get_mark (void * n)
{
  uintptr_t D.21792;
  unsigned int n.5;

  n.5 = (unsigned int) n;
  D.21792 = n.5 & 1;
  return D.21792;
}


mask (void * n, uintptr_t bit)
{
  void * D.21795;
  unsigned int n.6;
  unsigned int D.21797;

  n.6 = (unsigned int) n;
  D.21797 = n.6 | bit;
  D.21795 = (void *) D.21797;
  return D.21795;
}


mono_memory_write_barrier ()
{
  mono_memory_barrier ();
}


InterlockedCompareExchangePointer (void * volatile * dest, void * exch, void * comp)
{
  void * D.21799;
  unsigned int comp.7;
  unsigned int exch.8;
  unsigned int D.21802;

  comp.7 = (unsigned int) comp;
  exch.8 = (unsigned int) exch;
  D.21802 = __sync_val_compare_and_swap_4 (dest, comp.7, exch.8);
  D.21799 = (void *) D.21802;
  return D.21799;
}


find_previous_pointer_fragment (struct SgenFragmentAllocator * allocator, struct SgenFragment * frag)
{
  struct SgenFragment * D.21804;
  struct SgenFragment * * D.21807;
  unsigned int D.21809;
  void * D.21815;
  struct SgenFragment * * prev;
  struct SgenFragment * cur;
  struct SgenFragment * next;
  void try_again = <<< error >>>;

  try_again:
  prev = &allocator->alloc_head;
  D.21804 = *prev;
  cur = unmask (D.21804);
  <D.21539>:
  if (cur == 0B) goto <D.21805>; else goto <D.21806>;
  <D.21805>:
  D.21807 = 0B;
  return D.21807;
  <D.21806>:
  next = cur->next;
  mono_memory_read_barrier ();
  D.21804 = *prev;
  if (D.21804 != cur) goto try_again; else goto <D.21808>;
  <D.21808>:
  D.21809 = get_mark (next);
  if (D.21809 == 0) goto <D.21810>; else goto <D.21811>;
  <D.21810>:
  if (cur == frag) goto <D.21812>; else goto <D.21813>;
  <D.21812>:
  D.21807 = prev;
  return D.21807;
  <D.21813>:
  prev = &cur->next;
  goto <D.21814>;
  <D.21811>:
  next = unmask (next);
  D.21815 = InterlockedCompareExchangePointer (prev, next, cur);
  if (D.21815 != cur) goto try_again; else goto <D.21816>;
  <D.21816>:
  mono_memory_write_barrier ();
  <D.21814>:
  cur = mono_lls_pointer_unmask (next);
  goto <D.21539>;
  D.21807 = 0B;
  return D.21807;
}


mono_memory_read_barrier ()
{
  mono_memory_barrier ();
}


mono_lls_pointer_unmask (void * p)
{
  void * D.21818;
  unsigned int p.9;
  unsigned int D.21820;

  p.9 = (unsigned int) p;
  D.21820 = p.9 & 4294967292;
  D.21818 = (void *) D.21820;
  return D.21818;
}


sgen_fragment_allocator_serial_alloc (struct SgenFragmentAllocator * allocator, size_t size)
{
  void * D.21824;
  struct SgenFragment * frag;
  struct SgenFragment * * previous;

  previous = &allocator->alloc_head;
  frag = *previous;
  goto <D.21581>;
  <D.21580>:
  {
    char * p;

    p = serial_alloc_from_fragment (previous, frag, size);
    if (p != 0B) goto <D.21822>; else goto <D.21823>;
    <D.21822>:
    D.21824 = p;
    return D.21824;
    <D.21823>:
    previous = &frag->next;
  }
  frag = *previous;
  <D.21581>:
  if (frag != 0B) goto <D.21580>; else goto <D.21582>;
  <D.21582>:
  D.21824 = 0B;
  return D.21824;
}


serial_alloc_from_fragment (struct SgenFragment * * previous, struct SgenFragment * frag, size_t size)
{
  char * D.21826;
  void * D.21829;
  int D.21830;
  int end.10;
  int D.21832;
  struct SgenFragment * D.21835;
  unsigned int D.21836;
  char * p;
  char * end;

  p = frag->fragment_next;
  end = p + size;
  D.21826 = frag->fragment_end;
  if (D.21826 < end) goto <D.21827>; else goto <D.21828>;
  <D.21827>:
  D.21829 = 0B;
  return D.21829;
  <D.21828>:
  frag->fragment_next = end;
  D.21826 = frag->fragment_end;
  D.21830 = (int) D.21826;
  end.10 = (int) end;
  D.21832 = D.21830 - end.10;
  if (D.21832 <= 511) goto <D.21833>; else goto <D.21834>;
  <D.21833>:
  D.21835 = frag->next;
  *previous = D.21835;
  D.21826 = frag->fragment_end;
  D.21830 = (int) D.21826;
  end.10 = (int) end;
  D.21832 = D.21830 - end.10;
  D.21836 = (unsigned int) D.21832;
  memset (end, 0, D.21836);
  D.21835 = frag->next;
  *previous = D.21835;
  <D.21834>:
  D.21829 = p;
  return D.21829;
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.21840;
  int D.21845;
  void * D.21847;
  unsigned int D.21848;

  D.21840 = __builtin_constant_p (__len);
  if (D.21840 != 0) goto <D.21841>; else goto <D.21842>;
  <D.21841>:
  if (__len == 0) goto <D.21843>; else goto <D.21844>;
  <D.21843>:
  D.21845 = __builtin_constant_p (__ch);
  if (D.21845 == 0) goto <D.21838>; else goto <D.21846>;
  <D.21846>:
  if (__ch != 0) goto <D.21838>; else goto <D.21839>;
  <D.21838>:
  __warn_memset_zero_len ();
  D.21847 = __dest;
  return D.21847;
  <D.21839>:
  <D.21844>:
  <D.21842>:
  D.21848 = __builtin_object_size (__dest, 0);
  D.21847 = __builtin___memset_chk (__dest, __ch, __len, D.21848);
  return D.21847;
}


sgen_fragment_allocator_serial_range_alloc (struct SgenFragmentAllocator * allocator, size_t desired_size, size_t minimum_size, size_t * out_alloc_size)
{
  char * D.21850;
  int D.21851;
  char * D.21852;
  int D.21853;
  int D.21854;
  void * D.21857;
  char * D.21862;
  int D.21863;
  char * D.21864;
  int D.21865;
  int D.21866;
  struct SgenFragment * frag;
  struct SgenFragment * * previous;
  struct SgenFragment * min_frag;
  struct SgenFragment * * prev_min_frag;
  size_t current_minimum;

  min_frag = 0B;
  prev_min_frag = 0B;
  current_minimum = minimum_size;
  previous = &allocator->alloc_head;
  frag = *previous;
  goto <D.21597>;
  <D.21596>:
  {
    size_t frag_size;

    D.21850 = frag->fragment_end;
    D.21851 = (int) D.21850;
    D.21852 = frag->fragment_next;
    D.21853 = (int) D.21852;
    D.21854 = D.21851 - D.21853;
    frag_size = (size_t) D.21854;
    if (desired_size <= frag_size) goto <D.21855>; else goto <D.21856>;
    <D.21855>:
    {
      void * p;

      *out_alloc_size = desired_size;
      p = serial_alloc_from_fragment (previous, frag, desired_size);
      D.21857 = p;
      return D.21857;
    }
    <D.21856>:
    if (current_minimum <= frag_size) goto <D.21858>; else goto <D.21859>;
    <D.21858>:
    min_frag = frag;
    prev_min_frag = previous;
    current_minimum = frag_size;
    <D.21859>:
    previous = &frag->next;
  }
  frag = *previous;
  <D.21597>:
  if (frag != 0B) goto <D.21596>; else goto <D.21598>;
  <D.21598>:
  if (min_frag != 0B) goto <D.21860>; else goto <D.21861>;
  <D.21860>:
  {
    void * p;
    size_t frag_size;

    D.21862 = min_frag->fragment_end;
    D.21863 = (int) D.21862;
    D.21864 = min_frag->fragment_next;
    D.21865 = (int) D.21864;
    D.21866 = D.21863 - D.21865;
    frag_size = (size_t) D.21866;
    *out_alloc_size = frag_size;
    p = serial_alloc_from_fragment (prev_min_frag, min_frag, frag_size);
    D.21857 = p;
    return D.21857;
  }
  <D.21861>:
  D.21857 = 0B;
  return D.21857;
}


sgen_fragment_allocator_par_range_alloc (struct SgenFragmentAllocator * allocator, size_t desired_size, size_t minimum_size, size_t * out_alloc_size)
{
  struct SgenFragment * D.21868;
  char * D.21869;
  int D.21870;
  char * D.21871;
  int D.21872;
  unsigned int frag_size.11;
  void * D.21877;
  struct SgenFragment * D.21880;
  char * D.21883;
  int D.21884;
  char * D.21885;
  int D.21886;
  unsigned int frag_size.12;
  struct SgenFragment * frag;
  struct SgenFragment * min_frag;
  size_t current_minimum;
  void restart = <<< error >>>;

  restart:
  min_frag = 0B;
  current_minimum = minimum_size;
  D.21868 = allocator->alloc_head;
  frag = unmask (D.21868);
  goto <D.21614>;
  <D.21613>:
  {
    int frag_size;

    D.21869 = frag->fragment_end;
    D.21870 = (int) D.21869;
    D.21871 = frag->fragment_next;
    D.21872 = (int) D.21871;
    frag_size = D.21870 - D.21872;
    frag_size.11 = (unsigned int) frag_size;
    if (frag_size.11 >= desired_size) goto <D.21874>; else goto <D.21875>;
    <D.21874>:
    {
      void * p;

      *out_alloc_size = desired_size;
      p = par_alloc_from_fragment (allocator, frag, desired_size);
      if (p == 0B) goto restart; else goto <D.21876>;
      <D.21876>:
      D.21877 = p;
      return D.21877;
    }
    <D.21875>:
    frag_size.11 = (unsigned int) frag_size;
    if (frag_size.11 >= current_minimum) goto <D.21878>; else goto <D.21879>;
    <D.21878>:
    min_frag = frag;
    current_minimum = (size_t) frag_size;
    <D.21879>:
  }
  D.21880 = frag->next;
  frag = unmask (D.21880);
  <D.21614>:
  if (frag != 0B) goto <D.21613>; else goto <D.21615>;
  <D.21615>:
  mono_memory_barrier ();
  if (min_frag != 0B) goto <D.21881>; else goto <D.21882>;
  <D.21881>:
  {
    void * p;
    int frag_size;

    D.21883 = min_frag->fragment_end;
    D.21884 = (int) D.21883;
    D.21885 = min_frag->fragment_next;
    D.21886 = (int) D.21885;
    frag_size = D.21884 - D.21886;
    frag_size.12 = (unsigned int) frag_size;
    if (frag_size.12 < minimum_size) goto restart; else goto <D.21888>;
    <D.21888>:
    frag_size.12 = (unsigned int) frag_size;
    *out_alloc_size = frag_size.12;
    mono_memory_barrier ();
    frag_size.12 = (unsigned int) frag_size;
    p = par_alloc_from_fragment (allocator, min_frag, frag_size.12);
    if (p == 0B) goto restart; else goto <D.21889>;
    <D.21889>:
    D.21877 = p;
    return D.21877;
  }
  <D.21882>:
  D.21877 = 0B;
  return D.21877;
}


sgen_clear_allocator_fragments (struct SgenFragmentAllocator * allocator)
{
  struct SgenFragment * D.21891;
  struct FILE * gc_debug_file.13;
  char * D.21895;
  char * D.21896;
  struct SgenFragment * D.21897;
  struct SgenFragment * frag;

  D.21891 = allocator->alloc_head;
  frag = unmask (D.21891);
  goto <D.21623>;
  <D.21622>:
  if (0 != 0) goto <D.21892>; else goto <D.21893>;
  <D.21892>:
  gc_debug_file.13 = gc_debug_file;
  D.21895 = frag->fragment_next;
  D.21896 = frag->fragment_end;
  fprintf (gc_debug_file.13, "Clear nursery frag %p-%p\n", D.21895, D.21896);
  gc_debug_file.13 = gc_debug_file;
  fflush (gc_debug_file.13);
  <D.21893>:
  D.21895 = frag->fragment_next;
  D.21896 = frag->fragment_end;
  sgen_clear_range (D.21895, D.21896);
  D.21897 = frag->next;
  frag = unmask (D.21897);
  <D.21623>:
  if (frag != 0B) goto <D.21622>; else goto <D.21624>;
  <D.21624>:
}


sgen_clear_nursery_fragments ()
{
  <unnamed type> D.21898;
  void (*<T11c0>) (void) D.21901;

  D.21898 = sgen_get_nursery_clear_policy ();
  if (D.21898 == 1) goto <D.21899>; else goto <D.21900>;
  <D.21899>:
  sgen_clear_allocator_fragments (&mutator_allocator);
  D.21901 = sgen_minor_collector.clear_fragments;
  D.21901 ();
  <D.21900>:
}


sgen_clear_range (char * start, char * end)
{
  int end.14;
  int start.15;
  int D.21904;
  _Bool D.21907;
  _Bool D.21908;
  _Bool D.21909;
  struct MonoVTable * D.21913;
  unsigned int D.21914;
  unsigned int D.21915;
  char * D.21916;
  _Bool D.21917;
  long int D.21918;
  long int D.21919;
  struct MonoArray * o;
  size_t size;

  end.14 = (int) end;
  start.15 = (int) start;
  D.21904 = end.14 - start.15;
  size = (size_t) D.21904;
  D.21907 = start != 0B;
  D.21908 = end == 0B;
  D.21909 = D.21907 & D.21908;
  if (D.21909 != 0) goto <D.21905>; else goto <D.21910>;
  <D.21910>:
  if (start > end) goto <D.21905>; else goto <D.21906>;
  <D.21905>:
  monoeg_g_log (0B, 4, "Invalid range [%p %p]", start, end);
  <D.21634>:
  goto <D.21634>;
  <D.21906>:
  if (size <= 15) goto <D.21911>; else goto <D.21912>;
  <D.21911>:
  memset (start, 0, size);
  return;
  <D.21912>:
  o = start;
  D.21913 = sgen_get_array_fill_vtable ();
  o->obj.vtable = D.21913;
  o->obj.synchronisation = 4294967295B;
  o->bounds = 0B;
  D.21914 = size + 4294967280;
  o->max_length = D.21914;
  sgen_set_nursery_scan_start (start);
  D.21915 = sgen_safe_object_get_size (o);
  D.21916 = start + D.21915;
  D.21917 = D.21916 != end;
  D.21918 = (long int) D.21917;
  D.21919 = __builtin_expect (D.21918, 0);
  if (D.21919 != 0) goto <D.21920>; else goto <D.21921>;
  <D.21920>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-nursery-allocator.c", 690, "start + sgen_safe_object_get_size ((MonoObject*)o) == end");
  <D.21921>:
}


sgen_set_nursery_scan_start (char * p)
{
  int p.16;
  struct GCMemSection * nursery_section.17;
  char * D.21925;
  int D.21926;
  int D.21927;
  char * * D.21928;
  unsigned int idx.18;
  unsigned int D.21930;
  char * * D.21931;
  _Bool D.21932;
  _Bool D.21933;
  _Bool D.21934;
  int idx;
  char * old;

  p.16 = (int) p;
  nursery_section.17 = nursery_section;
  D.21925 = nursery_section.17->data;
  D.21926 = (int) D.21925;
  D.21927 = p.16 - D.21926;
  idx = D.21927 / 8192;
  nursery_section.17 = nursery_section;
  D.21928 = nursery_section.17->scan_starts;
  idx.18 = (unsigned int) idx;
  D.21930 = idx.18 * 4;
  D.21931 = D.21928 + D.21930;
  old = *D.21931;
  D.21932 = old == 0B;
  D.21933 = old > p;
  D.21934 = D.21932 | D.21933;
  if (D.21934 != 0) goto <D.21935>; else goto <D.21936>;
  <D.21935>:
  nursery_section.17 = nursery_section;
  D.21928 = nursery_section.17->scan_starts;
  idx.18 = (unsigned int) idx;
  D.21930 = idx.18 * 4;
  D.21931 = D.21928 + D.21930;
  *D.21931 = p;
  <D.21936>:
}


sgen_safe_object_get_size (struct MonoObject * obj)
{
  char * iftmp.19;
  unsigned int D.21938;
  unsigned int D.21939;
  unsigned int D.21942;
  guint D.21946;
  struct MonoVTable * D.21947;
  char * forwarded;

  D.21938 = MEM[(mword *)obj];
  D.21939 = D.21938 & 1;
  if (D.21939 != 0) goto <D.21940>; else goto <D.21941>;
  <D.21940>:
  D.21938 = MEM[(mword *)obj];
  D.21942 = D.21938 & 4294967292;
  iftmp.19 = (char *) D.21942;
  goto <D.21943>;
  <D.21941>:
  iftmp.19 = 0B;
  <D.21943>:
  forwarded = iftmp.19;
  if (forwarded != 0B) goto <D.21944>; else goto <D.21945>;
  <D.21944>:
  obj = forwarded;
  <D.21945>:
  D.21938 = MEM[(mword *)obj];
  D.21942 = D.21938 & 4294967292;
  D.21947 = (struct MonoVTable *) D.21942;
  D.21946 = sgen_par_object_get_size (D.21947, obj);
  return D.21946;
}


sgen_par_object_get_size (struct MonoVTable * vtable, struct MonoObject * o)
{
  void * D.21949;
  unsigned int D.21950;
  guint D.21955;
  int D.21956;
  int D.21957;
  unsigned int D.21958;
  unsigned int D.21961;
  int D.21962;
  unsigned int D.21963;
  unsigned int element_size.20;
  unsigned int D.21965;
  unsigned int D.21966;
  struct MonoClass * D.21969;
  unsigned char D.21970;
  unsigned int D.21971;
  unsigned int D.21972;
  mword descr;
  mword type;

  D.21949 = vtable->gc_descr;
  descr = (mword) D.21949;
  type = descr & 7;
  D.21950 = type + 4294967295;
  if (D.21950 <= 1) goto <D.21951>; else goto <D.21952>;
  <D.21951>:
  {
    mword size;

    size = descr & 65528;
    if (size == 0) goto <D.21953>; else goto <D.21954>;
    <D.21953>:
    D.21956 = MEM[(struct MonoString *)o].length;
    D.21957 = D.21956 * 2;
    D.21958 = (unsigned int) D.21957;
    D.21955 = D.21958 + 14;
    return D.21955;
    <D.21954>:
    D.21955 = size;
    return D.21955;
  }
  <D.21952>:
  if (type == 4) goto <D.21959>; else goto <D.21960>;
  <D.21959>:
  {
    int element_size;
    struct MonoArray * array;
    size_t size;

    D.21961 = descr >> 3;
    D.21962 = (int) D.21961;
    element_size = D.21962 & 1023;
    array = o;
    D.21963 = array->max_length;
    element_size.20 = (unsigned int) element_size;
    D.21965 = D.21963 * element_size.20;
    size = D.21965 + 16;
    D.21966 = descr & 8192;
    if (D.21966 != 0) goto <D.21967>; else goto <D.21968>;
    <D.21967>:
    size = size + 3;
    size = size & 4294967292;
    D.21969 = vtable->klass;
    D.21970 = D.21969->rank;
    D.21971 = (unsigned int) D.21970;
    D.21972 = D.21971 * 8;
    size = D.21972 + size;
    <D.21968>:
    D.21955 = size;
    return D.21955;
  }
  <D.21960>:
  D.21955 = slow_object_get_size (vtable, o);
  return D.21955;
}


slow_object_get_size (struct MonoVTable * vtable, struct MonoObject * o)
{
  struct MonoClass * D.21974;
  guint D.21977;
  int D.21978;
  int D.21979;
  unsigned int D.21980;
  unsigned char D.21981;
  int D.21984;
  unsigned int D.21985;
  unsigned int D.21986;
  unsigned int D.21987;
  struct MonoArrayBounds * D.21988;
  _Bool D.21989;
  long int D.21990;
  long int D.21991;
  unsigned int D.21994;
  unsigned int D.21995;
  int D.21996;
  struct MonoClass * klass;

  klass = vtable->klass;
  D.21974 = mono_defaults.string_class;
  if (D.21974 == klass) goto <D.21975>; else goto <D.21976>;
  <D.21975>:
  D.21978 = MEM[(struct MonoString *)o].length;
  D.21979 = D.21978 * 2;
  D.21980 = (unsigned int) D.21979;
  D.21977 = D.21980 + 14;
  return D.21977;
  <D.21976>:
  D.21981 = klass->rank;
  if (D.21981 != 0) goto <D.21982>; else goto <D.21983>;
  <D.21982>:
  {
    struct MonoArray * array;
    size_t size;

    array = o;
    D.21984 = klass->sizes.element_size;
    D.21985 = (unsigned int) D.21984;
    D.21986 = array->max_length;
    D.21987 = D.21985 * D.21986;
    size = D.21987 + 16;
    D.21988 = array->bounds;
    D.21989 = D.21988 != 0B;
    D.21990 = (long int) D.21989;
    D.21991 = __builtin_expect (D.21990, 0);
    if (D.21991 != 0) goto <D.21992>; else goto <D.21993>;
    <D.21992>:
    size = size + 3;
    size = size & 4294967292;
    D.21981 = klass->rank;
    D.21994 = (unsigned int) D.21981;
    D.21995 = D.21994 * 8;
    size = D.21995 + size;
    <D.21993>:
    D.21977 = size;
    return D.21977;
  }
  <D.21983>:
  D.21996 = klass->instance_size;
  D.21977 = (guint) D.21996;
  return D.21977;
}


sgen_nursery_allocator_prepare_for_pinning ()
{
  void (*<T11c0>) (void) D.21998;

  sgen_clear_allocator_fragments (&mutator_allocator);
  D.21998 = sgen_minor_collector.clear_fragments;
  D.21998 ();
}


sgen_build_nursery_fragments (struct GCMemSection * nursery_section, void * * start, int num_entries, struct SgenGrayQueue * unpin_queue)
{
  struct SgenFragment * (*<T3675>) (void) D.21999;
  char * * D.22000;
  unsigned int D.22001;
  unsigned int D.22002;
  unsigned int i.21;
  unsigned int D.22006;
  void * * D.22007;
  int iftmp.22;
  struct GrayQueueSection * D.22018;
  int D.22020;
  _Bool D.22021;
  long int D.22022;
  long int D.22023;
  int D.22027;
  int D.22028;
  unsigned int D.22030;
  unsigned int D.22031;
  unsigned int D.22032;
  unsigned int D.22033;
  char * D.22035;
  int D.22036;
  int addr1.23;
  int D.22038;
  int frag_end.24;
  int frag_start.25;
  int D.22041;
  _Bool D.22046;
  long int D.22047;
  long int D.22048;
  _Bool D.22051;
  _Bool D.22052;
  _Bool D.22053;
  _Bool D.22056;
  _Bool D.22057;
  _Bool D.22058;
  void (*<T11c0>) (void) D.22061;
  void (*<T367a>) (struct SgenFragmentAllocator *) D.22062;
  struct SgenFragment * D.22063;
  void * D.22064;
  int gc_debug_level.26;
  _Bool D.22068;
  long int D.22069;
  long int D.22070;
  struct FILE * gc_debug_file.27;
  void * D.22076;
  const char * D.22077;
  unsigned int D.22078;
  mword D.22079;
  char * frag_start;
  char * frag_end;
  size_t frag_size;
  int i;
  struct SgenFragment * frags_ranges;

  i = 0;
  sgen_fragment_allocator_release (&mutator_allocator);
  frag_start = sgen_nursery_start;
  fragment_total = 0;
  D.21999 = sgen_minor_collector.build_fragments_get_exclude_head;
  frags_ranges = D.21999 ();
  D.22000 = nursery_section->scan_starts;
  D.22001 = nursery_section->num_scan_start;
  D.22002 = D.22001 * 4;
  memset (D.22000, 0, D.22002);
  goto <D.21669>;
  <D.21670>:
  {
    char * addr0;
    char * addr1;
    size_t size;
    struct SgenFragment * last_frag;

    last_frag = 0B;
    addr1 = sgen_nursery_end;
    addr0 = addr1;
    if (i < num_entries) goto <D.22003>; else goto <D.22004>;
    <D.22003>:
    i.21 = (unsigned int) i;
    D.22006 = i.21 * 4;
    D.22007 = start + D.22006;
    addr0 = *D.22007;
    <D.22004>:
    if (frags_ranges != 0B) goto <D.22008>; else goto <D.22009>;
    <D.22008>:
    addr1 = frags_ranges->fragment_start;
    <D.22009>:
    if (addr0 < addr1) goto <D.22010>; else goto <D.22011>;
    <D.22010>:
    if (unpin_queue != 0B) goto <D.22012>; else goto <D.22013>;
    <D.22012>:
    D.22018 = unpin_queue->first;
    if (D.22018 == 0B) goto <D.22015>; else goto <D.22019>;
    <D.22019>:
    D.22018 = unpin_queue->first;
    D.22020 = D.22018->end;
    if (D.22020 == 125) goto <D.22015>; else goto <D.22016>;
    <D.22015>:
    iftmp.22 = 1;
    goto <D.22017>;
    <D.22016>:
    iftmp.22 = 0;
    <D.22017>:
    D.22021 = iftmp.22 != 0;
    D.22022 = (long int) D.22021;
    D.22023 = __builtin_expect (D.22022, 0);
    if (D.22023 != 0) goto <D.22024>; else goto <D.22025>;
    <D.22024>:
    sgen_gray_object_enqueue (unpin_queue, addr0);
    goto <D.22026>;
    <D.22025>:
    D.22018 = unpin_queue->first;
    D.22018 = unpin_queue->first;
    D.22020 = D.22018->end;
    D.22027 = D.22020;
    D.22028 = D.22027 + 1;
    D.22018->end = D.22028;
    D.22018->objects[D.22027] = addr0;
    <D.22026>:
    __builtin_prefetch (addr0);
    goto <D.22029>;
    <D.22013>:
    D.22030 = MEM[(mword *)addr0];
    D.22031 = D.22030 & 4294967293;
    MEM[(mword *)addr0] = D.22031;
    <D.22029>:
    sgen_set_nursery_scan_start (addr0);
    frag_end = addr0;
    D.22032 = sgen_safe_object_get_size (addr0);
    D.22033 = D.22032 + 7;
    size = D.22033 & 4294967288;
    i = i + 1;
    goto <D.22034>;
    <D.22011>:
    frag_end = addr1;
    D.22035 = frags_ranges->fragment_next;
    D.22036 = (int) D.22035;
    addr1.23 = (int) addr1;
    D.22038 = D.22036 - addr1.23;
    size = (size_t) D.22038;
    last_frag = frags_ranges;
    frags_ranges = frags_ranges->next_in_order;
    <D.22034>:
    frag_end.24 = (int) frag_end;
    frag_start.25 = (int) frag_start;
    D.22041 = frag_end.24 - frag_start.25;
    frag_size = (size_t) D.22041;
    if (size == 0) goto <D.22042>; else goto <D.22043>;
    <D.22042>:
    // predicted unlikely by continue predictor.
    goto <D.21669>;
    <D.22043>:
    if (0 != 0) goto <D.22044>; else goto <D.22045>;
    <D.22044>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-nursery-allocator.c", 802, "frag_size >= 0");
    <D.22045>:
    D.22046 = size == 0;
    D.22047 = (long int) D.22046;
    D.22048 = __builtin_expect (D.22047, 0);
    if (D.22048 != 0) goto <D.22049>; else goto <D.22050>;
    <D.22049>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-nursery-allocator.c", 803, "size > 0");
    <D.22050>:
    D.22051 = frag_size != 0;
    D.22052 = size != 0;
    D.22053 = D.22051 & D.22052;
    if (D.22053 != 0) goto <D.22054>; else goto <D.22055>;
    <D.22054>:
    add_nursery_frag (&mutator_allocator, frag_size, frag_start, frag_end);
    <D.22055>:
    frag_size = size;
    frag_start = frag_end + frag_size;
  }
  <D.21669>:
  D.22056 = i < num_entries;
  D.22057 = frags_ranges != 0B;
  D.22058 = D.22056 | D.22057;
  if (D.22058 != 0) goto <D.21670>; else goto <D.21671>;
  <D.21671>:
  nursery_last_pinned_end = frag_start;
  frag_end = sgen_nursery_end;
  frag_end.24 = (int) frag_end;
  frag_start.25 = (int) frag_start;
  D.22041 = frag_end.24 - frag_start.25;
  frag_size = (size_t) D.22041;
  if (frag_size != 0) goto <D.22059>; else goto <D.22060>;
  <D.22059>:
  add_nursery_frag (&mutator_allocator, frag_size, frag_start, frag_end);
  <D.22060>:
  D.22061 = sgen_minor_collector.build_fragments_release_exclude_head;
  D.22061 ();
  fragment_list_reverse (&mutator_allocator);
  D.22062 = sgen_minor_collector.build_fragments_finish;
  D.22062 (&mutator_allocator);
  D.22063 = mutator_allocator.alloc_head;
  D.22064 = unmask (D.22063);
  if (D.22064 == 0B) goto <D.22065>; else goto <D.22066>;
  <D.22065>:
  gc_debug_level.26 = gc_debug_level;
  D.22068 = gc_debug_level.26 > 0;
  D.22069 = (long int) D.22068;
  D.22070 = __builtin_expect (D.22069, 0);
  if (D.22070 != 0) goto <D.22071>; else goto <D.22072>;
  <D.22071>:
  gc_debug_file.27 = gc_debug_file;
  fprintf (gc_debug_file.27, "Nursery fully pinned (%d)\n", num_entries);
  gc_debug_file.27 = gc_debug_file;
  fflush (gc_debug_file.27);
  <D.22072>:
  i = 0;
  goto <D.21673>;
  <D.21672>:
  if (0 != 0) goto <D.22074>; else goto <D.22075>;
  <D.22074>:
  gc_debug_file.27 = gc_debug_file;
  i.21 = (unsigned int) i;
  D.22006 = i.21 * 4;
  D.22007 = start + D.22006;
  D.22076 = *D.22007;
  i.21 = (unsigned int) i;
  D.22006 = i.21 * 4;
  D.22007 = start + D.22006;
  D.22076 = *D.22007;
  D.22077 = sgen_safe_name (D.22076);
  i.21 = (unsigned int) i;
  D.22006 = i.21 * 4;
  D.22007 = start + D.22006;
  D.22076 = *D.22007;
  D.22078 = sgen_safe_object_get_size (D.22076);
  fprintf (gc_debug_file.27, "Bastard pinning obj %p (%s), size: %d\n", D.22076, D.22077, D.22078);
  gc_debug_file.27 = gc_debug_file;
  fflush (gc_debug_file.27);
  <D.22075>:
  i = i + 1;
  <D.21673>:
  if (i < num_entries) goto <D.21672>; else goto <D.21674>;
  <D.21674>:
  <D.22066>:
  D.22079 = fragment_total;
  return D.22079;
}


add_nursery_frag (struct SgenFragmentAllocator * allocator, size_t frag_size, char * frag_start, char * frag_end)
{
  struct FILE * gc_debug_file.28;
  <unnamed type> D.22086;
  unsigned int fragment_total.29;
  unsigned int fragment_total.30;

  if (0 != 0) goto <D.22081>; else goto <D.22082>;
  <D.22081>:
  gc_debug_file.28 = gc_debug_file;
  fprintf (gc_debug_file.28, "Found empty fragment: %p-%p, size: %zd\n", frag_start, frag_end, frag_size);
  gc_debug_file.28 = gc_debug_file;
  fflush (gc_debug_file.28);
  <D.22082>:
  if (frag_size > 511) goto <D.22084>; else goto <D.22085>;
  <D.22084>:
  D.22086 = sgen_get_nursery_clear_policy ();
  if (D.22086 == 0) goto <D.22087>; else goto <D.22088>;
  <D.22087>:
  memset (frag_start, 0, frag_size);
  <D.22088>:
  sgen_fragment_allocator_add (allocator, frag_start, frag_end);
  fragment_total.29 = fragment_total;
  fragment_total.30 = fragment_total.29 + frag_size;
  fragment_total = fragment_total.30;
  goto <D.22091>;
  <D.22085>:
  sgen_clear_range (frag_start, frag_end);
  <D.22091>:
}


fragment_list_reverse (struct SgenFragmentAllocator * allocator)
{
  struct SgenFragment * D.22092;
  struct SgenFragment * prev;
  struct SgenFragment * list;

  prev = 0B;
  list = allocator->region_head;
  goto <D.21652>;
  <D.21651>:
  {
    struct SgenFragment * next;

    next = list->next;
    list->next = prev;
    list->next_in_order = prev;
    prev = list;
    list = next;
  }
  <D.21652>:
  if (list != 0B) goto <D.21651>; else goto <D.21653>;
  <D.21653>:
  allocator->alloc_head = prev;
  D.22092 = allocator->alloc_head;
  allocator->region_head = D.22092;
}


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

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


sgen_nursery_alloc_get_upper_alloc_bound ()
{
  char * D.22095;

  D.22095 = sgen_nursery_end;
  return D.22095;
}


sgen_nursery_retire_region (void * address, ptrdiff_t size)
{

}


sgen_can_alloc_size (size_t size)
{
  unsigned int D.22097;
  struct SgenFragment * D.22098;
  char * D.22099;
  int D.22100;
  char * D.22101;
  int D.22102;
  int D.22103;
  unsigned int D.22104;
  gboolean D.22107;
  struct SgenFragment * D.22108;
  struct SgenFragment * frag;

  D.22097 = size + 7;
  size = D.22097 & 4294967288;
  D.22098 = mutator_allocator.alloc_head;
  frag = unmask (D.22098);
  goto <D.21687>;
  <D.21686>:
  D.22099 = frag->fragment_end;
  D.22100 = (int) D.22099;
  D.22101 = frag->fragment_next;
  D.22102 = (int) D.22101;
  D.22103 = D.22100 - D.22102;
  D.22104 = (unsigned int) D.22103;
  if (D.22104 >= size) goto <D.22105>; else goto <D.22106>;
  <D.22105>:
  D.22107 = 1;
  return D.22107;
  <D.22106>:
  D.22108 = frag->next;
  frag = unmask (D.22108);
  <D.21687>:
  if (frag != 0B) goto <D.21686>; else goto <D.21688>;
  <D.21688>:
  D.22107 = 0;
  return D.22107;
}


sgen_nursery_alloc (size_t size)
{
  struct FILE * gc_debug_file.31;
  unsigned int D.22113;
  void * D.22114;

  if (0 != 0) goto <D.22110>; else goto <D.22111>;
  <D.22110>:
  gc_debug_file.31 = gc_debug_file;
  fprintf (gc_debug_file.31, "Searching nursery for size: %zd\n", size);
  gc_debug_file.31 = gc_debug_file;
  fflush (gc_debug_file.31);
  <D.22111>:
  D.22113 = size + 7;
  size = D.22113 & 4294967288;
  D.22114 = sgen_fragment_allocator_par_alloc (&mutator_allocator, size);
  return D.22114;
}


sgen_nursery_alloc_range (size_t desired_size, size_t minimum_size, size_t * out_alloc_size)
{
  struct FILE * gc_debug_file.32;
  void * D.22119;

  if (0 != 0) goto <D.22116>; else goto <D.22117>;
  <D.22116>:
  gc_debug_file.32 = gc_debug_file;
  fprintf (gc_debug_file.32, "Searching for byte range desired size: %zd minimum size %zd\n", desired_size, minimum_size);
  gc_debug_file.32 = gc_debug_file;
  fflush (gc_debug_file.32);
  <D.22117>:
  D.22119 = sgen_fragment_allocator_par_range_alloc (&mutator_allocator, desired_size, minimum_size, out_alloc_size);
  return D.22119;
}


sgen_init_nursery_allocator ()
{
  sgen_register_fixed_internal_mem_type (1, 20);
}


sgen_nursery_alloc_prepare_for_minor ()
{
  void (*<T3671>) (char *, int) D.22121;
  char * sgen_space_bitmap.33;
  int sgen_space_bitmap_size.34;

  D.22121 = sgen_minor_collector.prepare_to_space;
  sgen_space_bitmap.33 = sgen_space_bitmap;
  sgen_space_bitmap_size.34 = sgen_space_bitmap_size;
  D.22121 (sgen_space_bitmap.33, sgen_space_bitmap_size.34);
}


sgen_nursery_alloc_prepare_for_major ()
{
  void (*<T3671>) (char *, int) D.22124;
  char * sgen_space_bitmap.35;
  int sgen_space_bitmap_size.36;

  D.22124 = sgen_minor_collector.prepare_to_space;
  sgen_space_bitmap.35 = sgen_space_bitmap;
  sgen_space_bitmap_size.36 = sgen_space_bitmap_size;
  D.22124 (sgen_space_bitmap.35, sgen_space_bitmap_size.36);
}


sgen_nursery_allocator_set_nursery_bounds (char * start, char * end)
{
  int end.37;
  int start.38;
  int D.22129;
  int sgen_space_bitmap_size.39;
  int sgen_space_bitmap_size.40;
  unsigned int sgen_space_bitmap_size.41;
  void * sgen_space_bitmap.42;
  void (*<T367e>) (struct SgenFragmentAllocator *, char *, char *) D.22134;

  sgen_nursery_start = start;
  sgen_nursery_end = end;
  end.37 = (int) end;
  start.38 = (int) start;
  D.22129 = end.37 - start.38;
  sgen_space_bitmap_size.39 = D.22129 / 4096;
  sgen_space_bitmap_size = sgen_space_bitmap_size.39;
  sgen_space_bitmap_size.40 = sgen_space_bitmap_size;
  sgen_space_bitmap_size.41 = (unsigned int) sgen_space_bitmap_size.40;
  sgen_space_bitmap.42 = monoeg_malloc0 (sgen_space_bitmap_size.41);
  sgen_space_bitmap = sgen_space_bitmap.42;
  D.22134 = sgen_minor_collector.init_nursery;
  D.22134 (&mutator_allocator, start, end);
}


