mono_gc_base_init ()
{
  int gc_initialized.0;
  long unsigned int D.18882;
  void * sstart.1;
  unsigned int size.2;
  char * GC_stackbottom.3;
  char * stack_bottom.4;
  int D.18892;
  char * D.18895;
  char D.18898;
  int D.18900;
  long int max_heap.5;
  struct _IO_FILE * stderr.6;
  long unsigned int max_heap.7;
  char * D.18907;
  struct MonoThreadInfoCallbacks cb;
  const char * env;

  try
    {
      gc_initialized.0 = gc_initialized;
      if (gc_initialized.0 != 0) goto <D.18880>; else goto <D.18881>;
      <D.18880>:
      return;
      <D.18881>:
      {
        size_t size;
        void * sstart;
        union pthread_attr_t attr;

        try
          {
            D.18882 = pthread_self ();
            pthread_getattr_np (D.18882, &attr);
            pthread_attr_getstack (&attr, &sstart, &size);
            pthread_attr_destroy (&attr);
            sstart.1 = sstart;
            if (sstart.1 != 0B) goto <D.18884>; else goto <D.18885>;
            <D.18884>:
            sstart.1 = sstart;
            size.2 = size;
            GC_stackbottom.3 = sstart.1 + size.2;
            GC_stackbottom = GC_stackbottom.3;
            goto <D.18888>;
            <D.18885>:
            {
              int dummy;
              gsize stack_bottom;

              try
                {
                  stack_bottom = (gsize) &dummy;
                  stack_bottom = stack_bottom + 4095;
                  stack_bottom = stack_bottom & 4294963200;
                  stack_bottom.4 = (char *) stack_bottom;
                  GC_stackbottom = stack_bottom.4;
                }
              finally
                {
                  dummy = {CLOBBER};
                }
            }
            <D.18888>:
          }
        finally
          {
            size = {CLOBBER};
            sstart = {CLOBBER};
            attr = {CLOBBER};
          }
      }
      GC_no_dls = 1;
      GC_init ();
      GC_oom_fn = mono_gc_out_of_memory;
      GC_set_warn_proc (mono_gc_warning);
      GC_finalize_on_demand = 1;
      GC_finalizer_notifier = mono_gc_finalize_notify;
      GC_init_gcj_malloc (5, 0B);
      env = monoeg_g_getenv ("MONO_GC_PARAMS");
      if (env != 0B) goto <D.18890>; else goto <D.18891>;
      <D.18890>:
      {
        char * * ptr;
        char * * opts;

        opts = monoeg_g_strsplit (env, ",", -1);
        ptr = opts;
        goto <D.18543>;
        <D.18542>:
        {
          char * opt;

          opt = *ptr;
          D.18892 = monoeg_g_str_has_prefix (opt, "max-heap-size=");
          if (D.18892 != 0) goto <D.18893>; else goto <D.18894>;
          <D.18893>:
          {
            glong max_heap;

            try
              {
                D.18895 = __builtin_strchr (opt, 61);
                opt = D.18895 + 1;
                D.18898 = *opt;
                if (D.18898 != 0) goto <D.18899>; else goto <D.18896>;
                <D.18899>:
                D.18900 = mono_gc_parse_environment_string_extract_number (opt, &max_heap);
                if (D.18900 != 0) goto <D.18901>; else goto <D.18896>;
                <D.18901>:
                max_heap.5 = max_heap;
                if (max_heap.5 <= 16777215) goto <D.18903>; else goto <D.18904>;
                <D.18903>:
                stderr.6 = stderr;
                fprintf (stderr.6, "max-heap-size must be at least %dMb.\n", 16);
                exit (1);
                <D.18904>:
                max_heap.5 = max_heap;
                max_heap.7 = (long unsigned int) max_heap.5;
                GC_set_max_heap_size (max_heap.7);
                goto <D.18897>;
                <D.18896>:
                stderr.6 = stderr;
                fprintf (stderr.6, "max-heap-size must be an integer.\n");
                exit (1);
                <D.18897>:
                // predicted unlikely by continue predictor.
                goto <D.18541>;
              }
            finally
              {
                max_heap = {CLOBBER};
              }
          }
          <D.18894>:
        }
        <D.18541>:
        ptr = ptr + 4;
        <D.18543>:
        D.18907 = *ptr;
        if (D.18907 != 0B) goto <D.18542>; else goto <D.18544>;
        <D.18544>:
        monoeg_g_strfreev (opts);
      }
      <D.18891>:
      memset (&cb, 0, 24);
      cb.thread_register = boehm_thread_register;
      cb.mono_method_is_critical = mono_runtime_is_critical_method;
      cb.mono_gc_pthread_create = mono_gc_pthread_create;
      mono_threads_init (&cb, 168);
      pthread_mutex_init (&mono_gc_lock, 0B);
      mono_gc_enable_events ();
      gc_initialized = 1;
    }
  finally
    {
      cb = {CLOBBER};
    }
}


boehm_thread_register (struct MonoThreadInfo * info, void * baseptr)
{
  int D.18912;
  void * D.18915;
  void * iftmp.8;
  int D.18917;

  D.18912 = mono_gc_is_gc_thread ();
  if (D.18912 != 0) goto <D.18913>; else goto <D.18914>;
  <D.18913>:
  D.18915 = info;
  return D.18915;
  <D.18914>:
  D.18917 = GC_thread_register_foreign (baseptr);
  if (D.18917 != 0) goto <D.18918>; else goto <D.18919>;
  <D.18918>:
  iftmp.8 = info;
  goto <D.18920>;
  <D.18919>:
  iftmp.8 = 0B;
  <D.18920>:
  D.18915 = iftmp.8;
  return D.18915;
}


mono_gc_warning (char * msg, GC_word arg)
{
  mono_trace (16, 8, msg, arg);
}


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

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


