mono_gc_base_init ()
{
  int gc_initialized.0;
  long unsigned int D.19242;
  void * sstart.1;
  long unsigned int size.2;
  char * GC_stackbottom.3;
  char * stack_bottom.4;
  int D.19252;
  char * D.19255;
  char D.19258;
  int D.19260;
  long int max_heap.5;
  struct _IO_FILE * stderr.6;
  long unsigned int max_heap.7;
  char * D.19267;
  struct MonoThreadInfoCallbacks cb;
  const char * env;

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

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

              try
                {
                  stack_bottom = (gsize) &dummy;
                  stack_bottom = stack_bottom + 4095;
                  stack_bottom = stack_bottom & 18446744073709547520;
                  stack_bottom.4 = (char *) stack_bottom;
                  GC_stackbottom = stack_bottom.4;
                }
              finally
                {
                  dummy = {CLOBBER};
                }
            }
            <D.19248>:
          }
        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.19250>; else goto <D.19251>;
      <D.19250>:
      {
        char * * ptr;
        char * * opts;

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

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

            try
              {
                D.19255 = __builtin_strchr (opt, 61);
                opt = D.19255 + 1;
                D.19258 = *opt;
                if (D.19258 != 0) goto <D.19259>; else goto <D.19256>;
                <D.19259>:
                D.19260 = mono_gc_parse_environment_string_extract_number (opt, &max_heap);
                if (D.19260 != 0) goto <D.19261>; else goto <D.19256>;
                <D.19261>:
                max_heap.5 = max_heap;
                if (max_heap.5 <= 16777215) goto <D.19263>; else goto <D.19264>;
                <D.19263>:
                stderr.6 = stderr;
                fprintf (stderr.6, "max-heap-size must be at least %dMb.\n", 16);
                exit (1);
                <D.19264>:
                max_heap.5 = max_heap;
                max_heap.7 = (long unsigned int) max_heap.5;
                GC_set_max_heap_size (max_heap.7);
                goto <D.19257>;
                <D.19256>:
                stderr.6 = stderr;
                fprintf (stderr.6, "max-heap-size must be an integer.\n");
                exit (1);
                <D.19257>:
                // predicted unlikely by continue predictor.
                goto <D.18899>;
              }
            finally
              {
                max_heap = {CLOBBER};
              }
          }
          <D.19254>:
        }
        <D.18899>:
        ptr = ptr + 8;
        <D.18901>:
        D.19267 = *ptr;
        if (D.19267 != 0B) goto <D.18900>; else goto <D.18902>;
        <D.18902>:
        monoeg_g_strfreev (opts);
      }
      <D.19251>:
      memset (&cb, 0, 48);
      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, 368);
      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.19272;
  void * D.19275;
  void * iftmp.8;
  int D.19277;

  D.19272 = mono_gc_is_gc_thread ();
  if (D.19272 != 0) goto <D.19273>; else goto <D.19274>;
  <D.19273>:
  D.19275 = info;
  return D.19275;
  <D.19274>:
  D.19277 = GC_thread_register_foreign (baseptr);
  if (D.19277 != 0) goto <D.19278>; else goto <D.19279>;
  <D.19278>:
  iftmp.8 = info;
  goto <D.19280>;
  <D.19279>:
  iftmp.8 = 0B;
  <D.19280>:
  D.19275 = iftmp.8;
  return D.19275;
}


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.19282;

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


memset (void * __dest, int __ch, size_t __len)
{
  int D.19286;
  int D.19291;
  void * D.19293;
  long unsigned int D.19294;

  D.19286 = __builtin_constant_p (__len);
  if (D.19286 != 0) goto <D.19287>; else goto <D.19288>;
  <D.19287>:
  if (__len == 0) goto <D.19289>; else goto <D.19290>;
  <D.19289>:
  D.19291 = __builtin_constant_p (__ch);
  if (D.19291 == 0) goto <D.19284>; else goto <D.19292>;
  <D.19292>:
  if (__ch != 0) goto <D.19284>; else goto <D.19285>;
  <D.19284>:
  __warn_memset_zero_len ();
  D.19293 = __dest;
  return D.19293;
  <D.19285>:
  <D.19290>:
  <D.19288>:
  D.19294 = __builtin_object_size (__dest, 0);
  D.19293 = __builtin___memset_chk (__dest, __ch, __len, D.19294);
  return D.19293;
}


mono_gc_collect (int generation)
{
  struct MonoPerfCounters * mono_perfcounters.9;
  unsigned int D.19297;
  unsigned int D.19298;

  mono_perfcounters.9 = mono_perfcounters;
  D.19297 = mono_perfcounters.9->gc_induced;
  D.19298 = D.19297 + 1;
  mono_perfcounters.9->gc_induced = D.19298;
  GC_gcollect ();
}


