#include <stdio.h>
#include "prescheme.h"
#include "scheme48vm-prelude.h"
#include "scheme48vm.h"
#include "scheme48heap.h"

struct image_location {
  long new_descriptor;
  long next;
};
struct table {
  long *keys;
  struct image_location **values;
  long count;
  long size;
};
static struct image_location *table_ref(struct table*, long);
static char resumer_recordP(long);
static long trace_image_value(long);
long s48_write_image(long, long, FILE *);
static long SstatusS;
static FILE * Simage_portS;
static char * Simage_bufferS;
static char * Simage_buffer_pointerS;
static struct table *Sstob_tableS;
static long Sfirst_stobS;
static struct image_location *Slast_stobS;
static char * Simage_beginS;
static char * Simage_hpS;
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 L1575;}
  else {
    return (NULL);}}
 L1575: {
  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 L1575;}
      else {
        return (NULL);}}
    else {
      arg0K0 = (1 + i_4X);
      goto L1575;}}}
}
static char resumer_recordP(long stob_6X)
{
  long type_7X;
 {  if ((3 == (3 & stob_6X))) {
    if ((9 == (31 & ((((*((long *) ((((char *) (-3 + stob_6X))) + -4))))>>2))))) {
      type_7X = *((long *) (((char *) (-3 + stob_6X))));
      if ((3 == (3 & type_7X))) {
        if ((9 == (31 & ((((*((long *) ((((char *) (-3 + type_7X))) + -4))))>>2))))) {
          return (3 == (3 & (*((long *) ((((char *) (-3 + type_7X))) + 4)))));}
        else {
          return 0;}}
      else {
        return 0;}}
    else {
      return 0;}}
  else {
    return 0;}}
}
static long trace_image_value(long thing_8X)
{
  long arg0K0;
  struct image_location *arg1K0;
  struct image_location *merged_arg1K2;
  long merged_arg0K0;
  long merged_arg0K1;
  struct table *merged_arg2K0;

  int table_setB_return_tag;
  int gc_recordP_return_tag;
  char gc_recordP0_return_value;
  struct table *table_9X;
  long key_10X;
  struct image_location *value_11X;
  long x_12X;
  long i_47X;
  struct image_location *value_46X;
  long key_45X;
  long i_44X;
  long i_43X;
  struct image_location **new_values_42X;
  long *new_keys_41X;
  long new_size_40X;
  struct image_location **old_values_39X;
  long v_38X;
  long old_size_37X;
  long *old_keys_36X;
  long next_35X;
  long i_34X;
  long *keys_33X;
  long size_32X;
  long header_31X;
  char v_30X;
  long x_29X;
  struct image_location *new_28X;
  struct image_location *new_27X;
  struct image_location *image_location_26X;
  long new_descriptor_25X;
  char * data_addr_24X;
  long h_23X;
  long stob_22X;
  struct image_location *image_location_21X;
  long new_alias_20X;
  long i_19X;
  long len_18X;
  long vector_17X;
  char v_16X;
  long type_15X;
  char v_14X;
  struct image_location *have_13X;
 {  if ((3 == (3 & thing_8X))) {
    have_13X = table_ref((Sstob_tableS), thing_8X);
    if ((NULL == have_13X)) {
      merged_arg0K0 = thing_8X;
      gc_recordP_return_tag = 0;
      goto gc_recordP;
     gc_recordP_return_0:
      v_14X = gc_recordP0_return_value;
      if (v_14X) {
        type_15X = *((long *) (((char *) (-3 + thing_8X))));
        merged_arg0K0 = type_15X;
        gc_recordP_return_tag = 1;
        goto gc_recordP;
       gc_recordP_return_1:
        v_16X = gc_recordP0_return_value;
        if (v_16X) {
          if ((1 == (*((long *) ((((char *) (-3 + type_15X))) + 4))))) {
            if (((Sundumpable_countS) < ((((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + (Sundumpable_recordsS)))) + -4))))>>8))))>>2)))) {
              vector_17X = Sundumpable_recordsS;
              len_18X = (((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + vector_17X))) + -4))))>>8))))>>2);
              arg0K0 = 0;
              goto L3788;}
            else {
              goto L5039;}}
          else {
            arg0K0 = thing_8X;
            goto L4139;}}
        else {
          arg0K0 = thing_8X;
          goto L4139;}}
      else {
        arg0K0 = thing_8X;
        goto L4139;}}
    else {
      return (have_13X->new_descriptor);}}
  else {
    return thing_8X;}}
 L3788: {
  i_19X = arg0K0;
  if ((i_19X == len_18X)) {
    *((long *) ((((char *) (-3 + (Sundumpable_recordsS)))) + ((((Sundumpable_countS))<<2)))) = (long) (thing_8X);
    Sundumpable_countS = (1 + (Sundumpable_countS));
    goto L5039;}
  else {
    if (((*((long *) ((((char *) (-3 + vector_17X))) + (((i_19X)<<2))))) == thing_8X)) {
      goto L5039;}
    else {
      arg0K0 = (1 + i_19X);
      goto L3788;}}}
 L5039: {
  new_alias_20X = trace_image_value((*((long *) ((((char *) (-3 + thing_8X))) + 4))));
  image_location_21X = (struct image_location*)malloc(sizeof(struct image_location));
  if ((NULL == image_location_21X)) {
    arg1K0 = image_location_21X;
    goto L5043;}
  else {
    image_location_21X->new_descriptor = new_alias_20X;
    image_location_21X->next = 0;
    arg1K0 = image_location_21X;
    goto L5043;}}
 L4139: {
  stob_22X = arg0K0;
  h_23X = *((long *) ((((char *) (-3 + stob_22X))) + -4));
  data_addr_24X = (Simage_hpS) + 4;
  Simage_hpS = (data_addr_24X + (-4 & (3 + ((long)(((unsigned long)h_23X)>>8)))));
  new_descriptor_25X = 3 + (((long) data_addr_24X));
  image_location_26X = (struct image_location*)malloc(sizeof(struct image_location));
  if ((NULL == image_location_26X)) {
    arg1K0 = image_location_26X;
    goto L4149;}
  else {
    image_location_26X->new_descriptor = new_descriptor_25X;
    image_location_26X->next = 0;
    arg1K0 = image_location_26X;
    goto L4149;}}
 L5043: {
  new_27X = arg1K0;
  if ((NULL == new_27X)) {
    (Sstob_tableS)->size = 0;
    return new_alias_20X;}
  else {
    merged_arg2K0 = (Sstob_tableS);
    merged_arg0K1 = thing_8X;
    merged_arg1K2 = new_27X;
    table_setB_return_tag = 0;
    goto table_setB;
   table_setB_return_0:
    return new_alias_20X;}}
 L4149: {
  new_28X = arg1K0;
  if ((NULL == new_28X)) {
    (Sstob_tableS)->size = 0;
    return new_descriptor_25X;}
  else {
    x_29X = Sfirst_stobS;
    if ((1 == x_29X)) {
      Sfirst_stobS = stob_22X;
      goto L4168;}
    else {
      (Slast_stobS)->next = stob_22X;
      goto L4168;}}}
 L4168: {
  Slast_stobS = new_28X;
  new_28X->next = 1;
  merged_arg2K0 = (Sstob_tableS);
  merged_arg0K1 = stob_22X;
  merged_arg1K2 = new_28X;
  table_setB_return_tag = 1;
  goto table_setB;
 table_setB_return_1:
  v_30X = resumer_recordP(stob_22X);
  if (v_30X) {
    Sresumer_countS = (1 + (Sresumer_countS));
    return new_descriptor_25X;}
  else {
    return new_descriptor_25X;}}
 gc_recordP: {
  x_12X = merged_arg0K0;{
  if ((3 == (3 & x_12X))) {
    header_31X = *((long *) ((((char *) (-3 + x_12X))) + -4));
    if ((3 == (3 & header_31X))) {
      if ((3 == (3 & header_31X))) {
        gc_recordP0_return_value = (9 == (31 & ((((*((long *) ((((char *) (-3 + header_31X))) + -4))))>>2))));
        goto gc_recordP_return;}
      else {
        gc_recordP0_return_value = 0;
        goto gc_recordP_return;}}
    else {
      if ((3 == (3 & x_12X))) {
        gc_recordP0_return_value = (9 == (31 & ((((*((long *) ((((char *) (-3 + x_12X))) + -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;
  }}

 table_setB: {
  table_9X = merged_arg2K0;
  key_10X = merged_arg0K1;
  value_11X = merged_arg1K2;{
  if ((0 < (table_9X->size))) {
    size_32X = table_9X->size;
    keys_33X = table_9X->keys;
    arg0K0 = ((key_10X ^ ((((key_10X)<<1)) ^ (((key_10X)>>10)))) & (-1 + size_32X));
    goto L2670;}
  else {
    goto table_setB_return;}}
 L2670: {
  i_34X = arg0K0;
  next_35X = *(keys_33X + i_34X);
  if ((key_10X == next_35X)) {
    *((table_9X->values) + i_34X) = value_11X;
    goto table_setB_return;}
  else {
    if ((0 == next_35X)) {
      if ((i_34X == (table_9X->size))) {
        arg0K0 = 0;
        goto L2670;}
      else {
        *((table_9X->keys) + i_34X) = key_10X;
        *((table_9X->values) + i_34X) = value_11X;
        table_9X->count = (1 + (table_9X->count));
        if (((table_9X->count) == ((table_9X->size) / 3))) {
          old_keys_36X = table_9X->keys;
          old_size_37X = table_9X->size;
          v_38X = table_9X->size;
          old_values_39X = table_9X->values;
          new_size_40X = ((v_38X)<<1);
          new_keys_41X = (long*)malloc(sizeof(long) * (1 + new_size_40X));
          new_values_42X = (struct image_location**)malloc(sizeof(struct image_location*) * new_size_40X);
          if ((NULL == new_keys_41X)) {
            goto L1848;}
          else {
            if ((NULL == new_values_42X)) {
              goto L1848;}
            else {
              table_9X->keys = new_keys_41X;
              table_9X->values = new_values_42X;
              table_9X->size = new_size_40X;
              table_9X->count = 0;
              arg0K0 = 0;
              goto L2001;}}}
        else {
          goto table_setB_return;}}}
    else {
      arg0K0 = (1 + i_34X);
      goto L2670;}}}
 L1848: {
  if ((NULL == new_keys_41X)) {
    goto L1856;}
  else {
    free(new_keys_41X);
    goto L1856;}}
 L2001: {
  i_43X = arg0K0;
  if ((i_43X < (1 + new_size_40X))) {
    *(new_keys_41X + i_43X) = 0;
    arg0K0 = (1 + i_43X);
    goto L2001;}
  else {
    arg0K0 = 0;
    goto L1879;}}
 L1856: {
  if ((NULL == new_values_42X)) {
    goto L1864;}
  else {
    free(new_values_42X);
    goto L1864;}}
 L1879: {
  i_44X = arg0K0;
  if ((i_44X == old_size_37X)) {
    free(old_keys_36X);
    free(old_values_39X);
    goto table_setB_return;}
  else {
    key_45X = *(old_keys_36X + i_44X);
    if ((0 == key_45X)) {
      goto L1895;}
    else {
      value_46X = *(old_values_39X + i_44X);
      arg0K0 = ((key_45X ^ ((((key_45X)<<1)) ^ (((key_45X)>>10)))) & (-1 + new_size_40X));
      goto L2023;}}}
 L1864: {
  table_9X->size = 0;
  goto table_setB_return;}
 L1895: {
  arg0K0 = (1 + i_44X);
  goto L1879;}
 L2023: {
  i_47X = arg0K0;
  if ((0 == (*(new_keys_41X + i_47X)))) {
    if ((i_47X == new_size_40X)) {
      arg0K0 = 0;
      goto L2023;}
    else {
      *(new_keys_41X + i_47X) = key_45X;
      *(new_values_42X + i_47X) = value_46X;
      goto L1895;}}
  else {
    arg0K0 = (1 + i_47X);
    goto L2023;}}
 table_setB_return:
  switch (table_setB_return_tag) {
  case 0: goto table_setB_return_0;
  default: goto table_setB_return_1;
  }}

}
long s48_write_image(long resume_proc_48X, long undumpables_49X, FILE * port_50X)
{
  struct table *arg2K0;
  long arg0K0;
  char * arg3K0;
  long merged_arg0K0;
  long merged_arg0K1;
  char * merged_arg3K0;

  int copy_image_data_return_tag;
  int write_descriptor_return_tag;
  int write_shared_table_return_tag;
  char write_shared_table0_return_value;
  char * start_51X;
  long size_52X;
  long descriptor_53X;
  long table_54X;
  long have_193X;
  long have_192X;
  long v_191X;
  long value_190X;
  struct image_location *have_189X;
  long thing_188X;
  long link_187X;
  struct image_location *v_186X;
  long next_185X;
  long shared_184X;
  long link_183X;
  char temp_182X;
  long i_181X;
  long value_180X;
  long v_179X;
  struct image_location *have_178X;
  long v_177X;
  long v_176X;
  struct image_location *have_175X;
  long thing_174X;
  struct image_location *have_173X;
  long thing_172X;
  long x_171X;
  char * addr_170X;
  long v_169X;
  long value_168X;
  struct image_location *have_167X;
  long thing_166X;
  char * addr_165X;
  char * start_164X;
  long header_163X;
  long next_162X;
  struct image_location *have_161X;
  long thing_160X;
  struct image_location *have_159X;
  char * addr_158X;
  long v_157X;
  long link_156X;
  struct image_location *v_155X;
  long next_154X;
  char * start_153X;
  long header_152X;
  long next_151X;
  long value_150X;
  long have_149X;
  long available_148X;
  long size_147X;
  char * start_146X;
  long header_145X;
  long shared_144X;
  long link_143X;
  struct image_location *v_142X;
  long next_141X;
  struct image_location *have_140X;
  long thing_139X;
  long i_138X;
  long link_137X;
  long symbol_136X;
  long v_135X;
  long link_134X;
  struct image_location *v_133X;
  long next_132X;
  struct image_location **values_131X;
  long *keys_130X;
  struct table *table_129X;
  long link_128X;
  struct image_location *have_127X;
  long thing_126X;
  long id_125X;
  char * addr_124X;
  long symbol_123X;
  long have_122X;
  char v_121X;
  struct image_location *location_120X;
  long stob_119X;
  char * start_118X;
  long header_117X;
  struct image_location *have_116X;
  long thing_115X;
  long link_114X;
  long v_113X;
  long v_112X;
  long i_111X;
  struct image_location *v_110X;
  long thing_109X;
  long table_108X;
  struct image_location *location_107X;
  long stob_106X;
  long v_105X;
  long v_104X;
  long v_103X;
  long n_102X;
  long v_101X;
  long n_100X;
  struct image_location *have_99X;
  long thing_98X;
  long v_97X;
  long n_96X;
  struct image_location *have_95X;
  long thing_94X;
  long v_93X;
  long n_92X;
  struct image_location *have_91X;
  long thing_90X;
  long v_89X;
  long v_88X;
  long v_87X;
  long v_86X;
  long v_85X;
  long v_84X;
  long i_83X;
  long v_82X;
  struct image_location **values_81X;
  long *keys_80X;
  struct table *table_79X;
  long v_78X;
  char * data_addr_77X;
  long cells_76X;
  long v_75X;
  long v_74X;
  long v_73X;
  struct image_location *last_72X;
  char * addr_71X;
  long next_70X;
  struct image_location *image_location_69X;
  char * start_68X;
  long link_67X;
  long entry_66X;
  long header_65X;
  long stob_64X;
  long link_63X;
  long i_62X;
  long table_61X;
  long resume_proc_60X;
  struct table *v_59X;
  struct table *table_58X;
  long i_57X;
  long *keys_56X;
  char * start_address_55X;
 {  start_address_55X = ((char *) 0);
  keys_56X = (long*)malloc(sizeof(long) * 4097);
  arg0K0 = 0;
  goto L2591;}
 L2591: {
  i_57X = arg0K0;
  if ((i_57X < 4097)) {
    *(keys_56X + i_57X) = 0;
    arg0K0 = (1 + i_57X);
    goto L2591;}
  else {
    table_58X = (struct table*)malloc(sizeof(struct table));
    if ((NULL == table_58X)) {
      arg2K0 = table_58X;
      goto L2560;}
    else {
      table_58X->keys = keys_56X;
      table_58X->values = ((struct image_location**)malloc(sizeof(struct image_location*) * 4096));
      table_58X->count = 0;
      table_58X->size = 4096;
      arg2K0 = table_58X;
      goto L2560;}}}
 L2560: {
  v_59X = arg2K0;
  Sstob_tableS = v_59X;
  Sfirst_stobS = 1;
  Slast_stobS = (NULL);
  Simage_beginS = start_address_55X;
  Simage_hpS = start_address_55X;
  Sundumpable_recordsS = undumpables_49X;
  Sundumpable_countS = 0;
  Sresumer_countS = 0;
  Simage_portS = port_50X;
  Simage_bufferS = ((char *)malloc(4096));
  Simage_buffer_pointerS = (Simage_bufferS);
  SstatusS = NO_ERRORS;
  if (((Simage_bufferS) == NULL)) {
    return ENOMEM;}
  else {
    resume_proc_60X = trace_image_value(resume_proc_48X);
    table_61X = s48_exported_bindings();
    arg0K0 = 0;
    goto L3388;}}
 L3388: {
  i_62X = arg0K0;
  if ((1024 == i_62X)) {
    arg0K0 = (Sfirst_stobS);
    goto L4837;}
  else {
    link_63X = *((long *) ((((char *) (-3 + table_61X))) + (((i_62X)<<2))));
    if ((0 == (3 & link_63X))) {
      arg0K0 = (3 + (-4 & link_63X));
      goto L3362;}
    else {
      arg0K0 = link_63X;
      goto L3362;}}}
 L4837: {
  stob_64X = arg0K0;
  header_65X = *((long *) ((((char *) (-3 + stob_64X))) + -4));
  if ((2 == (3 & header_65X))) {
    if (((31 & (((header_65X)>>2))) < 17)) {
      goto L4701;}
    else {
      goto L4839;}}
  else {
    goto L4701;}}
 L3362: {
  entry_66X = arg0K0;
  if ((1 == entry_66X)) {
    arg0K0 = (1 + i_62X);
    goto L3388;}
  else {trace_image_value(entry_66X);
    link_67X = *((long *) ((((char *) (-3 + entry_66X))) + 12));
    if ((0 == (3 & link_67X))) {
      arg0K0 = (3 + (-4 & link_67X));
      goto L3362;}
    else {
      arg0K0 = link_67X;
      goto L3362;}}}
 L4701: {
  if ((1078 == header_65X)) {
    goto L4839;}
  else {
    start_68X = ((char *) (-3 + stob_64X));
    arg3K0 = start_68X;
    goto L4720;}}
 L4839: {
  if ((0 < ((Sstob_tableS)->size))) {
    image_location_69X = table_ref((Sstob_tableS), stob_64X);
    next_70X = image_location_69X->next;
    if ((3 == (3 & next_70X))) {
      arg0K0 = next_70X;
      goto L4837;}
    else {
      goto L4908;}}
  else {
    goto L4908;}}
 L4720: {
  addr_71X = arg3K0;
  if ((addr_71X == (start_68X + (-4 & (3 + ((long)(((unsigned long)header_65X)>>8))))))) {
    goto L4839;}
  else {trace_image_value((*((long *) addr_71X)));
    arg3K0 = (addr_71X + 4);
    goto L4720;}}
 L4908: {
  last_72X = Slast_stobS;
  v_73X = s48_symbol_table();trace_image_value(v_73X);
  v_74X = s48_imported_bindings();trace_image_value(v_74X);
  v_75X = s48_exported_bindings();trace_image_value(v_75X);
  last_72X->next = 1;
  cells_76X = Sresumer_countS;
  data_addr_77X = (Simage_hpS) + 4;
  Simage_hpS = (data_addr_77X + (((cells_76X)<<2)));
  Sresumer_recordsS = (3 + (((long) data_addr_77X)));
  if ((0 < ((Sstob_tableS)->size))) {
    if (((SstatusS) == NO_ERRORS)) {
      PS_WRITE_CHAR(10, port_50X, v_78X)
      SstatusS = v_78X;
      goto L2264;}
    else {
      goto L2264;}}
  else {
    table_79X = Sstob_tableS;
    keys_80X = table_79X->keys;
    values_81X = table_79X->values;
    arg0K0 = 0;
    goto L5220;}}
 L2264: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(12, (Simage_portS), v_82X)
    SstatusS = v_82X;
    goto L2266;}
  else {
    goto L2266;}}
 L5220: {
  i_83X = arg0K0;
  if ((i_83X == (table_79X->size))) {
    free(keys_80X);
    free(values_81X);
    free(table_79X);
    free((Simage_bufferS));
    return ENOMEM;}
  else {
    if ((0 == (*(keys_80X + i_83X)))) {
      goto L5222;}
    else {
      free((*(values_81X + i_83X)));
      goto L5222;}}}
 L2266: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, port_50X, v_84X)
    SstatusS = v_84X;
    goto L2275;}
  else {
    goto L2275;}}
 L5222: {
  arg0K0 = (1 + i_83X);
  goto L5220;}
 L2275: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_string("Vanilla 27", port_50X));
    goto L2282;}
  else {
    goto L2282;}}
 L2282: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, port_50X, v_85X)
    SstatusS = v_85X;
    goto L2291;}
  else {
    goto L2291;}}
 L2291: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(4, (Simage_portS)));
    goto L2336;}
  else {
    goto L2336;}}
 L2336: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_86X)
    SstatusS = v_86X;
    goto L2293;}
  else {
    goto L2293;}}
 L2293: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(0, (Simage_portS)));
    goto L2353;}
  else {
    goto L2353;}}
 L2353: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_87X)
    SstatusS = v_87X;
    goto L2297;}
  else {
    goto L2297;}}
 L2297: {
  v_88X = (Simage_hpS) - (Simage_beginS);
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer((((v_88X)>>2)), (Simage_portS)));
    goto L2372;}
  else {
    goto L2372;}}
 L2372: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_89X)
    SstatusS = v_89X;
    goto L2303;}
  else {
    goto L2303;}}
 L2303: {
  thing_90X = s48_symbol_table();
  if ((3 == (3 & thing_90X))) {
    have_91X = table_ref((Sstob_tableS), thing_90X);
    if ((NULL == have_91X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L2390;}
    else {
      goto L2390;}}
  else {
    arg0K0 = thing_90X;
    goto L2307;}}
 L2390: {
  arg0K0 = (have_91X->new_descriptor);
  goto L2307;}
 L2307: {
  n_92X = arg0K0;
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(n_92X, (Simage_portS)));
    goto L2400;}
  else {
    goto L2400;}}
 L2400: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_93X)
    SstatusS = v_93X;
    goto L2309;}
  else {
    goto L2309;}}
 L2309: {
  thing_94X = s48_imported_bindings();
  if ((3 == (3 & thing_94X))) {
    have_95X = table_ref((Sstob_tableS), thing_94X);
    if ((NULL == have_95X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L2418;}
    else {
      goto L2418;}}
  else {
    arg0K0 = thing_94X;
    goto L2313;}}
 L2418: {
  arg0K0 = (have_95X->new_descriptor);
  goto L2313;}
 L2313: {
  n_96X = arg0K0;
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(n_96X, (Simage_portS)));
    goto L2428;}
  else {
    goto L2428;}}
 L2428: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_97X)
    SstatusS = v_97X;
    goto L2315;}
  else {
    goto L2315;}}
 L2315: {
  thing_98X = s48_exported_bindings();
  if ((3 == (3 & thing_98X))) {
    have_99X = table_ref((Sstob_tableS), thing_98X);
    if ((NULL == have_99X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L2446;}
    else {
      goto L2446;}}
  else {
    arg0K0 = thing_98X;
    goto L2319;}}
 L2446: {
  arg0K0 = (have_99X->new_descriptor);
  goto L2319;}
 L2319: {
  n_100X = arg0K0;
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(n_100X, (Simage_portS)));
    goto L2456;}
  else {
    goto L2456;}}
 L2456: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_101X)
    SstatusS = v_101X;
    goto L2321;}
  else {
    goto L2321;}}
 L2321: {
  n_102X = Sresumer_recordsS;
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(n_102X, (Simage_portS)));
    goto L2470;}
  else {
    goto L2470;}}
 L2470: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_103X)
    SstatusS = v_103X;
    goto L2323;}
  else {
    goto L2323;}}
 L2323: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(resume_proc_60X, (Simage_portS)));
    goto L2484;}
  else {
    goto L2484;}}
 L2484: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_104X)
    SstatusS = v_104X;
    goto L2325;}
  else {
    goto L2325;}}
 L2325: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(12, (Simage_portS), v_105X)
    SstatusS = v_105X;
    goto L5125;}
  else {
    goto L5125;}}
 L5125: {
  merged_arg0K0 = 1;
  write_descriptor_return_tag = 0;
  goto write_descriptor;
 write_descriptor_return_0:
  arg0K0 = (Sfirst_stobS);
  goto L4566;}
 L4566: {
  stob_106X = arg0K0;
  if ((3 == (3 & stob_106X))) {
    location_107X = table_ref((Sstob_tableS), stob_106X);
    if ((NULL == location_107X)) {
      ps_error("traced stob has no image-table entry", 0);
      goto L4581;}
    else {
      goto L4581;}}
  else {
    table_108X = s48_symbol_table();
    merged_arg0K0 = (*((long *) ((((char *) (-3 + table_108X))) + -4)));
    write_descriptor_return_tag = 1;
    goto write_descriptor;
   write_descriptor_return_1:
    arg0K0 = 0;
    goto L3561;}}
 L4581: {
  if ((3 == (3 & stob_106X))) {
    if ((13 == (31 & ((((*((long *) ((((char *) (-3 + stob_106X))) + -4))))>>2))))) {
      merged_arg0K0 = 1078;
      write_descriptor_return_tag = 2;
      goto write_descriptor;
     write_descriptor_return_2:
      thing_109X = *((long *) (((char *) (-3 + stob_106X))));
      if ((3 == (3 & thing_109X))) {
        v_110X = table_ref((Sstob_tableS), thing_109X);
        if ((NULL == v_110X)) {
          merged_arg0K0 = 1;
          write_descriptor_return_tag = 3;
          goto write_descriptor;
         write_descriptor_return_3:
          goto L4583;}
        else {
          goto L4312;}}
      else {
        goto L4312;}}
    else {
      goto L4318;}}
  else {
    goto L4318;}}
 L3561: {
  i_111X = arg0K0;
  if ((i_111X == ((((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + table_108X))) + -4))))>>8))))>>2)))) {
    v_112X = s48_imported_bindings();
    merged_arg0K0 = v_112X;
    write_shared_table_return_tag = 0;
    goto write_shared_table;
   write_shared_table_return_0:
    v_113X = s48_exported_bindings();
    merged_arg0K0 = v_113X;
    write_shared_table_return_tag = 1;
    goto write_shared_table;
   write_shared_table_return_1:
    merged_arg0K0 = (10 + ((((Sresumer_countS))<<10)));
    write_descriptor_return_tag = 4;
    goto write_descriptor;
   write_descriptor_return_4:
    arg0K0 = (Sfirst_stobS);
    goto L4661;}
  else {
    link_114X = *((long *) ((((char *) (-3 + table_108X))) + (((i_111X)<<2))));
    if ((0 == (3 & link_114X))) {
      arg0K0 = (3 + (-4 & link_114X));
      goto L3571;}
    else {
      arg0K0 = link_114X;
      goto L3571;}}}
 L4583: {
  arg0K0 = (location_107X->next);
  goto L4566;}
 L4312: {
  thing_115X = *((long *) (((char *) (-3 + stob_106X))));
  if ((3 == (3 & thing_115X))) {
    have_116X = table_ref((Sstob_tableS), thing_115X);
    if ((NULL == have_116X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L4376;}
    else {
      goto L4376;}}
  else {
    merged_arg0K0 = thing_115X;
    write_descriptor_return_tag = 5;
    goto write_descriptor;
   write_descriptor_return_5:
    goto L4583;}}
 L4318: {
  if ((3 == (3 & stob_106X))) {
    if ((6 == (31 & ((((*((long *) ((((char *) (-3 + stob_106X))) + -4))))>>2))))) {
      header_117X = *((long *) ((((char *) (-3 + stob_106X))) + -4));
      merged_arg0K0 = header_117X;
      write_descriptor_return_tag = 6;
      goto write_descriptor;
     write_descriptor_return_6:
      merged_arg0K0 = 0;
      write_descriptor_return_tag = 7;
      goto write_descriptor;
     write_descriptor_return_7:
      start_118X = (((char *) (-3 + stob_106X))) + 4;
      arg3K0 = start_118X;
      goto L3068;}
    else {
      goto L4322;}}
  else {
    goto L4322;}}
 L4661: {
  stob_119X = arg0K0;
  if ((3 == (3 & stob_119X))) {
    location_120X = table_ref((Sstob_tableS), stob_119X);
    v_121X = resumer_recordP(stob_119X);
    if (v_121X) {
      merged_arg0K0 = (location_120X->new_descriptor);
      write_descriptor_return_tag = 8;
      goto write_descriptor;
     write_descriptor_return_8:
      goto L4673;}
    else {
      goto L4673;}}
  else {
    have_122X = (Simage_buffer_pointerS) - (Simage_bufferS);
    if ((0 < have_122X)) {
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_122X));
        goto L5168;}
      else {
        goto L5168;}}
    else {
      goto L5131;}}}
 L3571: {
  symbol_123X = arg0K0;
  arg0K0 = symbol_123X;
  goto L3605;}
 L4376: {
  merged_arg0K0 = (have_116X->new_descriptor);
  write_descriptor_return_tag = 9;
  goto write_descriptor;
 write_descriptor_return_9:
  goto L4583;}
 L3068: {
  addr_124X = arg3K0;
  if ((addr_124X == (start_118X + (-4 + (-4 & (3 + ((long)(((unsigned long)header_117X)>>8)))))))) {
    ps_write_string("Channel closed in dumped image: ", (stderr));
    id_125X = *((long *) ((((char *) (-3 + stob_106X))) + 4));
    if ((0 == (3 & id_125X))) {
      ps_write_integer((((id_125X)>>2)), (stderr));
      goto L3045;}
    else {
      ps_write_string((((char *)(((char *) (-3 + id_125X))))), (stderr));
      goto L3045;}}
  else {
    thing_126X = *((long *) addr_124X);
    if ((3 == (3 & thing_126X))) {
      have_127X = table_ref((Sstob_tableS), thing_126X);
      if ((NULL == have_127X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L3082;}
      else {
        goto L3082;}}
    else {
      arg0K0 = thing_126X;
      goto L3073;}}}
 L4322: {
  if ((3 == (3 & stob_106X))) {
    if ((1 == (31 & ((((*((long *) ((((char *) (-3 + stob_106X))) + -4))))>>2))))) {
      link_128X = *((long *) ((((char *) (-3 + stob_106X))) + 4));
      if ((0 == (3 & link_128X))) {
        arg0K0 = (3 + (-4 & link_128X));
        goto L4004;}
      else {
        arg0K0 = link_128X;
        goto L4004;}}
    else {
      goto L4326;}}
  else {
    goto L4326;}}
 L4673: {
  arg0K0 = (location_120X->next);
  goto L4661;}
 L5168: {
  Simage_buffer_pointerS = (Simage_bufferS);
  goto L5131;}
 L5131: {
  table_129X = Sstob_tableS;
  keys_130X = table_129X->keys;
  values_131X = table_129X->values;
  arg0K0 = 0;
  goto L5186;}
 L3605: {
  next_132X = arg0K0;
  if ((3 == (3 & next_132X))) {
    v_133X = table_ref((Sstob_tableS), next_132X);
    if ((NULL == v_133X)) {
      link_134X = *((long *) ((((char *) (-3 + next_132X))) + 4));
      if ((0 == (3 & link_134X))) {
        arg0K0 = (3 + (-4 & link_134X));
        goto L3605;}
      else {
        arg0K0 = link_134X;
        goto L3605;}}
    else {
      arg0K0 = next_132X;
      goto L3573;}}
  else {
    arg0K0 = next_132X;
    goto L3573;}}
 L3045: {
  { long ignoreXX;
  PS_WRITE_CHAR(10, (stderr), ignoreXX) }
  goto L4583;}
 L3082: {
  arg0K0 = (have_127X->new_descriptor);
  goto L3073;}
 L3073: {
  v_135X = arg0K0;
  merged_arg0K0 = v_135X;
  write_descriptor_return_tag = 10;
  goto write_descriptor;
 write_descriptor_return_10:
  arg3K0 = (addr_124X + 4);
  goto L3068;}
 L4004: {
  symbol_136X = arg0K0;
  arg0K0 = symbol_136X;
  goto L4037;}
 L4326: {
  if ((3 == (3 & stob_106X))) {
    if ((14 == (31 & ((((*((long *) ((((char *) (-3 + stob_106X))) + -4))))>>2))))) {
      link_137X = *((long *) ((((char *) (-3 + stob_106X))) + 12));
      if ((0 == (3 & link_137X))) {
        arg0K0 = (3 + (-4 & link_137X));
        goto L3847;}
      else {
        arg0K0 = link_137X;
        goto L3847;}}
    else {
      goto L4330;}}
  else {
    goto L4330;}}
 L5186: {
  i_138X = arg0K0;
  if ((i_138X == (table_129X->size))) {
    free(keys_130X);
    free(values_131X);
    free(table_129X);
    free((Simage_bufferS));
    return (SstatusS);}
  else {
    if ((0 == (*(keys_130X + i_138X)))) {
      goto L5188;}
    else {
      free((*(values_131X + i_138X)));
      goto L5188;}}}
 L3573: {
  thing_139X = arg0K0;
  if ((3 == (3 & thing_139X))) {
    have_140X = table_ref((Sstob_tableS), thing_139X);
    if ((NULL == have_140X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L3624;}
    else {
      goto L3624;}}
  else {
    arg0K0 = thing_139X;
    goto L3575;}}
 L4037: {
  next_141X = arg0K0;
  if ((3 == (3 & next_141X))) {
    v_142X = table_ref((Sstob_tableS), next_141X);
    if ((NULL == v_142X)) {
      link_143X = *((long *) ((((char *) (-3 + next_141X))) + 4));
      if ((0 == (3 & link_143X))) {
        arg0K0 = (3 + (-4 & link_143X));
        goto L4037;}
      else {
        arg0K0 = link_143X;
        goto L4037;}}
    else {
      arg0K0 = next_141X;
      goto L4006;}}
  else {
    arg0K0 = next_141X;
    goto L4006;}}
 L3847: {
  shared_144X = arg0K0;
  arg0K0 = shared_144X;
  goto L3896;}
 L4330: {
  header_145X = *((long *) ((((char *) (-3 + stob_106X))) + -4));
  start_146X = ((char *) (-3 + stob_106X));
  merged_arg0K0 = header_145X;
  write_descriptor_return_tag = 11;
  goto write_descriptor;
 write_descriptor_return_11:
  if ((2 == (3 & header_145X))) {
    if (((31 & (((header_145X)>>2))) < 17)) {
      goto L4346;}
    else {
      size_147X = -4 & (3 + ((long)(((unsigned long)header_145X)>>8)));
      available_148X = 4096 - ((Simage_buffer_pointerS) - (Simage_bufferS));
      if ((available_148X < size_147X)) {
        if ((4096 < size_147X)) {
          have_149X = (Simage_buffer_pointerS) - (Simage_bufferS);
          if ((0 < have_149X)) {
            if (((SstatusS) == NO_ERRORS)) {
              SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_149X));
              goto L2896;}
            else {
              goto L2896;}}
          else {
            goto L2870;}}
        else {
          merged_arg3K0 = start_146X;
          merged_arg0K1 = available_148X;
          copy_image_data_return_tag = 0;
          goto copy_image_data;
         copy_image_data_return_0:
          merged_arg3K0 = (start_146X + available_148X);
          merged_arg0K1 = (size_147X - available_148X);
          copy_image_data_return_tag = 1;
          goto copy_image_data;
         copy_image_data_return_1:
          goto L4583;}}
      else {
        merged_arg3K0 = start_146X;
        merged_arg0K1 = size_147X;
        copy_image_data_return_tag = 2;
        goto copy_image_data;
       copy_image_data_return_2:
        goto L4583;}}}
  else {
    goto L4346;}}
 L5188: {
  arg0K0 = (1 + i_138X);
  goto L5186;}
 L3624: {
  arg0K0 = (have_140X->new_descriptor);
  goto L3575;}
 L3575: {
  value_150X = arg0K0;
  if ((3 == (3 & value_150X))) {
    arg0K0 = (-4 & value_150X);
    goto L3577;}
  else {
    arg0K0 = value_150X;
    goto L3577;}}
 L4006: {
  next_151X = arg0K0;
  header_152X = *((long *) ((((char *) (-3 + stob_106X))) + -4));
  merged_arg0K0 = header_152X;
  write_descriptor_return_tag = 12;
  goto write_descriptor;
 write_descriptor_return_12:
  start_153X = ((char *) (-3 + stob_106X));
  arg3K0 = start_153X;
  goto L4066;}
 L3896: {
  next_154X = arg0K0;
  if ((3 == (3 & next_154X))) {
    v_155X = table_ref((Sstob_tableS), next_154X);
    if ((NULL == v_155X)) {
      link_156X = *((long *) ((((char *) (-3 + next_154X))) + 12));
      if ((0 == (3 & link_156X))) {
        arg0K0 = (3 + (-4 & link_156X));
        goto L3896;}
      else {
        arg0K0 = link_156X;
        goto L3896;}}
    else {
      arg0K0 = next_154X;
      goto L3849;}}
  else {
    arg0K0 = next_154X;
    goto L3849;}}
 L4346: {
  arg3K0 = start_146X;
  goto L4448;}
 L2896: {
  Simage_buffer_pointerS = (Simage_bufferS);
  goto L2870;}
 L2870: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_block((Simage_portS), ((char *) start_146X), size_147X));
    goto L4583;}
  else {
    goto L4583;}}
 L3577: {
  v_157X = arg0K0;
  merged_arg0K0 = v_157X;
  write_descriptor_return_tag = 13;
  goto write_descriptor;
 write_descriptor_return_13:
  arg0K0 = (1 + i_111X);
  goto L3561;}
 L4066: {
  addr_158X = arg3K0;
  if ((addr_158X == (start_153X + (-4 + (-4 & (3 + ((long)(((unsigned long)header_152X)>>8)))))))) {
    if ((3 == (3 & next_151X))) {
      have_159X = table_ref((Sstob_tableS), next_151X);
      if ((NULL == have_159X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L4096;}
      else {
        goto L4096;}}
    else {
      arg0K0 = next_151X;
      goto L4019;}}
  else {
    thing_160X = *((long *) addr_158X);
    if ((3 == (3 & thing_160X))) {
      have_161X = table_ref((Sstob_tableS), thing_160X);
      if ((NULL == have_161X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L4080;}
      else {
        goto L4080;}}
    else {
      arg0K0 = thing_160X;
      goto L4071;}}}
 L3849: {
  next_162X = arg0K0;
  header_163X = *((long *) ((((char *) (-3 + stob_106X))) + -4));
  merged_arg0K0 = header_163X;
  write_descriptor_return_tag = 14;
  goto write_descriptor;
 write_descriptor_return_14:
  start_164X = ((char *) (-3 + stob_106X));
  arg3K0 = start_164X;
  goto L3925;}
 L4448: {
  addr_165X = arg3K0;
  if ((addr_165X == (start_146X + (-4 & (3 + ((long)(((unsigned long)header_145X)>>8))))))) {
    goto L4583;}
  else {
    thing_166X = *((long *) addr_165X);
    if ((3 == (3 & thing_166X))) {
      have_167X = table_ref((Sstob_tableS), thing_166X);
      if ((NULL == have_167X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L4462;}
      else {
        goto L4462;}}
    else {
      arg0K0 = thing_166X;
      goto L4453;}}}
 L4096: {
  arg0K0 = (have_159X->new_descriptor);
  goto L4019;}
 L4019: {
  value_168X = arg0K0;
  if ((3 == (3 & value_168X))) {
    merged_arg0K0 = (-4 & value_168X);
    write_descriptor_return_tag = 15;
    goto write_descriptor;
   write_descriptor_return_15:
    goto L4583;}
  else {
    merged_arg0K0 = value_168X;
    write_descriptor_return_tag = 16;
    goto write_descriptor;
   write_descriptor_return_16:
    goto L4583;}}
 L4080: {
  arg0K0 = (have_161X->new_descriptor);
  goto L4071;}
 L4071: {
  v_169X = arg0K0;
  merged_arg0K0 = v_169X;
  write_descriptor_return_tag = 17;
  goto write_descriptor;
 write_descriptor_return_17:
  arg3K0 = (addr_158X + 4);
  goto L4066;}
 L3925: {
  addr_170X = arg3K0;
  if ((addr_170X == (start_164X + (-8 + (-4 & (3 + ((long)(((unsigned long)header_163X)>>8)))))))) {
    x_171X = *((long *) ((((char *) (-3 + stob_106X))) + 4));
    if ((5 == x_171X)) {
      arg0K0 = 529;
      goto L3874;}
    else {
      thing_172X = *((long *) ((((char *) (-3 + stob_106X))) + 8));
      if ((3 == (3 & thing_172X))) {
        have_173X = table_ref((Sstob_tableS), thing_172X);
        if ((NULL == have_173X)) {
          ps_error("traced object has no descriptor in image", 0);
          goto L3986;}
        else {
          goto L3986;}}
      else {
        arg0K0 = thing_172X;
        goto L3874;}}}
  else {
    thing_174X = *((long *) addr_170X);
    if ((3 == (3 & thing_174X))) {
      have_175X = table_ref((Sstob_tableS), thing_174X);
      if ((NULL == have_175X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L3939;}
      else {
        goto L3939;}}
    else {
      arg0K0 = thing_174X;
      goto L3930;}}}
 L4462: {
  arg0K0 = (have_167X->new_descriptor);
  goto L4453;}
 L4453: {
  v_176X = arg0K0;
  merged_arg0K0 = v_176X;
  write_descriptor_return_tag = 18;
  goto write_descriptor;
 write_descriptor_return_18:
  arg3K0 = (addr_165X + 4);
  goto L4448;}
 L3874: {
  v_177X = arg0K0;
  merged_arg0K0 = v_177X;
  write_descriptor_return_tag = 19;
  goto write_descriptor;
 write_descriptor_return_19:
  if ((3 == (3 & next_162X))) {
    have_178X = table_ref((Sstob_tableS), next_162X);
    if ((NULL == have_178X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L3962;}
    else {
      goto L3962;}}
  else {
    arg0K0 = next_162X;
    goto L3878;}}
 L3986: {
  arg0K0 = (have_173X->new_descriptor);
  goto L3874;}
 L3939: {
  arg0K0 = (have_175X->new_descriptor);
  goto L3930;}
 L3930: {
  v_179X = arg0K0;
  merged_arg0K0 = v_179X;
  write_descriptor_return_tag = 20;
  goto write_descriptor;
 write_descriptor_return_20:
  arg3K0 = (addr_170X + 4);
  goto L3925;}
 L3962: {
  arg0K0 = (have_178X->new_descriptor);
  goto L3878;}
 L3878: {
  value_180X = arg0K0;
  if ((3 == (3 & value_180X))) {
    merged_arg0K0 = (-4 & value_180X);
    write_descriptor_return_tag = 21;
    goto write_descriptor;
   write_descriptor_return_21:
    goto L4583;}
  else {
    merged_arg0K0 = value_180X;
    write_descriptor_return_tag = 22;
    goto write_descriptor;
   write_descriptor_return_22:
    goto L4583;}}
 write_shared_table: {
  table_54X = merged_arg0K0;{
  merged_arg0K0 = (*((long *) ((((char *) (-3 + table_54X))) + -4)));
  write_descriptor_return_tag = 23;
  goto write_descriptor;
 write_descriptor_return_23:
  arg0K0 = 0;
  goto L3471;}
 L3471: {
  i_181X = arg0K0;
  temp_182X = i_181X == ((((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + table_54X))) + -4))))>>8))))>>2));
  if (temp_182X) {
    write_shared_table0_return_value = temp_182X;
    goto write_shared_table_return;}
  else {
    link_183X = *((long *) ((((char *) (-3 + table_54X))) + (((i_181X)<<2))));
    if ((0 == (3 & link_183X))) {
      arg0K0 = (3 + (-4 & link_183X));
      goto L3481;}
    else {
      arg0K0 = link_183X;
      goto L3481;}}}
 L3481: {
  shared_184X = arg0K0;
  arg0K0 = shared_184X;
  goto L3515;}
 L3515: {
  next_185X = arg0K0;
  if ((3 == (3 & next_185X))) {
    v_186X = table_ref((Sstob_tableS), next_185X);
    if ((NULL == v_186X)) {
      link_187X = *((long *) ((((char *) (-3 + next_185X))) + 12));
      if ((0 == (3 & link_187X))) {
        arg0K0 = (3 + (-4 & link_187X));
        goto L3515;}
      else {
        arg0K0 = link_187X;
        goto L3515;}}
    else {
      arg0K0 = next_185X;
      goto L3483;}}
  else {
    arg0K0 = next_185X;
    goto L3483;}}
 L3483: {
  thing_188X = arg0K0;
  if ((3 == (3 & thing_188X))) {
    have_189X = table_ref((Sstob_tableS), thing_188X);
    if ((NULL == have_189X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L3534;}
    else {
      goto L3534;}}
  else {
    arg0K0 = thing_188X;
    goto L3485;}}
 L3534: {
  arg0K0 = (have_189X->new_descriptor);
  goto L3485;}
 L3485: {
  value_190X = arg0K0;
  if ((3 == (3 & value_190X))) {
    arg0K0 = (-4 & value_190X);
    goto L3487;}
  else {
    arg0K0 = value_190X;
    goto L3487;}}
 L3487: {
  v_191X = arg0K0;
  merged_arg0K0 = v_191X;
  write_descriptor_return_tag = 24;
  goto write_descriptor;
 write_descriptor_return_24:
  arg0K0 = (1 + i_181X);
  goto L3471;}
 write_shared_table_return:
  switch (write_shared_table_return_tag) {
  case 0: goto write_shared_table_return_0;
  default: goto write_shared_table_return_1;
  }}

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

 copy_image_data: {
  start_51X = merged_arg3K0;
  size_52X = merged_arg0K1;{
  memcpy((void *)(Simage_buffer_pointerS), (void *)start_51X,size_52X);
  Simage_buffer_pointerS = ((Simage_buffer_pointerS) + size_52X);
  if ((4096 == ((Simage_buffer_pointerS) - (Simage_bufferS)))) {
    have_193X = (Simage_buffer_pointerS) - (Simage_bufferS);
    if ((0 < have_193X)) {
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_193X));
        goto L2172;}
      else {
        goto L2172;}}
    else {
      goto copy_image_data_return;}}
  else {
    goto copy_image_data_return;}}
 L2172: {
  Simage_buffer_pointerS = (Simage_bufferS);
  goto copy_image_data_return;}
 copy_image_data_return:
  switch (copy_image_data_return_tag) {
  case 0: goto copy_image_data_return_0;
  case 1: goto copy_image_data_return_1;
  default: goto copy_image_data_return_2;
  }}

}void
s48_write_image_init(void)
{
SstatusS = NO_ERRORS;
}