memset (void * __dest, int __ch, size_t __len)
{
  int D.18926;
  int D.18931;
  void * D.18933;
  unsigned int D.18934;

  D.18926 = __builtin_constant_p (__len);
  if (D.18926 != 0) goto <D.18927>; else goto <D.18928>;
  <D.18927>:
  if (__len == 0) goto <D.18929>; else goto <D.18930>;
  <D.18929>:
  D.18931 = __builtin_constant_p (__ch);
  if (D.18931 == 0) goto <D.18924>; else goto <D.18932>;
  <D.18932>:
  if (__ch != 0) goto <D.18924>; else goto <D.18925>;
  <D.18924>:
  __warn_memset_zero_len ();
  D.18933 = __dest;
  return D.18933;
  <D.18925>:
  <D.18930>:
  <D.18928>:
  D.18934 = __builtin_object_size (__dest, 0);
  D.18933 = __builtin___memset_chk (__dest, __ch, __len, D.18934);
  return D.18933;
}


mono_gc_collect (int generation)
{
  struct MonoPerfCounters * mono_perfcounters.9;
  unsigned int D.18937;
  unsigned int D.18938;

  mono_perfcounters.9 = mono_perfcounters;
  D.18937 = mono_perfcounters.9->gc_induced;
  D.18938 = D.18937 + 1;
  mono_perfcounters.9->gc_induced = D.18938;
  GC_gcollect ();
}


mono_gc_max_generation ()
{
  int D.18939;

  D.18939 = 0;
  return D.18939;
}


mono_gc_get_generation (struct MonoObject * object)
{
  int D.18941;

  D.18941 = 0;
  return D.18941;
}


mono_gc_collection_count (int generation)
{
  int D.18943;
  long unsigned int GC_gc_no.10;

  GC_gc_no.10 = GC_gc_no;
  D.18943 = (int) GC_gc_no.10;
  return D.18943;
}


mono_gc_add_memory_pressure (gint64 value)
{

}


mono_gc_get_used_size ()
{
  int64_t D.18946;
  unsigned int D.18947;
  unsigned int D.18948;
  unsigned int D.18949;

  D.18947 = GC_get_heap_size ();
  D.18948 = GC_get_free_bytes ();
  D.18949 = D.18947 - D.18948;
  D.18946 = (int64_t) D.18949;
  return D.18946;
}


mono_gc_get_heap_size ()
{
  int64_t D.18951;
  unsigned int D.18952;

  D.18952 = GC_get_heap_size ();
  D.18951 = (int64_t) D.18952;
  return D.18951;
}


mono_gc_is_gc_thread ()
{
  gboolean D.18954;

  D.18954 = GC_thread_is_registered ();
  return D.18954;
}


mono_gc_register_thread (void * baseptr)
{
  gboolean D.18956;
  struct MonoThreadInfo * D.18957;
  _Bool D.18958;

  D.18957 = mono_thread_info_attach (baseptr);
  D.18958 = D.18957 != 0B;
  D.18956 = (gboolean) D.18958;
  return D.18956;
}


mono_object_is_alive (struct MonoObject * o)
{
  gboolean D.18960;

  D.18960 = GC_is_marked (o);
  return D.18960;
}


mono_gc_walk_heap (int flags, int (*MonoGCReferences) (struct MonoObject *, struct MonoClass *, uintptr_t, uintptr_t, struct MonoObject * *, uintptr_t *, void *) callback, void * data)
{
  int D.18962;

  D.18962 = 1;
  return D.18962;
}


mono_gc_enable_events ()
{
  GC_notify_event = on_gc_notification;
  GC_on_heap_resize = on_gc_heap_resize;
}


on_gc_heap_resize (size_t new_size)
{
  unsigned int D.18964;
  struct MonoPerfCounters * mono_perfcounters.11;
  unsigned int D.18968;
  long long int D.18969;
  guint64 heap_size;

  D.18964 = GC_get_heap_size ();
  heap_size = (guint64) D.18964;
  mono_perfcounters.11 = mono_perfcounters;
  if (mono_perfcounters.11 != 0B) goto <D.18966>; else goto <D.18967>;
  <D.18966>:
  mono_perfcounters.11 = mono_perfcounters;
  D.18968 = (unsigned int) heap_size;
  mono_perfcounters.11->gc_committed_bytes = D.18968;
  mono_perfcounters.11 = mono_perfcounters;
  D.18968 = (unsigned int) heap_size;
  mono_perfcounters.11->gc_reserved_bytes = D.18968;
  mono_perfcounters.11 = mono_perfcounters;
  D.18968 = (unsigned int) heap_size;
  mono_perfcounters.11->gc_gen0size = D.18968;
  <D.18967>:
  D.18969 = (long long int) new_size;
  mono_profiler_gc_heap_resize (D.18969);
}