mono_gc_max_generation ()
{
  int D.19299;

  D.19299 = 0;
  return D.19299;
}


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

  D.19301 = 0;
  return D.19301;
}


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

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


mono_gc_add_memory_pressure (gint64 value)
{

}


mono_gc_get_used_size ()
{
  int64_t D.19306;
  long unsigned int D.19307;
  long unsigned int D.19308;
  long unsigned int D.19309;

  D.19307 = GC_get_heap_size ();
  D.19308 = GC_get_free_bytes ();
  D.19309 = D.19307 - D.19308;
  D.19306 = (int64_t) D.19309;
  return D.19306;
}


mono_gc_get_heap_size ()
{
  int64_t D.19311;
  long unsigned int D.19312;

  D.19312 = GC_get_heap_size ();
  D.19311 = (int64_t) D.19312;
  return D.19311;
}


mono_gc_is_gc_thread ()
{
  gboolean D.19314;

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


mono_gc_register_thread (void * baseptr)
{
  gboolean D.19316;
  struct MonoThreadInfo * D.19317;
  _Bool D.19318;

  D.19317 = mono_thread_info_attach (baseptr);
  D.19318 = D.19317 != 0B;
  D.19316 = (gboolean) D.19318;
  return D.19316;
}


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

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


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.19322;

  D.19322 = 1;
  return D.19322;
}


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)
{
  struct MonoPerfCounters * mono_perfcounters.11;
  unsigned int D.19327;
  long int new_size.12;
  guint64 heap_size;

  heap_size = GC_get_heap_size ();
  mono_perfcounters.11 = mono_perfcounters;
  if (mono_perfcounters.11 != 0B) goto <D.19325>; else goto <D.19326>;
  <D.19325>:
  mono_perfcounters.11 = mono_perfcounters;
  D.19327 = (unsigned int) heap_size;
  mono_perfcounters.11->gc_committed_bytes = D.19327;
  mono_perfcounters.11 = mono_perfcounters;
  D.19327 = (unsigned int) heap_size;
  mono_perfcounters.11->gc_reserved_bytes = D.19327;
  mono_perfcounters.11 = mono_perfcounters;
  D.19327 = (unsigned int) heap_size;
  mono_perfcounters.11->gc_gen0size = D.19327;
  <D.19326>:
  new_size.12 = (long int) new_size;
  mono_profiler_gc_heap_resize (new_size.12);
}


on_gc_notification (GCEventType event)
{
  struct MonoPerfCounters * mono_perfcounters.13;
  unsigned int D.19332;
  unsigned int D.19333;
  int D.19334;
  int D.19335;
  long int gc_start_time.14;
  long unsigned int D.19339;
  unsigned int D.19340;
  unsigned int D.19341;
  long int D.19342;
  long int gc_start_time.15;
  long int D.19344;
  long int D.19345;
  long long int D.19346;
  long long int D.19347;
  long int D.19348;
  long int D.19349;
  long int D.19350;
  MonoGCEvent e;

  e = event;
  switch (e) <default: <D.19351>, case 0: <D.18954>, case 5: <D.18955>, case 6: <D.18949>, case 7: <D.18951>, case 8: <D.18952>, case 9: <D.18953>>
  <D.18949>:
  mono_thread_info_suspend_lock ();
  goto <D.18950>;
  <D.18951>:
  goto <D.18950>;
  <D.18952>:
  goto <D.18950>;
  <D.18953>:
  mono_thread_info_suspend_unlock ();
  goto <D.18950>;
  <D.18954>:
  mono_perfcounters.13 = mono_perfcounters;
  if (mono_perfcounters.13 != 0B) goto <D.19330>; else goto <D.19331>;
  <D.19330>:
  mono_perfcounters.13 = mono_perfcounters;
  D.19332 = mono_perfcounters.13->gc_collections0;
  D.19333 = D.19332 + 1;
  mono_perfcounters.13->gc_collections0 = D.19333;
  <D.19331>:
  D.19334 = gc_stats.major_gc_count;
  D.19335 = D.19334 + 1;
  gc_stats.major_gc_count = D.19335;
  gc_start_time.14 = mono_100ns_ticks ();
  gc_start_time = gc_start_time.14;
  goto <D.18950>;
  <D.18955>:
  mono_perfcounters.13 = mono_perfcounters;
  if (mono_perfcounters.13 != 0B) goto <D.19337>; else goto <D.19338>;
  <D.19337>:
  {
    guint64 heap_size;
    guint64 used_size;

    heap_size = GC_get_heap_size ();
    D.19339 = GC_get_free_bytes ();
    used_size = heap_size - D.19339;
    mono_perfcounters.13 = mono_perfcounters;
    D.19340 = (unsigned int) used_size;
    mono_perfcounters.13->gc_total_bytes = D.19340;
    mono_perfcounters.13 = mono_perfcounters;
    D.19341 = (unsigned int) heap_size;
    mono_perfcounters.13->gc_committed_bytes = D.19341;
    mono_perfcounters.13 = mono_perfcounters;
    D.19341 = (unsigned int) heap_size;
    mono_perfcounters.13->gc_reserved_bytes = D.19341;
    mono_perfcounters.13 = mono_perfcounters;
    D.19341 = (unsigned int) heap_size;
    mono_perfcounters.13->gc_gen0size = D.19341;
  }
  <D.19338>:
  D.19342 = mono_100ns_ticks ();
  gc_start_time.15 = gc_start_time;
  D.19344 = D.19342 - gc_start_time.15;
  D.19345 = D.19344 / 10;
  D.19346 = gc_stats.major_gc_time_usecs;
  D.19347 = D.19346 + D.19345;
  gc_stats.major_gc_time_usecs = D.19347;
  D.19348 = mono_100ns_ticks ();
  gc_start_time.15 = gc_start_time;
  D.19349 = D.19348 - gc_start_time.15;
  D.19350 = D.19349 / 10;
  mono_trace (32, 8, "gc took %d usecs", D.19350);
  goto <D.18950>;
  <D.19351>:
  <D.18950>:
  mono_profiler_gc_event (e, 0);
}


