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

  frag = fragment_freelist;
  if (frag != 0B) goto <D.20043>; else goto <D.20044>;
  <D.20043>:
  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.20046 = frag;
  return D.20046;
  <D.20044>:
  frag = sgen_alloc_internal (1);
  frag->next_in_order = 0B;
  fragment_freelist.0 = frag->next_in_order;
  frag->next = fragment_freelist.0;
  D.20046 = frag;
  return D.20046;
}


sgen_fragment_allocator_add (struct SgenFragmentAllocator * allocator, char * start, char * end)
{
  struct SgenFragment * D.20048;
  void * D.20049;
  struct SgenFragment * D.20050;
  struct SgenFragment * D.20051;
  char * D.20052;
  char * D.20053;
  _Bool D.20054;
  long int D.20055;
  long int D.20056;
  struct SgenFragment * fragment;

  fragment = sgen_fragment_allocator_alloc ();
  fragment->fragment_start = start;
  fragment->fragment_next = start;
  fragment->fragment_end = end;
  D.20048 = allocator->region_head;
  D.20049 = unmask (D.20048);
  fragment->next = D.20049;
  D.20050 = fragment->next;
  fragment->next_in_order = D.20050;
  allocator->alloc_head = fragment;
  D.20051 = allocator->alloc_head;
  allocator->region_head = D.20051;
  D.20052 = fragment->fragment_end;
  D.20053 = fragment->fragment_start;
  D.20054 = D.20052 <= D.20053;
  D.20055 = (long int) D.20054;
  D.20056 = __builtin_expect (D.20055, 0);
  if (D.20056 != 0) goto <D.20057>; else goto <D.20058>;
  <D.20057>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-nursery-allocator.c", 293, "fragment->fragment_end > fragment->fragment_start");
  <D.20058>:
}


unmask (void * p)
{
  void * D.20059;
  long unsigned int p.1;
  long unsigned int D.20061;

  p.1 = (long unsigned int) p;
  D.20061 = p.1 & 18446744073709551612;
  D.20059 = (void *) D.20061;
  return D.20059;
}


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

  last = allocator->region_head;
  if (last == 0B) goto <D.20063>; else goto <D.20064>;
  <D.20063>:
  return;
  <D.20064>:
  goto <D.19861>;
  <D.19860>:
  last = last->next_in_order;
  <D.19861>:
  D.20065 = last->next_in_order;
  if (D.20065 != 0B) goto <D.19860>; else goto <D.19862>;
  <D.19862>:
  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.20069;
  char * D.20070;
  long int D.20071;
  char * D.20072;
  long int D.20073;
  long int D.20074;
  long unsigned int D.20075;
  void * D.20079;
  struct SgenFragment * D.20080;
  void * D.20081;
  struct SgenFragment * frag;
  void restart = <<< error >>>;

  restart:
  D.20069 = allocator->alloc_head;
  frag = unmask (D.20069);
  goto <D.19903>;
  <D.19902>:
  D.20070 = frag->fragment_end;
  D.20071 = (long int) D.20070;
  D.20072 = frag->fragment_next;
  D.20073 = (long int) D.20072;
  D.20074 = D.20071 - D.20073;
  D.20075 = (long unsigned int) D.20074;
  if (D.20075 >= size) goto <D.20076>; else goto <D.20077>;
  <D.20076>:
  {
    void * p;

    p = par_alloc_from_fragment (allocator, frag, size);
    if (p == 0B) goto restart; else goto <D.20078>;
    <D.20078>:
    D.20079 = p;
    return D.20079;
  }
  <D.20077>:
  D.20080 = frag->next;
  frag = unmask (D.20080);
  <D.19903>:
  D.20081 = unmask (frag);
  if (D.20081 != 0B) goto <D.19902>; else goto <D.19904>;
  <D.19904>:
  D.20079 = 0B;
  return D.20079;
}


par_alloc_from_fragment (struct SgenFragmentAllocator * allocator, struct SgenFragment * frag, size_t size)
{
  char * D.20083;
  void * D.20086;
  char * * D.20087;
  void * D.20088;
  long int D.20091;
  long int end.4;
  long int D.20093;
  <unnamed type> D.20096;
  int D.20099;
  long unsigned int D.20102;
  struct SgenFragment * * D.20105;
  void * D.20106;
  void * D.20107;
  void * D.20110;
  char * p;
  char * end;

  p = frag->fragment_next;
  end = p + size;
  D.20083 = frag->fragment_end;
  if (D.20083 < end) goto <D.20084>; else goto <D.20085>;
  <D.20084>:
  D.20086 = 0B;
  return D.20086;
  <D.20085>:
  mono_memory_barrier ();
  D.20087 = &frag->fragment_next;
  D.20088 = InterlockedCompareExchangePointer (D.20087, end, p);
  if (D.20088 != p) goto <D.20089>; else goto <D.20090>;
  <D.20089>:
  D.20086 = 0B;
  return D.20086;
  <D.20090>:
  D.20083 = frag->fragment_end;
  D.20091 = (long int) D.20083;
  end.4 = (long int) end;
  D.20093 = D.20091 - end.4;
  if (D.20093 <= 511) goto <D.20094>; else goto <D.20095>;
  <D.20094>:
  {
    struct SgenFragment * next;
    struct SgenFragment * * prev_ptr;

    D.20096 = sgen_get_nursery_clear_policy ();
    if (D.20096 == 1) goto <D.20097>; else goto <D.20098>;
    <D.20097>:
    D.20099 = claim_remaining_size (frag, end);
    if (D.20099 != 0) goto <D.20100>; else goto <D.20101>;
    <D.20100>:
    D.20083 = frag->fragment_end;
    sgen_clear_range (end, D.20083);
    <D.20101>:
    <D.20098>:
    prev_ptr = find_previous_pointer_fragment (allocator, frag);
    goto <D.19885>;
    <D.19887>:
    next = frag->next;
    D.20102 = get_mark (next);
    if (D.20102 == 0) goto <D.20103>; else goto <D.20104>;
    <D.20103>:
    mono_memory_write_barrier ();
    D.20105 = &frag->next;
    D.20106 = mask (next, 1);
    D.20107 = InterlockedCompareExchangePointer (D.20105, D.20106, next);
    if (D.20107 != next) goto <D.20108>; else goto <D.20109>;
    <D.20108>:
    // predicted unlikely by continue predictor.
    goto <D.19885>;
    <D.20109>:
    <D.20104>:
    mono_memory_write_barrier ();
    D.20110 = InterlockedCompareExchangePointer (prev_ptr, next, frag);
    if (D.20110 != frag) goto <D.20111>; else goto <D.20112>;
    <D.20111>:
    prev_ptr = find_previous_pointer_fragment (allocator, frag);
    // predicted unlikely by continue predictor.
    goto <D.19885>;
    <D.20112>:
    goto <D.19886>;
    <D.19885>:
    if (prev_ptr != 0B) goto <D.19887>; else goto <D.19886>;
    <D.19886>:
  }
  <D.20095>:
  D.20086 = p;
  return D.20086;
}


