sgen_mark_bridge_object (struct MonoObject * obj)
{
  int D.17524;
  _Bool D.17525;
  int D.17526;
  struct MonoObject * D.17527;
  struct SgenHashTable * hash_table;

  D.17524 = sgen_ptr_in_nursery (obj);
  D.17525 = D.17524 == 0;
  D.17526 = (int) D.17525;
  hash_table = get_finalize_entry_hash_table (D.17526);
  D.17527 = tagged_object_apply (obj, 1);
  sgen_hash_table_set_key (hash_table, obj, D.17527);
}


sgen_ptr_in_nursery (void * p)
{
  gboolean D.17528;
  int sgen_nursery_bits.0;
  int D.17530;
  int D.17531;
  unsigned int D.17532;
  unsigned int p.1;
  unsigned int D.17534;
  char * sgen_nursery_start.2;
  unsigned int sgen_nursery_start.3;
  _Bool D.17537;

  sgen_nursery_bits.0 = sgen_nursery_bits;
  D.17530 = 1 << sgen_nursery_bits.0;
  D.17531 = -D.17530;
  D.17532 = (unsigned int) D.17531;
  p.1 = (unsigned int) p;
  D.17534 = D.17532 & p.1;
  sgen_nursery_start.2 = sgen_nursery_start;
  sgen_nursery_start.3 = (unsigned int) sgen_nursery_start.2;
  D.17537 = D.17534 == sgen_nursery_start.3;
  D.17528 = (gboolean) D.17537;
  return D.17528;
}


get_finalize_entry_hash_table (int generation)
{
  struct SgenHashTable * D.17539;

  switch (generation) <default: <D.17232>, case 0: <D.17230>, case 1: <D.17231>>
  <D.17230>:
  D.17539 = &minor_finalizable_hash;
  return D.17539;
  <D.17231>:
  D.17539 = &major_finalizable_hash;
  return D.17539;
  <D.17232>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "sgen-fin-weak-hash.c", 94);
}


tagged_object_equals (struct MonoObject * a, struct MonoObject * b)
{
  gboolean D.17541;
  struct MonoObject * D.17542;
  struct MonoObject * D.17543;
  _Bool D.17544;

  D.17542 = tagged_object_get_object (a);
  D.17543 = tagged_object_get_object (b);
  D.17544 = D.17542 == D.17543;
  D.17541 = (gboolean) D.17544;
  return D.17541;
}


tagged_object_get_object (struct MonoObject * object)
{
  struct MonoObject * D.17546;
  unsigned int object.4;
  unsigned int D.17548;

  object.4 = (unsigned int) object;
  D.17548 = object.4 & 4294967294;
  D.17546 = (struct MonoObject *) D.17548;
  return D.17546;
}


tagged_object_hash (struct MonoObject * o)
{
  int D.17550;
  struct MonoObject * D.17551;

  D.17551 = tagged_object_get_object (o);
  D.17550 = mono_object_hash (D.17551);
  return D.17550;
}


tagged_object_apply (void * object, int tag_bits)
{
  struct MonoObject * D.17553;
  unsigned int object.5;
  unsigned int tag_bits.6;
  unsigned int D.17556;

  object.5 = (unsigned int) object;
  tag_bits.6 = (unsigned int) tag_bits;
  D.17556 = object.5 | tag_bits.6;
  D.17553 = (struct MonoObject *) D.17556;
  return D.17553;
}


sgen_collect_bridge_objects (int generation, struct ScanCopyContext ctx)
{
  int no_finalize.7;
  unsigned int D.17561;
  gboolean (*<T2bea>) (char *) D.17564;
  int D.17565;
  int D.17568;
  int D.17571;
  char * copy.8;
  int D.17577;
  struct SgenHashTableEntry * D.17579;
  unsigned int D.17580;
  unsigned int D.17581;
  int D.17584;
  struct MonoObject * D.17585;
  const char * D.17588;
  struct FILE * gc_debug_file.9;
  const char * D.17592;
  struct MonoObject * D.17593;
  struct SgenHashTableEntry * D.17594;
  unsigned int D.17595;
  void (*CopyOrMarkObjectFunc) (void * *, struct SgenGrayQueue *) copy_func;
  struct GrayQueue * queue;
  struct SgenHashTable * hash_table;
  struct MonoObject * object;
  void * dummy;
  char * copy;

  try
    {
      copy_func = ctx.copy_func;
      queue = ctx.queue;
      hash_table = get_finalize_entry_hash_table (generation);
      no_finalize.7 = no_finalize;
      if (no_finalize.7 != 0) goto <D.17559>; else goto <D.17560>;
      <D.17559>:
      return;
      <D.17560>:
      {
        struct SgenHashTable * __hash_table;
        struct SgenHashTableEntry * * __table;
        guint __i;

        __hash_table = hash_table;
        __table = __hash_table->table;
        __i = 0;
        goto <D.17259>;
        <D.17258>:
        {
          struct SgenHashTableEntry * * __iter;
          struct SgenHashTableEntry * * __next;

          D.17561 = __i * 4;
          __iter = __table + D.17561;
          goto <D.17256>;
          <D.17255>:
          {
            struct SgenHashTableEntry * __entry;

            __entry = *__iter;
            __next = &__entry->next;
            object = __entry->key;
            dummy = &__entry->data;
            {
              int tag;

              tag = tagged_object_get_tag (object);
              object = tagged_object_get_object (object);
              if (tag == 1) goto <D.17562>; else goto <D.17563>;
              <D.17562>:
              // predicted unlikely by continue predictor.
              goto <D.17254>;
              <D.17563>:
              D.17564 = major_collector.is_object_live;
              D.17565 = D.17564 (object);
              if (D.17565 != 0) goto <D.17566>; else goto <D.17567>;
              <D.17566>:
              // predicted unlikely by continue predictor.
              goto <D.17254>;
              <D.17567>:
              D.17568 = sgen_gc_is_object_ready_for_finalization (object);
              if (D.17568 == 0) goto <D.17569>; else goto <D.17570>;
              <D.17569>:
              // predicted unlikely by continue predictor.
              goto <D.17254>;
              <D.17570>:
              D.17571 = sgen_is_bridge_object (object);
              if (D.17571 == 0) goto <D.17572>; else goto <D.17573>;
              <D.17572>:
              // predicted unlikely by continue predictor.
              goto <D.17254>;
              <D.17573>:
              copy = object;
              copy_func (&copy, queue);
              copy.8 = copy;
              sgen_bridge_register_finalized_object (copy.8);
              if (hash_table == &minor_finalizable_hash) goto <D.17576>; else goto <D.17575>;
              <D.17576>:
              copy.8 = copy;
              D.17577 = sgen_ptr_in_nursery (copy.8);
              if (D.17577 == 0) goto <D.17578>; else goto <D.17575>;
              <D.17578>:
              D.17579 = *__next;
              *__iter = D.17579;
              __next = __iter;
              D.17580 = __hash_table->num_entries;
              D.17581 = D.17580 + 4294967295;
              __hash_table->num_entries = D.17581;
              if (1 != 0) goto <D.17582>; else goto <D.17583>;
              <D.17582>:
              D.17584 = __hash_table->entry_mem_type;
              sgen_free_internal (__entry, D.17584);
              <D.17583>:
              copy.8 = copy;
              D.17585 = tagged_object_apply (copy.8, tag);
              sgen_hash_table_replace (&major_finalizable_hash, D.17585, 0B, 0B);
              if (0 != 0) goto <D.17586>; else goto <D.17587>;
              <D.17586>:
              copy.8 = copy;
              D.17588 = sgen_safe_name (copy.8);
              copy.8 = copy;
              gc_debug_file.9 = gc_debug_file;
              fprintf (gc_debug_file.9, "Promoting finalization of object %p (%s) (was at %p) to major table\n", copy.8, D.17588, object);
              gc_debug_file.9 = gc_debug_file;
              fflush (gc_debug_file.9);
              <D.17587>:
              // predicted unlikely by continue predictor.
              goto <D.17254>;
              <D.17575>:
              if (0 != 0) goto <D.17590>; else goto <D.17591>;
              <D.17590>:
              copy.8 = copy;
              D.17592 = sgen_safe_name (copy.8);
              copy.8 = copy;
              gc_debug_file.9 = gc_debug_file;
              fprintf (gc_debug_file.9, "Updating object for finalization: %p (%s) (was at %p)\n", copy.8, D.17592, object);
              gc_debug_file.9 = gc_debug_file;
              fflush (gc_debug_file.9);
              <D.17591>:
              copy.8 = copy;
              D.17593 = tagged_object_apply (copy.8, tag);
              __entry->key = D.17593;
            }
          }
          <D.17254>:
          __iter = __next;
          <D.17256>:
          D.17594 = *__iter;
          if (D.17594 != 0B) goto <D.17255>; else goto <D.17257>;
          <D.17257>:
        }
        __i = __i + 1;
        <D.17259>:
        D.17595 = hash_table->size;
        if (D.17595 > __i) goto <D.17258>; else goto <D.17260>;
        <D.17260>:
      }
    }
  finally
    {
      copy = {CLOBBER};
    }
}


