GC_init_gcj_malloc (int mp_index, void * mp)
{
  int D.5020;
  int GC_gcj_malloc_initialized.0;
  char * D.5026;
  _Bool D.5027;
  int GC_print_stats.1;
  struct GC_ms_entry * (*<T8f5>) (GC_word *, struct GC_ms_entry *, struct GC_ms_entry *, GC_word) mp.2;
  long unsigned int D.5034;
  long unsigned int GC_n_mark_procs.3;
  void * * D.5038;
  char * * GC_gcjobjfreelist.4;
  int D.5042;
  int D.5044;
  int GC_gcj_kind.5;
  void * * D.5049;
  char * * GC_gcjdebugobjfreelist.6;
  int D.5051;
  int D.5052;
  long unsigned int D.5053;
  int D.5054;
  register int i;
  GC_bool ignore_gcj_info;

  GC_init ();
  D.5020 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.5020 != 0) goto <D.5021>; else goto <D.5022>;
  <D.5021>:
  GC_lock ();
  <D.5022>:
  GC_gcj_malloc_initialized.0 = GC_gcj_malloc_initialized;
  if (GC_gcj_malloc_initialized.0 != 0) goto <D.5024>; else goto <D.5025>;
  <D.5024>:
  pthread_mutex_unlock (&GC_allocate_ml);
  return;
  <D.5025>:
  GC_gcj_malloc_initialized = 1;
  D.5026 = getenv ("GC_IGNORE_GCJ_INFO");
  D.5027 = D.5026 != 0B;
  ignore_gcj_info = (GC_bool) D.5027;
  GC_print_stats.1 = GC_print_stats;
  if (GC_print_stats.1 != 0) goto <D.5029>; else goto <D.5030>;
  <D.5029>:
  if (ignore_gcj_info != 0) goto <D.5031>; else goto <D.5032>;
  <D.5031>:
  GC_printf ("Gcj-style type information is disabled!\n", 0, 0, 0, 0, 0, 0);
  <D.5032>:
  <D.5030>:
  mp.2 = (struct GC_ms_entry * (*<T8f5>) (GC_word *, struct GC_ms_entry *, struct GC_ms_entry *, GC_word)) mp;
  GC_arrays._mark_procs[mp_index] = mp.2;
  D.5034 = (long unsigned int) mp_index;
  GC_n_mark_procs.3 = GC_n_mark_procs;
  if (D.5034 >= GC_n_mark_procs.3) goto <D.5036>; else goto <D.5037>;
  <D.5036>:
  GC_abort ("GC_init_gcj_malloc: bad index");
  <D.5037>:
  D.5038 = GC_new_free_list_inner ();
  GC_gcjobjfreelist = D.5038;
  if (ignore_gcj_info != 0) goto <D.5039>; else goto <D.5040>;
  <D.5039>:
  GC_gcjobjfreelist.4 = GC_gcjobjfreelist;
  D.5042 = GC_new_kind_inner (GC_gcjobjfreelist.4, 0, 1, 1);
  GC_gcj_kind = D.5042;
  goto <D.5043>;
  <D.5040>:
  GC_gcjobjfreelist.4 = GC_gcjobjfreelist;
  D.5044 = GC_new_kind_inner (GC_gcjobjfreelist.4, 18446744073709551595, 0, 1);
  GC_gcj_kind = D.5044;
  <D.5043>:
  if (ignore_gcj_info != 0) goto <D.5045>; else goto <D.5046>;
  <D.5045>:
  GC_gcj_kind.5 = GC_gcj_kind;
  GC_gcj_debug_kind = GC_gcj_kind.5;
  GC_gcjobjfreelist.4 = GC_gcjobjfreelist;
  GC_gcjdebugobjfreelist = GC_gcjobjfreelist.4;
  goto <D.5048>;
  <D.5046>:
  D.5049 = GC_new_free_list_inner ();
  GC_gcjdebugobjfreelist = D.5049;
  GC_gcjdebugobjfreelist.6 = GC_gcjdebugobjfreelist;
  D.5051 = mp_index << 2;
  D.5052 = D.5051 | 258;
  D.5053 = (long unsigned int) D.5052;
  D.5054 = GC_new_kind_inner (GC_gcjdebugobjfreelist.6, D.5053, 0, 1);
  GC_gcj_debug_kind = D.5054;
  <D.5048>:
  pthread_mutex_unlock (&GC_allocate_ml);
}