mono_memory_barrier ()
{
  __sync_synchronize ();
}


claim_remaining_size (struct SgenFragment * frag, char * alloc_end)
{
  char * D.20114;
  gboolean D.20117;
  char * * D.20118;
  void * D.20119;
  _Bool D.20120;

  D.20114 = frag->fragment_end;
  if (D.20114 <= alloc_end) goto <D.20115>; else goto <D.20116>;
  <D.20115>:
  D.20117 = 0;
  return D.20117;
  <D.20116>:
  D.20118 = &frag->fragment_next;
  D.20114 = frag->fragment_end;
  D.20119 = InterlockedCompareExchangePointer (D.20118, D.20114, alloc_end);
  D.20120 = D.20119 == alloc_end;
  D.20117 = (gboolean) D.20120;
  return D.20117;
}


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

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


mask (void * n, uintptr_t bit)
{
  void * D.20125;
  long unsigned int n.6;
  long unsigned int D.20127;

  n.6 = (long unsigned int) n;
  D.20127 = n.6 | bit;
  D.20125 = (void *) D.20127;
  return D.20125;
}


mono_memory_write_barrier ()
{
  mono_memory_barrier ();
}


InterlockedCompareExchangePointer (void * volatile * dest, void * exch, void * comp)
{
  void * D.20129;
  long unsigned int comp.7;
  long unsigned int exch.8;
  long unsigned int D.20132;

  comp.7 = (long unsigned int) comp;
  exch.8 = (long unsigned int) exch;
  D.20132 = __sync_val_compare_and_swap_8 (dest, comp.7, exch.8);
  D.20129 = (void *) D.20132;
  return D.20129;
}


find_previous_pointer_fragment (struct SgenFragmentAllocator * allocator, struct SgenFragment * frag)
{
  struct SgenFragment * D.20134;
  struct SgenFragment * * D.20137;
  long unsigned int D.20139;
  void * D.20145;
  struct SgenFragment * * prev;
  struct SgenFragment * cur;
  struct SgenFragment * next;
  void try_again = <<< error >>>;

  try_again:
  prev = &allocator->alloc_head;
  D.20134 = *prev;
  cur = unmask (D.20134);
  <D.19871>:
  if (cur == 0B) goto <D.20135>; else goto <D.20136>;
  <D.20135>:
  D.20137 = 0B;
  return D.20137;
  <D.20136>:
  next = cur->next;
  mono_memory_read_barrier ();
  D.20134 = *prev;
  if (D.20134 != cur) goto try_again; else goto <D.20138>;
  <D.20138>:
  D.20139 = get_mark (next);
  if (D.20139 == 0) goto <D.20140>; else goto <D.20141>;
  <D.20140>:
  if (cur == frag) goto <D.20142>; else goto <D.20143>;
  <D.20142>:
  D.20137 = prev;
  return D.20137;
  <D.20143>:
  prev = &cur->next;
  goto <D.20144>;
  <D.20141>:
  next = unmask (next);
  D.20145 = InterlockedCompareExchangePointer (prev, next, cur);
  if (D.20145 != cur) goto try_again; else goto <D.20146>;
  <D.20146>:
  mono_memory_write_barrier ();
  <D.20144>:
  cur = mono_lls_pointer_unmask (next);
  goto <D.19871>;
  D.20137 = 0B;
  return D.20137;
}


mono_memory_read_barrier ()
{
  mono_memory_barrier ();
}


mono_lls_pointer_unmask (void * p)
{
  void * D.20148;
  long unsigned int p.9;
  long unsigned int D.20150;

  p.9 = (long unsigned int) p;
  D.20150 = p.9 & 18446744073709551612;
  D.20148 = (void *) D.20150;
  return D.20148;
}


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

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

    p = serial_alloc_from_fragment (previous, frag, size);
    if (p != 0B) goto <D.20152>; else goto <D.20153>;
    <D.20152>:
    D.20154 = p;
    return D.20154;
    <D.20153>:
    previous = &frag->next;
  }
  frag = *previous;
  <D.19913>:
  if (frag != 0B) goto <D.19912>; else goto <D.19914>;
  <D.19914>:
  D.20154 = 0B;
  return D.20154;
}