tagged_object_get_tag (struct MonoObject * object)
{
  int D.17599;
  int object.10;

  object.10 = (int) object;
  D.17599 = object.10 & 1;
  return D.17599;
}


sgen_finalize_in_range (int generation, struct ScanCopyContext ctx)
{
  int no_finalize.11;
  unsigned int D.17605;
  gboolean (*<T2bea>) (char *) D.17606;
  int D.17607;
  struct SgenHashTableEntry * D.17612;
  unsigned int D.17613;
  unsigned int D.17614;
  int D.17617;
  int num_ready_finalizers.12;
  int num_ready_finalizers.13;
  struct MonoObject * copy.14;
  unsigned int D.17623;
  const char * D.17624;
  struct FILE * gc_debug_file.15;
  int D.17628;
  struct MonoObject * D.17632;
  const char * D.17635;
  const char * D.17638;
  struct MonoObject * D.17639;
  struct SgenHashTableEntry * D.17640;
  unsigned int D.17641;
  void (*CopyOrMarkObjectFunc) (void * *, struct SgenGrayQueue *) copy_func;
  struct GrayQueue * queue;
  struct SgenHashTable * hash_table;
  struct MonoObject * object;
  void * dummy;

  copy_func = ctx.copy_func;
  queue = ctx.queue;
  hash_table = get_finalize_entry_hash_table (generation);
  no_finalize.11 = no_finalize;
  if (no_finalize.11 != 0) goto <D.17603>; else goto <D.17604>;
  <D.17603>:
  return;
  <D.17604>:
  {
    struct SgenHashTable * __hash_table;
    struct SgenHashTableEntry * * __table;
    guint __i;

    __hash_table = hash_table;
    __table = __hash_table->table;
    __i = 0;
    goto <D.17284>;
    <D.17283>:
    {
      struct SgenHashTableEntry * * __iter;
      struct SgenHashTableEntry * * __next;

      D.17605 = __i * 4;
      __iter = __table + D.17605;
      goto <D.17281>;
      <D.17280>:
      {
        struct SgenHashTableEntry * __entry;

        __entry = *__iter;
        __next = &__entry->next;
        object = __entry->key;
        dummy = &__entry->data;
        {
          int tag;

          tag = tagged_object_get_tag (object);
          object = tagged_object_get_object (object);
          D.17606 = major_collector.is_object_live;
          D.17607 = D.17606 (object);
          if (D.17607 == 0) goto <D.17608>; else goto <D.17609>;
          <D.17608>:
          {
            gboolean is_fin_ready;
            struct MonoObject * copy;

            try
              {
                is_fin_ready = sgen_gc_is_object_ready_for_finalization (object);
                copy = object;
                copy_func (&copy, queue);
                if (is_fin_ready != 0) goto <D.17610>; else goto <D.17611>;
                <D.17610>:
                D.17612 = *__next;
                *__iter = D.17612;
                __next = __iter;
                D.17613 = __hash_table->num_entries;
                D.17614 = D.17613 + 4294967295;
                __hash_table->num_entries = D.17614;
                if (1 != 0) goto <D.17615>; else goto <D.17616>;
                <D.17615>:
                D.17617 = __hash_table->entry_mem_type;
                sgen_free_internal (__entry, D.17617);
                <D.17616>:
                num_ready_finalizers.12 = num_ready_finalizers;
                num_ready_finalizers.13 = num_ready_finalizers.12 + 1;
                num_ready_finalizers = num_ready_finalizers.13;
                copy.14 = copy;
                sgen_queue_finalization_entry (copy.14);
                if (0 != 0) goto <D.17621>; else goto <D.17622>;
                <D.17621>:
                D.17623 = hash_table->num_entries;
                num_ready_finalizers.12 = num_ready_finalizers;
                copy.14 = copy;
                D.17624 = sgen_safe_name (copy.14);
                copy.14 = copy;
                gc_debug_file.15 = gc_debug_file;
                fprintf (gc_debug_file.15, "Queueing object for finalization: %p (%s) (was at %p) (%d/%d)\n", copy.14, D.17624, object, num_ready_finalizers.12, D.17623);
                gc_debug_file.15 = gc_debug_file;
                fflush (gc_debug_file.15);
                <D.17622>:
                // predicted unlikely by continue predictor.
                goto <D.17279>;
                <D.17611>:
                if (hash_table == &minor_finalizable_hash) goto <D.17627>; else goto <D.17626>;
                <D.17627>:
                copy.14 = copy;
                D.17628 = sgen_ptr_in_nursery (copy.14);
                if (D.17628 == 0) goto <D.17629>; else goto <D.17626>;
                <D.17629>:
                D.17612 = *__next;
                *__iter = D.17612;
                __next = __iter;
                D.17613 = __hash_table->num_entries;
                D.17614 = D.17613 + 4294967295;
                __hash_table->num_entries = D.17614;
                if (1 != 0) goto <D.17630>; else goto <D.17631>;
                <D.17630>:
                D.17617 = __hash_table->entry_mem_type;
                sgen_free_internal (__entry, D.17617);
                <D.17631>:
                copy.14 = copy;
                D.17632 = tagged_object_apply (copy.14, tag);
                sgen_hash_table_replace (&major_finalizable_hash, D.17632, 0B, 0B);
                if (0 != 0) goto <D.17633>; else goto <D.17634>;
                <D.17633>:
                copy.14 = copy;
                D.17635 = sgen_safe_name (copy.14);
                copy.14 = copy;
                gc_debug_file.15 = gc_debug_file;
                fprintf (gc_debug_file.15, "Promoting finalization of object %p (%s) (was at %p) to major table\n", copy.14, D.17635, object);
                gc_debug_file.15 = gc_debug_file;
                fflush (gc_debug_file.15);
                <D.17634>:
                // predicted unlikely by continue predictor.
                goto <D.17279>;
                <D.17626>:
                if (0 != 0) goto <D.17636>; else goto <D.17637>;
                <D.17636>:
                copy.14 = copy;
                D.17638 = sgen_safe_name (copy.14);
                copy.14 = copy;
                gc_debug_file.15 = gc_debug_file;
                fprintf (gc_debug_file.15, "Updating object for finalization: %p (%s) (was at %p)\n", copy.14, D.17638, object);
                gc_debug_file.15 = gc_debug_file;
                fflush (gc_debug_file.15);
                <D.17637>:
                copy.14 = copy;
                D.17639 = tagged_object_apply (copy.14, tag);
                __entry->key = D.17639;
              }
            finally
              {
                copy = {CLOBBER};
              }
          }
          <D.17609>:
        }
      }
      <D.17279>:
      __iter = __next;
      <D.17281>:
      D.17640 = *__iter;
      if (D.17640 != 0B) goto <D.17280>; else goto <D.17282>;
      <D.17282>:
    }
    __i = __i + 1;
    <D.17284>:
    D.17641 = hash_table->size;
    if (D.17641 > __i) goto <D.17283>; else goto <D.17285>;
    <D.17285>:
  }
}


