#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "prescheme.h"
#include "scheme48vm.h"
#include "scheme48heap.h"

struct image_location {
  long new_descriptor;
  long next;
};
struct table {
  long *keys;
  struct image_location **values;
  long count;
  long size;
};
static struct image_location *table_ref(struct table*, long);
static long copy_weak_pointer(long, char *, char **);
static void table_setB(struct table*, long, struct image_location*);
static long real_copy_object(long, char *, char **);
static char resumer_recordP(long);
static long trace_image_value(long);
void s48_write_barrier(long, char *, long);
void s48_forbid_gcB(void);
void s48_allow_gcB(void);
long s48_heap_size(void);
long s48_gc_count(void);
long s48_gc_run_time(long*);
void s48_initialization_completeB(void);
long s48_max_heap_size(void);
long s48_startup_procedure(void);
long s48_initial_symbols(void);
long s48_initial_imported_bindings(void);
long s48_initial_exported_bindings(void);
long s48_resumer_records(void);
void s48_set_image_valuesB(long, long, long, long, long);
char * s48_allocate_small(long);
char s48_stob_in_heapP(long);
long s48_available(void);
char s48_extantP(long);
long s48_gather_objects(char(*)(long), char(*)(char(*)(long)));
static char pD1(long);
char s48_check_heap(long);
long s48_find_all(long);
long s48_trace_value(long);
long s48_find_all_records(long);
void s48_trace_continuation_contentsB(char *, char *, long);
void s48_initializing_gc_root(void);
long s48_write_image(long, long, FILE *);
void s48_trace_locationsB(char *, char *);
void s48_trace_stob_contentsB(long);
void s48_collect(char);
void s48_make_availableAgc(long);
char * s48_allocate_tracedAgc(long);
char * s48_allocate_weakAgc(long);
char * s48_allocate_untracedAgc(long);
long s48_allocate_stob(long, long);
long s48_read_image(char*, long);
static char * Soldspace_hpS;
static char * Soldspace_limitS;
static char * Snewspace_beginS;
static char * Snewspace_endS;
static char * Soldspace_beginS;
static char * Soldspace_endS;
static char * Snew_heap_start_addrS;
static char * *Spure_areasS;
static char * *Simpure_areasS;
static long *Spure_sizesS;
static long *Simpure_sizesS;
static long Spure_area_countS;
static long Simpure_area_countS;
static char (*Scollect_predicateS)(long);
static long Sfinding_typeS;
static long Sheap_errors_leftS;
static long Sgc_countS;
static long Sgc_secondsS;
static long Sgc_msecondsS;
static char * Sfrom_beginS;
static char * Sfrom_endS;
static char * Sweak_pointer_hpS;
static char * Sweak_pointer_limitS;
static long SstatusS;
static char SeofPS;
static long Sstartup_procedureS;
static long SsymbolsS;
static long Simported_bindingsS;
static long Sexported_bindingsS;
static long Sresumer_recordsS;
static char * Simg_start_addrS;
static char * Simg_end_addrS;
static long Simg_heap_sizeS;
static char * Ssmall_img_start_addrS;
static char * Ssmall_img_hp_addrS;
static char * Ssmall_img_end_addrS;
static long Ssmall_img_heap_sizeS;
static char * Slarge_img_start_addrS;
static char * Slarge_img_hp_addrS;
static char * Slarge_img_end_addrS;
static long Slarge_img_heap_sizeS;
static char * Sweaks_img_start_addrS;
static char * Sweaks_img_hp_addrS;
static char * Sweaks_img_end_addrS;
static long Sweaks_img_heap_sizeS;
static char * Sheap_image_pointerS;
static char * Ssymbol_addressS;
static long Sheap_object_remaining_cellsS;
static char * Sheap_object_pointerS;
static struct table *Sstob_tableS;
static long SoffsetS;
static char * Sarea_startS;
static char SinitializingPS;
static long SstatusS;
static FILE * Simage_portS;
static char * Simage_bufferS;
static char * Simage_buffer_pointerS;
static long image_start_address;
static char * Simage_beginS;
static char * Simage_hpS;
static struct table *Sstob_tableS;
static long Sfirst_stobS;
static struct image_location *Slast_stobS;
static long Sresumer_countS;
static long Sresumer_recordsS;
static long Sundumpable_recordsS;
static long Sundumpable_countS;
static long Hthe_record_type270;
char * s48_ShpS;
char * s48_SlimitS;