serial_alloc_from_fragment (struct SgenFragment * * previous, struct SgenFragment * frag, size_t size)
{
  char * D.20156;
  void * D.20159;
  long int D.20160;
  long int end.10;
  long int D.20162;
  struct SgenFragment * D.20165;
  long unsigned int D.20166;
  char * p;
  char * end;

  p = frag->fragment_next;
  end = p + size;
  D.20156 = frag->fragment_end;
  if (D.20156 < end) goto <D.20157>; else goto <D.20158>;
  <D.20157>:
  D.20159 = 0B;
  return D.20159;
  <D.20158>:
  frag->fragment_next = end;
  D.20156 = frag->fragment_end;
  D.20160 = (long int) D.20156;
  end.10 = (long int) end;
  D.20162 = D.20160 - end.10;
  if (D.20162 <= 511) goto <D.20163>; else goto <D.20164>;
  <D.20163>:
  D.20165 = frag->next;
  *previous = D.20165;
  D.20156 = frag->fragment_end;
  D.20160 = (long int) D.20156;
  end.10 = (long int) end;
  D.20162 = D.20160 - end.10;
  D.20166 = (long unsigned int) D.20162;
  memset (end, 0, D.20166);
  D.20165 = frag->next;
  *previous = D.20165;
  <D.20164>:
  D.20159 = p;
  return D.20159;
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.20170;
  int D.20175;
  void * D.20177;
  long unsigned int D.20178;

  D.20170 = __builtin_constant_p (__len);
  if (D.20170 != 0) goto <D.20171>; else goto <D.20172>;
  <D.20171>:
  if (__len == 0) goto <D.20173>; else goto <D.20174>;
  <D.20173>:
  D.20175 = __builtin_constant_p (__ch);
  if (D.20175 == 0) goto <D.20168>; else goto <D.20176>;
  <D.20176>:
  if (__ch != 0) goto <D.20168>; else goto <D.20169>;
  <D.20168>:
  __warn_memset_zero_len ();
  D.20177 = __dest;
  return D.20177;
  <D.20169>:
  <D.20174>:
  <D.20172>:
  D.20178 = __builtin_object_size (__dest, 0);
  D.20177 = __builtin___memset_chk (__dest, __ch, __len, D.20178);
  return D.20177;
}


sgen_fragment_allocator_serial_range_alloc (struct SgenFragmentAllocator * allocator, size_t desired_size, size_t minimum_size, size_t * out_alloc_size)
{
  char * D.20180;
  long int D.20181;
  char * D.20182;
  long int D.20183;
  long int D.20184;
  void * D.20187;
  char * D.20192;
  long int D.20193;
  char * D.20194;
  long int D.20195;
  long int D.20196;
  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.19929>;
  <D.19928>:
  {
    size_t frag_size;

    D.20180 = frag->fragment_end;
    D.20181 = (long int) D.20180;
    D.20182 = frag->fragment_next;
    D.20183 = (long int) D.20182;
    D.20184 = D.20181 - D.20183;
    frag_size = (size_t) D.20184;
    if (desired_size <= frag_size) goto <D.20185>; else goto <D.20186>;
    <D.20185>:
    {
      void * p;

      *out_alloc_size = desired_size;
      p = serial_alloc_from_fragment (previous, frag, desired_size);
      D.20187 = p;
      return D.20187;
    }
    <D.20186>:
    if (current_minimum <= frag_size) goto <D.20188>; else goto <D.20189>;
    <D.20188>:
    min_frag = frag;
    prev_min_frag = previous;
    current_minimum = frag_size;
    <D.20189>:
    previous = &frag->next;
  }
  frag = *previous;
  <D.19929>:
  if (frag != 0B) goto <D.19928>; else goto <D.19930>;
  <D.19930>:
  if (min_frag != 0B) goto <D.20190>; else goto <D.20191>;
  <D.20190>:
  {
    void * p;
    size_t frag_size;

    D.20192 = min_frag->fragment_end;
    D.20193 = (long int) D.20192;
    D.20194 = min_frag->fragment_next;
    D.20195 = (long int) D.20194;
    D.20196 = D.20193 - D.20195;
    frag_size = (size_t) D.20196;
    *out_alloc_size = frag_size;
    p = serial_alloc_from_fragment (prev_min_frag, min_frag, frag_size);
    D.20187 = p;
    return D.20187;
  }
  <D.20191>:
  D.20187 = 0B;
  return D.20187;
}


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.20198;
  char * D.20199;
  long int D.20200;
  char * D.20201;
  long int D.20202;
  long int D.20203;
  long unsigned int D.20204;
  void * D.20208;
  struct SgenFragment * D.20211;
  char * D.20214;
  long int D.20215;
  char * D.20216;
  long int D.20217;
  long int D.20218;
  long unsigned int D.20219;
  struct SgenFragment * frag;
  struct SgenFragment * min_frag;
  size_t current_minimum;
  void restart = <<< error >>>;

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

    D.20199 = frag->fragment_end;
    D.20200 = (long int) D.20199;
    D.20201 = frag->fragment_next;
    D.20202 = (long int) D.20201;
    D.20203 = D.20200 - D.20202;
    frag_size = (int) D.20203;
    D.20204 = (long unsigned int) frag_size;
    if (D.20204 >= desired_size) goto <D.20205>; else goto <D.20206>;
    <D.20205>:
    {
      void * p;

      *out_alloc_size = desired_size;
      p = par_alloc_from_fragment (allocator, frag, desired_size);
      if (p == 0B) goto restart; else goto <D.20207>;
      <D.20207>:
      D.20208 = p;
      return D.20208;
    }
    <D.20206>:
    D.20204 = (long unsigned int) frag_size;
    if (D.20204 >= current_minimum) goto <D.20209>; else goto <D.20210>;
    <D.20209>:
    min_frag = frag;
    current_minimum = (size_t) frag_size;
    <D.20210>:
  }
  D.20211 = frag->next;
  frag = unmask (D.20211);
  <D.19946>:
  if (frag != 0B) goto <D.19945>; else goto <D.19947>;
  <D.19947>:
  mono_memory_barrier ();
  if (min_frag != 0B) goto <D.20212>; else goto <D.20213>;
  <D.20212>:
  {
    void * p;
    int frag_size;

    D.20214 = min_frag->fragment_end;
    D.20215 = (long int) D.20214;
    D.20216 = min_frag->fragment_next;
    D.20217 = (long int) D.20216;
    D.20218 = D.20215 - D.20217;
    frag_size = (int) D.20218;
    D.20219 = (long unsigned int) frag_size;
    if (D.20219 < minimum_size) goto restart; else goto <D.20220>;
    <D.20220>:
    D.20219 = (long unsigned int) frag_size;
    *out_alloc_size = D.20219;
    mono_memory_barrier ();
    D.20219 = (long unsigned int) frag_size;
    p = par_alloc_from_fragment (allocator, min_frag, D.20219);
    if (p == 0B) goto restart; else goto <D.20221>;
    <D.20221>:
    D.20208 = p;
    return D.20208;
  }
  <D.20213>:
  D.20208 = 0B;
  return D.20208;
}


