#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "prescheme.h"
#include <string.h>
#include <stdlib.h>
#include "scheme48vm.h"
#include "scheme48heap.h"
#include "scheme48write-barrier.h"
#include "bibop/bibop.h"

struct image_location {
  long new_descriptor;
  long next;
};
struct table {
  long *keys;
  struct image_location **values;
  long count;
  long size;
};
struct bibop_areas {
  long *small;
  long small_index;
  long *large;
  long large_index;
  long *weaks;
  long weaks_index;
};
static struct image_location *table_ref(struct table*, long);
static long image_alloc(long, long);
static void write_descriptor(long);
static void table_setB(struct table*, long, struct image_location*);
static char resumer_recordP(long);
static long trace_image_value(long);
long s48_max_heap_size(void);
void s48_set_max_heap_sizeB(long);
long s48_min_heap_size(void);
char * s48_get_new_small_start_addr(void);
void s48_set_new_small_start_addrB(char *);
char * s48_get_new_large_start_addr(void);
void s48_set_new_large_start_addrB(char *);
char * s48_get_new_weaks_start_addr(void);
void s48_set_new_weaks_start_addrB(char *);
void s48_initialization_completeB(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_initializing_gc_root(void);
void s48_set_image_valuesB(long, long, long, long, long);
void s48_trace_continuation_contentsB(char *, char *, long);
long s48_allocate_stob(long, long);
void s48_trace_continuation(char *, long);
long s48_read_image(char*, long);
long s48_write_image(long, long, FILE *);
static long Smax_heap_sizeS;
static long Smin_heap_sizeS;
static char * Snew_small_start_addrS;
static char * Snew_large_start_addrS;
static char * Snew_weaks_start_addrS;
static char * *Spure_areasS;
static char * *Simpure_areasS;
static long *Spure_sizesS;
static long *Simpure_sizesS;
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 small_image_start_address;
static char * Ssmall_image_beginS;
static char * Ssmall_image_hpS;
static char * Ssmall_image_endS;
static char * Slarge_image_beginS;
static char * Slarge_image_hpS;
static char * Slarge_image_endS;
static char * Sweaks_image_beginS;
static char * Sweaks_image_hpS;
static char * Sweaks_image_endS;
static struct bibop_areas *Sbibop_areasS;
static char Straced_last_stobPS;
static long Sstob_table_obj_nrS;
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 struct image_location *table_ref(struct table *table_0X, long key_1X)
{
  long arg0K0;
  long next_5X;
  long i_4X;
  long *keys_3X;
  long size_2X;
 {  if ((0 < (table_0X->size))) {
    size_2X = table_0X->size;
    keys_3X = table_0X->keys;
    arg0K0 = ((key_1X ^ ((((key_1X)<<1)) ^ (((key_1X)>>10)))) & (-1 + size_2X));
    goto L3752;}
  else {
    return (NULL);}}
 L3752: {
  i_4X = arg0K0;
  next_5X = *(keys_3X + i_4X);
  if ((key_1X == next_5X)) {
    return (*((table_0X->values) + i_4X));}
  else {
    if ((0 == next_5X)) {
      if ((i_4X == (table_0X->size))) {
        arg0K0 = 0;
        goto L3752;}
      else {
        return (NULL);}}
    else {
      arg0K0 = (1 + i_4X);
      goto L3752;}}}
}
static long image_alloc(long type_size_6X, long length_in_a_units_7X)
{
  char * arg1K0;
  char * data_addr_9X;
  char * image_hp_8X;
 {  if ((0 == type_size_6X)) {
    arg1K0 = (Ssmall_image_hpS);
    goto L4264;}
  else {
    if ((1 == type_size_6X)) {
      arg1K0 = (Slarge_image_hpS);
      goto L4264;}
    else {
      if ((2 == type_size_6X)) {
        arg1K0 = (Sweaks_image_hpS);
        goto L4264;}
      else {
        ps_error("invalid area tag", 0);
        arg1K0 = (Sweaks_image_hpS);
        goto L4264;}}}}
 L4264: {
  image_hp_8X = arg1K0;
  data_addr_9X = image_hp_8X + 4;
  if ((0 == type_size_6X)) {
    Ssmall_image_hpS = (data_addr_9X + length_in_a_units_7X);
    goto L4283;}
  else {
    if ((1 == type_size_6X)) {
      Slarge_image_hpS = (data_addr_9X + length_in_a_units_7X);
      goto L4283;}
    else {
      if ((2 == type_size_6X)) {
        Sweaks_image_hpS = (data_addr_9X + length_in_a_units_7X);
        goto L4283;}
      else {
        goto L4283;}}}}
 L4283: {
  return (3 + (((long) data_addr_9X)));}
}
static void write_descriptor(long descriptor_10X)
{
  long have_11X;
 {  *((long *) (Simage_buffer_pointerS)) = (long) (descriptor_10X);
  Simage_buffer_pointerS = ((Simage_buffer_pointerS) + 4);
  if ((4096 == ((Simage_buffer_pointerS) - (Simage_bufferS)))) {
    have_11X = (Simage_buffer_pointerS) - (Simage_bufferS);
    if ((0 < have_11X)) {
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_11X));
        goto L7312;}
      else {
        goto L7312;}}
    else {
      return;}}
  else {
    return;}}
 L7312: {
  Simage_buffer_pointerS = (Simage_bufferS);
  return;}
}
static void table_setB(struct table *table_12X, long key_13X, struct image_location *value_14X)
{
  long arg0K0;
  long i_30X;
  struct image_location *value_29X;
  long key_28X;
  long i_27X;
  long i_26X;
  struct image_location **new_values_25X;
  long *new_keys_24X;
  long new_size_23X;
  struct image_location **old_values_22X;
  long v_21X;
  long old_size_20X;
  long *old_keys_19X;
  long next_18X;
  long i_17X;
  long *keys_16X;
  long size_15X;
 {  if ((0 < (table_12X->size))) {
    size_15X = table_12X->size;
    keys_16X = table_12X->keys;
    arg0K0 = ((key_13X ^ ((((key_13X)<<1)) ^ (((key_13X)>>10)))) & (-1 + size_15X));
    goto L7807;}
  else {
    return;}}
 L7807: {
  i_17X = arg0K0;
  next_18X = *(keys_16X + i_17X);
  if ((key_13X == next_18X)) {
    *((table_12X->values) + i_17X) = value_14X;
    return;}
  else {
    if ((0 == next_18X)) {
      if ((i_17X == (table_12X->size))) {
        arg0K0 = 0;
        goto L7807;}
      else {
        *((table_12X->keys) + i_17X) = key_13X;
        *((table_12X->values) + i_17X) = value_14X;
        table_12X->count = (1 + (table_12X->count));
        if (((table_12X->count) == ((table_12X->size) / 3))) {
          old_keys_19X = table_12X->keys;
          old_size_20X = table_12X->size;
          v_21X = table_12X->size;
          old_values_22X = table_12X->values;
          new_size_23X = ((v_21X)<<1);
          new_keys_24X = (long*)malloc(sizeof(long) * (1 + new_size_23X));
          new_values_25X = (struct image_location**)malloc(sizeof(struct image_location*) * new_size_23X);
          if ((NULL == new_keys_24X)) {
            goto L5413;}
          else {
            if ((NULL == new_values_25X)) {
              goto L5413;}
            else {
              table_12X->keys = new_keys_24X;
              table_12X->values = new_values_25X;
              table_12X->size = new_size_23X;
              table_12X->count = 0;
              arg0K0 = 0;
              goto L5566;}}}
        else {
          return;}}}
    else {
      arg0K0 = (1 + i_17X);
      goto L7807;}}}
 L5413: {
  if ((NULL == new_keys_24X)) {
    goto L5421;}
  else {
    free(new_keys_24X);
    goto L5421;}}
 L5566: {
  i_26X = arg0K0;
  if ((i_26X < (1 + new_size_23X))) {
    *(new_keys_24X + i_26X) = 0;
    arg0K0 = (1 + i_26X);
    goto L5566;}
  else {
    arg0K0 = 0;
    goto L5444;}}
 L5421: {
  if ((NULL == new_values_25X)) {
    goto L5429;}
  else {
    free(new_values_25X);
    goto L5429;}}
 L5444: {
  i_27X = arg0K0;
  if ((i_27X == old_size_20X)) {
    free(old_keys_19X);
    free(old_values_22X);
    return;}
  else {
    key_28X = *(old_keys_19X + i_27X);
    if ((0 == key_28X)) {
      goto L5460;}
    else {
      value_29X = *(old_values_22X + i_27X);
      arg0K0 = ((key_28X ^ ((((key_28X)<<1)) ^ (((key_28X)>>10)))) & (-1 + new_size_23X));
      goto L5588;}}}
 L5429: {
  table_12X->size = 0;
  return;}
 L5460: {
  arg0K0 = (1 + i_27X);
  goto L5444;}
 L5588: {
  i_30X = arg0K0;
  if ((0 == (*(new_keys_24X + i_30X)))) {
    if ((i_30X == new_size_23X)) {
      arg0K0 = 0;
      goto L5588;}
    else {
      *(new_keys_24X + i_30X) = key_28X;
      *(new_values_25X + i_30X) = value_29X;
      goto L5460;}}
  else {
    arg0K0 = (1 + i_30X);
    goto L5588;}}
}
static char resumer_recordP(long stob_31X)
{
  long type_32X;
 {  if ((3 == (3 & stob_31X))) {
    if ((9 == (31 & ((((*((long *) ((((char *) (-3 + stob_31X))) + -4))))>>2))))) {
      type_32X = *((long *) (((char *) (-3 + stob_31X))));
      if ((3 == (3 & type_32X))) {
        if ((9 == (31 & ((((*((long *) ((((char *) (-3 + type_32X))) + -4))))>>2))))) {
          return (3 == (3 & (*((long *) ((((char *) (-3 + type_32X))) + 4)))));}
        else {
          return 0;}}
      else {
        return 0;}}
    else {
      return 0;}}
  else {
    return 0;}}
}
static long trace_image_value(long thing_33X)
{
  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_34X;
  long header_57X;
  long type_size_56X;
  char v_55X;
  long x_54X;
  struct image_location *new_53X;
  long new_descriptor_52X;
  struct image_location *new_51X;
  struct image_location *image_location_50X;
  long new_descriptor_49X;
  long v_48X;
  long h_47X;
  long stob_46X;
  struct image_location *image_location_45X;
  long new_alias_44X;
  char * addr_43X;
  long x_42X;
  long i_41X;
  long len_40X;
  long vector_39X;
  char v_38X;
  long type_37X;
  char v_36X;
  struct image_location *have_35X;
 {  if ((3 == (3 & thing_33X))) {
    have_35X = table_ref((Sstob_tableS), thing_33X);
    if ((NULL == have_35X)) {
      merged_arg0K0 = thing_33X;
      gc_recordP_return_tag = 0;
      goto gc_recordP;
     gc_recordP_return_0:
      v_36X = gc_recordP0_return_value;
      if (v_36X) {
        type_37X = *((long *) (((char *) (-3 + thing_33X))));
        merged_arg0K0 = type_37X;
        gc_recordP_return_tag = 1;
        goto gc_recordP;
       gc_recordP_return_1:
        v_38X = gc_recordP0_return_value;
        if (v_38X) {
          if ((1 == (*((long *) ((((char *) (-3 + type_37X))) + 4))))) {
            if (((Sundumpable_countS) < ((((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + (Sundumpable_recordsS)))) + -4))))>>8))))>>2)))) {
              vector_39X = Sundumpable_recordsS;
              len_40X = (((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + vector_39X))) + -4))))>>8))))>>2);
              arg0K0 = 0;
              goto L12238;}
            else {
              goto L15569;}}
          else {
            arg0K0 = thing_33X;
            goto L13035;}}
        else {
          arg0K0 = thing_33X;
          goto L13035;}}
      else {
        arg0K0 = thing_33X;
        goto L13035;}}
    else {
      return (have_35X->new_descriptor);}}
  else {
    return thing_33X;}}
 L12238: {
  i_41X = arg0K0;
  if ((i_41X == len_40X)) {
    x_42X = Sundumpable_recordsS;
    addr_43X = (((char *) (-3 + x_42X))) + ((((Sundumpable_countS))<<2));S48_WRITE_BARRIER(x_42X, addr_43X, thing_33X);
    *((long *) addr_43X) = (long) (thing_33X);
    Sundumpable_countS = (1 + (Sundumpable_countS));
    goto L15569;}
  else {
    if (((*((long *) ((((char *) (-3 + vector_39X))) + (((i_41X)<<2))))) == thing_33X)) {
      goto L15569;}
    else {
      arg0K0 = (1 + i_41X);
      goto L12238;}}}
 L15569: {
  new_alias_44X = trace_image_value((*((long *) ((((char *) (-3 + thing_33X))) + 4))));
  image_location_45X = (struct image_location*)malloc(sizeof(struct image_location));
  if ((NULL == image_location_45X)) {
    arg2K0 = image_location_45X;
    goto L15573;}
  else {
    image_location_45X->new_descriptor = new_alias_44X;
    image_location_45X->next = 0;
    arg2K0 = image_location_45X;
    goto L15573;}}
 L13035: {
  stob_46X = arg0K0;
  h_47X = *((long *) ((((char *) (-3 + stob_46X))) + -4));
  v_48X = s48_area_type_size(stob_46X);
  new_descriptor_49X = image_alloc(v_48X, (-4 & (3 + ((long)(((unsigned long)h_47X)>>8)))));
  image_location_50X = (struct image_location*)malloc(sizeof(struct image_location));
  if ((NULL == image_location_50X)) {
    arg0K0 = new_descriptor_49X;
    arg2K1 = image_location_50X;
    goto L13039;}
  else {
    image_location_50X->new_descriptor = new_descriptor_49X;
    image_location_50X->next = 0;
    arg0K0 = new_descriptor_49X;
    arg2K1 = image_location_50X;
    goto L13039;}}
 L15573: {
  new_51X = arg2K0;
  if ((NULL == new_51X)) {
    (Sstob_tableS)->size = 0;
    return new_alias_44X;}
  else {table_setB((Sstob_tableS), thing_33X, new_51X);
    return new_alias_44X;}}
 L13039: {
  new_descriptor_52X = arg0K0;
  new_53X = arg2K1;
  if ((NULL == new_53X)) {
    (Sstob_tableS)->size = 0;
    return new_descriptor_52X;}
  else {
    x_54X = Sfirst_stobS;
    if ((1 == x_54X)) {
      Sfirst_stobS = stob_46X;
      goto L13060;}
    else {
      (Slast_stobS)->next = stob_46X;
      goto L13060;}}}
 L13060: {
  Slast_stobS = new_53X;
  new_53X->next = 1;table_setB((Sstob_tableS), stob_46X, new_53X);
  v_55X = resumer_recordP(stob_46X);
  if (v_55X) {
    Sresumer_countS = (1 + (Sresumer_countS));
    goto L13076;}
  else {
    goto L13076;}}
 L13076: {
  Sstob_table_obj_nrS = (1 + (Sstob_table_obj_nrS));
  type_size_56X = s48_area_type_size(stob_46X);
  if ((0 == type_size_56X)) {
    if ((Straced_last_stobPS)) {
      *(((Sbibop_areasS)->small) + ((Sbibop_areasS)->small_index)) = 1;
      (Sbibop_areasS)->small_index = (1 + ((Sbibop_areasS)->small_index));
      goto L4387;}
    else {
      goto L4387;}}
  else {
    if ((1 == type_size_56X)) {
      if ((Straced_last_stobPS)) {
        *(((Sbibop_areasS)->large) + ((Sbibop_areasS)->large_index)) = 1;
        (Sbibop_areasS)->large_index = (1 + ((Sbibop_areasS)->large_index));
        goto L4403;}
      else {
        goto L4403;}}
    else {
      if ((2 == type_size_56X)) {
        if ((Straced_last_stobPS)) {
          *(((Sbibop_areasS)->weaks) + ((Sbibop_areasS)->weaks_index)) = 1;
          (Sbibop_areasS)->weaks_index = (1 + ((Sbibop_areasS)->weaks_index));
          goto L4419;}
        else {
          goto L4419;}}
      else {
        ps_error("Unexpected area type size!", 0);
        return new_descriptor_52X;}}}}
 L4387: {
  *(((Sbibop_areasS)->small) + ((Sbibop_areasS)->small_index)) = stob_46X;
  (Sbibop_areasS)->small_index = (1 + ((Sbibop_areasS)->small_index));
  return new_descriptor_52X;}
 L4403: {
  *(((Sbibop_areasS)->large) + ((Sbibop_areasS)->large_index)) = stob_46X;
  (Sbibop_areasS)->large_index = (1 + ((Sbibop_areasS)->large_index));
  return new_descriptor_52X;}
 L4419: {
  *(((Sbibop_areasS)->weaks) + ((Sbibop_areasS)->weaks_index)) = stob_46X;
  (Sbibop_areasS)->weaks_index = (1 + ((Sbibop_areasS)->weaks_index));
  return new_descriptor_52X;}
 gc_recordP: {
  x_34X = merged_arg0K0;{
  if ((3 == (3 & x_34X))) {
    header_57X = *((long *) ((((char *) (-3 + x_34X))) + -4));
    if ((3 == (3 & header_57X))) {
      if ((3 == (3 & header_57X))) {
        gc_recordP0_return_value = (9 == (31 & ((((*((long *) ((((char *) (-3 + header_57X))) + -4))))>>2))));
        goto gc_recordP_return;}
      else {
        gc_recordP0_return_value = 0;
        goto gc_recordP_return;}}
    else {
      if ((3 == (3 & x_34X))) {
        gc_recordP0_return_value = (9 == (31 & ((((*((long *) ((((char *) (-3 + x_34X))) + -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;
  }}

}
long s48_max_heap_size(void)
{

 {  return (Smax_heap_sizeS);}
}
void s48_set_max_heap_sizeB(long size_58X)
{

 {  Smax_heap_sizeS = size_58X;
  return;}
}
long s48_min_heap_size(void)
{

 {  return (Smin_heap_sizeS);}
}
char * s48_get_new_small_start_addr(void)
{

 {  return (Snew_small_start_addrS);}
}
void s48_set_new_small_start_addrB(char * addr_59X)
{

 {  Snew_small_start_addrS = addr_59X;
  return;}
}
char * s48_get_new_large_start_addr(void)
{

 {  return (Snew_large_start_addrS);}
}
void s48_set_new_large_start_addrB(char * addr_60X)
{

 {  Snew_large_start_addrS = addr_60X;
  return;}
}
char * s48_get_new_weaks_start_addr(void)
{

 {  return (Snew_weaks_start_addrS);}
}
void s48_set_new_weaks_start_addrB(char * addr_61X)
{

 {  Snew_weaks_start_addrS = addr_61X;
  return;}
}
void s48_initialization_completeB(void)
{

 {  SinitializingPS = 0;
  return;}
}
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_initializing_gc_root(void)
{
  long expr_66X;
  long expr_65X;
  long expr_64X;
  long expr_63X;
  long expr_62X;
 {  if ((SinitializingPS)) {
    expr_62X = s48_trace_value((Sstartup_procedureS));
    Sstartup_procedureS = expr_62X;
    expr_63X = s48_trace_value((SsymbolsS));
    SsymbolsS = expr_63X;
    expr_64X = s48_trace_value((Simported_bindingsS));
    Simported_bindingsS = expr_64X;
    expr_65X = s48_trace_value((Sexported_bindingsS));
    Sexported_bindingsS = expr_65X;
    expr_66X = s48_trace_value((Sresumer_recordsS));
    Sresumer_recordsS = expr_66X;
    return;}
  else {
    return;}}
}
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;}
}
void s48_trace_continuation_contentsB(char * contents_pointer_72X, char * code_pointer_73X, long mask_size_74X)
{
  char * arg1K0;
  char * arg1K1;
  long arg0K0;
  long x2_80X;
  char * ptr_79X;
  long mask_78X;
  char * trace_ptr_77X;
  char * mask_ptr_76X;
  char * mask_pointer_75X;
 {  mask_pointer_75X = code_pointer_73X + -7;
  arg1K0 = (mask_pointer_75X + (0 - mask_size_74X));
  arg1K1 = contents_pointer_72X;
  goto L3169;}
 L3169: {
  mask_ptr_76X = arg1K0;
  trace_ptr_77X = arg1K1;
  if ((mask_ptr_76X == mask_pointer_75X)) {
    return;}
  else {
    arg0K0 = (*((unsigned char *) mask_ptr_76X));
    arg1K1 = trace_ptr_77X;
    goto L3177;}}
 L3177: {
  mask_78X = arg0K0;
  ptr_79X = arg1K1;
  if ((0 == mask_78X)) {
    arg1K0 = (mask_ptr_76X + 1);
    arg1K1 = (trace_ptr_77X + 32);
    goto L3169;}
  else {
    if ((1 == (1 & mask_78X))) {
      x2_80X = s48_trace_value((*((long *) ptr_79X)));
      *((long *) ptr_79X) = (long) (x2_80X);
      goto L3195;}
    else {
      goto L3195;}}}
 L3195: {
  arg0K0 = (((mask_78X)>>1));
  arg1K1 = (ptr_79X + 4);
  goto L3177;}
}
long s48_allocate_stob(long type_81X, long size_82X)
{
  long arg0K0;
  char * arg1K0;
  char * thing_88X;
  char * v_87X;
  char * v_86X;
  long needed_85X;
  long length_in_bytes_84X;
  char tracedP_83X;
 {  tracedP_83X = type_81X < 16;
  if (tracedP_83X) {
    arg0K0 = (((size_82X)<<2));
    goto L4164;}
  else {
    arg0K0 = size_82X;
    goto L4164;}}
 L4164: {
  length_in_bytes_84X = arg0K0;
  needed_85X = 4 + length_in_bytes_84X;
  if (tracedP_83X) {
    v_86X = s48_allocate_tracedAgc(needed_85X);
    arg1K0 = v_86X;
    goto L4180;}
  else {
    v_87X = s48_allocate_untracedAgc(needed_85X);
    arg1K0 = v_87X;
    goto L4180;}}
 L4180: {
  thing_88X = arg1K0;
  if ((thing_88X == NULL)) {
    ps_error("insufficient heap space for external allocation", 0);
    goto L4192;}
  else {
    goto L4192;}}
 L4192: {
  *((long *) thing_88X) = (long) ((2 + (((((((length_in_bytes_84X)<<6)) + type_81X))<<2))));
  return (3 + (((long) (thing_88X + 4))));}
}
void s48_trace_continuation(char * contents_pointer_89X, long size_90X)
{
  char * data_pointer_93X;
  long mask_size_92X;
  char * code_pointer_91X;
 {  code_pointer_91X = (((char *) (-3 + (*((long *) (contents_pointer_89X + 4)))))) + ((((*((long *) contents_pointer_89X)))>>2));
  mask_size_92X = *((unsigned char *) (code_pointer_91X + -3));
  if ((0 == mask_size_92X)) {s48_trace_locationsB(contents_pointer_89X, (contents_pointer_89X + size_90X));
    return;}
  else {
    data_pointer_93X = contents_pointer_89X + 12;s48_trace_locationsB(contents_pointer_89X, data_pointer_93X);s48_trace_continuation_contentsB(data_pointer_93X, code_pointer_91X, mask_size_92X);
    return;}}
}
long s48_read_image(char *image_filename_94X, long max_heap_size_95X)
{
  struct image_location *arg2K0;
  struct table *arg5K0;
  char *arg4K1;
  char arg3K1;
  char arg3K0;
  char * arg1K0;
  long arg0K2;
  long arg0K1;
  long arg0K0;
  struct table *merged_arg5K1;
  FILE * merged_arg6K2;
  long merged_arg0K2;
  long merged_arg0K0;
  long merged_arg0K1;
  char * merged_arg1K2;
  char * merged_arg1K1;
  char * merged_arg1K0;

  int really_read_image_area_return_tag;
  long really_read_image_area0_return_value;
  int read_image_area_return_tag;
  long read_image_area0_return_value;
  int reverse_byte_orderB_return_tag;
  int relocate_image_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 parse_reachable_objects_return_tag;
  long parse_reachable_objects0_return_value;
  int relocateD1_return_tag;
  long relocateD10_return_value;
  char * new_start_addr_96X;
  long img_heap_size_97X;
  FILE * port_98X;
  char * new_start_addr_99X;
  long img_heap_size_100X;
  FILE * port_101X;
  char * start_102X;
  char * end_103X;
  long delta_104X;
  char * start_105X;
  char * end_106X;
  long table_107X;
  long delta_108X;
  long table_109X;
  struct table *stob_table_110X;
  long address_111X;
  char * addr_112X;
  long format_113X;
  char * from_addr_114X;
  char * to_addr_115X;
  long image_format_116X;
  long address_117X;
  long status_497X;
  long status_496X;
  char *string_495X;
  char okayP_494X;
  long status_493X;
  char eofP_492X;
  long got_491X;
  long need_490X;
  long status_489X;
  long status_488X;
  char *string_487X;
  char okayP_486X;
  long status_485X;
  char eofP_484X;
  long got_483X;
  long need_482X;
  char * next_481X;
  long value_480X;
  long x_479X;
  long x_478X;
  char * ptr_477X;
  long d_476X;
  long descriptor_475X;
  char * ptr_474X;
  char * addr_473X;
  long val_472X;
  long next_471X;
  long next_470X;
  long link_469X;
  long entry_468X;
  char * addr_467X;
  long value_466X;
  long bucket_465X;
  long bucket_464X;
  long link_463X;
  long i_462X;
  char * addr_461X;
  long val_460X;
  long next_459X;
  long next_458X;
  long link_457X;
  long entry_456X;
  char * addr_455X;
  long value_454X;
  long bucket_453X;
  long bucket_452X;
  long link_451X;
  long i_450X;
  struct image_location *image_location_449X;
  long v_448X;
  char * address_447X;
  char * y_446X;
  char * y_445X;
  char * v_444X;
  char * y_443X;
  char * index_442X;
  long v_441X;
  long v_440X;
  char * v_439X;
  long v_438X;
  char * new_address_437X;
  struct image_location *image_location_436X;
  long v_435X;
  struct image_location *val_434X;
  struct image_location *image_location_433X;
  long v_432X;
  char * v_431X;
  long v_430X;
  struct image_location *val_429X;
  struct image_location *val_428X;
  struct image_location *image_location_427X;
  char * new_address_426X;
  struct image_location *v_425X;
  long v_424X;
  char * address_423X;
  struct image_location *val_422X;
  struct image_location *image_location_421X;
  char * new_address_420X;
  struct image_location *image_location_419X;
  char * new_address_418X;
  long size_in_cells_417X;
  struct image_location *v_416X;
  long v_415X;
  struct image_location *image_location_414X;
  char * new_address_413X;
  long size_in_bytes_412X;
  long size_in_cells_411X;
  long header_cell_410X;
  char * x1_409X;
  char * current_addr_408X;
  struct image_location *v_407X;
  long v_406X;
  char * current_addr_405X;
  long size_in_cells_404X;
  long cell_403X;
  char * x1_402X;
  char * current_addr_401X;
  struct image_location *image_location_400X;
  long v_399X;
  char * address_398X;
  char * addr_397X;
  long val_396X;
  long next_395X;
  long next_394X;
  struct image_location *image_location_393X;
  long v_392X;
  char * addr_391X;
  long val_390X;
  long link_389X;
  long entry_388X;
  char * address_387X;
  long cell_386X;
  long size_385X;
  char * address_384X;
  long i_383X;
  long next_382X;
  long next_381X;
  char * addr_380X;
  long value_379X;
  long cell_378X;
  long resumer_records_377X;
  long expr_376X;
  struct image_location **values_375X;
  long *keys_374X;
  struct table *table_373X;
  long link_372X;
  long entry_371X;
  long bucket_370X;
  long bucket_369X;
  long expr_368X;
  long v_367X;
  char * pointer_366X;
  long size_365X;
  long cell_364X;
  char * addr_363X;
  long tab_362X;
  char * addr_361X;
  long value_360X;
  long link_359X;
  long i_358X;
  long expr_357X;
  long v_356X;
  char * pointer_355X;
  long size_354X;
  long cell_353X;
  char * addr_352X;
  long tab_351X;
  long v_350X;
  long bucket_349X;
  long bucket_348X;
  struct table *stob_table_347X;
  long table_346X;
  long expr_345X;
  long v_344X;
  char * pointer_343X;
  long size_342X;
  long cell_341X;
  char * addr_340X;
  long tab_339X;
  long v_338X;
  long link_337X;
  long i_336X;
  long v_335X;
  char * pointer_334X;
  long size_333X;
  long cell_332X;
  char * addr_331X;
  long tab_330X;
  long v_329X;
  struct image_location *image_location_328X;
  long v_327X;
  long table_326X;
  long expr_325X;
  char * address_324X;
  long descriptor_323X;
  long expr_322X;
  long status_321X;
  char eofP_320X;
  long descriptor_319X;
  long expr_318X;
  long status_317X;
  long status_316X;
  long status_315X;
  char * v_314X;
  char * v_313X;
  long expr_312X;
  long status_311X;
  long status_310X;
  char eofP_309X;
  char ch_308X;
  long we_307X;
  long cells_306X;
  long descriptor_305X;
  long expr_304X;
  long status_303X;
  long status_302X;
  long status_301X;
  long status_300X;
  long status_299X;
  long status_298X;
  char eofP_297X;
  char v_296X;
  long expr_295X;
  long status_294X;
  char *string_293X;
  char okayP_292X;
  long expr_291X;
  long status_290X;
  char eofP_289X;
  long thing_288X;
  long status_287X;
  long wh_286X;
  long cells_285X;
  long descriptor_284X;
  long expr_283X;
  long status_282X;
  long expr_281X;
  long expr_280X;
  long expr_279X;
  long status_278X;
  char eofP_277X;
  long got_276X;
  long need_275X;
  struct table *v_274X;
  long status_273X;
  char eofP_272X;
  long thing_271X;
  long status_270X;
  long expr_269X;
  long status_268X;
  char eofP_267X;
  long thing_266X;
  long status_265X;
  long le_264X;
  long cells_263X;
  long status_262X;
  long status_261X;
  long status_260X;
  long expr_259X;
  long descriptor_258X;
  struct table *table_257X;
  long i_256X;
  long status_255X;
  char eofP_254X;
  long thing_253X;
  long status_252X;
  long expr_251X;
  long status_250X;
  char eofP_249X;
  long thing_248X;
  long status_247X;
  long lh_246X;
  long cells_245X;
  long status_244X;
  long status_243X;
  long status_242X;
  long status_241X;
  long status_240X;
  long status_239X;
  long status_238X;
  long *keys_237X;
  char * v_236X;
  long status_235X;
  char eofP_234X;
  long thing_233X;
  long status_232X;
  long expr_231X;
  long status_230X;
  char eofP_229X;
  long thing_228X;
  long status_227X;
  long se_226X;
  long cells_225X;
  long status_224X;
  long status_223X;
  long status_222X;
  long status_221X;
  long status_220X;
  long status_219X;
  char eofP_218X;
  char v_217X;
  long expr_216X;
  long expr_215X;
  long expr_214X;
  char * weaks_new_hp_213X;
  long weaks_delta_212X;
  char * large_new_hp_211X;
  long large_delta_210X;
  char * small_new_hp_209X;
  long small_delta_208X;
  long v_207X;
  char reverse_byte_orderP_206X;
  long status_205X;
  char eofP_204X;
  long thing_203X;
  long status_202X;
  long expr_201X;
  long status_200X;
  char eofP_199X;
  long thing_198X;
  long status_197X;
  long sh_196X;
  long cells_195X;
  long cells_194X;
  long v_193X;
  long x_192X;
  long x_191X;
  long status_190X;
  long status_189X;
  char eofP_188X;
  long thing_187X;
  long status_186X;
  long status_185X;
  char eofP_184X;
  long thing_183X;
  long status_182X;
  long sb_181X;
  long cells_180X;
  long status_179X;
  char eofP_178X;
  long thing_177X;
  long status_176X;
  long cells_175X;
  long status_174X;
  char eofP_173X;
  long got_172X;
  char * new_addr_171X;
  long image_size_170X;
  long format_169X;
  long status_168X;
  long status_167X;
  long status_166X;
  long status_165X;
  long status_164X;
  long status_163X;
  char eofP_162X;
  long thing_161X;
  long status_160X;
  long status_159X;
  char eofP_158X;
  long thing_157X;
  long status_156X;
  long status_155X;
  long status_154X;
  long status_153X;
  long status_152X;
  long status_151X;
  long old_bytes_per_cell_150X;
  long status_149X;
  char eofP_148X;
  char thing_147X;
  long status_146X;
  char eofP_145X;
  long thing_144X;
  long status_143X;
  long format_142X;
  long status_141X;
  char eofP_140X;
  long status_139X;
  char eofP_138X;
  char ch_137X;
  long i_136X;
  long status_135X;
  char eofP_134X;
  long n_133X;
  long status_132X;
  char same_versionP_131X;
  long status_130X;
  char eofP_129X;
  long status_128X;
  char eofP_127X;
  char ch_126X;
  long status_125X;
  long status_124X;
  char eofP_123X;
  char ch_122X;
  long status_121X;
  long status_120X;
  long status_119X;
  FILE * port_118X;
 {  SstatusS = NO_ERRORS;
  SeofPS = 0;
  port_118X = ps_open_input_file(image_filename_94X, &status_119X);
  if ((status_119X == NO_ERRORS)) {
    status_120X = SstatusS;
    if ((status_120X == NO_ERRORS)) {
      if ((SeofPS)) {
        goto L7912;}
      else {
        goto L9435;}}
    else {
      goto L7912;}}
  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_119X)), (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    return -1;}}
 L7912: {
  status_121X = SstatusS;
  if ((status_121X == NO_ERRORS)) {
    if ((SeofPS)) {
      goto L7963;}
    else {
      goto L9355;}}
  else {
    goto L7963;}}
 L9435: {
  PS_READ_CHAR(port_118X, ch_122X, eofP_123X, status_124X)
  if (eofP_123X) {
    arg3K0 = eofP_123X;
    arg0K1 = status_124X;
    goto L7886;}
  else {
    if ((status_124X == NO_ERRORS)) {
      if ((12 == ch_122X)) {
        arg3K0 = 0;
        arg0K1 = status_124X;
        goto L7886;}
      else {
        goto L9435;}}
    else {
      arg3K0 = eofP_123X;
      arg0K1 = status_124X;
      goto L7886;}}}
 L7963: {
  status_125X = SstatusS;
  if ((status_125X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg3K0 = 0;
      goto L8014;}
    else {
      arg0K0 = 0;
      goto L9289;}}
  else {
    arg3K0 = 0;
    goto L8014;}}
 L9355: {
  PS_READ_CHAR(port_118X, ch_126X, eofP_127X, status_128X)
  if (eofP_127X) {
    arg3K0 = eofP_127X;
    arg0K1 = status_128X;
    goto L7937;}
  else {
    if ((status_128X == NO_ERRORS)) {
      if ((10 == ch_126X)) {
        arg3K0 = 0;
        arg0K1 = status_128X;
        goto L7937;}
      else {
        goto L9355;}}
    else {
      arg3K0 = eofP_127X;
      arg0K1 = status_128X;
      goto L7937;}}}
 L7886: {
  eofP_129X = arg3K0;
  status_130X = arg0K1;
  if (eofP_129X) {
    SeofPS = 1;
    goto L7912;}
  else {
    if ((status_130X == NO_ERRORS)) {
      goto L7912;}
    else {
      SeofPS = 1;
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = status_130X;
        goto L7912;}
      else {
        goto L7912;}}}}
 L8014: {
  same_versionP_131X = arg3K0;
  status_132X = SstatusS;
  if ((status_132X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L8067;}
    else {
      PS_READ_INTEGER(port_118X, n_133X, eofP_134X, status_135X)
      if (eofP_134X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L8067;}
      else {
        if ((status_135X == NO_ERRORS)) {
          arg0K0 = n_133X;
          goto L8067;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_135X;
            arg0K0 = -1;
            goto L8067;}
          else {
            arg0K0 = -1;
            goto L8067;}}}}}
  else {
    arg0K0 = -1;
    goto L8067;}}
 L9289: {
  i_136X = arg0K0;
  PS_READ_CHAR(port_118X, ch_137X, eofP_138X, status_139X)
  if (eofP_138X) {
    arg3K0 = 0;
    arg3K1 = eofP_138X;
    arg0K2 = status_139X;
    goto L7988;}
  else {
    if ((status_139X == NO_ERRORS)) {
      if ((i_136X == (strlen((char *) "Vanilla 33")))) {
        arg3K0 = (10 == ch_137X);
        arg3K1 = 0;
        arg0K2 = status_139X;
        goto L7988;}
      else {
        if ((ch_137X == (*("Vanilla 33" + i_136X)))) {
          arg0K0 = (1 + i_136X);
          goto L9289;}
        else {
          arg3K0 = 0;
          arg3K1 = 0;
          arg0K2 = status_139X;
          goto L7988;}}}
    else {
      arg3K0 = 0;
      arg3K1 = eofP_138X;
      arg0K2 = status_139X;
      goto L7988;}}}
 L7937: {
  eofP_140X = arg3K0;
  status_141X = arg0K1;
  if (eofP_140X) {
    SeofPS = 1;
    goto L7963;}
  else {
    if ((status_141X == NO_ERRORS)) {
      goto L7963;}
    else {
      SeofPS = 1;
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = status_141X;
        goto L7963;}
      else {
        goto L7963;}}}}
 L8067: {
  format_142X = arg0K0;
  status_143X = SstatusS;
  if ((status_143X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L8120;}
    else {
      PS_READ_INTEGER(port_118X, thing_144X, eofP_145X, status_146X)
      if (eofP_145X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L8120;}
      else {
        if ((status_146X == NO_ERRORS)) {
          arg0K0 = thing_144X;
          goto L8120;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_146X;
            arg0K0 = -1;
            goto L8120;}
          else {
            arg0K0 = -1;
            goto L8120;}}}}}
  else {
    arg0K0 = -1;
    goto L8120;}}
 L7988: {
  thing_147X = arg3K0;
  eofP_148X = arg3K1;
  status_149X = arg0K2;
  if (eofP_148X) {
    SeofPS = 1;
    arg3K0 = 0;
    goto L8014;}
  else {
    if ((status_149X == NO_ERRORS)) {
      arg3K0 = thing_147X;
      goto L8014;}
    else {
      SeofPS = 1;
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = status_149X;
        arg3K0 = 0;
        goto L8014;}
      else {
        arg3K0 = 0;
        goto L8014;}}}}
 L8120: {
  old_bytes_per_cell_150X = 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_151X = SstatusS;
      if ((status_151X == NO_ERRORS)) {
        goto L8568;}
      else {
        ps_write_string((ps_error_string((SstatusS))), (stderr));
        { long ignoreXX;
        PS_WRITE_CHAR(10, (stderr), ignoreXX) }
        goto L8568;}}
    else {
      if (same_versionP_131X) {
        if ((0 == format_142X)) {
          goto L8632;}
        else {
          if ((1 == format_142X)) {
            goto L8632;}
          else {
            ps_write_string("Unknown image format", (stderr));
            { long ignoreXX;
            PS_WRITE_CHAR(10, (stderr), ignoreXX) }
            status_152X = SstatusS;
            if ((status_152X == NO_ERRORS)) {
              goto L8643;}
            else {
              ps_write_string((ps_error_string((SstatusS))), (stderr));
              { long ignoreXX;
              PS_WRITE_CHAR(10, (stderr), ignoreXX) }
              goto L8643;}}}}
      else {
        ps_write_string("Format of image is incompatible with this version of system", (stderr));
        { long ignoreXX;
        PS_WRITE_CHAR(10, (stderr), ignoreXX) }
        status_153X = SstatusS;
        if ((status_153X == NO_ERRORS)) {
          goto L8602;}
        else {
          ps_write_string((ps_error_string((SstatusS))), (stderr));
          { long ignoreXX;
          PS_WRITE_CHAR(10, (stderr), ignoreXX) }
          goto L8602;}}}}
  else {
    ps_write_string("Error reading from image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    status_154X = SstatusS;
    if ((status_154X == NO_ERRORS)) {
      goto L8533;}
    else {
      ps_write_string((ps_error_string((SstatusS))), (stderr));
      { long ignoreXX;
      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
      goto L8533;}}}
 L8568: {
  status_155X = ps_close(port_118X);
  if ((status_155X == NO_ERRORS)) {
    arg0K0 = -1;
    arg0K1 = format_142X;
    goto L15056;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    arg0K1 = format_142X;
    goto L15056;}}
 L8632: {
  if ((4 == old_bytes_per_cell_150X)) {
    if ((0 == format_142X)) {
      status_156X = SstatusS;
      if ((status_156X == NO_ERRORS)) {
        if ((SeofPS)) {
          arg0K0 = -1;
          goto L5714;}
        else {
          PS_READ_INTEGER(port_118X, thing_157X, eofP_158X, status_159X)
          if (eofP_158X) {
            SeofPS = 1;
            arg0K0 = -1;
            goto L5714;}
          else {
            if ((status_159X == NO_ERRORS)) {
              arg0K0 = thing_157X;
              goto L5714;}
            else {
              SeofPS = 1;
              if (((SstatusS) == NO_ERRORS)) {
                SstatusS = status_159X;
                arg0K0 = -1;
                goto L5714;}
              else {
                arg0K0 = -1;
                goto L5714;}}}}}
      else {
        arg0K0 = -1;
        goto L5714;}}
    else {
      if ((1 == format_142X)) {
        status_160X = SstatusS;
        if ((status_160X == NO_ERRORS)) {
          if ((SeofPS)) {
            arg0K0 = -1;
            goto L5832;}
          else {
            PS_READ_INTEGER(port_118X, thing_161X, eofP_162X, status_163X)
            if (eofP_162X) {
              SeofPS = 1;
              arg0K0 = -1;
              goto L5832;}
            else {
              if ((status_163X == NO_ERRORS)) {
                arg0K0 = thing_161X;
                goto L5832;}
              else {
                SeofPS = 1;
                if (((SstatusS) == NO_ERRORS)) {
                  SstatusS = status_163X;
                  arg0K0 = -1;
                  goto L5832;}
                else {
                  arg0K0 = -1;
                  goto L5832;}}}}}
        else {
          arg0K0 = -1;
          goto L5832;}}
      else {
        ps_error("check-all-data!: Unknown image format (this can't happen)", 0);
        goto L8162;}}}
  else {
    ps_write_string("Incompatible bytes-per-cell in image", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    status_164X = SstatusS;
    if ((status_164X == NO_ERRORS)) {
      goto L8677;}
    else {
      ps_write_string((ps_error_string((SstatusS))), (stderr));
      { long ignoreXX;
      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
      goto L8677;}}}
 L8643: {
  status_165X = ps_close(port_118X);
  if ((status_165X == NO_ERRORS)) {
    arg0K0 = -1;
    arg0K1 = format_142X;
    goto L15056;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    arg0K1 = format_142X;
    goto L15056;}}
 L8602: {
  status_166X = ps_close(port_118X);
  if ((status_166X == NO_ERRORS)) {
    arg0K0 = -1;
    arg0K1 = format_142X;
    goto L15056;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    arg0K1 = format_142X;
    goto L15056;}}
 L8533: {
  status_167X = ps_close(port_118X);
  if ((status_167X == NO_ERRORS)) {
    arg0K0 = -1;
    arg0K1 = format_142X;
    goto L15056;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    arg0K1 = format_142X;
    goto L15056;}}
 L15056: {
  status_168X = arg0K0;
  format_169X = arg0K1;
  if ((0 == status_168X)) {
    if (((SstatusS) == NO_ERRORS)) {
      image_size_170X = Simg_heap_sizeS;
      Smax_heap_sizeS = max_heap_size_95X;
      Smin_heap_sizeS = (((image_size_170X)<<2));s48_initialize_bibop_heap();
      Spure_areasS = ((char **)malloc(sizeof(char *) * 0));
      Simpure_areasS = (Spure_areasS);
      Spure_sizesS = ((long*)malloc(sizeof(long) * 0));
      Simpure_sizesS = (Spure_sizesS);s48_initialize_image_areas(((Ssmall_img_end_addrS) - (Ssmall_img_start_addrS)), ((Ssmall_img_hp_addrS) - (Ssmall_img_start_addrS)), ((Slarge_img_end_addrS) - (Slarge_img_start_addrS)), ((Slarge_img_hp_addrS) - (Slarge_img_start_addrS)), ((Sweaks_img_end_addrS) - (Sweaks_img_start_addrS)), ((Sweaks_img_hp_addrS) - (Sweaks_img_start_addrS)));s48_check_heap_sizeB();
      if (((SstatusS) == NO_ERRORS)) {
        new_addr_171X = (char *)malloc(4);
        got_172X = ps_read_block(port_118X, ((char *) new_addr_171X), 4, &eofP_173X, &status_174X);
        if ((status_174X == NO_ERRORS)) {
          if (eofP_173X) {
            goto L4594;}
          else {
            if ((got_172X < 4)) {
              goto L4594;}
            else {
              goto L4546;}}}
        else {
          SstatusS = status_174X;
          goto L4594;}}
      else {
        return -1;}}
    else {
      return -1;}}
  else {
    return -1;}}
 L5714: {
  cells_175X = arg0K0;
  Simg_start_addrS = (((char *) (((cells_175X)<<2))));
  status_176X = SstatusS;
  if ((status_176X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L5769;}
    else {
      PS_READ_INTEGER(port_118X, thing_177X, eofP_178X, status_179X)
      if (eofP_178X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L5769;}
      else {
        if ((status_179X == NO_ERRORS)) {
          arg0K0 = thing_177X;
          goto L5769;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_179X;
            arg0K0 = -1;
            goto L5769;}
          else {
            arg0K0 = -1;
            goto L5769;}}}}}
  else {
    arg0K0 = -1;
    goto L5769;}}
 L5832: {
  cells_180X = arg0K0;
  sb_181X = ((cells_180X)<<2);
  status_182X = SstatusS;
  if ((status_182X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L5887;}
    else {
      PS_READ_INTEGER(port_118X, thing_183X, eofP_184X, status_185X)
      if (eofP_184X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L5887;}
      else {
        if ((status_185X == NO_ERRORS)) {
          arg0K0 = thing_183X;
          goto L5887;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_185X;
            arg0K0 = -1;
            goto L5887;}
          else {
            arg0K0 = -1;
            goto L5887;}}}}}
  else {
    arg0K0 = -1;
    goto L5887;}}
 L8162: {
  status_186X = SstatusS;
  if ((status_186X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L8213;}
    else {
      PS_READ_INTEGER(port_118X, thing_187X, eofP_188X, status_189X)
      if (eofP_188X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L8213;}
      else {
        if ((status_189X == NO_ERRORS)) {
          arg0K0 = thing_187X;
          goto L8213;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_189X;
            arg0K0 = -1;
            goto L8213;}
          else {
            arg0K0 = -1;
            goto L8213;}}}}}
  else {
    arg0K0 = -1;
    goto L8213;}}
 L8677: {
  status_190X = ps_close(port_118X);
  if ((status_190X == NO_ERRORS)) {
    arg0K0 = -1;
    arg0K1 = format_142X;
    goto L15056;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    arg0K1 = format_142X;
    goto L15056;}}
 L4594: {
  ps_error("byte order check failed", 0);
  goto L4546;}
 L4546: {
  if ((1 == (*((long *) new_addr_171X)))) {
    free(new_addr_171X);
    arg3K0 = 0;
    goto L15119;}
  else {
    x_191X = *((unsigned char *) new_addr_171X);
    *((unsigned char *) new_addr_171X) = (unsigned char) ((*((unsigned char *) (new_addr_171X + 3))));
    *((unsigned char *) (new_addr_171X + 3)) = (unsigned char) (x_191X);
    x_192X = *((unsigned char *) (new_addr_171X + 1));
    *((unsigned char *) (new_addr_171X + 1)) = (unsigned char) ((*((unsigned char *) (new_addr_171X + 2))));
    *((unsigned char *) (new_addr_171X + 2)) = (unsigned char) (x_192X);
    v_193X = *((long *) new_addr_171X);
    if ((1 == v_193X)) {
      goto L4566;}
    else {
      ps_error("Unable to correct byte order", 0);
      goto L4566;}}}
 L5769: {
  cells_194X = arg0K0;
  Simg_end_addrS = (((char *) (((cells_194X)<<2))));
  Simg_heap_sizeS = ((((3 + ((Simg_end_addrS) - (Simg_start_addrS))))>>2));
  goto L8162;}
 L5887: {
  cells_195X = arg0K0;
  sh_196X = ((cells_195X)<<2);
  status_197X = SstatusS;
  if ((status_197X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L5942;}
    else {
      PS_READ_INTEGER(port_118X, thing_198X, eofP_199X, status_200X)
      if (eofP_199X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L5942;}
      else {
        if ((status_200X == NO_ERRORS)) {
          arg0K0 = thing_198X;
          goto L5942;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_200X;
            arg0K0 = -1;
            goto L5942;}
          else {
            arg0K0 = -1;
            goto L5942;}}}}}
  else {
    arg0K0 = -1;
    goto L5942;}}
 L8213: {
  expr_201X = arg0K0;
  SsymbolsS = expr_201X;
  status_202X = SstatusS;
  if ((status_202X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L8266;}
    else {
      PS_READ_INTEGER(port_118X, thing_203X, eofP_204X, status_205X)
      if (eofP_204X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L8266;}
      else {
        if ((status_205X == NO_ERRORS)) {
          arg0K0 = thing_203X;
          goto L8266;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_205X;
            arg0K0 = -1;
            goto L8266;}
          else {
            arg0K0 = -1;
            goto L8266;}}}}}
  else {
    arg0K0 = -1;
    goto L8266;}}
 L15119: {
  reverse_byte_orderP_206X = arg3K0;
  if ((0 == format_169X)) {
    Sheap_image_pointerS = NULL;
    Ssymbol_addressS = NULL;
    v_207X = SsymbolsS;
    if ((1 == v_207X)) {
      arg1K0 = (Simg_end_addrS);
      goto L7648;}
    else {
      arg1K0 = ((((char *) (-3 + (SsymbolsS)))) + -4);
      goto L7648;}}
  else {
    if ((1 == format_169X)) {
      small_delta_208X = (Snew_small_start_addrS) - (Ssmall_img_start_addrS);
      small_new_hp_209X = (Ssmall_img_hp_addrS) + small_delta_208X;
      large_delta_210X = (Snew_large_start_addrS) - (Slarge_img_start_addrS);
      large_new_hp_211X = (Slarge_img_hp_addrS) + large_delta_210X;
      weaks_delta_212X = (Snew_weaks_start_addrS) - (Sweaks_img_start_addrS);
      weaks_new_hp_213X = (Sweaks_img_hp_addrS) + weaks_delta_212X;
      merged_arg1K0 = (Snew_weaks_start_addrS);
      merged_arg0K1 = (Sweaks_img_heap_sizeS);
      merged_arg6K2 = port_118X;
      read_image_area_return_tag = 0;
      goto read_image_area;
     read_image_area_return_0:
      expr_214X = read_image_area0_return_value;
      if ((0 == expr_214X)) {
        if (((SstatusS) == NO_ERRORS)) {
          merged_arg1K0 = (Snew_large_start_addrS);
          merged_arg0K1 = (Slarge_img_heap_sizeS);
          merged_arg6K2 = port_118X;
          read_image_area_return_tag = 1;
          goto read_image_area;
         read_image_area_return_1:
          expr_215X = read_image_area0_return_value;
          if ((0 == expr_215X)) {
            if (((SstatusS) == NO_ERRORS)) {
              merged_arg1K0 = (Snew_small_start_addrS);
              merged_arg0K1 = (Ssmall_img_heap_sizeS);
              merged_arg6K2 = port_118X;
              read_image_area_return_tag = 2;
              goto read_image_area;
             read_image_area_return_2:
              expr_216X = read_image_area0_return_value;
              if ((0 == expr_216X)) {
                if (((SstatusS) == NO_ERRORS)) {
                  PS_READ_CHAR(port_118X, v_217X, eofP_218X, status_219X)
                  if ((status_219X == NO_ERRORS)) {
                    if (eofP_218X) {
                      status_220X = ps_close(port_118X);
                      if ((status_220X == NO_ERRORS)) {
                        if (reverse_byte_orderP_206X) {
                          merged_arg1K0 = (Snew_small_start_addrS);
                          merged_arg1K1 = small_new_hp_209X;
                          reverse_byte_orderB_return_tag = 0;
                          goto reverse_byte_orderB;
                         reverse_byte_orderB_return_0:
                          merged_arg1K0 = (Snew_large_start_addrS);
                          merged_arg1K1 = large_new_hp_211X;
                          reverse_byte_orderB_return_tag = 1;
                          goto reverse_byte_orderB;
                         reverse_byte_orderB_return_1:
                          merged_arg1K0 = (Snew_weaks_start_addrS);
                          merged_arg1K1 = weaks_new_hp_213X;
                          reverse_byte_orderB_return_tag = 2;
                          goto reverse_byte_orderB;
                         reverse_byte_orderB_return_2:
                          goto L13835;}
                        else {
                          goto L13835;}}
                      else {
                        ps_write_string("Error closing image file", (stderr));
                        { long ignoreXX;
                        PS_WRITE_CHAR(10, (stderr), ignoreXX) }
                        status_221X = SstatusS;
                        if ((status_221X == NO_ERRORS)) {
                          goto L14144;}
                        else {
                          ps_write_string((ps_error_string((SstatusS))), (stderr));
                          { long ignoreXX;
                          PS_WRITE_CHAR(10, (stderr), ignoreXX) }
                          goto L14144;}}}
                    else {
                      ps_write_string("Image file has extraneous data after image", (stderr));
                      { long ignoreXX;
                      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
                      status_222X = SstatusS;
                      if ((status_222X == NO_ERRORS)) {
                        goto L14112;}
                      else {
                        ps_write_string((ps_error_string((SstatusS))), (stderr));
                        { long ignoreXX;
                        PS_WRITE_CHAR(10, (stderr), ignoreXX) }
                        goto L14112;}}}
                  else {
                    ps_write_string("Error reading from image file", (stderr));
                    { long ignoreXX;
                    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
                    status_223X = SstatusS;
                    if ((status_223X == NO_ERRORS)) {
                      goto L14080;}
                    else {
                      ps_write_string((ps_error_string((SstatusS))), (stderr));
                      { long ignoreXX;
                      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
                      goto L14080;}}}
                else {
                  goto L13794;}}
              else {
                goto L13794;}}
            else {
              goto L13788;}}
          else {
            goto L13788;}}
        else {
          goto L13782;}}
      else {
        goto L13782;}}
    else {
      ps_write_string("invalid image format", (stderr));
      { long ignoreXX;
      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
      status_224X = SstatusS;
      if ((status_224X == NO_ERRORS)) {
        goto L15006;}
      else {
        ps_write_string((ps_error_string((SstatusS))), (stderr));
        { long ignoreXX;
        PS_WRITE_CHAR(10, (stderr), ignoreXX) }
        goto L15006;}}}}
 L4566: {
  free(new_addr_171X);
  arg3K0 = 1;
  goto L15119;}
 L5942: {
  cells_225X = arg0K0;
  se_226X = ((cells_225X)<<2);
  status_227X = SstatusS;
  if ((status_227X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L5999;}
    else {
      PS_READ_INTEGER(port_118X, thing_228X, eofP_229X, status_230X)
      if (eofP_229X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L5999;}
      else {
        if ((status_230X == NO_ERRORS)) {
          arg0K0 = thing_228X;
          goto L5999;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_230X;
            arg0K0 = -1;
            goto L5999;}
          else {
            arg0K0 = -1;
            goto L5999;}}}}}
  else {
    arg0K0 = -1;
    goto L5999;}}
 L8266: {
  expr_231X = arg0K0;
  Simported_bindingsS = expr_231X;
  status_232X = SstatusS;
  if ((status_232X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L8319;}
    else {
      PS_READ_INTEGER(port_118X, thing_233X, eofP_234X, status_235X)
      if (eofP_234X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L8319;}
      else {
        if ((status_235X == NO_ERRORS)) {
          arg0K0 = thing_233X;
          goto L8319;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_235X;
            arg0K0 = -1;
            goto L8319;}
          else {
            arg0K0 = -1;
            goto L8319;}}}}}
  else {
    arg0K0 = -1;
    goto L8319;}}
 L7648: {
  v_236X = arg1K0;
  Ssymbol_addressS = v_236X;
  Sheap_object_remaining_cellsS = 0;
  Sheap_object_pointerS = NULL;
  keys_237X = (long*)malloc(sizeof(long) * 4097);
  arg0K0 = 0;
  goto L7671;}
 L13835: {
  if ((small_delta_208X == large_delta_210X)) {
    if ((large_delta_210X == weaks_delta_212X)) {
      goto L13851;}
    else {
      goto L14164;}}
  else {
    goto L14164;}}
 L14144: {
  status_238X = ps_close(port_118X);
  if ((status_238X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L15121;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L15121;}}
 L14112: {
  status_239X = ps_close(port_118X);
  if ((status_239X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L15121;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L15121;}}
 L14080: {
  status_240X = ps_close(port_118X);
  if ((status_240X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L15121;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L15121;}}
 L13794: {
  ps_write_string("error reading small area from image", (stderr));
  { long ignoreXX;
  PS_WRITE_CHAR(10, (stderr), ignoreXX) }
  status_241X = SstatusS;
  if ((status_241X == NO_ERRORS)) {
    goto L14048;}
  else {
    ps_write_string((ps_error_string((SstatusS))), (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    goto L14048;}}
 L13788: {
  ps_write_string("error reading large area from image", (stderr));
  { long ignoreXX;
  PS_WRITE_CHAR(10, (stderr), ignoreXX) }
  status_242X = SstatusS;
  if ((status_242X == NO_ERRORS)) {
    goto L14009;}
  else {
    ps_write_string((ps_error_string((SstatusS))), (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    goto L14009;}}
 L13782: {
  ps_write_string("error reading weaks area from image", (stderr));
  { long ignoreXX;
  PS_WRITE_CHAR(10, (stderr), ignoreXX) }
  status_243X = SstatusS;
  if ((status_243X == NO_ERRORS)) {
    goto L13970;}
  else {
    ps_write_string((ps_error_string((SstatusS))), (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    goto L13970;}}
 L15006: {
  status_244X = ps_close(port_118X);
  if ((status_244X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L15121;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L15121;}}
 L5999: {
  cells_245X = arg0K0;
  lh_246X = ((cells_245X)<<2);
  status_247X = SstatusS;
  if ((status_247X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L6054;}
    else {
      PS_READ_INTEGER(port_118X, thing_248X, eofP_249X, status_250X)
      if (eofP_249X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L6054;}
      else {
        if ((status_250X == NO_ERRORS)) {
          arg0K0 = thing_248X;
          goto L6054;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_250X;
            arg0K0 = -1;
            goto L6054;}
          else {
            arg0K0 = -1;
            goto L6054;}}}}}
  else {
    arg0K0 = -1;
    goto L6054;}}
 L8319: {
  expr_251X = arg0K0;
  Sexported_bindingsS = expr_251X;
  status_252X = SstatusS;
  if ((status_252X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L8372;}
    else {
      PS_READ_INTEGER(port_118X, thing_253X, eofP_254X, status_255X)
      if (eofP_254X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L8372;}
      else {
        if ((status_255X == NO_ERRORS)) {
          arg0K0 = thing_253X;
          goto L8372;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_255X;
            arg0K0 = -1;
            goto L8372;}
          else {
            arg0K0 = -1;
            goto L8372;}}}}}
  else {
    arg0K0 = -1;
    goto L8372;}}
 L7671: {
  i_256X = arg0K0;
  if ((i_256X < 4097)) {
    *(keys_237X + i_256X) = 0;
    arg0K0 = (1 + i_256X);
    goto L7671;}
  else {
    table_257X = (struct table*)malloc(sizeof(struct table));
    if ((NULL == table_257X)) {
      arg5K0 = table_257X;
      goto L7659;}
    else {
      table_257X->keys = keys_237X;
      table_257X->values = ((struct image_location**)malloc(sizeof(struct image_location*) * 4096));
      table_257X->count = 0;
      table_257X->size = 4096;
      arg5K0 = table_257X;
      goto L7659;}}}
 L13851: {
  if ((0 == small_delta_208X)) {
    goto L13905;}
  else {
    descriptor_258X = Sstartup_procedureS;
    if ((3 == (3 & descriptor_258X))) {
      arg0K0 = (3 + (((long) ((((char *) (-3 + descriptor_258X))) + small_delta_208X))));
      goto L13860;}
    else {
      arg0K0 = descriptor_258X;
      goto L13860;}}}
 L14164: {
  ps_error("Bug: Cannot load image, because the deltas of all parts aren't equal. Notify the authors.", 0);
  goto L13851;}
 L15121: {
  expr_259X = arg0K0;
  if ((0 == expr_259X)) {
    if (((SstatusS) == NO_ERRORS)) {
      return 0;}
    else {
      return -1;}}
  else {
    return -1;}}
 L14048: {
  status_260X = ps_close(port_118X);
  if ((status_260X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L15121;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L15121;}}
 L14009: {
  status_261X = ps_close(port_118X);
  if ((status_261X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L15121;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L15121;}}
 L13970: {
  status_262X = ps_close(port_118X);
  if ((status_262X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L15121;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L15121;}}
 L6054: {
  cells_263X = arg0K0;
  le_264X = ((cells_263X)<<2);
  status_265X = SstatusS;
  if ((status_265X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L6111;}
    else {
      PS_READ_INTEGER(port_118X, thing_266X, eofP_267X, status_268X)
      if (eofP_267X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L6111;}
      else {
        if ((status_268X == NO_ERRORS)) {
          arg0K0 = thing_266X;
          goto L6111;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_268X;
            arg0K0 = -1;
            goto L6111;}
          else {
            arg0K0 = -1;
            goto L6111;}}}}}
  else {
    arg0K0 = -1;
    goto L6111;}}
 L8372: {
  expr_269X = arg0K0;
  Sresumer_recordsS = expr_269X;
  status_270X = SstatusS;
  if ((status_270X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L8425;}
    else {
      PS_READ_INTEGER(port_118X, thing_271X, eofP_272X, status_273X)
      if (eofP_272X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L8425;}
      else {
        if ((status_273X == NO_ERRORS)) {
          arg0K0 = thing_271X;
          goto L8425;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_273X;
            arg0K0 = -1;
            goto L8425;}
          else {
            arg0K0 = -1;
            goto L8425;}}}}}
  else {
    arg0K0 = -1;
    goto L8425;}}
 L7659: {
  v_274X = arg5K0;
  Sstob_tableS = v_274X;
  Sheap_image_pointerS = ((char *)malloc(((((Simg_heap_sizeS))<<2))));
  if ((0 == format_169X)) {
    need_275X = (((Simg_heap_sizeS))<<2);
    got_276X = ps_read_block(port_118X, ((char *) (Sheap_image_pointerS)), need_275X, &eofP_277X, &status_278X);
    if ((status_278X == NO_ERRORS)) {
      if (eofP_277X) {
        arg3K0 = 0;
        arg4K1 = "Premature EOF when reading image file";
        goto L9822;}
      else {
        if ((got_276X < need_275X)) {
          arg3K0 = 0;
          arg4K1 = "Read returned too few bytes";
          goto L9822;}
        else {
          arg3K0 = 1;
          arg4K1 = "";
          goto L9822;}}}
    else {
      SstatusS = status_278X;
      arg3K0 = 0;
      arg4K1 = "Error reading from image file";
      goto L9822;}}
  else {
    if ((1 == format_169X)) {
      merged_arg1K0 = (Snew_weaks_start_addrS);
      merged_arg0K1 = (Sweaks_img_heap_sizeS);
      merged_arg6K2 = port_118X;
      really_read_image_area_return_tag = 0;
      goto really_read_image_area;
     really_read_image_area_return_0:
      expr_279X = really_read_image_area0_return_value;
      if ((0 == expr_279X)) {
        if (((SstatusS) == NO_ERRORS)) {
          merged_arg1K0 = (Snew_large_start_addrS);
          merged_arg0K1 = (Slarge_img_heap_sizeS);
          merged_arg6K2 = port_118X;
          really_read_image_area_return_tag = 1;
          goto really_read_image_area;
         really_read_image_area_return_1:
          expr_280X = really_read_image_area0_return_value;
          if ((0 == expr_280X)) {
            if (((SstatusS) == NO_ERRORS)) {
              merged_arg1K0 = (Snew_small_start_addrS);
              merged_arg0K1 = (Ssmall_img_heap_sizeS);
              merged_arg6K2 = port_118X;
              really_read_image_area_return_tag = 2;
              goto really_read_image_area;
             really_read_image_area_return_2:
              expr_281X = really_read_image_area0_return_value;
              if ((0 == expr_281X)) {
                if (((SstatusS) == NO_ERRORS)) {
                  arg0K0 = 0;
                  goto L9855;}
                else {
                  arg0K0 = -1;
                  goto L9855;}}
              else {
                arg0K0 = -1;
                goto L9855;}}
            else {
              arg0K0 = -1;
              goto L9855;}}
          else {
            arg0K0 = -1;
            goto L9855;}}
        else {
          arg0K0 = -1;
          goto L9855;}}
      else {
        arg0K0 = -1;
        goto L9855;}}
    else {
      ps_write_string("this can't happen: invalid image format", (stderr));
      { long ignoreXX;
      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
      status_282X = SstatusS;
      if ((status_282X == NO_ERRORS)) {
        goto L10225;}
      else {
        ps_write_string((ps_error_string((SstatusS))), (stderr));
        { long ignoreXX;
        PS_WRITE_CHAR(10, (stderr), ignoreXX) }
        goto L10225;}}}}
 L13905: {
  if ((0 == large_delta_210X)) {
    goto L13917;}
  else {
    merged_arg0K0 = large_delta_210X;
    merged_arg1K1 = (Snew_large_start_addrS);
    merged_arg1K2 = large_new_hp_211X;
    relocate_image_return_tag = 0;
    goto relocate_image;
   relocate_image_return_0:
    goto L13917;}}
 L13860: {
  expr_283X = arg0K0;
  Sstartup_procedureS = expr_283X;
  descriptor_284X = SsymbolsS;
  if ((3 == (3 & descriptor_284X))) {
    arg0K0 = (3 + (((long) ((((char *) (-3 + descriptor_284X))) + small_delta_208X))));
    goto L13866;}
  else {
    arg0K0 = descriptor_284X;
    goto L13866;}}
 L6111: {
  cells_285X = arg0K0;
  wh_286X = ((cells_285X)<<2);
  status_287X = SstatusS;
  if ((status_287X == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = -1;
      goto L6166;}
    else {
      PS_READ_INTEGER(port_118X, thing_288X, eofP_289X, status_290X)
      if (eofP_289X) {
        SeofPS = 1;
        arg0K0 = -1;
        goto L6166;}
      else {
        if ((status_290X == NO_ERRORS)) {
          arg0K0 = thing_288X;
          goto L6166;}
        else {
          SeofPS = 1;
          if (((SstatusS) == NO_ERRORS)) {
            SstatusS = status_290X;
            arg0K0 = -1;
            goto L6166;}
          else {
            arg0K0 = -1;
            goto L6166;}}}}}
  else {
    arg0K0 = -1;
    goto L6166;}}
 L8425: {
  expr_291X = arg0K0;
  Sstartup_procedureS = expr_291X;
  if (((SstatusS) == NO_ERRORS)) {
    if ((SeofPS)) {
      arg0K0 = 0;
      arg0K1 = format_142X;
      goto L15056;}
    else {
      goto L8764;}}
  else {
    arg0K0 = 0;
    arg0K1 = format_142X;
    goto L15056;}}
 L9822: {
  okayP_292X = arg3K0;
  string_293X = arg4K1;
  if (okayP_292X) {
    arg0K0 = 0;
    goto L9855;}
  else {
    ps_write_string(string_293X, (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    status_294X = SstatusS;
    if ((status_294X == NO_ERRORS)) {
      goto L10090;}
    else {
      ps_write_string((ps_error_string((SstatusS))), (stderr));
      { long ignoreXX;
      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
      goto L10090;}}}
 L9855: {
  expr_295X = arg0K0;
  if ((0 == expr_295X)) {
    if (((SstatusS) == NO_ERRORS)) {
      PS_READ_CHAR(port_118X, v_296X, eofP_297X, status_298X)
      if ((status_298X == NO_ERRORS)) {
        if (eofP_297X) {
          status_299X = ps_close(port_118X);
          if ((status_299X == NO_ERRORS)) {
            arg0K0 = 0;
            goto L14902;}
          else {
            ps_write_string("Error closing image file", (stderr));
            { long ignoreXX;
            PS_WRITE_CHAR(10, (stderr), ignoreXX) }
            status_300X = SstatusS;
            if ((status_300X == NO_ERRORS)) {
              goto L9973;}
            else {
              ps_write_string((ps_error_string((SstatusS))), (stderr));
              { long ignoreXX;
              PS_WRITE_CHAR(10, (stderr), ignoreXX) }
              goto L9973;}}}
        else {
          ps_write_string("Image file has extraneous data after image", (stderr));
          { long ignoreXX;
          PS_WRITE_CHAR(10, (stderr), ignoreXX) }
          status_301X = SstatusS;
          if ((status_301X == NO_ERRORS)) {
            goto L9941;}
          else {
            ps_write_string((ps_error_string((SstatusS))), (stderr));
            { long ignoreXX;
            PS_WRITE_CHAR(10, (stderr), ignoreXX) }
            goto L9941;}}}
      else {
        ps_write_string("Error reading from image file", (stderr));
        { long ignoreXX;
        PS_WRITE_CHAR(10, (stderr), ignoreXX) }
        status_302X = SstatusS;
        if ((status_302X == NO_ERRORS)) {
          goto L9909;}
        else {
          ps_write_string((ps_error_string((SstatusS))), (stderr));
          { long ignoreXX;
          PS_WRITE_CHAR(10, (stderr), ignoreXX) }
          goto L9909;}}}
    else {
      arg0K0 = -1;
      goto L14902;}}
  else {
    arg0K0 = -1;
    goto L14902;}}
 L10225: {
  status_303X = ps_close(port_118X);
  if ((status_303X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L9855;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L9855;}}
 L13917: {
  if ((0 == weaks_delta_212X)) {
    arg0K0 = 0;
    goto L15121;}
  else {
    merged_arg0K0 = weaks_delta_212X;
    merged_arg1K1 = (Snew_weaks_start_addrS);
    merged_arg1K2 = weaks_new_hp_213X;
    relocate_image_return_tag = 1;
    goto relocate_image;
   relocate_image_return_1:
    arg0K0 = 0;
    goto L15121;}}
 L13866: {
  expr_304X = arg0K0;
  SsymbolsS = expr_304X;
  descriptor_305X = Simported_bindingsS;
  if ((3 == (3 & descriptor_305X))) {
    arg0K0 = (3 + (((long) ((((char *) (-3 + descriptor_305X))) + small_delta_208X))));
    goto L13872;}
  else {
    arg0K0 = descriptor_305X;
    goto L13872;}}
 L6166: {
  cells_306X = arg0K0;
  we_307X = ((cells_306X)<<2);
  Ssmall_img_start_addrS = (((char *) sb_181X));
  Ssmall_img_hp_addrS = (((char *) sh_196X));
  Ssmall_img_end_addrS = (((char *) se_226X));
  Slarge_img_start_addrS = (((char *) se_226X));
  Slarge_img_hp_addrS = (((char *) lh_246X));
  Slarge_img_end_addrS = (((char *) le_264X));
  Sweaks_img_start_addrS = (((char *) le_264X));
  Sweaks_img_hp_addrS = (((char *) wh_286X));
  Sweaks_img_end_addrS = (((char *) we_307X));
  Ssmall_img_heap_sizeS = ((((sh_196X - sb_181X))>>2));
  Slarge_img_heap_sizeS = ((((lh_246X - se_226X))>>2));
  Sweaks_img_heap_sizeS = ((((wh_286X - le_264X))>>2));
  Simg_start_addrS = (((char *) le_264X));
  Simg_end_addrS = (((char *) sh_196X));
  Simg_heap_sizeS = ((((((se_226X - sb_181X))>>2)) + ((((le_264X - se_226X))>>2))) + ((((we_307X - le_264X))>>2)));
  goto L8162;}
 L8764: {
  PS_READ_CHAR(port_118X, ch_308X, eofP_309X, status_310X)
  if (eofP_309X) {
    arg3K0 = eofP_309X;
    arg0K1 = status_310X;
    goto L8452;}
  else {
    if ((status_310X == NO_ERRORS)) {
      if ((12 == ch_308X)) {
        arg3K0 = 0;
        arg0K1 = status_310X;
        goto L8452;}
      else {
        goto L8764;}}
    else {
      arg3K0 = eofP_309X;
      arg0K1 = status_310X;
      goto L8452;}}}
 L10090: {
  status_311X = ps_close(port_118X);
  if ((status_311X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L9855;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L9855;}}
 L14902: {
  expr_312X = arg0K0;
  if ((0 == expr_312X)) {
    if (((SstatusS) == NO_ERRORS)) {
      if (reverse_byte_orderP_206X) {
        merged_arg1K0 = (Simg_start_addrS);
        merged_arg0K1 = format_169X;
        old_Gnew_addr_return_tag = 0;
        goto old_Gnew_addr;
       old_Gnew_addr_return_0:
        v_313X = old_Gnew_addr0_return_value;
        merged_arg1K0 = (Simg_end_addrS);
        merged_arg0K1 = format_169X;
        old_Gnew_addr_return_tag = 1;
        goto old_Gnew_addr;
       old_Gnew_addr_return_1:
        v_314X = old_Gnew_addr0_return_value;
        merged_arg1K0 = v_313X;
        merged_arg1K1 = v_314X;
        reverse_byte_orderB_return_tag = 3;
        goto reverse_byte_orderB;
       reverse_byte_orderB_return_3:
        goto L14914;}
      else {
        goto L14914;}}
    else {
      arg0K0 = -1;
      goto L15121;}}
  else {
    arg0K0 = -1;
    goto L15121;}}
 L9973: {
  status_315X = ps_close(port_118X);
  if ((status_315X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L14902;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L14902;}}
 L9941: {
  status_316X = ps_close(port_118X);
  if ((status_316X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L14902;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L14902;}}
 L9909: {
  status_317X = ps_close(port_118X);
  if ((status_317X == NO_ERRORS)) {
    arg0K0 = -1;
    goto L14902;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    arg0K0 = -1;
    goto L14902;}}
 L13872: {
  expr_318X = arg0K0;
  Simported_bindingsS = expr_318X;
  descriptor_319X = Sexported_bindingsS;
  if ((3 == (3 & descriptor_319X))) {
    arg0K0 = (3 + (((long) ((((char *) (-3 + descriptor_319X))) + small_delta_208X))));
    goto L13878;}
  else {
    arg0K0 = descriptor_319X;
    goto L13878;}}
 L8452: {
  eofP_320X = arg3K0;
  status_321X = arg0K1;
  if (eofP_320X) {
    SeofPS = 1;
    arg0K0 = 0;
    arg0K1 = format_142X;
    goto L15056;}
  else {
    if ((status_321X == NO_ERRORS)) {
      arg0K0 = 0;
      arg0K1 = format_142X;
      goto L15056;}
    else {
      SeofPS = 1;
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = status_321X;
        arg0K0 = 0;
        arg0K1 = format_142X;
        goto L15056;}
      else {
        arg0K0 = 0;
        arg0K1 = format_142X;
        goto L15056;}}}}
 L14914: {
  if ((0 == format_169X)) {
    merged_arg1K0 = (Simg_start_addrS);
    merged_arg1K1 = (Ssymbol_addressS);
    merged_arg0K2 = format_169X;
    parse_reachable_objects_return_tag = 0;
    goto parse_reachable_objects;
   parse_reachable_objects_return_0:
    goto L14916;}
  else {
    if ((1 == format_169X)) {
      merged_arg1K0 = (Ssmall_img_start_addrS);
      merged_arg1K1 = (Ssymbol_addressS);
      merged_arg0K2 = format_169X;
      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_169X;
      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_169X;
      parse_reachable_objects_return_tag = 3;
      goto parse_reachable_objects;
     parse_reachable_objects_return_3:
      goto L14916;}
    else {
      ps_error("allocate+parse+copy-objects!: Unknown image format", 0);
      goto L14916;}}}
 L13878: {
  expr_322X = arg0K0;
  Sexported_bindingsS = expr_322X;
  descriptor_323X = Sresumer_recordsS;
  if ((3 == (3 & descriptor_323X))) {
    arg0K0 = (3 + (((long) ((((char *) (-3 + descriptor_323X))) + small_delta_208X))));
    goto L13884;}
  else {
    arg0K0 = descriptor_323X;
    goto L13884;}}
 L14916: {
  address_324X = (((char *) (-3 + (Sstartup_procedureS)))) + -4;
  if ((0 == (((long) address_324X)))) {
    arg0K0 = -1;
    goto L14571;}
  else {
    arg0K0 = (((long) address_324X));
    goto L14571;}}
 L13884: {
  expr_325X = arg0K0;
  Sresumer_recordsS = expr_325X;
  table_326X = SsymbolsS;
  if ((3 == (3 & table_326X))) {
    if ((2 == (31 & ((((*((long *) ((((char *) (-3 + table_326X))) + -4))))>>2))))) {
      arg0K0 = 0;
      goto L12582;}
    else {
      goto L13890;}}
  else {
    goto L13890;}}
 L14571: {
  v_327X = arg0K0;
  image_location_328X = table_ref((Sstob_tableS), v_327X);
  Sstartup_procedureS = (3 + (((long) ((((char *) (image_location_328X->new_descriptor))) + 4))));
  v_329X = SsymbolsS;
  if ((1 == v_329X)) {
    goto L14501;}
  else {
    tab_330X = SsymbolsS;
    merged_arg1K0 = ((((char *) (-3 + tab_330X))) + -4);
    merged_arg0K1 = format_169X;
    old_Gnew_addr_return_tag = 2;
    goto old_Gnew_addr;
   old_Gnew_addr_return_2:
    addr_331X = old_Gnew_addr0_return_value;
    cell_332X = *((long *) addr_331X);
    if ((2 == (3 & cell_332X))) {
      size_333X = (((3 + ((long)(((unsigned long)cell_332X)>>8))))>>2);
      pointer_334X = s48_allocate_tracedAgc((4 + (((size_333X)<<2))));
      memmove((void *)pointer_334X, (void *)addr_331X,(4 + (((size_333X)<<2))));
      arg0K0 = (3 + (((long) (pointer_334X + 4))));
      goto L14492;}
    else {
      ps_error("read-tables! no header", 0);
      arg0K0 = v_335X;
      goto L14492;}}}
 L12582: {
  i_336X = arg0K0;
  if ((1024 == i_336X)) {
    goto L13890;}
  else {
    link_337X = *((long *) ((((char *) (-3 + table_326X))) + (((i_336X)<<2))));
    if ((0 == (3 & link_337X))) {
      arg0K0 = (3 + (-4 & link_337X));
      goto L12588;}
    else {
      arg0K0 = link_337X;
      goto L12588;}}}
 L13890: {
  merged_arg0K0 = (Simported_bindingsS);
  merged_arg0K1 = small_delta_208X;
  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 = small_delta_208X;
  relocate_binding_table_two_spaceB_return_tag = 1;
  goto relocate_binding_table_two_spaceB;
 relocate_binding_table_two_spaceB_return_1:
  merged_arg0K0 = small_delta_208X;
  merged_arg1K1 = (Snew_small_start_addrS);
  merged_arg1K2 = small_new_hp_209X;
  relocate_image_return_tag = 2;
  goto relocate_image;
 relocate_image_return_2:
  goto L13905;}
 L14501: {
  v_338X = Simported_bindingsS;
  if ((1 == v_338X)) {
    goto L14521;}
  else {
    tab_339X = Simported_bindingsS;
    merged_arg1K0 = ((((char *) (-3 + tab_339X))) + -4);
    merged_arg0K1 = format_169X;
    old_Gnew_addr_return_tag = 3;
    goto old_Gnew_addr;
   old_Gnew_addr_return_3:
    addr_340X = old_Gnew_addr0_return_value;
    cell_341X = *((long *) addr_340X);
    if ((2 == (3 & cell_341X))) {
      size_342X = (((3 + ((long)(((unsigned long)cell_341X)>>8))))>>2);
      pointer_343X = s48_allocate_tracedAgc((4 + (((size_342X)<<2))));
      memmove((void *)pointer_343X, (void *)addr_340X,(4 + (((size_342X)<<2))));
      arg0K0 = (3 + (((long) (pointer_343X + 4))));
      goto L14512;}
    else {
      ps_error("read-tables! no header", 0);
      arg0K0 = v_344X;
      goto L14512;}}}
 L14492: {
  expr_345X = arg0K0;
  SsymbolsS = expr_345X;
  table_346X = SsymbolsS;
  stob_table_347X = Sstob_tableS;
  if ((3 == (3 & table_346X))) {
    if ((2 == (31 & ((((*((long *) ((((char *) (-3 + table_346X))) + -4))))>>2))))) {
      arg0K0 = 0;
      goto L12796;}
    else {
      goto L14501;}}
  else {
    goto L14501;}}
 L12588: {
  bucket_348X = arg0K0;
  if ((1 == bucket_348X)) {
    goto L12584;}
  else {
    bucket_349X = bucket_348X + small_delta_208X;
    if ((3 == (3 & bucket_349X))) {
      arg0K0 = (-4 & bucket_349X);
      goto L12593;}
    else {
      arg0K0 = bucket_349X;
      goto L12593;}}}
 L14521: {
  v_350X = Sexported_bindingsS;
  if ((1 == v_350X)) {
    goto L14541;}
  else {
    tab_351X = Sexported_bindingsS;
    merged_arg1K0 = ((((char *) (-3 + tab_351X))) + -4);
    merged_arg0K1 = format_169X;
    old_Gnew_addr_return_tag = 4;
    goto old_Gnew_addr;
   old_Gnew_addr_return_4:
    addr_352X = old_Gnew_addr0_return_value;
    cell_353X = *((long *) addr_352X);
    if ((2 == (3 & cell_353X))) {
      size_354X = (((3 + ((long)(((unsigned long)cell_353X)>>8))))>>2);
      pointer_355X = s48_allocate_tracedAgc((4 + (((size_354X)<<2))));
      memmove((void *)pointer_355X, (void *)addr_352X,(4 + (((size_354X)<<2))));
      arg0K0 = (3 + (((long) (pointer_355X + 4))));
      goto L14532;}
    else {
      ps_error("read-tables! no header", 0);
      arg0K0 = v_356X;
      goto L14532;}}}
 L14512: {
  expr_357X = arg0K0;
  Simported_bindingsS = expr_357X;
  merged_arg0K0 = (Simported_bindingsS);
  merged_arg5K1 = (Sstob_tableS);
  relocate_binding_table_bibopB_return_tag = 0;
  goto relocate_binding_table_bibopB;
 relocate_binding_table_bibopB_return_0:
  goto L14521;}
 L12796: {
  i_358X = arg0K0;
  if ((1024 == i_358X)) {
    goto L14501;}
  else {
    link_359X = *((long *) ((((char *) (-3 + table_346X))) + (((i_358X)<<2))));
    if ((0 == (3 & link_359X))) {
      arg0K0 = (3 + (-4 & link_359X));
      goto L12802;}
    else {
      arg0K0 = link_359X;
      goto L12802;}}}
 L12584: {
  arg0K0 = (1 + i_336X);
  goto L12582;}
 L12593: {
  value_360X = arg0K0;
  addr_361X = (((char *) (-3 + table_326X))) + (((i_336X)<<2));S48_WRITE_BARRIER(table_326X, addr_361X, value_360X);
  *((long *) addr_361X) = (long) (value_360X);
  arg0K0 = bucket_349X;
  goto L12604;}
 L14541: {
  if ((1 == (Sresumer_recordsS))) {
    goto L14918;}
  else {
    tab_362X = Sresumer_recordsS;
    merged_arg1K0 = ((((char *) (-3 + tab_362X))) + -4);
    merged_arg0K1 = format_169X;
    old_Gnew_addr_return_tag = 5;
    goto old_Gnew_addr;
   old_Gnew_addr_return_5:
    addr_363X = old_Gnew_addr0_return_value;
    cell_364X = *((long *) addr_363X);
    if ((2 == (3 & cell_364X))) {
      size_365X = (((3 + ((long)(((unsigned long)cell_364X)>>8))))>>2);
      pointer_366X = s48_allocate_tracedAgc((4 + (((size_365X)<<2))));
      memmove((void *)pointer_366X, (void *)addr_363X,(4 + (((size_365X)<<2))));
      arg0K0 = (3 + (((long) (pointer_366X + 4))));
      goto L14552;}
    else {
      ps_error("read-tables! no header", 0);
      arg0K0 = v_367X;
      goto L14552;}}}
 L14532: {
  expr_368X = arg0K0;
  Sexported_bindingsS = expr_368X;
  merged_arg0K0 = (Sexported_bindingsS);
  merged_arg5K1 = (Sstob_tableS);
  relocate_binding_table_bibopB_return_tag = 1;
  goto relocate_binding_table_bibopB;
 relocate_binding_table_bibopB_return_1:
  goto L14541;}
 L12802: {
  bucket_369X = arg0K0;
  if ((1 == bucket_369X)) {
    goto L12798;}
  else {
    merged_arg0K0 = bucket_369X;
    relocateD1_return_tag = 0;
    goto relocateD1;
   relocateD1_return_0:
    bucket_370X = relocateD10_return_value;
    if ((3 == (3 & bucket_370X))) {
      arg0K0 = (-4 & bucket_370X);
      goto L12807;}
    else {
      arg0K0 = bucket_370X;
      goto L12807;}}}
 L12604: {
  entry_371X = arg0K0;
  link_372X = *((long *) ((((char *) (-3 + entry_371X))) + 4));
  if ((0 == (3 & link_372X))) {
    arg0K0 = (3 + (-4 & link_372X));
    goto L12608;}
  else {
    arg0K0 = link_372X;
    goto L12608;}}
 L14918: {
  table_373X = Sstob_tableS;
  keys_374X = table_373X->keys;
  values_375X = table_373X->values;
  arg0K0 = 0;
  goto L3703;}
 L14552: {
  expr_376X = arg0K0;
  Sresumer_recordsS = expr_376X;
  resumer_records_377X = Sresumer_recordsS;
  cell_378X = *((long *) ((((char *) (-3 + resumer_records_377X))) + -4));
  if ((2 == (3 & cell_378X))) {
    arg1K0 = (((char *) (-3 + resumer_records_377X)));
    arg0K1 = ((((3 + ((long)(((unsigned long)cell_378X)>>8))))>>2));
    goto L10378;}
  else {
    ps_error("relocate-resumer-record! - no header", 0);
    goto L14918;}}
 L12798: {
  arg0K0 = (1 + i_358X);
  goto L12796;}
 L12807: {
  value_379X = arg0K0;
  addr_380X = (((char *) (-3 + table_346X))) + (((i_358X)<<2));S48_WRITE_BARRIER(table_346X, addr_380X, value_379X);
  *((long *) addr_380X) = (long) (value_379X);
  arg0K0 = bucket_370X;
  goto L12818;}
 L12608: {
  next_381X = arg0K0;
  if ((1 == next_381X)) {
    goto L12584;}
  else {
    next_382X = next_381X + small_delta_208X;
    if ((3 == (3 & next_382X))) {
      arg0K0 = (-4 & next_382X);
      goto L12613;}
    else {
      arg0K0 = next_382X;
      goto L12613;}}}
 L3703: {
  i_383X = arg0K0;
  if ((i_383X == (table_373X->size))) {
    free(keys_374X);
    free(values_375X);
    free(table_373X);
    free((Sheap_image_pointerS));
    arg0K0 = 0;
    goto L15121;}
  else {
    if ((0 == (*(keys_374X + i_383X)))) {
      goto L3705;}
    else {
      free((*(values_375X + i_383X)));
      goto L3705;}}}
 L10378: {
  address_384X = arg1K0;
  size_385X = arg0K1;
  if ((0 == size_385X)) {
    goto L14918;}
  else {
    cell_386X = *((long *) address_384X);
    if ((3 == (3 & cell_386X))) {
      address_387X = (((char *) (-3 + cell_386X))) + -4;
      if ((0 == (((long) address_387X)))) {
        arg0K0 = -1;
        goto L10443;}
      else {
        arg0K0 = (((long) address_387X));
        goto L10443;}}
    else {
      ps_error("Could this happen?", 0);
      goto L14918;}}}
 L12818: {
  entry_388X = arg0K0;
  link_389X = *((long *) ((((char *) (-3 + entry_388X))) + 4));
  if ((0 == (3 & link_389X))) {
    arg0K0 = (3 + (-4 & link_389X));
    goto L12822;}
  else {
    arg0K0 = link_389X;
    goto L12822;}}
 L12613: {
  val_390X = arg0K0;
  addr_391X = (((char *) (-3 + entry_371X))) + 4;S48_WRITE_BARRIER(entry_371X, addr_391X, val_390X);
  *((long *) addr_391X) = (long) (val_390X);
  arg0K0 = next_382X;
  goto L12604;}
 L3705: {
  arg0K0 = (1 + i_383X);
  goto L3703;}
 L10443: {
  v_392X = arg0K0;
  image_location_393X = table_ref((Sstob_tableS), v_392X);
  *((long *) address_384X) = (long) ((3 + (((long) ((((char *) (image_location_393X->new_descriptor))) + 4)))));
  arg1K0 = (address_384X + 4);
  arg0K1 = (-1 + size_385X);
  goto L10378;}
 L12822: {
  next_394X = arg0K0;
  if ((1 == next_394X)) {
    goto L12798;}
  else {
    merged_arg0K0 = next_394X;
    relocateD1_return_tag = 1;
    goto relocateD1;
   relocateD1_return_1:
    next_395X = relocateD10_return_value;
    if ((3 == (3 & next_395X))) {
      arg0K0 = (-4 & next_395X);
      goto L12827;}
    else {
      arg0K0 = next_395X;
      goto L12827;}}}
 L12827: {
  val_396X = arg0K0;
  addr_397X = (((char *) (-3 + entry_388X))) + 4;S48_WRITE_BARRIER(entry_388X, addr_397X, val_396X);
  *((long *) addr_397X) = (long) (val_396X);
  arg0K0 = next_395X;
  goto L12818;}
 relocateD1: {
  address_117X = merged_arg0K0;{
  address_398X = (((char *) (-3 + address_117X))) + -4;
  if ((0 == (((long) address_398X)))) {
    arg0K0 = -1;
    goto L12766;}
  else {
    arg0K0 = (((long) address_398X));
    goto L12766;}}
 L12766: {
  v_399X = arg0K0;
  image_location_400X = table_ref(stob_table_347X, v_399X);
  relocateD10_return_value = (3 + (((long) ((((char *) (image_location_400X->new_descriptor))) + 4))));
  goto relocateD1_return;}
 relocateD1_return:
  switch (relocateD1_return_tag) {
  case 0: goto relocateD1_return_0;
  default: goto relocateD1_return_1;
  }}

 parse_reachable_objects: {
  from_addr_114X = merged_arg1K0;
  to_addr_115X = merged_arg1K1;
  image_format_116X = merged_arg0K2;{
  arg1K0 = from_addr_114X;
  goto L13209;}
 L13209: {
  current_addr_401X = arg1K0;
  if ((current_addr_401X == to_addr_115X)) {
    parse_reachable_objects0_return_value = 0;
    goto parse_reachable_objects_return;}
  else {
    merged_arg1K0 = current_addr_401X;
    merged_arg0K1 = image_format_116X;
    old_Gnew_addr_return_tag = 6;
    goto old_Gnew_addr;
   old_Gnew_addr_return_6:
    x1_402X = old_Gnew_addr0_return_value;
    cell_403X = *((long *) x1_402X);
    if ((2 == (3 & cell_403X))) {
      size_in_cells_404X = (((3 + ((long)(((unsigned long)cell_403X)>>8))))>>2);
      if ((0 == (Sheap_object_remaining_cellsS))) {
        goto L13234;}
      else {
        ps_error("Encountered an header within an d-vector.", 0);
        goto L13234;}}
    else {
      if ((3 == (3 & cell_403X))) {
        current_addr_405X = (((char *) (-3 + cell_403X))) + -4;
        if ((0 == (((long) current_addr_405X)))) {
          arg0K0 = -1;
          goto L13436;}
        else {
          arg0K0 = (((long) current_addr_405X));
          goto L13436;}}
      else {
        *((long *) (Sheap_object_pointerS)) = (long) (cell_403X);
        Sheap_object_remaining_cellsS = (-1 + (Sheap_object_remaining_cellsS));
        Sheap_object_pointerS = ((Sheap_object_pointerS) + 4);
        goto L13291;}}}}
 L13234: {
  if ((2 == (3 & cell_403X))) {
    if (((31 & (((cell_403X)>>2))) < 16)) {
      goto L13250;}
    else {
      if ((0 == (((long) current_addr_401X)))) {
        arg0K0 = -1;
        goto L13322;}
      else {
        arg0K0 = (((long) current_addr_401X));
        goto L13322;}}}
  else {
    goto L13250;}}
 L13436: {
  v_406X = arg0K0;
  v_407X = table_ref((Sstob_tableS), v_406X);
  if ((NULL == v_407X)) {
    current_addr_408X = (((char *) (-3 + cell_403X))) + -4;
    merged_arg1K0 = current_addr_408X;
    merged_arg0K1 = image_format_116X;
    old_Gnew_addr_return_tag = 7;
    goto old_Gnew_addr;
   old_Gnew_addr_return_7:
    x1_409X = old_Gnew_addr0_return_value;
    header_cell_410X = *((long *) x1_409X);
    size_in_cells_411X = 1 + ((((3 + ((long)(((unsigned long)header_cell_410X)>>8))))>>2));
    size_in_bytes_412X = ((size_in_cells_411X)<<2);
    if ((2 == (3 & header_cell_410X))) {
      if (((31 & (((header_cell_410X)>>2))) < 16)) {
        goto L12015;}
      else {
        new_address_413X = s48_allocate_tracedAgc((((size_in_cells_411X)<<2)));
        image_location_414X = (struct image_location*)malloc(sizeof(struct image_location));
        if ((NULL == image_location_414X)) {
          arg2K0 = image_location_414X;
          goto L12074;}
        else {
          image_location_414X->new_descriptor = (((long) new_address_413X));
          image_location_414X->next = 0;
          arg2K0 = image_location_414X;
          goto L12074;}}}
    else {
      goto L12015;}}
  else {
    goto L13282;}}
 L13291: {
  arg1K0 = (current_addr_401X + 4);
  goto L13209;}
 L13250: {
  if ((0 == (((long) current_addr_401X)))) {
    arg0K0 = -1;
    goto L13369;}
  else {
    arg0K0 = (((long) current_addr_401X));
    goto L13369;}}
 L13322: {
  v_415X = arg0K0;
  v_416X = table_ref((Sstob_tableS), v_415X);
  if ((NULL == v_416X)) {
    size_in_cells_417X = 1 + size_in_cells_404X;
    new_address_418X = s48_allocate_tracedAgc((((size_in_cells_417X)<<2)));
    image_location_419X = (struct image_location*)malloc(sizeof(struct image_location));
    if ((NULL == image_location_419X)) {
      arg2K0 = image_location_419X;
      goto L13340;}
    else {
      image_location_419X->new_descriptor = (((long) new_address_418X));
      image_location_419X->next = 0;
      arg2K0 = image_location_419X;
      goto L13340;}}
  else {
    goto L13247;}}
 L12015: {
  new_address_420X = s48_allocate_tracedAgc(size_in_bytes_412X);
  image_location_421X = (struct image_location*)malloc(sizeof(struct image_location));
  if ((NULL == image_location_421X)) {
    arg2K0 = image_location_421X;
    goto L12102;}
  else {
    image_location_421X->new_descriptor = (((long) new_address_420X));
    image_location_421X->next = 0;
    arg2K0 = image_location_421X;
    goto L12102;}}
 L12074: {
  val_422X = arg2K0;
  if ((0 == (((long) current_addr_408X)))) {
    arg0K0 = -1;
    goto L12076;}
  else {
    arg0K0 = (((long) current_addr_408X));
    goto L12076;}}
 L13282: {
  address_423X = (((char *) (-3 + cell_403X))) + -4;
  if ((0 == (((long) address_423X)))) {
    arg0K0 = -1;
    goto L13450;}
  else {
    arg0K0 = (((long) address_423X));
    goto L13450;}}
 L13369: {
  v_424X = arg0K0;
  v_425X = table_ref((Sstob_tableS), v_424X);
  if ((NULL == v_425X)) {
    new_address_426X = s48_allocate_tracedAgc((4 + (((size_in_cells_404X)<<2))));
    image_location_427X = (struct image_location*)malloc(sizeof(struct image_location));
    if ((NULL == image_location_427X)) {
      arg2K0 = image_location_427X;
      goto L11285;}
    else {
      image_location_427X->new_descriptor = (((long) new_address_426X));
      image_location_427X->next = 0;
      arg2K0 = image_location_427X;
      goto L11285;}}
  else {
    if ((0 == (((long) current_addr_401X)))) {
      arg0K0 = -1;
      goto L10503;}
    else {
      arg0K0 = (((long) current_addr_401X));
      goto L10503;}}}
 L13340: {
  val_428X = arg2K0;
  if ((0 == (((long) current_addr_401X)))) {
    arg0K0 = -1;
    goto L13342;}
  else {
    arg0K0 = (((long) current_addr_401X));
    goto L13342;}}
 L13247: {
  arg1K0 = (current_addr_401X + (4 + (((size_in_cells_404X)<<2))));
  goto L13209;}
 L12102: {
  val_429X = arg2K0;
  if ((0 == (((long) current_addr_408X)))) {
    arg0K0 = -1;
    goto L12104;}
  else {
    arg0K0 = (((long) current_addr_408X));
    goto L12104;}}
 L12076: {
  v_430X = arg0K0;table_setB((Sstob_tableS), v_430X, val_422X);
  merged_arg1K0 = current_addr_408X;
  merged_arg0K1 = image_format_116X;
  old_Gnew_addr_return_tag = 8;
  goto old_Gnew_addr;
 old_Gnew_addr_return_8:
  v_431X = old_Gnew_addr0_return_value;
  memmove((void *)new_address_413X, (void *)v_431X,(((size_in_cells_411X)<<2)));
  goto L13282;}
 L13450: {
  v_432X = arg0K0;
  image_location_433X = table_ref((Sstob_tableS), v_432X);
  *((long *) (Sheap_object_pointerS)) = (long) ((3 + (((long) ((((char *) (image_location_433X->new_descriptor))) + 4)))));
  Sheap_object_remaining_cellsS = (-1 + (Sheap_object_remaining_cellsS));
  Sheap_object_pointerS = ((Sheap_object_pointerS) + 4);
  goto L13291;}
 L11285: {
  val_434X = arg2K0;
  if ((0 == (((long) current_addr_401X)))) {
    arg0K0 = -1;
    goto L11287;}
  else {
    arg0K0 = (((long) current_addr_401X));
    goto L11287;}}
 L10503: {
  v_435X = arg0K0;
  image_location_436X = table_ref((Sstob_tableS), v_435X);
  new_address_437X = ((char *) (image_location_436X->new_descriptor));
  if ((2 == (3 & cell_403X))) {
    goto L10488;}
  else {
    ps_error("cell was not a header", 0);
    goto L10488;}}
 L13342: {
  v_438X = arg0K0;table_setB((Sstob_tableS), v_438X, val_428X);
  merged_arg1K0 = current_addr_401X;
  merged_arg0K1 = image_format_116X;
  old_Gnew_addr_return_tag = 9;
  goto old_Gnew_addr;
 old_Gnew_addr_return_9:
  v_439X = old_Gnew_addr0_return_value;
  memmove((void *)new_address_418X, (void *)v_439X,(((size_in_cells_417X)<<2)));
  goto L13247;}
 L12104: {
  v_440X = arg0K0;table_setB((Sstob_tableS), v_440X, val_429X);
  *((long *) new_address_420X) = (long) ((-954 + (((size_in_bytes_412X)<<8))));
  arg1K0 = (new_address_420X + 4);
  goto L12033;}
 L11287: {
  v_441X = arg0K0;table_setB((Sstob_tableS), v_441X, val_434X);
  if ((2 == (3 & cell_403X))) {
    goto L11264;}
  else {
    ps_error("cell was not a header", 0);
    goto L11264;}}
 L10488: {
  *((long *) new_address_437X) = (long) (cell_403X);
  Sheap_object_pointerS = new_address_437X;
  Sheap_object_remaining_cellsS = (1 + ((((3 + ((long)(((unsigned long)cell_403X)>>8))))>>2)));
  Sheap_object_remaining_cellsS = (-1 + (Sheap_object_remaining_cellsS));
  Sheap_object_pointerS = ((Sheap_object_pointerS) + 4);
  goto L13262;}
 L12033: {
  index_442X = arg1K0;
  if ((index_442X == (new_address_420X + (-4 & (3 + size_in_bytes_412X))))) {
    goto L13282;}
  else {
    *((long *) index_442X) = (long) (0);
    arg1K0 = (index_442X + 4);
    goto L12033;}}
 L11264: {
  *((long *) new_address_426X) = (long) (cell_403X);
  Sheap_object_pointerS = new_address_426X;
  Sheap_object_remaining_cellsS = (1 + ((((3 + ((long)(((unsigned long)cell_403X)>>8))))>>2)));
  Sheap_object_remaining_cellsS = (-1 + (Sheap_object_remaining_cellsS));
  Sheap_object_pointerS = ((Sheap_object_pointerS) + 4);
  goto L13262;}
 L13262: {
  arg1K0 = (current_addr_401X + 4);
  goto L13209;}
 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;
  }}

 old_Gnew_addr: {
  addr_112X = merged_arg1K0;
  format_113X = merged_arg0K1;{
  if ((0 == format_113X)) {
    old_Gnew_addr0_return_value = ((Sheap_image_pointerS) + (addr_112X - (Simg_start_addrS)));
    goto old_Gnew_addr_return;}
  else {
    if ((1 == format_113X)) {
      y_443X = Ssmall_img_start_addrS;
      if ((addr_112X < y_443X)) {
        goto L3837;}
      else {
        if (((Ssmall_img_hp_addrS) < addr_112X)) {
          goto L3837;}
        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 L3889;}}}
    else {
      ps_error("old->new-addr: Unknown image format", 0);
      old_Gnew_addr0_return_value = v_444X;
      goto old_Gnew_addr_return;}}}
 L3837: {
  y_445X = Slarge_img_start_addrS;
  if ((addr_112X < y_445X)) {
    goto L3863;}
  else {
    if (((Slarge_img_hp_addrS) < addr_112X)) {
      goto L3863;}
    else {
      SoffsetS = ((Sweaks_img_end_addrS) - (Sweaks_img_start_addrS));
      Sarea_startS = (Slarge_img_start_addrS);
      goto L3889;}}}
 L3889: {
  old_Gnew_addr0_return_value = ((Sheap_image_pointerS) + ((SoffsetS) + (addr_112X - (Sarea_startS))));
  goto old_Gnew_addr_return;}
 L3863: {
  y_446X = Sweaks_img_start_addrS;
  if ((addr_112X < y_446X)) {
    goto L3885;}
  else {
    if (((Sweaks_img_hp_addrS) < addr_112X)) {
      goto L3885;}
    else {
      SoffsetS = 0;
      Sarea_startS = (Sweaks_img_start_addrS);
      goto L3889;}}}
 L3885: {
  ps_error("Unknown address area!", 0);
  goto L3889;}
 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;
  case 6: goto old_Gnew_addr_return_6;
  case 7: goto old_Gnew_addr_return_7;
  case 8: goto old_Gnew_addr_return_8;
  default: goto old_Gnew_addr_return_9;
  }}

 relocateD0: {
  address_111X = merged_arg0K0;{
  address_447X = (((char *) (-3 + address_111X))) + -4;
  if ((0 == (((long) address_447X)))) {
    arg0K0 = -1;
    goto L12894;}
  else {
    arg0K0 = (((long) address_447X));
    goto L12894;}}
 L12894: {
  v_448X = arg0K0;
  image_location_449X = table_ref(stob_table_110X, v_448X);
  relocateD00_return_value = (3 + (((long) ((((char *) (image_location_449X->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_109X = merged_arg0K0;
  stob_table_110X = merged_arg5K1;{
  if ((3 == (3 & table_109X))) {
    if ((2 == (31 & ((((*((long *) ((((char *) (-3 + table_109X))) + -4))))>>2))))) {
      arg0K0 = 0;
      goto L12924;}
    else {
      goto relocate_binding_table_bibopB_return;}}
  else {
    goto relocate_binding_table_bibopB_return;}}
 L12924: {
  i_450X = arg0K0;
  if ((1024 == i_450X)) {
    goto relocate_binding_table_bibopB_return;}
  else {
    link_451X = *((long *) ((((char *) (-3 + table_109X))) + (((i_450X)<<2))));
    if ((0 == (3 & link_451X))) {
      arg0K0 = (3 + (-4 & link_451X));
      goto L12930;}
    else {
      arg0K0 = link_451X;
      goto L12930;}}}
 L12930: {
  bucket_452X = arg0K0;
  if ((1 == bucket_452X)) {
    goto L12926;}
  else {
    merged_arg0K0 = bucket_452X;
    relocateD0_return_tag = 0;
    goto relocateD0;
   relocateD0_return_0:
    bucket_453X = relocateD00_return_value;
    if ((3 == (3 & bucket_453X))) {
      arg0K0 = (-4 & bucket_453X);
      goto L12935;}
    else {
      arg0K0 = bucket_453X;
      goto L12935;}}}
 L12926: {
  arg0K0 = (1 + i_450X);
  goto L12924;}
 L12935: {
  value_454X = arg0K0;
  addr_455X = (((char *) (-3 + table_109X))) + (((i_450X)<<2));S48_WRITE_BARRIER(table_109X, addr_455X, value_454X);
  *((long *) addr_455X) = (long) (value_454X);
  arg0K0 = bucket_453X;
  goto L12946;}
 L12946: {
  entry_456X = arg0K0;
  link_457X = *((long *) ((((char *) (-3 + entry_456X))) + 12));
  if ((0 == (3 & link_457X))) {
    arg0K0 = (3 + (-4 & link_457X));
    goto L12950;}
  else {
    arg0K0 = link_457X;
    goto L12950;}}
 L12950: {
  next_458X = arg0K0;
  if ((1 == next_458X)) {
    goto L12926;}
  else {
    merged_arg0K0 = next_458X;
    relocateD0_return_tag = 1;
    goto relocateD0;
   relocateD0_return_1:
    next_459X = relocateD00_return_value;
    if ((3 == (3 & next_459X))) {
      arg0K0 = (-4 & next_459X);
      goto L12955;}
    else {
      arg0K0 = next_459X;
      goto L12955;}}}
 L12955: {
  val_460X = arg0K0;
  addr_461X = (((char *) (-3 + entry_456X))) + 12;S48_WRITE_BARRIER(entry_456X, addr_461X, val_460X);
  *((long *) addr_461X) = (long) (val_460X);
  arg0K0 = next_459X;
  goto L12946;}
 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_107X = merged_arg0K0;
  delta_108X = merged_arg0K1;{
  if ((3 == (3 & table_107X))) {
    if ((2 == (31 & ((((*((long *) ((((char *) (-3 + table_107X))) + -4))))>>2))))) {
      arg0K0 = 0;
      goto L12677;}
    else {
      goto relocate_binding_table_two_spaceB_return;}}
  else {
    goto relocate_binding_table_two_spaceB_return;}}
 L12677: {
  i_462X = arg0K0;
  if ((1024 == i_462X)) {
    goto relocate_binding_table_two_spaceB_return;}
  else {
    link_463X = *((long *) ((((char *) (-3 + table_107X))) + (((i_462X)<<2))));
    if ((0 == (3 & link_463X))) {
      arg0K0 = (3 + (-4 & link_463X));
      goto L12683;}
    else {
      arg0K0 = link_463X;
      goto L12683;}}}
 L12683: {
  bucket_464X = arg0K0;
  if ((1 == bucket_464X)) {
    goto L12679;}
  else {
    bucket_465X = bucket_464X + delta_108X;
    if ((3 == (3 & bucket_465X))) {
      arg0K0 = (-4 & bucket_465X);
      goto L12688;}
    else {
      arg0K0 = bucket_465X;
      goto L12688;}}}
 L12679: {
  arg0K0 = (1 + i_462X);
  goto L12677;}
 L12688: {
  value_466X = arg0K0;
  addr_467X = (((char *) (-3 + table_107X))) + (((i_462X)<<2));S48_WRITE_BARRIER(table_107X, addr_467X, value_466X);
  *((long *) addr_467X) = (long) (value_466X);
  arg0K0 = bucket_465X;
  goto L12699;}
 L12699: {
  entry_468X = arg0K0;
  link_469X = *((long *) ((((char *) (-3 + entry_468X))) + 12));
  if ((0 == (3 & link_469X))) {
    arg0K0 = (3 + (-4 & link_469X));
    goto L12703;}
  else {
    arg0K0 = link_469X;
    goto L12703;}}
 L12703: {
  next_470X = arg0K0;
  if ((1 == next_470X)) {
    goto L12679;}
  else {
    next_471X = next_470X + delta_108X;
    if ((3 == (3 & next_471X))) {
      arg0K0 = (-4 & next_471X);
      goto L12708;}
    else {
      arg0K0 = next_471X;
      goto L12708;}}}
 L12708: {
  val_472X = arg0K0;
  addr_473X = (((char *) (-3 + entry_468X))) + 12;S48_WRITE_BARRIER(entry_468X, addr_473X, val_472X);
  *((long *) addr_473X) = (long) (val_472X);
  arg0K0 = next_471X;
  goto L12699;}
 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;
  }}

 relocate_image: {
  delta_104X = merged_arg0K0;
  start_105X = merged_arg1K1;
  end_106X = merged_arg1K2;{
  arg1K0 = start_105X;
  goto L10876;}
 L10876: {
  ptr_474X = arg1K0;
  if ((ptr_474X < end_106X)) {
    descriptor_475X = *((long *) ptr_474X);
    if ((3 == (3 & descriptor_475X))) {
      arg0K0 = (3 + (((long) ((((char *) (-3 + descriptor_475X))) + delta_104X))));
      goto L10881;}
    else {
      arg0K0 = descriptor_475X;
      goto L10881;}}
  else {
    goto relocate_image_return;}}
 L10881: {
  d_476X = arg0K0;
  *((long *) ptr_474X) = (long) (d_476X);
  if ((2 == (3 & d_476X))) {
    if (((31 & (((d_476X)>>2))) < 16)) {
      goto L10893;}
    else {
      arg1K0 = (ptr_474X + (4 + (-4 & (3 + ((long)(((unsigned long)d_476X)>>8))))));
      goto L10876;}}
  else {
    goto L10893;}}
 L10893: {
  arg1K0 = (ptr_474X + 4);
  goto L10876;}
 relocate_image_return:
  switch (relocate_image_return_tag) {
  case 0: goto relocate_image_return_0;
  case 1: goto relocate_image_return_1;
  default: goto relocate_image_return_2;
  }}

 reverse_byte_orderB: {
  start_102X = merged_arg1K0;
  end_103X = merged_arg1K1;{
  ps_write_string("Correcting byte order of resumed image.", (stderr));
  { long ignoreXX;
  PS_WRITE_CHAR(10, (stderr), ignoreXX) }
  arg1K0 = start_102X;
  goto L10777;}
 L10777: {
  ptr_477X = arg1K0;
  if ((ptr_477X < end_103X)) {
    x_478X = *((unsigned char *) ptr_477X);
    *((unsigned char *) ptr_477X) = (unsigned char) ((*((unsigned char *) (ptr_477X + 3))));
    *((unsigned char *) (ptr_477X + 3)) = (unsigned char) (x_478X);
    x_479X = *((unsigned char *) (ptr_477X + 1));
    *((unsigned char *) (ptr_477X + 1)) = (unsigned char) ((*((unsigned char *) (ptr_477X + 2))));
    *((unsigned char *) (ptr_477X + 2)) = (unsigned char) (x_479X);
    value_480X = *((long *) ptr_477X);
    next_481X = ptr_477X + 4;
    if ((2 == (3 & value_480X))) {
      if (((31 & (((value_480X)>>2))) < 16)) {
        arg1K0 = next_481X;
        goto L10777;}
      else {
        arg1K0 = (next_481X + (-4 & (3 + ((long)(((unsigned long)value_480X)>>8)))));
        goto L10777;}}
    else {
      arg1K0 = next_481X;
      goto L10777;}}
  else {
    goto reverse_byte_orderB_return;}}
 reverse_byte_orderB_return:
  switch (reverse_byte_orderB_return_tag) {
  case 0: goto reverse_byte_orderB_return_0;
  case 1: goto reverse_byte_orderB_return_1;
  case 2: goto reverse_byte_orderB_return_2;
  default: goto reverse_byte_orderB_return_3;
  }}

 read_image_area: {
  new_start_addr_99X = merged_arg1K0;
  img_heap_size_100X = merged_arg0K1;
  port_101X = merged_arg6K2;{
  need_482X = ((img_heap_size_100X)<<2);
  got_483X = ps_read_block(port_101X, ((char *) new_start_addr_99X), need_482X, &eofP_484X, &status_485X);
  if ((status_485X == NO_ERRORS)) {
    if (eofP_484X) {
      arg3K0 = 0;
      arg4K1 = "Premature EOF when reading image file";
      goto L4792;}
    else {
      if ((got_483X < need_482X)) {
        arg3K0 = 0;
        arg4K1 = "Read returned too few bytes";
        goto L4792;}
      else {
        arg3K0 = 1;
        arg4K1 = "";
        goto L4792;}}}
  else {
    SstatusS = status_485X;
    arg3K0 = 0;
    arg4K1 = "Error reading from image file";
    goto L4792;}}
 L4792: {
  okayP_486X = arg3K0;
  string_487X = arg4K1;
  if (okayP_486X) {
    read_image_area0_return_value = 0;
    goto read_image_area_return;}
  else {
    ps_write_string(string_487X, (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    status_488X = SstatusS;
    if ((status_488X == NO_ERRORS)) {
      goto L4835;}
    else {
      ps_write_string((ps_error_string((SstatusS))), (stderr));
      { long ignoreXX;
      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
      goto L4835;}}}
 L4835: {
  status_489X = ps_close(port_101X);
  if ((status_489X == NO_ERRORS)) {
    read_image_area0_return_value = -1;
    goto read_image_area_return;}
  else {
    ps_write_string("Error closing image file", (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    read_image_area0_return_value = -1;
    goto read_image_area_return;}}
 read_image_area_return:
  switch (read_image_area_return_tag) {
  case 0: goto read_image_area_return_0;
  case 1: goto read_image_area_return_1;
  default: goto read_image_area_return_2;
  }}

 really_read_image_area: {
  new_start_addr_96X = merged_arg1K0;
  img_heap_size_97X = merged_arg0K1;
  port_98X = merged_arg6K2;{
  need_490X = ((img_heap_size_97X)<<2);
  got_491X = ps_read_block(port_98X, ((char *) new_start_addr_96X), need_490X, &eofP_492X, &status_493X);
  if ((status_493X == NO_ERRORS)) {
    if (eofP_492X) {
      arg3K0 = 0;
      arg4K1 = "Premature EOF when reading image file";
      goto L4706;}
    else {
      if ((got_491X < need_490X)) {
        arg3K0 = 0;
        arg4K1 = "Read returned too few bytes";
        goto L4706;}
      else {
        arg3K0 = 1;
        arg4K1 = "";
        goto L4706;}}}
  else {
    SstatusS = status_493X;
    arg3K0 = 0;
    arg4K1 = "Error reading from image file";
    goto L4706;}}
 L4706: {
  okayP_494X = arg3K0;
  string_495X = arg4K1;
  if (okayP_494X) {
    really_read_image_area0_return_value = 0;
    goto really_read_image_area_return;}
  else {
    ps_write_string(string_495X, (stderr));
    { long ignoreXX;
    PS_WRITE_CHAR(10, (stderr), ignoreXX) }
    status_496X = SstatusS;
    if ((status_496X == NO_ERRORS)) {
      goto L4749;}
    else {
      ps_write_string((ps_error_string((SstatusS))), (stderr));
      { long ignoreXX;
      PS_WRITE_CHAR(10, (stderr), ignoreXX) }
      goto L4749;}}}
 L4749: {
  status_497X = ps_close(port_98X);
  if ((status_497X == 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;
  }}

}
long s48_write_image(long resume_proc_498X, long undumpables_499X, FILE * port_500X)
{
  struct table *arg5K0;
  struct bibop_areas *arg7K0;
  long arg0K0;
  char * arg1K0;
  char * merged_arg1K0;
  long merged_arg0K1;
  long merged_arg0K0;

  int write_shared_table_return_tag;
  char write_shared_table0_return_value;
  int write_stob_return_tag;
  int copy_image_data_return_tag;
  long table_501X;
  long stob_502X;
  char * start_503X;
  long size_504X;
  long v_668X;
  long value_667X;
  struct image_location *have_666X;
  long thing_665X;
  long link_664X;
  struct image_location *v_663X;
  long next_662X;
  long shared_661X;
  long link_660X;
  char temp_659X;
  long i_658X;
  long value_657X;
  long v_656X;
  struct image_location *have_655X;
  long v_654X;
  long v_653X;
  struct image_location *have_652X;
  long thing_651X;
  struct image_location *have_650X;
  long thing_649X;
  long x_648X;
  char * addr_647X;
  long v_646X;
  long value_645X;
  struct image_location *have_644X;
  long thing_643X;
  char * addr_642X;
  char * start_641X;
  long header_640X;
  long next_639X;
  struct image_location *have_638X;
  long thing_637X;
  struct image_location *have_636X;
  char * addr_635X;
  long link_634X;
  struct image_location *v_633X;
  long next_632X;
  char * start_631X;
  long header_630X;
  long next_629X;
  long have_628X;
  long available_627X;
  long size_626X;
  char * start_625X;
  long header_624X;
  long shared_623X;
  long link_622X;
  struct image_location *v_621X;
  long next_620X;
  long link_619X;
  long symbol_618X;
  long v_617X;
  long link_616X;
  struct image_location *have_615X;
  long thing_614X;
  long id_613X;
  char * addr_612X;
  char * start_611X;
  long header_610X;
  struct image_location *have_609X;
  long thing_608X;
  struct image_location *v_607X;
  long thing_606X;
  long have_605X;
  long v_604X;
  long value_603X;
  struct image_location *have_602X;
  long thing_601X;
  long i_600X;
  long link_599X;
  struct image_location *v_598X;
  long next_597X;
  struct image_location **values_596X;
  long *keys_595X;
  struct table *table_594X;
  long symbol_593X;
  long have_592X;
  char v_591X;
  struct image_location *location_590X;
  long stob_589X;
  long link_588X;
  long v_587X;
  long v_586X;
  long i_585X;
  long table_584X;
  long i_583X;
  long i_582X;
  long i_581X;
  long v_580X;
  long v_579X;
  long v_578X;
  long v_577X;
  long n_576X;
  struct image_location *have_575X;
  long thing_574X;
  long v_573X;
  long n_572X;
  struct image_location *have_571X;
  long thing_570X;
  long v_569X;
  long n_568X;
  struct image_location *have_567X;
  long thing_566X;
  long v_565X;
  long cells_564X;
  long v_563X;
  long cells_562X;
  long v_561X;
  long cells_560X;
  long v_559X;
  long cells_558X;
  long v_557X;
  long cells_556X;
  long v_555X;
  long cells_554X;
  long v_553X;
  long cells_552X;
  long v_551X;
  long v_550X;
  long v_549X;
  long v_548X;
  long i_547X;
  long v_546X;
  struct image_location *image_location_545X;
  long stob_544X;
  struct image_location **values_543X;
  long *keys_542X;
  struct table *table_541X;
  long v_540X;
  long resumer_records_539X;
  long i_538X;
  struct image_location *image_location_537X;
  long stob_536X;
  long i_535X;
  long n_534X;
  long v_533X;
  long n_532X;
  long v_531X;
  long n_530X;
  long v_529X;
  struct table *stob_table_528X;
  long v_527X;
  long v_526X;
  long v_525X;
  long v_524X;
  struct image_location *last_523X;
  char * addr_522X;
  long next_521X;
  struct image_location *image_location_520X;
  char * start_519X;
  long link_518X;
  long entry_517X;
  long header_516X;
  long stob_515X;
  long link_514X;
  long i_513X;
  long table_512X;
  long resume_proc_511X;
  struct bibop_areas *v_510X;
  struct bibop_areas *bibop_areas_509X;
  struct table *v_508X;
  struct table *table_507X;
  long i_506X;
  long *keys_505X;
 {  keys_505X = (long*)malloc(sizeof(long) * 4097);
  arg0K0 = 0;
  goto L7728;}
 L7728: {
  i_506X = arg0K0;
  if ((i_506X < 4097)) {
    *(keys_505X + i_506X) = 0;
    arg0K0 = (1 + i_506X);
    goto L7728;}
  else {
    table_507X = (struct table*)malloc(sizeof(struct table));
    if ((NULL == table_507X)) {
      arg5K0 = table_507X;
      goto L7701;}
    else {
      table_507X->keys = keys_505X;
      table_507X->values = ((struct image_location**)malloc(sizeof(struct image_location*) * 4096));
      table_507X->count = 0;
      table_507X->size = 4096;
      arg5K0 = table_507X;
      goto L7701;}}}
 L7701: {
  v_508X = arg5K0;
  Sstob_tableS = v_508X;
  Sfirst_stobS = 1;
  Slast_stobS = (NULL);
  Sundumpable_recordsS = undumpables_499X;
  Sundumpable_countS = 0;
  Sresumer_countS = 0;
  small_image_start_address = (((long) (Snew_small_start_addrS)));
  Ssmall_image_beginS = (((char *) (small_image_start_address)));
  Ssmall_image_hpS = (((char *) (small_image_start_address)));
  Ssmall_image_endS = NULL;
  Slarge_image_beginS = (((char *) 0));
  Slarge_image_hpS = (((char *) 0));
  Slarge_image_endS = NULL;
  Sweaks_image_beginS = (((char *) 0));
  Sweaks_image_hpS = (((char *) 0));
  Sweaks_image_endS = NULL;
  bibop_areas_509X = (struct bibop_areas*)malloc(sizeof(struct bibop_areas));
  if ((NULL == bibop_areas_509X)) {
    arg7K0 = bibop_areas_509X;
    goto L5320;}
  else {
    bibop_areas_509X->small = ((long*)malloc(sizeof(long) * 1048576));
    bibop_areas_509X->small_index = 0;
    bibop_areas_509X->large = ((long*)malloc(sizeof(long) * 1048576));
    bibop_areas_509X->large_index = 0;
    bibop_areas_509X->weaks = ((long*)malloc(sizeof(long) * 1048576));
    bibop_areas_509X->weaks_index = 0;
    arg7K0 = bibop_areas_509X;
    goto L5320;}}
 L5320: {
  v_510X = arg7K0;
  Sbibop_areasS = v_510X;
  Straced_last_stobPS = 0;
  Simage_portS = port_500X;
  Simage_bufferS = ((char *)malloc(4096));
  Simage_buffer_pointerS = (Simage_bufferS);
  SstatusS = NO_ERRORS;
  if (((Simage_bufferS) == NULL)) {
    return ENOMEM;}
  else {
    resume_proc_511X = trace_image_value(resume_proc_498X);
    table_512X = s48_exported_bindings();
    arg0K0 = 0;
    goto L11435;}}
 L11435: {
  i_513X = arg0K0;
  if ((1024 == i_513X)) {
    arg0K0 = (Sfirst_stobS);
    goto L15368;}
  else {
    link_514X = *((long *) ((((char *) (-3 + table_512X))) + (((i_513X)<<2))));
    if ((0 == (3 & link_514X))) {
      arg0K0 = (3 + (-4 & link_514X));
      goto L11409;}
    else {
      arg0K0 = link_514X;
      goto L11409;}}}
 L15368: {
  stob_515X = arg0K0;
  header_516X = *((long *) ((((char *) (-3 + stob_515X))) + -4));
  if ((2 == (3 & header_516X))) {
    if (((31 & (((header_516X)>>2))) < 16)) {
      goto L15232;}
    else {
      goto L15370;}}
  else {
    goto L15232;}}
 L11409: {
  entry_517X = arg0K0;
  if ((1 == entry_517X)) {
    arg0K0 = (1 + i_513X);
    goto L11435;}
  else {trace_image_value(entry_517X);
    link_518X = *((long *) ((((char *) (-3 + entry_517X))) + 12));
    if ((0 == (3 & link_518X))) {
      arg0K0 = (3 + (-4 & link_518X));
      goto L11409;}
    else {
      arg0K0 = link_518X;
      goto L11409;}}}
 L15232: {
  if ((1078 == header_516X)) {
    goto L15370;}
  else {
    start_519X = ((char *) (-3 + stob_515X));
    arg1K0 = start_519X;
    goto L15251;}}
 L15370: {
  if ((0 < ((Sstob_tableS)->size))) {
    image_location_520X = table_ref((Sstob_tableS), stob_515X);
    next_521X = image_location_520X->next;
    if ((3 == (3 & next_521X))) {
      arg0K0 = next_521X;
      goto L15368;}
    else {
      goto L15440;}}
  else {
    goto L15440;}}
 L15251: {
  addr_522X = arg1K0;
  if ((addr_522X == (start_519X + (-4 & (3 + ((long)(((unsigned long)header_516X)>>8))))))) {
    goto L15370;}
  else {trace_image_value((*((long *) addr_522X)));
    arg1K0 = (addr_522X + 4);
    goto L15251;}}
 L15440: {
  last_523X = Slast_stobS;
  Straced_last_stobPS = 1;
  v_524X = s48_symbol_table();trace_image_value(v_524X);
  v_525X = s48_imported_bindings();trace_image_value(v_525X);
  v_526X = s48_exported_bindings();trace_image_value(v_526X);
  last_523X->next = 1;
  v_527X = image_alloc(0, ((((Sresumer_countS))<<2)));
  Sresumer_recordsS = v_527X;
  stob_table_528X = Sstob_tableS;
  v_529X = (Ssmall_image_hpS) - (Ssmall_image_beginS);
  if ((0 == v_529X)) {
    arg0K0 = 1;
    goto L7598;}
  else {
    arg0K0 = ((Ssmall_image_hpS) - (Ssmall_image_beginS));
    goto L7598;}}
 L7598: {
  n_530X = arg0K0;
  Ssmall_image_endS = ((Ssmall_image_beginS) + (-4096 & (4095 + n_530X)));
  v_531X = (Slarge_image_hpS) - (Slarge_image_beginS);
  if ((0 == v_531X)) {
    arg0K0 = 1;
    goto L7609;}
  else {
    arg0K0 = ((Slarge_image_hpS) - (Slarge_image_beginS));
    goto L7609;}}
 L7609: {
  n_532X = arg0K0;
  Slarge_image_endS = ((Slarge_image_beginS) + (-4096 & (4095 + n_532X)));
  v_533X = (Sweaks_image_hpS) - (Sweaks_image_beginS);
  if ((0 == v_533X)) {
    arg0K0 = 1;
    goto L7620;}
  else {
    arg0K0 = ((Sweaks_image_hpS) - (Sweaks_image_beginS));
    goto L7620;}}
 L7620: {
  n_534X = arg0K0;
  Sweaks_image_endS = ((Sweaks_image_beginS) + (-4096 & (4095 + n_534X)));
  arg0K0 = 0;
  goto L4951;}
 L4951: {
  i_535X = arg0K0;
  if ((i_535X == ((Sbibop_areasS)->large_index))) {
    Slarge_image_beginS = ((Ssmall_image_endS) + (((long) (Slarge_image_beginS))));
    Slarge_image_hpS = ((Ssmall_image_endS) + (((long) (Slarge_image_hpS))));
    Slarge_image_endS = ((Ssmall_image_endS) + (((long) (Slarge_image_endS))));
    arg0K0 = 0;
    goto L5086;}
  else {
    stob_536X = *(((Sbibop_areasS)->large) + i_535X);
    if ((3 == (3 & stob_536X))) {
      if ((1 == stob_536X)) {
        goto L4993;}
      else {
        image_location_537X = table_ref(stob_table_528X, stob_536X);
        image_location_537X->new_descriptor = (3 + (((long) ((Ssmall_image_endS) + (((long) (((char *) (-3 + (image_location_537X->new_descriptor))))))))));
        goto L4993;}}
    else {
      goto L4993;}}}
 L5086: {
  i_538X = arg0K0;
  if ((i_538X == ((Sbibop_areasS)->weaks_index))) {
    Sweaks_image_beginS = ((Slarge_image_endS) + (((long) (Sweaks_image_beginS))));
    Sweaks_image_hpS = ((Slarge_image_endS) + (((long) (Sweaks_image_hpS))));
    Sweaks_image_endS = ((Slarge_image_endS) + (((long) (Sweaks_image_endS))));
    if ((0 < ((Sstob_tableS)->size))) {
      resumer_records_539X = Sresumer_recordsS;
      if (((SstatusS) == NO_ERRORS)) {
        PS_WRITE_CHAR(10, port_500X, v_540X)
        SstatusS = v_540X;
        goto L6830;}
      else {
        goto L6830;}}
    else {
      table_541X = Sstob_tableS;
      keys_542X = table_541X->keys;
      values_543X = table_541X->values;
      arg0K0 = 0;
      goto L15754;}}
  else {
    stob_544X = *(((Sbibop_areasS)->weaks) + i_538X);
    if ((3 == (3 & stob_544X))) {
      if ((1 == stob_544X)) {
        goto L5128;}
      else {
        image_location_545X = table_ref(stob_table_528X, stob_544X);
        image_location_545X->new_descriptor = (3 + (((long) ((Slarge_image_endS) + (((long) (((char *) (-3 + (image_location_545X->new_descriptor))))))))));
        goto L5128;}}
    else {
      goto L5128;}}}
 L4993: {
  arg0K0 = (1 + i_535X);
  goto L4951;}
 L6830: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(12, (Simage_portS), v_546X)
    SstatusS = v_546X;
    goto L6832;}
  else {
    goto L6832;}}
 L15754: {
  i_547X = arg0K0;
  if ((i_547X == (table_541X->size))) {
    free(keys_542X);
    free(values_543X);
    free(table_541X);
    free((Simage_bufferS));
    return ENOMEM;}
  else {
    if ((0 == (*(keys_542X + i_547X)))) {
      goto L15756;}
    else {
      free((*(values_543X + i_547X)));
      goto L15756;}}}
 L5128: {
  arg0K0 = (1 + i_538X);
  goto L5086;}
 L6832: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, port_500X, v_548X)
    SstatusS = v_548X;
    goto L6841;}
  else {
    goto L6841;}}
 L15756: {
  arg0K0 = (1 + i_547X);
  goto L15754;}
 L6841: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_string("Vanilla 33", port_500X));
    goto L6848;}
  else {
    goto L6848;}}
 L6848: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, port_500X, v_549X)
    SstatusS = v_549X;
    goto L6857;}
  else {
    goto L6857;}}
 L6857: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(1, port_500X));
    goto L6864;}
  else {
    goto L6864;}}
 L6864: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, port_500X, v_550X)
    SstatusS = v_550X;
    goto L6873;}
  else {
    goto L6873;}}
 L6873: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(4, (Simage_portS)));
    goto L6936;}
  else {
    goto L6936;}}
 L6936: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_551X)
    SstatusS = v_551X;
    goto L6875;}
  else {
    goto L6875;}}
 L6875: {
  cells_552X = ((long) (Ssmall_image_beginS));
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer((((cells_552X)>>2)), (Simage_portS)));
    goto L6953;}
  else {
    goto L6953;}}
 L6953: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_553X)
    SstatusS = v_553X;
    goto L6879;}
  else {
    goto L6879;}}
 L6879: {
  cells_554X = ((long) (Ssmall_image_hpS));
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer((((cells_554X)>>2)), (Simage_portS)));
    goto L6970;}
  else {
    goto L6970;}}
 L6970: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_555X)
    SstatusS = v_555X;
    goto L6883;}
  else {
    goto L6883;}}
 L6883: {
  cells_556X = ((long) (Slarge_image_beginS));
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer((((cells_556X)>>2)), (Simage_portS)));
    goto L6987;}
  else {
    goto L6987;}}
 L6987: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_557X)
    SstatusS = v_557X;
    goto L6887;}
  else {
    goto L6887;}}
 L6887: {
  cells_558X = ((long) (Slarge_image_hpS));
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer((((cells_558X)>>2)), (Simage_portS)));
    goto L7004;}
  else {
    goto L7004;}}
 L7004: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_559X)
    SstatusS = v_559X;
    goto L6891;}
  else {
    goto L6891;}}
 L6891: {
  cells_560X = ((long) (Sweaks_image_beginS));
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer((((cells_560X)>>2)), (Simage_portS)));
    goto L7021;}
  else {
    goto L7021;}}
 L7021: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_561X)
    SstatusS = v_561X;
    goto L6895;}
  else {
    goto L6895;}}
 L6895: {
  cells_562X = ((long) (Sweaks_image_hpS));
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer((((cells_562X)>>2)), (Simage_portS)));
    goto L7038;}
  else {
    goto L7038;}}
 L7038: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_563X)
    SstatusS = v_563X;
    goto L6899;}
  else {
    goto L6899;}}
 L6899: {
  cells_564X = ((long) (Sweaks_image_endS));
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer((((cells_564X)>>2)), (Simage_portS)));
    goto L7055;}
  else {
    goto L7055;}}
 L7055: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_565X)
    SstatusS = v_565X;
    goto L6903;}
  else {
    goto L6903;}}
 L6903: {
  thing_566X = s48_symbol_table();
  if ((3 == (3 & thing_566X))) {
    have_567X = table_ref((Sstob_tableS), thing_566X);
    if ((NULL == have_567X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L15991;}
    else {
      goto L15991;}}
  else {
    arg0K0 = thing_566X;
    goto L6907;}}
 L15991: {
  arg0K0 = (have_567X->new_descriptor);
  goto L6907;}
 L6907: {
  n_568X = arg0K0;
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(n_568X, (Simage_portS)));
    goto L7069;}
  else {
    goto L7069;}}
 L7069: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_569X)
    SstatusS = v_569X;
    goto L6909;}
  else {
    goto L6909;}}
 L6909: {
  thing_570X = s48_imported_bindings();
  if ((3 == (3 & thing_570X))) {
    have_571X = table_ref((Sstob_tableS), thing_570X);
    if ((NULL == have_571X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L16005;}
    else {
      goto L16005;}}
  else {
    arg0K0 = thing_570X;
    goto L6913;}}
 L16005: {
  arg0K0 = (have_571X->new_descriptor);
  goto L6913;}
 L6913: {
  n_572X = arg0K0;
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(n_572X, (Simage_portS)));
    goto L7083;}
  else {
    goto L7083;}}
 L7083: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_573X)
    SstatusS = v_573X;
    goto L6915;}
  else {
    goto L6915;}}
 L6915: {
  thing_574X = s48_exported_bindings();
  if ((3 == (3 & thing_574X))) {
    have_575X = table_ref((Sstob_tableS), thing_574X);
    if ((NULL == have_575X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L16019;}
    else {
      goto L16019;}}
  else {
    arg0K0 = thing_574X;
    goto L6919;}}
 L16019: {
  arg0K0 = (have_575X->new_descriptor);
  goto L6919;}
 L6919: {
  n_576X = arg0K0;
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(n_576X, (Simage_portS)));
    goto L7097;}
  else {
    goto L7097;}}
 L7097: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_577X)
    SstatusS = v_577X;
    goto L6921;}
  else {
    goto L6921;}}
 L6921: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(resumer_records_539X, (Simage_portS)));
    goto L7111;}
  else {
    goto L7111;}}
 L7111: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_578X)
    SstatusS = v_578X;
    goto L6923;}
  else {
    goto L6923;}}
 L6923: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(resume_proc_511X, (Simage_portS)));
    goto L7125;}
  else {
    goto L7125;}}
 L7125: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_579X)
    SstatusS = v_579X;
    goto L6925;}
  else {
    goto L6925;}}
 L6925: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(12, (Simage_portS), v_580X)
    SstatusS = v_580X;
    goto L15655;}
  else {
    goto L15655;}}
 L15655: {
write_descriptor(1);
  arg0K0 = 0;
  goto L4451;}
 L4451: {
  i_581X = arg0K0;
  if ((i_581X == ((Sbibop_areasS)->weaks_index))) {
    goto L4439;}
  else {
    if ((1 == (*(((Sbibop_areasS)->weaks) + i_581X)))) {
      goto L4439;}
    else {
      merged_arg0K0 = (*(((Sbibop_areasS)->weaks) + i_581X));
      write_stob_return_tag = 0;
      goto write_stob;
     write_stob_return_0:
      arg0K0 = (1 + i_581X);
      goto L4451;}}}
 L4439: {
  arg0K0 = 0;
  goto L4470;}
 L4470: {
  i_582X = arg0K0;
  if ((i_582X == ((Sbibop_areasS)->large_index))) {
    goto L4441;}
  else {
    if ((1 == (*(((Sbibop_areasS)->large) + i_582X)))) {
      goto L4441;}
    else {
      merged_arg0K0 = (*(((Sbibop_areasS)->large) + i_582X));
      write_stob_return_tag = 1;
      goto write_stob;
     write_stob_return_1:
      arg0K0 = (1 + i_582X);
      goto L4470;}}}
 L4441: {
  arg0K0 = 0;
  goto L4489;}
 L4489: {
  i_583X = arg0K0;
  if ((i_583X == ((Sbibop_areasS)->small_index))) {
    goto L14857;}
  else {
    if ((1 == (*(((Sbibop_areasS)->small) + i_583X)))) {
      goto L14857;}
    else {
      merged_arg0K0 = (*(((Sbibop_areasS)->small) + i_583X));
      write_stob_return_tag = 2;
      goto write_stob;
     write_stob_return_2:
      arg0K0 = (1 + i_583X);
      goto L4489;}}}
 L14857: {
  table_584X = s48_symbol_table();write_descriptor((*((long *) ((((char *) (-3 + table_584X))) + -4))));
  arg0K0 = 0;
  goto L11608;}
 L11608: {
  i_585X = arg0K0;
  if ((i_585X == ((((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + table_584X))) + -4))))>>8))))>>2)))) {
    v_586X = s48_imported_bindings();
    merged_arg0K0 = v_586X;
    write_shared_table_return_tag = 0;
    goto write_shared_table;
   write_shared_table_return_0:
    v_587X = s48_exported_bindings();
    merged_arg0K0 = v_587X;
    write_shared_table_return_tag = 1;
    goto write_shared_table;
   write_shared_table_return_1:write_descriptor((10 + ((((Sresumer_countS))<<10))));
    arg0K0 = (Sfirst_stobS);
    goto L14878;}
  else {
    link_588X = *((long *) ((((char *) (-3 + table_584X))) + (((i_585X)<<2))));
    if ((0 == (3 & link_588X))) {
      arg0K0 = (3 + (-4 & link_588X));
      goto L11618;}
    else {
      arg0K0 = link_588X;
      goto L11618;}}}
 L14878: {
  stob_589X = arg0K0;
  if ((3 == (3 & stob_589X))) {
    location_590X = table_ref((Sstob_tableS), stob_589X);
    v_591X = resumer_recordP(stob_589X);
    if (v_591X) {write_descriptor((location_590X->new_descriptor));
      goto L14885;}
    else {
      goto L14885;}}
  else {
    have_592X = (Simage_buffer_pointerS) - (Simage_bufferS);
    if ((0 < have_592X)) {
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_592X));
        goto L15700;}
      else {
        goto L15700;}}
    else {
      goto L15661;}}}
 L11618: {
  symbol_593X = arg0K0;
  arg0K0 = symbol_593X;
  goto L11652;}
 L14885: {
  arg0K0 = (location_590X->next);
  goto L14878;}
 L15700: {
  Simage_buffer_pointerS = (Simage_bufferS);
  goto L15661;}
 L15661: {
  table_594X = Sstob_tableS;
  keys_595X = table_594X->keys;
  values_596X = table_594X->values;
  arg0K0 = 0;
  goto L15720;}
 L11652: {
  next_597X = arg0K0;
  if ((3 == (3 & next_597X))) {
    v_598X = table_ref((Sstob_tableS), next_597X);
    if ((NULL == v_598X)) {
      link_599X = *((long *) ((((char *) (-3 + next_597X))) + 4));
      if ((0 == (3 & link_599X))) {
        arg0K0 = (3 + (-4 & link_599X));
        goto L11652;}
      else {
        arg0K0 = link_599X;
        goto L11652;}}
    else {
      arg0K0 = next_597X;
      goto L11620;}}
  else {
    arg0K0 = next_597X;
    goto L11620;}}
 L15720: {
  i_600X = arg0K0;
  if ((i_600X == (table_594X->size))) {
    free(keys_595X);
    free(values_596X);
    free(table_594X);
    free((Simage_bufferS));
    return (SstatusS);}
  else {
    if ((0 == (*(keys_595X + i_600X)))) {
      goto L15722;}
    else {
      free((*(values_596X + i_600X)));
      goto L15722;}}}
 L11620: {
  thing_601X = arg0K0;
  if ((3 == (3 & thing_601X))) {
    have_602X = table_ref((Sstob_tableS), thing_601X);
    if ((NULL == have_602X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L11671;}
    else {
      goto L11671;}}
  else {
    arg0K0 = thing_601X;
    goto L11622;}}
 L15722: {
  arg0K0 = (1 + i_600X);
  goto L15720;}
 L11671: {
  arg0K0 = (have_602X->new_descriptor);
  goto L11622;}
 L11622: {
  value_603X = arg0K0;
  if ((3 == (3 & value_603X))) {
    arg0K0 = (-4 & value_603X);
    goto L11624;}
  else {
    arg0K0 = value_603X;
    goto L11624;}}
 L11624: {
  v_604X = arg0K0;write_descriptor(v_604X);
  arg0K0 = (1 + i_585X);
  goto L11608;}
 copy_image_data: {
  start_503X = merged_arg1K0;
  size_504X = merged_arg0K1;{
  memmove((void *)(Simage_buffer_pointerS), (void *)start_503X,size_504X);
  Simage_buffer_pointerS = ((Simage_buffer_pointerS) + size_504X);
  if ((4096 == ((Simage_buffer_pointerS) - (Simage_bufferS)))) {
    have_605X = (Simage_buffer_pointerS) - (Simage_bufferS);
    if ((0 < have_605X)) {
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_605X));
        goto L7337;}
      else {
        goto L7337;}}
    else {
      goto copy_image_data_return;}}
  else {
    goto copy_image_data_return;}}
 L7337: {
  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;
  }}

 write_stob: {
  stob_502X = merged_arg0K0;{
  if ((3 == (3 & stob_502X))) {
    if ((13 == (31 & ((((*((long *) ((((char *) (-3 + stob_502X))) + -4))))>>2))))) {write_descriptor(1078);
      thing_606X = *((long *) (((char *) (-3 + stob_502X))));
      if ((3 == (3 & thing_606X))) {
        v_607X = table_ref((Sstob_tableS), thing_606X);
        if ((NULL == v_607X)) {
          write_descriptor(1);
          goto write_stob_return;}
        else {
          goto L13495;}}
      else {
        goto L13495;}}
    else {
      goto L13501;}}
  else {
    goto L13501;}}
 L13495: {
  thing_608X = *((long *) (((char *) (-3 + stob_502X))));
  if ((3 == (3 & thing_608X))) {
    have_609X = table_ref((Sstob_tableS), thing_608X);
    if ((NULL == have_609X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L13559;}
    else {
      goto L13559;}}
  else {
    write_descriptor(thing_608X);
    goto write_stob_return;}}
 L13501: {
  if ((3 == (3 & stob_502X))) {
    if ((6 == (31 & ((((*((long *) ((((char *) (-3 + stob_502X))) + -4))))>>2))))) {
      header_610X = *((long *) ((((char *) (-3 + stob_502X))) + -4));write_descriptor(header_610X);write_descriptor(0);
      start_611X = (((char *) (-3 + stob_502X))) + 4;
      arg1K0 = start_611X;
      goto L10675;}
    else {
      goto L13505;}}
  else {
    goto L13505;}}
 L13559: {
  write_descriptor((have_609X->new_descriptor));
  goto write_stob_return;}
 L10675: {
  addr_612X = arg1K0;
  if ((addr_612X == (start_611X + (-4 + (-4 & (3 + ((long)(((unsigned long)header_610X)>>8)))))))) {
    ps_write_string("Channel closed in dumped image: ", (stderr));
    id_613X = *((long *) ((((char *) (-3 + stob_502X))) + 4));
    if ((0 == (3 & id_613X))) {
      ps_write_integer((((id_613X)>>2)), (stderr));
      goto L10652;}
    else {
      ps_write_string((((char *)(((char *) (-3 + id_613X))))), (stderr));
      goto L10652;}}
  else {
    thing_614X = *((long *) addr_612X);
    if ((3 == (3 & thing_614X))) {
      have_615X = table_ref((Sstob_tableS), thing_614X);
      if ((NULL == have_615X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L10689;}
      else {
        goto L10689;}}
    else {
      arg0K0 = thing_614X;
      goto L10680;}}}
 L13505: {
  if ((3 == (3 & stob_502X))) {
    if ((1 == (31 & ((((*((long *) ((((char *) (-3 + stob_502X))) + -4))))>>2))))) {
      link_616X = *((long *) ((((char *) (-3 + stob_502X))) + 4));
      if ((0 == (3 & link_616X))) {
        arg0K0 = (3 + (-4 & link_616X));
        goto L12454;}
      else {
        arg0K0 = link_616X;
        goto L12454;}}
    else {
      goto L13509;}}
  else {
    goto L13509;}}
 L10652: {
  { long ignoreXX;
  PS_WRITE_CHAR(10, (stderr), ignoreXX) }
  goto write_stob_return;}
 L10689: {
  arg0K0 = (have_615X->new_descriptor);
  goto L10680;}
 L10680: {
  v_617X = arg0K0;write_descriptor(v_617X);
  arg1K0 = (addr_612X + 4);
  goto L10675;}
 L12454: {
  symbol_618X = arg0K0;
  arg0K0 = symbol_618X;
  goto L12487;}
 L13509: {
  if ((3 == (3 & stob_502X))) {
    if ((14 == (31 & ((((*((long *) ((((char *) (-3 + stob_502X))) + -4))))>>2))))) {
      link_619X = *((long *) ((((char *) (-3 + stob_502X))) + 12));
      if ((0 == (3 & link_619X))) {
        arg0K0 = (3 + (-4 & link_619X));
        goto L12297;}
      else {
        arg0K0 = link_619X;
        goto L12297;}}
    else {
      goto L13513;}}
  else {
    goto L13513;}}
 L12487: {
  next_620X = arg0K0;
  if ((3 == (3 & next_620X))) {
    v_621X = table_ref((Sstob_tableS), next_620X);
    if ((NULL == v_621X)) {
      link_622X = *((long *) ((((char *) (-3 + next_620X))) + 4));
      if ((0 == (3 & link_622X))) {
        arg0K0 = (3 + (-4 & link_622X));
        goto L12487;}
      else {
        arg0K0 = link_622X;
        goto L12487;}}
    else {
      arg0K0 = next_620X;
      goto L12456;}}
  else {
    arg0K0 = next_620X;
    goto L12456;}}
 L12297: {
  shared_623X = arg0K0;
  arg0K0 = shared_623X;
  goto L12346;}
 L13513: {
  header_624X = *((long *) ((((char *) (-3 + stob_502X))) + -4));
  start_625X = ((char *) (-3 + stob_502X));write_descriptor(header_624X);
  if ((2 == (3 & header_624X))) {
    if (((31 & (((header_624X)>>2))) < 16)) {
      goto L13529;}
    else {
      size_626X = -4 & (3 + ((long)(((unsigned long)header_624X)>>8)));
      available_627X = 4096 - ((Simage_buffer_pointerS) - (Simage_bufferS));
      if ((available_627X < size_626X)) {
        if ((4096 < size_626X)) {
          have_628X = (Simage_buffer_pointerS) - (Simage_bufferS);
          if ((0 < have_628X)) {
            if (((SstatusS) == NO_ERRORS)) {
              SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_628X));
              goto L9741;}
            else {
              goto L9741;}}
          else {
            goto L9715;}}
        else {
          merged_arg1K0 = start_625X;
          merged_arg0K1 = available_627X;
          copy_image_data_return_tag = 0;
          goto copy_image_data;
         copy_image_data_return_0:
          merged_arg1K0 = (start_625X + available_627X);
          merged_arg0K1 = (size_626X - available_627X);
          copy_image_data_return_tag = 1;
          goto copy_image_data;
         copy_image_data_return_1:
          goto write_stob_return;}}
      else {
        merged_arg1K0 = start_625X;
        merged_arg0K1 = size_626X;
        copy_image_data_return_tag = 2;
        goto copy_image_data;
       copy_image_data_return_2:
        goto write_stob_return;}}}
  else {
    goto L13529;}}
 L12456: {
  next_629X = arg0K0;
  header_630X = *((long *) ((((char *) (-3 + stob_502X))) + -4));write_descriptor(header_630X);
  start_631X = ((char *) (-3 + stob_502X));
  arg1K0 = start_631X;
  goto L12516;}
 L12346: {
  next_632X = arg0K0;
  if ((3 == (3 & next_632X))) {
    v_633X = table_ref((Sstob_tableS), next_632X);
    if ((NULL == v_633X)) {
      link_634X = *((long *) ((((char *) (-3 + next_632X))) + 12));
      if ((0 == (3 & link_634X))) {
        arg0K0 = (3 + (-4 & link_634X));
        goto L12346;}
      else {
        arg0K0 = link_634X;
        goto L12346;}}
    else {
      arg0K0 = next_632X;
      goto L12299;}}
  else {
    arg0K0 = next_632X;
    goto L12299;}}
 L13529: {
  arg1K0 = start_625X;
  goto L13631;}
 L9741: {
  Simage_buffer_pointerS = (Simage_bufferS);
  goto L9715;}
 L9715: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_block((Simage_portS), ((char *) start_625X), size_626X));
    goto write_stob_return;}
  else {
    goto write_stob_return;}}
 L12516: {
  addr_635X = arg1K0;
  if ((addr_635X == (start_631X + (-4 + (-4 & (3 + ((long)(((unsigned long)header_630X)>>8)))))))) {
    if ((3 == (3 & next_629X))) {
      have_636X = table_ref((Sstob_tableS), next_629X);
      if ((NULL == have_636X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L12546;}
      else {
        goto L12546;}}
    else {
      arg0K0 = next_629X;
      goto L12469;}}
  else {
    thing_637X = *((long *) addr_635X);
    if ((3 == (3 & thing_637X))) {
      have_638X = table_ref((Sstob_tableS), thing_637X);
      if ((NULL == have_638X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L12530;}
      else {
        goto L12530;}}
    else {
      arg0K0 = thing_637X;
      goto L12521;}}}
 L12299: {
  next_639X = arg0K0;
  header_640X = *((long *) ((((char *) (-3 + stob_502X))) + -4));write_descriptor(header_640X);
  start_641X = ((char *) (-3 + stob_502X));
  arg1K0 = start_641X;
  goto L12375;}
 L13631: {
  addr_642X = arg1K0;
  if ((addr_642X == (start_625X + (-4 & (3 + ((long)(((unsigned long)header_624X)>>8))))))) {
    goto write_stob_return;}
  else {
    thing_643X = *((long *) addr_642X);
    if ((3 == (3 & thing_643X))) {
      have_644X = table_ref((Sstob_tableS), thing_643X);
      if ((NULL == have_644X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L13645;}
      else {
        goto L13645;}}
    else {
      arg0K0 = thing_643X;
      goto L13636;}}}
 L12546: {
  arg0K0 = (have_636X->new_descriptor);
  goto L12469;}
 L12469: {
  value_645X = arg0K0;
  if ((3 == (3 & value_645X))) {
    write_descriptor((-4 & value_645X));
    goto write_stob_return;}
  else {
    write_descriptor(value_645X);
    goto write_stob_return;}}
 L12530: {
  arg0K0 = (have_638X->new_descriptor);
  goto L12521;}
 L12521: {
  v_646X = arg0K0;write_descriptor(v_646X);
  arg1K0 = (addr_635X + 4);
  goto L12516;}
 L12375: {
  addr_647X = arg1K0;
  if ((addr_647X == (start_641X + (-8 + (-4 & (3 + ((long)(((unsigned long)header_640X)>>8)))))))) {
    x_648X = *((long *) ((((char *) (-3 + stob_502X))) + 4));
    if ((5 == x_648X)) {
      arg0K0 = 529;
      goto L12324;}
    else {
      thing_649X = *((long *) ((((char *) (-3 + stob_502X))) + 8));
      if ((3 == (3 & thing_649X))) {
        have_650X = table_ref((Sstob_tableS), thing_649X);
        if ((NULL == have_650X)) {
          ps_error("traced object has no descriptor in image", 0);
          goto L12436;}
        else {
          goto L12436;}}
      else {
        arg0K0 = thing_649X;
        goto L12324;}}}
  else {
    thing_651X = *((long *) addr_647X);
    if ((3 == (3 & thing_651X))) {
      have_652X = table_ref((Sstob_tableS), thing_651X);
      if ((NULL == have_652X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L12389;}
      else {
        goto L12389;}}
    else {
      arg0K0 = thing_651X;
      goto L12380;}}}
 L13645: {
  arg0K0 = (have_644X->new_descriptor);
  goto L13636;}
 L13636: {
  v_653X = arg0K0;write_descriptor(v_653X);
  arg1K0 = (addr_642X + 4);
  goto L13631;}
 L12324: {
  v_654X = arg0K0;write_descriptor(v_654X);
  if ((3 == (3 & next_639X))) {
    have_655X = table_ref((Sstob_tableS), next_639X);
    if ((NULL == have_655X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L12412;}
    else {
      goto L12412;}}
  else {
    arg0K0 = next_639X;
    goto L12328;}}
 L12436: {
  arg0K0 = (have_650X->new_descriptor);
  goto L12324;}
 L12389: {
  arg0K0 = (have_652X->new_descriptor);
  goto L12380;}
 L12380: {
  v_656X = arg0K0;write_descriptor(v_656X);
  arg1K0 = (addr_647X + 4);
  goto L12375;}
 L12412: {
  arg0K0 = (have_655X->new_descriptor);
  goto L12328;}
 L12328: {
  value_657X = arg0K0;
  if ((3 == (3 & value_657X))) {
    write_descriptor((-4 & value_657X));
    goto write_stob_return;}
  else {
    write_descriptor(value_657X);
    goto write_stob_return;}}
 write_stob_return:
  switch (write_stob_return_tag) {
  case 0: goto write_stob_return_0;
  case 1: goto write_stob_return_1;
  default: goto write_stob_return_2;
  }}

 write_shared_table: {
  table_501X = merged_arg0K0;{write_descriptor((*((long *) ((((char *) (-3 + table_501X))) + -4))));
  arg0K0 = 0;
  goto L11518;}
 L11518: {
  i_658X = arg0K0;
  temp_659X = i_658X == ((((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + table_501X))) + -4))))>>8))))>>2));
  if (temp_659X) {
    write_shared_table0_return_value = temp_659X;
    goto write_shared_table_return;}
  else {
    link_660X = *((long *) ((((char *) (-3 + table_501X))) + (((i_658X)<<2))));
    if ((0 == (3 & link_660X))) {
      arg0K0 = (3 + (-4 & link_660X));
      goto L11528;}
    else {
      arg0K0 = link_660X;
      goto L11528;}}}
 L11528: {
  shared_661X = arg0K0;
  arg0K0 = shared_661X;
  goto L11562;}
 L11562: {
  next_662X = arg0K0;
  if ((3 == (3 & next_662X))) {
    v_663X = table_ref((Sstob_tableS), next_662X);
    if ((NULL == v_663X)) {
      link_664X = *((long *) ((((char *) (-3 + next_662X))) + 12));
      if ((0 == (3 & link_664X))) {
        arg0K0 = (3 + (-4 & link_664X));
        goto L11562;}
      else {
        arg0K0 = link_664X;
        goto L11562;}}
    else {
      arg0K0 = next_662X;
      goto L11530;}}
  else {
    arg0K0 = next_662X;
    goto L11530;}}
 L11530: {
  thing_665X = arg0K0;
  if ((3 == (3 & thing_665X))) {
    have_666X = table_ref((Sstob_tableS), thing_665X);
    if ((NULL == have_666X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L11581;}
    else {
      goto L11581;}}
  else {
    arg0K0 = thing_665X;
    goto L11532;}}
 L11581: {
  arg0K0 = (have_666X->new_descriptor);
  goto L11532;}
 L11532: {
  value_667X = arg0K0;
  if ((3 == (3 & value_667X))) {
    arg0K0 = (-4 & value_667X);
    goto L11534;}
  else {
    arg0K0 = value_667X;
    goto L11534;}}
 L11534: {
  v_668X = arg0K0;write_descriptor(v_668X);
  arg0K0 = (1 + i_658X);
  goto L11518;}
 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;
  }}

}void
s48_heap_init(void)
{
Smax_heap_sizeS = 0;
Smin_heap_sizeS = 0;
Snew_small_start_addrS = NULL;
Snew_large_start_addrS = NULL;
Snew_weaks_start_addrS = NULL;
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;
small_image_start_address = 0;
Straced_last_stobPS = 0;
Sstob_table_obj_nrS = 0;
}
