GC_init_gcj_malloc (int mp_index, void * mp)
{
  int D.7096;
  int GC_gcj_malloc_initialized.0;
  char * D.7102;
  _Bool D.7103;
  int GC_print_stats.1;
  struct GC_ms_entry * (*<T11e4>) (GC_word *, struct GC_ms_entry *, struct GC_ms_entry *, GC_word) mp.2;
  long unsigned int mp_index.3;
  long unsigned int GC_n_mark_procs.4;
  void * * GC_gcjobjfreelist.5;
  char * * GC_gcjobjfreelist.6;
  int GC_gcj_kind.7;
  int GC_gcj_kind.8;
  int GC_gcj_kind.9;
  void * * GC_gcjdebugobjfreelist.10;
  char * * GC_gcjdebugobjfreelist.11;
  int D.7127;
  int D.7128;
  int D.7129;
  long unsigned int D.7130;
  int GC_gcj_debug_kind.12;
  register int i;
  GC_bool ignore_gcj_info;

  GC_init ();
  D.7096 = GC_test_and_set (&GC_allocate_lock);
  if (D.7096 != 0) goto <D.7097>; else goto <D.7098>;
  <D.7097>:
  GC_lock ();
  <D.7098>:
  GC_gcj_malloc_initialized.0 = GC_gcj_malloc_initialized;
  if (GC_gcj_malloc_initialized.0 != 0) goto <D.7100>; else goto <D.7101>;
  <D.7100>:
  GC_clear (&GC_allocate_lock);
  return;
  <D.7101>:
  GC_gcj_malloc_initialized = 1;
  D.7102 = getenv ("GC_IGNORE_GCJ_INFO");
  D.7103 = D.7102 != 0B;
  ignore_gcj_info = (GC_bool) D.7103;
  GC_print_stats.1 = GC_print_stats;
  if (GC_print_stats.1 != 0) goto <D.7105>; else goto <D.7106>;
  <D.7105>:
  if (ignore_gcj_info != 0) goto <D.7107>; else goto <D.7108>;
  <D.7107>:
  GC_printf ("Gcj-style type information is disabled!\n", 0, 0, 0, 0, 0, 0);
  <D.7108>:
  <D.7106>:
  mp.2 = (struct GC_ms_entry * (*<T11e4>) (GC_word *, struct GC_ms_entry *, struct GC_ms_entry *, GC_word)) mp;
  GC_arrays._mark_procs[mp_index] = mp.2;
  mp_index.3 = (long unsigned int) mp_index;
  GC_n_mark_procs.4 = GC_n_mark_procs;
  if (mp_index.3 >= GC_n_mark_procs.4) goto <D.7112>; else goto <D.7113>;
  <D.7112>:
  GC_abort ("GC_init_gcj_malloc: bad index");
  <D.7113>:
  GC_gcjobjfreelist.5 = GC_new_free_list_inner ();
  GC_gcjobjfreelist = GC_gcjobjfreelist.5;
  if (ignore_gcj_info != 0) goto <D.7115>; else goto <D.7116>;
  <D.7115>:
  GC_gcjobjfreelist.6 = GC_gcjobjfreelist;
  GC_gcj_kind.7 = GC_new_kind_inner (GC_gcjobjfreelist.6, 0, 1, 1);
  GC_gcj_kind = GC_gcj_kind.7;
  goto <D.7119>;
  <D.7116>:
  GC_gcjobjfreelist.6 = GC_gcjobjfreelist;
  GC_gcj_kind.8 = GC_new_kind_inner (GC_gcjobjfreelist.6, 4294967279, 0, 1);
  GC_gcj_kind = GC_gcj_kind.8;
  <D.7119>:
  if (ignore_gcj_info != 0) goto <D.7121>; else goto <D.7122>;
  <D.7121>:
  GC_gcj_kind.9 = GC_gcj_kind;
  GC_gcj_debug_kind = GC_gcj_kind.9;
  GC_gcjobjfreelist.6 = GC_gcjobjfreelist;
  GC_gcjdebugobjfreelist = GC_gcjobjfreelist.6;
  goto <D.7124>;
  <D.7122>:
  GC_gcjdebugobjfreelist.10 = GC_new_free_list_inner ();
  GC_gcjdebugobjfreelist = GC_gcjdebugobjfreelist.10;
  GC_gcjdebugobjfreelist.11 = GC_gcjdebugobjfreelist;
  D.7127 = mp_index | 64;
  D.7128 = D.7127 << 2;
  D.7129 = D.7128 | 2;
  D.7130 = (long unsigned int) D.7129;
  GC_gcj_debug_kind.12 = GC_new_kind_inner (GC_gcjdebugobjfreelist.11, D.7130, 0, 1);
  GC_gcj_debug_kind = GC_gcj_debug_kind.12;
  <D.7124>:
  GC_clear (&GC_allocate_lock);
}