on_gc_notification (GCEventType event)
{
  struct MonoPerfCounters * mono_perfcounters.12;
  unsigned int D.18973;
  unsigned int D.18974;
  int D.18975;
  int D.18976;
  long long int gc_start_time.13;
  unsigned int D.18980;
  unsigned int D.18981;
  long long unsigned int D.18982;
  unsigned int D.18983;
  unsigned int D.18984;
  long long int D.18985;
  long long int gc_start_time.14;
  long long int D.18987;
  long long int D.18988;
  long long int D.18989;
  long long int D.18990;
  long long int D.18991;
  long long int D.18992;
  long long int D.18993;
  MonoGCEvent e;

  e = event;
  switch (e) <default: <D.18994>, case 0: <D.18596>, case 5: <D.18597>, case 6: <D.18591>, case 7: <D.18593>, case 8: <D.18594>, case 9: <D.18595>>
  <D.18591>:
  mono_thread_info_suspend_lock ();
  goto <D.18592>;
  <D.18593>:
  goto <D.18592>;
  <D.18594>:
  goto <D.18592>;
  <D.18595>:
  mono_thread_info_suspend_unlock ();
  goto <D.18592>;
  <D.18596>:
  mono_perfcounters.12 = mono_perfcounters;
  if (mono_perfcounters.12 != 0B) goto <D.18971>; else goto <D.18972>;
  <D.18971>:
  mono_perfcounters.12 = mono_perfcounters;
  D.18973 = mono_perfcounters.12->gc_collections0;
  D.18974 = D.18973 + 1;
  mono_perfcounters.12->gc_collections0 = D.18974;
  <D.18972>:
  D.18975 = gc_stats.major_gc_count;
  D.18976 = D.18975 + 1;
  gc_stats.major_gc_count = D.18976;
  gc_start_time.13 = mono_100ns_ticks ();
  gc_start_time = gc_start_time.13;
  goto <D.18592>;
  <D.18597>:
  mono_perfcounters.12 = mono_perfcounters;
  if (mono_perfcounters.12 != 0B) goto <D.18978>; else goto <D.18979>;
  <D.18978>:
  {
    guint64 heap_size;
    guint64 used_size;

    D.18980 = GC_get_heap_size ();
    heap_size = (guint64) D.18980;
    D.18981 = GC_get_free_bytes ();
    D.18982 = (long long unsigned int) D.18981;
    used_size = heap_size - D.18982;
    mono_perfcounters.12 = mono_perfcounters;
    D.18983 = (unsigned int) used_size;
    mono_perfcounters.12->gc_total_bytes = D.18983;
    mono_perfcounters.12 = mono_perfcounters;
    D.18984 = (unsigned int) heap_size;
    mono_perfcounters.12->gc_committed_bytes = D.18984;
    mono_perfcounters.12 = mono_perfcounters;
    D.18984 = (unsigned int) heap_size;
    mono_perfcounters.12->gc_reserved_bytes = D.18984;
    mono_perfcounters.12 = mono_perfcounters;
    D.18984 = (unsigned int) heap_size;
    mono_perfcounters.12->gc_gen0size = D.18984;
  }
  <D.18979>:
  D.18985 = mono_100ns_ticks ();
  gc_start_time.14 = gc_start_time;
  D.18987 = D.18985 - gc_start_time.14;
  D.18988 = D.18987 / 10;
  D.18989 = gc_stats.major_gc_time_usecs;
  D.18990 = D.18989 + D.18988;
  gc_stats.major_gc_time_usecs = D.18990;
  D.18991 = mono_100ns_ticks ();
  gc_start_time.14 = gc_start_time;
  D.18992 = D.18991 - gc_start_time.14;
  D.18993 = D.18992 / 10;
  mono_trace (32, 8, "gc took %d usecs", D.18993);
  goto <D.18592>;
  <D.18994>:
  <D.18592>:
  mono_profiler_gc_event (e, 0);
}


mono_gc_register_root (char * start, size_t size, void * descr)
{
  sizetype D.18995;
  char * D.18996;
  int D.18997;

  D.18995 = size + 1;
  D.18996 = start + D.18995;
  GC_add_roots (start, D.18996);
  D.18997 = 1;
  return D.18997;
}


mono_gc_deregister_root (char * addr)
{
  char * D.18999;

  D.18999 = addr + 5;
  GC_remove_roots (addr, D.18999);
}


mono_gc_weak_link_add (void * * link_addr, struct MonoObject * obj, gboolean track)
{
  long unsigned int obj.15;
  long unsigned int D.19001;
  void * D.19002;

  obj.15 = (long unsigned int) obj;
  D.19001 = ~obj.15;
  D.19002 = (void *) D.19001;
  *link_addr = D.19002;
  if (track != 0) goto <D.19003>; else goto <D.19004>;
  <D.19003>:
  GC_register_long_link (link_addr, obj);
  goto <D.19005>;
  <D.19004>:
  GC_general_register_disappearing_link (link_addr, obj);
  <D.19005>:
}


mono_gc_weak_link_remove (void * * link_addr, gboolean track)
{
  if (track != 0) goto <D.19006>; else goto <D.19007>;
  <D.19006>:
  GC_unregister_long_link (link_addr);
  goto <D.19008>;
  <D.19007>:
  GC_unregister_disappearing_link (link_addr);
  <D.19008>:
  *link_addr = 0B;
}


mono_gc_weak_link_get (void * * link_addr)
{
  struct MonoObject * D.19011;
  struct MonoObject * obj;

  obj = GC_call_with_alloc_lock (reveal_link, link_addr);
  if (obj == 4294967295B) goto <D.19009>; else goto <D.19010>;
  <D.19009>:
  D.19011 = 0B;
  return D.19011;
  <D.19010>:
  D.19011 = obj;
  return D.19011;
}


reveal_link (void * link_addr)
{
  void * D.19013;
  void * D.19014;
  long unsigned int D.19015;
  long unsigned int D.19016;
  void * * link_a;

  link_a = link_addr;
  D.19014 = *link_a;
  D.19015 = (long unsigned int) D.19014;
  D.19016 = ~D.19015;
  D.19013 = (void *) D.19016;
  return D.19013;
}


mono_gc_make_descr_for_string (gsize * bitmap, int numbits)
{
  void * D.19018;

  D.19018 = mono_gc_make_descr_from_bitmap (bitmap, numbits);
  return D.19018;
}


mono_gc_make_descr_for_object (gsize * bitmap, int numbits, size_t obj_size)
{
  void * D.19020;

  D.19020 = mono_gc_make_descr_from_bitmap (bitmap, numbits);
  return D.19020;
}


mono_gc_make_descr_for_array (int vector, gsize * elem_bitmap, int numbits, size_t elem_size)
{
  void * D.19022;

  D.19022 = 0B;
  return D.19022;
}