sgen_process_fin_stage_entries ()
{
  lock_stage_for_processing (&next_fin_stage_entry);
  process_stage_entries (1024, &next_fin_stage_entry, &fin_stage_entries, process_fin_stage_entry);
}


process_fin_stage_entry (struct MonoObject * obj, void * user_data, int index)
{
  int D.17645;

  D.17645 = sgen_ptr_in_nursery (obj);
  if (D.17645 != 0) goto <D.17646>; else goto <D.17647>;
  <D.17646>:
  register_for_finalization (obj, user_data, 0);
  goto <D.17648>;
  <D.17647>:
  register_for_finalization (obj, user_data, 1);
  <D.17648>:
}


register_for_finalization (struct MonoObject * obj, void * user_data, int generation)
{
  int no_finalize.16;
  int iftmp.17;
  _Bool D.17657;
  long int D.17658;
  long int D.17659;
  int D.17664;
  const char * D.17669;
  unsigned int D.17670;
  struct MonoVTable * D.17671;
  struct MonoClass * D.17672;
  const char * D.17673;
  struct FILE * gc_debug_file.18;
  int D.17676;
  struct SgenHashTable * hash_table;

  hash_table = get_finalize_entry_hash_table (generation);
  no_finalize.16 = no_finalize;
  if (no_finalize.16 != 0) goto <D.17650>; else goto <D.17651>;
  <D.17650>:
  return;
  <D.17651>:
  if (user_data != 0B) goto <D.17655>; else goto <D.17653>;
  <D.17655>:
  if (user_data != mono_gc_run_finalize) goto <D.17656>; else goto <D.17653>;
  <D.17656>:
  iftmp.17 = 1;
  goto <D.17654>;
  <D.17653>:
  iftmp.17 = 0;
  <D.17654>:
  D.17657 = iftmp.17 != 0;
  D.17658 = (long int) D.17657;
  D.17659 = __builtin_expect (D.17658, 0);
  if (D.17659 != 0) goto <D.17660>; else goto <D.17661>;
  <D.17660>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-fin-weak-hash.c", 223, "user_data == NULL || user_data == mono_gc_run_finalize");
  <D.17661>:
  if (user_data != 0B) goto <D.17662>; else goto <D.17663>;
  <D.17662>:
  D.17664 = sgen_hash_table_replace (hash_table, obj, 0B, 0B);
  if (D.17664 != 0) goto <D.17665>; else goto <D.17666>;
  <D.17665>:
  if (0 != 0) goto <D.17667>; else goto <D.17668>;
  <D.17667>:
  D.17669 = sgen_generation_name (generation);
  D.17670 = hash_table->num_entries;
  D.17671 = obj->vtable;
  D.17672 = D.17671->klass;
  D.17673 = D.17672->name;
  gc_debug_file.18 = gc_debug_file;
  fprintf (gc_debug_file.18, "Added finalizer for object: %p (%s) (%d) to %s table\n", obj, D.17673, D.17670, D.17669);
  gc_debug_file.18 = gc_debug_file;
  fflush (gc_debug_file.18);
  <D.17668>:
  <D.17666>:
  goto <D.17675>;
  <D.17663>:
  D.17676 = sgen_hash_table_remove (hash_table, obj, 0B);
  if (D.17676 != 0) goto <D.17677>; else goto <D.17678>;
  <D.17677>:
  if (0 != 0) goto <D.17679>; else goto <D.17680>;
  <D.17679>:
  D.17670 = hash_table->num_entries;
  D.17671 = obj->vtable;
  D.17672 = D.17671->klass;
  D.17673 = D.17672->name;
  gc_debug_file.18 = gc_debug_file;
  fprintf (gc_debug_file.18, "Removed finalizer for object: %p (%s) (%d)\n", obj, D.17673, D.17670);
  gc_debug_file.18 = gc_debug_file;
  fflush (gc_debug_file.18);
  <D.17680>:
  <D.17678>:
  <D.17675>:
}


lock_stage_for_processing (volatile gint32 * next_entry)
{
  *next_entry = -1;
}


process_stage_entries (int num_entries, volatile gint32 * next_entry, struct StageEntry * entries, void (*<T2e97>) (struct MonoObject *, void *, int) process_func)
{
  int D.17682;
  unsigned int i.19;
  unsigned int D.17686;
  struct StageEntry * D.17687;
  volatile gint32 * D.17688;
  int D.17689;
  void * D.17693;
  struct MonoObject * D.17694;
  int i;
  void retry = <<< error >>>;

  D.17682 = *next_entry;
  if (D.17682 != -1) goto <D.17683>; else goto <D.17684>;
  <D.17683>:
  return;
  <D.17684>:
  i = 0;
  goto <D.17328>;
  <D.17327>:
  {
    gint32 state;

    retry:
    i.19 = (unsigned int) i;
    D.17686 = i.19 * 12;
    D.17687 = entries + D.17686;
    state = D.17687->state;
    switch (state) <default: <D.17325>, case 0: <D.17319>, case 1: <D.17322>, case 2: <D.17323>, case 3: <D.17320>>
    <D.17319>:
    <D.17320>:
    // predicted unlikely by continue predictor.
    goto <D.17321>;
    <D.17322>:
    i.19 = (unsigned int) i;
    D.17686 = i.19 * 12;
    D.17687 = entries + D.17686;
    D.17688 = &D.17687->state;
    D.17689 = InterlockedCompareExchange (D.17688, 3, 1);
    if (D.17689 != 1) goto retry; else goto <D.17690>;
    <D.17690>:
    // predicted unlikely by continue predictor.
    goto <D.17321>;
    <D.17323>:
    goto <D.17324>;
    <D.17325>:
    if (1 != 0) goto <D.17691>; else goto <D.17692>;
    <D.17691>:
    monoeg_g_log (0B, 4, "Invalid stage entry state");
    <D.17326>:
    goto <D.17326>;
    <D.17692>:
    goto <D.17324>;
    <D.17324>:
    i.19 = (unsigned int) i;
    D.17686 = i.19 * 12;
    D.17687 = entries + D.17686;
    D.17693 = D.17687->user_data;
    i.19 = (unsigned int) i;
    D.17686 = i.19 * 12;
    D.17687 = entries + D.17686;
    D.17694 = D.17687->obj;
    process_func (D.17694, D.17693, i);
    i.19 = (unsigned int) i;
    D.17686 = i.19 * 12;
    D.17687 = entries + D.17686;
    D.17687->obj = 0B;
    i.19 = (unsigned int) i;
    D.17686 = i.19 * 12;
    D.17687 = entries + D.17686;
    D.17687->user_data = 0B;
    mono_memory_write_barrier ();
    i.19 = (unsigned int) i;
    D.17686 = i.19 * 12;
    D.17687 = entries + D.17686;
    D.17687->state = 0;
  }
  <D.17321>:
  i = i + 1;
  <D.17328>:
  if (i < num_entries) goto <D.17327>; else goto <D.17329>;
  <D.17329>:
  mono_memory_write_barrier ();
  *next_entry = 0;
}