GC_test_and_set (volatile unsigned int * addr)
{
  int D.7133;
  unsigned int D.7134;

  D.7134 = __sync_lock_test_and_set_4 (addr, 1);
  D.7133 = (int) D.7134;
  return D.7133;
}


GC_clear (volatile unsigned int * addr)
{
  __sync_synchronize ();
  *addr = 0;
}


GC_gcj_malloc (size_t lb, void * ptr_to_struct_containing_descr)
{
  int GC_all_interior_pointers.13;
  long unsigned int GC_all_interior_pointers.14;
  long unsigned int D.7138;
  _Bool D.7139;
  long int D.7140;
  long int D.7141;
  char * * GC_gcjobjfreelist.15;
  long unsigned int D.7145;
  int D.7146;
  _Bool D.7149;
  long int D.7150;
  long int D.7151;
  int GC_gcj_kind.16;
  char * D.7155;
  void * D.7158;
  void * (*<Td4e>) (size_t) GC_oom_fn.17;
  char * D.7161;
  long unsigned int D.7162;
  long unsigned int D.7163;
  int D.7165;
  char * D.7168;
  register char * op;
  register char * * opp;
  register word lw;

  GC_all_interior_pointers.13 = GC_all_interior_pointers;
  GC_all_interior_pointers.14 = (long unsigned int) GC_all_interior_pointers.13;
  D.7138 = 2048 - GC_all_interior_pointers.14;
  D.7139 = D.7138 >= lb;
  D.7140 = (long int) D.7139;
  D.7141 = __builtin_expect (D.7140, 1);
  if (D.7141 != 0) goto <D.7142>; else goto <D.7143>;
  <D.7142>:
  lw = GC_arrays._size_map[lb];
  GC_gcjobjfreelist.15 = GC_gcjobjfreelist;
  D.7145 = lw * 4;
  opp = GC_gcjobjfreelist.15 + D.7145;
  D.7146 = GC_test_and_set (&GC_allocate_lock);
  if (D.7146 != 0) goto <D.7147>; else goto <D.7148>;
  <D.7147>:
  GC_lock ();
  <D.7148>:
  op = *opp;
  D.7149 = op == 0B;
  D.7150 = (long int) D.7149;
  D.7151 = __builtin_expect (D.7150, 0);
  if (D.7151 != 0) goto <D.7152>; else goto <D.7153>;
  <D.7152>:
  maybe_finalize ();
  GC_gcj_kind.16 = GC_gcj_kind;
  D.7155 = GC_generic_malloc_inner (lb, GC_gcj_kind.16);
  op = GC_clear_stack (D.7155);
  if (op == 0B) goto <D.7156>; else goto <D.7157>;
  <D.7156>:
  GC_clear (&GC_allocate_lock);
  GC_oom_fn.17 = GC_oom_fn;
  D.7158 = GC_oom_fn.17 (lb);
  return D.7158;
  <D.7157>:
  lw = GC_arrays._size_map[lb];
  goto <D.7160>;
  <D.7153>:
  D.7161 = MEM[(char * *)op];
  *opp = D.7161;
  D.7162 = GC_arrays._words_allocd;
  D.7163 = D.7162 + lw;
  GC_arrays._words_allocd = D.7163;
  <D.7160>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  GC_clear (&GC_allocate_lock);
  goto <D.7164>;
  <D.7143>:
  D.7165 = GC_test_and_set (&GC_allocate_lock);
  if (D.7165 != 0) goto <D.7166>; else goto <D.7167>;
  <D.7166>:
  GC_lock ();
  <D.7167>:
  maybe_finalize ();
  GC_gcj_kind.16 = GC_gcj_kind;
  D.7168 = GC_generic_malloc_inner (lb, GC_gcj_kind.16);
  op = GC_clear_stack (D.7168);
  if (op == 0B) goto <D.7169>; else goto <D.7170>;
  <D.7169>:
  GC_clear (&GC_allocate_lock);
  GC_oom_fn.17 = GC_oom_fn;
  D.7158 = GC_oom_fn.17 (lb);
  return D.7158;
  <D.7170>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  GC_clear (&GC_allocate_lock);
  <D.7164>:
  D.7158 = op;
  return D.7158;
}