sgen_clear_allocator_fragments (struct SgenFragmentAllocator * allocator)
{
  struct SgenFragment * D.20223;
  struct FILE * gc_debug_file.11;
  char * D.20227;
  char * D.20228;
  struct SgenFragment * D.20229;
  struct SgenFragment * frag;

  D.20223 = allocator->alloc_head;
  frag = unmask (D.20223);
  goto <D.19955>;
  <D.19954>:
  if (0 != 0) goto <D.20224>; else goto <D.20225>;
  <D.20224>:
  gc_debug_file.11 = gc_debug_file;
  D.20227 = frag->fragment_next;
  D.20228 = frag->fragment_end;
  fprintf (gc_debug_file.11, "Clear nursery frag %p-%p\n", D.20227, D.20228);
  gc_debug_file.11 = gc_debug_file;
  fflush (gc_debug_file.11);
  <D.20225>:
  D.20227 = frag->fragment_next;
  D.20228 = frag->fragment_end;
  sgen_clear_range (D.20227, D.20228);
  D.20229 = frag->next;
  frag = unmask (D.20229);
  <D.19955>:
  if (frag != 0B) goto <D.19954>; else goto <D.19956>;
  <D.19956>:
}


sgen_clear_nursery_fragments ()
{
  <unnamed type> D.20230;
  void (*<T7e8>) (void) D.20233;

  D.20230 = sgen_get_nursery_clear_policy ();
  if (D.20230 == 1) goto <D.20231>; else goto <D.20232>;
  <D.20231>:
  sgen_clear_allocator_fragments (&mutator_allocator);
  D.20233 = sgen_minor_collector.clear_fragments;
  D.20233 ();
  <D.20232>:
}


sgen_clear_range (char * start, char * end)
{
  long int end.12;
  long int start.13;
  long int D.20236;
  struct MonoVTable * D.20243;
  unsigned int D.20244;
  unsigned int D.20245;
  unsigned int D.20246;
  sizetype D.20247;
  char * D.20248;
  _Bool D.20249;
  long int D.20250;
  long int D.20251;
  struct MonoArray * o;
  size_t size;

  end.12 = (long int) end;
  start.13 = (long int) start;
  D.20236 = end.12 - start.13;
  size = (size_t) D.20236;
  if (start != 0B) goto <D.20240>; else goto <D.20237>;
  <D.20240>:
  if (end == 0B) goto <D.20238>; else goto <D.20237>;
  <D.20237>:
  if (start > end) goto <D.20238>; else goto <D.20239>;
  <D.20238>:
  monoeg_g_log (0B, 4, "Invalid range [%p %p]", start, end);
  <D.19966>:
  goto <D.19966>;
  <D.20239>:
  if (size <= 31) goto <D.20241>; else goto <D.20242>;
  <D.20241>:
  memset (start, 0, size);
  return;
  <D.20242>:
  o = start;
  D.20243 = sgen_get_array_fill_vtable ();
  o->obj.vtable = D.20243;
  o->obj.synchronisation = -1B;
  o->bounds = 0B;
  D.20244 = (unsigned int) size;
  D.20245 = D.20244 + 4294967264;
  o->max_length = D.20245;
  sgen_set_nursery_scan_start (start);
  D.20246 = sgen_safe_object_get_size (o);
  D.20247 = (sizetype) D.20246;
  D.20248 = start + D.20247;
  D.20249 = D.20248 != end;
  D.20250 = (long int) D.20249;
  D.20251 = __builtin_expect (D.20250, 0);
  if (D.20251 != 0) goto <D.20252>; else goto <D.20253>;
  <D.20252>:
  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.20253>:
}