mono_gc_make_descr_from_bitmap (gsize * bitmap, int numbits)
{
  void * D.19026;
  unsigned int numbits.16;
  long unsigned int D.19028;

  if (numbits > 29) goto <D.19024>; else goto <D.19025>;
  <D.19024>:
  D.19026 = 0B;
  return D.19026;
  <D.19025>:
  numbits.16 = (unsigned int) numbits;
  D.19028 = GC_make_descriptor (bitmap, numbits.16);
  D.19026 = (void *) D.19028;
  return D.19026;
}


mono_gc_make_root_descr_all_refs (int numbits)
{
  void * D.19030;

  D.19030 = 0B;
  return D.19030;
}


mono_gc_alloc_fixed (size_t size, void * descr)
{
  void * D.19034;
  long unsigned int descr.17;

  if (descr != 0B) goto <D.19032>; else goto <D.19033>;
  <D.19032>:
  descr.17 = (long unsigned int) descr;
  D.19034 = GC_malloc_explicitly_typed (size, descr.17);
  return D.19034;
  <D.19033>:
  D.19034 = GC_local_malloc (size);
  return D.19034;
}


mono_gc_free_fixed (void * addr)
{

}


mono_gc_invoke_finalizers ()
{
  int D.19037;
  int D.19040;

  D.19037 = GC_should_invoke_finalizers ();
  if (D.19037 != 0) goto <D.19038>; else goto <D.19039>;
  <D.19038>:
  D.19040 = GC_invoke_finalizers ();
  return D.19040;
  <D.19039>:
  D.19040 = 0;
  return D.19040;
}


mono_gc_pending_finalizers ()
{
  gboolean D.19042;

  D.19042 = GC_should_invoke_finalizers ();
  return D.19042;
}


mono_gc_wbarrier_set_field (struct MonoObject * obj, void * field_ptr, struct MonoObject * value)
{
  MEM[(void * *)field_ptr] = value;
}


mono_gc_wbarrier_set_arrayref (struct MonoArray * arr, void * slot_ptr, struct MonoObject * value)
{
  MEM[(void * *)slot_ptr] = value;
}


mono_gc_wbarrier_arrayref_copy (void * dest_ptr, void * src_ptr, int count)
{
  unsigned int count.18;
  unsigned int D.19045;

  count.18 = (unsigned int) count;
  D.19045 = count.18 * 4;
  mono_gc_memmove_aligned (dest_ptr, src_ptr, D.19045);
}


mono_gc_wbarrier_generic_store (void * ptr, struct MonoObject * value)
{
  MEM[(void * *)ptr] = value;
}


mono_gc_wbarrier_generic_store_atomic (void * ptr, struct MonoObject * value)
{
  InterlockedWritePointer (ptr, value);
}


InterlockedWritePointer (void * volatile * dst, void * val)
{
  InterlockedExchangePointer (dst, val);
}


InterlockedExchangePointer (void * volatile * val, void * new_val)
{
  unsigned int new_val.19;
  unsigned int old_val.20;
  unsigned int D.19048;
  void * D.19049;
  void * D.19050;
  void * old_val;

  <D.17631>:
  old_val = *val;
  new_val.19 = (unsigned int) new_val;
  old_val.20 = (unsigned int) old_val;
  D.19048 = __sync_val_compare_and_swap_4 (val, old_val.20, new_val.19);
  D.19049 = (void *) D.19048;
  if (D.19049 != old_val) goto <D.17631>; else goto <D.17632>;
  <D.17632>:
  D.19050 = old_val;
  return D.19050;
}


mono_gc_wbarrier_generic_nostore (void * ptr)
{

}


mono_gc_wbarrier_value_copy (void * dest, void * src, int count, struct MonoClass * klass)
{
  int D.19052;
  int D.19053;
  unsigned int D.19054;

  D.19052 = mono_class_value_size (klass, 0B);
  D.19053 = D.19052 * count;
  D.19054 = (unsigned int) D.19053;
  mono_gc_memmove_atomic (dest, src, D.19054);
}


mono_gc_wbarrier_object_copy (struct MonoObject * obj, struct MonoObject * src)
{
  struct MonoVTable * D.19055;
  struct MonoClass * D.19056;
  int D.19057;
  unsigned int D.19058;
  unsigned int D.19059;
  const void * D.19060;
  void * D.19061;

  D.19055 = obj->vtable;
  D.19056 = D.19055->klass;
  D.19057 = D.19056->instance_size;
  D.19058 = (unsigned int) D.19057;
  D.19059 = D.19058 + 4294967288;
  D.19060 = src + 8;
  D.19061 = obj + 8;
  mono_gc_memmove_aligned (D.19061, D.19060, D.19059);
}


mono_gc_clear_domain (struct MonoDomain * domain)
{

}


mono_gc_get_suspend_signal ()
{
  int D.19062;

  D.19062 = -1;
  return D.19062;
}