InterlockedCompareExchange (volatile gint32 * dest, gint32 exch, gint32 comp)
{
  gint32 D.17698;
  unsigned int exch.20;
  unsigned int comp.21;
  unsigned int D.17701;

  exch.20 = (unsigned int) exch;
  comp.21 = (unsigned int) comp;
  D.17701 = __sync_val_compare_and_swap_4 (dest, comp.21, exch.20);
  D.17698 = (gint32) D.17701;
  return D.17698;
}


mono_memory_write_barrier ()
{
  mono_memory_barrier ();
}


mono_memory_barrier ()
{
  __sync_synchronize ();
}


mono_gc_register_for_finalization (struct MonoObject * obj, void * user_data)
{
  int D.17703;
  int D.17706;

  goto <D.17364>;
  <D.17363>:
  D.17703 = try_lock_stage_for_processing (1024, &next_fin_stage_entry);
  if (D.17703 != 0) goto <D.17704>; else goto <D.17705>;
  <D.17704>:
  pthread_mutex_lock (&gc_mutex);
  process_stage_entries (1024, &next_fin_stage_entry, &fin_stage_entries, process_fin_stage_entry);
  sgen_gc_unlock ();
  <D.17705>:
  <D.17364>:
  D.17706 = add_stage_entry (1024, &next_fin_stage_entry, &fin_stage_entries, obj, user_data);
  if (D.17706 == -1) goto <D.17363>; else goto <D.17365>;
  <D.17365>:
}


try_lock_stage_for_processing (int num_entries, volatile gint32 * next_entry)
{
  gboolean D.17709;
  int D.17710;
  _Bool D.17711;
  gint32 old;

  old = *next_entry;
  if (old < num_entries) goto <D.17707>; else goto <D.17708>;
  <D.17707>:
  D.17709 = 0;
  return D.17709;
  <D.17708>:
  D.17710 = InterlockedCompareExchange (next_entry, -1, old);
  D.17711 = D.17710 == old;
  D.17709 = (gboolean) D.17711;
  return D.17709;
}


add_stage_entry (int num_entries, volatile gint32 * next_entry, struct StageEntry * entries, struct MonoObject * obj, void * user_data)
{
  int D.17715;
  unsigned int index.22;
  unsigned int D.17721;
  struct StageEntry * D.17722;
  int D.17723;
  volatile gint32 * D.17725;
  int D.17726;
  int D.17727;
  int D.17730;
  _Bool D.17733;
  _Bool D.17734;
  _Bool D.17735;
  int D.17736;
  _Bool D.17737;
  long int D.17738;
  long int D.17739;
  volatile gint32 * D.17742;
  _Bool D.17745;
  _Bool D.17746;
  _Bool D.17747;
  int D.17748;
  _Bool D.17749;
  long int D.17750;
  long int D.17751;
  _Bool D.17754;
  long int D.17755;
  long int D.17756;
  gint32 index;
  gint32 new_next_entry;
  gint32 old_next_entry;
  gint32 previous_state;
  void retry = <<< error >>>;

  retry:
  <D.17347>:
  index = *next_entry;
  if (index >= num_entries) goto <D.17713>; else goto <D.17714>;
  <D.17713>:
  D.17715 = -1;
  return D.17715;
  <D.17714>:
  if (index < 0) goto <D.17716>; else goto <D.17717>;
  <D.17716>:
  goto <D.17343>;
  <D.17342>:
  monoeg_g_usleep (200);
  <D.17343>:
  index = *next_entry;
  if (index < 0) goto <D.17342>; else goto <D.17344>;
  <D.17344>:
  // predicted unlikely by continue predictor.
  goto <D.17345>;
  <D.17717>:
  index.22 = (unsigned int) index;
  D.17721 = index.22 * 12;
  D.17722 = entries + D.17721;
  D.17723 = D.17722->state;
  if (D.17723 != 0) goto <D.17718>; else goto <D.17724>;
  <D.17724>:
  index.22 = (unsigned int) index;
  D.17721 = index.22 * 12;
  D.17722 = entries + D.17721;
  D.17725 = &D.17722->state;
  D.17726 = InterlockedCompareExchange (D.17725, 1, 0);
  if (D.17726 != 0) goto <D.17718>; else goto <D.17719>;
  <D.17718>:
  D.17727 = *next_entry;
  if (D.17727 == index) goto <D.17728>; else goto <D.17729>;
  <D.17728>:
  D.17730 = index + 1;
  InterlockedCompareExchange (next_entry, D.17730, index);
  <D.17729>:
  // predicted unlikely by continue predictor.
  goto <D.17345>;
  <D.17719>:
  mono_memory_write_barrier ();
  D.17730 = index + 1;
  old_next_entry = InterlockedCompareExchange (next_entry, D.17730, index);
  if (old_next_entry < index) goto <D.17731>; else goto <D.17732>;
  <D.17731>:
  index.22 = (unsigned int) index;
  D.17721 = index.22 * 12;
  D.17722 = entries + D.17721;
  D.17722->state = 0;
  // predicted unlikely by continue predictor.
  goto <D.17345>;
  <D.17732>:
  goto <D.17346>;
  <D.17345>:
  goto <D.17347>;
  <D.17346>:
  D.17733 = index < 0;
  D.17734 = index >= num_entries;
  D.17735 = D.17733 | D.17734;
  D.17736 = (int) D.17735;
  D.17737 = D.17736 != 0;
  D.17738 = (long int) D.17737;
  D.17739 = __builtin_expect (D.17738, 0);
  if (D.17739 != 0) goto <D.17740>; else goto <D.17741>;
  <D.17740>:
  monoeg_g_log (0B, 4, "Invalid index");
  <D.17348>:
  goto <D.17348>;
  <D.17741>:
  index.22 = (unsigned int) index;
  D.17721 = index.22 * 12;
  D.17722 = entries + D.17721;
  D.17722->obj = obj;
  index.22 = (unsigned int) index;
  D.17721 = index.22 * 12;
  D.17722 = entries + D.17721;
  D.17722->user_data = user_data;
  mono_memory_write_barrier ();
  new_next_entry = *next_entry;
  mono_memory_read_barrier ();
  index.22 = (unsigned int) index;
  D.17721 = index.22 * 12;
  D.17722 = entries + D.17721;
  D.17742 = &D.17722->state;
  previous_state = InterlockedCompareExchange (D.17742, 2, 1);
  if (previous_state == 1) goto <D.17743>; else goto <D.17744>;
  <D.17743>:
  D.17745 = new_next_entry < index;
  D.17746 = new_next_entry >= 0;
  D.17747 = D.17745 & D.17746;
  D.17748 = (int) D.17747;
  D.17749 = D.17748 != 0;
  D.17750 = (long int) D.17749;
  D.17751 = __builtin_expect (D.17750, 0);
  if (D.17751 != 0) goto <D.17752>; else goto <D.17753>;
  <D.17752>:
  monoeg_g_log (0B, 4, "Invalid next entry index - as long as we\'re busy, other thread can only increment or invalidate it");
  <D.17349>:
  goto <D.17349>;
  <D.17753>:
  D.17715 = index;
  return D.17715;
  <D.17744>:
  D.17754 = previous_state != 3;
  D.17755 = (long int) D.17754;
  D.17756 = __builtin_expect (D.17755, 0);
  if (D.17756 != 0) goto <D.17757>; else goto <D.17758>;
  <D.17757>:
  monoeg_g_log (0B, 4, "Invalid state transition - other thread can only make busy state invalid");
  <D.17350>:
  goto <D.17350>;
  <D.17758>:
  index.22 = (unsigned int) index;
  D.17721 = index.22 * 12;
  D.17722 = entries + D.17721;
  D.17722->obj = 0B;
  index.22 = (unsigned int) index;
  D.17721 = index.22 * 12;
  D.17722 = entries + D.17721;
  D.17722->user_data = 0B;
  mono_memory_write_barrier ();
  index.22 = (unsigned int) index;
  D.17721 = index.22 * 12;
  D.17722 = entries + D.17721;
  D.17722->state = 0;
  goto retry;
}