mono_gc_register_root (char * start, size_t size, void * descr)
{
  sizetype D.19352;
  char * D.19353;
  int D.19354;

  D.19352 = size + 1;
  D.19353 = start + D.19352;
  GC_add_roots (start, D.19353);
  D.19354 = 1;
  return D.19354;
}


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

  D.19356 = addr + 9;
  GC_remove_roots (addr, D.19356);
}


mono_gc_weak_link_add (void * * link_addr, struct MonoObject * obj, gboolean track)
{
  long unsigned int obj.16;
  long unsigned int D.19358;
  void * D.19359;

  obj.16 = (long unsigned int) obj;
  D.19358 = ~obj.16;
  D.19359 = (void *) D.19358;
  *link_addr = D.19359;
  if (track != 0) goto <D.19360>; else goto <D.19361>;
  <D.19360>:
  GC_register_long_link (link_addr, obj);
  goto <D.19362>;
  <D.19361>:
  GC_general_register_disappearing_link (link_addr, obj);
  <D.19362>:
}


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


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

  obj = GC_call_with_alloc_lock (reveal_link, link_addr);
  if (obj == -1B) goto <D.19366>; else goto <D.19367>;
  <D.19366>:
  D.19368 = 0B;
  return D.19368;
  <D.19367>:
  D.19368 = obj;
  return D.19368;
}


reveal_link (void * link_addr)
{
  void * D.19370;
  void * D.19371;
  long unsigned int D.19372;
  long unsigned int D.19373;
  void * * link_a;

  link_a = link_addr;
  D.19371 = *link_a;
  D.19372 = (long unsigned int) D.19371;
  D.19373 = ~D.19372;
  D.19370 = (void *) D.19373;
  return D.19370;
}


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

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


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

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


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

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


mono_gc_make_descr_from_bitmap (gsize * bitmap, int numbits)
{
  void * D.19383;
  long unsigned int D.19384;
  long unsigned int D.19385;

  if (numbits > 29) goto <D.19381>; else goto <D.19382>;
  <D.19381>:
  D.19383 = 0B;
  return D.19383;
  <D.19382>:
  D.19384 = (long unsigned int) numbits;
  D.19385 = GC_make_descriptor (bitmap, D.19384);
  D.19383 = (void *) D.19385;
  return D.19383;
}


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

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


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

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


mono_gc_free_fixed (void * addr)
{

}


mono_gc_invoke_finalizers ()
{
  int D.19394;
  int D.19397;

  D.19394 = GC_should_invoke_finalizers ();
  if (D.19394 != 0) goto <D.19395>; else goto <D.19396>;
  <D.19395>:
  D.19397 = GC_invoke_finalizers ();
  return D.19397;
  <D.19396>:
  D.19397 = 0;
  return D.19397;
}