mono_gc_get_managed_allocator (struct MonoClass * klass, gboolean for_box)
{
  struct MonoMethod * D.19066;
  int D.19067;
  int GC_all_interior_pointers.21;
  int D.19069;
  int D.19074;
  unsigned char D.19076;
  unsigned char D.19077;
  <unnamed type> D.19079;
  unsigned int D.19080;
  unsigned char D.19081;
  struct MonoType * D.19084;
  int D.19085;
  unsigned char D.19088;
  unsigned char D.19092;
  unsigned char D.19093;
  int offset;
  int atype;

  offset = -1;
  __asm__("movl $GC_thread_tls@ntpoff, %0" : "=r" offset);
  if (offset == -1) goto <D.19064>; else goto <D.19065>;
  <D.19064>:
  D.19066 = 0B;
  return D.19066;
  <D.19065>:
  D.19067 = klass->instance_size;
  GC_all_interior_pointers.21 = GC_all_interior_pointers;
  D.19069 = D.19067 + GC_all_interior_pointers.21;
  if (D.19069 > 512) goto <D.19070>; else goto <D.19071>;
  <D.19070>:
  D.19066 = 0B;
  return D.19066;
  <D.19071>:
  D.19074 = mono_class_has_finalizer (klass);
  if (D.19074 != 0) goto <D.19072>; else goto <D.19075>;
  <D.19075>:
  D.19076 = BIT_FIELD_REF <*klass, 8, 176>;
  D.19077 = D.19076 & 64;
  if (D.19077 != 0) goto <D.19072>; else goto <D.19078>;
  <D.19078>:
  D.19079 = mono_profiler_get_events ();
  D.19080 = D.19079 & 128;
  if (D.19080 != 0) goto <D.19072>; else goto <D.19073>;
  <D.19072>:
  D.19066 = 0B;
  return D.19066;
  <D.19073>:
  D.19081 = klass->rank;
  if (D.19081 != 0) goto <D.19082>; else goto <D.19083>;
  <D.19082>:
  D.19066 = 0B;
  return D.19066;
  <D.19083>:
  D.19084 = &klass->byval_arg;
  D.19085 = mono_class_is_open_constructed_type (D.19084);
  if (D.19085 != 0) goto <D.19086>; else goto <D.19087>;
  <D.19086>:
  D.19066 = 0B;
  return D.19066;
  <D.19087>:
  D.19088 = klass->byval_arg.type;
  if (D.19088 == 14) goto <D.19089>; else goto <D.19090>;
  <D.19089>:
  atype = 4;
  goto <D.19091>;
  <D.19090>:
  D.19092 = BIT_FIELD_REF <*klass, 8, 184>;
  D.19093 = D.19092 & 8;
  if (D.19093 == 0) goto <D.19094>; else goto <D.19095>;
  <D.19094>:
  if (for_box != 0) goto <D.19096>; else goto <D.19097>;
  <D.19096>:
  atype = 1;
  goto <D.19098>;
  <D.19097>:
  atype = 0;
  <D.19098>:
  goto <D.19099>;
  <D.19095>:
  D.19066 = 0B;
  return D.19066;
  <D.19099>:
  <D.19091>:
  D.19066 = mono_gc_get_managed_allocator_by_type (atype);
  return D.19066;
}


mono_gc_get_managed_array_allocator (struct MonoClass * klass)
{
  struct MonoMethod * D.19101;

  D.19101 = 0B;
  return D.19101;
}


mono_gc_get_managed_allocator_by_type (int atype)
{
  struct MonoMethod * D.19105;
  struct MonoMethod * D.19106;
  int offset;
  struct MonoMethod * res;

  offset = -1;
  __asm__("movl $GC_thread_tls@ntpoff, %0" : "=r" offset);
  mono_tls_key_set_offset (7, offset);
  res = alloc_method_cache[atype];
  if (res != 0B) goto <D.19103>; else goto <D.19104>;
  <D.19103>:
  D.19105 = res;
  return D.19105;
  <D.19104>:
  res = create_allocator (atype, 7);
  pthread_mutex_lock (&mono_gc_lock);
  D.19106 = alloc_method_cache[atype];
  if (D.19106 != 0B) goto <D.19107>; else goto <D.19108>;
  <D.19107>:
  mono_free_method (res);
  res = alloc_method_cache[atype];
  goto <D.19109>;
  <D.19108>:
  mono_memory_barrier ();
  alloc_method_cache[atype] = res;
  <D.19109>:
  pthread_mutex_unlock (&mono_gc_lock);
  D.19105 = res;
  return D.19105;
}