sgen_set_nursery_scan_start (char * p)
{
  long int p.14;
  struct GCMemSection * nursery_section.15;
  char * D.20257;
  long int D.20258;
  long int D.20259;
  long int D.20260;
  char * * D.20261;
  long unsigned int D.20262;
  long unsigned int D.20263;
  char * * D.20264;
  int idx;
  char * old;

  p.14 = (long int) p;
  nursery_section.15 = nursery_section;
  D.20257 = nursery_section.15->data;
  D.20258 = (long int) D.20257;
  D.20259 = p.14 - D.20258;
  D.20260 = D.20259 / 8192;
  idx = (int) D.20260;
  nursery_section.15 = nursery_section;
  D.20261 = nursery_section.15->scan_starts;
  D.20262 = (long unsigned int) idx;
  D.20263 = D.20262 * 8;
  D.20264 = D.20261 + D.20263;
  old = *D.20264;
  if (old == 0B) goto <D.20265>; else goto <D.20267>;
  <D.20267>:
  if (old > p) goto <D.20265>; else goto <D.20266>;
  <D.20265>:
  nursery_section.15 = nursery_section;
  D.20261 = nursery_section.15->scan_starts;
  D.20262 = (long unsigned int) idx;
  D.20263 = D.20262 * 8;
  D.20264 = D.20261 + D.20263;
  *D.20264 = p;
  <D.20266>:
}


sgen_safe_object_get_size (struct MonoObject * obj)
{
  char * iftmp.16;
  long unsigned int D.20269;
  long unsigned int D.20270;
  long unsigned int D.20273;
  guint D.20277;
  struct MonoVTable * D.20278;
  char * forwarded;

  D.20269 = MEM[(mword *)obj];
  D.20270 = D.20269 & 1;
  if (D.20270 != 0) goto <D.20271>; else goto <D.20272>;
  <D.20271>:
  D.20269 = MEM[(mword *)obj];
  D.20273 = D.20269 & 18446744073709551612;
  iftmp.16 = (char *) D.20273;
  goto <D.20274>;
  <D.20272>:
  iftmp.16 = 0B;
  <D.20274>:
  forwarded = iftmp.16;
  if (forwarded != 0B) goto <D.20275>; else goto <D.20276>;
  <D.20275>:
  obj = forwarded;
  <D.20276>:
  D.20269 = MEM[(mword *)obj];
  D.20273 = D.20269 & 18446744073709551612;
  D.20278 = (struct MonoVTable *) D.20273;
  D.20277 = sgen_par_object_get_size (D.20278, obj);
  return D.20277;
}


sgen_par_object_get_size (struct MonoVTable * vtable, struct MonoObject * o)
{
  void * D.20280;
  long unsigned int D.20281;
  guint D.20286;
  int D.20287;
  int D.20288;
  unsigned int D.20289;
  long unsigned int D.20292;
  int D.20293;
  unsigned int D.20294;
  unsigned int element_size.17;
  unsigned int D.20296;
  long unsigned int D.20297;
  long unsigned int D.20298;
  struct MonoClass * D.20301;
  unsigned char D.20302;
  long unsigned int D.20303;
  long unsigned int D.20304;
  mword descr;
  mword type;

  D.20280 = vtable->gc_descr;
  descr = (mword) D.20280;
  type = descr & 7;
  D.20281 = type + 18446744073709551615;
  if (D.20281 <= 1) goto <D.20282>; else goto <D.20283>;
  <D.20282>:
  {
    mword size;

    size = descr & 65528;
    if (size == 0) goto <D.20284>; else goto <D.20285>;
    <D.20284>:
    D.20287 = MEM[(struct MonoString *)o].length;
    D.20288 = D.20287 * 2;
    D.20289 = (unsigned int) D.20288;
    D.20286 = D.20289 + 26;
    return D.20286;
    <D.20285>:
    D.20286 = (guint) size;
    return D.20286;
  }
  <D.20283>:
  if (type == 4) goto <D.20290>; else goto <D.20291>;
  <D.20290>:
  {
    int element_size;
    struct MonoArray * array;
    size_t size;

    D.20292 = descr >> 3;
    D.20293 = (int) D.20292;
    element_size = D.20293 & 1023;
    array = o;
    D.20294 = array->max_length;
    element_size.17 = (unsigned int) element_size;
    D.20296 = D.20294 * element_size.17;
    D.20297 = (long unsigned int) D.20296;
    size = D.20297 + 32;
    D.20298 = descr & 8192;
    if (D.20298 != 0) goto <D.20299>; else goto <D.20300>;
    <D.20299>:
    size = size + 3;
    size = size & 18446744073709551612;
    D.20301 = vtable->klass;
    D.20302 = D.20301->rank;
    D.20303 = (long unsigned int) D.20302;
    D.20304 = D.20303 * 8;
    size = D.20304 + size;
    <D.20300>:
    D.20286 = (guint) size;
    return D.20286;
  }
  <D.20291>:
  D.20286 = slow_object_get_size (vtable, o);
  return D.20286;
}