mono_memory_read_barrier ()
{
  mono_memory_barrier ();
}


mono_gc_finalizers_for_domain (struct MonoDomain * domain, struct MonoObject * * out_array, int out_size)
{
  int D.17762;
  unsigned int result.23;
  unsigned int D.17764;
  struct MonoObject * * D.17765;
  int D.17766;
  int D.17767;
  int result;

  pthread_mutex_lock (&gc_mutex);
  sgen_process_fin_stage_entries ();
  result = finalizers_for_domain (domain, out_array, out_size, &minor_finalizable_hash);
  if (result < out_size) goto <D.17760>; else goto <D.17761>;
  <D.17760>:
  D.17762 = out_size - result;
  result.23 = (unsigned int) result;
  D.17764 = result.23 * 4;
  D.17765 = out_array + D.17764;
  D.17766 = finalizers_for_domain (domain, D.17765, D.17762, &major_finalizable_hash);
  result = D.17766 + result;
  <D.17761>:
  sgen_gc_unlock ();
  D.17767 = result;
  return D.17767;
}


finalizers_for_domain (struct MonoDomain * domain, struct MonoObject * * out_array, int out_size, struct SgenHashTable * hash_table)
{
  int no_finalize.24;
  _Bool D.17773;
  _Bool D.17774;
  _Bool D.17775;
  int D.17776;
  unsigned int D.17777;
  struct MonoVTable * D.17778;
  struct MonoDomain * D.17779;
  struct SgenHashTableEntry * D.17782;
  unsigned int D.17783;
  unsigned int D.17784;
  int D.17787;
  int count.25;
  unsigned int count.26;
  unsigned int D.17790;
  struct MonoObject * * D.17791;
  unsigned int D.17794;
  int num_ready_finalizers.27;
  const char * D.17796;
  struct FILE * gc_debug_file.28;
  struct SgenHashTableEntry * D.17800;
  unsigned int D.17801;
  struct MonoObject * object;
  void * dummy;
  int count;

  no_finalize.24 = no_finalize;
  if (no_finalize.24 != 0) goto <D.17769>; else goto <D.17772>;
  <D.17772>:
  D.17773 = out_size == 0;
  D.17774 = out_array == 0B;
  D.17775 = D.17773 | D.17774;
  if (D.17775 != 0) goto <D.17769>; else goto <D.17770>;
  <D.17769>:
  D.17776 = 0;
  return D.17776;
  <D.17770>:
  count = 0;
  {
    struct SgenHashTable * __hash_table;
    struct SgenHashTableEntry * * __table;
    guint __i;

    __hash_table = hash_table;
    __table = __hash_table->table;
    __i = 0;
    goto <D.17386>;
    <D.17385>:
    {
      struct SgenHashTableEntry * * __iter;
      struct SgenHashTableEntry * * __next;

      D.17777 = __i * 4;
      __iter = __table + D.17777;
      goto <D.17383>;
      <D.17382>:
      {
        struct SgenHashTableEntry * __entry;

        __entry = *__iter;
        __next = &__entry->next;
        object = __entry->key;
        dummy = &__entry->data;
        object = tagged_object_get_object (object);
        D.17778 = object->vtable;
        D.17779 = D.17778->domain;
        if (D.17779 == domain) goto <D.17780>; else goto <D.17781>;
        <D.17780>:
        D.17782 = *__next;
        *__iter = D.17782;
        __next = __iter;
        D.17783 = __hash_table->num_entries;
        D.17784 = D.17783 + 4294967295;
        __hash_table->num_entries = D.17784;
        if (1 != 0) goto <D.17785>; else goto <D.17786>;
        <D.17785>:
        D.17787 = __hash_table->entry_mem_type;
        sgen_free_internal (__entry, D.17787);
        <D.17786>:
        count.25 = count;
        count = count.25 + 1;
        count.26 = (unsigned int) count.25;
        D.17790 = count.26 * 4;
        D.17791 = out_array + D.17790;
        *D.17791 = object;
        if (0 != 0) goto <D.17792>; else goto <D.17793>;
        <D.17792>:
        D.17794 = hash_table->num_entries;
        num_ready_finalizers.27 = num_ready_finalizers;
        D.17796 = sgen_safe_name (object);
        gc_debug_file.28 = gc_debug_file;
        fprintf (gc_debug_file.28, "Collecting object for finalization: %p (%s) (%d/%d)\n", object, D.17796, num_ready_finalizers.27, D.17794);
        gc_debug_file.28 = gc_debug_file;
        fflush (gc_debug_file.28);
        <D.17793>:
        if (count == out_size) goto <D.17798>; else goto <D.17799>;
        <D.17798>:
        D.17776 = count;
        return D.17776;
        <D.17799>:
        // predicted unlikely by continue predictor.
        goto <D.17381>;
        <D.17781>:
      }
      <D.17381>:
      __iter = __next;
      <D.17383>:
      D.17800 = *__iter;
      if (D.17800 != 0B) goto <D.17382>; else goto <D.17384>;
      <D.17384>:
    }
    __i = __i + 1;
    <D.17386>:
    D.17801 = hash_table->size;
    if (D.17801 > __i) goto <D.17385>; else goto <D.17387>;
    <D.17387>:
  }
  D.17776 = count;
  return D.17776;
}