create_allocator (int atype, int tls_key)
{
  struct MonoImage * D.19113;
  struct MonoClass * D.19114;
  struct MonoType * D.19115;
  struct MonoClass * D.19116;
  struct MonoType * D.19117;
  struct MonoClass * D.19118;
  struct MonoType * D.19119;
  struct MonoClass * D.19121;
  struct MonoType * D.19122;
  unsigned int bytes_var.22;
  int D.19129;
  int D.19130;
  unsigned int index_var.23;
  unsigned int atype.24;
  _Bool D.19133;
  _Bool D.19134;
  _Bool D.19135;
  unsigned int my_fl_var.25;
  unsigned int my_entry_var.26;
  unsigned int end_var.27;
  unsigned int start_var.28;
  unsigned char D.19151;
  int D.19152;
  unsigned char D.19153;
  unsigned char D.19154;
  unsigned char D.19155;
  int D.19156;
  _Bool D.19158;
  _Bool D.19159;
  struct MonoMethodHeader * D.19171;
  struct MonoMethod * D.19172;
  int index_var;
  int bytes_var;
  int my_fl_var;
  int my_entry_var;
  guint32 no_freelist_branch;
  guint32 not_small_enough_branch;
  guint32 size_overflow_branch;
  struct MonoMethodBuilder * mb;
  struct MonoMethod * res;
  struct MonoMethodSignature * csig;
  struct AllocatorWrapperInfo * info;

  not_small_enough_branch = 0;
  size_overflow_branch = 0;
  if (atype == 4) goto <D.19111>; else goto <D.19112>;
  <D.19111>:
  D.19113 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.19113, 2);
  D.19114 = mono_defaults.string_class;
  D.19115 = &D.19114->byval_arg;
  csig->ret = D.19115;
  D.19116 = mono_defaults.int_class;
  D.19117 = &D.19116->byval_arg;
  csig->params[0] = D.19117;
  D.19118 = mono_defaults.int32_class;
  D.19119 = &D.19118->byval_arg;
  csig->params[1] = D.19119;
  goto <D.19120>;
  <D.19112>:
  D.19113 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.19113, 1);
  D.19121 = mono_defaults.object_class;
  D.19122 = &D.19121->byval_arg;
  csig->ret = D.19122;
  D.19116 = mono_defaults.int_class;
  D.19117 = &D.19116->byval_arg;
  csig->params[0] = D.19117;
  <D.19120>:
  D.19121 = mono_defaults.object_class;
  mb = mono_mb_new (D.19121, "Alloc", 28);
  D.19118 = mono_defaults.int32_class;
  D.19119 = &D.19118->byval_arg;
  bytes_var = mono_mb_add_local (mb, D.19119);
  if (atype == 4) goto <D.19123>; else goto <D.19124>;
  <D.19123>:
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icon (mb, 1);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_icon (mb, 1);
  mono_mb_emit_byte (mb, 98);
  mono_mb_emit_icon (mb, 12);
  mono_mb_emit_byte (mb, 88);
  bytes_var.22 = (unsigned int) bytes_var;
  mono_mb_emit_stloc (mb, bytes_var.22);
  goto <D.19126>;
  <D.19124>:
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_icon (mb, 0);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_icon (mb, 16);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 75);
  bytes_var.22 = (unsigned int) bytes_var;
  mono_mb_emit_stloc (mb, bytes_var.22);
  <D.19126>:
  if (atype == 4) goto <D.19127>; else goto <D.19128>;
  <D.19127>:
  bytes_var.22 = (unsigned int) bytes_var;
  mono_mb_emit_ldloc (mb, bytes_var.22);
  mono_mb_emit_icon (mb, 512);
  not_small_enough_branch = mono_mb_emit_short_branch (mb, 53);
  bytes_var.22 = (unsigned int) bytes_var;
  mono_mb_emit_ldloc (mb, bytes_var.22);
  mono_mb_emit_icon (mb, 12);
  size_overflow_branch = mono_mb_emit_short_branch (mb, 54);
  <D.19128>:
  D.19118 = mono_defaults.int32_class;
  D.19119 = &D.19118->byval_arg;
  index_var = mono_mb_add_local (mb, D.19119);
  bytes_var.22 = (unsigned int) bytes_var;
  mono_mb_emit_ldloc (mb, bytes_var.22);
  mono_mb_emit_icon (mb, 7);
  mono_mb_emit_byte (mb, 88);
  D.19129 = shift_amount (8);
  mono_mb_emit_icon (mb, D.19129);
  mono_mb_emit_byte (mb, 100);
  D.19130 = shift_amount (4);
  mono_mb_emit_icon (mb, D.19130);
  mono_mb_emit_byte (mb, 98);
  index_var.23 = (unsigned int) index_var;
  mono_mb_emit_stloc (mb, index_var.23);
  D.19116 = mono_defaults.int_class;
  D.19117 = &D.19116->byval_arg;
  my_fl_var = mono_mb_add_local (mb, D.19117);
  D.19116 = mono_defaults.int_class;
  D.19117 = &D.19116->byval_arg;
  my_entry_var = mono_mb_add_local (mb, D.19117);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 13);
  mono_mb_emit_i4 (mb, tls_key);
  atype.24 = (unsigned int) atype;
  D.19133 = atype.24 <= 1;
  D.19134 = atype == 4;
  D.19135 = D.19133 | D.19134;
  if (D.19135 != 0) goto <D.19136>; else goto <D.19137>;
  <D.19136>:
  mono_mb_emit_icon (mb, 48);
  goto <D.19138>;
  <D.19137>:
  if (atype == 2) goto <D.19139>; else goto <D.19140>;
  <D.19139>:
  mono_mb_emit_icon (mb, 308);
  goto <D.19141>;
  <D.19140>:
  if (atype == 3) goto <D.19142>; else goto <D.19143>;
  <D.19142>:
  mono_mb_emit_icon (mb, 568);
  goto <D.19144>;
  <D.19143>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "boehm-gc.c", 781);
  <D.19144>:
  <D.19141>:
  <D.19138>:
  mono_mb_emit_byte (mb, 88);
  index_var.23 = (unsigned int) index_var;
  mono_mb_emit_ldloc (mb, index_var.23);
  mono_mb_emit_byte (mb, 88);
  my_fl_var.25 = (unsigned int) my_fl_var;
  mono_mb_emit_stloc (mb, my_fl_var.25);
  my_fl_var.25 = (unsigned int) my_fl_var;
  mono_mb_emit_ldloc (mb, my_fl_var.25);
  mono_mb_emit_byte (mb, 77);
  my_entry_var.26 = (unsigned int) my_entry_var;
  mono_mb_emit_stloc (mb, my_entry_var.26);
  my_entry_var.26 = (unsigned int) my_entry_var;
  mono_mb_emit_ldloc (mb, my_entry_var.26);
  mono_mb_emit_icon (mb, 4096);
  no_freelist_branch = mono_mb_emit_short_branch (mb, 55);
  my_fl_var.25 = (unsigned int) my_fl_var;
  mono_mb_emit_ldloc (mb, my_fl_var.25);
  my_entry_var.26 = (unsigned int) my_entry_var;
  mono_mb_emit_ldloc (mb, my_entry_var.26);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_byte (mb, 223);
  my_entry_var.26 = (unsigned int) my_entry_var;
  mono_mb_emit_ldloc (mb, my_entry_var.26);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 223);
  if (atype == 0) goto <D.19147>; else goto <D.19148>;
  <D.19147>:
  {
    int start_var;
    int end_var;
    int start_loop;

    D.19116 = mono_defaults.int_class;
    D.19117 = &D.19116->byval_arg;
    start_var = mono_mb_add_local (mb, D.19117);
    D.19116 = mono_defaults.int_class;
    D.19117 = &D.19116->byval_arg;
    end_var = mono_mb_add_local (mb, D.19117);
    my_entry_var.26 = (unsigned int) my_entry_var;
    mono_mb_emit_ldloc (mb, my_entry_var.26);
    bytes_var.22 = (unsigned int) bytes_var;
    mono_mb_emit_ldloc (mb, bytes_var.22);
    mono_mb_emit_byte (mb, 88);
    end_var.27 = (unsigned int) end_var;
    mono_mb_emit_stloc (mb, end_var.27);
    my_entry_var.26 = (unsigned int) my_entry_var;
    mono_mb_emit_ldloc (mb, my_entry_var.26);
    mono_mb_emit_icon (mb, 4);
    mono_mb_emit_byte (mb, 88);
    start_var.28 = (unsigned int) start_var;
    mono_mb_emit_stloc (mb, start_var.28);
    start_loop = mono_mb_get_label (mb);
    start_var.28 = (unsigned int) start_var;
    mono_mb_emit_ldloc (mb, start_var.28);
    mono_mb_emit_icon (mb, 0);
    mono_mb_emit_byte (mb, 223);
    start_var.28 = (unsigned int) start_var;
    mono_mb_emit_ldloc (mb, start_var.28);
    mono_mb_emit_icon (mb, 4);
    mono_mb_emit_byte (mb, 88);
    start_var.28 = (unsigned int) start_var;
    mono_mb_emit_stloc (mb, start_var.28);
    start_var.28 = (unsigned int) start_var;
    mono_mb_emit_ldloc (mb, start_var.28);
    end_var.27 = (unsigned int) end_var;
    mono_mb_emit_ldloc (mb, end_var.27);
    mono_mb_emit_byte (mb, 55);
    D.19151 = (unsigned char) start_loop;
    D.19152 = mono_mb_get_label (mb);
    D.19153 = (unsigned char) D.19152;
    D.19154 = D.19151 - D.19153;
    D.19155 = D.19154 + 255;
    D.19156 = (int) D.19155;
    mono_mb_emit_byte (mb, D.19156);
  }
  goto <D.19157>;
  <D.19148>:
  D.19158 = atype == 1;
  D.19134 = atype == 4;
  D.19159 = D.19158 | D.19134;
  if (D.19159 != 0) goto <D.19160>; else goto <D.19161>;
  <D.19160>:
  my_entry_var.26 = (unsigned int) my_entry_var;
  mono_mb_emit_ldloc (mb, my_entry_var.26);
  mono_mb_emit_icon (mb, 4);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_icon (mb, 0);
  mono_mb_emit_byte (mb, 223);
  <D.19161>:
  <D.19157>:
  if (atype == 4) goto <D.19162>; else goto <D.19163>;
  <D.19162>:
  my_entry_var.26 = (unsigned int) my_entry_var;
  mono_mb_emit_ldloc (mb, my_entry_var.26);
  mono_mb_emit_icon (mb, 8);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_byte (mb, 84);
  my_entry_var.26 = (unsigned int) my_entry_var;
  mono_mb_emit_ldloc (mb, my_entry_var.26);
  bytes_var.22 = (unsigned int) bytes_var;
  mono_mb_emit_ldloc (mb, bytes_var.22);
  mono_mb_emit_icon (mb, 2);
  mono_mb_emit_byte (mb, 89);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_icon (mb, 0);
  mono_mb_emit_byte (mb, 83);
  <D.19163>:
  my_entry_var.26 = (unsigned int) my_entry_var;
  mono_mb_emit_ldloc (mb, my_entry_var.26);
  mono_mb_emit_byte (mb, 42);
  mono_mb_patch_short_branch (mb, no_freelist_branch);
  if (not_small_enough_branch != 0) goto <D.19164>; else goto <D.19165>;
  <D.19164>:
  mono_mb_patch_short_branch (mb, not_small_enough_branch);
  <D.19165>:
  if (size_overflow_branch != 0) goto <D.19166>; else goto <D.19167>;
  <D.19166>:
  mono_mb_patch_short_branch (mb, size_overflow_branch);
  <D.19167>:
  if (atype == 4) goto <D.19168>; else goto <D.19169>;
  <D.19168>:
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icall (mb, mono_string_alloc);
  goto <D.19170>;
  <D.19169>:
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_icall (mb, mono_object_new_specific);
  <D.19170>:
  mono_mb_emit_byte (mb, 42);
  res = mono_mb_create_method (mb, csig, 8);
  mono_mb_free (mb);
  D.19171 = mono_method_get_header (res);
  D.19171->init_locals = 0;
  D.19113 = mono_defaults.corlib;
  info = mono_image_alloc0 (D.19113, 8);
  info->gc_name = "boehm";
  info->alloc_type = atype;
  mono_marshal_set_wrapper_info (res, info);
  D.19172 = res;
  return D.19172;
}