mono_gc_pending_finalizers ()
{
  gboolean D.19399;

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


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)
{
  long unsigned int D.19401;
  long unsigned int D.19402;

  D.19401 = (long unsigned int) count;
  D.19402 = D.19401 * 8;
  mono_gc_memmove_aligned (dest_ptr, src_ptr, D.19402);
}


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)
{
  long unsigned int new_val.18;
  long unsigned int old_val.19;
  long unsigned int D.19405;
  void * D.19406;
  void * D.19407;
  void * old_val;

  <D.17995>:
  old_val = *val;
  new_val.18 = (long unsigned int) new_val;
  old_val.19 = (long unsigned int) old_val;
  D.19405 = __sync_val_compare_and_swap_8 (val, old_val.19, new_val.18);
  D.19406 = (void *) D.19405;
  if (D.19406 != old_val) goto <D.17995>; else goto <D.17996>;
  <D.17996>:
  D.19407 = old_val;
  return D.19407;
}


mono_gc_wbarrier_generic_nostore (void * ptr)
{

}


mono_gc_wbarrier_value_copy (void * dest, void * src, int count, struct MonoClass * klass)
{
  int D.19409;
  int D.19410;
  long unsigned int D.19411;

  D.19409 = mono_class_value_size (klass, 0B);
  D.19410 = D.19409 * count;
  D.19411 = (long unsigned int) D.19410;
  mono_gc_memmove_atomic (dest, src, D.19411);
}


mono_gc_wbarrier_object_copy (struct MonoObject * obj, struct MonoObject * src)
{
  struct MonoVTable * D.19412;
  struct MonoClass * D.19413;
  int D.19414;
  long unsigned int D.19415;
  long unsigned int D.19416;
  const void * D.19417;
  void * D.19418;

  D.19412 = obj->vtable;
  D.19413 = D.19412->klass;
  D.19414 = D.19413->instance_size;
  D.19415 = (long unsigned int) D.19414;
  D.19416 = D.19415 + 18446744073709551600;
  D.19417 = src + 16;
  D.19418 = obj + 16;
  mono_gc_memmove_aligned (D.19418, D.19417, D.19416);
}


mono_gc_clear_domain (struct MonoDomain * domain)
{

}


