GC_init_gcj_malloc (int mp_index, void * mp)
{
  int D.4588;
  int GC_gcj_malloc_initialized.0;
  char * D.4594;
  _Bool D.4595;
  int GC_print_stats.1;
  struct GC_ms_entry * (*<T775>) (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;
  int D.4618;
  int D.4619;
  int D.4620;
  long unsigned int D.4621;
  char * * GC_gcjdebugobjfreelist.11;
  int GC_gcj_debug_kind.12;
  register int i;
  GC_bool ignore_gcj_info;

  GC_init ();
  D.4588 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.4588 != 0) goto <D.4589>; else goto <D.4590>;
  <D.4589>:
  GC_lock ();
  <D.4590>:
  GC_gcj_malloc_initialized.0 = GC_gcj_malloc_initialized;
  if (GC_gcj_malloc_initialized.0 != 0) goto <D.4592>; else goto <D.4593>;
  <D.4592>:
  pthread_mutex_unlock (&GC_allocate_ml);
  return;
  <D.4593>:
  GC_gcj_malloc_initialized = 1;
  D.4594 = getenv ("GC_IGNORE_GCJ_INFO");
  D.4595 = D.4594 != 0B;
  ignore_gcj_info = (GC_bool) D.4595;
  GC_print_stats.1 = GC_print_stats;
  if (GC_print_stats.1 != 0) goto <D.4597>; else goto <D.4598>;
  <D.4597>:
  if (ignore_gcj_info != 0) goto <D.4599>; else goto <D.4600>;
  <D.4599>:
  GC_printf ("Gcj-style type information is disabled!\n", 0, 0, 0, 0, 0, 0);
  <D.4600>:
  <D.4598>:
  mp.2 = (struct GC_ms_entry * (*<T775>) (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.4604>; else goto <D.4605>;
  <D.4604>:
  GC_abort ("GC_init_gcj_malloc: bad index");
  <D.4605>:
  GC_gcjobjfreelist.5 = GC_new_free_list_inner ();
  GC_gcjobjfreelist = GC_gcjobjfreelist.5;
  if (ignore_gcj_info != 0) goto <D.4607>; else goto <D.4608>;
  <D.4607>:
  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.4611>;
  <D.4608>:
  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.4611>:
  if (ignore_gcj_info != 0) goto <D.4613>; else goto <D.4614>;
  <D.4613>:
  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.4616>;
  <D.4614>:
  GC_gcjdebugobjfreelist.10 = GC_new_free_list_inner ();
  GC_gcjdebugobjfreelist = GC_gcjdebugobjfreelist.10;
  D.4618 = mp_index | 64;
  D.4619 = D.4618 << 2;
  D.4620 = D.4619 | 2;
  D.4621 = (long unsigned int) D.4620;
  GC_gcjdebugobjfreelist.11 = GC_gcjdebugobjfreelist;
  GC_gcj_debug_kind.12 = GC_new_kind_inner (GC_gcjdebugobjfreelist.11, D.4621, 0, 1);
  GC_gcj_debug_kind = GC_gcj_debug_kind.12;
  <D.4616>:
  pthread_mutex_unlock (&GC_allocate_ml);
}


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.4627;
  _Bool D.4628;
  long int D.4629;
  long int D.4630;
  char * * GC_gcjobjfreelist.15;
  long unsigned int D.4634;
  int D.4635;
  _Bool D.4638;
  long int D.4639;
  long int D.4640;
  int GC_gcj_kind.16;
  char * D.4644;
  void * D.4647;
  void * (*<T2bb>) (size_t) GC_oom_fn.17;
  char * D.4650;
  long unsigned int D.4651;
  long unsigned int D.4652;
  int D.4654;
  char * D.4657;
  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.4627 = 2048 - GC_all_interior_pointers.14;
  D.4628 = D.4627 >= lb;
  D.4629 = (long int) D.4628;
  D.4630 = __builtin_expect (D.4629, 1);
  if (D.4630 != 0) goto <D.4631>; else goto <D.4632>;
  <D.4631>:
  lw = GC_arrays._size_map[lb];
  GC_gcjobjfreelist.15 = GC_gcjobjfreelist;
  D.4634 = lw * 4;
  opp = GC_gcjobjfreelist.15 + D.4634;
  D.4635 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.4635 != 0) goto <D.4636>; else goto <D.4637>;
  <D.4636>:
  GC_lock ();
  <D.4637>:
  op = *opp;
  D.4638 = op == 0B;
  D.4639 = (long int) D.4638;
  D.4640 = __builtin_expect (D.4639, 0);
  if (D.4640 != 0) goto <D.4641>; else goto <D.4642>;
  <D.4641>:
  maybe_finalize ();
  GC_gcj_kind.16 = GC_gcj_kind;
  D.4644 = GC_generic_malloc_inner (lb, GC_gcj_kind.16);
  op = GC_clear_stack (D.4644);
  if (op == 0B) goto <D.4645>; else goto <D.4646>;
  <D.4645>:
  pthread_mutex_unlock (&GC_allocate_ml);
  GC_oom_fn.17 = GC_oom_fn;
  D.4647 = GC_oom_fn.17 (lb);
  return D.4647;
  <D.4646>:
  lw = GC_arrays._size_map[lb];
  goto <D.4649>;
  <D.4642>:
  D.4650 = MEM[(char * *)op];
  *opp = D.4650;
  D.4651 = GC_arrays._words_allocd;
  D.4652 = D.4651 + lw;
  GC_arrays._words_allocd = D.4652;
  <D.4649>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  pthread_mutex_unlock (&GC_allocate_ml);
  goto <D.4653>;
  <D.4632>:
  D.4654 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.4654 != 0) goto <D.4655>; else goto <D.4656>;
  <D.4655>:
  GC_lock ();
  <D.4656>:
  maybe_finalize ();
  GC_gcj_kind.16 = GC_gcj_kind;
  D.4657 = GC_generic_malloc_inner (lb, GC_gcj_kind.16);
  op = GC_clear_stack (D.4657);
  if (op == 0B) goto <D.4658>; else goto <D.4659>;
  <D.4658>:
  pthread_mutex_unlock (&GC_allocate_ml);
  GC_oom_fn.17 = GC_oom_fn;
  D.4647 = GC_oom_fn.17 (lb);
  return D.4647;
  <D.4659>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  pthread_mutex_unlock (&GC_allocate_ml);
  <D.4653>:
  D.4647 = op;
  return D.4647;
}


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.4670;
  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.4664>; else goto <D.4665>;
  <D.4664>:
  return;
  <D.4665>:
  GC_is_initialized.21 = GC_is_initialized;
  if (GC_is_initialized.21 == 0) goto <D.4667>; else goto <D.4668>;
  <D.4667>:
  return;
  <D.4668>:
  pthread_mutex_unlock (&GC_allocate_ml);
  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.4670 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.4670 != 0) goto <D.4671>; else goto <D.4672>;
  <D.4671>:
  GC_lock ();
  <D.4672>:
}


