GC_init_gcj_malloc (int mp_index, void * mp)
{
  int D.4938;
  int GC_gcj_malloc_initialized.0;
  char * D.4944;
  _Bool D.4945;
  int GC_print_stats.1;
  struct GC_ms_entry * (*<T852>) (GC_word *, struct GC_ms_entry *, struct GC_ms_entry *, GC_word) mp.2;
  long unsigned int D.4952;
  long unsigned int GC_n_mark_procs.3;
  void * * GC_gcjobjfreelist.4;
  char * * GC_gcjobjfreelist.5;
  int GC_gcj_kind.6;
  int GC_gcj_kind.7;
  int GC_gcj_kind.8;
  void * * GC_gcjdebugobjfreelist.9;
  int D.4968;
  int D.4969;
  int D.4970;
  long unsigned int D.4971;
  char * * GC_gcjdebugobjfreelist.10;
  int GC_gcj_debug_kind.11;
  register int i;
  GC_bool ignore_gcj_info;

  GC_init ();
  D.4938 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.4938 != 0) goto <D.4939>; else goto <D.4940>;
  <D.4939>:
  GC_lock ();
  <D.4940>:
  GC_gcj_malloc_initialized.0 = GC_gcj_malloc_initialized;
  if (GC_gcj_malloc_initialized.0 != 0) goto <D.4942>; else goto <D.4943>;
  <D.4942>:
  pthread_mutex_unlock (&GC_allocate_ml);
  return;
  <D.4943>:
  GC_gcj_malloc_initialized = 1;
  D.4944 = getenv ("GC_IGNORE_GCJ_INFO");
  D.4945 = D.4944 != 0B;
  ignore_gcj_info = (GC_bool) D.4945;
  GC_print_stats.1 = GC_print_stats;
  if (GC_print_stats.1 != 0) goto <D.4947>; else goto <D.4948>;
  <D.4947>:
  if (ignore_gcj_info != 0) goto <D.4949>; else goto <D.4950>;
  <D.4949>:
  GC_printf ("Gcj-style type information is disabled!\n", 0, 0, 0, 0, 0, 0);
  <D.4950>:
  <D.4948>:
  mp.2 = (struct GC_ms_entry * (*<T852>) (GC_word *, struct GC_ms_entry *, struct GC_ms_entry *, GC_word)) mp;
  GC_arrays._mark_procs[mp_index] = mp.2;
  D.4952 = (long unsigned int) mp_index;
  GC_n_mark_procs.3 = GC_n_mark_procs;
  if (D.4952 >= GC_n_mark_procs.3) goto <D.4954>; else goto <D.4955>;
  <D.4954>:
  GC_abort ("GC_init_gcj_malloc: bad index");
  <D.4955>:
  GC_gcjobjfreelist.4 = GC_new_free_list_inner ();
  GC_gcjobjfreelist = GC_gcjobjfreelist.4;
  if (ignore_gcj_info != 0) goto <D.4957>; else goto <D.4958>;
  <D.4957>:
  GC_gcjobjfreelist.5 = GC_gcjobjfreelist;
  GC_gcj_kind.6 = GC_new_kind_inner (GC_gcjobjfreelist.5, 0, 1, 1);
  GC_gcj_kind = GC_gcj_kind.6;
  goto <D.4961>;
  <D.4958>:
  GC_gcjobjfreelist.5 = GC_gcjobjfreelist;
  GC_gcj_kind.7 = GC_new_kind_inner (GC_gcjobjfreelist.5, 18446744073709551595, 0, 1);
  GC_gcj_kind = GC_gcj_kind.7;
  <D.4961>:
  if (ignore_gcj_info != 0) goto <D.4963>; else goto <D.4964>;
  <D.4963>:
  GC_gcj_kind.8 = GC_gcj_kind;
  GC_gcj_debug_kind = GC_gcj_kind.8;
  GC_gcjobjfreelist.5 = GC_gcjobjfreelist;
  GC_gcjdebugobjfreelist = GC_gcjobjfreelist.5;
  goto <D.4966>;
  <D.4964>:
  GC_gcjdebugobjfreelist.9 = GC_new_free_list_inner ();
  GC_gcjdebugobjfreelist = GC_gcjdebugobjfreelist.9;
  D.4968 = mp_index | 64;
  D.4969 = D.4968 << 2;
  D.4970 = D.4969 | 2;
  D.4971 = (long unsigned int) D.4970;
  GC_gcjdebugobjfreelist.10 = GC_gcjdebugobjfreelist;
  GC_gcj_debug_kind.11 = GC_new_kind_inner (GC_gcjdebugobjfreelist.10, D.4971, 0, 1);
  GC_gcj_debug_kind = GC_gcj_debug_kind.11;
  <D.4966>:
  pthread_mutex_unlock (&GC_allocate_ml);
}