slow_object_get_size (struct MonoVTable * vtable, struct MonoObject * o)
{
  struct MonoClass * D.20306;
  guint D.20309;
  int D.20310;
  int D.20311;
  unsigned int D.20312;
  unsigned char D.20313;
  int D.20316;
  unsigned int D.20317;
  unsigned int D.20318;
  unsigned int D.20319;
  long unsigned int D.20320;
  struct MonoArrayBounds * D.20321;
  _Bool D.20322;
  long int D.20323;
  long int D.20324;
  long unsigned int D.20327;
  long unsigned int D.20328;
  int D.20329;
  struct MonoClass * klass;

  klass = vtable->klass;
  D.20306 = mono_defaults.string_class;
  if (D.20306 == klass) goto <D.20307>; else goto <D.20308>;
  <D.20307>:
  D.20310 = MEM[(struct MonoString *)o].length;
  D.20311 = D.20310 * 2;
  D.20312 = (unsigned int) D.20311;
  D.20309 = D.20312 + 26;
  return D.20309;
  <D.20308>:
  D.20313 = klass->rank;
  if (D.20313 != 0) goto <D.20314>; else goto <D.20315>;
  <D.20314>:
  {
    struct MonoArray * array;
    size_t size;

    array = o;
    D.20316 = klass->sizes.element_size;
    D.20317 = (unsigned int) D.20316;
    D.20318 = array->max_length;
    D.20319 = D.20317 * D.20318;
    D.20320 = (long unsigned int) D.20319;
    size = D.20320 + 32;
    D.20321 = array->bounds;
    D.20322 = D.20321 != 0B;
    D.20323 = (long int) D.20322;
    D.20324 = __builtin_expect (D.20323, 0);
    if (D.20324 != 0) goto <D.20325>; else goto <D.20326>;
    <D.20325>:
    size = size + 3;
    size = size & 18446744073709551612;
    D.20313 = klass->rank;
    D.20327 = (long unsigned int) D.20313;
    D.20328 = D.20327 * 8;
    size = D.20328 + size;
    <D.20326>:
    D.20309 = (guint) size;
    return D.20309;
  }
  <D.20315>:
  D.20329 = klass->instance_size;
  D.20309 = (guint) D.20329;
  return D.20309;
}