maybe_finalize ()
{
  int last_finalized_no.18;
  long unsigned int last_finalized_no.19;
  long unsigned int GC_gc_no.20;
  int GC_is_initialized.21;
  int GC_gc_no.22;
  int D.7181;
  static int last_finalized_no = 0;

  last_finalized_no.18 = last_finalized_no;
  last_finalized_no.19 = (long unsigned int) last_finalized_no.18;
  GC_gc_no.20 = GC_gc_no;
  if (last_finalized_no.19 == GC_gc_no.20) goto <D.7175>; else goto <D.7176>;
  <D.7175>:
  return;
  <D.7176>:
  GC_is_initialized.21 = GC_is_initialized;
  if (GC_is_initialized.21 == 0) goto <D.7178>; else goto <D.7179>;
  <D.7178>:
  return;
  <D.7179>:
  GC_clear (&GC_allocate_lock);
  GC_notify_or_invoke_finalizers ();
  GC_gc_no.20 = GC_gc_no;
  GC_gc_no.22 = (int) GC_gc_no.20;
  last_finalized_no = GC_gc_no.22;
  D.7181 = GC_test_and_set (&GC_allocate_lock);
  if (D.7181 != 0) goto <D.7182>; else goto <D.7183>;
  <D.7182>:
  GC_lock ();
  <D.7183>:
}


GC_debug_gcj_malloc (size_t lb, void * ptr_to_struct_containing_descr, const char * s, int i)
{
  int D.7185;
  int GC_all_interior_pointers.23;
  unsigned int GC_all_interior_pointers.24;
  unsigned int D.7190;
  unsigned int D.7191;
  int GC_gcj_debug_kind.25;
  long int lb.26;
  long int ptr_to_struct_containing_descr.27;
  void * D.7197;
  void * (*<Td4e>) (size_t) GC_oom_fn.28;
  void * * D.7199;
  int GC_debugging_started.29;
  long unsigned int i.30;
  void * result;

  D.7185 = GC_test_and_set (&GC_allocate_lock);
  if (D.7185 != 0) goto <D.7186>; else goto <D.7187>;
  <D.7186>:
  GC_lock ();
  <D.7187>:
  maybe_finalize ();
  GC_all_interior_pointers.23 = GC_all_interior_pointers;
  GC_all_interior_pointers.24 = (unsigned int) GC_all_interior_pointers.23;
  D.7190 = lb - GC_all_interior_pointers.24;
  D.7191 = D.7190 + 20;
  GC_gcj_debug_kind.25 = GC_gcj_debug_kind;
  result = GC_generic_malloc_inner (D.7191, GC_gcj_debug_kind.25);
  if (result == 0B) goto <D.7193>; else goto <D.7194>;
  <D.7193>:
  GC_clear (&GC_allocate_lock);
  lb.26 = (long int) lb;
  ptr_to_struct_containing_descr.27 = (long int) ptr_to_struct_containing_descr;
  GC_err_printf ("GC_debug_gcj_malloc(%ld, 0x%lx) returning NIL (", lb.26, ptr_to_struct_containing_descr.27, 0, 0, 0, 0);
  GC_err_puts (s);
  GC_err_printf (":%ld)\n", i, 0, 0, 0, 0, 0);
  GC_oom_fn.28 = GC_oom_fn;
  D.7197 = GC_oom_fn.28 (lb);
  return D.7197;
  <D.7194>:
  D.7199 = result + 16;
  *D.7199 = ptr_to_struct_containing_descr;
  GC_clear (&GC_allocate_lock);
  GC_debugging_started.29 = GC_debugging_started;
  if (GC_debugging_started.29 == 0) goto <D.7201>; else goto <D.7202>;
  <D.7201>:
  {
    extern int GC_start_debugging ();

    GC_start_debugging ();
  }
  <D.7202>:
  i.30 = (long unsigned int) i;
  D.7197 = GC_store_debug_info (result, lb, s, i.30);
  return D.7197;
}