GC_gcj_malloc (size_t lb, void * ptr_to_struct_containing_descr)
{
  int GC_all_interior_pointers.12;
  long unsigned int D.4976;
  long unsigned int D.4977;
  _Bool D.4978;
  long int D.4979;
  long int D.4980;
  unsigned int D.4983;
  char * * GC_gcjobjfreelist.13;
  long unsigned int D.4985;
  int D.4986;
  _Bool D.4989;
  long int D.4990;
  long int D.4991;
  int GC_gcj_kind.14;
  char * D.4995;
  void * D.4998;
  void * (*<T397>) (size_t) GC_oom_fn.15;
  char * D.5001;
  long unsigned int D.5002;
  long unsigned int D.5003;
  int D.5005;
  char * D.5008;
  register char * op;
  register char * * opp;
  register word lw;

  GC_all_interior_pointers.12 = GC_all_interior_pointers;
  D.4976 = (long unsigned int) GC_all_interior_pointers.12;
  D.4977 = 2048 - D.4976;
  D.4978 = D.4977 >= lb;
  D.4979 = (long int) D.4978;
  D.4980 = __builtin_expect (D.4979, 1);
  if (D.4980 != 0) goto <D.4981>; else goto <D.4982>;
  <D.4981>:
  D.4983 = GC_arrays._size_map[lb];
  lw = (word) D.4983;
  GC_gcjobjfreelist.13 = GC_gcjobjfreelist;
  D.4985 = lw * 8;
  opp = GC_gcjobjfreelist.13 + D.4985;
  D.4986 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.4986 != 0) goto <D.4987>; else goto <D.4988>;
  <D.4987>:
  GC_lock ();
  <D.4988>:
  op = *opp;
  D.4989 = op == 0B;
  D.4990 = (long int) D.4989;
  D.4991 = __builtin_expect (D.4990, 0);
  if (D.4991 != 0) goto <D.4992>; else goto <D.4993>;
  <D.4992>:
  maybe_finalize ();
  GC_gcj_kind.14 = GC_gcj_kind;
  D.4995 = GC_generic_malloc_inner (lb, GC_gcj_kind.14);
  op = GC_clear_stack (D.4995);
  if (op == 0B) goto <D.4996>; else goto <D.4997>;
  <D.4996>:
  pthread_mutex_unlock (&GC_allocate_ml);
  GC_oom_fn.15 = GC_oom_fn;
  D.4998 = GC_oom_fn.15 (lb);
  return D.4998;
  <D.4997>:
  D.4983 = GC_arrays._size_map[lb];
  lw = (word) D.4983;
  goto <D.5000>;
  <D.4993>:
  D.5001 = MEM[(char * *)op];
  *opp = D.5001;
  D.5002 = GC_arrays._words_allocd;
  D.5003 = D.5002 + lw;
  GC_arrays._words_allocd = D.5003;
  <D.5000>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  pthread_mutex_unlock (&GC_allocate_ml);
  goto <D.5004>;
  <D.4982>:
  D.5005 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.5005 != 0) goto <D.5006>; else goto <D.5007>;
  <D.5006>:
  GC_lock ();
  <D.5007>:
  maybe_finalize ();
  GC_gcj_kind.14 = GC_gcj_kind;
  D.5008 = GC_generic_malloc_inner (lb, GC_gcj_kind.14);
  op = GC_clear_stack (D.5008);
  if (op == 0B) goto <D.5009>; else goto <D.5010>;
  <D.5009>:
  pthread_mutex_unlock (&GC_allocate_ml);
  GC_oom_fn.15 = GC_oom_fn;
  D.4998 = GC_oom_fn.15 (lb);
  return D.4998;
  <D.5010>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  pthread_mutex_unlock (&GC_allocate_ml);
  <D.5004>:
  D.4998 = op;
  return D.4998;
}