GC_gcj_malloc (size_t lb, void * ptr_to_struct_containing_descr)
{
  int GC_all_interior_pointers.7;
  long unsigned int D.5057;
  long unsigned int D.5058;
  _Bool D.5059;
  long int D.5060;
  long int D.5061;
  unsigned int D.5064;
  char * * GC_gcjobjfreelist.8;
  long unsigned int D.5066;
  int D.5067;
  _Bool D.5070;
  long int D.5071;
  long int D.5072;
  int GC_gcj_kind.9;
  char * D.5076;
  void * D.5079;
  void * (*<T40d>) (size_t) GC_oom_fn.10;
  char * D.5082;
  long unsigned int D.5083;
  long unsigned int D.5084;
  int D.5086;
  char * D.5089;
  register char * op;
  register char * * opp;
  register word lw;

  GC_all_interior_pointers.7 = GC_all_interior_pointers;
  D.5057 = (long unsigned int) GC_all_interior_pointers.7;
  D.5058 = 2048 - D.5057;
  D.5059 = D.5058 >= lb;
  D.5060 = (long int) D.5059;
  D.5061 = __builtin_expect (D.5060, 1);
  if (D.5061 != 0) goto <D.5062>; else goto <D.5063>;
  <D.5062>:
  D.5064 = GC_arrays._size_map[lb];
  lw = (word) D.5064;
  GC_gcjobjfreelist.8 = GC_gcjobjfreelist;
  D.5066 = lw * 8;
  opp = GC_gcjobjfreelist.8 + D.5066;
  D.5067 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.5067 != 0) goto <D.5068>; else goto <D.5069>;
  <D.5068>:
  GC_lock ();
  <D.5069>:
  op = *opp;
  D.5070 = op == 0B;
  D.5071 = (long int) D.5070;
  D.5072 = __builtin_expect (D.5071, 0);
  if (D.5072 != 0) goto <D.5073>; else goto <D.5074>;
  <D.5073>:
  maybe_finalize ();
  GC_gcj_kind.9 = GC_gcj_kind;
  D.5076 = GC_generic_malloc_inner (lb, GC_gcj_kind.9);
  op = GC_clear_stack (D.5076);
  if (op == 0B) goto <D.5077>; else goto <D.5078>;
  <D.5077>:
  pthread_mutex_unlock (&GC_allocate_ml);
  GC_oom_fn.10 = GC_oom_fn;
  D.5079 = GC_oom_fn.10 (lb);
  return D.5079;
  <D.5078>:
  D.5064 = GC_arrays._size_map[lb];
  lw = (word) D.5064;
  goto <D.5081>;
  <D.5074>:
  D.5082 = MEM[(char * *)op];
  *opp = D.5082;
  D.5083 = GC_arrays._words_allocd;
  D.5084 = D.5083 + lw;
  GC_arrays._words_allocd = D.5084;
  <D.5081>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  pthread_mutex_unlock (&GC_allocate_ml);
  goto <D.5085>;
  <D.5063>:
  D.5086 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.5086 != 0) goto <D.5087>; else goto <D.5088>;
  <D.5087>:
  GC_lock ();
  <D.5088>:
  maybe_finalize ();
  GC_gcj_kind.9 = GC_gcj_kind;
  D.5089 = GC_generic_malloc_inner (lb, GC_gcj_kind.9);
  op = GC_clear_stack (D.5089);
  if (op == 0B) goto <D.5090>; else goto <D.5091>;
  <D.5090>:
  pthread_mutex_unlock (&GC_allocate_ml);
  GC_oom_fn.10 = GC_oom_fn;
  D.5079 = GC_oom_fn.10 (lb);
  return D.5079;
  <D.5091>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  pthread_mutex_unlock (&GC_allocate_ml);
  <D.5085>:
  D.5079 = op;
  return D.5079;
}