GC_gcj_fast_malloc (size_t lw, void * ptr_to_struct_containing_descr)
{
  char * * GC_gcjobjfreelist.31;
  unsigned int D.7206;
  int D.7207;
  _Bool D.7210;
  long int D.7211;
  long int D.7212;
  int GC_gcj_kind.32;
  char * D.7216;
  void * D.7219;
  void * (*<Td4e>) (size_t) GC_oom_fn.33;
  unsigned int D.7221;
  char * D.7223;
  long unsigned int D.7224;
  long unsigned int D.7225;
  char * op;
  char * * opp;

  GC_gcjobjfreelist.31 = GC_gcjobjfreelist;
  D.7206 = lw * 4;
  opp = GC_gcjobjfreelist.31 + D.7206;
  D.7207 = GC_test_and_set (&GC_allocate_lock);
  if (D.7207 != 0) goto <D.7208>; else goto <D.7209>;
  <D.7208>:
  GC_lock ();
  <D.7209>:
  op = *opp;
  D.7210 = op == 0B;
  D.7211 = (long int) D.7210;
  D.7212 = __builtin_expect (D.7211, 0);
  if (D.7212 != 0) goto <D.7213>; else goto <D.7214>;
  <D.7213>:
  maybe_finalize ();
  GC_gcj_kind.32 = GC_gcj_kind;
  D.7216 = GC_generic_malloc_words_small_inner (lw, GC_gcj_kind.32);
  op = GC_clear_stack (D.7216);
  if (op == 0B) goto <D.7217>; else goto <D.7218>;
  <D.7217>:
  GC_clear (&GC_allocate_lock);
  GC_oom_fn.33 = GC_oom_fn;
  D.7221 = lw << 2;
  D.7219 = GC_oom_fn.33 (D.7221);
  return D.7219;
  <D.7218>:
  goto <D.7222>;
  <D.7214>:
  D.7223 = MEM[(char * *)op];
  *opp = D.7223;
  D.7224 = GC_arrays._words_allocd;
  D.7225 = D.7224 + lw;
  GC_arrays._words_allocd = D.7225;
  <D.7222>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  GC_clear (&GC_allocate_lock);
  D.7219 = op;
  return D.7219;
}


GC_debug_gcj_fast_malloc (size_t lw, void * ptr_to_struct_containing_descr, const char * s, int i)
{
  int D.7227;
  int GC_all_interior_pointers.34;
  unsigned int GC_all_interior_pointers.35;
  unsigned int D.7232;
  unsigned int D.7233;
  int GC_gcj_debug_kind.36;
  long int lw.37;
  long int ptr_to_struct_containing_descr.38;
  void * D.7239;
  void * (*<Td4e>) (size_t) GC_oom_fn.39;
  unsigned int D.7241;
  void * * D.7242;
  int GC_debugging_started.40;
  long unsigned int i.41;
  void * result;
  size_t lb;

  lb = lw << 2;
  D.7227 = GC_test_and_set (&GC_allocate_lock);
  if (D.7227 != 0) goto <D.7228>; else goto <D.7229>;
  <D.7228>:
  GC_lock ();
  <D.7229>:
  maybe_finalize ();
  GC_all_interior_pointers.34 = GC_all_interior_pointers;
  GC_all_interior_pointers.35 = (unsigned int) GC_all_interior_pointers.34;
  D.7232 = lb - GC_all_interior_pointers.35;
  D.7233 = D.7232 + 20;
  GC_gcj_debug_kind.36 = GC_gcj_debug_kind;
  result = GC_generic_malloc_inner (D.7233, GC_gcj_debug_kind.36);
  if (result == 0B) goto <D.7235>; else goto <D.7236>;
  <D.7235>:
  GC_clear (&GC_allocate_lock);
  lw.37 = (long int) lw;
  ptr_to_struct_containing_descr.38 = (long int) ptr_to_struct_containing_descr;
  GC_err_printf ("GC_debug_gcj_fast_malloc(%ld, 0x%lx) returning NIL (", lw.37, ptr_to_struct_containing_descr.38, 0, 0, 0, 0);
  GC_err_puts (s);
  GC_err_printf (":%ld)\n", i, 0, 0, 0, 0, 0);
  GC_oom_fn.39 = GC_oom_fn;
  D.7241 = lw << 2;
  D.7239 = GC_oom_fn.39 (D.7241);
  return D.7239;
  <D.7236>:
  D.7242 = result + 16;
  *D.7242 = ptr_to_struct_containing_descr;
  GC_clear (&GC_allocate_lock);
  GC_debugging_started.40 = GC_debugging_started;
  if (GC_debugging_started.40 == 0) goto <D.7244>; else goto <D.7245>;
  <D.7244>:
  {
    extern int GC_start_debugging ();

    GC_start_debugging ();
  }
  <D.7245>:
  i.41 = (long unsigned int) i;
  D.7239 = GC_store_debug_info (result, lb, s, i.41);
  return D.7239;
}