mono_gc_get_suspend_signal ()
{
  int D.19419;

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


mono_gc_get_managed_allocator (struct MonoClass * klass, gboolean for_box)
{
  struct MonoMethod * D.19423;
  int D.19424;
  int GC_all_interior_pointers.20;
  int D.19426;
  int D.19431;
  unsigned char D.19433;
  unsigned char D.19434;
  <unnamed type> D.19436;
  unsigned int D.19437;
  unsigned char D.19438;
  struct MonoType * D.19441;
  int D.19442;
  unsigned char D.19445;
  unsigned char D.19449;
  unsigned char D.19450;
  int offset;
  int atype;

  offset = -1;
  {
    guint64 foo;

    __asm__("movq $GC_thread_tls@TPOFF, %0" : "=r" foo);
    offset = (int) foo;
  }
  if (offset == -1) goto <D.19421>; else goto <D.19422>;
  <D.19421>:
  D.19423 = 0B;
  return D.19423;
  <D.19422>:
  D.19424 = klass->instance_size;
  GC_all_interior_pointers.20 = GC_all_interior_pointers;
  D.19426 = D.19424 + GC_all_interior_pointers.20;
  if (D.19426 > 512) goto <D.19427>; else goto <D.19428>;
  <D.19427>:
  D.19423 = 0B;
  return D.19423;
  <D.19428>:
  D.19431 = mono_class_has_finalizer (klass);
  if (D.19431 != 0) goto <D.19429>; else goto <D.19432>;
  <D.19432>:
  D.19433 = BIT_FIELD_REF <*klass, 8, 272>;
  D.19434 = D.19433 & 64;
  if (D.19434 != 0) goto <D.19429>; else goto <D.19435>;
  <D.19435>:
  D.19436 = mono_profiler_get_events ();
  D.19437 = D.19436 & 128;
  if (D.19437 != 0) goto <D.19429>; else goto <D.19430>;
  <D.19429>:
  D.19423 = 0B;
  return D.19423;
  <D.19430>:
  D.19438 = klass->rank;
  if (D.19438 != 0) goto <D.19439>; else goto <D.19440>;
  <D.19439>:
  D.19423 = 0B;
  return D.19423;
  <D.19440>:
  D.19441 = &klass->byval_arg;
  D.19442 = mono_class_is_open_constructed_type (D.19441);
  if (D.19442 != 0) goto <D.19443>; else goto <D.19444>;
  <D.19443>:
  D.19423 = 0B;
  return D.19423;
  <D.19444>:
  D.19445 = klass->byval_arg.type;
  if (D.19445 == 14) goto <D.19446>; else goto <D.19447>;
  <D.19446>:
  atype = 4;
  goto <D.19448>;
  <D.19447>:
  D.19449 = BIT_FIELD_REF <*klass, 8, 280>;
  D.19450 = D.19449 & 8;
  if (D.19450 == 0) goto <D.19451>; else goto <D.19452>;
  <D.19451>:
  if (for_box != 0) goto <D.19453>; else goto <D.19454>;
  <D.19453>:
  atype = 1;
  goto <D.19455>;
  <D.19454>:
  atype = 0;
  <D.19455>:
  goto <D.19456>;
  <D.19452>:
  D.19423 = 0B;
  return D.19423;
  <D.19456>:
  <D.19448>:
  D.19423 = mono_gc_get_managed_allocator_by_type (atype);
  return D.19423;
}


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

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


mono_gc_get_managed_allocator_by_type (int atype)
{
  struct MonoMethod * D.19462;
  struct MonoMethod * D.19463;
  int offset;
  struct MonoMethod * res;

  offset = -1;
  {
    guint64 foo;

    __asm__("movq $GC_thread_tls@TPOFF, %0" : "=r" foo);
    offset = (int) foo;
  }
  mono_tls_key_set_offset (7, offset);
  res = alloc_method_cache[atype];
  if (res != 0B) goto <D.19460>; else goto <D.19461>;
  <D.19460>:
  D.19462 = res;
  return D.19462;
  <D.19461>:
  res = create_allocator (atype, 7);
  pthread_mutex_lock (&mono_gc_lock);
  D.19463 = alloc_method_cache[atype];
  if (D.19463 != 0B) goto <D.19464>; else goto <D.19465>;
  <D.19464>:
  mono_free_method (res);
  res = alloc_method_cache[atype];
  goto <D.19466>;
  <D.19465>:
  mono_memory_barrier ();
  alloc_method_cache[atype] = res;
  <D.19466>:
  pthread_mutex_unlock (&mono_gc_lock);
  D.19462 = res;
  return D.19462;
}


create_allocator (int atype, int tls_key)
{
  struct MonoImage * D.19470;
  struct MonoClass * D.19471;
  struct MonoType * D.19472;
  struct MonoClass * D.19473;
  struct MonoType * D.19474;
  struct MonoClass * D.19475;
  struct MonoType * D.19476;
  struct MonoClass * D.19478;
  struct MonoType * D.19479;
  unsigned int bytes_var.21;
  int D.19486;
  int D.19487;
  unsigned int index_var.22;
  unsigned int atype.23;
  _Bool D.19490;
  _Bool D.19491;
  _Bool D.19492;
  unsigned int my_fl_var.24;
  unsigned int my_entry_var.25;
  unsigned int end_var.26;
  unsigned int start_var.27;
  unsigned char D.19508;
  int D.19509;
  unsigned char D.19510;
  unsigned char D.19511;
  unsigned char D.19512;
  int D.19513;
  _Bool D.19515;
  _Bool D.19516;
  struct MonoMethodHeader * D.19528;
  struct MonoMethod * D.19529;
  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.19468>; else goto <D.19469>;
  <D.19468>:
  D.19470 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.19470, 2);
  D.19471 = mono_defaults.string_class;
  D.19472 = &D.19471->byval_arg;
  csig->ret = D.19472;
  D.19473 = mono_defaults.int_class;
  D.19474 = &D.19473->byval_arg;
  csig->params[0] = D.19474;
  D.19475 = mono_defaults.int32_class;
  D.19476 = &D.19475->byval_arg;
  csig->params[1] = D.19476;
  goto <D.19477>;
  <D.19469>:
  D.19470 = mono_defaults.corlib;
  csig = mono_metadata_signature_alloc (D.19470, 1);
  D.19478 = mono_defaults.object_class;
  D.19479 = &D.19478->byval_arg;
  csig->ret = D.19479;
  D.19473 = mono_defaults.int_class;
  D.19474 = &D.19473->byval_arg;
  csig->params[0] = D.19474;
  <D.19477>:
  D.19478 = mono_defaults.object_class;
  mb = mono_mb_new (D.19478, "Alloc", 28);
  D.19475 = mono_defaults.int32_class;
  D.19476 = &D.19475->byval_arg;
  bytes_var = mono_mb_add_local (mb, D.19476);
  if (atype == 4) goto <D.19480>; else goto <D.19481>;
  <D.19480>:
  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, 20);
  mono_mb_emit_byte (mb, 88);
  bytes_var.21 = (unsigned int) bytes_var;
  mono_mb_emit_stloc (mb, bytes_var.21);
  goto <D.19483>;
  <D.19481>:
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_icon (mb, 0);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_icon (mb, 28);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_byte (mb, 75);
  bytes_var.21 = (unsigned int) bytes_var;
  mono_mb_emit_stloc (mb, bytes_var.21);
  <D.19483>:
  if (atype == 4) goto <D.19484>; else goto <D.19485>;
  <D.19484>:
  bytes_var.21 = (unsigned int) bytes_var;
  mono_mb_emit_ldloc (mb, bytes_var.21);
  mono_mb_emit_icon (mb, 512);
  not_small_enough_branch = mono_mb_emit_short_branch (mb, 53);
  bytes_var.21 = (unsigned int) bytes_var;
  mono_mb_emit_ldloc (mb, bytes_var.21);
  mono_mb_emit_icon (mb, 24);
  size_overflow_branch = mono_mb_emit_short_branch (mb, 54);
  <D.19485>:
  D.19475 = mono_defaults.int32_class;
  D.19476 = &D.19475->byval_arg;
  index_var = mono_mb_add_local (mb, D.19476);
  bytes_var.21 = (unsigned int) bytes_var;
  mono_mb_emit_ldloc (mb, bytes_var.21);
  mono_mb_emit_icon (mb, 7);
  mono_mb_emit_byte (mb, 88);
  D.19486 = shift_amount (8);
  mono_mb_emit_icon (mb, D.19486);
  mono_mb_emit_byte (mb, 100);
  D.19487 = shift_amount (8);
  mono_mb_emit_icon (mb, D.19487);
  mono_mb_emit_byte (mb, 98);
  index_var.22 = (unsigned int) index_var;
  mono_mb_emit_stloc (mb, index_var.22);
  D.19473 = mono_defaults.int_class;
  D.19474 = &D.19473->byval_arg;
  my_fl_var = mono_mb_add_local (mb, D.19474);
  D.19473 = mono_defaults.int_class;
  D.19474 = &D.19473->byval_arg;
  my_entry_var = mono_mb_add_local (mb, D.19474);
  mono_mb_emit_byte (mb, 240);
  mono_mb_emit_byte (mb, 13);
  mono_mb_emit_i4 (mb, tls_key);
  atype.23 = (unsigned int) atype;
  D.19490 = atype.23 <= 1;
  D.19491 = atype == 4;
  D.19492 = D.19490 | D.19491;
  if (D.19492 != 0) goto <D.19493>; else goto <D.19494>;
  <D.19493>:
  mono_mb_emit_icon (mb, 96);
  goto <D.19495>;
  <D.19494>:
  if (atype == 2) goto <D.19496>; else goto <D.19497>;
  <D.19496>:
  mono_mb_emit_icon (mb, 616);
  goto <D.19498>;
  <D.19497>:
  if (atype == 3) goto <D.19499>; else goto <D.19500>;
  <D.19499>:
  mono_mb_emit_icon (mb, 1136);
  goto <D.19501>;
  <D.19500>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "boehm-gc.c", 781);
  <D.19501>:
  <D.19498>:
  <D.19495>:
  mono_mb_emit_byte (mb, 88);
  index_var.22 = (unsigned int) index_var;
  mono_mb_emit_ldloc (mb, index_var.22);
  mono_mb_emit_byte (mb, 88);
  my_fl_var.24 = (unsigned int) my_fl_var;
  mono_mb_emit_stloc (mb, my_fl_var.24);
  my_fl_var.24 = (unsigned int) my_fl_var;
  mono_mb_emit_ldloc (mb, my_fl_var.24);
  mono_mb_emit_byte (mb, 77);
  my_entry_var.25 = (unsigned int) my_entry_var;
  mono_mb_emit_stloc (mb, my_entry_var.25);
  my_entry_var.25 = (unsigned int) my_entry_var;
  mono_mb_emit_ldloc (mb, my_entry_var.25);
  mono_mb_emit_icon (mb, 4096);
  no_freelist_branch = mono_mb_emit_short_branch (mb, 55);
  my_fl_var.24 = (unsigned int) my_fl_var;
  mono_mb_emit_ldloc (mb, my_fl_var.24);
  my_entry_var.25 = (unsigned int) my_entry_var;
  mono_mb_emit_ldloc (mb, my_entry_var.25);
  mono_mb_emit_byte (mb, 77);
  mono_mb_emit_byte (mb, 223);
  my_entry_var.25 = (unsigned int) my_entry_var;
  mono_mb_emit_ldloc (mb, my_entry_var.25);
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_byte (mb, 223);
  if (atype == 0) goto <D.19504>; else goto <D.19505>;
  <D.19504>:
  {
    int start_var;
    int end_var;
    int start_loop;

    D.19473 = mono_defaults.int_class;
    D.19474 = &D.19473->byval_arg;
    start_var = mono_mb_add_local (mb, D.19474);
    D.19473 = mono_defaults.int_class;
    D.19474 = &D.19473->byval_arg;
    end_var = mono_mb_add_local (mb, D.19474);
    my_entry_var.25 = (unsigned int) my_entry_var;
    mono_mb_emit_ldloc (mb, my_entry_var.25);
    bytes_var.21 = (unsigned int) bytes_var;
    mono_mb_emit_ldloc (mb, bytes_var.21);
    mono_mb_emit_byte (mb, 88);
    end_var.26 = (unsigned int) end_var;
    mono_mb_emit_stloc (mb, end_var.26);
    my_entry_var.25 = (unsigned int) my_entry_var;
    mono_mb_emit_ldloc (mb, my_entry_var.25);
    mono_mb_emit_icon (mb, 8);
    mono_mb_emit_byte (mb, 88);
    start_var.27 = (unsigned int) start_var;
    mono_mb_emit_stloc (mb, start_var.27);
    start_loop = mono_mb_get_label (mb);
    start_var.27 = (unsigned int) start_var;
    mono_mb_emit_ldloc (mb, start_var.27);
    mono_mb_emit_icon (mb, 0);
    mono_mb_emit_byte (mb, 223);
    start_var.27 = (unsigned int) start_var;
    mono_mb_emit_ldloc (mb, start_var.27);
    mono_mb_emit_icon (mb, 8);
    mono_mb_emit_byte (mb, 88);
    start_var.27 = (unsigned int) start_var;
    mono_mb_emit_stloc (mb, start_var.27);
    start_var.27 = (unsigned int) start_var;
    mono_mb_emit_ldloc (mb, start_var.27);
    end_var.26 = (unsigned int) end_var;
    mono_mb_emit_ldloc (mb, end_var.26);
    mono_mb_emit_byte (mb, 55);
    D.19508 = (unsigned char) start_loop;
    D.19509 = mono_mb_get_label (mb);
    D.19510 = (unsigned char) D.19509;
    D.19511 = D.19508 - D.19510;
    D.19512 = D.19511 + 255;
    D.19513 = (int) D.19512;
    mono_mb_emit_byte (mb, D.19513);
  }
  goto <D.19514>;
  <D.19505>:
  D.19515 = atype == 1;
  D.19491 = atype == 4;
  D.19516 = D.19515 | D.19491;
  if (D.19516 != 0) goto <D.19517>; else goto <D.19518>;
  <D.19517>:
  my_entry_var.25 = (unsigned int) my_entry_var;
  mono_mb_emit_ldloc (mb, my_entry_var.25);
  mono_mb_emit_icon (mb, 8);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_icon (mb, 0);
  mono_mb_emit_byte (mb, 223);
  <D.19518>:
  <D.19514>:
  if (atype == 4) goto <D.19519>; else goto <D.19520>;
  <D.19519>:
  my_entry_var.25 = (unsigned int) my_entry_var;
  mono_mb_emit_ldloc (mb, my_entry_var.25);
  mono_mb_emit_icon (mb, 16);
  mono_mb_emit_byte (mb, 88);
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_byte (mb, 84);
  my_entry_var.25 = (unsigned int) my_entry_var;
  mono_mb_emit_ldloc (mb, my_entry_var.25);
  bytes_var.21 = (unsigned int) bytes_var;
  mono_mb_emit_ldloc (mb, bytes_var.21);
  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.19520>:
  my_entry_var.25 = (unsigned int) my_entry_var;
  mono_mb_emit_ldloc (mb, my_entry_var.25);
  mono_mb_emit_byte (mb, 42);
  mono_mb_patch_short_branch (mb, no_freelist_branch);
  if (not_small_enough_branch != 0) goto <D.19521>; else goto <D.19522>;
  <D.19521>:
  mono_mb_patch_short_branch (mb, not_small_enough_branch);
  <D.19522>:
  if (size_overflow_branch != 0) goto <D.19523>; else goto <D.19524>;
  <D.19523>:
  mono_mb_patch_short_branch (mb, size_overflow_branch);
  <D.19524>:
  if (atype == 4) goto <D.19525>; else goto <D.19526>;
  <D.19525>:
  mono_mb_emit_ldarg (mb, 1);
  mono_mb_emit_icall (mb, mono_string_alloc);
  goto <D.19527>;
  <D.19526>:
  mono_mb_emit_ldarg (mb, 0);
  mono_mb_emit_icall (mb, mono_object_new_specific);
  <D.19527>:
  mono_mb_emit_byte (mb, 42);
  res = mono_mb_create_method (mb, csig, 8);
  mono_mb_free (mb);
  D.19528 = mono_method_get_header (res);
  D.19528->init_locals = 0;
  D.19470 = mono_defaults.corlib;
  info = mono_image_alloc0 (D.19470, 16);
  info->gc_name = "boehm";
  info->alloc_type = atype;
  mono_marshal_set_wrapper_info (res, info);
  D.19529 = res;
  return D.19529;
}