maybe_finalize ()
{
  int last_finalized_no.11;
  long unsigned int D.5094;
  long unsigned int GC_gc_no.12;
  int GC_is_initialized.13;
  int last_finalized_no.14;
  int D.5102;
  static int last_finalized_no = 0;

  last_finalized_no.11 = last_finalized_no;
  D.5094 = (long unsigned int) last_finalized_no.11;
  GC_gc_no.12 = GC_gc_no;
  if (D.5094 == GC_gc_no.12) goto <D.5096>; else goto <D.5097>;
  <D.5096>:
  return;
  <D.5097>:
  GC_is_initialized.13 = GC_is_initialized;
  if (GC_is_initialized.13 == 0) goto <D.5099>; else goto <D.5100>;
  <D.5099>:
  return;
  <D.5100>:
  pthread_mutex_unlock (&GC_allocate_ml);
  GC_notify_or_invoke_finalizers ();
  GC_gc_no.12 = GC_gc_no;
  last_finalized_no.14 = (int) GC_gc_no.12;
  last_finalized_no = last_finalized_no.14;
  D.5102 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.5102 != 0) goto <D.5103>; else goto <D.5104>;
  <D.5103>:
  GC_lock ();
  <D.5104>:
}


GC_debug_gcj_malloc (size_t lb, void * ptr_to_struct_containing_descr, const char * s, int i)
{
  int D.5106;
  int GC_all_interior_pointers.15;
  long unsigned int D.5110;
  long unsigned int D.5111;
  long unsigned int D.5112;
  int GC_gcj_debug_kind.16;
  long int lb.17;
  long int ptr_to_struct_containing_descr.18;
  long int D.5118;
  void * D.5119;
  void * (*<T40d>) (size_t) GC_oom_fn.19;
  void * * D.5121;
  int GC_debugging_started.20;
  long unsigned int D.5125;
  void * result;

  D.5106 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.5106 != 0) goto <D.5107>; else goto <D.5108>;
  <D.5107>:
  GC_lock ();
  <D.5108>:
  maybe_finalize ();
  GC_all_interior_pointers.15 = GC_all_interior_pointers;
  D.5110 = (long unsigned int) GC_all_interior_pointers.15;
  D.5111 = lb - D.5110;
  D.5112 = D.5111 + 40;
  GC_gcj_debug_kind.16 = GC_gcj_debug_kind;
  result = GC_generic_malloc_inner (D.5112, GC_gcj_debug_kind.16);
  if (result == 0B) goto <D.5114>; else goto <D.5115>;
  <D.5114>:
  pthread_mutex_unlock (&GC_allocate_ml);
  lb.17 = (long int) lb;
  ptr_to_struct_containing_descr.18 = (long int) ptr_to_struct_containing_descr;
  GC_err_printf ("GC_debug_gcj_malloc(%ld, 0x%lx) returning NIL (", lb.17, ptr_to_struct_containing_descr.18, 0, 0, 0, 0);
  GC_err_puts (s);
  D.5118 = (long int) i;
  GC_err_printf (":%ld)\n", D.5118, 0, 0, 0, 0, 0);
  GC_oom_fn.19 = GC_oom_fn;
  D.5119 = GC_oom_fn.19 (lb);
  return D.5119;
  <D.5115>:
  D.5121 = result + 32;
  *D.5121 = ptr_to_struct_containing_descr;
  pthread_mutex_unlock (&GC_allocate_ml);
  GC_debugging_started.20 = GC_debugging_started;
  if (GC_debugging_started.20 == 0) goto <D.5123>; else goto <D.5124>;
  <D.5123>:
  {
    extern int GC_start_debugging ();

    GC_start_debugging ();
  }
  <D.5124>:
  D.5125 = (long unsigned int) i;
  D.5119 = GC_store_debug_info (result, lb, s, D.5125);
  return D.5119;
}