shift_amount (int v)
{
  int D.19174;
  int D.19175;
  int D.19176;
  int i;

  i = 0;
  goto <D.18715>;
  <D.18714>:
  i = i + 1;
  <D.18715>:
  D.19174 = v >> i;
  D.19175 = D.19174 & 1;
  if (D.19175 == 0) goto <D.18714>; else goto <D.18716>;
  <D.18716>:
  D.19176 = i;
  return D.19176;
}


mono_memory_barrier ()
{
  __sync_synchronize ();
}


mono_gc_get_managed_allocator_types ()
{
  guint32 D.19178;

  D.19178 = 5;
  return D.19178;
}


mono_gc_get_write_barrier ()
{
  struct MonoMethod * D.19180;

  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "boehm-gc.c", 1008);
  D.19180 = 0B;
  return D.19180;
}


mono_gc_get_gc_name ()
{
  const char * D.19182;

  D.19182 = "boehm";
  return D.19182;
}


mono_gc_invoke_with_gc_lock (void * (*MonoGCLockedCallbackFunc) (void *) func, void * data)
{
  void * D.19184;

  D.19184 = GC_call_with_alloc_lock (func, data);
  return D.19184;
}


mono_gc_get_description ()
{
  char * D.19186;

  D.19186 = monoeg_strdup ("Included Boehm (with typed GC and Parallel Mark)");
  return D.19186;
}