sgen_null_link_in_range (int generation, gboolean before_finalization, struct ScanCopyContext ctx)
{
  unsigned int D.17803;
  void * D.17804;
  struct FILE * gc_debug_file.29;
  long unsigned int D.17810;
  long unsigned int D.17811;
  _Bool D.17812;
  long unsigned int D.17815;
  long unsigned int D.17816;
  gboolean (*<T2bea>) (char *) D.17821;
  int D.17822;
  int D.17825;
  struct SgenHashTableEntry * D.17830;
  unsigned int D.17831;
  unsigned int D.17832;
  int D.17835;
  char * copy.30;
  int D.17839;
  _Bool D.17843;
  long int D.17844;
  long int D.17845;
  long unsigned int iftmp.31;
  long unsigned int copy.32;
  long unsigned int D.17853;
  long unsigned int D.17854;
  void * D.17855;
  long unsigned int iftmp.33;
  long unsigned int D.17862;
  long unsigned int D.17863;
  void * D.17864;
  void * D.17867;
  struct SgenHashTableEntry * D.17868;
  unsigned int D.17869;
  void (*CopyOrMarkObjectFunc) (void * *, struct SgenGrayQueue *) copy_func;
  struct GrayQueue * queue;
  void * * link;
  void * dummy;
  struct SgenHashTable * hash;

  copy_func = ctx.copy_func;
  queue = ctx.queue;
  hash = get_dislink_hash_table (generation);
  {
    struct SgenHashTable * __hash_table;
    struct SgenHashTableEntry * * __table;
    guint __i;

    __hash_table = hash;
    __table = __hash_table->table;
    __i = 0;
    goto <D.17432>;
    <D.17431>:
    {
      struct SgenHashTableEntry * * __iter;
      struct SgenHashTableEntry * * __next;

      D.17803 = __i * 4;
      __iter = __table + D.17803;
      goto <D.17429>;
      <D.17428>:
      {
        struct SgenHashTableEntry * __entry;

        __entry = *__iter;
        __next = &__entry->next;
        link = __entry->key;
        dummy = &__entry->data;
        {
          char * object;
          gboolean track;

          D.17804 = *link;
          if (D.17804 == 0B) goto <D.17805>; else goto <D.17806>;
          <D.17805>:
          if (0 != 0) goto <D.17807>; else goto <D.17808>;
          <D.17807>:
          gc_debug_file.29 = gc_debug_file;
          fprintf (gc_debug_file.29, "Dislink %p was externally nullified\n", link);
          gc_debug_file.29 = gc_debug_file;
          fflush (gc_debug_file.29);
          <D.17808>:
          // predicted unlikely by continue predictor.
          goto <D.17426>;
          <D.17806>:
          D.17804 = *link;
          D.17810 = (long unsigned int) D.17804;
          D.17811 = D.17810 & 1;
          D.17812 = D.17811 == 0;
          track = (gboolean) D.17812;
          if (track != before_finalization) goto <D.17813>; else goto <D.17814>;
          <D.17813>:
          D.17804 = *link;
          D.17810 = (long unsigned int) D.17804;
          D.17815 = ~D.17810;
          D.17816 = D.17815 & 4294967292;
          object = (char *) D.17816;
          if (object == 0B) goto <D.17817>; else goto <D.17818>;
          <D.17817>:
          if (0 != 0) goto <D.17819>; else goto <D.17820>;
          <D.17819>:
          gc_debug_file.29 = gc_debug_file;
          fprintf (gc_debug_file.29, "Dislink %p with a hidden null object\n", link);
          gc_debug_file.29 = gc_debug_file;
          fflush (gc_debug_file.29);
          <D.17820>:
          // predicted unlikely by continue predictor.
          goto <D.17426>;
          <D.17818>:
          D.17821 = major_collector.is_object_live;
          D.17822 = D.17821 (object);
          if (D.17822 == 0) goto <D.17823>; else goto <D.17824>;
          <D.17823>:
          D.17825 = sgen_gc_is_object_ready_for_finalization (object);
          if (D.17825 != 0) goto <D.17826>; else goto <D.17827>;
          <D.17826>:
          *link = 0B;
          if (0 != 0) goto <D.17828>; else goto <D.17829>;
          <D.17828>:
          gc_debug_file.29 = gc_debug_file;
          fprintf (gc_debug_file.29, "Dislink nullified at %p to GCed object %p\n", link, object);
          gc_debug_file.29 = gc_debug_file;
          fflush (gc_debug_file.29);
          <D.17829>:
          D.17830 = *__next;
          *__iter = D.17830;
          __next = __iter;
          D.17831 = __hash_table->num_entries;
          D.17832 = D.17831 + 4294967295;
          __hash_table->num_entries = D.17832;
          if (1 != 0) goto <D.17833>; else goto <D.17834>;
          <D.17833>:
          D.17835 = __hash_table->entry_mem_type;
          sgen_free_internal (__entry, D.17835);
          <D.17834>:
          // predicted unlikely by continue predictor.
          goto <D.17426>;
          <D.17827>:
          {
            char * copy;

            try
              {
                copy = object;
                copy_func (&copy, queue);
                if (hash == &minor_disappearing_link_hash) goto <D.17837>; else goto <D.17836>;
                <D.17837>:
                copy.30 = copy;
                D.17839 = sgen_ptr_in_nursery (copy.30);
                if (D.17839 == 0) goto <D.17840>; else goto <D.17836>;
                <D.17840>:
                D.17830 = *__next;
                *__iter = D.17830;
                __next = __iter;
                D.17831 = __hash_table->num_entries;
                D.17832 = D.17831 + 4294967295;
                __hash_table->num_entries = D.17832;
                if (1 != 0) goto <D.17841>; else goto <D.17842>;
                <D.17841>:
                D.17835 = __hash_table->entry_mem_type;
                sgen_free_internal (__entry, D.17835);
                <D.17842>:
                copy.30 = copy;
                D.17843 = copy.30 == 0B;
                D.17844 = (long int) D.17843;
                D.17845 = __builtin_expect (D.17844, 0);
                if (D.17845 != 0) goto <D.17846>; else goto <D.17847>;
                <D.17846>:
                monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "sgen-fin-weak-hash.c", 700, "copy");
                <D.17847>:
                if (track != 0) goto <D.17849>; else goto <D.17850>;
                <D.17849>:
                iftmp.31 = 1;
                goto <D.17851>;
                <D.17850>:
                iftmp.31 = 0;
                <D.17851>:
                copy.30 = copy;
                copy.32 = (long unsigned int) copy.30;
                D.17853 = iftmp.31 | copy.32;
                D.17854 = ~D.17853;
                D.17855 = (void *) D.17854;
                *link = D.17855;
                copy.30 = copy;
                add_or_remove_disappearing_link (copy.30, link, 1);
                if (0 != 0) goto <D.17856>; else goto <D.17857>;
                <D.17856>:
                copy.30 = copy;
                gc_debug_file.29 = gc_debug_file;
                fprintf (gc_debug_file.29, "Upgraded dislink at %p to major because object %p moved to %p\n", link, object, copy.30);
                gc_debug_file.29 = gc_debug_file;
                fflush (gc_debug_file.29);
                <D.17857>:
                // predicted unlikely by continue predictor.
                goto <D.17426>;
                <D.17836>:
                if (track != 0) goto <D.17859>; else goto <D.17860>;
                <D.17859>:
                iftmp.33 = 1;
                goto <D.17861>;
                <D.17860>:
                iftmp.33 = 0;
                <D.17861>:
                copy.30 = copy;
                copy.32 = (long unsigned int) copy.30;
                D.17862 = iftmp.33 | copy.32;
                D.17863 = ~D.17862;
                D.17864 = (void *) D.17863;
                *link = D.17864;
                if (0 != 0) goto <D.17865>; else goto <D.17866>;
                <D.17865>:
                D.17804 = *link;
                D.17810 = (long unsigned int) D.17804;
                D.17815 = ~D.17810;
                D.17816 = D.17815 & 4294967292;
                D.17867 = (void *) D.17816;
                gc_debug_file.29 = gc_debug_file;
                fprintf (gc_debug_file.29, "Updated dislink at %p to %p\n", link, D.17867);
                gc_debug_file.29 = gc_debug_file;
                fflush (gc_debug_file.29);
                <D.17866>:
              }
            finally
              {
                copy = {CLOBBER};
              }
          }
          <D.17824>:
          <D.17814>:
        }
      }
      <D.17426>:
      __iter = __next;
      <D.17429>:
      D.17868 = *__iter;
      if (D.17868 != 0B) goto <D.17428>; else goto <D.17430>;
      <D.17430>:
    }
    __i = __i + 1;
    <D.17432>:
    D.17869 = hash->size;
    if (D.17869 > __i) goto <D.17431>; else goto <D.17433>;
    <D.17433>:
  }
}