GC_gcj_fast_malloc (size_t lw, void * ptr_to_struct_containing_descr)
{
  char * * GC_gcjobjfreelist.21;
  long unsigned int D.5128;
  int D.5129;
  _Bool D.5132;
  long int D.5133;
  long int D.5134;
  int GC_gcj_kind.22;
  char * D.5138;
  void * D.5141;
  void * (*<T40d>) (size_t) GC_oom_fn.23;
  long unsigned int D.5143;
  char * D.5145;
  long unsigned int D.5146;
  long unsigned int D.5147;
  char * op;
  char * * opp;

  GC_gcjobjfreelist.21 = GC_gcjobjfreelist;
  D.5128 = lw * 8;
  opp = GC_gcjobjfreelist.21 + D.5128;
  D.5129 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.5129 != 0) goto <D.5130>; else goto <D.5131>;
  <D.5130>:
  GC_lock ();
  <D.5131>:
  op = *opp;
  D.5132 = op == 0B;
  D.5133 = (long int) D.5132;
  D.5134 = __builtin_expect (D.5133, 0);
  if (D.5134 != 0) goto <D.5135>; else goto <D.5136>;
  <D.5135>:
  maybe_finalize ();
  GC_gcj_kind.22 = GC_gcj_kind;
  D.5138 = GC_generic_malloc_words_small_inner (lw, GC_gcj_kind.22);
  op = GC_clear_stack (D.5138);
  if (op == 0B) goto <D.5139>; else goto <D.5140>;
  <D.5139>:
  pthread_mutex_unlock (&GC_allocate_ml);
  GC_oom_fn.23 = GC_oom_fn;
  D.5143 = lw << 3;
  D.5141 = GC_oom_fn.23 (D.5143);
  return D.5141;
  <D.5140>:
  goto <D.5144>;
  <D.5136>:
  D.5145 = MEM[(char * *)op];
  *opp = D.5145;
  D.5146 = GC_arrays._words_allocd;
  D.5147 = D.5146 + lw;
  GC_arrays._words_allocd = D.5147;
  <D.5144>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  pthread_mutex_unlock (&GC_allocate_ml);
  D.5141 = op;
  return D.5141;
}


GC_debug_gcj_fast_malloc (size_t lw, void * ptr_to_struct_containing_descr, const char * s, int i)
{
  int D.5149;
  int GC_all_interior_pointers.24;
  long unsigned int D.5153;
  long unsigned int D.5154;
  long unsigned int D.5155;
  int GC_gcj_debug_kind.25;
  long int lw.26;
  long int ptr_to_struct_containing_descr.27;
  long int D.5161;
  void * D.5162;
  void * (*<T40d>) (size_t) GC_oom_fn.28;
  long unsigned int D.5164;
  void * * D.5165;
  int GC_debugging_started.29;
  long unsigned int D.5169;
  void * result;
  size_t lb;

  lb = lw << 3;
  D.5149 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.5149 != 0) goto <D.5150>; else goto <D.5151>;
  <D.5150>:
  GC_lock ();
  <D.5151>:
  maybe_finalize ();
  GC_all_interior_pointers.24 = GC_all_interior_pointers;
  D.5153 = (long unsigned int) GC_all_interior_pointers.24;
  D.5154 = lb - D.5153;
  D.5155 = D.5154 + 40;
  GC_gcj_debug_kind.25 = GC_gcj_debug_kind;
  result = GC_generic_malloc_inner (D.5155, GC_gcj_debug_kind.25);
  if (result == 0B) goto <D.5157>; else goto <D.5158>;
  <D.5157>:
  pthread_mutex_unlock (&GC_allocate_ml);
  lw.26 = (long int) lw;
  ptr_to_struct_containing_descr.27 = (long int) ptr_to_struct_containing_descr;
  GC_err_printf ("GC_debug_gcj_fast_malloc(%ld, 0x%lx) returning NIL (", lw.26, ptr_to_struct_containing_descr.27, 0, 0, 0, 0);
  GC_err_puts (s);
  D.5161 = (long int) i;
  GC_err_printf (":%ld)\n", D.5161, 0, 0, 0, 0, 0);
  GC_oom_fn.28 = GC_oom_fn;
  D.5164 = lw << 3;
  D.5162 = GC_oom_fn.28 (D.5164);
  return D.5162;
  <D.5158>:
  D.5165 = result + 32;
  *D.5165 = ptr_to_struct_containing_descr;
  pthread_mutex_unlock (&GC_allocate_ml);
  GC_debugging_started.29 = GC_debugging_started;
  if (GC_debugging_started.29 == 0) goto <D.5167>; else goto <D.5168>;
  <D.5167>:
  {
    extern int GC_start_debugging ();

    GC_start_debugging ();
  }
  <D.5168>:
  D.5169 = (long unsigned int) i;
  D.5162 = GC_store_debug_info (result, lb, s, D.5169);
  return D.5162;
}