GC_gcj_malloc_ignore_off_page (size_t lb, void * ptr_to_struct_containing_descr)
{
  int GC_all_interior_pointers.42;
  long unsigned int GC_all_interior_pointers.43;
  long unsigned int D.7250;
  char * * GC_gcjobjfreelist.44;
  long unsigned int D.7254;
  int D.7255;
  int GC_gcj_kind.45;
  char * D.7261;
  char * D.7263;
  long unsigned int D.7264;
  long unsigned int D.7265;
  int D.7267;
  char * D.7270;
  void * D.7273;
  register char * op;
  register char * * opp;
  register word lw;

  GC_all_interior_pointers.42 = GC_all_interior_pointers;
  GC_all_interior_pointers.43 = (long unsigned int) GC_all_interior_pointers.42;
  D.7250 = 2048 - GC_all_interior_pointers.43;
  if (D.7250 >= lb) goto <D.7251>; else goto <D.7252>;
  <D.7251>:
  lw = GC_arrays._size_map[lb];
  GC_gcjobjfreelist.44 = GC_gcjobjfreelist;
  D.7254 = lw * 4;
  opp = GC_gcjobjfreelist.44 + D.7254;
  D.7255 = GC_test_and_set (&GC_allocate_lock);
  if (D.7255 != 0) goto <D.7256>; else goto <D.7257>;
  <D.7256>:
  GC_lock ();
  <D.7257>:
  op = *opp;
  if (op == 0B) goto <D.7258>; else goto <D.7259>;
  <D.7258>:
  maybe_finalize ();
  GC_gcj_kind.45 = GC_gcj_kind;
  D.7261 = GC_generic_malloc_inner_ignore_off_page (lb, GC_gcj_kind.45);
  op = GC_clear_stack (D.7261);
  lw = GC_arrays._size_map[lb];
  goto <D.7262>;
  <D.7259>:
  D.7263 = MEM[(char * *)op];
  *opp = D.7263;
  D.7264 = GC_arrays._words_allocd;
  D.7265 = D.7264 + lw;
  GC_arrays._words_allocd = D.7265;
  <D.7262>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  GC_clear (&GC_allocate_lock);
  goto <D.7266>;
  <D.7252>:
  D.7267 = GC_test_and_set (&GC_allocate_lock);
  if (D.7267 != 0) goto <D.7268>; else goto <D.7269>;
  <D.7268>:
  GC_lock ();
  <D.7269>:
  maybe_finalize ();
  GC_gcj_kind.45 = GC_gcj_kind;
  D.7270 = GC_generic_malloc_inner_ignore_off_page (lb, GC_gcj_kind.45);
  op = GC_clear_stack (D.7270);
  if (op != 0B) goto <D.7271>; else goto <D.7272>;
  <D.7271>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  <D.7272>:
  GC_clear (&GC_allocate_lock);
  <D.7266>:
  D.7273 = op;
  return D.7273;
}