get_dislink_hash_table (int generation)
{
  struct SgenHashTable * D.17872;

  switch (generation) <default: <D.17401>, case 0: <D.17399>, case 1: <D.17400>>
  <D.17399>:
  D.17872 = &minor_disappearing_link_hash;
  return D.17872;
  <D.17400>:
  D.17872 = &major_disappearing_link_hash;
  return D.17872;
  <D.17401>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "sgen-fin-weak-hash.c", 608);
}


add_or_remove_disappearing_link (struct MonoObject * obj, void * * link, int generation)
{
  int D.17876;
  const char * D.17881;
  unsigned int D.17882;
  struct FILE * gc_debug_file.34;
  const char * D.17886;
  struct MonoVTable * D.17887;
  struct MonoClass * D.17888;
  const char * D.17889;
  struct SgenHashTable * hash_table;

  hash_table = get_dislink_hash_table (generation);
  if (obj == 0B) goto <D.17874>; else goto <D.17875>;
  <D.17874>:
  D.17876 = sgen_hash_table_remove (hash_table, link, 0B);
  if (D.17876 != 0) goto <D.17877>; else goto <D.17878>;
  <D.17877>:
  if (0 != 0) goto <D.17879>; else goto <D.17880>;
  <D.17879>:
  D.17881 = sgen_generation_name (generation);
  D.17882 = hash_table->num_entries;
  gc_debug_file.34 = gc_debug_file;
  fprintf (gc_debug_file.34, "Removed dislink %p (%d) from %s table\n", link, D.17882, D.17881);
  gc_debug_file.34 = gc_debug_file;
  fflush (gc_debug_file.34);
  <D.17880>:
  <D.17878>:
  return;
  <D.17875>:
  sgen_hash_table_replace (hash_table, link, 0B, 0B);
  if (0 != 0) goto <D.17884>; else goto <D.17885>;
  <D.17884>:
  D.17886 = sgen_generation_name (generation);
  D.17887 = obj->vtable;
  D.17888 = D.17887->klass;
  D.17889 = D.17888->name;
  gc_debug_file.34 = gc_debug_file;
  fprintf (gc_debug_file.34, "Added dislink for object: %p (%s) at %p to %s table\n", obj, D.17889, link, D.17886);
  gc_debug_file.34 = gc_debug_file;
  fflush (gc_debug_file.34);
  <D.17885>:
}


sgen_null_links_for_domain (struct MonoDomain * domain, int generation)
{
  unsigned int D.17891;
  void * D.17892;
  long unsigned int D.17893;
  long unsigned int D.17894;
  long unsigned int D.17895;
  struct MonoVTable * D.17900;
  struct FILE * gc_debug_file.35;
  struct SgenHashTableEntry * D.17908;
  unsigned int D.17909;
  unsigned int D.17910;
  int D.17913;
  struct SgenHashTableEntry * D.17914;
  unsigned int D.17915;
  void * * link;
  void * dummy;
  struct SgenHashTable * hash;

  hash = get_dislink_hash_table (generation);
  {
    struct SgenHashTable * __hash_table;
    struct SgenHashTableEntry * * __table;
    guint __i;

    __hash_table = hash;
    __table = __hash_table->table;
    __i = 0;
    goto <D.17454>;
    <D.17453>:
    {
      struct SgenHashTableEntry * * __iter;
      struct SgenHashTableEntry * * __next;

      D.17891 = __i * 4;
      __iter = __table + D.17891;
      goto <D.17451>;
      <D.17450>:
      {
        struct SgenHashTableEntry * __entry;

        __entry = *__iter;
        __next = &__entry->next;
        link = __entry->key;
        dummy = &__entry->data;
        {
          char * object;

          D.17892 = *link;
          D.17893 = (long unsigned int) D.17892;
          D.17894 = ~D.17893;
          D.17895 = D.17894 & 4294967292;
          object = (char *) D.17895;
          D.17892 = *link;
          if (D.17892 != 0B) goto <D.17896>; else goto <D.17897>;
          <D.17896>:
          if (object != 0B) goto <D.17898>; else goto <D.17899>;
          <D.17898>:
          D.17900 = MEM[(struct MonoObject *)object].vtable;
          if (D.17900 == 0B) goto <D.17901>; else goto <D.17902>;
          <D.17901>:
          {
            gboolean free;

            free = 1;
            D.17892 = *link;
            if (D.17892 != 0B) goto <D.17903>; else goto <D.17904>;
            <D.17903>:
            *link = 0B;
            free = 0;
            if (0 != 0) goto <D.17905>; else goto <D.17906>;
            <D.17905>:
            gc_debug_file.35 = gc_debug_file;
            fprintf (gc_debug_file.35, "Disappearing link %p not freed\n", link);
            gc_debug_file.35 = gc_debug_file;
            fflush (gc_debug_file.35);
            <D.17906>:
            <D.17904>:
            D.17908 = *__next;
            *__iter = D.17908;
            __next = __iter;
            D.17909 = __hash_table->num_entries;
            D.17910 = D.17909 + 4294967295;
            __hash_table->num_entries = D.17910;
            if (free != 0) goto <D.17911>; else goto <D.17912>;
            <D.17911>:
            D.17913 = __hash_table->entry_mem_type;
            sgen_free_internal (__entry, D.17913);
            <D.17912>:
            // predicted unlikely by continue predictor.
            goto <D.17449>;
          }
          <D.17902>:
          <D.17899>:
          <D.17897>:
        }
      }
      <D.17449>:
      __iter = __next;
      <D.17451>:
      D.17914 = *__iter;
      if (D.17914 != 0B) goto <D.17450>; else goto <D.17452>;
      <D.17452>:
    }
    __i = __i + 1;
    <D.17454>:
    D.17915 = hash->size;
    if (D.17915 > __i) goto <D.17453>; else goto <D.17455>;
    <D.17455>:
  }
}