maybe_finalize ()
{
  int last_finalized_no.16;
  long unsigned int D.5013;
  long unsigned int GC_gc_no.17;
  int GC_is_initialized.18;
  int last_finalized_no.19;
  int D.5021;
  static int last_finalized_no = 0;

  last_finalized_no.16 = last_finalized_no;
  D.5013 = (long unsigned int) last_finalized_no.16;
  GC_gc_no.17 = GC_gc_no;
  if (D.5013 == GC_gc_no.17) goto <D.5015>; else goto <D.5016>;
  <D.5015>:
  return;
  <D.5016>:
  GC_is_initialized.18 = GC_is_initialized;
  if (GC_is_initialized.18 == 0) goto <D.5018>; else goto <D.5019>;
  <D.5018>:
  return;
  <D.5019>:
  pthread_mutex_unlock (&GC_allocate_ml);
  GC_notify_or_invoke_finalizers ();
  GC_gc_no.17 = GC_gc_no;
  last_finalized_no.19 = (int) GC_gc_no.17;
  last_finalized_no = last_finalized_no.19;
  D.5021 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.5021 != 0) goto <D.5022>; else goto <D.5023>;
  <D.5022>:
  GC_lock ();
  <D.5023>:
}


GC_debug_gcj_malloc (size_t lb, void * ptr_to_struct_containing_descr, const char * s, int i)
{
  int D.5025;
  int GC_gcj_debug_kind.20;
  int GC_all_interior_pointers.21;
  long unsigned int D.5030;
  long unsigned int D.5031;
  long unsigned int D.5032;
  long int ptr_to_struct_containing_descr.22;
  long int lb.23;
  long int D.5037;
  void * D.5038;
  void * (*<T397>) (size_t) GC_oom_fn.24;
  void * * D.5040;
  int GC_debugging_started.25;
  long unsigned int D.5044;
  void * result;

  D.5025 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.5025 != 0) goto <D.5026>; else goto <D.5027>;
  <D.5026>:
  GC_lock ();
  <D.5027>:
  maybe_finalize ();
  GC_gcj_debug_kind.20 = GC_gcj_debug_kind;
  GC_all_interior_pointers.21 = GC_all_interior_pointers;
  D.5030 = (long unsigned int) GC_all_interior_pointers.21;
  D.5031 = lb - D.5030;
  D.5032 = D.5031 + 40;
  result = GC_generic_malloc_inner (D.5032, GC_gcj_debug_kind.20);
  if (result == 0B) goto <D.5033>; else goto <D.5034>;
  <D.5033>:
  pthread_mutex_unlock (&GC_allocate_ml);
  ptr_to_struct_containing_descr.22 = (long int) ptr_to_struct_containing_descr;
  lb.23 = (long int) lb;
  GC_err_printf ("GC_debug_gcj_malloc(%ld, 0x%lx) returning NIL (", lb.23, ptr_to_struct_containing_descr.22, 0, 0, 0, 0);
  GC_err_puts (s);
  D.5037 = (long int) i;
  GC_err_printf (":%ld)\n", D.5037, 0, 0, 0, 0, 0);
  GC_oom_fn.24 = GC_oom_fn;
  D.5038 = GC_oom_fn.24 (lb);
  return D.5038;
  <D.5034>:
  D.5040 = result + 32;
  *D.5040 = ptr_to_struct_containing_descr;
  pthread_mutex_unlock (&GC_allocate_ml);
  GC_debugging_started.25 = GC_debugging_started;
  if (GC_debugging_started.25 == 0) goto <D.5042>; else goto <D.5043>;
  <D.5042>:
  {
    extern int GC_start_debugging ();

    GC_start_debugging ();
  }
  <D.5043>:
  D.5044 = (long unsigned int) i;
  D.5038 = GC_store_debug_info (result, lb, s, D.5044);
  return D.5038;
}