GC_debug_gcj_malloc (size_t lb, void * ptr_to_struct_containing_descr, const char * s, int i)
{
  int D.4674;
  int GC_gcj_debug_kind.23;
  int GC_all_interior_pointers.24;
  unsigned int GC_all_interior_pointers.25;
  unsigned int D.4680;
  unsigned int D.4681;
  long int ptr_to_struct_containing_descr.26;
  long int lb.27;
  void * D.4686;
  void * (*<T2bb>) (size_t) GC_oom_fn.28;
  void * * D.4688;
  int GC_debugging_started.29;
  long unsigned int i.30;
  void * result;

  D.4674 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.4674 != 0) goto <D.4675>; else goto <D.4676>;
  <D.4675>:
  GC_lock ();
  <D.4676>:
  maybe_finalize ();
  GC_gcj_debug_kind.23 = GC_gcj_debug_kind;
  GC_all_interior_pointers.24 = GC_all_interior_pointers;
  GC_all_interior_pointers.25 = (unsigned int) GC_all_interior_pointers.24;
  D.4680 = lb - GC_all_interior_pointers.25;
  D.4681 = D.4680 + 20;
  result = GC_generic_malloc_inner (D.4681, GC_gcj_debug_kind.23);
  if (result == 0B) goto <D.4682>; else goto <D.4683>;
  <D.4682>:
  pthread_mutex_unlock (&GC_allocate_ml);
  ptr_to_struct_containing_descr.26 = (long int) ptr_to_struct_containing_descr;
  lb.27 = (long int) lb;
  GC_err_printf ("GC_debug_gcj_malloc(%ld, 0x%lx) returning NIL (", lb.27, ptr_to_struct_containing_descr.26, 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.4686 = GC_oom_fn.28 (lb);
  return D.4686;
  <D.4683>:
  D.4688 = result + 16;
  *D.4688 = 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.4690>; else goto <D.4691>;
  <D.4690>:
  {
    extern int GC_start_debugging ();

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


GC_gcj_fast_malloc (size_t lw, void * ptr_to_struct_containing_descr)
{
  char * * GC_gcjobjfreelist.31;
  unsigned int D.4695;
  int D.4696;
  _Bool D.4699;
  long int D.4700;
  long int D.4701;
  int GC_gcj_kind.32;
  char * D.4705;
  void * D.4708;
  void * (*<T2bb>) (size_t) GC_oom_fn.33;
  unsigned int D.4710;
  char * D.4712;
  long unsigned int D.4713;
  long unsigned int D.4714;
  char * op;
  char * * opp;

  GC_gcjobjfreelist.31 = GC_gcjobjfreelist;
  D.4695 = lw * 4;
  opp = GC_gcjobjfreelist.31 + D.4695;
  D.4696 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.4696 != 0) goto <D.4697>; else goto <D.4698>;
  <D.4697>:
  GC_lock ();
  <D.4698>:
  op = *opp;
  D.4699 = op == 0B;
  D.4700 = (long int) D.4699;
  D.4701 = __builtin_expect (D.4700, 0);
  if (D.4701 != 0) goto <D.4702>; else goto <D.4703>;
  <D.4702>:
  maybe_finalize ();
  GC_gcj_kind.32 = GC_gcj_kind;
  D.4705 = GC_generic_malloc_words_small_inner (lw, GC_gcj_kind.32);
  op = GC_clear_stack (D.4705);
  if (op == 0B) goto <D.4706>; else goto <D.4707>;
  <D.4706>:
  pthread_mutex_unlock (&GC_allocate_ml);
  GC_oom_fn.33 = GC_oom_fn;
  D.4710 = lw << 2;
  D.4708 = GC_oom_fn.33 (D.4710);
  return D.4708;
  <D.4707>:
  goto <D.4711>;
  <D.4703>:
  D.4712 = MEM[(char * *)op];
  *opp = D.4712;
  D.4713 = GC_arrays._words_allocd;
  D.4714 = D.4713 + lw;
  GC_arrays._words_allocd = D.4714;
  <D.4711>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  pthread_mutex_unlock (&GC_allocate_ml);
  D.4708 = op;
  return D.4708;
}


GC_debug_gcj_fast_malloc (size_t lw, void * ptr_to_struct_containing_descr, const char * s, int i)
{
  int D.4716;
  int GC_gcj_debug_kind.34;
  int GC_all_interior_pointers.35;
  unsigned int GC_all_interior_pointers.36;
  unsigned int D.4722;
  unsigned int D.4723;
  long int ptr_to_struct_containing_descr.37;
  long int lw.38;
  void * D.4728;
  void * (*<T2bb>) (size_t) GC_oom_fn.39;
  unsigned int D.4730;
  void * * D.4731;
  int GC_debugging_started.40;
  long unsigned int i.41;
  void * result;
  size_t lb;

  lb = lw << 2;
  D.4716 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.4716 != 0) goto <D.4717>; else goto <D.4718>;
  <D.4717>:
  GC_lock ();
  <D.4718>:
  maybe_finalize ();
  GC_gcj_debug_kind.34 = GC_gcj_debug_kind;
  GC_all_interior_pointers.35 = GC_all_interior_pointers;
  GC_all_interior_pointers.36 = (unsigned int) GC_all_interior_pointers.35;
  D.4722 = lb - GC_all_interior_pointers.36;
  D.4723 = D.4722 + 20;
  result = GC_generic_malloc_inner (D.4723, GC_gcj_debug_kind.34);
  if (result == 0B) goto <D.4724>; else goto <D.4725>;
  <D.4724>:
  pthread_mutex_unlock (&GC_allocate_ml);
  ptr_to_struct_containing_descr.37 = (long int) ptr_to_struct_containing_descr;
  lw.38 = (long int) lw;
  GC_err_printf ("GC_debug_gcj_fast_malloc(%ld, 0x%lx) returning NIL (", lw.38, ptr_to_struct_containing_descr.37, 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.4730 = lw << 2;
  D.4728 = GC_oom_fn.39 (D.4730);
  return D.4728;
  <D.4725>:
  D.4731 = result + 16;
  *D.4731 = ptr_to_struct_containing_descr;
  pthread_mutex_unlock (&GC_allocate_ml);
  GC_debugging_started.40 = GC_debugging_started;
  if (GC_debugging_started.40 == 0) goto <D.4733>; else goto <D.4734>;
  <D.4733>:
  {
    extern int GC_start_debugging ();

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


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.4739;
  char * * GC_gcjobjfreelist.44;
  long unsigned int D.4743;
  int D.4744;
  int GC_gcj_kind.45;
  char * D.4750;
  char * D.4752;
  long unsigned int D.4753;
  long unsigned int D.4754;
  int D.4756;
  char * D.4759;
  void * D.4762;
  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.4739 = 2048 - GC_all_interior_pointers.43;
  if (D.4739 >= lb) goto <D.4740>; else goto <D.4741>;
  <D.4740>:
  lw = GC_arrays._size_map[lb];
  GC_gcjobjfreelist.44 = GC_gcjobjfreelist;
  D.4743 = lw * 4;
  opp = GC_gcjobjfreelist.44 + D.4743;
  D.4744 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.4744 != 0) goto <D.4745>; else goto <D.4746>;
  <D.4745>:
  GC_lock ();
  <D.4746>:
  op = *opp;
  if (op == 0B) goto <D.4747>; else goto <D.4748>;
  <D.4747>:
  maybe_finalize ();
  GC_gcj_kind.45 = GC_gcj_kind;
  D.4750 = GC_generic_malloc_inner_ignore_off_page (lb, GC_gcj_kind.45);
  op = GC_clear_stack (D.4750);
  lw = GC_arrays._size_map[lb];
  goto <D.4751>;
  <D.4748>:
  D.4752 = MEM[(char * *)op];
  *opp = D.4752;
  D.4753 = GC_arrays._words_allocd;
  D.4754 = D.4753 + lw;
  GC_arrays._words_allocd = D.4754;
  <D.4751>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  pthread_mutex_unlock (&GC_allocate_ml);
  goto <D.4755>;
  <D.4741>:
  D.4756 = pthread_mutex_trylock (&GC_allocate_ml);
  if (D.4756 != 0) goto <D.4757>; else goto <D.4758>;
  <D.4757>:
  GC_lock ();
  <D.4758>:
  maybe_finalize ();
  GC_gcj_kind.45 = GC_gcj_kind;
  D.4759 = GC_generic_malloc_inner_ignore_off_page (lb, GC_gcj_kind.45);
  op = GC_clear_stack (D.4759);
  if (op != 0B) goto <D.4760>; else goto <D.4761>;
  <D.4760>:
  MEM[(void * *)op] = ptr_to_struct_containing_descr;
  <D.4761>:
  pthread_mutex_unlock (&GC_allocate_ml);
  <D.4755>:
  D.4762 = op;
  return D.4762;
}