monoeg_strdup (const gchar * str)
{
  gchar * D.19190;

  if (str != 0B) goto <D.19188>; else goto <D.19189>;
  <D.19188>:
  D.19190 = __strdup (str);
  return D.19190;
  <D.19189>:
  D.19190 = 0B;
  return D.19190;
}


mono_gc_set_desktop_mode ()
{
  GC_dont_expand = 1;
}


mono_gc_is_moving ()
{
  gboolean D.19192;

  D.19192 = 0;
  return D.19192;
}


mono_gc_is_disabled ()
{
  int GC_dont_gc.29;
  const gchar * D.19198;
  gboolean D.19199;

  GC_dont_gc.29 = GC_dont_gc;
  if (GC_dont_gc.29 != 0) goto <D.19194>; else goto <D.19197>;
  <D.19197>:
  D.19198 = monoeg_g_getenv ("GC_DONT_GC");
  if (D.19198 != 0B) goto <D.19194>; else goto <D.19195>;
  <D.19194>:
  D.19199 = 1;
  return D.19199;
  <D.19195>:
  D.19199 = 0;
  return D.19199;
}


mono_gc_wbarrier_value_copy_bitmap (void * _dest, void * _src, int size, unsigned int bitmap)
{
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "boehm-gc.c", 1095);
}


mono_gc_get_card_table (int * shift_bits, void * * card_mask)
{
  guint8 * D.19201;

  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "boehm-gc.c", 1102);
  D.19201 = 0B;
  return D.19201;
}


mono_gc_card_table_nursery_check ()
{
  gboolean D.19203;

  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "boehm-gc.c", 1109);
  D.19203 = 1;
  return D.19203;
}


mono_gc_get_nursery (int * shift_bits, size_t * size)
{
  void * D.19205;

  D.19205 = 0B;
  return D.19205;
}


mono_gc_set_current_thread_appdomain (struct MonoDomain * domain)
{

}


mono_gc_precise_stack_mark_enabled ()
{
  gboolean D.19207;

  D.19207 = 0;
  return D.19207;
}


mono_gc_get_logfile ()
{
  struct FILE * D.19209;

  D.19209 = 0B;
  return D.19209;
}


mono_gc_conservatively_scan_area (void * start, void * end)
{
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "boehm-gc.c", 1139);
}


mono_gc_scan_object (void * obj)
{
  void * D.19211;

  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "boehm-gc.c", 1145);
  D.19211 = 0B;
  return D.19211;
}


mono_gc_get_bitmap_for_descr (void * descr, int * numbits)
{
  gsize * D.19213;

  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "boehm-gc.c", 1152);
  D.19213 = 0B;
  return D.19213;
}


mono_gc_set_gc_callbacks (struct MonoGCCallbacks * callbacks)
{

}


mono_gc_set_stack_end (void * stack_end)
{

}


mono_gc_set_skip_thread (gboolean value)
{

}


mono_gc_register_for_finalization (struct MonoObject * obj, void * user_data)
{
  void * D.19215;
  sizetype D.19216;
  void * D.19217;
  _Bool D.19218;
  long int D.19219;
  long int D.19220;
  void * offset.30;
  void (*<T27a9>) (void *, void *) user_data.31;
  void * D.19225;
  guint offset;

  offset = 0;
  D.19215 = GC_base (obj);
  D.19216 = -offset;
  D.19217 = obj + D.19216;
  D.19218 = D.19215 != D.19217;
  D.19219 = (long int) D.19218;
  D.19220 = __builtin_expect (D.19219, 0);
  if (D.19220 != 0) goto <D.19221>; else goto <D.19222>;
  <D.19221>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "boehm-gc.c", 1177, "GC_base (obj) == (char*)obj - offset");
  <D.19222>:
  offset.30 = (void *) offset;
  user_data.31 = (void (*<T27a9>) (void *, void *)) user_data;
  D.19216 = -offset;
  D.19225 = obj + D.19216;
  GC_register_finalizer_no_order (D.19225, user_data.31, offset.30, 0B, 0B);
}


mono_gc_pthread_create (pthread_t * new_thread, const union pthread_attr_t * attr, void * (*<T131d>) (void *) start_routine, void * arg)
{
  int D.19226;

  D.19226 = GC_pthread_create (new_thread, attr, start_routine, arg);
  return D.19226;
}


mono_gc_pthread_join (pthread_t thread, void * * retval)
{
  int D.19228;

  D.19228 = GC_pthread_join (thread, retval);
  return D.19228;
}


mono_gc_pthread_detach (pthread_t thread)
{
  int D.19230;

  D.19230 = GC_pthread_detach (thread);
  return D.19230;
}


mono_gc_pthread_exit (void * retval)
{
  pthread_exit (retval);
}


mono_gc_get_vtable_bits (struct MonoClass * class)
{
  guint D.19232;

  D.19232 = 0;
  return D.19232;
}


mono_gc_register_altstack (void * stack, gint32 stack_size, void * altstack, gint32 altstack_size)
{
  GC_register_altstack (stack, stack_size, altstack, altstack_size);
}


mono_gc_get_los_limit ()
{
  int D.19234;

  D.19234 = 2147483647;
  return D.19234;
}


mono_gc_user_markers_supported ()
{
  gboolean D.19236;

  D.19236 = 0;
  return D.19236;
}


mono_gc_make_root_descr_user (void (*MonoGCRootMarkFunc) (void *, void (*MonoGCMarkFunc) (void * *)) marker)
{
  void * D.19238;

  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "boehm-gc.c", 1261);
  D.19238 = 0B;
  return D.19238;
}


mono_gc_set_allow_synchronous_major (gboolean flag)
{
  gboolean D.19240;

  D.19240 = flag;
  return D.19240;
}