sgen_nursery_allocator_prepare_for_pinning ()
{
  void (*<T7e8>) (void) D.20331;

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


sgen_build_nursery_fragments (struct GCMemSection * nursery_section, void * * start, int num_entries, struct SgenGrayQueue * unpin_queue)
{
  struct SgenFragment * (*<T2d41>) (void) D.20332;
  char * * D.20333;
  unsigned int D.20334;
  long unsigned int D.20335;
  long unsigned int D.20336;
  long unsigned int D.20339;
  long unsigned int D.20340;
  void * * D.20341;
  int iftmp.18;
  struct GrayQueueSection * D.20352;
  int D.20354;
  _Bool D.20355;
  long int D.20356;
  long int D.20357;
  int D.20361;
  int D.20362;
  long unsigned int D.20364;
  long unsigned int D.20365;
  unsigned int D.20366;
  unsigned int D.20367;
  long unsigned int D.20368;
  char * D.20370;
  long int D.20371;
  long int addr1.19;
  long int D.20373;
  long int frag_end.20;
  long int frag_start.21;
  long int D.20376;
  _Bool D.20381;
  long int D.20382;
  long int D.20383;
  void (*<T7e8>) (void) D.20393;
  void (*<T2d46>) (struct SgenFragmentAllocator *) D.20394;
  struct SgenFragment * D.20395;
  void * D.20396;
  int gc_debug_level.22;
  _Bool D.20400;
  long int D.20401;
  long int D.20402;
  struct FILE * gc_debug_file.23;
  void * D.20408;
  const char * D.20409;
  unsigned int D.20410;
  mword D.20411;
  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.20332 = sgen_minor_collector.build_fragments_get_exclude_head;
  frags_ranges = D.20332 ();
  D.20333 = nursery_section->scan_starts;
  D.20334 = nursery_section->num_scan_start;
  D.20335 = (long unsigned int) D.20334;
  D.20336 = D.20335 * 8;
  memset (D.20333, 0, D.20336);
  goto <D.20001>;
  <D.20002>:
  {
    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.20337>; else goto <D.20338>;
    <D.20337>:
    D.20339 = (long unsigned int) i;
    D.20340 = D.20339 * 8;
    D.20341 = start + D.20340;
    addr0 = *D.20341;
    <D.20338>:
    if (frags_ranges != 0B) goto <D.20342>; else goto <D.20343>;
    <D.20342>:
    addr1 = frags_ranges->fragment_start;
    <D.20343>:
    if (addr0 < addr1) goto <D.20344>; else goto <D.20345>;
    <D.20344>:
    if (unpin_queue != 0B) goto <D.20346>; else goto <D.20347>;
    <D.20346>:
    D.20352 = unpin_queue->first;
    if (D.20352 == 0B) goto <D.20349>; else goto <D.20353>;
    <D.20353>:
    D.20352 = unpin_queue->first;
    D.20354 = D.20352->end;
    if (D.20354 == 125) goto <D.20349>; else goto <D.20350>;
    <D.20349>:
    iftmp.18 = 1;
    goto <D.20351>;
    <D.20350>:
    iftmp.18 = 0;
    <D.20351>:
    D.20355 = iftmp.18 != 0;
    D.20356 = (long int) D.20355;
    D.20357 = __builtin_expect (D.20356, 0);
    if (D.20357 != 0) goto <D.20358>; else goto <D.20359>;
    <D.20358>:
    sgen_gray_object_enqueue (unpin_queue, addr0);
    goto <D.20360>;
    <D.20359>:
    D.20352 = unpin_queue->first;
    D.20352 = unpin_queue->first;
    D.20354 = D.20352->end;
    D.20361 = D.20354;
    D.20362 = D.20361 + 1;
    D.20352->end = D.20362;
    D.20352->objects[D.20361] = addr0;
    <D.20360>:
    __builtin_prefetch (addr0);
    goto <D.20363>;
    <D.20347>:
    D.20364 = MEM[(mword *)addr0];
    D.20365 = D.20364 & 18446744073709551613;
    MEM[(mword *)addr0] = D.20365;
    <D.20363>:
    sgen_set_nursery_scan_start (addr0);
    frag_end = addr0;
    D.20366 = sgen_safe_object_get_size (addr0);
    D.20367 = D.20366 + 7;
    D.20368 = (long unsigned int) D.20367;
    size = D.20368 & 4294967288;
    i = i + 1;
    goto <D.20369>;
    <D.20345>:
    frag_end = addr1;
    D.20370 = frags_ranges->fragment_next;
    D.20371 = (long int) D.20370;
    addr1.19 = (long int) addr1;
    D.20373 = D.20371 - addr1.19;
    size = (size_t) D.20373;
    last_frag = frags_ranges;
    frags_ranges = frags_ranges->next_in_order;
    <D.20369>:
    frag_end.20 = (long int) frag_end;
    frag_start.21 = (long int) frag_start;
    D.20376 = frag_end.20 - frag_start.21;
    frag_size = (size_t) D.20376;
    if (size == 0) goto <D.20377>; else goto <D.20378>;
    <D.20377>:
    // predicted unlikely by continue predictor.
    goto <D.20001>;
    <D.20378>:
    if (0 != 0) goto <D.20379>; else goto <D.20380>;
    <D.20379>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-nursery-allocator.c", 802, "frag_size >= 0");
    <D.20380>:
    D.20381 = size == 0;
    D.20382 = (long int) D.20381;
    D.20383 = __builtin_expect (D.20382, 0);
    if (D.20383 != 0) goto <D.20384>; else goto <D.20385>;
    <D.20384>:
    monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-nursery-allocator.c", 803, "size > 0");
    <D.20385>:
    if (frag_size != 0) goto <D.20386>; else goto <D.20387>;
    <D.20386>:
    if (size != 0) goto <D.20388>; else goto <D.20389>;
    <D.20388>:
    add_nursery_frag (&mutator_allocator, frag_size, frag_start, frag_end);
    <D.20389>:
    <D.20387>:
    frag_size = size;
    frag_start = frag_end + frag_size;
  }
  <D.20001>:
  if (i < num_entries) goto <D.20002>; else goto <D.20390>;
  <D.20390>:
  if (frags_ranges != 0B) goto <D.20002>; else goto <D.20003>;
  <D.20003>:
  nursery_last_pinned_end = frag_start;
  frag_end = sgen_nursery_end;
  frag_end.20 = (long int) frag_end;
  frag_start.21 = (long int) frag_start;
  D.20376 = frag_end.20 - frag_start.21;
  frag_size = (size_t) D.20376;
  if (frag_size != 0) goto <D.20391>; else goto <D.20392>;
  <D.20391>:
  add_nursery_frag (&mutator_allocator, frag_size, frag_start, frag_end);
  <D.20392>:
  D.20393 = sgen_minor_collector.build_fragments_release_exclude_head;
  D.20393 ();
  fragment_list_reverse (&mutator_allocator);
  D.20394 = sgen_minor_collector.build_fragments_finish;
  D.20394 (&mutator_allocator);
  D.20395 = mutator_allocator.alloc_head;
  D.20396 = unmask (D.20395);
  if (D.20396 == 0B) goto <D.20397>; else goto <D.20398>;
  <D.20397>:
  gc_debug_level.22 = gc_debug_level;
  D.20400 = gc_debug_level.22 > 0;
  D.20401 = (long int) D.20400;
  D.20402 = __builtin_expect (D.20401, 0);
  if (D.20402 != 0) goto <D.20403>; else goto <D.20404>;
  <D.20403>:
  gc_debug_file.23 = gc_debug_file;
  fprintf (gc_debug_file.23, "Nursery fully pinned (%d)\n", num_entries);
  gc_debug_file.23 = gc_debug_file;
  fflush (gc_debug_file.23);
  <D.20404>:
  i = 0;
  goto <D.20005>;
  <D.20004>:
  if (0 != 0) goto <D.20406>; else goto <D.20407>;
  <D.20406>:
  gc_debug_file.23 = gc_debug_file;
  D.20339 = (long unsigned int) i;
  D.20340 = D.20339 * 8;
  D.20341 = start + D.20340;
  D.20408 = *D.20341;
  D.20339 = (long unsigned int) i;
  D.20340 = D.20339 * 8;
  D.20341 = start + D.20340;
  D.20408 = *D.20341;
  D.20409 = sgen_safe_name (D.20408);
  D.20339 = (long unsigned int) i;
  D.20340 = D.20339 * 8;
  D.20341 = start + D.20340;
  D.20408 = *D.20341;
  D.20410 = sgen_safe_object_get_size (D.20408);
  fprintf (gc_debug_file.23, "Bastard pinning obj %p (%s), size: %d\n", D.20408, D.20409, D.20410);
  gc_debug_file.23 = gc_debug_file;
  fflush (gc_debug_file.23);
  <D.20407>:
  i = i + 1;
  <D.20005>:
  if (i < num_entries) goto <D.20004>; else goto <D.20006>;
  <D.20006>:
  <D.20398>:
  D.20411 = fragment_total;
  return D.20411;
}


add_nursery_frag (struct SgenFragmentAllocator * allocator, size_t frag_size, char * frag_start, char * frag_end)
{
  struct FILE * gc_debug_file.24;
  <unnamed type> D.20418;
  long unsigned int fragment_total.25;
  long unsigned int fragment_total.26;

  if (0 != 0) goto <D.20413>; else goto <D.20414>;
  <D.20413>:
  gc_debug_file.24 = gc_debug_file;
  fprintf (gc_debug_file.24, "Found empty fragment: %p-%p, size: %zd\n", frag_start, frag_end, frag_size);
  gc_debug_file.24 = gc_debug_file;
  fflush (gc_debug_file.24);
  <D.20414>:
  if (frag_size > 511) goto <D.20416>; else goto <D.20417>;
  <D.20416>:
  D.20418 = sgen_get_nursery_clear_policy ();
  if (D.20418 == 0) goto <D.20419>; else goto <D.20420>;
  <D.20419>:
  memset (frag_start, 0, frag_size);
  <D.20420>:
  sgen_fragment_allocator_add (allocator, frag_start, frag_end);
  fragment_total.25 = fragment_total;
  fragment_total.26 = fragment_total.25 + frag_size;
  fragment_total = fragment_total.26;
  goto <D.20423>;
  <D.20417>:
  sgen_clear_range (frag_start, frag_end);
  <D.20423>:
}


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

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

    next = list->next;
    list->next = prev;
    list->next_in_order = prev;
    prev = list;
    list = next;
  }
  <D.19984>:
  if (list != 0B) goto <D.19983>; else goto <D.19985>;
  <D.19985>:
  allocator->alloc_head = prev;
  D.20424 = allocator->alloc_head;
  allocator->region_head = D.20424;
}


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

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