GC_gcj_fast_malloc (size_t lw, void * ptr_to_struct_containing_descr)
{
  char * * GC_gcjobjfreelist.26;
  long unsigned int D.5047;
  int D.5048;
  _Bool D.5051;
  long int D.5052;
  long int D.5053;
  int GC_gcj_kind.27;
  char * D.5057;
  void * D.5060;
  void * (*<T397>) (size_t) GC_oom_fn.28;
  long unsigned int D.5062;
  char * D.5064;
  long unsigned int D.5065;
  long unsigned int D.5066;
  char * op;
  char * * opp;

  GC_gcjobjfreelist.26 = GC_gcjobjfreelist;
  D.5047 = lw * 8;
  opp = GC_gcjobjfreelist.26 + D.5047;
  D.5048 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.5048 != 0) goto <D.5049>; else goto <D.5050>;
  <D.5049>:
  GC_lock ();
  <D.5050>:
  op = *opp;
  D.5051 = op == 0B;
  D.5052 = (long int) D.5051;
  D.5053 = __builtin_expect (D.5052, 0);
  if (D.5053 != 0) goto <D.5054>; else goto <D.5055>;
  <D.5054>:
  maybe_finalize ();
  GC_gcj_kind.27 = GC_gcj_kind;
  D.5057 = GC_generic_malloc_words_small_inner (lw, GC_gcj_kind.27);
  op = GC_clear_stack (D.5057);
  if (op == 0B) goto <D.5058>; else goto <D.5059>;
  <D.5058>:
  pthread_mutex_unlock (&GC_allocate_ml);
  GC_oom_fn.28 = GC_oom_fn;
  D.5062 = lw << 3;
  D.5060 = GC_oom_fn.28 (D.5062);
  return D.5060;
  <D.5059>:
  goto <D.5063>;
  <D.5055>:
  D.5064 = MEM[(char * *)op];
  *opp = D.5064;
  D.5065 = GC_arrays._words_allocd;
  D.5066 = D.5065 + lw;
  GC_arrays._words_allocd = D.5066;
  <D.5063>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  pthread_mutex_unlock (&GC_allocate_ml);
  D.5060 = op;
  return D.5060;
}


GC_debug_gcj_fast_malloc (size_t lw, void * ptr_to_struct_containing_descr, const char * s, int i)
{
  int D.5068;
  int GC_gcj_debug_kind.29;
  int GC_all_interior_pointers.30;
  long unsigned int D.5073;
  long unsigned int D.5074;
  long unsigned int D.5075;
  long int ptr_to_struct_containing_descr.31;
  long int lw.32;
  long int D.5080;
  void * D.5081;
  void * (*<T397>) (size_t) GC_oom_fn.33;
  long unsigned int D.5083;
  void * * D.5084;
  int GC_debugging_started.34;
  long unsigned int D.5088;
  void * result;
  size_t lb;

  lb = lw << 3;
  D.5068 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.5068 != 0) goto <D.5069>; else goto <D.5070>;
  <D.5069>:
  GC_lock ();
  <D.5070>:
  maybe_finalize ();
  GC_gcj_debug_kind.29 = GC_gcj_debug_kind;
  GC_all_interior_pointers.30 = GC_all_interior_pointers;
  D.5073 = (long unsigned int) GC_all_interior_pointers.30;
  D.5074 = lb - D.5073;
  D.5075 = D.5074 + 40;
  result = GC_generic_malloc_inner (D.5075, GC_gcj_debug_kind.29);
  if (result == 0B) goto <D.5076>; else goto <D.5077>;
  <D.5076>:
  pthread_mutex_unlock (&GC_allocate_ml);
  ptr_to_struct_containing_descr.31 = (long int) ptr_to_struct_containing_descr;
  lw.32 = (long int) lw;
  GC_err_printf ("GC_debug_gcj_fast_malloc(%ld, 0x%lx) returning NIL (", lw.32, ptr_to_struct_containing_descr.31, 0, 0, 0, 0);
  GC_err_puts (s);
  D.5080 = (long int) i;
  GC_err_printf (":%ld)\n", D.5080, 0, 0, 0, 0, 0);
  GC_oom_fn.33 = GC_oom_fn;
  D.5083 = lw << 3;
  D.5081 = GC_oom_fn.33 (D.5083);
  return D.5081;
  <D.5077>:
  D.5084 = result + 32;
  *D.5084 = ptr_to_struct_containing_descr;
  pthread_mutex_unlock (&GC_allocate_ml);
  GC_debugging_started.34 = GC_debugging_started;
  if (GC_debugging_started.34 == 0) goto <D.5086>; else goto <D.5087>;
  <D.5086>:
  {
    extern int GC_start_debugging ();

    GC_start_debugging ();
  }
  <D.5087>:
  D.5088 = (long unsigned int) i;
  D.5081 = GC_store_debug_info (result, lb, s, D.5088);
  return D.5081;
}