sgen_null_links_with_predicate (int generation, mono_bool (*WeakLinkAlivePredicateFunc) (struct MonoObject *, void *) predicate, void * data)
{
  unsigned int D.17916;
  void * D.17917;
  long unsigned int D.17918;
  long unsigned int D.17919;
  long unsigned int D.17920;
  struct FILE * gc_debug_file.36;
  struct SgenHashTableEntry * D.17928;
  unsigned int D.17929;
  unsigned int D.17930;
  int D.17933;
  struct SgenHashTableEntry * D.17934;
  unsigned int D.17935;
  void * * link;
  void * dummy;
  struct SgenHashTable * hash;

  hash = get_dislink_hash_table (generation);
  {
    struct SgenHashTable * __hash_table;
    struct SgenHashTableEntry * * __table;
    guint __i;

    __hash_table = hash;
    __table = __hash_table->table;
    __i = 0;
    goto <D.17477>;
    <D.17476>:
    {
      struct SgenHashTableEntry * * __iter;
      struct SgenHashTableEntry * * __next;

      D.17916 = __i * 4;
      __iter = __table + D.17916;
      goto <D.17474>;
      <D.17473>:
      {
        struct SgenHashTableEntry * __entry;

        __entry = *__iter;
        __next = &__entry->next;
        link = __entry->key;
        dummy = &__entry->data;
        {
          char * object;
          mono_bool is_alive;

          D.17917 = *link;
          D.17918 = (long unsigned int) D.17917;
          D.17919 = ~D.17918;
          D.17920 = D.17919 & 4294967292;
          object = (char *) D.17920;
          D.17917 = *link;
          if (D.17917 == 0B) goto <D.17921>; else goto <D.17922>;
          <D.17921>:
          // predicted unlikely by continue predictor.
          goto <D.17472>;
          <D.17922>:
          is_alive = predicate (object, data);
          if (is_alive == 0) goto <D.17923>; else goto <D.17924>;
          <D.17923>:
          *link = 0B;
          if (0 != 0) goto <D.17925>; else goto <D.17926>;
          <D.17925>:
          gc_debug_file.36 = gc_debug_file;
          fprintf (gc_debug_file.36, "Dislink nullified by predicate at %p to GCed object %p\n", link, object);
          gc_debug_file.36 = gc_debug_file;
          fflush (gc_debug_file.36);
          <D.17926>:
          D.17928 = *__next;
          *__iter = D.17928;
          __next = __iter;
          D.17929 = __hash_table->num_entries;
          D.17930 = D.17929 + 4294967295;
          __hash_table->num_entries = D.17930;
          if (1 != 0) goto <D.17931>; else goto <D.17932>;
          <D.17931>:
          D.17933 = __hash_table->entry_mem_type;
          sgen_free_internal (__entry, D.17933);
          <D.17932>:
          // predicted unlikely by continue predictor.
          goto <D.17472>;
          <D.17924>:
        }
      }
      <D.17472>:
      __iter = __next;
      <D.17474>:
      D.17934 = *__iter;
      if (D.17934 != 0B) goto <D.17473>; else goto <D.17475>;
      <D.17475>:
    }
    __i = __i + 1;
    <D.17477>:
    D.17935 = hash->size;
    if (D.17935 > __i) goto <D.17476>; else goto <D.17478>;
    <D.17478>:
  }
}


sgen_remove_finalizers_for_domain (struct MonoDomain * domain, int generation)
{
  unsigned int D.17936;
  struct MonoVTable * D.17937;
  struct MonoDomain * D.17938;
  const char * D.17943;
  struct FILE * gc_debug_file.37;
  struct SgenHashTableEntry * D.17945;
  unsigned int D.17946;
  unsigned int D.17947;
  int D.17950;
  struct SgenHashTableEntry * D.17951;
  unsigned int D.17952;
  struct SgenHashTable * hash_table;
  struct MonoObject * object;
  void * dummy;

  hash_table = get_finalize_entry_hash_table (generation);
  {
    struct SgenHashTable * __hash_table;
    struct SgenHashTableEntry * * __table;
    guint __i;

    __hash_table = hash_table;
    __table = __hash_table->table;
    __i = 0;
    goto <D.17497>;
    <D.17496>:
    {
      struct SgenHashTableEntry * * __iter;
      struct SgenHashTableEntry * * __next;

      D.17936 = __i * 4;
      __iter = __table + D.17936;
      goto <D.17494>;
      <D.17493>:
      {
        struct SgenHashTableEntry * __entry;

        __entry = *__iter;
        __next = &__entry->next;
        object = __entry->key;
        dummy = &__entry->data;
        object = tagged_object_get_object (object);
        D.17937 = object->vtable;
        D.17938 = D.17937->domain;
        if (D.17938 == domain) goto <D.17939>; else goto <D.17940>;
        <D.17939>:
        if (0 != 0) goto <D.17941>; else goto <D.17942>;
        <D.17941>:
        D.17943 = sgen_safe_name (object);
        gc_debug_file.37 = gc_debug_file;
        fprintf (gc_debug_file.37, "Unregistering finalizer for object: %p (%s)\n", object, D.17943);
        gc_debug_file.37 = gc_debug_file;
        fflush (gc_debug_file.37);
        <D.17942>:
        D.17945 = *__next;
        *__iter = D.17945;
        __next = __iter;
        D.17946 = __hash_table->num_entries;
        D.17947 = D.17946 + 4294967295;
        __hash_table->num_entries = D.17947;
        if (1 != 0) goto <D.17948>; else goto <D.17949>;
        <D.17948>:
        D.17950 = __hash_table->entry_mem_type;
        sgen_free_internal (__entry, D.17950);
        <D.17949>:
        // predicted unlikely by continue predictor.
        goto <D.17492>;
        <D.17940>:
      }
      <D.17492>:
      __iter = __next;
      <D.17494>:
      D.17951 = *__iter;
      if (D.17951 != 0B) goto <D.17493>; else goto <D.17495>;
      <D.17495>:
    }
    __i = __i + 1;
    <D.17497>:
    D.17952 = hash_table->size;
    if (D.17952 > __i) goto <D.17496>; else goto <D.17498>;
    <D.17498>:
  }
}


sgen_process_dislink_stage_entries ()
{
  lock_stage_for_processing (&next_dislink_stage_entry);
  process_stage_entries (1024, &next_dislink_stage_entry, &dislink_stage_entries, process_dislink_stage_entry);
}


process_dislink_stage_entry (struct MonoObject * obj, void * _link, int index)
{
  int D.17957;
  void * * link;

  link = _link;
  if (index >= 0) goto <D.17953>; else goto <D.17954>;
  <D.17953>:
  <D.17954>:
  add_or_remove_disappearing_link (0B, link, 0);
  add_or_remove_disappearing_link (0B, link, 1);
  if (obj != 0B) goto <D.17955>; else goto <D.17956>;
  <D.17955>:
  D.17957 = sgen_ptr_in_nursery (obj);
  if (D.17957 != 0) goto <D.17958>; else goto <D.17959>;
  <D.17958>:
  add_or_remove_disappearing_link (obj, link, 0);
  goto <D.17960>;
  <D.17959>:
  add_or_remove_disappearing_link (obj, link, 1);
  <D.17960>:
  <D.17956>:
}


sgen_register_disappearing_link (struct MonoObject * obj, void * * link, gboolean track, gboolean in_gc)
{
  long unsigned int iftmp.38;
  long unsigned int obj.39;
  long unsigned int D.17968;
  long unsigned int D.17969;
  void * D.17970;
  int D.17975;

  if (obj != 0B) goto <D.17961>; else goto <D.17962>;
  <D.17961>:
  if (track != 0) goto <D.17964>; else goto <D.17965>;
  <D.17964>:
  iftmp.38 = 1;
  goto <D.17966>;
  <D.17965>:
  iftmp.38 = 0;
  <D.17966>:
  obj.39 = (long unsigned int) obj;
  D.17968 = iftmp.38 | obj.39;
  D.17969 = ~D.17968;
  D.17970 = (void *) D.17969;
  *link = D.17970;
  goto <D.17971>;
  <D.17962>:
  *link = 0B;
  <D.17971>:
  if (in_gc != 0) goto <D.17972>; else goto <D.17973>;
  <D.17972>:
  process_dislink_stage_entry (obj, link, -1);
  goto <D.17974>;
  <D.17973>:
  {
    int index;

    goto <D.17518>;
    <D.17517>:
    D.17975 = try_lock_stage_for_processing (1024, &next_dislink_stage_entry);
    if (D.17975 != 0) goto <D.17976>; else goto <D.17977>;
    <D.17976>:
    pthread_mutex_lock (&gc_mutex);
    process_stage_entries (1024, &next_dislink_stage_entry, &dislink_stage_entries, process_dislink_stage_entry);
    sgen_gc_unlock ();
    <D.17977>:
    <D.17518>:
    index = add_stage_entry (1024, &next_dislink_stage_entry, &dislink_stage_entries, obj, link);
    if (index == -1) goto <D.17517>; else goto <D.17519>;
    <D.17519>:
  }
  <D.17974>:
}


sgen_init_fin_weak_hash ()
{

}