shift_amount (int v)
{
  int D.19531;
  int D.19532;
  int D.19533;
  int i;

  i = 0;
  goto <D.19073>;
  <D.19072>:
  i = i + 1;
  <D.19073>:
  D.19531 = v >> i;
  D.19532 = D.19531 & 1;
  if (D.19532 == 0) goto <D.19072>; else goto <D.19074>;
  <D.19074>:
  D.19533 = i;
  return D.19533;
}


mono_memory_barrier ()
{
  __sync_synchronize ();
}


mono_gc_get_managed_allocator_types ()
{
  guint32 D.19535;

  D.19535 = 5;
  return D.19535;
}


mono_gc_get_write_barrier ()
{
  struct MonoMethod * D.19537;

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


mono_gc_get_gc_name ()
{
  const char * D.19539;

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


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

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


mono_gc_get_description ()
{
  char * D.19543;

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


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

  if (str != 0B) goto <D.19545>; else goto <D.19546>;
  <D.19545>:
  D.19547 = __strdup (str);
  return D.19547;
  <D.19546>:
  D.19547 = 0B;
  return D.19547;
}


mono_gc_set_desktop_mode ()
{
  GC_dont_expand = 1;
}


mono_gc_is_moving ()
{
  gboolean D.19549;

  D.19549 = 0;
  return D.19549;
}


mono_gc_is_disabled ()
{
  int GC_dont_gc.28;
  const gchar * D.19555;
  gboolean D.19556;

  GC_dont_gc.28 = GC_dont_gc;
  if (GC_dont_gc.28 != 0) goto <D.19551>; else goto <D.19554>;
  <D.19554>:
  D.19555 = monoeg_g_getenv ("GC_DONT_GC");
  if (D.19555 != 0B) goto <D.19551>; else goto <D.19552>;
  <D.19551>:
  D.19556 = 1;
  return D.19556;
  <D.19552>:
  D.19556 = 0;
  return D.19556;
}


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.19558;

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


mono_gc_card_table_nursery_check ()
{
  gboolean D.19560;

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


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

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


mono_gc_set_current_thread_appdomain (struct MonoDomain * domain)
{

}


mono_gc_precise_stack_mark_enabled ()
{
  gboolean D.19564;

  D.19564 = 0;
  return D.19564;
}


mono_gc_get_logfile ()
{
  struct FILE * D.19566;

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


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.19568;

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


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

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


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.19572;
  sizetype D.19573;
  sizetype D.19574;
  void * D.19575;
  _Bool D.19576;
  long int D.19577;
  long int D.19578;
  long unsigned int D.19581;
  void * D.19582;
  void (*<T2855>) (void *, void *) user_data.29;
  void * D.19584;
  guint offset;

  offset = 0;
  D.19572 = GC_base (obj);
  D.19573 = (sizetype) offset;
  D.19574 = -D.19573;
  D.19575 = obj + D.19574;
  D.19576 = D.19572 != D.19575;
  D.19577 = (long int) D.19576;
  D.19578 = __builtin_expect (D.19577, 0);
  if (D.19578 != 0) goto <D.19579>; else goto <D.19580>;
  <D.19579>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "boehm-gc.c", 1177, "GC_base (obj) == (char*)obj - offset");
  <D.19580>:
  D.19581 = (long unsigned int) offset;
  D.19582 = (void *) D.19581;
  user_data.29 = (void (*<T2855>) (void *, void *)) user_data;
  D.19573 = (sizetype) offset;
  D.19574 = -D.19573;
  D.19584 = obj + D.19574;
  GC_register_finalizer_no_order (D.19584, user_data.29, D.19582, 0B, 0B);
}


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

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


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

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


mono_gc_pthread_detach (pthread_t thread)
{
  int D.19589;

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


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


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

  D.19591 = 0;
  return D.19591;
}


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.19593;

  D.19593 = 2147483647;
  return D.19593;
}


mono_gc_user_markers_supported ()
{
  gboolean D.19595;

  D.19595 = 0;
  return D.19595;
}


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

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


mono_gc_set_allow_synchronous_major (gboolean flag)
{
  gboolean D.19599;

  D.19599 = flag;
  return D.19599;
}