sgen_nursery_alloc_get_upper_alloc_bound ()
{
  char * D.20427;

  D.20427 = sgen_nursery_end;
  return D.20427;
}


sgen_nursery_retire_region (void * address, ptrdiff_t size)
{

}


sgen_can_alloc_size (size_t size)
{
  long unsigned int D.20429;
  struct SgenFragment * D.20430;
  char * D.20431;
  long int D.20432;
  char * D.20433;
  long int D.20434;
  long int D.20435;
  long unsigned int D.20436;
  gboolean D.20439;
  struct SgenFragment * D.20440;
  struct SgenFragment * frag;

  D.20429 = size + 7;
  size = D.20429 & 18446744073709551608;
  D.20430 = mutator_allocator.alloc_head;
  frag = unmask (D.20430);
  goto <D.20019>;
  <D.20018>:
  D.20431 = frag->fragment_end;
  D.20432 = (long int) D.20431;
  D.20433 = frag->fragment_next;
  D.20434 = (long int) D.20433;
  D.20435 = D.20432 - D.20434;
  D.20436 = (long unsigned int) D.20435;
  if (D.20436 >= size) goto <D.20437>; else goto <D.20438>;
  <D.20437>:
  D.20439 = 1;
  return D.20439;
  <D.20438>:
  D.20440 = frag->next;
  frag = unmask (D.20440);
  <D.20019>:
  if (frag != 0B) goto <D.20018>; else goto <D.20020>;
  <D.20020>:
  D.20439 = 0;
  return D.20439;
}


sgen_nursery_alloc (size_t size)
{
  struct FILE * gc_debug_file.27;
  long unsigned int D.20445;
  void * D.20446;

  if (0 != 0) goto <D.20442>; else goto <D.20443>;
  <D.20442>:
  gc_debug_file.27 = gc_debug_file;
  fprintf (gc_debug_file.27, "Searching nursery for size: %zd\n", size);
  gc_debug_file.27 = gc_debug_file;
  fflush (gc_debug_file.27);
  <D.20443>:
  D.20445 = size + 7;
  size = D.20445 & 18446744073709551608;
  D.20446 = sgen_fragment_allocator_par_alloc (&mutator_allocator, size);
  return D.20446;
}


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

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


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


sgen_nursery_alloc_prepare_for_minor ()
{
  void (*<T2d3d>) (char *, int) D.20453;
  char * sgen_space_bitmap.29;
  int sgen_space_bitmap_size.30;

  D.20453 = sgen_minor_collector.prepare_to_space;
  sgen_space_bitmap.29 = sgen_space_bitmap;
  sgen_space_bitmap_size.30 = sgen_space_bitmap_size;
  D.20453 (sgen_space_bitmap.29, sgen_space_bitmap_size.30);
}


sgen_nursery_alloc_prepare_for_major ()
{
  void (*<T2d3d>) (char *, int) D.20456;
  char * sgen_space_bitmap.31;
  int sgen_space_bitmap_size.32;

  D.20456 = sgen_minor_collector.prepare_to_space;
  sgen_space_bitmap.31 = sgen_space_bitmap;
  sgen_space_bitmap_size.32 = sgen_space_bitmap_size;
  D.20456 (sgen_space_bitmap.31, sgen_space_bitmap_size.32);
}


sgen_nursery_allocator_set_nursery_bounds (char * start, char * end)
{
  long int end.33;
  long int start.34;
  long int D.20461;
  long int D.20462;
  int sgen_space_bitmap_size.35;
  int sgen_space_bitmap_size.36;
  long unsigned int D.20465;
  void * sgen_space_bitmap.37;
  void (*<T2d4a>) (struct SgenFragmentAllocator *, char *, char *) D.20467;

  sgen_nursery_start = start;
  sgen_nursery_end = end;
  end.33 = (long int) end;
  start.34 = (long int) start;
  D.20461 = end.33 - start.34;
  D.20462 = D.20461 / 4096;
  sgen_space_bitmap_size.35 = (int) D.20462;
  sgen_space_bitmap_size = sgen_space_bitmap_size.35;
  sgen_space_bitmap_size.36 = sgen_space_bitmap_size;
  D.20465 = (long unsigned int) sgen_space_bitmap_size.36;
  sgen_space_bitmap.37 = monoeg_malloc0 (D.20465);
  sgen_space_bitmap = sgen_space_bitmap.37;
  D.20467 = sgen_minor_collector.init_nursery;
  D.20467 (&mutator_allocator, start, end);
}