GC_gcj_malloc_ignore_off_page (size_t lb, void * ptr_to_struct_containing_descr)
{
  int GC_all_interior_pointers.30;
  long unsigned int D.5172;
  long unsigned int D.5173;
  unsigned int D.5176;
  char * * GC_gcjobjfreelist.31;
  long unsigned int D.5178;
  int D.5179;
  int GC_gcj_kind.32;
  char * D.5185;
  char * D.5187;
  long unsigned int D.5188;
  long unsigned int D.5189;
  int D.5191;
  char * D.5194;
  void * D.5197;
  register char * op;
  register char * * opp;
  register word lw;

  GC_all_interior_pointers.30 = GC_all_interior_pointers;
  D.5172 = (long unsigned int) GC_all_interior_pointers.30;
  D.5173 = 2048 - D.5172;
  if (D.5173 >= lb) goto <D.5174>; else goto <D.5175>;
  <D.5174>:
  D.5176 = GC_arrays._size_map[lb];
  lw = (word) D.5176;
  GC_gcjobjfreelist.31 = GC_gcjobjfreelist;
  D.5178 = lw * 8;
  opp = GC_gcjobjfreelist.31 + D.5178;
  D.5179 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.5179 != 0) goto <D.5180>; else goto <D.5181>;
  <D.5180>:
  GC_lock ();
  <D.5181>:
  op = *opp;
  if (op == 0B) goto <D.5182>; else goto <D.5183>;
  <D.5182>:
  maybe_finalize ();
  GC_gcj_kind.32 = GC_gcj_kind;
  D.5185 = GC_generic_malloc_inner_ignore_off_page (lb, GC_gcj_kind.32);
  op = GC_clear_stack (D.5185);
  D.5176 = GC_arrays._size_map[lb];
  lw = (word) D.5176;
  goto <D.5186>;
  <D.5183>:
  D.5187 = MEM[(char * *)op];
  *opp = D.5187;
  D.5188 = GC_arrays._words_allocd;
  D.5189 = D.5188 + lw;
  GC_arrays._words_allocd = D.5189;
  <D.5186>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  pthread_mutex_unlock (&GC_allocate_ml);
  goto <D.5190>;
  <D.5175>:
  D.5191 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.5191 != 0) goto <D.5192>; else goto <D.5193>;
  <D.5192>:
  GC_lock ();
  <D.5193>:
  maybe_finalize ();
  GC_gcj_kind.32 = GC_gcj_kind;
  D.5194 = GC_generic_malloc_inner_ignore_off_page (lb, GC_gcj_kind.32);
  op = GC_clear_stack (D.5194);
  if (op != 0B) goto <D.5195>; else goto <D.5196>;
  <D.5195>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  <D.5196>:
  pthread_mutex_unlock (&GC_allocate_ml);
  <D.5190>:
  D.5197 = op;
  return D.5197;
}