GC_gcj_malloc_ignore_off_page (size_t lb, void * ptr_to_struct_containing_descr)
{
  int GC_all_interior_pointers.35;
  long unsigned int D.5091;
  long unsigned int D.5092;
  unsigned int D.5095;
  char * * GC_gcjobjfreelist.36;
  long unsigned int D.5097;
  int D.5098;
  int GC_gcj_kind.37;
  char * D.5104;
  char * D.5106;
  long unsigned int D.5107;
  long unsigned int D.5108;
  int D.5110;
  char * D.5113;
  void * D.5116;
  register char * op;
  register char * * opp;
  register word lw;

  GC_all_interior_pointers.35 = GC_all_interior_pointers;
  D.5091 = (long unsigned int) GC_all_interior_pointers.35;
  D.5092 = 2048 - D.5091;
  if (D.5092 >= lb) goto <D.5093>; else goto <D.5094>;
  <D.5093>:
  D.5095 = GC_arrays._size_map[lb];
  lw = (word) D.5095;
  GC_gcjobjfreelist.36 = GC_gcjobjfreelist;
  D.5097 = lw * 8;
  opp = GC_gcjobjfreelist.36 + D.5097;
  D.5098 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.5098 != 0) goto <D.5099>; else goto <D.5100>;
  <D.5099>:
  GC_lock ();
  <D.5100>:
  op = *opp;
  if (op == 0B) goto <D.5101>; else goto <D.5102>;
  <D.5101>:
  maybe_finalize ();
  GC_gcj_kind.37 = GC_gcj_kind;
  D.5104 = GC_generic_malloc_inner_ignore_off_page (lb, GC_gcj_kind.37);
  op = GC_clear_stack (D.5104);
  D.5095 = GC_arrays._size_map[lb];
  lw = (word) D.5095;
  goto <D.5105>;
  <D.5102>:
  D.5106 = MEM[(char * *)op];
  *opp = D.5106;
  D.5107 = GC_arrays._words_allocd;
  D.5108 = D.5107 + lw;
  GC_arrays._words_allocd = D.5108;
  <D.5105>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  pthread_mutex_unlock (&GC_allocate_ml);
  goto <D.5109>;
  <D.5094>:
  D.5110 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.5110 != 0) goto <D.5111>; else goto <D.5112>;
  <D.5111>:
  GC_lock ();
  <D.5112>:
  maybe_finalize ();
  GC_gcj_kind.37 = GC_gcj_kind;
  D.5113 = GC_generic_malloc_inner_ignore_off_page (lb, GC_gcj_kind.37);
  op = GC_clear_stack (D.5113);
  if (op != 0B) goto <D.5114>; else goto <D.5115>;
  <D.5114>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  <D.5115>:
  pthread_mutex_unlock (&GC_allocate_ml);
  <D.5109>:
  D.5116 = op;
  return D.5116;
}