static struct image_location *table_ref(struct table *table_1X, long key_2X)
{
  long arg0K0;
  long next_6X;
  long i_5X;
  long *keys_4X;
  long size_3X;
 {  if ((0 < (table_1X->size))) {
    size_3X = table_1X->size;
    keys_4X = table_1X->keys;
    arg0K0 = ((key_2X ^ ((((key_2X)<<1)) ^ (((key_2X)>>10)))) & (-1 + size_3X));
    goto L3071;}
  else {
    return (NULL);}}
 L3071: {
  i_5X = arg0K0;
  next_6X = *(keys_4X + i_5X);
  if ((key_2X == next_6X)) {
    return (*((table_1X->values) + i_5X));}
  else {
    if ((0 == next_6X)) {
      if ((i_5X == (table_1X->size))) {
        arg0K0 = 0;
        goto L3071;}
      else {
        return (NULL);}}
    else {
      arg0K0 = (1 + i_5X);
      goto L3071;}}}
}
static long copy_weak_pointer(long weak_7X, char * frontier_8X, char * *TT0)
{
  char * arg1K0;
  long new_13X;
  char * frontier_12X;
  char * new_frontier_11X;
  char * old_10X;
  char * x_9X;
 {  x_9X = Sweak_pointer_hpS;
  if ((x_9X == NULL)) {
    goto L6463;}
  else {
    if (((Sweak_pointer_hpS) < (Sweak_pointer_limitS))) {
      arg1K0 = frontier_8X;
      goto L6468;}
    else {
      goto L6463;}}}
 L6463: {
  old_10X = Sweak_pointer_hpS;
  new_frontier_11X = frontier_8X + 1024;
  Sweak_pointer_hpS = frontier_8X;
  Sweak_pointer_limitS = new_frontier_11X;
  *((long *) (Sweak_pointer_hpS)) = (long) (261190);
  *((long *) ((Sweak_pointer_hpS) + 8)) = (long) ((((long) old_10X)));
  arg1K0 = new_frontier_11X;
  goto L6468;}
 L6468: {
  frontier_12X = arg1K0;
  new_13X = 3 + (((long) ((Sweak_pointer_hpS) + 4)));
  *((long *) ((Sweak_pointer_hpS) + 4)) = (long) ((*((long *) (((char *) (-3 + weak_7X))))));
  Sweak_pointer_hpS = ((Sweak_pointer_hpS) + 8);
  *((long *) ((((char *) (-3 + weak_7X))) + -4)) = (long) (new_13X);
  *TT0 = frontier_12X;
  return new_13X;}
}
static void table_setB(struct table *table_14X, long key_15X, struct image_location *value_16X)
{
  long arg0K0;
  long i_32X;
  struct image_location *value_31X;
  long key_30X;
  long i_29X;
  long i_28X;
  struct image_location **new_values_27X;
  long *new_keys_26X;
  long new_size_25X;
  struct image_location **old_values_24X;
  long v_23X;
  long old_size_22X;
  long *old_keys_21X;
  long next_20X;
  long i_19X;
  long *keys_18X;
  long size_17X;
 {  if ((0 < (table_14X->size))) {
    size_17X = table_14X->size;
    keys_18X = table_14X->keys;
    arg0K0 = ((key_15X ^ ((((key_15X)<<1)) ^ (((key_15X)>>10)))) & (-1 + size_17X));
    goto L7080;}
  else {
    return;}}
 L7080: {
  i_19X = arg0K0;
  next_20X = *(keys_18X + i_19X);
  if ((key_15X == next_20X)) {
    *((table_14X->values) + i_19X) = value_16X;
    return;}
  else {
    if ((0 == next_20X)) {
      if ((i_19X == (table_14X->size))) {
        arg0K0 = 0;
        goto L7080;}
      else {
        *((table_14X->keys) + i_19X) = key_15X;
        *((table_14X->values) + i_19X) = value_16X;
        table_14X->count = (1 + (table_14X->count));
        if (((table_14X->count) == ((table_14X->size) / 3))) {
          old_keys_21X = table_14X->keys;
          old_size_22X = table_14X->size;
          v_23X = table_14X->size;
          old_values_24X = table_14X->values;
          new_size_25X = ((v_23X)<<1);
          new_keys_26X = (long*)malloc(sizeof(long) * (1 + new_size_25X));
          new_values_27X = (struct image_location**)malloc(sizeof(struct image_location*) * new_size_25X);
          if ((NULL == new_keys_26X)) {
            goto L4396;}
          else {
            if ((NULL == new_values_27X)) {
              goto L4396;}
            else {
              table_14X->keys = new_keys_26X;
              table_14X->values = new_values_27X;
              table_14X->size = new_size_25X;
              table_14X->count = 0;
              arg0K0 = 0;
              goto L4549;}}}
        else {
          return;}}}
    else {
      arg0K0 = (1 + i_19X);
      goto L7080;}}}
 L4396: {
  if ((NULL == new_keys_26X)) {
    goto L4404;}
  else {
    free(new_keys_26X);
    goto L4404;}}
 L4549: {
  i_28X = arg0K0;
  if ((i_28X < (1 + new_size_25X))) {
    *(new_keys_26X + i_28X) = 0;
    arg0K0 = (1 + i_28X);
    goto L4549;}
  else {
    arg0K0 = 0;
    goto L4427;}}
 L4404: {
  if ((NULL == new_values_27X)) {
    goto L4412;}
  else {
    free(new_values_27X);
    goto L4412;}}
 L4427: {
  i_29X = arg0K0;
  if ((i_29X == old_size_22X)) {
    free(old_keys_21X);
    free(old_values_24X);
    return;}
  else {
    key_30X = *(old_keys_21X + i_29X);
    if ((0 == key_30X)) {
      goto L4443;}
    else {
      value_31X = *(old_values_24X + i_29X);
      arg0K0 = ((key_30X ^ ((((key_30X)<<1)) ^ (((key_30X)>>10)))) & (-1 + new_size_25X));
      goto L4571;}}}
 L4412: {
  table_14X->size = 0;
  return;}
 L4443: {
  arg0K0 = (1 + i_29X);
  goto L4427;}
 L4571: {
  i_32X = arg0K0;
  if ((0 == (*(new_keys_26X + i_32X)))) {
    if ((i_32X == new_size_25X)) {
      arg0K0 = 0;
      goto L4571;}
    else {
      *(new_keys_26X + i_32X) = key_30X;
      *(new_values_27X + i_32X) = value_31X;
      goto L4443;}}
  else {
    arg0K0 = (1 + i_32X);
    goto L4571;}}
}
static long real_copy_object(long thing_33X, char * frontier_34X, char * *TT0)
{
  long new_39X;
  char * data_addr_38X;
  char * a_37X;
  long descriptor_36X;
  long h_35X;
 {  h_35X = *((long *) ((((char *) (-3 + thing_33X))) + -4));
  if ((3 == (3 & h_35X))) {
    *TT0 = frontier_34X;
    return h_35X;}
  else {
    if ((1078 == h_35X)) {
      descriptor_36X = *((long *) (((char *) (-3 + thing_33X))));
      if ((3 == (3 & descriptor_36X))) {
        a_37X = ((char *) (-3 + descriptor_36X));
        if ((a_37X < (Sfrom_beginS))) {
          goto L10343;}
        else {
          if ((a_37X < (Sfrom_endS))) {
            return copy_weak_pointer(thing_33X, frontier_34X, TT0);}
          else {
            goto L10343;}}}
      else {
        goto L10343;}}
    else {
      goto L10343;}}}
 L10343: {
  *((long *) frontier_34X) = (long) (h_35X);
  data_addr_38X = frontier_34X + 4;
  new_39X = 3 + (((long) data_addr_38X));
  *((long *) ((((char *) (-3 + thing_33X))) + -4)) = (long) (new_39X);
  memmove((void *)data_addr_38X, (void *)(((char *) (-3 + thing_33X))),((long)(((unsigned long)h_35X)>>8)));
  *TT0 = (data_addr_38X + (-4 & (3 + ((long)(((unsigned long)h_35X)>>8)))));
  return new_39X;}
}
static char resumer_recordP(long stob_40X)
{
  long type_41X;
 {  if ((3 == (3 & stob_40X))) {
    if ((9 == (31 & ((((*((long *) ((((char *) (-3 + stob_40X))) + -4))))>>2))))) {
      type_41X = *((long *) (((char *) (-3 + stob_40X))));
      if ((3 == (3 & type_41X))) {
        if ((9 == (31 & ((((*((long *) ((((char *) (-3 + type_41X))) + -4))))>>2))))) {
          return (3 == (3 & (*((long *) ((((char *) (-3 + type_41X))) + 4)))));}
        else {
          return 0;}}
      else {
        return 0;}}
    else {
      return 0;}}
  else {
    return 0;}}
}
static long trace_image_value(long thing_42X)
{
  struct image_location *arg2K0;
  struct image_location *arg2K1;
  long arg0K0;
  long merged_arg0K0;

  int gc_recordP_return_tag;
  char gc_recordP0_return_value;
  long x_43X;
  long header_63X;
  char v_62X;
  long x_61X;
  struct image_location *new_60X;
  long new_descriptor_59X;
  struct image_location *new_58X;
  struct image_location *image_location_57X;
  long new_descriptor_56X;
  char * data_addr_55X;
  long h_54X;
  long stob_53X;
  struct image_location *image_location_52X;
  long new_alias_51X;
  long i_50X;
  long len_49X;
  long vector_48X;
  char v_47X;
  long type_46X;
  char v_45X;
  struct image_location *have_44X;
 {  if ((3 == (3 & thing_42X))) {
    have_44X = table_ref((Sstob_tableS), thing_42X);
    if ((NULL == have_44X)) {
      merged_arg0K0 = thing_42X;
      gc_recordP_return_tag = 0;
      goto gc_recordP;
     gc_recordP_return_0:
      v_45X = gc_recordP0_return_value;
      if (v_45X) {
        type_46X = *((long *) (((char *) (-3 + thing_42X))));
        merged_arg0K0 = type_46X;
        gc_recordP_return_tag = 1;
        goto gc_recordP;
       gc_recordP_return_1:
        v_47X = gc_recordP0_return_value;
        if (v_47X) {
          if ((1 == (*((long *) ((((char *) (-3 + type_46X))) + 4))))) {
            if (((Sundumpable_countS) < ((((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + (Sundumpable_recordsS)))) + -4))))>>8))))>>2)))) {
              vector_48X = Sundumpable_recordsS;
              len_49X = (((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + vector_48X))) + -4))))>>8))))>>2);
              arg0K0 = 0;
              goto L12327;}
            else {
              goto L14209;}}
          else {
            arg0K0 = thing_42X;
            goto L13092;}}
        else {
          arg0K0 = thing_42X;
          goto L13092;}}
      else {
        arg0K0 = thing_42X;
        goto L13092;}}
    else {
      return (have_44X->new_descriptor);}}
  else {
    return thing_42X;}}
 L12327: {
  i_50X = arg0K0;
  if ((i_50X == len_49X)) {
    *((long *) ((((char *) (-3 + (Sundumpable_recordsS)))) + ((((Sundumpable_countS))<<2)))) = (long) (thing_42X);
    Sundumpable_countS = (1 + (Sundumpable_countS));
    goto L14209;}
  else {
    if (((*((long *) ((((char *) (-3 + vector_48X))) + (((i_50X)<<2))))) == thing_42X)) {
      goto L14209;}
    else {
      arg0K0 = (1 + i_50X);
      goto L12327;}}}
 L14209: {
  new_alias_51X = trace_image_value((*((long *) ((((char *) (-3 + thing_42X))) + 4))));
  image_location_52X = (struct image_location*)malloc(sizeof(struct image_location));
  if ((NULL == image_location_52X)) {
    arg2K0 = image_location_52X;
    goto L14213;}
  else {
    image_location_52X->new_descriptor = new_alias_51X;
    image_location_52X->next = 0;
    arg2K0 = image_location_52X;
    goto L14213;}}
 L13092: {
  stob_53X = arg0K0;
  h_54X = *((long *) ((((char *) (-3 + stob_53X))) + -4));
  data_addr_55X = (Simage_hpS) + 4;
  Simage_hpS = (data_addr_55X + (-4 & (3 + ((long)(((unsigned long)h_54X)>>8)))));
  new_descriptor_56X = 3 + (((long) data_addr_55X));
  image_location_57X = (struct image_location*)malloc(sizeof(struct image_location));
  if ((NULL == image_location_57X)) {
    arg0K0 = new_descriptor_56X;
    arg2K1 = image_location_57X;
    goto L13096;}
  else {
    image_location_57X->new_descriptor = new_descriptor_56X;
    image_location_57X->next = 0;
    arg0K0 = new_descriptor_56X;
    arg2K1 = image_location_57X;
    goto L13096;}}
 L14213: {
  new_58X = arg2K0;
  if ((NULL == new_58X)) {
    (Sstob_tableS)->size = 0;
    return new_alias_51X;}
  else {table_setB((Sstob_tableS), thing_42X, new_58X);
    return new_alias_51X;}}
 L13096: {
  new_descriptor_59X = arg0K0;
  new_60X = arg2K1;
  if ((NULL == new_60X)) {
    (Sstob_tableS)->size = 0;
    return new_descriptor_59X;}
  else {
    x_61X = Sfirst_stobS;
    if ((1 == x_61X)) {
      Sfirst_stobS = stob_53X;
      goto L13117;}
    else {
      (Slast_stobS)->next = stob_53X;
      goto L13117;}}}
 L13117: {
  Slast_stobS = new_60X;
  new_60X->next = 1;table_setB((Sstob_tableS), stob_53X, new_60X);
  v_62X = resumer_recordP(stob_53X);
  if (v_62X) {
    Sresumer_countS = (1 + (Sresumer_countS));
    return new_descriptor_59X;}
  else {
    return new_descriptor_59X;}}
 gc_recordP: {
  x_43X = merged_arg0K0;{
  if ((3 == (3 & x_43X))) {
    header_63X = *((long *) ((((char *) (-3 + x_43X))) + -4));
    if ((3 == (3 & header_63X))) {
      if ((3 == (3 & header_63X))) {
        gc_recordP0_return_value = (9 == (31 & ((((*((long *) ((((char *) (-3 + header_63X))) + -4))))>>2))));
        goto gc_recordP_return;}
      else {
        gc_recordP0_return_value = 0;
        goto gc_recordP_return;}}
    else {
      if ((3 == (3 & x_43X))) {
        gc_recordP0_return_value = (9 == (31 & ((((*((long *) ((((char *) (-3 + x_43X))) + -4))))>>2))));
        goto gc_recordP_return;}
      else {
        gc_recordP0_return_value = 0;
        goto gc_recordP_return;}}}
  else {
    gc_recordP0_return_value = 0;
    goto gc_recordP_return;}}
 gc_recordP_return:
  switch (gc_recordP_return_tag) {
  case 0: goto gc_recordP_return_0;
  default: goto gc_recordP_return_1;
  }}

}
void s48_write_barrier(long stob_64X, char * address_65X, long value_66X)
{

 {  return;}
}
void s48_forbid_gcB(void)
{

 {  return;}
}
void s48_allow_gcB(void)
{

 {  return;}
}
long s48_heap_size(void)
{

 {  return ((Snewspace_endS) - (Snewspace_beginS));}
}
long s48_gc_count(void)
{

 {  return (Sgc_countS);}
}
long s48_gc_run_time(long *TT0)
{

 {  *TT0 = (Sgc_msecondsS);
  return (Sgc_secondsS);}
}
void s48_initialization_completeB(void)
{

 {  SinitializingPS = 0;
  return;}
}
long s48_max_heap_size(void)
{

 {  return ((((3 + ((Snewspace_endS) - (Snewspace_beginS))))>>2));}
}
long s48_startup_procedure(void)
{

 {  return (Sstartup_procedureS);}
}
long s48_initial_symbols(void)
{

 {  return (SsymbolsS);}
}
long s48_initial_imported_bindings(void)
{

 {  return (Simported_bindingsS);}
}
long s48_initial_exported_bindings(void)
{

 {  return (Sexported_bindingsS);}
}
long s48_resumer_records(void)
{

 {  return (Sresumer_recordsS);}
}
void s48_set_image_valuesB(long startup_proc_67X, long symbols_68X, long imports_69X, long exports_70X, long records_71X)
{

 {  Sstartup_procedureS = startup_proc_67X;
  SsymbolsS = symbols_68X;
  Simported_bindingsS = imports_69X;
  Sexported_bindingsS = exports_70X;
  Sresumer_recordsS = records_71X;
  return;}
}
char * s48_allocate_small(long len_72X)
{
  char * new_73X;
 {  new_73X = s48_ShpS;
  s48_ShpS = ((s48_ShpS) + (-4 & (3 + len_72X)));
  return new_73X;}
}
char s48_stob_in_heapP(long stob_74X)
{
  char temp_76X;
  char * addr_75X;
 {  addr_75X = (((char *) (-3 + stob_74X))) + -4;
  temp_76X = addr_75X < (Snewspace_beginS);
  if (temp_76X) {
    goto L3668;}
  else {
    if ((addr_75X < (s48_ShpS))) {
      if ((2 == (3 & (*((long *) addr_75X))))) {
        return 1;}
      else {
        ps_write_string("Heap-check: stob has no header.", (stderr));
        { long ignoreXX;
        PS_WRITE_CHAR(10, (stderr), ignoreXX) }
        Sheap_errors_leftS = (-1 + (Sheap_errors_leftS));
        return ((Sheap_errors_leftS) < 1);}}
    else {
      goto L3668;}}}
 L3668: {
  ps_write_string("Heap-check: address out of bounds.", (stderr));
  { long ignoreXX;
  PS_WRITE_CHAR(10, (stderr), ignoreXX) }
  Sheap_errors_leftS = (-1 + (Sheap_errors_leftS));
  return ((Sheap_errors_leftS) < 1);}
}
long s48_available(void)
{

 {  return (((((s48_SlimitS) - (s48_ShpS)))>>2));}
}
char s48_extantP(long thing_77X)
{
  char * a_78X;
 {  if ((3 == (3 & thing_77X))) {
    if ((3 == (3 & thing_77X))) {
      a_78X = ((char *) (-3 + thing_77X));
      if ((a_78X < (Sfrom_beginS))) {
        return 1;}
      else {
        if ((a_78X < (Sfrom_endS))) {
          return (3 == (3 & (*((long *) ((((char *) (-3 + thing_77X))) + -4)))));}
        else {
          return 1;}}}
    else {
      return 1;}}
  else {
    return 1;}}
}
long s48_gather_objects(char (*predicate_79X)(long), char (*for_each_object_80X)(char(*)(long)))
{
  char v_82X;
  char * start_hp_81X;
 {  Scollect_predicateS = predicate_79X;
  start_hp_81X = s48_ShpS;
  *((long *) (s48_ShpS)) = (long) (0);
  s48_ShpS = ((s48_ShpS) + 4);
  v_82X = (*for_each_object_80X)(pD1);
  if (v_82X) {
    *((long *) start_hp_81X) = (long) ((10 + (((((s48_ShpS) - (start_hp_81X + 4)))<<8))));
    return (3 + (((long) (start_hp_81X + 4))));}
  else {
    s48_ShpS = start_hp_81X;
    return 1;}}
}
static char pD1(long obj_83X)
{
  char x_84X;
 {  x_84X = (*(Scollect_predicateS))(obj_83X);
  if (x_84X) {
    if ((((s48_ShpS) + 16) < (s48_SlimitS))) {
      *((long *) (s48_ShpS)) = (long) (obj_83X);
      s48_ShpS = ((s48_ShpS) + 4);
      return 1;}
    else {
      return 0;}}
  else {
    return 1;}}
}
char s48_check_heap(long error_count_85X)
{
  char * arg1K0;
  long arg0K0;
  char * merged_arg1K1;
  char * merged_arg1K0;

  int check_area_return_tag;
  char check_area0_return_value;
  char * start_86X;
  char * end_87X;
  char v_104X;
  long x_103X;
  char * addr_102X;
  char * next_101X;
  long d_100X;
  char * addr_99X;
  char v_98X;
  long i_97X;
  long count_96X;
  long *sizes_95X;
  char * *areas_94X;
  char v_93X;
  long i_92X;
  long count_91X;
  long *sizes_90X;
  char * *areas_89X;
  char v_88X;
 {  Sheap_errors_leftS = error_count_85X;
  merged_arg1K0 = (Snewspace_beginS);
  merged_arg1K1 = (s48_ShpS);
  check_area_return_tag = 0;
  goto check_area;
 check_area_return_0:
  v_88X = check_area0_return_value;
  if (v_88X) {
    if ((0 < (Simpure_area_countS))) {
      areas_89X = Simpure_areasS;
      sizes_90X = Simpure_sizesS;
      count_91X = Simpure_area_countS;
      arg0K0 = 0;
      goto L11257;}
    else {
      goto L11241;}}
  else {
    return 0;}}
 L11257: {
  i_92X = arg0K0;
  if ((i_92X < count_91X)) {
    merged_arg1K0 = (*(areas_89X + i_92X));
    merged_arg1K1 = ((*(areas_89X + i_92X)) + (*(sizes_90X + i_92X)));
    check_area_return_tag = 1;
    goto check_area;
   check_area_return_1:
    v_93X = check_area0_return_value;
    if (v_93X) {
      arg0K0 = (1 + i_92X);
      goto L11257;}
    else {
      return 0;}}
  else {
    goto L11241;}}
 L11241: {
  if ((0 < (Spure_area_countS))) {
    areas_94X = Spure_areasS;
    sizes_95X = Spure_sizesS;
    count_96X = Spure_area_countS;
    arg0K0 = 0;
    goto L11278;}
  else {
    return 1;}}
 L11278: {
  i_97X = arg0K0;
  if ((i_97X < count_96X)) {
    merged_arg1K0 = (*(areas_94X + i_97X));
    merged_arg1K1 = ((*(areas_94X + i_97X)) + (*(sizes_95X + i_97X)));
    check_area_return_tag = 2;
    goto check_area;
   check_area_return_2:
    v_98X = check_area0_return_value;
    if (v_98X) {
      arg0K0 = (1 + i_97X);
      goto L11278;}
    else {
      return 0;}}
  else {
    return 1;}}
 check_area: {
  start_86X = merged_arg1K0;
  end_87X = merged_arg1K1;{
  arg1K0 = start_86X;
  goto L10176;}
 L10176: {
  addr_99X = arg1K0;
  if ((addr_99X < end_87X)) {
    d_100X = *((long *) addr_99X);
    next_101X = addr_99X + (4 + (-4 & (3 + ((long)(((unsigned long)d_100X)>>8)))));
    if ((2 == (3 & d_100X))) {
      if ((end_87X < next_101X)) {
        ps_write_string("Heap-check: header too large.", (stderr));
        { long ignoreXX;
        PS_WRITE_CHAR(10, (stderr), ignoreXX) }
        Sheap_errors_leftS = (-1 + (Sheap_errors_leftS));
        check_area0_return_value = ((Sheap_errors_leftS) < 1);
        goto check_area_return;}
      else {
        if ((2 == (3 & d_100X))) {
          if (((31 & (((d_100X)>>2))) < 16)) {
            goto L10202;}
          else {
            arg1K0 = next_101X;
            goto L10176;}}
        else {
          goto L10202;}}}
    else {
      ps_write_string("Heap-check: unexpected non-header.", (stderr));
      { long ignoreXX;
      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
      Sheap_errors_leftS = (-1 + (Sheap_errors_leftS));
      check_area0_return_value = ((Sheap_errors_leftS) < 1);
      goto check_area_return;}}
  else {
    check_area0_return_value = 1;
    goto check_area_return;}}
 L10202: {
  arg1K0 = (addr_99X + 4);
  goto L8936;}
 L8936: {
  addr_102X = arg1K0;
  if ((addr_102X == next_101X)) {
    arg1K0 = next_101X;
    goto L10176;}
  else {
    x_103X = *((long *) addr_102X);
    if ((2 == (3 & x_103X))) {
      ps_write_string("Heap-check: unexpected header.", (stderr));
      { long ignoreXX;
      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
      Sheap_errors_leftS = (-1 + (Sheap_errors_leftS));
      if (((Sheap_errors_leftS) < 1)) {
        arg1K0 = next_101X;
        goto L10176;}
      else {
        check_area0_return_value = 0;
        goto check_area_return;}}
    else {
      if ((3 == (3 & x_103X))) {
        v_104X = s48_stob_in_heapP(x_103X);
        if (v_104X) {
          goto L8961;}
        else {
          check_area0_return_value = 0;
          goto check_area_return;}}
      else {
        goto L8961;}}}}
 L8961: {
  arg1K0 = (addr_102X + 4);
  goto L8936;}
 check_area_return:
  switch (check_area_return_tag) {
  case 0: goto check_area_return_0;
  case 1: goto check_area_return_1;
  default: goto check_area_return_2;
  }}

}
long s48_find_all(long type_105X)
{
  char * arg1K0;
  long arg0K0;
  char * merged_arg1K1;
  char * merged_arg1K0;

  int Hproc24106_return_tag;
  char Hproc241060_return_value;
  char * start_107X;
  char * end_108X;
  char * next_125X;
  long d_124X;
  char * addr_123X;
  long type_122X;
  char v_121X;
  long i_120X;
  long count_119X;
  long *sizes_118X;
  char * *areas_117X;
  char v_116X;
  long i_115X;
  long count_114X;
  long *sizes_113X;
  char * *areas_112X;
  char v_111X;
  char * start_hp_110X;
  char * start_hp_109X;
 {  Sfinding_typeS = type_105X;
  start_hp_109X = s48_ShpS;
  start_hp_110X = s48_ShpS;
  *((long *) (s48_ShpS)) = (long) (0);
  s48_ShpS = ((s48_ShpS) + 4);
  merged_arg1K0 = (Snewspace_beginS);
  merged_arg1K1 = start_hp_109X;
  Hproc24106_return_tag = 0;
  goto Hproc24106;
 Hproc24106_return_0:
  v_111X = Hproc241060_return_value;
  if (v_111X) {
    if ((0 < (Simpure_area_countS))) {
      areas_112X = Simpure_areasS;
      sizes_113X = Simpure_sizesS;
      count_114X = Simpure_area_countS;
      arg0K0 = 0;
      goto L11392;}
    else {
      goto L11361;}}
  else {
    goto L11374;}}
 L11392: {
  i_115X = arg0K0;
  if ((i_115X < count_114X)) {
    merged_arg1K0 = (*(areas_112X + i_115X));
    merged_arg1K1 = ((*(areas_112X + i_115X)) + (*(sizes_113X + i_115X)));
    Hproc24106_return_tag = 1;
    goto Hproc24106;
   Hproc24106_return_1:
    v_116X = Hproc241060_return_value;
    if (v_116X) {
      arg0K0 = (1 + i_115X);
      goto L11392;}
    else {
      goto L11374;}}
  else {
    goto L11361;}}
 L11361: {
  if ((0 < (Spure_area_countS))) {
    areas_117X = Spure_areasS;
    sizes_118X = Spure_sizesS;
    count_119X = Spure_area_countS;
    arg0K0 = 0;
    goto L11413;}
  else {
    goto L11376;}}
 L11374: {
  s48_ShpS = start_hp_110X;
  return 1;}
 L11413: {
  i_120X = arg0K0;
  if ((i_120X < count_119X)) {
    merged_arg1K0 = (*(areas_117X + i_120X));
    merged_arg1K1 = ((*(areas_117X + i_120X)) + (*(sizes_118X + i_120X)));
    Hproc24106_return_tag = 2;
    goto Hproc24106;
   Hproc24106_return_2:
    v_121X = Hproc241060_return_value;
    if (v_121X) {
      arg0K0 = (1 + i_120X);
      goto L11413;}
    else {
      goto L11374;}}
  else {
    goto L11376;}}
 L11376: {
  *((long *) start_hp_110X) = (long) ((10 + (((((s48_ShpS) - (start_hp_110X + 4)))<<8))));
  return (3 + (((long) (start_hp_110X + 4))));}
 Hproc24106: {
  start_107X = merged_arg1K0;
  end_108X = merged_arg1K1;{
  type_122X = Sfinding_typeS;
  arg1K0 = start_107X;
  goto L10687;}
 L10687: {
  addr_123X = arg1K0;
  if ((addr_123X < end_108X)) {
    d_124X = *((long *) addr_123X);
    next_125X = addr_123X + (4 + (-4 & (3 + ((long)(((unsigned long)d_124X)>>8)))));
    if ((2 == (3 & d_124X))) {
      if ((type_122X == (31 & (((d_124X)>>2))))) {
        if ((((s48_ShpS) + 16) < (s48_SlimitS))) {
          *((long *) (s48_ShpS)) = (long) ((3 + (((long) (addr_123X + 4)))));
          s48_ShpS = ((s48_ShpS) + 4);
          arg1K0 = next_125X;
          goto L10687;}
        else {
          Hproc241060_return_value = 0;
          goto Hproc24106_return;}}
      else {
        arg1K0 = next_125X;
        goto L10687;}}
    else {
      ps_write_string("heap is in an inconsistent state.", (stderr));
      Hproc241060_return_value = 0;
      goto Hproc24106_return;}}
  else {
    Hproc241060_return_value = 1;
    goto Hproc24106_return;}}
 Hproc24106_return:
  switch (Hproc24106_return_tag) {
  case 0: goto Hproc24106_return_0;
  case 1: goto Hproc24106_return_1;
  default: goto Hproc24106_return_2;
  }}

}
long s48_trace_value(long stob_126X)
{
  char * new_hp_129X;
  long new_thing_128X;
  char * a_127X;
 {  if ((3 == (3 & stob_126X))) {
    a_127X = ((char *) (-3 + stob_126X));
    if ((a_127X < (Sfrom_beginS))) {
      return stob_126X;}
    else {
      if ((a_127X < (Sfrom_endS))) {
        new_thing_128X = real_copy_object(stob_126X, (s48_ShpS), &new_hp_129X);
        s48_ShpS = new_hp_129X;
        return new_thing_128X;}
      else {
        return stob_126X;}}}
  else {
    return stob_126X;}}
}
long s48_find_all_records(long record_type_130X)
{
  char * arg1K0;
  long arg0K0;
  char * merged_arg1K1;
  char * merged_arg1K0;

  int Hproc84131_return_tag;
  char Hproc841310_return_value;
  char * start_132X;
  char * end_133X;
  long obj_151X;
  char * next_150X;
  long d_149X;
  char * addr_148X;
  long type_147X;
  char v_146X;
  long i_145X;
  long count_144X;
  long *sizes_143X;
  char * *areas_142X;
  char v_141X;
  long i_140X;
  long count_139X;
  long *sizes_138X;
  char * *areas_137X;
  char v_136X;
  char * start_hp_135X;
  char * start_hp_134X;
 {  Hthe_record_type270 = record_type_130X;
  Sfinding_typeS = 9;
  start_hp_134X = s48_ShpS;
  start_hp_135X = s48_ShpS;
  *((long *) (s48_ShpS)) = (long) (0);
  s48_ShpS = ((s48_ShpS) + 4);
  merged_arg1K0 = (Snewspace_beginS);
  merged_arg1K1 = start_hp_134X;
  Hproc84131_return_tag = 0;
  goto Hproc84131;
 Hproc84131_return_0:
  v_136X = Hproc841310_return_value;
  if (v_136X) {
    if ((0 < (Simpure_area_countS))) {
      areas_137X = Simpure_areasS;
      sizes_138X = Simpure_sizesS;
      count_139X = Simpure_area_countS;
      arg0K0 = 0;
      goto L11522;}
    else {
      goto L11491;}}
  else {
    goto L11504;}}
 L11522: {
  i_140X = arg0K0;
  if ((i_140X < count_139X)) {
    merged_arg1K0 = (*(areas_137X + i_140X));
    merged_arg1K1 = ((*(areas_137X + i_140X)) + (*(sizes_138X + i_140X)));
    Hproc84131_return_tag = 1;
    goto Hproc84131;
   Hproc84131_return_1:
    v_141X = Hproc841310_return_value;
    if (v_141X) {
      arg0K0 = (1 + i_140X);
      goto L11522;}
    else {
      goto L11504;}}
  else {
    goto L11491;}}
 L11491: {
  if ((0 < (Spure_area_countS))) {
    areas_142X = Spure_areasS;
    sizes_143X = Spure_sizesS;
    count_144X = Spure_area_countS;
    arg0K0 = 0;
    goto L11543;}
  else {
    goto L11506;}}
 L11504: {
  s48_ShpS = start_hp_135X;
  return 1;}
 L11543: {
  i_145X = arg0K0;
  if ((i_145X < count_144X)) {
    merged_arg1K0 = (*(areas_142X + i_145X));
    merged_arg1K1 = ((*(areas_142X + i_145X)) + (*(sizes_143X + i_145X)));
    Hproc84131_return_tag = 2;
    goto Hproc84131;
   Hproc84131_return_2:
    v_146X = Hproc841310_return_value;
    if (v_146X) {
      arg0K0 = (1 + i_145X);
      goto L11543;}
    else {
      goto L11504;}}
  else {
    goto L11506;}}
 L11506: {
  *((long *) start_hp_135X) = (long) ((10 + (((((s48_ShpS) - (start_hp_135X + 4)))<<8))));
  return (3 + (((long) (start_hp_135X + 4))));}
 Hproc84131: {
  start_132X = merged_arg1K0;
  end_133X = merged_arg1K1;{
  type_147X = Sfinding_typeS;
  arg1K0 = start_132X;
  goto L10854;}
 L10854: {
  addr_148X = arg1K0;
  if ((addr_148X < end_133X)) {
    d_149X = *((long *) addr_148X);
    next_150X = addr_148X + (4 + (-4 & (3 + ((long)(((unsigned long)d_149X)>>8)))));
    if ((2 == (3 & d_149X))) {
      if ((type_147X == (31 & (((d_149X)>>2))))) {
        obj_151X = 3 + (((long) (addr_148X + 4)));
        if (((*((long *) (((char *) (-3 + obj_151X))))) == (Hthe_record_type270))) {
          if ((((s48_ShpS) + 16) < (s48_SlimitS))) {
            *((long *) (s48_ShpS)) = (long) (obj_151X);
            s48_ShpS = ((s48_ShpS) + 4);
            arg1K0 = next_150X;
            goto L10854;}
          else {
            Hproc841310_return_value = 0;
            goto Hproc84131_return;}}
        else {
          arg1K0 = next_150X;
          goto L10854;}}
      else {
        arg1K0 = next_150X;
        goto L10854;}}
    else {
      ps_write_string("heap is in an inconsistent state.", (stderr));
      Hproc841310_return_value = 0;
      goto Hproc84131_return;}}
  else {
    Hproc841310_return_value = 1;
    goto Hproc84131_return;}}
 Hproc84131_return:
  switch (Hproc84131_return_tag) {
  case 0: goto Hproc84131_return_0;
  case 1: goto Hproc84131_return_1;
  default: goto Hproc84131_return_2;
  }}

}
void s48_trace_continuation_contentsB(char * contents_pointer_152X, char * code_pointer_153X, long mask_size_154X)
{
  char * arg1K0;
  char * arg1K1;
  long arg0K0;
  long x2_164X;
  char * new_hp_163X;
  long new_thing_162X;
  char * a_161X;
  long stob_160X;
  char * ptr_159X;
  long mask_158X;
  char * trace_ptr_157X;
  char * mask_ptr_156X;
  char * mask_pointer_155X;
 {  mask_pointer_155X = code_pointer_153X + -7;
  arg1K0 = (mask_pointer_155X + (0 - mask_size_154X));
  arg1K1 = contents_pointer_152X;
  goto L13269;}
 L13269: {
  mask_ptr_156X = arg1K0;
  trace_ptr_157X = arg1K1;
  if ((mask_ptr_156X == mask_pointer_155X)) {
    return;}
  else {
    arg0K0 = (*((unsigned char *) mask_ptr_156X));
    arg1K1 = trace_ptr_157X;
    goto L13277;}}
 L13277: {
  mask_158X = arg0K0;
  ptr_159X = arg1K1;
  if ((0 == mask_158X)) {
    arg1K0 = (mask_ptr_156X + 1);
    arg1K1 = (trace_ptr_157X + 32);
    goto L13269;}
  else {
    if ((1 == (1 & mask_158X))) {
      stob_160X = *((long *) ptr_159X);
      if ((3 == (3 & stob_160X))) {
        a_161X = ((char *) (-3 + stob_160X));
        if ((a_161X < (Sfrom_beginS))) {
          arg0K0 = stob_160X;
          goto L13290;}
        else {
          if ((a_161X < (Sfrom_endS))) {
            new_thing_162X = real_copy_object(stob_160X, (s48_ShpS), &new_hp_163X);
            s48_ShpS = new_hp_163X;
            arg0K0 = new_thing_162X;
            goto L13290;}
          else {
            arg0K0 = stob_160X;
            goto L13290;}}}
      else {
        arg0K0 = stob_160X;
        goto L13290;}}
    else {
      goto L13295;}}}
 L13290: {
  x2_164X = arg0K0;
  *((long *) ptr_159X) = (long) (x2_164X);
  goto L13295;}
 L13295: {
  arg0K0 = (((mask_158X)>>1));
  arg1K1 = (ptr_159X + 4);
  goto L13277;}
}
void s48_initializing_gc_root(void)
{
  long arg0K0;
  long expr_189X;
  char * new_hp_188X;
  long new_thing_187X;
  char * a_186X;
  long stob_185X;
  long expr_184X;
  char * new_hp_183X;
  long new_thing_182X;
  char * a_181X;
  long stob_180X;
  long expr_179X;
  char * new_hp_178X;
  long new_thing_177X;
  char * a_176X;
  long stob_175X;
  long expr_174X;
  char * new_hp_173X;
  long new_thing_172X;
  char * a_171X;
  long stob_170X;
  long expr_169X;
  char * new_hp_168X;
  long new_thing_167X;
  char * a_166X;
  long stob_165X;
 {  if ((SinitializingPS)) {
    stob_165X = Sstartup_procedureS;
    if ((3 == (3 & stob_165X))) {
      a_166X = ((char *) (-3 + stob_165X));
      if ((a_166X < (Sfrom_beginS))) {
        arg0K0 = stob_165X;
        goto L13383;}
      else {
        if ((a_166X < (Sfrom_endS))) {
          new_thing_167X = real_copy_object(stob_165X, (s48_ShpS), &new_hp_168X);
          s48_ShpS = new_hp_168X;
          arg0K0 = new_thing_167X;
          goto L13383;}
        else {
          arg0K0 = stob_165X;
          goto L13383;}}}
    else {
      arg0K0 = stob_165X;
      goto L13383;}}
  else {
    return;}}
 L13383: {
  expr_169X = arg0K0;
  Sstartup_procedureS = expr_169X;
  stob_170X = SsymbolsS;
  if ((3 == (3 & stob_170X))) {
    a_171X = ((char *) (-3 + stob_170X));
    if ((a_171X < (Sfrom_beginS))) {
      arg0K0 = stob_170X;
      goto L13389;}
    else {
      if ((a_171X < (Sfrom_endS))) {
        new_thing_172X = real_copy_object(stob_170X, (s48_ShpS), &new_hp_173X);
        s48_ShpS = new_hp_173X;
        arg0K0 = new_thing_172X;
        goto L13389;}
      else {
        arg0K0 = stob_170X;
        goto L13389;}}}
  else {
    arg0K0 = stob_170X;
    goto L13389;}}
 L13389: {
  expr_174X = arg0K0;
  SsymbolsS = expr_174X;
  stob_175X = Simported_bindingsS;
  if ((3 == (3 & stob_175X))) {
    a_176X = ((char *) (-3 + stob_175X));
    if ((a_176X < (Sfrom_beginS))) {
      arg0K0 = stob_175X;
      goto L13395;}
    else {
      if ((a_176X < (Sfrom_endS))) {
        new_thing_177X = real_copy_object(stob_175X, (s48_ShpS), &new_hp_178X);
        s48_ShpS = new_hp_178X;
        arg0K0 = new_thing_177X;
        goto L13395;}
      else {
        arg0K0 = stob_175X;
        goto L13395;}}}
  else {
    arg0K0 = stob_175X;
    goto L13395;}}
 L13395: {
  expr_179X = arg0K0;
  Simported_bindingsS = expr_179X;
  stob_180X = Sexported_bindingsS;
  if ((3 == (3 & stob_180X))) {
    a_181X = ((char *) (-3 + stob_180X));
    if ((a_181X < (Sfrom_beginS))) {
      arg0K0 = stob_180X;
      goto L13401;}
    else {
      if ((a_181X < (Sfrom_endS))) {
        new_thing_182X = real_copy_object(stob_180X, (s48_ShpS), &new_hp_183X);
        s48_ShpS = new_hp_183X;
        arg0K0 = new_thing_182X;
        goto L13401;}
      else {
        arg0K0 = stob_180X;
        goto L13401;}}}
  else {
    arg0K0 = stob_180X;
    goto L13401;}}
 L13401: {
  expr_184X = arg0K0;
  Sexported_bindingsS = expr_184X;
  stob_185X = Sresumer_recordsS;
  if ((3 == (3 & stob_185X))) {
    a_186X = ((char *) (-3 + stob_185X));
    if ((a_186X < (Sfrom_beginS))) {
      arg0K0 = stob_185X;
      goto L13407;}
    else {
      if ((a_186X < (Sfrom_endS))) {
        new_thing_187X = real_copy_object(stob_185X, (s48_ShpS), &new_hp_188X);
        s48_ShpS = new_hp_188X;
        arg0K0 = new_thing_187X;
        goto L13407;}
      else {
        arg0K0 = stob_185X;
        goto L13407;}}}
  else {
    arg0K0 = stob_185X;
    goto L13407;}}
 L13407: {
  expr_189X = arg0K0;
  Sresumer_recordsS = expr_189X;
  return;}
}
long s48_write_image(long resume_proc_190X, long undumpables_191X, FILE * port_192X)
{
  struct table *arg3K0;
  long arg0K0;
  char * arg1K0;
  long merged_arg0K0;
  long merged_arg0K1;
  char * merged_arg1K0;

  int copy_image_data_return_tag;
  int write_descriptor_return_tag;
  int write_shared_table_return_tag;
  char write_shared_table0_return_value;
  char * start_193X;
  long size_194X;
  long descriptor_195X;
  long table_196X;
  long have_338X;
  long have_337X;
  long v_336X;
  long value_335X;
  struct image_location *have_334X;
  long thing_333X;
  long link_332X;
  struct image_location *v_331X;
  long next_330X;
  long shared_329X;
  long link_328X;
  char temp_327X;
  long i_326X;
  long value_325X;
  long v_324X;
  struct image_location *have_323X;
  long v_322X;
  long v_321X;
  struct image_location *have_320X;
  long thing_319X;
  struct image_location *have_318X;
  long thing_317X;
  long x_316X;
  char * addr_315X;
  long v_314X;
  long value_313X;
  struct image_location *have_312X;
  long thing_311X;
  char * addr_310X;
  char * start_309X;
  long header_308X;
  long next_307X;
  struct image_location *have_306X;
  long thing_305X;
  struct image_location *have_304X;
  char * addr_303X;
  long v_302X;
  long link_301X;
  struct image_location *v_300X;
  long next_299X;
  char * start_298X;
  long header_297X;
  long next_296X;
  long value_295X;
  long have_294X;
  long available_293X;
  long size_292X;
  char * start_291X;
  long header_290X;
  long shared_289X;
  long link_288X;
  struct image_location *v_287X;
  long next_286X;
  struct image_location *have_285X;
  long thing_284X;
  long i_283X;
  long link_282X;
  long symbol_281X;
  long v_280X;
  long link_279X;
  struct image_location *v_278X;
  long next_277X;
  struct image_location **values_276X;
  long *keys_275X;
  struct table *table_274X;
  long link_273X;
  struct image_location *have_272X;
  long thing_271X;
  long id_270X;
  char * addr_269X;
  long symbol_268X;
  long have_267X;
  char v_266X;
  struct image_location *location_265X;
  long stob_264X;
  char * start_263X;
  long header_262X;
  struct image_location *have_261X;
  long thing_260X;
  long link_259X;
  long v_258X;
  long v_257X;
  long i_256X;
  struct image_location *v_255X;
  long thing_254X;
  long table_253X;
  struct image_location *location_252X;
  long stob_251X;
  struct table *stob_table_250X;
  long first_stob_249X;
  long v_248X;
  long v_247X;
  long v_246X;
  long v_245X;
  long n_244X;
  struct image_location *have_243X;
  long thing_242X;
  long v_241X;
  long n_240X;
  struct image_location *have_239X;
  long thing_238X;
  long v_237X;
  long n_236X;
  struct image_location *have_235X;
  long thing_234X;
  long v_233X;
  long cells_232X;
  long v_231X;
  long cells_230X;
  long v_229X;
  long v_228X;
  long v_227X;
  long v_226X;
  long i_225X;
  long v_224X;
  struct image_location **values_223X;
  long *keys_222X;
  struct table *table_221X;
  long v_220X;
  long resumer_records_219X;
  char * data_addr_218X;
  long cells_217X;
  long v_216X;
  long v_215X;
  long v_214X;
  struct image_location *last_213X;
  char * addr_212X;
  long next_211X;
  struct image_location *image_location_210X;
  char * start_209X;
  long link_208X;
  long entry_207X;
  long header_206X;
  long stob_205X;
  long link_204X;
  long i_203X;
  long table_202X;
  long resume_proc_201X;
  struct table *v_200X;
  struct table *table_199X;
  long i_198X;
  long *keys_197X;
 {  keys_197X = (long*)malloc(sizeof(long) * 4097);
  arg0K0 = 0;
  goto L6996;}
 L6996: {
  i_198X = arg0K0;
  if ((i_198X < 4097)) {
    *(keys_197X + i_198X) = 0;
    arg0K0 = (1 + i_198X);
    goto L6996;}
  else {
    table_199X = (struct table*)malloc(sizeof(struct table));
    if ((NULL == table_199X)) {
      arg3K0 = table_199X;
      goto L6969;}
    else {
      table_199X->keys = keys_197X;
      table_199X->values = ((struct image_location**)malloc(sizeof(struct image_location*) * 4096));
      table_199X->count = 0;
      table_199X->size = 4096;
      arg3K0 = table_199X;
      goto L6969;}}}
 L6969: {
  v_200X = arg3K0;
  Sstob_tableS = v_200X;
  Sfirst_stobS = 1;
  Slast_stobS = (NULL);
  Sundumpable_recordsS = undumpables_191X;
  Sundumpable_countS = 0;
  Sresumer_countS = 0;
  image_start_address = (((long) (Snew_heap_start_addrS)));
  Simage_beginS = (((char *) (image_start_address)));
  Simage_hpS = (((char *) (image_start_address)));
  Simage_portS = port_192X;
  Simage_bufferS = ((char *)malloc(4096));
  Simage_buffer_pointerS = (Simage_bufferS);
  SstatusS = NO_ERRORS;
  if (((Simage_bufferS) == NULL)) {
    return ENOMEM;}
  else {
    resume_proc_201X = trace_image_value(resume_proc_190X);
    table_202X = s48_exported_bindings();
    arg0K0 = 0;
    goto L11680;}}
 L11680: {
  i_203X = arg0K0;
  if ((1024 == i_203X)) {
    arg0K0 = (Sfirst_stobS);
    goto L13997;}
  else {
    link_204X = *((long *) ((((char *) (-3 + table_202X))) + (((i_203X)<<2))));
    if ((0 == (3 & link_204X))) {
      arg0K0 = (3 + (-4 & link_204X));
      goto L11654;}
    else {
      arg0K0 = link_204X;
      goto L11654;}}}
 L13997: {
  stob_205X = arg0K0;
  header_206X = *((long *) ((((char *) (-3 + stob_205X))) + -4));
  if ((2 == (3 & header_206X))) {
    if (((31 & (((header_206X)>>2))) < 16)) {
      goto L13861;}
    else {
      goto L13999;}}
  else {
    goto L13861;}}
 L11654: {
  entry_207X = arg0K0;
  if ((1 == entry_207X)) {
    arg0K0 = (1 + i_203X);
    goto L11680;}
  else {trace_image_value(entry_207X);
    link_208X = *((long *) ((((char *) (-3 + entry_207X))) + 12));
    if ((0 == (3 & link_208X))) {
      arg0K0 = (3 + (-4 & link_208X));
      goto L11654;}
    else {
      arg0K0 = link_208X;
      goto L11654;}}}
 L13861: {
  if ((1078 == header_206X)) {
    goto L13999;}
  else {
    start_209X = ((char *) (-3 + stob_205X));
    arg1K0 = start_209X;
    goto L13880;}}
 L13999: {
  if ((0 < ((Sstob_tableS)->size))) {
    image_location_210X = table_ref((Sstob_tableS), stob_205X);
    next_211X = image_location_210X->next;
    if ((3 == (3 & next_211X))) {
      arg0K0 = next_211X;
      goto L13997;}
    else {
      goto L14078;}}
  else {
    goto L14078;}}
 L13880: {
  addr_212X = arg1K0;
  if ((addr_212X == (start_209X + (-4 & (3 + ((long)(((unsigned long)header_206X)>>8))))))) {
    goto L13999;}
  else {trace_image_value((*((long *) addr_212X)));
    arg1K0 = (addr_212X + 4);
    goto L13880;}}
 L14078: {
  last_213X = Slast_stobS;
  v_214X = s48_symbol_table();trace_image_value(v_214X);
  v_215X = s48_imported_bindings();trace_image_value(v_215X);
  v_216X = s48_exported_bindings();trace_image_value(v_216X);
  last_213X->next = 1;
  cells_217X = Sresumer_countS;
  data_addr_218X = (Simage_hpS) + 4;
  Simage_hpS = (data_addr_218X + (((cells_217X)<<2)));
  Sresumer_recordsS = (3 + (((long) data_addr_218X)));
  if ((0 < ((Sstob_tableS)->size))) {
    resumer_records_219X = Sresumer_recordsS;
    if (((SstatusS) == NO_ERRORS)) {
      PS_WRITE_CHAR(10, port_192X, v_220X)
      SstatusS = v_220X;
      goto L5867;}
    else {
      goto L5867;}}
  else {
    table_221X = Sstob_tableS;
    keys_222X = table_221X->keys;
    values_223X = table_221X->values;
    arg0K0 = 0;
    goto L14394;}}
 L5867: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(12, (Simage_portS), v_224X)
    SstatusS = v_224X;
    goto L5869;}
  else {
    goto L5869;}}
 L14394: {
  i_225X = arg0K0;
  if ((i_225X == (table_221X->size))) {
    free(keys_222X);
    free(values_223X);
    free(table_221X);
    free((Simage_bufferS));
    return ENOMEM;}
  else {
    if ((0 == (*(keys_222X + i_225X)))) {
      goto L14396;}
    else {
      free((*(values_223X + i_225X)));
      goto L14396;}}}
 L5869: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, port_192X, v_226X)
    SstatusS = v_226X;
    goto L5878;}
  else {
    goto L5878;}}
 L14396: {
  arg0K0 = (1 + i_225X);
  goto L14394;}
 L5878: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_string("Vanilla 33", port_192X));
    goto L5885;}
  else {
    goto L5885;}}
 L5885: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, port_192X, v_227X)
    SstatusS = v_227X;
    goto L5894;}
  else {
    goto L5894;}}
 L5894: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(0, port_192X));
    goto L5901;}
  else {
    goto L5901;}}
 L5901: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, port_192X, v_228X)
    SstatusS = v_228X;
    goto L5910;}
  else {
    goto L5910;}}
 L5910: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(4, (Simage_portS)));
    goto L5955;}
  else {
    goto L5955;}}
 L5955: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_229X)
    SstatusS = v_229X;
    goto L5912;}
  else {
    goto L5912;}}
 L5912: {
  cells_230X = image_start_address;
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer((((cells_230X)>>2)), (Simage_portS)));
    goto L5972;}
  else {
    goto L5972;}}
 L5972: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_231X)
    SstatusS = v_231X;
    goto L5916;}
  else {
    goto L5916;}}
 L5916: {
  cells_232X = (image_start_address) + ((Simage_hpS) - (Simage_beginS));
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer((((cells_232X)>>2)), (Simage_portS)));
    goto L5991;}
  else {
    goto L5991;}}
 L5991: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_233X)
    SstatusS = v_233X;
    goto L5922;}
  else {
    goto L5922;}}
 L5922: {
  thing_234X = s48_symbol_table();
  if ((3 == (3 & thing_234X))) {
    have_235X = table_ref((Sstob_tableS), thing_234X);
    if ((NULL == have_235X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L17200;}
    else {
      goto L17200;}}
  else {
    arg0K0 = thing_234X;
    goto L5926;}}
 L17200: {
  arg0K0 = (have_235X->new_descriptor);
  goto L5926;}
 L5926: {
  n_236X = arg0K0;
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(n_236X, (Simage_portS)));
    goto L6005;}
  else {
    goto L6005;}}
 L6005: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_237X)
    SstatusS = v_237X;
    goto L5928;}
  else {
    goto L5928;}}
 L5928: {
  thing_238X = s48_imported_bindings();
  if ((3 == (3 & thing_238X))) {
    have_239X = table_ref((Sstob_tableS), thing_238X);
    if ((NULL == have_239X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L17214;}
    else {
      goto L17214;}}
  else {
    arg0K0 = thing_238X;
    goto L5932;}}
 L17214: {
  arg0K0 = (have_239X->new_descriptor);
  goto L5932;}
 L5932: {
  n_240X = arg0K0;
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(n_240X, (Simage_portS)));
    goto L6019;}
  else {
    goto L6019;}}
 L6019: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_241X)
    SstatusS = v_241X;
    goto L5934;}
  else {
    goto L5934;}}
 L5934: {
  thing_242X = s48_exported_bindings();
  if ((3 == (3 & thing_242X))) {
    have_243X = table_ref((Sstob_tableS), thing_242X);
    if ((NULL == have_243X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L17228;}
    else {
      goto L17228;}}
  else {
    arg0K0 = thing_242X;
    goto L5938;}}
 L17228: {
  arg0K0 = (have_243X->new_descriptor);
  goto L5938;}
 L5938: {
  n_244X = arg0K0;
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(n_244X, (Simage_portS)));
    goto L6033;}
  else {
    goto L6033;}}
 L6033: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_245X)
    SstatusS = v_245X;
    goto L5940;}
  else {
    goto L5940;}}
 L5940: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(resumer_records_219X, (Simage_portS)));
    goto L6047;}
  else {
    goto L6047;}}
 L6047: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_246X)
    SstatusS = v_246X;
    goto L5942;}
  else {
    goto L5942;}}
 L5942: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(resume_proc_201X, (Simage_portS)));
    goto L6061;}
  else {
    goto L6061;}}
 L6061: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_247X)
    SstatusS = v_247X;
    goto L5944;}
  else {
    goto L5944;}}
 L5944: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(12, (Simage_portS), v_248X)
    SstatusS = v_248X;
    goto L14295;}
  else {
    goto L14295;}}
 L14295: {
  merged_arg0K0 = 1;
  write_descriptor_return_tag = 0;
  goto write_descriptor;
 write_descriptor_return_0:
  first_stob_249X = Sfirst_stobS;
  stob_table_250X = Sstob_tableS;
  arg0K0 = first_stob_249X;
  goto L13801;}
 L13801: {
  stob_251X = arg0K0;
  if ((3 == (3 & stob_251X))) {
    location_252X = table_ref(stob_table_250X, stob_251X);
    if ((NULL == location_252X)) {
      ps_error("traced stob has no image-table entry", 0);
      goto L13806;}
    else {
      goto L13806;}}
  else {
    table_253X = s48_symbol_table();
    merged_arg0K0 = (*((long *) ((((char *) (-3 + table_253X))) + -4)));
    write_descriptor_return_tag = 1;
    goto write_descriptor;
   write_descriptor_return_1:
    arg0K0 = 0;
    goto L11853;}}
 L13806: {
  if ((3 == (3 & stob_251X))) {
    if ((13 == (31 & ((((*((long *) ((((char *) (-3 + stob_251X))) + -4))))>>2))))) {
      merged_arg0K0 = 1078;
      write_descriptor_return_tag = 2;
      goto write_descriptor;
     write_descriptor_return_2:
      thing_254X = *((long *) (((char *) (-3 + stob_251X))));
      if ((3 == (3 & thing_254X))) {
        v_255X = table_ref((Sstob_tableS), thing_254X);
        if ((NULL == v_255X)) {
          merged_arg0K0 = 1;
          write_descriptor_return_tag = 3;
          goto write_descriptor;
         write_descriptor_return_3:
          goto L13808;}
        else {
          goto L13527;}}
      else {
        goto L13527;}}
    else {
      goto L13533;}}
  else {
    goto L13533;}}
 L11853: {
  i_256X = arg0K0;
  if ((i_256X == ((((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + table_253X))) + -4))))>>8))))>>2)))) {
    v_257X = s48_imported_bindings();
    merged_arg0K0 = v_257X;
    write_shared_table_return_tag = 0;
    goto write_shared_table;
   write_shared_table_return_0:
    v_258X = s48_exported_bindings();
    merged_arg0K0 = v_258X;
    write_shared_table_return_tag = 1;
    goto write_shared_table;
   write_shared_table_return_1:
    merged_arg0K0 = (10 + ((((Sresumer_countS))<<10)));
    write_descriptor_return_tag = 4;
    goto write_descriptor;
   write_descriptor_return_4:
    arg0K0 = (Sfirst_stobS);
    goto L13824;}
  else {
    link_259X = *((long *) ((((char *) (-3 + table_253X))) + (((i_256X)<<2))));
    if ((0 == (3 & link_259X))) {
      arg0K0 = (3 + (-4 & link_259X));
      goto L11863;}
    else {
      arg0K0 = link_259X;
      goto L11863;}}}
 L13808: {
  arg0K0 = (location_252X->next);
  goto L13801;}
 L13527: {
  thing_260X = *((long *) (((char *) (-3 + stob_251X))));
  if ((3 == (3 & thing_260X))) {
    have_261X = table_ref((Sstob_tableS), thing_260X);
    if ((NULL == have_261X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L13591;}
    else {
      goto L13591;}}
  else {
    merged_arg0K0 = thing_260X;
    write_descriptor_return_tag = 5;
    goto write_descriptor;
   write_descriptor_return_5:
    goto L13808;}}
 L13533: {
  if ((3 == (3 & stob_251X))) {
    if ((6 == (31 & ((((*((long *) ((((char *) (-3 + stob_251X))) + -4))))>>2))))) {
      header_262X = *((long *) ((((char *) (-3 + stob_251X))) + -4));
      merged_arg0K0 = header_262X;
      write_descriptor_return_tag = 6;
      goto write_descriptor;
     write_descriptor_return_6:
      merged_arg0K0 = 0;
      write_descriptor_return_tag = 7;
      goto write_descriptor;
     write_descriptor_return_7:
      start_263X = (((char *) (-3 + stob_251X))) + 4;
      arg1K0 = start_263X;
      goto L10116;}
    else {
      goto L13537;}}
  else {
    goto L13537;}}
 L13824: {
  stob_264X = arg0K0;
  if ((3 == (3 & stob_264X))) {
    location_265X = table_ref((Sstob_tableS), stob_264X);
    v_266X = resumer_recordP(stob_264X);
    if (v_266X) {
      merged_arg0K0 = (location_265X->new_descriptor);
      write_descriptor_return_tag = 8;
      goto write_descriptor;
     write_descriptor_return_8:
      goto L13831;}
    else {
      goto L13831;}}
  else {
    have_267X = (Simage_buffer_pointerS) - (Simage_bufferS);
    if ((0 < have_267X)) {
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_267X));
        goto L14340;}
      else {
        goto L14340;}}
    else {
      goto L14301;}}}
 L11863: {
  symbol_268X = arg0K0;
  arg0K0 = symbol_268X;
  goto L11897;}
 L13591: {
  merged_arg0K0 = (have_261X->new_descriptor);
  write_descriptor_return_tag = 9;
  goto write_descriptor;
 write_descriptor_return_9:
  goto L13808;}
 L10116: {
  addr_269X = arg1K0;
  if ((addr_269X == (start_263X + (-4 + (-4 & (3 + ((long)(((unsigned long)header_262X)>>8)))))))) {
    ps_write_string("Channel closed in dumped image: ", (stderr));
    id_270X = *((long *) ((((char *) (-3 + stob_251X))) + 4));
    if ((0 == (3 & id_270X))) {
      ps_write_integer((((id_270X)>>2)), (stderr));
      goto L10093;}
    else {
      ps_write_string((((char *)(((char *) (-3 + id_270X))))), (stderr));
      goto L10093;}}
  else {
    thing_271X = *((long *) addr_269X);
    if ((3 == (3 & thing_271X))) {
      have_272X = table_ref((Sstob_tableS), thing_271X);
      if ((NULL == have_272X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L10130;}
      else {
        goto L10130;}}
    else {
      arg0K0 = thing_271X;
      goto L10121;}}}
 L13537: {
  if ((3 == (3 & stob_251X))) {
    if ((1 == (31 & ((((*((long *) ((((char *) (-3 + stob_251X))) + -4))))>>2))))) {
      link_273X = *((long *) ((((char *) (-3 + stob_251X))) + 4));
      if ((0 == (3 & link_273X))) {
        arg0K0 = (3 + (-4 & link_273X));
        goto L12543;}
      else {
        arg0K0 = link_273X;
        goto L12543;}}
    else {
      goto L13541;}}
  else {
    goto L13541;}}
 L13831: {
  arg0K0 = (location_265X->next);
  goto L13824;}
 L14340: {
  Simage_buffer_pointerS = (Simage_bufferS);
  goto L14301;}
 L14301: {
  table_274X = Sstob_tableS;
  keys_275X = table_274X->keys;
  values_276X = table_274X->values;
  arg0K0 = 0;
  goto L14360;}
 L11897: {
  next_277X = arg0K0;
  if ((3 == (3 & next_277X))) {
    v_278X = table_ref((Sstob_tableS), next_277X);
    if ((NULL == v_278X)) {
      link_279X = *((long *) ((((char *) (-3 + next_277X))) + 4));
      if ((0 == (3 & link_279X))) {
        arg0K0 = (3 + (-4 & link_279X));
        goto L11897;}
      else {
        arg0K0 = link_279X;
        goto L11897;}}
    else {
      arg0K0 = next_277X;
      goto L11865;}}
  else {
    arg0K0 = next_277X;
    goto L11865;}}
 L10093: {
  { long ignoreXX;
  PS_WRITE_CHAR(10, (stderr), ignoreXX) }
  goto L13808;}
 L10130: {
  arg0K0 = (have_272X->new_descriptor);
  goto L10121;}
 L10121: {
  v_280X = arg0K0;
  merged_arg0K0 = v_280X;
  write_descriptor_return_tag = 10;
  goto write_descriptor;
 write_descriptor_return_10:
  arg1K0 = (addr_269X + 4);
  goto L10116;}
 L12543: {
  symbol_281X = arg0K0;
  arg0K0 = symbol_281X;
  goto L12576;}
 L13541: {
  if ((3 == (3 & stob_251X))) {
    if ((14 == (31 & ((((*((long *) ((((char *) (-3 + stob_251X))) + -4))))>>2))))) {
      link_282X = *((long *) ((((char *) (-3 + stob_251X))) + 12));
      if ((0 == (3 & link_282X))) {
        arg0K0 = (3 + (-4 & link_282X));
        goto L12386;}
      else {
        arg0K0 = link_282X;
        goto L12386;}}
    else {
      goto L13545;}}
  else {
    goto L13545;}}
 L14360: {
  i_283X = arg0K0;
  if ((i_283X == (table_274X->size))) {
    free(keys_275X);
    free(values_276X);
    free(table_274X);
    free((Simage_bufferS));
    return (SstatusS);}
  else {
    if ((0 == (*(keys_275X + i_283X)))) {
      goto L14362;}
    else {
      free((*(values_276X + i_283X)));
      goto L14362;}}}
 L11865: {
  thing_284X = arg0K0;
  if ((3 == (3 & thing_284X))) {
    have_285X = table_ref((Sstob_tableS), thing_284X);
    if ((NULL == have_285X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L11916;}
    else {
      goto L11916;}}
  else {
    arg0K0 = thing_284X;
    goto L11867;}}
 L12576: {
  next_286X = arg0K0;
  if ((3 == (3 & next_286X))) {
    v_287X = table_ref((Sstob_tableS), next_286X);
    if ((NULL == v_287X)) {
      link_288X = *((long *) ((((char *) (-3 + next_286X))) + 4));
      if ((0 == (3 & link_288X))) {
        arg0K0 = (3 + (-4 & link_288X));
        goto L12576;}
      else {
        arg0K0 = link_288X;
        goto L12576;}}
    else {
      arg0K0 = next_286X;
      goto L12545;}}
  else {
    arg0K0 = next_286X;
    goto L12545;}}
 L12386: {
  shared_289X = arg0K0;
  arg0K0 = shared_289X;
  goto L12435;}
 L13545: {
  header_290X = *((long *) ((((char *) (-3 + stob_251X))) + -4));
  start_291X = ((char *) (-3 + stob_251X));
  merged_arg0K0 = header_290X;
  write_descriptor_return_tag = 11;
  goto write_descriptor;
 write_descriptor_return_11:
  if ((2 == (3 & header_290X))) {
    if (((31 & (((header_290X)>>2))) < 16)) {
      goto L13561;}
    else {
      size_292X = -4 & (3 + ((long)(((unsigned long)header_290X)>>8)));
      available_293X = 4096 - ((Simage_buffer_pointerS) - (Simage_bufferS));
      if ((available_293X < size_292X)) {
        if ((4096 < size_292X)) {
          have_294X = (Simage_buffer_pointerS) - (Simage_bufferS);
          if ((0 < have_294X)) {
            if (((SstatusS) == NO_ERRORS)) {
              SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_294X));
              goto L9142;}
            else {
              goto L9142;}}
          else {
            goto L9116;}}
        else {
          merged_arg1K0 = start_291X;
          merged_arg0K1 = available_293X;
          copy_image_data_return_tag = 0;
          goto copy_image_data;
         copy_image_data_return_0:
          merged_arg1K0 = (start_291X + available_293X);
          merged_arg0K1 = (size_292X - available_293X);
          copy_image_data_return_tag = 1;
          goto copy_image_data;
         copy_image_data_return_1:
          goto L13808;}}
      else {
        merged_arg1K0 = start_291X;
        merged_arg0K1 = size_292X;
        copy_image_data_return_tag = 2;
        goto copy_image_data;
       copy_image_data_return_2:
        goto L13808;}}}
  else {
    goto L13561;}}
 L14362: {
  arg0K0 = (1 + i_283X);
  goto L14360;}
 L11916: {
  arg0K0 = (have_285X->new_descriptor);
  goto L11867;}
 L11867: {
  value_295X = arg0K0;
  if ((3 == (3 & value_295X))) {
    arg0K0 = (-4 & value_295X);
    goto L11869;}
  else {
    arg0K0 = value_295X;
    goto L11869;}}
 L12545: {
  next_296X = arg0K0;
  header_297X = *((long *) ((((char *) (-3 + stob_251X))) + -4));
  merged_arg0K0 = header_297X;
  write_descriptor_return_tag = 12;
  goto write_descriptor;
 write_descriptor_return_12:
  start_298X = ((char *) (-3 + stob_251X));
  arg1K0 = start_298X;
  goto L12605;}
 L12435: {
  next_299X = arg0K0;
  if ((3 == (3 & next_299X))) {
    v_300X = table_ref((Sstob_tableS), next_299X);
    if ((NULL == v_300X)) {
      link_301X = *((long *) ((((char *) (-3 + next_299X))) + 12));
      if ((0 == (3 & link_301X))) {
        arg0K0 = (3 + (-4 & link_301X));
        goto L12435;}
      else {
        arg0K0 = link_301X;
        goto L12435;}}
    else {
      arg0K0 = next_299X;
      goto L12388;}}
  else {
    arg0K0 = next_299X;
    goto L12388;}}
 L13561: {
  arg1K0 = start_291X;
  goto L13663;}
 L9142: {
  Simage_buffer_pointerS = (Simage_bufferS);
  goto L9116;}
 L9116: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_block((Simage_portS), ((char *) start_291X), size_292X));
    goto L13808;}
  else {
    goto L13808;}}
 L11869: {
  v_302X = arg0K0;
  merged_arg0K0 = v_302X;
  write_descriptor_return_tag = 13;
  goto write_descriptor;
 write_descriptor_return_13:
  arg0K0 = (1 + i_256X);
  goto L11853;}
 L12605: {
  addr_303X = arg1K0;
  if ((addr_303X == (start_298X + (-4 + (-4 & (3 + ((long)(((unsigned long)header_297X)>>8)))))))) {
    if ((3 == (3 & next_296X))) {
      have_304X = table_ref((Sstob_tableS), next_296X);
      if ((NULL == have_304X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L12635;}
      else {
        goto L12635;}}
    else {
      arg0K0 = next_296X;
      goto L12558;}}
  else {
    thing_305X = *((long *) addr_303X);
    if ((3 == (3 & thing_305X))) {
      have_306X = table_ref((Sstob_tableS), thing_305X);
      if ((NULL == have_306X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L12619;}
      else {
        goto L12619;}}
    else {
      arg0K0 = thing_305X;
      goto L12610;}}}
 L12388: {
  next_307X = arg0K0;
  header_308X = *((long *) ((((char *) (-3 + stob_251X))) + -4));
  merged_arg0K0 = header_308X;
  write_descriptor_return_tag = 14;
  goto write_descriptor;
 write_descriptor_return_14:
  start_309X = ((char *) (-3 + stob_251X));
  arg1K0 = start_309X;
  goto L12464;}
 L13663: {
  addr_310X = arg1K0;
  if ((addr_310X == (start_291X + (-4 & (3 + ((long)(((unsigned long)header_290X)>>8))))))) {
    goto L13808;}
  else {
    thing_311X = *((long *) addr_310X);
    if ((3 == (3 & thing_311X))) {
      have_312X = table_ref((Sstob_tableS), thing_311X);
      if ((NULL == have_312X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L13677;}
      else {
        goto L13677;}}
    else {
      arg0K0 = thing_311X;
      goto L13668;}}}
 L12635: {
  arg0K0 = (have_304X->new_descriptor);
  goto L12558;}
 L12558: {
  value_313X = arg0K0;
  if ((3 == (3 & value_313X))) {
    merged_arg0K0 = (-4 & value_313X);
    write_descriptor_return_tag = 15;
    goto write_descriptor;
   write_descriptor_return_15:
    goto L13808;}
  else {
    merged_arg0K0 = value_313X;
    write_descriptor_return_tag = 16;
    goto write_descriptor;
   write_descriptor_return_16:
    goto L13808;}}
 L12619: {
  arg0K0 = (have_306X->new_descriptor);
  goto L12610;}
 L12610: {
  v_314X = arg0K0;
  merged_arg0K0 = v_314X;
  write_descriptor_return_tag = 17;
  goto write_descriptor;
 write_descriptor_return_17:
  arg1K0 = (addr_303X + 4);
  goto L12605;}
 L12464: {
  addr_315X = arg1K0;
  if ((addr_315X == (start_309X + (-8 + (-4 & (3 + ((long)(((unsigned long)header_308X)>>8)))))))) {
    x_316X = *((long *) ((((char *) (-3 + stob_251X))) + 4));
    if ((5 == x_316X)) {
      arg0K0 = 529;
      goto L12413;}
    else {
      thing_317X = *((long *) ((((char *) (-3 + stob_251X))) + 8));
      if ((3 == (3 & thing_317X))) {
        have_318X = table_ref((Sstob_tableS), thing_317X);
        if ((NULL == have_318X)) {
          ps_error("traced object has no descriptor in image", 0);
          goto L12525;}
        else {
          goto L12525;}}
      else {
        arg0K0 = thing_317X;
        goto L12413;}}}
  else {
    thing_319X = *((long *) addr_315X);
    if ((3 == (3 & thing_319X))) {
      have_320X = table_ref((Sstob_tableS), thing_319X);
      if ((NULL == have_320X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L12478;}
      else {
        goto L12478;}}
    else {
      arg0K0 = thing_319X;
      goto L12469;}}}
 L13677: {
  arg0K0 = (have_312X->new_descriptor);
  goto L13668;}
 L13668: {
  v_321X = arg0K0;
  merged_arg0K0 = v_321X;
  write_descriptor_return_tag = 18;
  goto write_descriptor;
 write_descriptor_return_18:
  arg1K0 = (addr_310X + 4);
  goto L13663;}
 L12413: {
  v_322X = arg0K0;
  merged_arg0K0 = v_322X;
  write_descriptor_return_tag = 19;
  goto write_descriptor;
 write_descriptor_return_19:
  if ((3 == (3 & next_307X))) {
    have_323X = table_ref((Sstob_tableS), next_307X);
    if ((NULL == have_323X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L12501;}
    else {
      goto L12501;}}
  else {
    arg0K0 = next_307X;
    goto L12417;}}
 L12525: {
  arg0K0 = (have_318X->new_descriptor);
  goto L12413;}
 L12478: {
  arg0K0 = (have_320X->new_descriptor);
  goto L12469;}
 L12469: {
  v_324X = arg0K0;
  merged_arg0K0 = v_324X;
  write_descriptor_return_tag = 20;
  goto write_descriptor;
 write_descriptor_return_20:
  arg1K0 = (addr_315X + 4);
  goto L12464;}
 L12501: {
  arg0K0 = (have_323X->new_descriptor);
  goto L12417;}
 L12417: {
  value_325X = arg0K0;
  if ((3 == (3 & value_325X))) {
    merged_arg0K0 = (-4 & value_325X);
    write_descriptor_return_tag = 21;
    goto write_descriptor;
   write_descriptor_return_21:
    goto L13808;}
  else {
    merged_arg0K0 = value_325X;
    write_descriptor_return_tag = 22;
    goto write_descriptor;
   write_descriptor_return_22:
    goto L13808;}}
 write_shared_table: {
  table_196X = merged_arg0K0;{
  merged_arg0K0 = (*((long *) ((((char *) (-3 + table_196X))) + -4)));
  write_descriptor_return_tag = 23;
  goto write_descriptor;
 write_descriptor_return_23:
  arg0K0 = 0;
  goto L11763;}
 L11763: {
  i_326X = arg0K0;
  temp_327X = i_326X == ((((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + table_196X))) + -4))))>>8))))>>2));
  if (temp_327X) {
    write_shared_table0_return_value = temp_327X;
    goto write_shared_table_return;}
  else {
    link_328X = *((long *) ((((char *) (-3 + table_196X))) + (((i_326X)<<2))));
    if ((0 == (3 & link_328X))) {
      arg0K0 = (3 + (-4 & link_328X));
      goto L11773;}
    else {
      arg0K0 = link_328X;
      goto L11773;}}}
 L11773: {
  shared_329X = arg0K0;
  arg0K0 = shared_329X;
  goto L11807;}
 L11807: {
  next_330X = arg0K0;
  if ((3 == (3 & next_330X))) {
    v_331X = table_ref((Sstob_tableS), next_330X);
    if ((NULL == v_331X)) {
      link_332X = *((long *) ((((char *) (-3 + next_330X))) + 12));
      if ((0 == (3 & link_332X))) {
        arg0K0 = (3 + (-4 & link_332X));
        goto L11807;}
      else {
        arg0K0 = link_332X;
        goto L11807;}}
    else {
      arg0K0 = next_330X;
      goto L11775;}}
  else {
    arg0K0 = next_330X;
    goto L11775;}}
 L11775: {
  thing_333X = arg0K0;
  if ((3 == (3 & thing_333X))) {
    have_334X = table_ref((Sstob_tableS), thing_333X);
    if ((NULL == have_334X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L11826;}
    else {
      goto L11826;}}
  else {
    arg0K0 = thing_333X;
    goto L11777;}}
 L11826: {
  arg0K0 = (have_334X->new_descriptor);
  goto L11777;}
 L11777: {
  value_335X = arg0K0;
  if ((3 == (3 & value_335X))) {
    arg0K0 = (-4 & value_335X);
    goto L11779;}
  else {
    arg0K0 = value_335X;
    goto L11779;}}
 L11779: {
  v_336X = arg0K0;
  merged_arg0K0 = v_336X;
  write_descriptor_return_tag = 24;
  goto write_descriptor;
 write_descriptor_return_24:
  arg0K0 = (1 + i_326X);
  goto L11763;}
 write_shared_table_return:
  switch (write_shared_table_return_tag) {
  case 0: goto write_shared_table_return_0;
  default: goto write_shared_table_return_1;
  }}

 write_descriptor: {
  descriptor_195X = merged_arg0K0;{
  *((long *) (Simage_buffer_pointerS)) = (long) (descriptor_195X);
  Simage_buffer_pointerS = ((Simage_buffer_pointerS) + 4);
  if ((4096 == ((Simage_buffer_pointerS) - (Simage_bufferS)))) {
    have_337X = (Simage_buffer_pointerS) - (Simage_bufferS);
    if ((0 < have_337X)) {
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_337X));
        goto L6589;}
      else {
        goto L6589;}}
    else {
      goto write_descriptor_return;}}
  else {
    goto write_descriptor_return;}}
 L6589: {
  Simage_buffer_pointerS = (Simage_bufferS);
  goto write_descriptor_return;}
 write_descriptor_return:
  switch (write_descriptor_return_tag) {
  case 0: goto write_descriptor_return_0;
  case 1: goto write_descriptor_return_1;
  case 2: goto write_descriptor_return_2;
  case 3: goto write_descriptor_return_3;
  case 4: goto write_descriptor_return_4;
  case 5: goto write_descriptor_return_5;
  case 6: goto write_descriptor_return_6;
  case 7: goto write_descriptor_return_7;
  case 8: goto write_descriptor_return_8;
  case 9: goto write_descriptor_return_9;
  case 10: goto write_descriptor_return_10;
  case 11: goto write_descriptor_return_11;
  case 12: goto write_descriptor_return_12;
  case 13: goto write_descriptor_return_13;
  case 14: goto write_descriptor_return_14;
  case 15: goto write_descriptor_return_15;
  case 16: goto write_descriptor_return_16;
  case 17: goto write_descriptor_return_17;
  case 18: goto write_descriptor_return_18;
  case 19: goto write_descriptor_return_19;
  case 20: goto write_descriptor_return_20;
  case 21: goto write_descriptor_return_21;
  case 22: goto write_descriptor_return_22;
  case 23: goto write_descriptor_return_23;
  default: goto write_descriptor_return_24;
  }}

 copy_image_data: {
  start_193X = merged_arg1K0;
  size_194X = merged_arg0K1;{
  memmove((void *)(Simage_buffer_pointerS), (void *)start_193X,size_194X);
  Simage_buffer_pointerS = ((Simage_buffer_pointerS) + size_194X);
  if ((4096 == ((Simage_buffer_pointerS) - (Simage_bufferS)))) {
    have_338X = (Simage_buffer_pointerS) - (Simage_bufferS);
    if ((0 < have_338X)) {
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_338X));
        goto L6614;}
      else {
        goto L6614;}}
    else {
      goto copy_image_data_return;}}
  else {
    goto copy_image_data_return;}}
 L6614: {
  Simage_buffer_pointerS = (Simage_bufferS);
  goto copy_image_data_return;}
 copy_image_data_return:
  switch (copy_image_data_return_tag) {
  case 0: goto copy_image_data_return_0;
  case 1: goto copy_image_data_return_1;
  default: goto copy_image_data_return_2;
  }}

}
void s48_trace_locationsB(char * start_339X, char * end_340X)
{
  char * arg1K0;
  char * arg1K1;
  long arg0K0;
  long new_358X;
  char * data_addr_357X;
  char * frontier_356X;
  long new_thing_355X;
  char * data_pointer_354X;
  long mask_size_353X;
  char * code_pointer_352X;
  long size_351X;
  char * frontier_350X;
  long new_thing_349X;
  char * a_348X;
  long descriptor_347X;
  long h_346X;
  char * a_345X;
  char * next_344X;
  long thing_343X;
  char * frontier_342X;
  char * addr_341X;
 {  arg1K0 = start_339X;
  arg1K1 = (s48_ShpS);
  goto L14492;}
 L14492: {
  addr_341X = arg1K0;
  frontier_342X = arg1K1;
  if ((addr_341X < end_340X)) {
    thing_343X = *((long *) addr_341X);
    next_344X = addr_341X + 4;
    if ((2 == (3 & thing_343X))) {
      if ((2 == (3 & thing_343X))) {
        if (((31 & (((thing_343X)>>2))) < 16)) {
          goto L14509;}
        else {
          arg1K0 = (next_344X + (-4 & (3 + ((long)(((unsigned long)thing_343X)>>8)))));
          arg1K1 = frontier_342X;
          goto L14492;}}
      else {
        goto L14509;}}
    else {
      if ((3 == (3 & thing_343X))) {
        a_345X = ((char *) (-3 + thing_343X));
        if ((a_345X < (Sfrom_beginS))) {
          arg1K0 = next_344X;
          arg1K1 = frontier_342X;
          goto L14492;}
        else {
          if ((a_345X < (Sfrom_endS))) {
            h_346X = *((long *) ((((char *) (-3 + thing_343X))) + -4));
            if ((3 == (3 & h_346X))) {
              arg0K0 = h_346X;
              arg1K1 = frontier_342X;
              goto L14531;}
            else {
              if ((1078 == h_346X)) {
                descriptor_347X = *((long *) (((char *) (-3 + thing_343X))));
                if ((3 == (3 & descriptor_347X))) {
                  a_348X = ((char *) (-3 + descriptor_347X));
                  if ((a_348X < (Sfrom_beginS))) {
                    goto L16999;}
                  else {
                    if ((a_348X < (Sfrom_endS))) {
                      new_thing_349X = copy_weak_pointer(thing_343X, frontier_342X, &frontier_350X);
                      arg0K0 = new_thing_349X;
                      arg1K1 = frontier_350X;
                      goto L14531;}
                    else {
                      goto L16999;}}}
                else {
                  goto L16999;}}
              else {
                goto L16999;}}}
          else {
            arg1K0 = next_344X;
            arg1K1 = frontier_342X;
            goto L14492;}}}
      else {
        arg1K0 = next_344X;
        arg1K1 = frontier_342X;
        goto L14492;}}}
  else {
    s48_ShpS = frontier_342X;
    return;}}
 L14509: {
  if ((10 == (31 & (((thing_343X)>>2))))) {
    size_351X = -4 & (3 + ((long)(((unsigned long)thing_343X)>>8)));
    s48_ShpS = frontier_342X;
    code_pointer_352X = (((char *) (-3 + (*((long *) (next_344X + 4)))))) + ((((*((long *) next_344X)))>>2));
    mask_size_353X = *((unsigned char *) (code_pointer_352X + -3));
    if ((0 == mask_size_353X)) {s48_trace_locationsB(next_344X, (next_344X + size_351X));
      goto L14520;}
    else {
      data_pointer_354X = next_344X + 12;s48_trace_locationsB(next_344X, data_pointer_354X);s48_trace_continuation_contentsB(data_pointer_354X, code_pointer_352X, mask_size_353X);
      goto L14520;}}
  else {
    arg1K0 = next_344X;
    arg1K1 = frontier_342X;
    goto L14492;}}
 L14531: {
  new_thing_355X = arg0K0;
  frontier_356X = arg1K1;
  *((long *) addr_341X) = (long) (new_thing_355X);
  arg1K0 = next_344X;
  arg1K1 = frontier_356X;
  goto L14492;}
 L16999: {
  *((long *) frontier_342X) = (long) (h_346X);
  data_addr_357X = frontier_342X + 4;
  new_358X = 3 + (((long) data_addr_357X));
  *((long *) ((((char *) (-3 + thing_343X))) + -4)) = (long) (new_358X);
  memmove((void *)data_addr_357X, (void *)(((char *) (-3 + thing_343X))),((long)(((unsigned long)h_346X)>>8)));
  arg0K0 = new_358X;
  arg1K1 = (data_addr_357X + (-4 & (3 + ((long)(((unsigned long)h_346X)>>8)))));
  goto L14531;}
 L14520: {
  arg1K0 = (next_344X + size_351X);
  arg1K1 = (s48_ShpS);
  goto L14492;}
}
void s48_trace_stob_contentsB(long stob_359X)
{
  char * start_361X;
  long h_360X;
 {  h_360X = *((long *) ((((char *) (-3 + stob_359X))) + -4));
  start_361X = ((char *) (-3 + stob_359X));
  s48_trace_locationsB(start_361X, (start_361X + (-4 & (3 + ((long)(((unsigned long)h_360X)>>8))))));
  return;}
}
void s48_collect(char force_majorP_362X)
{
  char * arg1K1;
  char * arg1K0;
  long arg0K0;
  long x2_383X;
  long h_382X;
  char * a_381X;
  long value_380X;
  char * scan_379X;
  char * next_378X;
  char * end_377X;
  char * start_376X;
  long end_mseconds_375X;
  long end_seconds_374X;
  char v_373X;
  char * end_372X;
  char * x_371X;
  char * end_370X;
  char * start_369X;
  char * temp_368X;
  char * temp_367X;
  char * temp_366X;
  char * temp_365X;
  long start_mseconds_364X;
  long start_seconds_363X;
 {  start_seconds_363X = s48_run_time(&start_mseconds_364X);
  Sfrom_beginS = (Snewspace_beginS);
  Sfrom_endS = (Snewspace_endS);
  temp_365X = s48_SlimitS;
  s48_SlimitS = (Soldspace_limitS);
  Soldspace_limitS = temp_365X;
  temp_366X = s48_ShpS;
  s48_ShpS = (Soldspace_hpS);
  Soldspace_hpS = temp_366X;
  temp_367X = Snewspace_beginS;
  Snewspace_beginS = (Soldspace_beginS);
  Soldspace_beginS = temp_367X;
  temp_368X = Snewspace_endS;
  Snewspace_endS = (Soldspace_endS);
  Soldspace_endS = temp_368X;
  s48_ShpS = (Snewspace_beginS);
  Sweak_pointer_hpS = NULL;s48_gc_root();
  arg1K0 = (Snewspace_beginS);
  goto L14832;}
 L14832: {
  start_369X = arg1K0;
  end_370X = s48_ShpS;s48_trace_locationsB(start_369X, end_370X);
  if (((((((s48_SlimitS) - (s48_ShpS)))>>2)) < 0)) {
    ps_error("GC error: ran out of space in new heap", 0);
    goto L14768;}
  else {
    if ((end_370X < (s48_ShpS))) {
      arg1K0 = end_370X;
      goto L14832;}
    else {
      goto L14768;}}}
 L14768: {
  if (((Sweak_pointer_hpS) == NULL)) {
    goto L14770;}
  else {
    x_371X = Sweak_pointer_limitS;
    end_372X = Sweak_pointer_hpS;
    arg1K0 = (x_371X + -1024);
    arg1K1 = end_372X;
    goto L9969;}}
 L14770: {
  v_373X = (((((s48_SlimitS) - (s48_ShpS)))>>2)) < (((((3 + ((Snewspace_endS) - (Snewspace_beginS))))>>2)) / 10);s48_post_gc_cleanup(1, v_373X);
  Sgc_countS = (1 + (Sgc_countS));
  end_seconds_374X = s48_run_time(&end_mseconds_375X);
  if ((end_mseconds_375X < start_mseconds_364X)) {
    Sgc_secondsS = (-1 + ((Sgc_secondsS) + (end_seconds_374X - start_seconds_363X)));
    Sgc_msecondsS = ((Sgc_msecondsS) + ((1000 + end_mseconds_375X) - start_mseconds_364X));
    return;}
  else {
    Sgc_secondsS = ((Sgc_secondsS) + (end_seconds_374X - start_seconds_363X));
    Sgc_msecondsS = ((Sgc_msecondsS) + (end_mseconds_375X - start_mseconds_364X));
    return;}}
 L9969: {
  start_376X = arg1K0;
  end_377X = arg1K1;
  next_378X = ((char *) (*((long *) (start_376X + 8))));
  arg1K0 = start_376X;
  goto L6281;}
 L6281: {
  scan_379X = arg1K0;
  if ((scan_379X < end_377X)) {
    *((long *) scan_379X) = (long) (1078);
    value_380X = *((long *) (scan_379X + 4));
    if ((3 == (3 & value_380X))) {
      a_381X = ((char *) (-3 + value_380X));
      if ((a_381X < (Sfrom_beginS))) {
        goto L6327;}
      else {
        if ((a_381X < (Sfrom_endS))) {
          if ((3 == (3 & value_380X))) {
            h_382X = *((long *) ((((char *) (-3 + value_380X))) + -4));
            if ((3 == (3 & h_382X))) {
              arg0K0 = h_382X;
              goto L6322;}
            else {
              arg0K0 = 1;
              goto L6322;}}
          else {
            goto L6327;}}
        else {
          goto L6327;}}}
    else {
      goto L6327;}}
  else {
    if ((next_378X == NULL)) {
      if ((end_372X < (Sweak_pointer_limitS))) {
        *((long *) end_372X) = (long) ((70 + ((((-4 & ((Sweak_pointer_limitS) - (end_372X + 4))))<<8))));
        goto L14770;}
      else {
        goto L14770;}}
    else {
      arg1K0 = (next_378X + -1024);
      arg1K1 = next_378X;
      goto L9969;}}}
 L6327: {
  arg1K0 = (scan_379X + 8);
  goto L6281;}
 L6322: {
  x2_383X = arg0K0;
  *((long *) (scan_379X + 4)) = (long) (x2_383X);
  goto L6327;}
}
void s48_make_availableAgc(long len_384X)
{
  char x_385X;
 {  x_385X = ((s48_ShpS) + (-4 & (3 + len_384X))) < (s48_SlimitS);
  if (x_385X) {
    goto L14886;}
  else {s48_collect(0);
    goto L14886;}}
 L14886: {
  if ((((s48_ShpS) + (-4 & (3 + len_384X))) < (s48_SlimitS))) {
    return;}
  else {
    ps_error("Scheme 48 heap overflow", 0);
    return;}}
}
char * s48_allocate_tracedAgc(long len_386X)
{
  char * new_388X;
  char x_387X;
 {  x_387X = ((s48_ShpS) + (-4 & (3 + len_386X))) < (s48_SlimitS);
  if (x_387X) {
    goto L14960;}
  else {s48_collect(0);
    goto L14960;}}
 L14960: {
  if ((((s48_ShpS) + (-4 & (3 + len_386X))) < (s48_SlimitS))) {
    new_388X = s48_ShpS;
    s48_ShpS = ((s48_ShpS) + (-4 & (3 + len_386X)));
    return new_388X;}
  else {
    return NULL;}}
}
char * s48_allocate_weakAgc(long len_389X)
{
  char * new_391X;
  char x_390X;
 {  x_390X = ((s48_ShpS) + (-4 & (3 + len_389X))) < (s48_SlimitS);
  if (x_390X) {
    goto L15032;}
  else {s48_collect(0);
    goto L15032;}}
 L15032: {
  if ((((s48_ShpS) + (-4 & (3 + len_389X))) < (s48_SlimitS))) {
    new_391X = s48_ShpS;
    s48_ShpS = ((s48_ShpS) + (-4 & (3 + len_389X)));
    return new_391X;}
  else {
    return NULL;}}
}
char * s48_allocate_untracedAgc(long len_392X)
{
  char * new_394X;
  char x_393X;
 {  x_393X = ((s48_ShpS) + (-4 & (3 + len_392X))) < (s48_SlimitS);
  if (x_393X) {
    goto L15053;}
  else {s48_collect(0);
    goto L15053;}}
 L15053: {
  if ((((s48_ShpS) + (-4 & (3 + len_392X))) < (s48_SlimitS))) {
    new_394X = s48_ShpS;
    s48_ShpS = ((s48_ShpS) + (-4 & (3 + len_392X)));
    return new_394X;}
  else {
    return NULL;}}
}
long s48_allocate_stob(long type_395X, long size_396X)
{
  long arg0K0;
  char * arg1K0;
  char * thing_404X;
  char * new_403X;
  char * new_402X;
  char x_401X;
  char x_400X;
  long needed_399X;
  long length_in_bytes_398X;
  char tracedP_397X;
 {  tracedP_397X = type_395X < 16;
  if (tracedP_397X) {
    arg0K0 = (((size_396X)<<2));
    goto L15100;}
  else {
    arg0K0 = size_396X;
    goto L15100;}}
 L15100: {
  length_in_bytes_398X = arg0K0;
  needed_399X = 4 + length_in_bytes_398X;
  if (tracedP_397X) {
    x_400X = ((s48_ShpS) + (-4 & (3 + needed_399X))) < (s48_SlimitS);
    if (x_400X) {
      goto L15166;}
    else {s48_collect(0);
      goto L15166;}}
  else {
    x_401X = ((s48_ShpS) + (-4 & (3 + needed_399X))) < (s48_SlimitS);
    if (x_401X) {
      goto L15185;}
    else {s48_collect(0);
      goto L15185;}}}
 L15166: {
  if ((((s48_ShpS) + (-4 & (3 + needed_399X))) < (s48_SlimitS))) {
    new_402X = s48_ShpS;
    s48_ShpS = ((s48_ShpS) + (-4 & (3 + needed_399X)));
    arg1K0 = new_402X;
    goto L15116;}
  else {
    arg1K0 = NULL;
    goto L15116;}}
 L15185: {
  if ((((s48_ShpS) + (-4 & (3 + needed_399X))) < (s48_SlimitS))) {
    new_403X = s48_ShpS;
    s48_ShpS = ((s48_ShpS) + (-4 & (3 + needed_399X)));
    arg1K0 = new_403X;
    goto L15116;}
  else {
    arg1K0 = NULL;
    goto L15116;}}
 L15116: {
  thing_404X = arg1K0;
  if ((thing_404X == NULL)) {
    ps_error("insufficient heap space for external allocation", 0);
    goto L15128;}
  else {
    goto L15128;}}
 L15128: {
  *((long *) thing_404X) = (long) ((2 + (((((((length_in_bytes_398X)<<6)) + type_395X))<<2))));
  return (3 + (((long) (thing_404X + 4))));}
}
long s48_read_image(char *image_filename_405X, long max_heap_size_406X)
{
  struct image_location *arg2K0;
  struct table *arg3K0;
  char *arg5K1;
  char arg4K1;
  char arg4K0;
  char * arg1K0;
  long arg0K2;
  long arg0K1;
  long arg0K0;
  struct table *merged_arg3K1;
  FILE * merged_arg6K2;
  long merged_arg0K2;
  long merged_arg0K0;
  long merged_arg0K1;
  char * merged_arg1K1;
  char * merged_arg1K0;

  int really_read_image_area_return_tag;
  long really_read_image_area0_return_value;
  int reverse_byte_orderB_return_tag;
  int relocate_binding_table_two_spaceB_return_tag;
  int relocate_binding_table_bibopB_return_tag;
  int relocateD0_return_tag;
  long relocateD00_return_value;
  int old_Gnew_addr_return_tag;
  char * old_Gnew_addr0_return_value;
  int allocate_table_return_tag;
  long allocate_table0_return_value;
  int parse_reachable_objects_return_tag;
  long parse_reachable_objects0_return_value;
  int alloc_object_return_tag;
  char * alloc_object0_return_value;
  int relocateD2_return_tag;
  long relocateD20_return_value;
  char * new_start_addr_407X;
  long img_heap_size_408X;
  FILE * port_409X;
  char * start_410X;
  char * end_411X;
  long table_412X;
  long delta_413X;
  long table_414X;
  struct table *stob_table_415X;
  long address_416X;
  char * addr_417X;
  long format_418X;
  long tab_419X;
  long image_format_420X;
  char * from_addr_421X;
  char * to_addr_422X;
  long image_format_423X;
  char * current_address_424X;
  long size_in_bytes_425X;
  long address_426X;
  long status_776X;
  long status_775X;
  char *string_774X;
  char okayP_773X;
  long status_772X;
  char eofP_771X;
  long got_770X;
  long need_769X;
  char * next_768X;
  long value_767X;
  long x_766X;
  long x_765X;
  char * ptr_764X;
  long val_763X;
  long next_762X;
  long next_761X;
  long link_760X;
  long entry_759X;
  long value_758X;
  long bucket_757X;
  long bucket_756X;
  long link_755X;
  long i_754X;
  long val_753X;
  long next_752X;
  long next_751X;
  long link_750X;
  long entry_749X;
  long value_748X;
  long bucket_747X;
  long bucket_746X;
  long link_745X;
  long i_744X;
  struct image_location *image_location_743X;
  long v_742X;
  char * address_741X;
  char * y_740X;
  char * y_739X;
  char * v_738X;
  char * y_737X;
  char * pointer_736X;
  char * new_735X;
  long v_734X;
  char x_733X;
  long size_in_byte_732X;
  long size_731X;
  long cell_730X;
  char * addr_729X;
  char * new_address_728X;
  struct image_location *image_location_727X;
  long v_726X;
  struct image_location *image_location_725X;
  long v_724X;
  char * index_723X;
  char * new_address_722X;
  struct image_location *v_721X;
  long v_720X;
  char * address_719X;
  char * new_address_718X;
  char * v_717X;
  char * new_address_716X;
  long size_in_cells_715X;
  struct image_location *v_714X;
  long v_713X;
  char * v_712X;
  char * new_address_711X;
  long size_in_bytes_710X;
  long size_in_cells_709X;
  long header_cell_708X;
  char * x1_707X;
  char * current_addr_706X;
  struct image_location *v_705X;
  long v_704X;
  char * current_addr_703X;
  long size_in_cells_702X;
  long cell_701X;
  char * x1_700X;
  char * current_addr_699X;
  long v_698X;
  struct image_location *val_697X;
  struct image_location *image_location_696X;
  char * new_address_695X;
  char * new_694X;
  char x_693X;
  struct image_location *image_location_692X;
  long v_691X;
  char * address_690X;
  long val_689X;
  long val_688X;
  long next_687X;
  long next_686X;
  long next_685X;
  long next_684X;
  struct image_location *image_location_683X;
  long v_682X;
  long i_681X;
  long link_680X;
  long entry_679X;
  long link_678X;
  long entry_677X;
  char * address_676X;
  long cell_675X;
  long size_674X;
  char * address_673X;
  struct image_location **values_672X;
  long *keys_671X;
  struct table *table_670X;
  long d_669X;
  long value_668X;
  long value_667X;
  long cell_666X;
  long resumer_records_665X;
  long expr_664X;
  long descriptor_663X;
  char * ptr_662X;
  long bucket_661X;
  long bucket_660X;
  long bucket_659X;
  long bucket_658X;
  long expr_657X;
  long v_656X;
  char * start_655X;
  long link_654X;
  long i_653X;
  long link_652X;
  long i_651X;
  long expr_650X;
  long v_649X;
  long table_648X;
  long expr_647X;
  struct table *stob_table_646X;
  long table_645X;
  long expr_644X;
  long v_643X;
  struct image_location *image_location_642X;
  long v_641X;
  long descriptor_640X;
  long expr_639X;
  char * address_638X;
  long descriptor_637X;
  long expr_636X;
  long descriptor_635X;
  long expr_634X;
  long status_633X;
  long status_632X;
  long status_631X;
  char * v_630X;
  char * v_629X;
  long expr_628X;
  long status_627X;
  long descriptor_626X;
  long expr_625X;
  long status_624X;
  long status_623X;
  long status_622X;
  long status_621X;
  long status_620X;
  long status_619X;
  char eofP_618X;
  char v_617X;
  long expr_616X;
  long status_615X;
  char *string_614X;
  char okayP_613X;
  long status_612X;
  long status_611X;
  long status_610X;
  long status_609X;
  long descriptor_608X;
  long status_607X;
  long expr_606X;
  long expr_605X;
  long expr_604X;
  long status_603X;
  char eofP_602X;
  long got_601X;
  long need_600X;
  struct table *v_599X;
  long status_598X;
  long status_597X;
  long status_596X;
  long status_595X;
  long status_594X;
  long status_593X;
  char eofP_592X;
  char v_591X;
  char *string_590X;
  char okayP_589X;
  long status_588X;
  char eofP_587X;
  long expr_586X;
  struct table *table_585X;
  long i_584X;
  long status_583X;
  char eofP_582X;
  long got_581X;
  long need_580X;
  char * address_579X;
  long cells_578X;
  long status_577X;
  char eofP_576X;
  char ch_575X;
  long we_574X;
  long cells_573X;
  long status_572X;
  long *keys_571X;
  char * v_570X;
  long expr_569X;
  long status_568X;
  char eofP_567X;
  long thing_566X;
  long status_565X;
  long wh_564X;
  long cells_563X;
  long status_562X;
  long v_561X;
  char x_560X;
  long size_in_byte_559X;
  char * new_hp_558X;
  long delta_557X;
  char reverse_byte_orderP_556X;
  long status_555X;
  char eofP_554X;
  long thing_553X;
  long status_552X;
  long expr_551X;
  long status_550X;
  char eofP_549X;
  long thing_548X;
  long status_547X;
  long le_546X;
  long cells_545X;
  long v_544X;
  long x_543X;
  long x_542X;
  long status_541X;
  char eofP_540X;
  long thing_539X;
  long status_538X;
  long expr_537X;
  long status_536X;
  char eofP_535X;
  long thing_534X;
  long status_533X;
  long lh_532X;
  long cells_531X;
  long status_530X;
  char eofP_529X;
  long got_528X;
  char * new_addr_527X;
  long status_526X;
  char eofP_525X;
  long thing_524X;
  long status_523X;
  long expr_522X;
  long status_521X;
  char eofP_520X;
  long thing_519X;
  long status_518X;
  long se_517X;
  long cells_516X;
  char * temp_515X;
  char * temp_514X;
  char * temp_513X;
  char * temp_512X;
  long semisize_511X;
  long status_510X;
  char eofP_509X;
  long thing_508X;
  long status_507X;
  long expr_506X;
  long status_505X;
  char eofP_504X;
  long thing_503X;
  long status_502X;
  long sh_501X;
  long cells_500X;
  long cells_499X;
  char * heap_498X;
  long heap_size_497X;
  long status_496X;
  long status_495X;
  char eofP_494X;
  long thing_493X;
  long status_492X;
  long status_491X;
  char eofP_490X;
  long thing_489X;
  long status_488X;
  long sb_487X;
  long cells_486X;
  long status_485X;
  char eofP_484X;
  long thing_483X;
  long status_482X;
  long cells_481X;
  long minimum_size_480X;
  char * image_start_address_479X;
  long format_478X;
  long status_477X;
  long status_476X;
  long status_475X;
  long status_474X;
  long status_473X;
  long status_472X;
  char eofP_471X;
  long thing_470X;
  long status_469X;
  long status_468X;
  char eofP_467X;
  long thing_466X;
  long status_465X;
  long status_464X;
  long status_463X;
  long status_462X;
  long status_461X;
  long status_460X;
  long old_bytes_per_cell_459X;
  long status_458X;
  char eofP_457X;
  char thing_456X;
  long status_455X;
  char eofP_454X;
  long thing_453X;
  long status_452X;
  long format_451X;
  long status_450X;
  char eofP_449X;
  long status_448X;
  char eofP_447X;
  char ch_446X;
  long i_445X;
  long status_444X;
  char eofP_443X;
  long n_442X;
  long status_441X;
  char same_versionP_440X;
  long status_439X;
  char eofP_438X;
  long status_437X;
  char eofP_436X;
  char ch_435X;
  long status_434X;
  long status_433X;
  char eofP_432X;
  char ch_431X;
  long status_430X;
  long status_429X;
  long status_428X;
  FILE * port_427X;
 {  SstatusS = NO_ERRORS;
  SeofPS = 0;
  port_427X = ps_open_input_file(image_filename_405X, &status_428X);
  if ((status_428X == NO_ERRORS)) {
    status_429X = SstatusS;
    if ((status_429X == NO_ERRORS)) {
      if ((SeofPS)) {
        goto L7196;}
      else {
        goto L8719;}}
    else {
      goto L7196;}}
  else {
    ps_write_string("Can't open heap image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    ps_write_string((ps_error_string(status_428X)), (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    return -1;}}
 L7196: {
  status_430X = SstatusS;
  if ((status_430X == NO_ERRORS)) {
    if ((SeofPS)) {
      goto L7247;}
    else {
      goto L8639;}}
  else {
    goto L7247;}}
 L8719: {
  PS_READ_CHAR(port_427X, ch_431X, eofP_432X, status_433X)
  if (eofP_432X) {
    arg4K0 = eofP_432X;
    arg0K1 = status_433X;
    goto L7170;}
  else {
    if ((status_433X == NO_ERRORS)) {
      if ((12 == ch_431X)) {
        arg4K0 = 0;
        arg0K1 = status_433X;
        goto L7170;}
      else {
        goto L8719;}}
    else {
      arg4K0 = eofP_432X;
      arg0K1 = status_433X;
      goto L7170;}}}
 L7247: {
  status_434X = SstatusS;
  if ((status_434X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg4K0 = 0;
      goto L7298;}
    else {
      arg0K0 = 0;
      goto L8573;}}
  else {
    arg4K0 = 0;
    goto L7298;}}
 L8639: {
  PS_READ_CHAR(port_427X, ch_435X, eofP_436X, status_437X)
  if (eofP_436X) {
    arg4K0 = eofP_436X;
    arg0K1 = status_437X;
    goto L7221;}
  else {
    if ((status_437X == NO_ERRORS)) {
      if ((10 == ch_435X)) {
        arg4K0 = 0;
        arg0K1 = status_437X;
        goto L7221;}
      else {
        goto L8639;}}
    else {
      arg4K0 = eofP_436X;
      arg0K1 = status_437X;
      goto L7221;}}}
 L7170: {
  eofP_438X = arg4K0;
  status_439X = arg0K1;
  if (eofP_438X) {
    SeofPS = 1;
    goto L7196;}
  else {
    if ((status_439X == NO_ERRORS)) {
      goto L7196;}
    else {
      SeofPS = 1;
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = status_439X;
        goto L7196;}
      else {
        goto L7196;}}}}
 L7298: {
  same_versionP_440X = arg4K0;
  status_441X = SstatusS;
  if ((status_441X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L7351;}
    else {
      PS_READ_INTEGER(port_427X, n_442X, eofP_443X, status_444X)
      if (eofP_443X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L7351;}
      else {
        if ((status_444X == NO_ERRORS)) {
          arg0K0 = n_442X;
          goto L7351;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_444X;
            arg0K0 = -1;
            goto L7351;}
          else {
            arg0K0 = -1;
            goto L7351;}}}}}
  else {
    arg0K0 = -1;
    goto L7351;}}
 L8573: {
  i_445X = arg0K0;
  PS_READ_CHAR(port_427X, ch_446X, eofP_447X, status_448X)
  if (eofP_447X) {
    arg4K0 = 0;
    arg4K1 = eofP_447X;
    arg0K2 = status_448X;
    goto L7272;}
  else {
    if ((status_448X == NO_ERRORS)) {
      if ((i_445X == (strlen((char *) "Vanilla 33")))) {
        arg4K0 = (10 == ch_446X);
        arg4K1 = 0;
        arg0K2 = status_448X;
        goto L7272;}
      else {
        if ((ch_446X == (*("Vanilla 33" + i_445X)))) {
          arg0K0 = (1 + i_445X);
          goto L8573;}
        else {
          arg4K0 = 0;
          arg4K1 = 0;
          arg0K2 = status_448X;
          goto L7272;}}}
    else {
      arg4K0 = 0;
      arg4K1 = eofP_447X;
      arg0K2 = status_448X;
      goto L7272;}}}
 L7221: {
  eofP_449X = arg4K0;
  status_450X = arg0K1;
  if (eofP_449X) {
    SeofPS = 1;
    goto L7247;}
  else {
    if ((status_450X == NO_ERRORS)) {
      goto L7247;}
    else {
      SeofPS = 1;
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = status_450X;
        goto L7247;}
      else {
        goto L7247;}}}}
 L7351: {
  format_451X = arg0K0;
  status_452X = SstatusS;
  if ((status_452X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L7404;}
    else {
      PS_READ_INTEGER(port_427X, thing_453X, eofP_454X, status_455X)
      if (eofP_454X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L7404;}
      else {
        if ((status_455X == NO_ERRORS)) {
          arg0K0 = thing_453X;
          goto L7404;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_455X;
            arg0K0 = -1;
            goto L7404;}
          else {
            arg0K0 = -1;
            goto L7404;}}}}}
  else {
    arg0K0 = -1;
    goto L7404;}}
 L7272: {
  thing_456X = arg4K0;
  eofP_457X = arg4K1;
  status_458X = arg0K2;
  if (eofP_457X) {
    SeofPS = 1;
    arg4K0 = 0;
    goto L7298;}
  else {
    if ((status_458X == NO_ERRORS)) {
      arg4K0 = thing_456X;
      goto L7298;}
    else {
      SeofPS = 1;
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = status_458X;
        arg4K0 = 0;
        goto L7298;}
      else {
        arg4K0 = 0;
        goto L7298;}}}}
 L7404: {
  old_bytes_per_cell_459X = arg0K0;
  if (((SstatusS) == NO_ERRORS)) {
    if ((SeofPS)) {
      SstatusS = EDOM;
      ps_write_string("Premature EOF when reading image file", (stderr));
      { long ignoreXX;
      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
      status_460X = SstatusS;
      if ((status_460X == NO_ERRORS)) {
        goto L7852;}
      else {
        ps_write_string((ps_error_string((SstatusS))), (stderr));
        { long ignoreXX;
        PS_WRITE_CHAR(10, (stderr), ignoreXX) }
        goto L7852;}}
    else {
      if (same_versionP_440X) {
        if ((0 == format_451X)) {
          goto L7916;}
        else {
          if ((1 == format_451X)) {
            goto L7916;}
          else {
            ps_write_string("Unknown image format", (stderr));
            { long ignoreXX;
            PS_WRITE_CHAR(10, (stderr), ignoreXX) }
            status_461X = SstatusS;
            if ((status_461X == NO_ERRORS)) {
              goto L7927;}
            else {
              ps_write_string((ps_error_string((SstatusS))), (stderr));
              { long ignoreXX;
              PS_WRITE_CHAR(10, (stderr), ignoreXX) }
              goto L7927;}}}}
      else {
        ps_write_string("Format of image is incompatible with this version of system", (stderr));
        { long ignoreXX;
        PS_WRITE_CHAR(10, (stderr), ignoreXX) }
        status_462X = SstatusS;
        if ((status_462X == NO_ERRORS)) {
          goto L7886;}
        else {
          ps_write_string((ps_error_string((SstatusS))), (stderr));
          { long ignoreXX;
          PS_WRITE_CHAR(10, (stderr), ignoreXX) }
          goto L7886;}}}}
  else {
    ps_write_string("Error reading from image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    status_463X = SstatusS;
    if ((status_463X == NO_ERRORS)) {
      goto L7817;}
    else {
      ps_write_string((ps_error_string((SstatusS))), (stderr));
      { long ignoreXX;
      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
      goto L7817;}}}
 L7852: {
  status_464X = ps_close(port_427X);
  if ((status_464X == NO_ERRORS)) {
    arg0K0 = -1;
    arg0K1 = format_451X;
    goto L16824;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    arg0K1 = format_451X;
    goto L16824;}}
 L7916: {
  if ((4 == old_bytes_per_cell_459X)) {
    if ((0 == format_451X)) {
      status_465X = SstatusS;
      if ((status_465X == NO_ERRORS)) {
        if ((SeofPS)) {
          arg0K0 = -1;
          goto L4751;}
        else {
          PS_READ_INTEGER(port_427X, thing_466X, eofP_467X, status_468X)
          if (eofP_467X) {
            SeofPS = 1;
            arg0K0 = -1;
            goto L4751;}
          else {
            if ((status_468X == NO_ERRORS)) {
              arg0K0 = thing_466X;
              goto L4751;}
            else {
              SeofPS = 1;
              if (((SstatusS) == NO_ERRORS)) {
                SstatusS = status_468X;
                arg0K0 = -1;
                goto L4751;}
              else {
                arg0K0 = -1;
                goto L4751;}}}}}
      else {
        arg0K0 = -1;
        goto L4751;}}
    else {
      if ((1 == format_451X)) {
        status_469X = SstatusS;
        if ((status_469X == NO_ERRORS)) {
          if ((SeofPS)) {
            arg0K0 = -1;
            goto L4869;}
          else {
            PS_READ_INTEGER(port_427X, thing_470X, eofP_471X, status_472X)
            if (eofP_471X) {
              SeofPS = 1;
              arg0K0 = -1;
              goto L4869;}
            else {
              if ((status_472X == NO_ERRORS)) {
                arg0K0 = thing_470X;
                goto L4869;}
              else {
                SeofPS = 1;
                if (((SstatusS) == NO_ERRORS)) {
                  SstatusS = status_472X;
                  arg0K0 = -1;
                  goto L4869;}
                else {
                  arg0K0 = -1;
                  goto L4869;}}}}}
        else {
          arg0K0 = -1;
          goto L4869;}}
      else {
        ps_error("check-all-data!: Unknown image format (this can't happen)", 0);
        goto L7446;}}}
  else {
    ps_write_string("Incompatible bytes-per-cell in image", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    status_473X = SstatusS;
    if ((status_473X == NO_ERRORS)) {
      goto L7961;}
    else {
      ps_write_string((ps_error_string((SstatusS))), (stderr));
      { long ignoreXX;
      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
      goto L7961;}}}
 L7927: {
  status_474X = ps_close(port_427X);
  if ((status_474X == NO_ERRORS)) {
    arg0K0 = -1;
    arg0K1 = format_451X;
    goto L16824;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    arg0K1 = format_451X;
    goto L16824;}}
 L7886: {
  status_475X = ps_close(port_427X);
  if ((status_475X == NO_ERRORS)) {
    arg0K0 = -1;
    arg0K1 = format_451X;
    goto L16824;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    arg0K1 = format_451X;
    goto L16824;}}
 L7817: {
  status_476X = ps_close(port_427X);
  if ((status_476X == NO_ERRORS)) {
    arg0K0 = -1;
    arg0K1 = format_451X;
    goto L16824;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    arg0K1 = format_451X;
    goto L16824;}}
 L16824: {
  status_477X = arg0K0;
  format_478X = arg0K1;
  if ((0 == status_477X)) {
    if (((SstatusS) == NO_ERRORS)) {
      image_start_address_479X = Simg_start_addrS;
      minimum_size_480X = (((Simg_heap_sizeS))<<2);
      if ((max_heap_size_406X < minimum_size_480X)) {
        ps_write_string("Heap size ", (stderr));
        ps_write_integer(max_heap_size_406X, (stderr));
        ps_write_string(" is too small, using ", (stderr));
        ps_write_integer(minimum_size_480X, (stderr));
        ps_write_string(" cells", (stderr));
        { long ignoreXX;
        PS_WRITE_CHAR(10, (stderr), ignoreXX) }
        arg0K0 = minimum_size_480X;
        goto L2222;}
      else {
        arg0K0 = max_heap_size_406X;
        goto L2222;}}
    else {
      return -1;}}
  else {
    return -1;}}
 L4751: {
  cells_481X = arg0K0;
  Simg_start_addrS = (((char *) (((cells_481X)<<2))));
  status_482X = SstatusS;
  if ((status_482X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L4806;}
    else {
      PS_READ_INTEGER(port_427X, thing_483X, eofP_484X, status_485X)
      if (eofP_484X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L4806;}
      else {
        if ((status_485X == NO_ERRORS)) {
          arg0K0 = thing_483X;
          goto L4806;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_485X;
            arg0K0 = -1;
            goto L4806;}
          else {
            arg0K0 = -1;
            goto L4806;}}}}}
  else {
    arg0K0 = -1;
    goto L4806;}}
 L4869: {
  cells_486X = arg0K0;
  sb_487X = ((cells_486X)<<2);
  status_488X = SstatusS;
  if ((status_488X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L4924;}
    else {
      PS_READ_INTEGER(port_427X, thing_489X, eofP_490X, status_491X)
      if (eofP_490X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L4924;}
      else {
        if ((status_491X == NO_ERRORS)) {
          arg0K0 = thing_489X;
          goto L4924;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_491X;
            arg0K0 = -1;
            goto L4924;}
          else {
            arg0K0 = -1;
            goto L4924;}}}}}
  else {
    arg0K0 = -1;
    goto L4924;}}
 L7446: {
  status_492X = SstatusS;
  if ((status_492X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L7497;}
    else {
      PS_READ_INTEGER(port_427X, thing_493X, eofP_494X, status_495X)
      if (eofP_494X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L7497;}
      else {
        if ((status_495X == NO_ERRORS)) {
          arg0K0 = thing_493X;
          goto L7497;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_495X;
            arg0K0 = -1;
            goto L7497;}
          else {
            arg0K0 = -1;
            goto L7497;}}}}}
  else {
    arg0K0 = -1;
    goto L7497;}}
 L7961: {
  status_496X = ps_close(port_427X);
  if ((status_496X == NO_ERRORS)) {
    arg0K0 = -1;
    arg0K1 = format_451X;
    goto L16824;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    arg0K1 = format_451X;
    goto L16824;}}
 L2222: {
  heap_size_497X = arg0K0;
  heap_498X = (char *)malloc((((heap_size_497X)<<3)));
  if ((heap_498X == NULL)) {
    ps_error("unable to allocate heap space", 0);
    goto L2238;}
  else {
    goto L2238;}}
 L4806: {
  cells_499X = arg0K0;
  Simg_end_addrS = (((char *) (((cells_499X)<<2))));
  Simg_heap_sizeS = ((((3 + ((Simg_end_addrS) - (Simg_start_addrS))))>>2));
  goto L7446;}
 L4924: {
  cells_500X = arg0K0;
  sh_501X = ((cells_500X)<<2);
  status_502X = SstatusS;
  if ((status_502X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L4979;}
    else {
      PS_READ_INTEGER(port_427X, thing_503X, eofP_504X, status_505X)
      if (eofP_504X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L4979;}
      else {
        if ((status_505X == NO_ERRORS)) {
          arg0K0 = thing_503X;
          goto L4979;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_505X;
            arg0K0 = -1;
            goto L4979;}
          else {
            arg0K0 = -1;
            goto L4979;}}}}}
  else {
    arg0K0 = -1;
    goto L4979;}}
 L7497: {
  expr_506X = arg0K0;
  SsymbolsS = expr_506X;
  status_507X = SstatusS;
  if ((status_507X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L7550;}
    else {
      PS_READ_INTEGER(port_427X, thing_508X, eofP_509X, status_510X)
      if (eofP_509X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L7550;}
      else {
        if ((status_510X == NO_ERRORS)) {
          arg0K0 = thing_508X;
          goto L7550;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_510X;
            arg0K0 = -1;
            goto L7550;}
          else {
            arg0K0 = -1;
            goto L7550;}}}}}
  else {
    arg0K0 = -1;
    goto L7550;}}
 L2238: {
  semisize_511X = ((heap_size_497X)<<2);
  Snewspace_beginS = heap_498X;
  Snewspace_endS = ((Snewspace_beginS) + semisize_511X);
  Soldspace_beginS = (Snewspace_endS);
  Soldspace_endS = ((Soldspace_beginS) + semisize_511X);
  if (((Soldspace_beginS) == image_start_address_479X)) {
    temp_512X = s48_SlimitS;
    s48_SlimitS = (Soldspace_limitS);
    Soldspace_limitS = temp_512X;
    temp_513X = s48_ShpS;
    s48_ShpS = (Soldspace_hpS);
    Soldspace_hpS = temp_513X;
    temp_514X = Snewspace_beginS;
    Snewspace_beginS = (Soldspace_beginS);
    Soldspace_beginS = temp_514X;
    temp_515X = Snewspace_endS;
    Snewspace_endS = (Soldspace_endS);
    Soldspace_endS = temp_515X;
    goto L2262;}
  else {
    goto L2262;}}
 L4979: {
  cells_516X = arg0K0;
  se_517X = ((cells_516X)<<2);
  status_518X = SstatusS;
  if ((status_518X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L5036;}
    else {
      PS_READ_INTEGER(port_427X, thing_519X, eofP_520X, status_521X)
      if (eofP_520X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L5036;}
      else {
        if ((status_521X == NO_ERRORS)) {
          arg0K0 = thing_519X;
          goto L5036;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_521X;
            arg0K0 = -1;
            goto L5036;}
          else {
            arg0K0 = -1;
            goto L5036;}}}}}
  else {
    arg0K0 = -1;
    goto L5036;}}
 L7550: {
  expr_522X = arg0K0;
  Simported_bindingsS = expr_522X;
  status_523X = SstatusS;
  if ((status_523X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L7603;}
    else {
      PS_READ_INTEGER(port_427X, thing_524X, eofP_525X, status_526X)
      if (eofP_525X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L7603;}
      else {
        if ((status_526X == NO_ERRORS)) {
          arg0K0 = thing_524X;
          goto L7603;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_526X;
            arg0K0 = -1;
            goto L7603;}
          else {
            arg0K0 = -1;
            goto L7603;}}}}}
  else {
    arg0K0 = -1;
    goto L7603;}}
 L2262: {
  Soldspace_hpS = (Soldspace_beginS);
  Soldspace_limitS = (Soldspace_endS);
  s48_ShpS = (Snewspace_beginS);
  s48_SlimitS = (Snewspace_endS);
  Snew_heap_start_addrS = (Snewspace_beginS);
  if (((SstatusS) == NO_ERRORS)) {
    new_addr_527X = (char *)malloc(4);
    got_528X = ps_read_block(port_427X, ((char *) new_addr_527X), 4, &eofP_529X, &status_530X);
    if ((status_530X == NO_ERRORS)) {
      if (eofP_529X) {
        goto L3948;}
      else {
        if ((got_528X < 4)) {
          goto L3948;}
        else {
          goto L3900;}}}
    else {
      SstatusS = status_530X;
      goto L3948;}}
  else {
    return -1;}}
 L5036: {
  cells_531X = arg0K0;
  lh_532X = ((cells_531X)<<2);
  status_533X = SstatusS;
  if ((status_533X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L5091;}
    else {
      PS_READ_INTEGER(port_427X, thing_534X, eofP_535X, status_536X)
      if (eofP_535X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L5091;}
      else {
        if ((status_536X == NO_ERRORS)) {
          arg0K0 = thing_534X;
          goto L5091;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_536X;
            arg0K0 = -1;
            goto L5091;}
          else {
            arg0K0 = -1;
            goto L5091;}}}}}
  else {
    arg0K0 = -1;
    goto L5091;}}
 L7603: {
  expr_537X = arg0K0;
  Sexported_bindingsS = expr_537X;
  status_538X = SstatusS;
  if ((status_538X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L7656;}
    else {
      PS_READ_INTEGER(port_427X, thing_539X, eofP_540X, status_541X)
      if (eofP_540X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L7656;}
      else {
        if ((status_541X == NO_ERRORS)) {
          arg0K0 = thing_539X;
          goto L7656;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_541X;
            arg0K0 = -1;
            goto L7656;}
          else {
            arg0K0 = -1;
            goto L7656;}}}}}
  else {
    arg0K0 = -1;
    goto L7656;}}
 L3948: {
  ps_error("byte order check failed", 0);
  goto L3900;}
 L3900: {
  if ((1 == (*((long *) new_addr_527X)))) {
    free(new_addr_527X);
    arg4K0 = 0;
    goto L16892;}
  else {
    x_542X = *((unsigned char *) new_addr_527X);
    *((unsigned char *) new_addr_527X) = (unsigned char) ((*((unsigned char *) (new_addr_527X + 3))));
    *((unsigned char *) (new_addr_527X + 3)) = (unsigned char) (x_542X);
    x_543X = *((unsigned char *) (new_addr_527X + 1));
    *((unsigned char *) (new_addr_527X + 1)) = (unsigned char) ((*((unsigned char *) (new_addr_527X + 2))));
    *((unsigned char *) (new_addr_527X + 2)) = (unsigned char) (x_543X);
    v_544X = *((long *) new_addr_527X);
    if ((1 == v_544X)) {
      goto L3920;}
    else {
      ps_error("Unable to correct byte order", 0);
      goto L3920;}}}
 L5091: {
  cells_545X = arg0K0;
  le_546X = ((cells_545X)<<2);
  status_547X = SstatusS;
  if ((status_547X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L5148;}
    else {
      PS_READ_INTEGER(port_427X, thing_548X, eofP_549X, status_550X)
      if (eofP_549X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L5148;}
      else {
        if ((status_550X == NO_ERRORS)) {
          arg0K0 = thing_548X;
          goto L5148;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_550X;
            arg0K0 = -1;
            goto L5148;}
          else {
            arg0K0 = -1;
            goto L5148;}}}}}
  else {
    arg0K0 = -1;
    goto L5148;}}
 L7656: {
  expr_551X = arg0K0;
  Sresumer_recordsS = expr_551X;
  status_552X = SstatusS;
  if ((status_552X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L7709;}
    else {
      PS_READ_INTEGER(port_427X, thing_553X, eofP_554X, status_555X)
      if (eofP_554X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L7709;}
      else {
        if ((status_555X == NO_ERRORS)) {
          arg0K0 = thing_553X;
          goto L7709;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_555X;
            arg0K0 = -1;
            goto L7709;}
          else {
            arg0K0 = -1;
            goto L7709;}}}}}
  else {
    arg0K0 = -1;
    goto L7709;}}
 L16892: {
  reverse_byte_orderP_556X = arg4K0;
  if ((0 == format_478X)) {
    delta_557X = (Snew_heap_start_addrS) - (Simg_start_addrS);
    new_hp_558X = (Simg_end_addrS) + delta_557X;
    size_in_byte_559X = (((Simg_heap_sizeS))<<2);
    x_560X = ((s48_ShpS) + (-4 & (3 + size_in_byte_559X))) < (s48_SlimitS);
    if (x_560X) {
      goto L15473;}
    else {s48_collect(0);
      goto L15473;}}
  else {
    if ((1 == format_478X)) {
      Sheap_image_pointerS = NULL;
      Ssymbol_addressS = NULL;
      v_561X = SsymbolsS;
      if ((1 == v_561X)) {
        arg1K0 = (Simg_end_addrS);
        goto L6916;}
      else {
        arg1K0 = ((((char *) (-3 + (SsymbolsS)))) + -4);
        goto L6916;}}
    else {
      ps_write_string("unknown image format", (stderr));
      { long ignoreXX;
      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
      status_562X = SstatusS;
      if ((status_562X == NO_ERRORS)) {
        goto L16769;}
      else {
        ps_write_string((ps_error_string((SstatusS))), (stderr));
        { long ignoreXX;
        PS_WRITE_CHAR(10, (stderr), ignoreXX) }
        goto L16769;}}}}
 L3920: {
  free(new_addr_527X);
  arg4K0 = 1;
  goto L16892;}
 L5148: {
  cells_563X = arg0K0;
  wh_564X = ((cells_563X)<<2);
  status_565X = SstatusS;
  if ((status_565X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L5203;}
    else {
      PS_READ_INTEGER(port_427X, thing_566X, eofP_567X, status_568X)
      if (eofP_567X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L5203;}
      else {
        if ((status_568X == NO_ERRORS)) {
          arg0K0 = thing_566X;
          goto L5203;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_568X;
            arg0K0 = -1;
            goto L5203;}
          else {
            arg0K0 = -1;
            goto L5203;}}}}}
  else {
    arg0K0 = -1;
    goto L5203;}}
 L7709: {
  expr_569X = arg0K0;
  Sstartup_procedureS = expr_569X;
  if (((SstatusS) == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = 0;
      arg0K1 = format_451X;
      goto L16824;}
    else {
      goto L8048;}}
  else {
    arg0K0 = 0;
    arg0K1 = format_451X;
    goto L16824;}}
 L15473: {
  if ((((s48_ShpS) + (-4 & (3 + size_in_byte_559X))) < (s48_SlimitS))) {
    s48_ShpS = ((s48_ShpS) + (-4 & (3 + size_in_byte_559X)));
    goto L15352;}
  else {
    goto L15352;}}
 L6916: {
  v_570X = arg1K0;
  Ssymbol_addressS = v_570X;
  Sheap_object_remaining_cellsS = 0;
  Sheap_object_pointerS = NULL;
  keys_571X = (long*)malloc(sizeof(long) * 4097);
  arg0K0 = 0;
  goto L6939;}
 L16769: {
  status_572X = ps_close(port_427X);
  if ((status_572X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L16894;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L16894;}}
 L5203: {
  cells_573X = arg0K0;
  we_574X = ((cells_573X)<<2);
  Ssmall_img_start_addrS = (((char *) sb_487X));
  Ssmall_img_hp_addrS = (((char *) sh_501X));
  Ssmall_img_end_addrS = (((char *) se_517X));
  Slarge_img_start_addrS = (((char *) se_517X));
  Slarge_img_hp_addrS = (((char *) lh_532X));
  Slarge_img_end_addrS = (((char *) le_546X));
  Sweaks_img_start_addrS = (((char *) le_546X));
  Sweaks_img_hp_addrS = (((char *) wh_564X));
  Sweaks_img_end_addrS = (((char *) we_574X));
  Ssmall_img_heap_sizeS = ((((sh_501X - sb_487X))>>2));
  Slarge_img_heap_sizeS = ((((lh_532X - se_517X))>>2));
  Sweaks_img_heap_sizeS = ((((wh_564X - le_546X))>>2));
  Simg_start_addrS = (((char *) le_546X));
  Simg_end_addrS = (((char *) sh_501X));
  Simg_heap_sizeS = ((((((se_517X - sb_487X))>>2)) + ((((le_546X - se_517X))>>2))) + ((((we_574X - le_546X))>>2)));
  goto L7446;}
 L8048: {
  PS_READ_CHAR(port_427X, ch_575X, eofP_576X, status_577X)
  if (eofP_576X) {
    arg4K0 = eofP_576X;
    arg0K1 = status_577X;
    goto L7736;}
  else {
    if ((status_577X == NO_ERRORS)) {
      if ((12 == ch_575X)) {
        arg4K0 = 0;
        arg0K1 = status_577X;
        goto L7736;}
      else {
        goto L8048;}}
    else {
      arg4K0 = eofP_576X;
      arg0K1 = status_577X;
      goto L7736;}}}
 L15352: {
  cells_578X = Simg_heap_sizeS;
  address_579X = Snew_heap_start_addrS;
  need_580X = ((cells_578X)<<2);
  got_581X = ps_read_block(port_427X, ((char *) address_579X), need_580X, &eofP_582X, &status_583X);
  if ((status_583X == NO_ERRORS)) {
    if (eofP_582X) {
      arg4K0 = 0;
      arg5K1 = "Premature EOF when reading image file";
      goto L15362;}
    else {
      if ((got_581X < need_580X)) {
        arg4K0 = 0;
        arg5K1 = "Read returned too few bytes";
        goto L15362;}
      else {
        arg4K0 = 1;
        arg5K1 = "";
        goto L15362;}}}
  else {
    SstatusS = status_583X;
    arg4K0 = 0;
    arg5K1 = "Error reading from image file";
    goto L15362;}}
 L6939: {
  i_584X = arg0K0;
  if ((i_584X < 4097)) {
    *(keys_571X + i_584X) = 0;
    arg0K0 = (1 + i_584X);
    goto L6939;}
  else {
    table_585X = (struct table*)malloc(sizeof(struct table));
    if ((NULL == table_585X)) {
      arg3K0 = table_585X;
      goto L6927;}
    else {
      table_585X->keys = keys_571X;
      table_585X->values = ((struct image_location**)malloc(sizeof(struct image_location*) * 4096));
      table_585X->count = 0;
      table_585X->size = 4096;
      arg3K0 = table_585X;
      goto L6927;}}}
 L16894: {
  expr_586X = arg0K0;
  if ((0 == expr_586X)) {
    if (((SstatusS) == NO_ERRORS)) {
      return 0;}
    else {
      return -1;}}
  else {
    return -1;}}
 L7736: {
  eofP_587X = arg4K0;
  status_588X = arg0K1;
  if (eofP_587X) {
    SeofPS = 1;
    arg0K0 = 0;
    arg0K1 = format_451X;
    goto L16824;}
  else {
    if ((status_588X == NO_ERRORS)) {
      arg0K0 = 0;
      arg0K1 = format_451X;
      goto L16824;}
    else {
      SeofPS = 1;
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = status_588X;
        arg0K0 = 0;
        arg0K1 = format_451X;
        goto L16824;}
      else {
        arg0K0 = 0;
        arg0K1 = format_451X;
        goto L16824;}}}}
 L15362: {
  okayP_589X = arg4K0;
  string_590X = arg5K1;
  PS_READ_CHAR(port_427X, v_591X, eofP_592X, status_593X)
  if (okayP_589X) {
    if ((status_593X == NO_ERRORS)) {
      if (eofP_592X) {
        status_594X = ps_close(port_427X);
        if ((status_594X == NO_ERRORS)) {
          if (reverse_byte_orderP_556X) {
            merged_arg1K0 = (Snew_heap_start_addrS);
            merged_arg1K1 = new_hp_558X;
            reverse_byte_orderB_return_tag = 0;
            goto reverse_byte_orderB;
           reverse_byte_orderB_return_0:
            goto L15402;}
          else {
            goto L15402;}}
        else {
          ps_write_string("Error closing image file", (stderr));
          { long ignoreXX;
          PS_WRITE_CHAR(10, (stderr), ignoreXX) }
          status_595X = SstatusS;
          if ((status_595X == NO_ERRORS)) {
            goto L15619;}
          else {
            ps_write_string((ps_error_string((SstatusS))), (stderr));
            { long ignoreXX;
            PS_WRITE_CHAR(10, (stderr), ignoreXX) }
            goto L15619;}}}
      else {
        ps_write_string("Image file has extraneous data after image", (stderr));
        { long ignoreXX;
        PS_WRITE_CHAR(10, (stderr), ignoreXX) }
        status_596X = SstatusS;
        if ((status_596X == NO_ERRORS)) {
          goto L15587;}
        else {
          ps_write_string((ps_error_string((SstatusS))), (stderr));
          { long ignoreXX;
          PS_WRITE_CHAR(10, (stderr), ignoreXX) }
          goto L15587;}}}
    else {
      ps_write_string("Error reading from image file", (stderr));
      { long ignoreXX;
      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
      status_597X = SstatusS;
      if ((status_597X == NO_ERRORS)) {
        goto L15555;}
      else {
        ps_write_string((ps_error_string((SstatusS))), (stderr));
        { long ignoreXX;
        PS_WRITE_CHAR(10, (stderr), ignoreXX) }
        goto L15555;}}}
  else {
    ps_write_string(string_590X, (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    status_598X = SstatusS;
    if ((status_598X == NO_ERRORS)) {
      goto L15523;}
    else {
      ps_write_string((ps_error_string((SstatusS))), (stderr));
      { long ignoreXX;
      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
      goto L15523;}}}
 L6927: {
  v_599X = arg3K0;
  Sstob_tableS = v_599X;
  Sheap_image_pointerS = ((char *)malloc(((((Simg_heap_sizeS))<<2))));
  if ((0 == format_478X)) {
    need_600X = (((Simg_heap_sizeS))<<2);
    got_601X = ps_read_block(port_427X, ((char *) (Sheap_image_pointerS)), need_600X, &eofP_602X, &status_603X);
    if ((status_603X == NO_ERRORS)) {
      if (eofP_602X) {
        arg4K0 = 0;
        arg5K1 = "Premature EOF when reading image file";
        goto L9223;}
      else {
        if ((got_601X < need_600X)) {
          arg4K0 = 0;
          arg5K1 = "Read returned too few bytes";
          goto L9223;}
        else {
          arg4K0 = 1;
          arg5K1 = "";
          goto L9223;}}}
    else {
      SstatusS = status_603X;
      arg4K0 = 0;
      arg5K1 = "Error reading from image file";
      goto L9223;}}
  else {
    if ((1 == format_478X)) {
      merged_arg1K0 = (Sheap_image_pointerS);
      merged_arg0K1 = (Sweaks_img_heap_sizeS);
      merged_arg6K2 = port_427X;
      really_read_image_area_return_tag = 0;
      goto really_read_image_area;
     really_read_image_area_return_0:
      expr_604X = really_read_image_area0_return_value;
      if ((0 == expr_604X)) {
        if (((SstatusS) == NO_ERRORS)) {
          merged_arg1K0 = ((Sheap_image_pointerS) + ((Sweaks_img_end_addrS) - (Sweaks_img_start_addrS)));
          merged_arg0K1 = (Slarge_img_heap_sizeS);
          merged_arg6K2 = port_427X;
          really_read_image_area_return_tag = 1;
          goto really_read_image_area;
         really_read_image_area_return_1:
          expr_605X = really_read_image_area0_return_value;
          if ((0 == expr_605X)) {
            if (((SstatusS) == NO_ERRORS)) {
              merged_arg1K0 = ((Sheap_image_pointerS) + ((Sweaks_img_end_addrS) - (Slarge_img_start_addrS)));
              merged_arg0K1 = (Ssmall_img_heap_sizeS);
              merged_arg6K2 = port_427X;
              really_read_image_area_return_tag = 2;
              goto really_read_image_area;
             really_read_image_area_return_2:
              expr_606X = really_read_image_area0_return_value;
              if ((0 == expr_606X)) {
                if (((SstatusS) == NO_ERRORS)) {
                  arg0K0 = 0;
                  goto L9256;}
                else {
                  arg0K0 = -1;
                  goto L9256;}}
              else {
                arg0K0 = -1;
                goto L9256;}}
            else {
              arg0K0 = -1;
              goto L9256;}}
          else {
            arg0K0 = -1;
            goto L9256;}}
        else {
          arg0K0 = -1;
          goto L9256;}}
      else {
        arg0K0 = -1;
        goto L9256;}}
    else {
      ps_write_string("this can't happen: invalid image format", (stderr));
      { long ignoreXX;
      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
      status_607X = SstatusS;
      if ((status_607X == NO_ERRORS)) {
        goto L9626;}
      else {
        ps_write_string((ps_error_string((SstatusS))), (stderr));
        { long ignoreXX;
        PS_WRITE_CHAR(10, (stderr), ignoreXX) }
        goto L9626;}}}}
 L15402: {
  if ((0 == delta_557X)) {
    arg0K0 = 0;
    goto L16894;}
  else {
    descriptor_608X = Sstartup_procedureS;
    if ((3 == (3 & descriptor_608X))) {
      arg0K0 = (3 + (((long) ((((char *) (-3 + descriptor_608X))) + delta_557X))));
      goto L15411;}
    else {
      arg0K0 = descriptor_608X;
      goto L15411;}}}
 L15619: {
  status_609X = ps_close(port_427X);
  if ((status_609X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L16894;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L16894;}}
 L15587: {
  status_610X = ps_close(port_427X);
  if ((status_610X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L16894;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L16894;}}
 L15555: {
  status_611X = ps_close(port_427X);
  if ((status_611X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L16894;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L16894;}}
 L15523: {
  status_612X = ps_close(port_427X);
  if ((status_612X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L16894;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L16894;}}
 L9223: {
  okayP_613X = arg4K0;
  string_614X = arg5K1;
  if (okayP_613X) {
    arg0K0 = 0;
    goto L9256;}
  else {
    ps_write_string(string_614X, (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    status_615X = SstatusS;
    if ((status_615X == NO_ERRORS)) {
      goto L9491;}
    else {
      ps_write_string((ps_error_string((SstatusS))), (stderr));
      { long ignoreXX;
      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
      goto L9491;}}}
 L9256: {
  expr_616X = arg0K0;
  if ((0 == expr_616X)) {
    if (((SstatusS) == NO_ERRORS)) {
      PS_READ_CHAR(port_427X, v_617X, eofP_618X, status_619X)
      if ((status_619X == NO_ERRORS)) {
        if (eofP_618X) {
          status_620X = ps_close(port_427X);
          if ((status_620X == NO_ERRORS)) {
            arg0K0 = 0;
            goto L16663;}
          else {
            ps_write_string("Error closing image file", (stderr));
            { long ignoreXX;
            PS_WRITE_CHAR(10, (stderr), ignoreXX) }
            status_621X = SstatusS;
            if ((status_621X == NO_ERRORS)) {
              goto L9374;}
            else {
              ps_write_string((ps_error_string((SstatusS))), (stderr));
              { long ignoreXX;
              PS_WRITE_CHAR(10, (stderr), ignoreXX) }
              goto L9374;}}}
        else {
          ps_write_string("Image file has extraneous data after image", (stderr));
          { long ignoreXX;
          PS_WRITE_CHAR(10, (stderr), ignoreXX) }
          status_622X = SstatusS;
          if ((status_622X == NO_ERRORS)) {
            goto L9342;}
          else {
            ps_write_string((ps_error_string((SstatusS))), (stderr));
            { long ignoreXX;
            PS_WRITE_CHAR(10, (stderr), ignoreXX) }
            goto L9342;}}}
      else {
        ps_write_string("Error reading from image file", (stderr));
        { long ignoreXX;
        PS_WRITE_CHAR(10, (stderr), ignoreXX) }
        status_623X = SstatusS;
        if ((status_623X == NO_ERRORS)) {
          goto L9310;}
        else {
          ps_write_string((ps_error_string((SstatusS))), (stderr));
          { long ignoreXX;
          PS_WRITE_CHAR(10, (stderr), ignoreXX) }
          goto L9310;}}}
    else {
      arg0K0 = -1;
      goto L16663;}}
  else {
    arg0K0 = -1;
    goto L16663;}}
 L9626: {
  status_624X = ps_close(port_427X);
  if ((status_624X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L9256;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L9256;}}
 L15411: {
  expr_625X = arg0K0;
  Sstartup_procedureS = expr_625X;
  descriptor_626X = SsymbolsS;
  if ((3 == (3 & descriptor_626X))) {
    arg0K0 = (3 + (((long) ((((char *) (-3 + descriptor_626X))) + delta_557X))));
    goto L15417;}
  else {
    arg0K0 = descriptor_626X;
    goto L15417;}}
 L9491: {
  status_627X = ps_close(port_427X);
  if ((status_627X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L9256;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L9256;}}
 L16663: {
  expr_628X = arg0K0;
  if ((0 == expr_628X)) {
    if (((SstatusS) == NO_ERRORS)) {
      if (reverse_byte_orderP_556X) {
        merged_arg1K0 = (Simg_start_addrS);
        merged_arg0K1 = format_478X;
        old_Gnew_addr_return_tag = 0;
        goto old_Gnew_addr;
       old_Gnew_addr_return_0:
        v_629X = old_Gnew_addr0_return_value;
        merged_arg1K0 = (Simg_end_addrS);
        merged_arg0K1 = format_478X;
        old_Gnew_addr_return_tag = 1;
        goto old_Gnew_addr;
       old_Gnew_addr_return_1:
        v_630X = old_Gnew_addr0_return_value;
        merged_arg1K0 = v_629X;
        merged_arg1K1 = v_630X;
        reverse_byte_orderB_return_tag = 1;
        goto reverse_byte_orderB;
       reverse_byte_orderB_return_1:
        goto L16675;}
      else {
        goto L16675;}}
    else {
      arg0K0 = -1;
      goto L16894;}}
  else {
    arg0K0 = -1;
    goto L16894;}}
 L9374: {
  status_631X = ps_close(port_427X);
  if ((status_631X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L16663;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L16663;}}
 L9342: {
  status_632X = ps_close(port_427X);
  if ((status_632X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L16663;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L16663;}}
 L9310: {
  status_633X = ps_close(port_427X);
  if ((status_633X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L16663;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L16663;}}
 L15417: {
  expr_634X = arg0K0;
  SsymbolsS = expr_634X;
  descriptor_635X = Simported_bindingsS;
  if ((3 == (3 & descriptor_635X))) {
    arg0K0 = (3 + (((long) ((((char *) (-3 + descriptor_635X))) + delta_557X))));
    goto L15423;}
  else {
    arg0K0 = descriptor_635X;
    goto L15423;}}
 L16675: {
  if ((0 == format_478X)) {
    merged_arg1K0 = (Simg_start_addrS);
    merged_arg1K1 = (Ssymbol_addressS);
    merged_arg0K2 = format_478X;
    parse_reachable_objects_return_tag = 0;
    goto parse_reachable_objects;
   parse_reachable_objects_return_0:
    goto L16677;}
  else {
    if ((1 == format_478X)) {
      merged_arg1K0 = (Ssmall_img_start_addrS);
      merged_arg1K1 = (Ssymbol_addressS);
      merged_arg0K2 = format_478X;
      parse_reachable_objects_return_tag = 1;
      goto parse_reachable_objects;
     parse_reachable_objects_return_1:
      merged_arg1K0 = (Slarge_img_start_addrS);
      merged_arg1K1 = ((Slarge_img_start_addrS) + ((((Slarge_img_heap_sizeS))<<2)));
      merged_arg0K2 = format_478X;
      parse_reachable_objects_return_tag = 2;
      goto parse_reachable_objects;
     parse_reachable_objects_return_2:
      merged_arg1K0 = (Sweaks_img_start_addrS);
      merged_arg1K1 = ((Sweaks_img_start_addrS) + ((((Sweaks_img_heap_sizeS))<<2)));
      merged_arg0K2 = format_478X;
      parse_reachable_objects_return_tag = 3;
      goto parse_reachable_objects;
     parse_reachable_objects_return_3:
      goto L16677;}
    else {
      ps_error("allocate+parse+copy-objects!: Unknown image format", 0);
      goto L16677;}}}
 L15423: {
  expr_636X = arg0K0;
  Simported_bindingsS = expr_636X;
  descriptor_637X = Sexported_bindingsS;
  if ((3 == (3 & descriptor_637X))) {
    arg0K0 = (3 + (((long) ((((char *) (-3 + descriptor_637X))) + delta_557X))));
    goto L15429;}
  else {
    arg0K0 = descriptor_637X;
    goto L15429;}}
 L16677: {
  address_638X = (((char *) (-3 + (Sstartup_procedureS)))) + -4;
  if ((0 == (((long) address_638X)))) {
    arg0K0 = -1;
    goto L16004;}
  else {
    arg0K0 = (((long) address_638X));
    goto L16004;}}
 L15429: {
  expr_639X = arg0K0;
  Sexported_bindingsS = expr_639X;
  descriptor_640X = Sresumer_recordsS;
  if ((3 == (3 & descriptor_640X))) {
    arg0K0 = (3 + (((long) ((((char *) (-3 + descriptor_640X))) + delta_557X))));
    goto L15435;}
  else {
    arg0K0 = descriptor_640X;
    goto L15435;}}
 L16004: {
  v_641X = arg0K0;
  image_location_642X = table_ref((Sstob_tableS), v_641X);
  Sstartup_procedureS = (3 + (((long) ((((char *) (image_location_642X->new_descriptor))) + 4))));
  v_643X = SsymbolsS;
  if ((1 == v_643X)) {
    goto L15934;}
  else {
    merged_arg0K0 = (SsymbolsS);
    merged_arg0K1 = format_478X;
    allocate_table_return_tag = 0;
    goto allocate_table;
   allocate_table_return_0:
    expr_644X = allocate_table0_return_value;
    SsymbolsS = expr_644X;
    table_645X = SsymbolsS;
    stob_table_646X = Sstob_tableS;
    if ((3 == (3 & table_645X))) {
      if ((2 == (31 & ((((*((long *) ((((char *) (-3 + table_645X))) + -4))))>>2))))) {
        arg0K0 = 0;
        goto L12869;}
      else {
        goto L15934;}}
    else {
      goto L15934;}}}
 L15435: {
  expr_647X = arg0K0;
  Sresumer_recordsS = expr_647X;
  table_648X = SsymbolsS;
  if ((3 == (3 & table_648X))) {
    if ((2 == (31 & ((((*((long *) ((((char *) (-3 + table_648X))) + -4))))>>2))))) {
      arg0K0 = 0;
      goto L12671;}
    else {
      goto L15441;}}
  else {
    goto L15441;}}
 L15934: {
  v_649X = Simported_bindingsS;
  if ((1 == v_649X)) {
    goto L15954;}
  else {
    merged_arg0K0 = (Simported_bindingsS);
    merged_arg0K1 = format_478X;
    allocate_table_return_tag = 1;
    goto allocate_table;
   allocate_table_return_1:
    expr_650X = allocate_table0_return_value;
    Simported_bindingsS = expr_650X;
    merged_arg0K0 = (Simported_bindingsS);
    merged_arg3K1 = (Sstob_tableS);
    relocate_binding_table_bibopB_return_tag = 0;
    goto relocate_binding_table_bibopB;
   relocate_binding_table_bibopB_return_0:
    goto L15954;}}
 L12869: {
  i_651X = arg0K0;
  if ((1024 == i_651X)) {
    goto L15934;}
  else {
    link_652X = *((long *) ((((char *) (-3 + table_645X))) + (((i_651X)<<2))));
    if ((0 == (3 & link_652X))) {
      arg0K0 = (3 + (-4 & link_652X));
      goto L12875;}
    else {
      arg0K0 = link_652X;
      goto L12875;}}}
 L12671: {
  i_653X = arg0K0;
  if ((1024 == i_653X)) {
    goto L15441;}
  else {
    link_654X = *((long *) ((((char *) (-3 + table_648X))) + (((i_653X)<<2))));
    if ((0 == (3 & link_654X))) {
      arg0K0 = (3 + (-4 & link_654X));
      goto L12677;}
    else {
      arg0K0 = link_654X;
      goto L12677;}}}
 L15441: {
  merged_arg0K0 = (Simported_bindingsS);
  merged_arg0K1 = delta_557X;
  relocate_binding_table_two_spaceB_return_tag = 0;
  goto relocate_binding_table_two_spaceB;
 relocate_binding_table_two_spaceB_return_0:
  merged_arg0K0 = (Sexported_bindingsS);
  merged_arg0K1 = delta_557X;
  relocate_binding_table_two_spaceB_return_tag = 1;
  goto relocate_binding_table_two_spaceB;
 relocate_binding_table_two_spaceB_return_1:
  start_655X = Snew_heap_start_addrS;
  arg1K0 = start_655X;
  goto L10558;}
 L15954: {
  v_656X = Sexported_bindingsS;
  if ((1 == v_656X)) {
    goto L15974;}
  else {
    merged_arg0K0 = (Sexported_bindingsS);
    merged_arg0K1 = format_478X;
    allocate_table_return_tag = 2;
    goto allocate_table;
   allocate_table_return_2:
    expr_657X = allocate_table0_return_value;
    Sexported_bindingsS = expr_657X;
    merged_arg0K0 = (Sexported_bindingsS);
    merged_arg3K1 = (Sstob_tableS);
    relocate_binding_table_bibopB_return_tag = 1;
    goto relocate_binding_table_bibopB;
   relocate_binding_table_bibopB_return_1:
    goto L15974;}}
 L12875: {
  bucket_658X = arg0K0;
  if ((1 == bucket_658X)) {
    goto L12871;}
  else {
    merged_arg0K0 = bucket_658X;
    relocateD2_return_tag = 0;
    goto relocateD2;
   relocateD2_return_0:
    bucket_659X = relocateD20_return_value;
    if ((3 == (3 & bucket_659X))) {
      arg0K0 = (-4 & bucket_659X);
      goto L12880;}
    else {
      arg0K0 = bucket_659X;
      goto L12880;}}}
 L12677: {
  bucket_660X = arg0K0;
  if ((1 == bucket_660X)) {
    goto L12673;}
  else {
    bucket_661X = bucket_660X + delta_557X;
    if ((3 == (3 & bucket_661X))) {
      arg0K0 = (-4 & bucket_661X);
      goto L12682;}
    else {
      arg0K0 = bucket_661X;
      goto L12682;}}}
 L10558: {
  ptr_662X = arg1K0;
  if ((ptr_662X < new_hp_558X)) {
    descriptor_663X = *((long *) ptr_662X);
    if ((3 == (3 & descriptor_663X))) {
      arg0K0 = (3 + (((long) ((((char *) (-3 + descriptor_663X))) + delta_557X))));
      goto L10563;}
    else {
      arg0K0 = descriptor_663X;
      goto L10563;}}
  else {
    arg0K0 = 0;
    goto L16894;}}
 L15974: {
  if ((1 == (Sresumer_recordsS))) {
    goto L16679;}
  else {
    merged_arg0K0 = (Sresumer_recordsS);
    merged_arg0K1 = format_478X;
    allocate_table_return_tag = 3;
    goto allocate_table;
   allocate_table_return_3:
    expr_664X = allocate_table0_return_value;
    Sresumer_recordsS = expr_664X;
    resumer_records_665X = Sresumer_recordsS;
    cell_666X = *((long *) ((((char *) (-3 + resumer_records_665X))) + -4));
    if ((2 == (3 & cell_666X))) {
      arg1K0 = (((char *) (-3 + resumer_records_665X)));
      arg0K1 = ((((3 + ((long)(((unsigned long)cell_666X)>>8))))>>2));
      goto L9713;}
    else {
      ps_error("relocate-resumer-record! - no header", 0);
      goto L16679;}}}
 L12871: {
  arg0K0 = (1 + i_651X);
  goto L12869;}
 L12880: {
  value_667X = arg0K0;
  *((long *) ((((char *) (-3 + table_645X))) + (((i_651X)<<2)))) = (long) (value_667X);
  arg0K0 = bucket_659X;
  goto L12887;}
 L12673: {
  arg0K0 = (1 + i_653X);
  goto L12671;}
 L12682: {
  value_668X = arg0K0;
  *((long *) ((((char *) (-3 + table_648X))) + (((i_653X)<<2)))) = (long) (value_668X);
  arg0K0 = bucket_661X;
  goto L12689;}
 L10563: {
  d_669X = arg0K0;
  *((long *) ptr_662X) = (long) (d_669X);
  if ((2 == (3 & d_669X))) {
    if (((31 & (((d_669X)>>2))) < 16)) {
      goto L10575;}
    else {
      arg1K0 = (ptr_662X + (4 + (-4 & (3 + ((long)(((unsigned long)d_669X)>>8))))));
      goto L10558;}}
  else {
    goto L10575;}}
 L16679: {
  table_670X = Sstob_tableS;
  keys_671X = table_670X->keys;
  values_672X = table_670X->values;
  arg0K0 = 0;
  goto L3022;}
 L9713: {
  address_673X = arg1K0;
  size_674X = arg0K1;
  if ((0 == size_674X)) {
    goto L16679;}
  else {
    cell_675X = *((long *) address_673X);
    if ((3 == (3 & cell_675X))) {
      address_676X = (((char *) (-3 + cell_675X))) + -4;
      if ((0 == (((long) address_676X)))) {
        arg0K0 = -1;
        goto L9778;}
      else {
        arg0K0 = (((long) address_676X));
        goto L9778;}}
    else {
      ps_error("Could this happen?", 0);
      goto L16679;}}}
 L12887: {
  entry_677X = arg0K0;
  link_678X = *((long *) ((((char *) (-3 + entry_677X))) + 4));
  if ((0 == (3 & link_678X))) {
    arg0K0 = (3 + (-4 & link_678X));
    goto L12891;}
  else {
    arg0K0 = link_678X;
    goto L12891;}}
 L12689: {
  entry_679X = arg0K0;
  link_680X = *((long *) ((((char *) (-3 + entry_679X))) + 4));
  if ((0 == (3 & link_680X))) {
    arg0K0 = (3 + (-4 & link_680X));
    goto L12693;}
  else {
    arg0K0 = link_680X;
    goto L12693;}}
 L10575: {
  arg1K0 = (ptr_662X + 4);
  goto L10558;}
 L3022: {
  i_681X = arg0K0;
  if ((i_681X == (table_670X->size))) {
    free(keys_671X);
    free(values_672X);
    free(table_670X);
    free((Sheap_image_pointerS));
    arg0K0 = 0;
    goto L16894;}
  else {
    if ((0 == (*(keys_671X + i_681X)))) {
      goto L3024;}
    else {
      free((*(values_672X + i_681X)));
      goto L3024;}}}
 L9778: {
  v_682X = arg0K0;
  image_location_683X = table_ref((Sstob_tableS), v_682X);
  *((long *) address_673X) = (long) ((3 + (((long) ((((char *) (image_location_683X->new_descriptor))) + 4)))));
  arg1K0 = (address_673X + 4);
  arg0K1 = (-1 + size_674X);
  goto L9713;}
 L12891: {
  next_684X = arg0K0;
  if ((1 == next_684X)) {
    goto L12871;}
  else {
    merged_arg0K0 = next_684X;
    relocateD2_return_tag = 1;
    goto relocateD2;
   relocateD2_return_1:
    next_685X = relocateD20_return_value;
    if ((3 == (3 & next_685X))) {
      arg0K0 = (-4 & next_685X);
      goto L12896;}
    else {
      arg0K0 = next_685X;
      goto L12896;}}}
 L12693: {
  next_686X = arg0K0;
  if ((1 == next_686X)) {
    goto L12673;}
  else {
    next_687X = next_686X + delta_557X;
    if ((3 == (3 & next_687X))) {
      arg0K0 = (-4 & next_687X);
      goto L12698;}
    else {
      arg0K0 = next_687X;
      goto L12698;}}}
 L3024: {
  arg0K0 = (1 + i_681X);
  goto L3022;}
 L12896: {
  val_688X = arg0K0;
  *((long *) ((((char *) (-3 + entry_677X))) + 4)) = (long) (val_688X);
  arg0K0 = next_685X;
  goto L12887;}
 L12698: {
  val_689X = arg0K0;
  *((long *) ((((char *) (-3 + entry_679X))) + 4)) = (long) (val_689X);
  arg0K0 = next_687X;
  goto L12689;}
 relocateD2: {
  address_426X = merged_arg0K0;{
  address_690X = (((char *) (-3 + address_426X))) + -4;
  if ((0 == (((long) address_690X)))) {
    arg0K0 = -1;
    goto L12839;}
  else {
    arg0K0 = (((long) address_690X));
    goto L12839;}}
 L12839: {
  v_691X = arg0K0;
  image_location_692X = table_ref(stob_table_646X, v_691X);
  relocateD20_return_value = (3 + (((long) ((((char *) (image_location_692X->new_descriptor))) + 4))));
  goto relocateD2_return;}
 relocateD2_return:
  switch (relocateD2_return_tag) {
  case 0: goto relocateD2_return_0;
  default: goto relocateD2_return_1;
  }}

 alloc_object: {
  current_address_424X = merged_arg1K0;
  size_in_bytes_425X = merged_arg0K1;{
  x_693X = ((s48_ShpS) + (-4 & (3 + size_in_bytes_425X))) < (s48_SlimitS);
  if (x_693X) {
    goto L15218;}
  else {s48_collect(0);
    goto L15218;}}
 L15218: {
  if ((((s48_ShpS) + (-4 & (3 + size_in_bytes_425X))) < (s48_SlimitS))) {
    new_694X = s48_ShpS;
    s48_ShpS = ((s48_ShpS) + (-4 & (3 + size_in_bytes_425X)));
    arg1K0 = new_694X;
    goto L15208;}
  else {
    arg1K0 = NULL;
    goto L15208;}}
 L15208: {
  new_address_695X = arg1K0;
  image_location_696X = (struct image_location*)malloc(sizeof(struct image_location));
  if ((NULL == image_location_696X)) {
    arg2K0 = image_location_696X;
    goto L15235;}
  else {
    image_location_696X->new_descriptor = (((long) new_address_695X));
    image_location_696X->next = 0;
    arg2K0 = image_location_696X;
    goto L15235;}}
 L15235: {
  val_697X = arg2K0;
  if ((0 == (((long) current_address_424X)))) {
    arg0K0 = -1;
    goto L15237;}
  else {
    arg0K0 = (((long) current_address_424X));
    goto L15237;}}
 L15237: {
  v_698X = arg0K0;table_setB((Sstob_tableS), v_698X, val_697X);
  alloc_object0_return_value = new_address_695X;
  goto alloc_object_return;}
 alloc_object_return:
  switch (alloc_object_return_tag) {
  case 0: goto alloc_object_return_0;
  case 1: goto alloc_object_return_1;
  case 2: goto alloc_object_return_2;
  default: goto alloc_object_return_3;
  }}

 parse_reachable_objects: {
  from_addr_421X = merged_arg1K0;
  to_addr_422X = merged_arg1K1;
  image_format_423X = merged_arg0K2;{
  arg1K0 = from_addr_421X;
  goto L16325;}
 L16325: {
  current_addr_699X = arg1K0;
  if ((current_addr_699X == to_addr_422X)) {
    parse_reachable_objects0_return_value = 0;
    goto parse_reachable_objects_return;}
  else {
    merged_arg1K0 = current_addr_699X;
    merged_arg0K1 = image_format_423X;
    old_Gnew_addr_return_tag = 2;
    goto old_Gnew_addr;
   old_Gnew_addr_return_2:
    x1_700X = old_Gnew_addr0_return_value;
    cell_701X = *((long *) x1_700X);
    if ((2 == (3 & cell_701X))) {
      size_in_cells_702X = (((3 + ((long)(((unsigned long)cell_701X)>>8))))>>2);
      if ((0 == (Sheap_object_remaining_cellsS))) {
        goto L16350;}
      else {
        ps_error("Encountered an header within an d-vector.", 0);
        goto L16350;}}
    else {
      if ((3 == (3 & cell_701X))) {
        current_addr_703X = (((char *) (-3 + cell_701X))) + -4;
        if ((0 == (((long) current_addr_703X)))) {
          arg0K0 = -1;
          goto L16552;}
        else {
          arg0K0 = (((long) current_addr_703X));
          goto L16552;}}
      else {
        *((long *) (Sheap_object_pointerS)) = (long) (cell_701X);
        Sheap_object_remaining_cellsS = (-1 + (Sheap_object_remaining_cellsS));
        Sheap_object_pointerS = ((Sheap_object_pointerS) + 4);
        goto L16407;}}}}
 L16350: {
  if ((2 == (3 & cell_701X))) {
    if (((31 & (((cell_701X)>>2))) < 16)) {
      goto L16366;}
    else {
      if ((0 == (((long) current_addr_699X)))) {
        arg0K0 = -1;
        goto L16438;}
      else {
        arg0K0 = (((long) current_addr_699X));
        goto L16438;}}}
  else {
    goto L16366;}}
 L16552: {
  v_704X = arg0K0;
  v_705X = table_ref((Sstob_tableS), v_704X);
  if ((NULL == v_705X)) {
    current_addr_706X = (((char *) (-3 + cell_701X))) + -4;
    merged_arg1K0 = current_addr_706X;
    merged_arg0K1 = image_format_423X;
    old_Gnew_addr_return_tag = 3;
    goto old_Gnew_addr;
   old_Gnew_addr_return_3:
    x1_707X = old_Gnew_addr0_return_value;
    header_cell_708X = *((long *) x1_707X);
    size_in_cells_709X = 1 + ((((3 + ((long)(((unsigned long)header_cell_708X)>>8))))>>2));
    size_in_bytes_710X = ((size_in_cells_709X)<<2);
    if ((2 == (3 & header_cell_708X))) {
      if (((31 & (((header_cell_708X)>>2))) < 16)) {
        goto L16184;}
      else {
        merged_arg1K0 = current_addr_706X;
        merged_arg0K1 = (((size_in_cells_709X)<<2));
        alloc_object_return_tag = 0;
        goto alloc_object;
       alloc_object_return_0:
        new_address_711X = alloc_object0_return_value;
        merged_arg1K0 = current_addr_706X;
        merged_arg0K1 = image_format_423X;
        old_Gnew_addr_return_tag = 4;
        goto old_Gnew_addr;
       old_Gnew_addr_return_4:
        v_712X = old_Gnew_addr0_return_value;
        memmove((void *)new_address_711X, (void *)v_712X,(((size_in_cells_709X)<<2)));
        goto L16398;}}
    else {
      goto L16184;}}
  else {
    goto L16398;}}
 L16407: {
  arg1K0 = (current_addr_699X + 4);
  goto L16325;}
 L16366: {
  if ((0 == (((long) current_addr_699X)))) {
    arg0K0 = -1;
    goto L16465;}
  else {
    arg0K0 = (((long) current_addr_699X));
    goto L16465;}}
 L16438: {
  v_713X = arg0K0;
  v_714X = table_ref((Sstob_tableS), v_713X);
  if ((NULL == v_714X)) {
    size_in_cells_715X = 1 + size_in_cells_702X;
    merged_arg1K0 = current_addr_699X;
    merged_arg0K1 = (((size_in_cells_715X)<<2));
    alloc_object_return_tag = 1;
    goto alloc_object;
   alloc_object_return_1:
    new_address_716X = alloc_object0_return_value;
    merged_arg1K0 = current_addr_699X;
    merged_arg0K1 = image_format_423X;
    old_Gnew_addr_return_tag = 5;
    goto old_Gnew_addr;
   old_Gnew_addr_return_5:
    v_717X = old_Gnew_addr0_return_value;
    memmove((void *)new_address_716X, (void *)v_717X,(((size_in_cells_715X)<<2)));
    goto L16363;}
  else {
    goto L16363;}}
 L16184: {
  merged_arg1K0 = current_addr_706X;
  merged_arg0K1 = size_in_bytes_710X;
  alloc_object_return_tag = 2;
  goto alloc_object;
 alloc_object_return_2:
  new_address_718X = alloc_object0_return_value;
  *((long *) new_address_718X) = (long) ((-954 + (((size_in_bytes_710X)<<8))));
  arg1K0 = (new_address_718X + 4);
  goto L16202;}
 L16398: {
  address_719X = (((char *) (-3 + cell_701X))) + -4;
  if ((0 == (((long) address_719X)))) {
    arg0K0 = -1;
    goto L16566;}
  else {
    arg0K0 = (((long) address_719X));
    goto L16566;}}
 L16465: {
  v_720X = arg0K0;
  v_721X = table_ref((Sstob_tableS), v_720X);
  if ((NULL == v_721X)) {
    merged_arg1K0 = current_addr_699X;
    merged_arg0K1 = (4 + (((size_in_cells_702X)<<2)));
    alloc_object_return_tag = 3;
    goto alloc_object;
   alloc_object_return_3:
    new_address_722X = alloc_object0_return_value;
    if ((2 == (3 & cell_701X))) {
      goto L16482;}
    else {
      ps_error("cell was not a header", 0);
      goto L16482;}}
  else {
    if ((0 == (((long) current_addr_699X)))) {
      arg0K0 = -1;
      goto L9838;}
    else {
      arg0K0 = (((long) current_addr_699X));
      goto L9838;}}}
 L16363: {
  arg1K0 = (current_addr_699X + (4 + (((size_in_cells_702X)<<2))));
  goto L16325;}
 L16202: {
  index_723X = arg1K0;
  if ((index_723X == (new_address_718X + (-4 & (3 + size_in_bytes_710X))))) {
    goto L16398;}
  else {
    *((long *) index_723X) = (long) (0);
    arg1K0 = (index_723X + 4);
    goto L16202;}}
 L16566: {
  v_724X = arg0K0;
  image_location_725X = table_ref((Sstob_tableS), v_724X);
  *((long *) (Sheap_object_pointerS)) = (long) ((3 + (((long) ((((char *) (image_location_725X->new_descriptor))) + 4)))));
  Sheap_object_remaining_cellsS = (-1 + (Sheap_object_remaining_cellsS));
  Sheap_object_pointerS = ((Sheap_object_pointerS) + 4);
  goto L16407;}
 L16482: {
  *((long *) new_address_722X) = (long) (cell_701X);
  Sheap_object_pointerS = new_address_722X;
  Sheap_object_remaining_cellsS = (1 + ((((3 + ((long)(((unsigned long)cell_701X)>>8))))>>2)));
  Sheap_object_remaining_cellsS = (-1 + (Sheap_object_remaining_cellsS));
  Sheap_object_pointerS = ((Sheap_object_pointerS) + 4);
  goto L16378;}
 L9838: {
  v_726X = arg0K0;
  image_location_727X = table_ref((Sstob_tableS), v_726X);
  new_address_728X = ((char *) (image_location_727X->new_descriptor));
  if ((2 == (3 & cell_701X))) {
    goto L9823;}
  else {
    ps_error("cell was not a header", 0);
    goto L9823;}}
 L16378: {
  arg1K0 = (current_addr_699X + 4);
  goto L16325;}
 L9823: {
  *((long *) new_address_728X) = (long) (cell_701X);
  Sheap_object_pointerS = new_address_728X;
  Sheap_object_remaining_cellsS = (1 + ((((3 + ((long)(((unsigned long)cell_701X)>>8))))>>2)));
  Sheap_object_remaining_cellsS = (-1 + (Sheap_object_remaining_cellsS));
  Sheap_object_pointerS = ((Sheap_object_pointerS) + 4);
  goto L16378;}
 parse_reachable_objects_return:
  switch (parse_reachable_objects_return_tag) {
  case 0: goto parse_reachable_objects_return_0;
  case 1: goto parse_reachable_objects_return_1;
  case 2: goto parse_reachable_objects_return_2;
  default: goto parse_reachable_objects_return_3;
  }}

 allocate_table: {
  tab_419X = merged_arg0K0;
  image_format_420X = merged_arg0K1;{
  merged_arg1K0 = ((((char *) (-3 + tab_419X))) + -4);
  merged_arg0K1 = image_format_420X;
  old_Gnew_addr_return_tag = 6;
  goto old_Gnew_addr;
 old_Gnew_addr_return_6:
  addr_729X = old_Gnew_addr0_return_value;
  cell_730X = *((long *) addr_729X);
  if ((2 == (3 & cell_730X))) {
    size_731X = (((3 + ((long)(((unsigned long)cell_730X)>>8))))>>2);
    size_in_byte_732X = 4 + (((size_731X)<<2));
    x_733X = ((s48_ShpS) + (-4 & (3 + size_in_byte_732X))) < (s48_SlimitS);
    if (x_733X) {
      goto L15311;}
    else {s48_collect(0);
      goto L15311;}}
  else {
    ps_error("read-tables! no header", 0);
    allocate_table0_return_value = v_734X;
    goto allocate_table_return;}}
 L15311: {
  if ((((s48_ShpS) + (-4 & (3 + size_in_byte_732X))) < (s48_SlimitS))) {
    new_735X = s48_ShpS;
    s48_ShpS = ((s48_ShpS) + (-4 & (3 + size_in_byte_732X)));
    arg1K0 = new_735X;
    goto L15279;}
  else {
    arg1K0 = NULL;
    goto L15279;}}
 L15279: {
  pointer_736X = arg1K0;
  memmove((void *)pointer_736X, (void *)addr_729X,(4 + (((size_731X)<<2))));
  allocate_table0_return_value = (3 + (((long) (pointer_736X + 4))));
  goto allocate_table_return;}
 allocate_table_return:
  switch (allocate_table_return_tag) {
  case 0: goto allocate_table_return_0;
  case 1: goto allocate_table_return_1;
  case 2: goto allocate_table_return_2;
  default: goto allocate_table_return_3;
  }}

 old_Gnew_addr: {
  addr_417X = merged_arg1K0;
  format_418X = merged_arg0K1;{
  if ((0 == format_418X)) {
    old_Gnew_addr0_return_value = ((Sheap_image_pointerS) + (addr_417X - (Simg_start_addrS)));
    goto old_Gnew_addr_return;}
  else {
    if ((1 == format_418X)) {
      y_737X = Ssmall_img_start_addrS;
      if ((addr_417X < y_737X)) {
        goto L3125;}
      else {
        if (((Ssmall_img_hp_addrS) < addr_417X)) {
          goto L3125;}
        else {
          SoffsetS = (((Sweaks_img_end_addrS) - (Sweaks_img_start_addrS)) + ((Slarge_img_end_addrS) - (Slarge_img_start_addrS)));
          Sarea_startS = (Ssmall_img_start_addrS);
          goto L3177;}}}
    else {
      ps_error("old->new-addr: Unknown image format", 0);
      old_Gnew_addr0_return_value = v_738X;
      goto old_Gnew_addr_return;}}}
 L3125: {
  y_739X = Slarge_img_start_addrS;
  if ((addr_417X < y_739X)) {
    goto L3151;}
  else {
    if (((Slarge_img_hp_addrS) < addr_417X)) {
      goto L3151;}
    else {
      SoffsetS = ((Sweaks_img_end_addrS) - (Sweaks_img_start_addrS));
      Sarea_startS = (Slarge_img_start_addrS);
      goto L3177;}}}
 L3177: {
  old_Gnew_addr0_return_value = ((Sheap_image_pointerS) + ((SoffsetS) + (addr_417X - (Sarea_startS))));
  goto old_Gnew_addr_return;}
 L3151: {
  y_740X = Sweaks_img_start_addrS;
  if ((addr_417X < y_740X)) {
    goto L3173;}
  else {
    if (((Sweaks_img_hp_addrS) < addr_417X)) {
      goto L3173;}
    else {
      SoffsetS = 0;
      Sarea_startS = (Sweaks_img_start_addrS);
      goto L3177;}}}
 L3173: {
  ps_error("Unknown address area!", 0);
  goto L3177;}
 old_Gnew_addr_return:
  switch (old_Gnew_addr_return_tag) {
  case 0: goto old_Gnew_addr_return_0;
  case 1: goto old_Gnew_addr_return_1;
  case 2: goto old_Gnew_addr_return_2;
  case 3: goto old_Gnew_addr_return_3;
  case 4: goto old_Gnew_addr_return_4;
  case 5: goto old_Gnew_addr_return_5;
  default: goto old_Gnew_addr_return_6;
  }}

 relocateD0: {
  address_416X = merged_arg0K0;{
  address_741X = (((char *) (-3 + address_416X))) + -4;
  if ((0 == (((long) address_741X)))) {
    arg0K0 = -1;
    goto L12959;}
  else {
    arg0K0 = (((long) address_741X));
    goto L12959;}}
 L12959: {
  v_742X = arg0K0;
  image_location_743X = table_ref(stob_table_415X, v_742X);
  relocateD00_return_value = (3 + (((long) ((((char *) (image_location_743X->new_descriptor))) + 4))));
  goto relocateD0_return;}
 relocateD0_return:
  switch (relocateD0_return_tag) {
  case 0: goto relocateD0_return_0;
  default: goto relocateD0_return_1;
  }}

 relocate_binding_table_bibopB: {
  table_414X = merged_arg0K0;
  stob_table_415X = merged_arg3K1;{
  if ((3 == (3 & table_414X))) {
    if ((2 == (31 & ((((*((long *) ((((char *) (-3 + table_414X))) + -4))))>>2))))) {
      arg0K0 = 0;
      goto L12989;}
    else {
      goto relocate_binding_table_bibopB_return;}}
  else {
    goto relocate_binding_table_bibopB_return;}}
 L12989: {
  i_744X = arg0K0;
  if ((1024 == i_744X)) {
    goto relocate_binding_table_bibopB_return;}
  else {
    link_745X = *((long *) ((((char *) (-3 + table_414X))) + (((i_744X)<<2))));
    if ((0 == (3 & link_745X))) {
      arg0K0 = (3 + (-4 & link_745X));
      goto L12995;}
    else {
      arg0K0 = link_745X;
      goto L12995;}}}
 L12995: {
  bucket_746X = arg0K0;
  if ((1 == bucket_746X)) {
    goto L12991;}
  else {
    merged_arg0K0 = bucket_746X;
    relocateD0_return_tag = 0;
    goto relocateD0;
   relocateD0_return_0:
    bucket_747X = relocateD00_return_value;
    if ((3 == (3 & bucket_747X))) {
      arg0K0 = (-4 & bucket_747X);
      goto L13000;}
    else {
      arg0K0 = bucket_747X;
      goto L13000;}}}
 L12991: {
  arg0K0 = (1 + i_744X);
  goto L12989;}
 L13000: {
  value_748X = arg0K0;
  *((long *) ((((char *) (-3 + table_414X))) + (((i_744X)<<2)))) = (long) (value_748X);
  arg0K0 = bucket_747X;
  goto L13007;}
 L13007: {
  entry_749X = arg0K0;
  link_750X = *((long *) ((((char *) (-3 + entry_749X))) + 12));
  if ((0 == (3 & link_750X))) {
    arg0K0 = (3 + (-4 & link_750X));
    goto L13011;}
  else {
    arg0K0 = link_750X;
    goto L13011;}}
 L13011: {
  next_751X = arg0K0;
  if ((1 == next_751X)) {
    goto L12991;}
  else {
    merged_arg0K0 = next_751X;
    relocateD0_return_tag = 1;
    goto relocateD0;
   relocateD0_return_1:
    next_752X = relocateD00_return_value;
    if ((3 == (3 & next_752X))) {
      arg0K0 = (-4 & next_752X);
      goto L13016;}
    else {
      arg0K0 = next_752X;
      goto L13016;}}}
 L13016: {
  val_753X = arg0K0;
  *((long *) ((((char *) (-3 + entry_749X))) + 12)) = (long) (val_753X);
  arg0K0 = next_752X;
  goto L13007;}
 relocate_binding_table_bibopB_return:
  switch (relocate_binding_table_bibopB_return_tag) {
  case 0: goto relocate_binding_table_bibopB_return_0;
  default: goto relocate_binding_table_bibopB_return_1;
  }}

 relocate_binding_table_two_spaceB: {
  table_412X = merged_arg0K0;
  delta_413X = merged_arg0K1;{
  if ((3 == (3 & table_412X))) {
    if ((2 == (31 & ((((*((long *) ((((char *) (-3 + table_412X))) + -4))))>>2))))) {
      arg0K0 = 0;
      goto L12758;}
    else {
      goto relocate_binding_table_two_spaceB_return;}}
  else {
    goto relocate_binding_table_two_spaceB_return;}}
 L12758: {
  i_754X = arg0K0;
  if ((1024 == i_754X)) {
    goto relocate_binding_table_two_spaceB_return;}
  else {
    link_755X = *((long *) ((((char *) (-3 + table_412X))) + (((i_754X)<<2))));
    if ((0 == (3 & link_755X))) {
      arg0K0 = (3 + (-4 & link_755X));
      goto L12764;}
    else {
      arg0K0 = link_755X;
      goto L12764;}}}
 L12764: {
  bucket_756X = arg0K0;
  if ((1 == bucket_756X)) {
    goto L12760;}
  else {
    bucket_757X = bucket_756X + delta_413X;
    if ((3 == (3 & bucket_757X))) {
      arg0K0 = (-4 & bucket_757X);
      goto L12769;}
    else {
      arg0K0 = bucket_757X;
      goto L12769;}}}
 L12760: {
  arg0K0 = (1 + i_754X);
  goto L12758;}
 L12769: {
  value_758X = arg0K0;
  *((long *) ((((char *) (-3 + table_412X))) + (((i_754X)<<2)))) = (long) (value_758X);
  arg0K0 = bucket_757X;
  goto L12776;}
 L12776: {
  entry_759X = arg0K0;
  link_760X = *((long *) ((((char *) (-3 + entry_759X))) + 12));
  if ((0 == (3 & link_760X))) {
    arg0K0 = (3 + (-4 & link_760X));
    goto L12780;}
  else {
    arg0K0 = link_760X;
    goto L12780;}}
 L12780: {
  next_761X = arg0K0;
  if ((1 == next_761X)) {
    goto L12760;}
  else {
    next_762X = next_761X + delta_413X;
    if ((3 == (3 & next_762X))) {
      arg0K0 = (-4 & next_762X);
      goto L12785;}
    else {
      arg0K0 = next_762X;
      goto L12785;}}}
 L12785: {
  val_763X = arg0K0;
  *((long *) ((((char *) (-3 + entry_759X))) + 12)) = (long) (val_763X);
  arg0K0 = next_762X;
  goto L12776;}
 relocate_binding_table_two_spaceB_return:
  switch (relocate_binding_table_two_spaceB_return_tag) {
  case 0: goto relocate_binding_table_two_spaceB_return_0;
  default: goto relocate_binding_table_two_spaceB_return_1;
  }}

 reverse_byte_orderB: {
  start_410X = merged_arg1K0;
  end_411X = merged_arg1K1;{
  ps_write_string("Correcting byte order of resumed image.", (stderr));
  { long ignoreXX;
  PS_WRITE_CHAR(10, (stderr), ignoreXX) }
  arg1K0 = start_410X;
  goto L10459;}
 L10459: {
  ptr_764X = arg1K0;
  if ((ptr_764X < end_411X)) {
    x_765X = *((unsigned char *) ptr_764X);
    *((unsigned char *) ptr_764X) = (unsigned char) ((*((unsigned char *) (ptr_764X + 3))));
    *((unsigned char *) (ptr_764X + 3)) = (unsigned char) (x_765X);
    x_766X = *((unsigned char *) (ptr_764X + 1));
    *((unsigned char *) (ptr_764X + 1)) = (unsigned char) ((*((unsigned char *) (ptr_764X + 2))));
    *((unsigned char *) (ptr_764X + 2)) = (unsigned char) (x_766X);
    value_767X = *((long *) ptr_764X);
    next_768X = ptr_764X + 4;
    if ((2 == (3 & value_767X))) {
      if (((31 & (((value_767X)>>2))) < 16)) {
        arg1K0 = next_768X;
        goto L10459;}
      else {
        arg1K0 = (next_768X + (-4 & (3 + ((long)(((unsigned long)value_767X)>>8)))));
        goto L10459;}}
    else {
      arg1K0 = next_768X;
      goto L10459;}}
  else {
    goto reverse_byte_orderB_return;}}
 reverse_byte_orderB_return:
  switch (reverse_byte_orderB_return_tag) {
  case 0: goto reverse_byte_orderB_return_0;
  default: goto reverse_byte_orderB_return_1;
  }}

 really_read_image_area: {
  new_start_addr_407X = merged_arg1K0;
  img_heap_size_408X = merged_arg0K1;
  port_409X = merged_arg6K2;{
  need_769X = ((img_heap_size_408X)<<2);
  got_770X = ps_read_block(port_409X, ((char *) new_start_addr_407X), need_769X, &eofP_771X, &status_772X);
  if ((status_772X == NO_ERRORS)) {
    if (eofP_771X) {
      arg4K0 = 0;
      arg5K1 = "Premature EOF when reading image file";
      goto L4060;}
    else {
      if ((got_770X < need_769X)) {
        arg4K0 = 0;
        arg5K1 = "Read returned too few bytes";
        goto L4060;}
      else {
        arg4K0 = 1;
        arg5K1 = "";
        goto L4060;}}}
  else {
    SstatusS = status_772X;
    arg4K0 = 0;
    arg5K1 = "Error reading from image file";
    goto L4060;}}
 L4060: {
  okayP_773X = arg4K0;
  string_774X = arg5K1;
  if (okayP_773X) {
    really_read_image_area0_return_value = 0;
    goto really_read_image_area_return;}
  else {
    ps_write_string(string_774X, (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    status_775X = SstatusS;
    if ((status_775X == NO_ERRORS)) {
      goto L4103;}
    else {
      ps_write_string((ps_error_string((SstatusS))), (stderr));
      { long ignoreXX;
      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
      goto L4103;}}}
 L4103: {
  status_776X = ps_close(port_409X);
  if ((status_776X == NO_ERRORS)) {
    really_read_image_area0_return_value = -1;
    goto really_read_image_area_return;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    really_read_image_area0_return_value = -1;
    goto really_read_image_area_return;}}
 really_read_image_area_return:
  switch (really_read_image_area_return_tag) {
  case 0: goto really_read_image_area_return_0;
  case 1: goto really_read_image_area_return_1;
  default: goto really_read_image_area_return_2;
  }}

}void
s48_heap_init(void)
{
Snew_heap_start_addrS = NULL;
Spure_area_countS = 0;
Simpure_area_countS = 0;
Sfinding_typeS = 1;
Sheap_errors_leftS = 0;
Sgc_countS = 0;
Sgc_secondsS = 0;
Sgc_msecondsS = 0;
SstatusS = NO_ERRORS;
SeofPS = 0;
Sstartup_procedureS = 0;
SsymbolsS = 0;
Simported_bindingsS = 0;
Sexported_bindingsS = 0;
Sresumer_recordsS = 0;
Simg_start_addrS = NULL;
Simg_end_addrS = NULL;
Simg_heap_sizeS = 0;
Ssmall_img_start_addrS = NULL;
Ssmall_img_hp_addrS = NULL;
Ssmall_img_end_addrS = NULL;
Ssmall_img_heap_sizeS = 0;
Slarge_img_start_addrS = NULL;
Slarge_img_hp_addrS = NULL;
Slarge_img_end_addrS = NULL;
Slarge_img_heap_sizeS = 0;
Sweaks_img_start_addrS = NULL;
Sweaks_img_hp_addrS = NULL;
Sweaks_img_end_addrS = NULL;
Sweaks_img_heap_sizeS = 0;
SoffsetS = 0;
SinitializingPS = 1;
SstatusS = NO_ERRORS;
image_start_address = 0;
Hthe_record_type270 = 1;
}
