scheme48write-image.c 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4. #include "prescheme.h"
  5. #include "scheme48vm-prelude.h"
  6. #include "scheme48vm.h"
  7. #include "scheme48heap.h"
  8. struct image_location {
  9. long new_descriptor;
  10. long next;
  11. };
  12. struct table {
  13. long *keys;
  14. struct image_location **values;
  15. long count;
  16. long size;
  17. };
  18. static struct image_location *table_ref(struct table*, long);
  19. static char resumer_recordP(long);
  20. static long trace_image_value(long);
  21. long s48_write_image(long, long, FILE *);
  22. static long SstatusS;
  23. static FILE * Simage_portS;
  24. static char * Simage_bufferS;
  25. static char * Simage_buffer_pointerS;
  26. static struct table *Sstob_tableS;
  27. static long Sfirst_stobS;
  28. static struct image_location *Slast_stobS;
  29. static char * Simage_beginS;
  30. static char * Simage_hpS;
  31. static long Sresumer_countS;
  32. static long Sresumer_recordsS;
  33. static long Sundumpable_recordsS;
  34. static long Sundumpable_countS;
  35. static struct image_location *table_ref(struct table *table_0X, long key_1X)
  36. {
  37. long arg0K0;
  38. long next_5X;
  39. long i_4X;
  40. long *keys_3X;
  41. long size_2X;
  42. { if ((0 < (table_0X->size))) {
  43. size_2X = table_0X->size;
  44. keys_3X = table_0X->keys;
  45. arg0K0 = ((key_1X ^ ((((key_1X)<<1)) ^ (((key_1X)>>10)))) & (-1 + size_2X));
  46. goto L1601;}
  47. else {
  48. return (NULL);}}
  49. L1601: {
  50. i_4X = arg0K0;
  51. next_5X = *(keys_3X + i_4X);
  52. if ((key_1X == next_5X)) {
  53. return (*((table_0X->values) + i_4X));}
  54. else {
  55. if ((0 == next_5X)) {
  56. if ((i_4X == (table_0X->size))) {
  57. arg0K0 = 0;
  58. goto L1601;}
  59. else {
  60. return (NULL);}}
  61. else {
  62. arg0K0 = (1 + i_4X);
  63. goto L1601;}}}
  64. }
  65. static char resumer_recordP(long stob_6X)
  66. {
  67. long type_7X;
  68. { if ((3 == (3 & stob_6X))) {
  69. if ((9 == (31 & ((((*((long *) ((((char *) (-3 + stob_6X))) + -4))))>>2))))) {
  70. type_7X = *((long *) (((char *) (-3 + stob_6X))));
  71. if ((3 == (3 & type_7X))) {
  72. if ((9 == (31 & ((((*((long *) ((((char *) (-3 + type_7X))) + -4))))>>2))))) {
  73. return (3 == (3 & (*((long *) ((((char *) (-3 + type_7X))) + 4)))));}
  74. else {
  75. return 0;}}
  76. else {
  77. return 0;}}
  78. else {
  79. return 0;}}
  80. else {
  81. return 0;}}
  82. }
  83. static long trace_image_value(long thing_8X)
  84. {
  85. long arg0K0;
  86. struct image_location *arg1K0;
  87. struct image_location *merged_arg1K2;
  88. long merged_arg0K0;
  89. long merged_arg0K1;
  90. struct table *merged_arg2K0;
  91. int table_setB_return_tag;
  92. int gc_recordP_return_tag;
  93. char gc_recordP0_return_value;
  94. struct table *table_9X;
  95. long key_10X;
  96. struct image_location *value_11X;
  97. long x_12X;
  98. long i_47X;
  99. struct image_location *value_46X;
  100. long key_45X;
  101. long i_44X;
  102. long i_43X;
  103. struct image_location **new_values_42X;
  104. long *new_keys_41X;
  105. long new_size_40X;
  106. struct image_location **old_values_39X;
  107. long v_38X;
  108. long old_size_37X;
  109. long *old_keys_36X;
  110. long next_35X;
  111. long i_34X;
  112. long *keys_33X;
  113. long size_32X;
  114. long header_31X;
  115. char v_30X;
  116. long x_29X;
  117. struct image_location *new_28X;
  118. struct image_location *new_27X;
  119. struct image_location *image_location_26X;
  120. long new_descriptor_25X;
  121. char * data_addr_24X;
  122. long h_23X;
  123. long stob_22X;
  124. struct image_location *image_location_21X;
  125. long new_alias_20X;
  126. long i_19X;
  127. long len_18X;
  128. long vector_17X;
  129. char v_16X;
  130. long type_15X;
  131. char v_14X;
  132. struct image_location *have_13X;
  133. { if ((3 == (3 & thing_8X))) {
  134. have_13X = table_ref((Sstob_tableS), thing_8X);
  135. if ((NULL == have_13X)) {
  136. merged_arg0K0 = thing_8X;
  137. gc_recordP_return_tag = 0;
  138. goto gc_recordP;
  139. gc_recordP_return_0:
  140. v_14X = gc_recordP0_return_value;
  141. if (v_14X) {
  142. type_15X = *((long *) (((char *) (-3 + thing_8X))));
  143. merged_arg0K0 = type_15X;
  144. gc_recordP_return_tag = 1;
  145. goto gc_recordP;
  146. gc_recordP_return_1:
  147. v_16X = gc_recordP0_return_value;
  148. if (v_16X) {
  149. if ((1 == (*((long *) ((((char *) (-3 + type_15X))) + 4))))) {
  150. if (((Sundumpable_countS) < ((((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + (Sundumpable_recordsS)))) + -4))))>>8))))>>2)))) {
  151. vector_17X = Sundumpable_recordsS;
  152. len_18X = (((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + vector_17X))) + -4))))>>8))))>>2);
  153. arg0K0 = 0;
  154. goto L3814;}
  155. else {
  156. goto L5065;}}
  157. else {
  158. arg0K0 = thing_8X;
  159. goto L4165;}}
  160. else {
  161. arg0K0 = thing_8X;
  162. goto L4165;}}
  163. else {
  164. arg0K0 = thing_8X;
  165. goto L4165;}}
  166. else {
  167. return (have_13X->new_descriptor);}}
  168. else {
  169. return thing_8X;}}
  170. L3814: {
  171. i_19X = arg0K0;
  172. if ((i_19X == len_18X)) {
  173. *((long *) ((((char *) (-3 + (Sundumpable_recordsS)))) + ((((Sundumpable_countS))<<2)))) = (long) (thing_8X);
  174. Sundumpable_countS = (1 + (Sundumpable_countS));
  175. goto L5065;}
  176. else {
  177. if (((*((long *) ((((char *) (-3 + vector_17X))) + (((i_19X)<<2))))) == thing_8X)) {
  178. goto L5065;}
  179. else {
  180. arg0K0 = (1 + i_19X);
  181. goto L3814;}}}
  182. L5065: {
  183. new_alias_20X = trace_image_value((*((long *) ((((char *) (-3 + thing_8X))) + 4))));
  184. image_location_21X = (struct image_location*)malloc(sizeof(struct image_location));
  185. if ((NULL == image_location_21X)) {
  186. arg1K0 = image_location_21X;
  187. goto L5069;}
  188. else {
  189. image_location_21X->new_descriptor = new_alias_20X;
  190. image_location_21X->next = 0;
  191. arg1K0 = image_location_21X;
  192. goto L5069;}}
  193. L4165: {
  194. stob_22X = arg0K0;
  195. h_23X = *((long *) ((((char *) (-3 + stob_22X))) + -4));
  196. data_addr_24X = (Simage_hpS) + 4;
  197. Simage_hpS = (data_addr_24X + (-4 & (3 + ((long)(((unsigned long)h_23X)>>8)))));
  198. new_descriptor_25X = 3 + (((long) data_addr_24X));
  199. image_location_26X = (struct image_location*)malloc(sizeof(struct image_location));
  200. if ((NULL == image_location_26X)) {
  201. arg1K0 = image_location_26X;
  202. goto L4175;}
  203. else {
  204. image_location_26X->new_descriptor = new_descriptor_25X;
  205. image_location_26X->next = 0;
  206. arg1K0 = image_location_26X;
  207. goto L4175;}}
  208. L5069: {
  209. new_27X = arg1K0;
  210. if ((NULL == new_27X)) {
  211. (Sstob_tableS)->size = 0;
  212. return new_alias_20X;}
  213. else {
  214. merged_arg2K0 = (Sstob_tableS);
  215. merged_arg0K1 = thing_8X;
  216. merged_arg1K2 = new_27X;
  217. table_setB_return_tag = 0;
  218. goto table_setB;
  219. table_setB_return_0:
  220. return new_alias_20X;}}
  221. L4175: {
  222. new_28X = arg1K0;
  223. if ((NULL == new_28X)) {
  224. (Sstob_tableS)->size = 0;
  225. return new_descriptor_25X;}
  226. else {
  227. x_29X = Sfirst_stobS;
  228. if ((1 == x_29X)) {
  229. Sfirst_stobS = stob_22X;
  230. goto L4194;}
  231. else {
  232. (Slast_stobS)->next = stob_22X;
  233. goto L4194;}}}
  234. L4194: {
  235. Slast_stobS = new_28X;
  236. new_28X->next = 1;
  237. merged_arg2K0 = (Sstob_tableS);
  238. merged_arg0K1 = stob_22X;
  239. merged_arg1K2 = new_28X;
  240. table_setB_return_tag = 1;
  241. goto table_setB;
  242. table_setB_return_1:
  243. v_30X = resumer_recordP(stob_22X);
  244. if (v_30X) {
  245. Sresumer_countS = (1 + (Sresumer_countS));
  246. return new_descriptor_25X;}
  247. else {
  248. return new_descriptor_25X;}}
  249. gc_recordP: {
  250. x_12X = merged_arg0K0;{
  251. if ((3 == (3 & x_12X))) {
  252. header_31X = *((long *) ((((char *) (-3 + x_12X))) + -4));
  253. if ((3 == (3 & header_31X))) {
  254. if ((3 == (3 & header_31X))) {
  255. gc_recordP0_return_value = (9 == (31 & ((((*((long *) ((((char *) (-3 + header_31X))) + -4))))>>2))));
  256. goto gc_recordP_return;}
  257. else {
  258. gc_recordP0_return_value = 0;
  259. goto gc_recordP_return;}}
  260. else {
  261. if ((3 == (3 & x_12X))) {
  262. gc_recordP0_return_value = (9 == (31 & ((((*((long *) ((((char *) (-3 + x_12X))) + -4))))>>2))));
  263. goto gc_recordP_return;}
  264. else {
  265. gc_recordP0_return_value = 0;
  266. goto gc_recordP_return;}}}
  267. else {
  268. gc_recordP0_return_value = 0;
  269. goto gc_recordP_return;}}
  270. gc_recordP_return:
  271. switch (gc_recordP_return_tag) {
  272. case 0: goto gc_recordP_return_0;
  273. default: goto gc_recordP_return_1;
  274. }}
  275. table_setB: {
  276. table_9X = merged_arg2K0;
  277. key_10X = merged_arg0K1;
  278. value_11X = merged_arg1K2;{
  279. if ((0 < (table_9X->size))) {
  280. size_32X = table_9X->size;
  281. keys_33X = table_9X->keys;
  282. arg0K0 = ((key_10X ^ ((((key_10X)<<1)) ^ (((key_10X)>>10)))) & (-1 + size_32X));
  283. goto L2696;}
  284. else {
  285. goto table_setB_return;}}
  286. L2696: {
  287. i_34X = arg0K0;
  288. next_35X = *(keys_33X + i_34X);
  289. if ((key_10X == next_35X)) {
  290. *((table_9X->values) + i_34X) = value_11X;
  291. goto table_setB_return;}
  292. else {
  293. if ((0 == next_35X)) {
  294. if ((i_34X == (table_9X->size))) {
  295. arg0K0 = 0;
  296. goto L2696;}
  297. else {
  298. *((table_9X->keys) + i_34X) = key_10X;
  299. *((table_9X->values) + i_34X) = value_11X;
  300. table_9X->count = (1 + (table_9X->count));
  301. if (((table_9X->count) == ((table_9X->size) / 3))) {
  302. old_keys_36X = table_9X->keys;
  303. old_size_37X = table_9X->size;
  304. v_38X = table_9X->size;
  305. old_values_39X = table_9X->values;
  306. new_size_40X = ((v_38X)<<1);
  307. new_keys_41X = (long*)malloc(sizeof(long) * (1 + new_size_40X));
  308. new_values_42X = (struct image_location**)malloc(sizeof(struct image_location*) * new_size_40X);
  309. if ((NULL == new_keys_41X)) {
  310. goto L1874;}
  311. else {
  312. if ((NULL == new_values_42X)) {
  313. goto L1874;}
  314. else {
  315. table_9X->keys = new_keys_41X;
  316. table_9X->values = new_values_42X;
  317. table_9X->size = new_size_40X;
  318. table_9X->count = 0;
  319. arg0K0 = 0;
  320. goto L2027;}}}
  321. else {
  322. goto table_setB_return;}}}
  323. else {
  324. arg0K0 = (1 + i_34X);
  325. goto L2696;}}}
  326. L1874: {
  327. if ((NULL == new_keys_41X)) {
  328. goto L1882;}
  329. else {
  330. free(new_keys_41X);
  331. goto L1882;}}
  332. L2027: {
  333. i_43X = arg0K0;
  334. if ((i_43X < (1 + new_size_40X))) {
  335. *(new_keys_41X + i_43X) = 0;
  336. arg0K0 = (1 + i_43X);
  337. goto L2027;}
  338. else {
  339. arg0K0 = 0;
  340. goto L1905;}}
  341. L1882: {
  342. if ((NULL == new_values_42X)) {
  343. goto L1890;}
  344. else {
  345. free(new_values_42X);
  346. goto L1890;}}
  347. L1905: {
  348. i_44X = arg0K0;
  349. if ((i_44X == old_size_37X)) {
  350. free(old_keys_36X);
  351. free(old_values_39X);
  352. goto table_setB_return;}
  353. else {
  354. key_45X = *(old_keys_36X + i_44X);
  355. if ((0 == key_45X)) {
  356. goto L1921;}
  357. else {
  358. value_46X = *(old_values_39X + i_44X);
  359. arg0K0 = ((key_45X ^ ((((key_45X)<<1)) ^ (((key_45X)>>10)))) & (-1 + new_size_40X));
  360. goto L2049;}}}
  361. L1890: {
  362. table_9X->size = 0;
  363. goto table_setB_return;}
  364. L1921: {
  365. arg0K0 = (1 + i_44X);
  366. goto L1905;}
  367. L2049: {
  368. i_47X = arg0K0;
  369. if ((0 == (*(new_keys_41X + i_47X)))) {
  370. if ((i_47X == new_size_40X)) {
  371. arg0K0 = 0;
  372. goto L2049;}
  373. else {
  374. *(new_keys_41X + i_47X) = key_45X;
  375. *(new_values_42X + i_47X) = value_46X;
  376. goto L1921;}}
  377. else {
  378. arg0K0 = (1 + i_47X);
  379. goto L2049;}}
  380. table_setB_return:
  381. switch (table_setB_return_tag) {
  382. case 0: goto table_setB_return_0;
  383. default: goto table_setB_return_1;
  384. }}
  385. }
  386. long s48_write_image(long resume_proc_48X, long undumpables_49X, FILE * port_50X)
  387. {
  388. struct table *arg2K0;
  389. long arg0K0;
  390. char * arg3K0;
  391. long merged_arg0K0;
  392. long merged_arg0K1;
  393. char * merged_arg3K0;
  394. int copy_image_data_return_tag;
  395. int write_descriptor_return_tag;
  396. int write_shared_table_return_tag;
  397. char write_shared_table0_return_value;
  398. char * start_51X;
  399. long size_52X;
  400. long descriptor_53X;
  401. long table_54X;
  402. long have_193X;
  403. long have_192X;
  404. long v_191X;
  405. long value_190X;
  406. struct image_location *have_189X;
  407. long thing_188X;
  408. long link_187X;
  409. struct image_location *v_186X;
  410. long next_185X;
  411. long shared_184X;
  412. long link_183X;
  413. char temp_182X;
  414. long i_181X;
  415. long value_180X;
  416. long v_179X;
  417. struct image_location *have_178X;
  418. long v_177X;
  419. long v_176X;
  420. struct image_location *have_175X;
  421. long thing_174X;
  422. struct image_location *have_173X;
  423. long thing_172X;
  424. long x_171X;
  425. char * addr_170X;
  426. long v_169X;
  427. long value_168X;
  428. struct image_location *have_167X;
  429. long thing_166X;
  430. char * addr_165X;
  431. char * start_164X;
  432. long header_163X;
  433. long next_162X;
  434. struct image_location *have_161X;
  435. long thing_160X;
  436. struct image_location *have_159X;
  437. char * addr_158X;
  438. long v_157X;
  439. long link_156X;
  440. struct image_location *v_155X;
  441. long next_154X;
  442. char * start_153X;
  443. long header_152X;
  444. long next_151X;
  445. long value_150X;
  446. long have_149X;
  447. long available_148X;
  448. long size_147X;
  449. char * start_146X;
  450. long header_145X;
  451. long shared_144X;
  452. long link_143X;
  453. struct image_location *v_142X;
  454. long next_141X;
  455. struct image_location *have_140X;
  456. long thing_139X;
  457. long i_138X;
  458. long link_137X;
  459. long symbol_136X;
  460. long v_135X;
  461. long link_134X;
  462. struct image_location *v_133X;
  463. long next_132X;
  464. struct image_location **values_131X;
  465. long *keys_130X;
  466. struct table *table_129X;
  467. long link_128X;
  468. struct image_location *have_127X;
  469. long thing_126X;
  470. long id_125X;
  471. char * addr_124X;
  472. long symbol_123X;
  473. long have_122X;
  474. char v_121X;
  475. struct image_location *location_120X;
  476. long stob_119X;
  477. char * start_118X;
  478. long header_117X;
  479. struct image_location *have_116X;
  480. long thing_115X;
  481. long link_114X;
  482. long v_113X;
  483. long v_112X;
  484. long i_111X;
  485. struct image_location *v_110X;
  486. long thing_109X;
  487. long table_108X;
  488. struct image_location *location_107X;
  489. long stob_106X;
  490. long v_105X;
  491. long v_104X;
  492. long v_103X;
  493. long n_102X;
  494. long v_101X;
  495. long n_100X;
  496. struct image_location *have_99X;
  497. long thing_98X;
  498. long v_97X;
  499. long n_96X;
  500. struct image_location *have_95X;
  501. long thing_94X;
  502. long v_93X;
  503. long n_92X;
  504. struct image_location *have_91X;
  505. long thing_90X;
  506. long v_89X;
  507. long v_88X;
  508. long v_87X;
  509. long v_86X;
  510. long v_85X;
  511. long v_84X;
  512. long i_83X;
  513. long v_82X;
  514. struct image_location **values_81X;
  515. long *keys_80X;
  516. struct table *table_79X;
  517. long v_78X;
  518. char * data_addr_77X;
  519. long cells_76X;
  520. long v_75X;
  521. long v_74X;
  522. long v_73X;
  523. struct image_location *last_72X;
  524. char * addr_71X;
  525. long next_70X;
  526. struct image_location *image_location_69X;
  527. char * start_68X;
  528. long link_67X;
  529. long entry_66X;
  530. long header_65X;
  531. long stob_64X;
  532. long link_63X;
  533. long i_62X;
  534. long table_61X;
  535. long resume_proc_60X;
  536. struct table *v_59X;
  537. struct table *table_58X;
  538. long i_57X;
  539. long *keys_56X;
  540. char * start_address_55X;
  541. { start_address_55X = ((char *) 0);
  542. keys_56X = (long*)malloc(sizeof(long) * 4097);
  543. arg0K0 = 0;
  544. goto L2617;}
  545. L2617: {
  546. i_57X = arg0K0;
  547. if ((i_57X < 4097)) {
  548. *(keys_56X + i_57X) = 0;
  549. arg0K0 = (1 + i_57X);
  550. goto L2617;}
  551. else {
  552. table_58X = (struct table*)malloc(sizeof(struct table));
  553. if ((NULL == table_58X)) {
  554. arg2K0 = table_58X;
  555. goto L2586;}
  556. else {
  557. table_58X->keys = keys_56X;
  558. table_58X->values = ((struct image_location**)malloc(sizeof(struct image_location*) * 4096));
  559. table_58X->count = 0;
  560. table_58X->size = 4096;
  561. arg2K0 = table_58X;
  562. goto L2586;}}}
  563. L2586: {
  564. v_59X = arg2K0;
  565. Sstob_tableS = v_59X;
  566. Sfirst_stobS = 1;
  567. Slast_stobS = (NULL);
  568. Simage_beginS = start_address_55X;
  569. Simage_hpS = start_address_55X;
  570. Sundumpable_recordsS = undumpables_49X;
  571. Sundumpable_countS = 0;
  572. Sresumer_countS = 0;
  573. Simage_portS = port_50X;
  574. Simage_bufferS = ((char *)malloc(4096));
  575. Simage_buffer_pointerS = (Simage_bufferS);
  576. SstatusS = NO_ERRORS;
  577. if (((Simage_bufferS) == NULL)) {
  578. return ENOMEM;}
  579. else {
  580. resume_proc_60X = trace_image_value(resume_proc_48X);
  581. table_61X = s48_exported_bindings();
  582. arg0K0 = 0;
  583. goto L3414;}}
  584. L3414: {
  585. i_62X = arg0K0;
  586. if ((1024 == i_62X)) {
  587. arg0K0 = (Sfirst_stobS);
  588. goto L4863;}
  589. else {
  590. link_63X = *((long *) ((((char *) (-3 + table_61X))) + (((i_62X)<<2))));
  591. if ((0 == (3 & link_63X))) {
  592. arg0K0 = (3 + (-4 & link_63X));
  593. goto L3388;}
  594. else {
  595. arg0K0 = link_63X;
  596. goto L3388;}}}
  597. L4863: {
  598. stob_64X = arg0K0;
  599. header_65X = *((long *) ((((char *) (-3 + stob_64X))) + -4));
  600. if ((2 == (3 & header_65X))) {
  601. if (((31 & (((header_65X)>>2))) < 16)) {
  602. goto L4727;}
  603. else {
  604. goto L4865;}}
  605. else {
  606. goto L4727;}}
  607. L3388: {
  608. entry_66X = arg0K0;
  609. if ((1 == entry_66X)) {
  610. arg0K0 = (1 + i_62X);
  611. goto L3414;}
  612. else {trace_image_value(entry_66X);
  613. link_67X = *((long *) ((((char *) (-3 + entry_66X))) + 12));
  614. if ((0 == (3 & link_67X))) {
  615. arg0K0 = (3 + (-4 & link_67X));
  616. goto L3388;}
  617. else {
  618. arg0K0 = link_67X;
  619. goto L3388;}}}
  620. L4727: {
  621. if ((1078 == header_65X)) {
  622. goto L4865;}
  623. else {
  624. start_68X = ((char *) (-3 + stob_64X));
  625. arg3K0 = start_68X;
  626. goto L4746;}}
  627. L4865: {
  628. if ((0 < ((Sstob_tableS)->size))) {
  629. image_location_69X = table_ref((Sstob_tableS), stob_64X);
  630. next_70X = image_location_69X->next;
  631. if ((3 == (3 & next_70X))) {
  632. arg0K0 = next_70X;
  633. goto L4863;}
  634. else {
  635. goto L4934;}}
  636. else {
  637. goto L4934;}}
  638. L4746: {
  639. addr_71X = arg3K0;
  640. if ((addr_71X == (start_68X + (-4 & (3 + ((long)(((unsigned long)header_65X)>>8))))))) {
  641. goto L4865;}
  642. else {trace_image_value((*((long *) addr_71X)));
  643. arg3K0 = (addr_71X + 4);
  644. goto L4746;}}
  645. L4934: {
  646. last_72X = Slast_stobS;
  647. v_73X = s48_symbol_table();trace_image_value(v_73X);
  648. v_74X = s48_imported_bindings();trace_image_value(v_74X);
  649. v_75X = s48_exported_bindings();trace_image_value(v_75X);
  650. last_72X->next = 1;
  651. cells_76X = Sresumer_countS;
  652. data_addr_77X = (Simage_hpS) + 4;
  653. Simage_hpS = (data_addr_77X + (((cells_76X)<<2)));
  654. Sresumer_recordsS = (3 + (((long) data_addr_77X)));
  655. if ((0 < ((Sstob_tableS)->size))) {
  656. if (((SstatusS) == NO_ERRORS)) {
  657. PS_WRITE_CHAR(10, port_50X, v_78X)
  658. SstatusS = v_78X;
  659. goto L2290;}
  660. else {
  661. goto L2290;}}
  662. else {
  663. table_79X = Sstob_tableS;
  664. keys_80X = table_79X->keys;
  665. values_81X = table_79X->values;
  666. arg0K0 = 0;
  667. goto L5246;}}
  668. L2290: {
  669. if (((SstatusS) == NO_ERRORS)) {
  670. PS_WRITE_CHAR(12, (Simage_portS), v_82X)
  671. SstatusS = v_82X;
  672. goto L2292;}
  673. else {
  674. goto L2292;}}
  675. L5246: {
  676. i_83X = arg0K0;
  677. if ((i_83X == (table_79X->size))) {
  678. free(keys_80X);
  679. free(values_81X);
  680. free(table_79X);
  681. free((Simage_bufferS));
  682. return ENOMEM;}
  683. else {
  684. if ((0 == (*(keys_80X + i_83X)))) {
  685. goto L5248;}
  686. else {
  687. free((*(values_81X + i_83X)));
  688. goto L5248;}}}
  689. L2292: {
  690. if (((SstatusS) == NO_ERRORS)) {
  691. PS_WRITE_CHAR(10, port_50X, v_84X)
  692. SstatusS = v_84X;
  693. goto L2301;}
  694. else {
  695. goto L2301;}}
  696. L5248: {
  697. arg0K0 = (1 + i_83X);
  698. goto L5246;}
  699. L2301: {
  700. if (((SstatusS) == NO_ERRORS)) {
  701. SstatusS = (ps_write_string("Vanilla 32", port_50X));
  702. goto L2308;}
  703. else {
  704. goto L2308;}}
  705. L2308: {
  706. if (((SstatusS) == NO_ERRORS)) {
  707. PS_WRITE_CHAR(10, port_50X, v_85X)
  708. SstatusS = v_85X;
  709. goto L2317;}
  710. else {
  711. goto L2317;}}
  712. L2317: {
  713. if (((SstatusS) == NO_ERRORS)) {
  714. SstatusS = (ps_write_integer(4, (Simage_portS)));
  715. goto L2362;}
  716. else {
  717. goto L2362;}}
  718. L2362: {
  719. if (((SstatusS) == NO_ERRORS)) {
  720. PS_WRITE_CHAR(10, (Simage_portS), v_86X)
  721. SstatusS = v_86X;
  722. goto L2319;}
  723. else {
  724. goto L2319;}}
  725. L2319: {
  726. if (((SstatusS) == NO_ERRORS)) {
  727. SstatusS = (ps_write_integer(0, (Simage_portS)));
  728. goto L2379;}
  729. else {
  730. goto L2379;}}
  731. L2379: {
  732. if (((SstatusS) == NO_ERRORS)) {
  733. PS_WRITE_CHAR(10, (Simage_portS), v_87X)
  734. SstatusS = v_87X;
  735. goto L2323;}
  736. else {
  737. goto L2323;}}
  738. L2323: {
  739. v_88X = (Simage_hpS) - (Simage_beginS);
  740. if (((SstatusS) == NO_ERRORS)) {
  741. SstatusS = (ps_write_integer((((v_88X)>>2)), (Simage_portS)));
  742. goto L2398;}
  743. else {
  744. goto L2398;}}
  745. L2398: {
  746. if (((SstatusS) == NO_ERRORS)) {
  747. PS_WRITE_CHAR(10, (Simage_portS), v_89X)
  748. SstatusS = v_89X;
  749. goto L2329;}
  750. else {
  751. goto L2329;}}
  752. L2329: {
  753. thing_90X = s48_symbol_table();
  754. if ((3 == (3 & thing_90X))) {
  755. have_91X = table_ref((Sstob_tableS), thing_90X);
  756. if ((NULL == have_91X)) {
  757. ps_error("traced object has no descriptor in image", 0);
  758. goto L2416;}
  759. else {
  760. goto L2416;}}
  761. else {
  762. arg0K0 = thing_90X;
  763. goto L2333;}}
  764. L2416: {
  765. arg0K0 = (have_91X->new_descriptor);
  766. goto L2333;}
  767. L2333: {
  768. n_92X = arg0K0;
  769. if (((SstatusS) == NO_ERRORS)) {
  770. SstatusS = (ps_write_integer(n_92X, (Simage_portS)));
  771. goto L2426;}
  772. else {
  773. goto L2426;}}
  774. L2426: {
  775. if (((SstatusS) == NO_ERRORS)) {
  776. PS_WRITE_CHAR(10, (Simage_portS), v_93X)
  777. SstatusS = v_93X;
  778. goto L2335;}
  779. else {
  780. goto L2335;}}
  781. L2335: {
  782. thing_94X = s48_imported_bindings();
  783. if ((3 == (3 & thing_94X))) {
  784. have_95X = table_ref((Sstob_tableS), thing_94X);
  785. if ((NULL == have_95X)) {
  786. ps_error("traced object has no descriptor in image", 0);
  787. goto L2444;}
  788. else {
  789. goto L2444;}}
  790. else {
  791. arg0K0 = thing_94X;
  792. goto L2339;}}
  793. L2444: {
  794. arg0K0 = (have_95X->new_descriptor);
  795. goto L2339;}
  796. L2339: {
  797. n_96X = arg0K0;
  798. if (((SstatusS) == NO_ERRORS)) {
  799. SstatusS = (ps_write_integer(n_96X, (Simage_portS)));
  800. goto L2454;}
  801. else {
  802. goto L2454;}}
  803. L2454: {
  804. if (((SstatusS) == NO_ERRORS)) {
  805. PS_WRITE_CHAR(10, (Simage_portS), v_97X)
  806. SstatusS = v_97X;
  807. goto L2341;}
  808. else {
  809. goto L2341;}}
  810. L2341: {
  811. thing_98X = s48_exported_bindings();
  812. if ((3 == (3 & thing_98X))) {
  813. have_99X = table_ref((Sstob_tableS), thing_98X);
  814. if ((NULL == have_99X)) {
  815. ps_error("traced object has no descriptor in image", 0);
  816. goto L2472;}
  817. else {
  818. goto L2472;}}
  819. else {
  820. arg0K0 = thing_98X;
  821. goto L2345;}}
  822. L2472: {
  823. arg0K0 = (have_99X->new_descriptor);
  824. goto L2345;}
  825. L2345: {
  826. n_100X = arg0K0;
  827. if (((SstatusS) == NO_ERRORS)) {
  828. SstatusS = (ps_write_integer(n_100X, (Simage_portS)));
  829. goto L2482;}
  830. else {
  831. goto L2482;}}
  832. L2482: {
  833. if (((SstatusS) == NO_ERRORS)) {
  834. PS_WRITE_CHAR(10, (Simage_portS), v_101X)
  835. SstatusS = v_101X;
  836. goto L2347;}
  837. else {
  838. goto L2347;}}
  839. L2347: {
  840. n_102X = Sresumer_recordsS;
  841. if (((SstatusS) == NO_ERRORS)) {
  842. SstatusS = (ps_write_integer(n_102X, (Simage_portS)));
  843. goto L2496;}
  844. else {
  845. goto L2496;}}
  846. L2496: {
  847. if (((SstatusS) == NO_ERRORS)) {
  848. PS_WRITE_CHAR(10, (Simage_portS), v_103X)
  849. SstatusS = v_103X;
  850. goto L2349;}
  851. else {
  852. goto L2349;}}
  853. L2349: {
  854. if (((SstatusS) == NO_ERRORS)) {
  855. SstatusS = (ps_write_integer(resume_proc_60X, (Simage_portS)));
  856. goto L2510;}
  857. else {
  858. goto L2510;}}
  859. L2510: {
  860. if (((SstatusS) == NO_ERRORS)) {
  861. PS_WRITE_CHAR(10, (Simage_portS), v_104X)
  862. SstatusS = v_104X;
  863. goto L2351;}
  864. else {
  865. goto L2351;}}
  866. L2351: {
  867. if (((SstatusS) == NO_ERRORS)) {
  868. PS_WRITE_CHAR(12, (Simage_portS), v_105X)
  869. SstatusS = v_105X;
  870. goto L5151;}
  871. else {
  872. goto L5151;}}
  873. L5151: {
  874. merged_arg0K0 = 1;
  875. write_descriptor_return_tag = 0;
  876. goto write_descriptor;
  877. write_descriptor_return_0:
  878. arg0K0 = (Sfirst_stobS);
  879. goto L4592;}
  880. L4592: {
  881. stob_106X = arg0K0;
  882. if ((3 == (3 & stob_106X))) {
  883. location_107X = table_ref((Sstob_tableS), stob_106X);
  884. if ((NULL == location_107X)) {
  885. ps_error("traced stob has no image-table entry", 0);
  886. goto L4607;}
  887. else {
  888. goto L4607;}}
  889. else {
  890. table_108X = s48_symbol_table();
  891. merged_arg0K0 = (*((long *) ((((char *) (-3 + table_108X))) + -4)));
  892. write_descriptor_return_tag = 1;
  893. goto write_descriptor;
  894. write_descriptor_return_1:
  895. arg0K0 = 0;
  896. goto L3587;}}
  897. L4607: {
  898. if ((3 == (3 & stob_106X))) {
  899. if ((13 == (31 & ((((*((long *) ((((char *) (-3 + stob_106X))) + -4))))>>2))))) {
  900. merged_arg0K0 = 1078;
  901. write_descriptor_return_tag = 2;
  902. goto write_descriptor;
  903. write_descriptor_return_2:
  904. thing_109X = *((long *) (((char *) (-3 + stob_106X))));
  905. if ((3 == (3 & thing_109X))) {
  906. v_110X = table_ref((Sstob_tableS), thing_109X);
  907. if ((NULL == v_110X)) {
  908. merged_arg0K0 = 1;
  909. write_descriptor_return_tag = 3;
  910. goto write_descriptor;
  911. write_descriptor_return_3:
  912. goto L4609;}
  913. else {
  914. goto L4338;}}
  915. else {
  916. goto L4338;}}
  917. else {
  918. goto L4344;}}
  919. else {
  920. goto L4344;}}
  921. L3587: {
  922. i_111X = arg0K0;
  923. if ((i_111X == ((((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + table_108X))) + -4))))>>8))))>>2)))) {
  924. v_112X = s48_imported_bindings();
  925. merged_arg0K0 = v_112X;
  926. write_shared_table_return_tag = 0;
  927. goto write_shared_table;
  928. write_shared_table_return_0:
  929. v_113X = s48_exported_bindings();
  930. merged_arg0K0 = v_113X;
  931. write_shared_table_return_tag = 1;
  932. goto write_shared_table;
  933. write_shared_table_return_1:
  934. merged_arg0K0 = (10 + ((((Sresumer_countS))<<10)));
  935. write_descriptor_return_tag = 4;
  936. goto write_descriptor;
  937. write_descriptor_return_4:
  938. arg0K0 = (Sfirst_stobS);
  939. goto L4687;}
  940. else {
  941. link_114X = *((long *) ((((char *) (-3 + table_108X))) + (((i_111X)<<2))));
  942. if ((0 == (3 & link_114X))) {
  943. arg0K0 = (3 + (-4 & link_114X));
  944. goto L3597;}
  945. else {
  946. arg0K0 = link_114X;
  947. goto L3597;}}}
  948. L4609: {
  949. arg0K0 = (location_107X->next);
  950. goto L4592;}
  951. L4338: {
  952. thing_115X = *((long *) (((char *) (-3 + stob_106X))));
  953. if ((3 == (3 & thing_115X))) {
  954. have_116X = table_ref((Sstob_tableS), thing_115X);
  955. if ((NULL == have_116X)) {
  956. ps_error("traced object has no descriptor in image", 0);
  957. goto L4402;}
  958. else {
  959. goto L4402;}}
  960. else {
  961. merged_arg0K0 = thing_115X;
  962. write_descriptor_return_tag = 5;
  963. goto write_descriptor;
  964. write_descriptor_return_5:
  965. goto L4609;}}
  966. L4344: {
  967. if ((3 == (3 & stob_106X))) {
  968. if ((6 == (31 & ((((*((long *) ((((char *) (-3 + stob_106X))) + -4))))>>2))))) {
  969. header_117X = *((long *) ((((char *) (-3 + stob_106X))) + -4));
  970. merged_arg0K0 = header_117X;
  971. write_descriptor_return_tag = 6;
  972. goto write_descriptor;
  973. write_descriptor_return_6:
  974. merged_arg0K0 = 0;
  975. write_descriptor_return_tag = 7;
  976. goto write_descriptor;
  977. write_descriptor_return_7:
  978. start_118X = (((char *) (-3 + stob_106X))) + 4;
  979. arg3K0 = start_118X;
  980. goto L3094;}
  981. else {
  982. goto L4348;}}
  983. else {
  984. goto L4348;}}
  985. L4687: {
  986. stob_119X = arg0K0;
  987. if ((3 == (3 & stob_119X))) {
  988. location_120X = table_ref((Sstob_tableS), stob_119X);
  989. v_121X = resumer_recordP(stob_119X);
  990. if (v_121X) {
  991. merged_arg0K0 = (location_120X->new_descriptor);
  992. write_descriptor_return_tag = 8;
  993. goto write_descriptor;
  994. write_descriptor_return_8:
  995. goto L4699;}
  996. else {
  997. goto L4699;}}
  998. else {
  999. have_122X = (Simage_buffer_pointerS) - (Simage_bufferS);
  1000. if ((0 < have_122X)) {
  1001. if (((SstatusS) == NO_ERRORS)) {
  1002. SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_122X));
  1003. goto L5194;}
  1004. else {
  1005. goto L5194;}}
  1006. else {
  1007. goto L5157;}}}
  1008. L3597: {
  1009. symbol_123X = arg0K0;
  1010. arg0K0 = symbol_123X;
  1011. goto L3631;}
  1012. L4402: {
  1013. merged_arg0K0 = (have_116X->new_descriptor);
  1014. write_descriptor_return_tag = 9;
  1015. goto write_descriptor;
  1016. write_descriptor_return_9:
  1017. goto L4609;}
  1018. L3094: {
  1019. addr_124X = arg3K0;
  1020. if ((addr_124X == (start_118X + (-4 + (-4 & (3 + ((long)(((unsigned long)header_117X)>>8)))))))) {
  1021. ps_write_string("Channel closed in dumped image: ", (stderr));
  1022. id_125X = *((long *) ((((char *) (-3 + stob_106X))) + 4));
  1023. if ((0 == (3 & id_125X))) {
  1024. ps_write_integer((((id_125X)>>2)), (stderr));
  1025. goto L3071;}
  1026. else {
  1027. ps_write_string((((char *)(((char *) (-3 + id_125X))))), (stderr));
  1028. goto L3071;}}
  1029. else {
  1030. thing_126X = *((long *) addr_124X);
  1031. if ((3 == (3 & thing_126X))) {
  1032. have_127X = table_ref((Sstob_tableS), thing_126X);
  1033. if ((NULL == have_127X)) {
  1034. ps_error("traced object has no descriptor in image", 0);
  1035. goto L3108;}
  1036. else {
  1037. goto L3108;}}
  1038. else {
  1039. arg0K0 = thing_126X;
  1040. goto L3099;}}}
  1041. L4348: {
  1042. if ((3 == (3 & stob_106X))) {
  1043. if ((1 == (31 & ((((*((long *) ((((char *) (-3 + stob_106X))) + -4))))>>2))))) {
  1044. link_128X = *((long *) ((((char *) (-3 + stob_106X))) + 4));
  1045. if ((0 == (3 & link_128X))) {
  1046. arg0K0 = (3 + (-4 & link_128X));
  1047. goto L4030;}
  1048. else {
  1049. arg0K0 = link_128X;
  1050. goto L4030;}}
  1051. else {
  1052. goto L4352;}}
  1053. else {
  1054. goto L4352;}}
  1055. L4699: {
  1056. arg0K0 = (location_120X->next);
  1057. goto L4687;}
  1058. L5194: {
  1059. Simage_buffer_pointerS = (Simage_bufferS);
  1060. goto L5157;}
  1061. L5157: {
  1062. table_129X = Sstob_tableS;
  1063. keys_130X = table_129X->keys;
  1064. values_131X = table_129X->values;
  1065. arg0K0 = 0;
  1066. goto L5212;}
  1067. L3631: {
  1068. next_132X = arg0K0;
  1069. if ((3 == (3 & next_132X))) {
  1070. v_133X = table_ref((Sstob_tableS), next_132X);
  1071. if ((NULL == v_133X)) {
  1072. link_134X = *((long *) ((((char *) (-3 + next_132X))) + 4));
  1073. if ((0 == (3 & link_134X))) {
  1074. arg0K0 = (3 + (-4 & link_134X));
  1075. goto L3631;}
  1076. else {
  1077. arg0K0 = link_134X;
  1078. goto L3631;}}
  1079. else {
  1080. arg0K0 = next_132X;
  1081. goto L3599;}}
  1082. else {
  1083. arg0K0 = next_132X;
  1084. goto L3599;}}
  1085. L3071: {
  1086. { long ignoreXX;
  1087. PS_WRITE_CHAR(10, (stderr), ignoreXX) }
  1088. goto L4609;}
  1089. L3108: {
  1090. arg0K0 = (have_127X->new_descriptor);
  1091. goto L3099;}
  1092. L3099: {
  1093. v_135X = arg0K0;
  1094. merged_arg0K0 = v_135X;
  1095. write_descriptor_return_tag = 10;
  1096. goto write_descriptor;
  1097. write_descriptor_return_10:
  1098. arg3K0 = (addr_124X + 4);
  1099. goto L3094;}
  1100. L4030: {
  1101. symbol_136X = arg0K0;
  1102. arg0K0 = symbol_136X;
  1103. goto L4063;}
  1104. L4352: {
  1105. if ((3 == (3 & stob_106X))) {
  1106. if ((14 == (31 & ((((*((long *) ((((char *) (-3 + stob_106X))) + -4))))>>2))))) {
  1107. link_137X = *((long *) ((((char *) (-3 + stob_106X))) + 12));
  1108. if ((0 == (3 & link_137X))) {
  1109. arg0K0 = (3 + (-4 & link_137X));
  1110. goto L3873;}
  1111. else {
  1112. arg0K0 = link_137X;
  1113. goto L3873;}}
  1114. else {
  1115. goto L4356;}}
  1116. else {
  1117. goto L4356;}}
  1118. L5212: {
  1119. i_138X = arg0K0;
  1120. if ((i_138X == (table_129X->size))) {
  1121. free(keys_130X);
  1122. free(values_131X);
  1123. free(table_129X);
  1124. free((Simage_bufferS));
  1125. return (SstatusS);}
  1126. else {
  1127. if ((0 == (*(keys_130X + i_138X)))) {
  1128. goto L5214;}
  1129. else {
  1130. free((*(values_131X + i_138X)));
  1131. goto L5214;}}}
  1132. L3599: {
  1133. thing_139X = arg0K0;
  1134. if ((3 == (3 & thing_139X))) {
  1135. have_140X = table_ref((Sstob_tableS), thing_139X);
  1136. if ((NULL == have_140X)) {
  1137. ps_error("traced object has no descriptor in image", 0);
  1138. goto L3650;}
  1139. else {
  1140. goto L3650;}}
  1141. else {
  1142. arg0K0 = thing_139X;
  1143. goto L3601;}}
  1144. L4063: {
  1145. next_141X = arg0K0;
  1146. if ((3 == (3 & next_141X))) {
  1147. v_142X = table_ref((Sstob_tableS), next_141X);
  1148. if ((NULL == v_142X)) {
  1149. link_143X = *((long *) ((((char *) (-3 + next_141X))) + 4));
  1150. if ((0 == (3 & link_143X))) {
  1151. arg0K0 = (3 + (-4 & link_143X));
  1152. goto L4063;}
  1153. else {
  1154. arg0K0 = link_143X;
  1155. goto L4063;}}
  1156. else {
  1157. arg0K0 = next_141X;
  1158. goto L4032;}}
  1159. else {
  1160. arg0K0 = next_141X;
  1161. goto L4032;}}
  1162. L3873: {
  1163. shared_144X = arg0K0;
  1164. arg0K0 = shared_144X;
  1165. goto L3922;}
  1166. L4356: {
  1167. header_145X = *((long *) ((((char *) (-3 + stob_106X))) + -4));
  1168. start_146X = ((char *) (-3 + stob_106X));
  1169. merged_arg0K0 = header_145X;
  1170. write_descriptor_return_tag = 11;
  1171. goto write_descriptor;
  1172. write_descriptor_return_11:
  1173. if ((2 == (3 & header_145X))) {
  1174. if (((31 & (((header_145X)>>2))) < 16)) {
  1175. goto L4372;}
  1176. else {
  1177. size_147X = -4 & (3 + ((long)(((unsigned long)header_145X)>>8)));
  1178. available_148X = 4096 - ((Simage_buffer_pointerS) - (Simage_bufferS));
  1179. if ((available_148X < size_147X)) {
  1180. if ((4096 < size_147X)) {
  1181. have_149X = (Simage_buffer_pointerS) - (Simage_bufferS);
  1182. if ((0 < have_149X)) {
  1183. if (((SstatusS) == NO_ERRORS)) {
  1184. SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_149X));
  1185. goto L2922;}
  1186. else {
  1187. goto L2922;}}
  1188. else {
  1189. goto L2896;}}
  1190. else {
  1191. merged_arg3K0 = start_146X;
  1192. merged_arg0K1 = available_148X;
  1193. copy_image_data_return_tag = 0;
  1194. goto copy_image_data;
  1195. copy_image_data_return_0:
  1196. merged_arg3K0 = (start_146X + available_148X);
  1197. merged_arg0K1 = (size_147X - available_148X);
  1198. copy_image_data_return_tag = 1;
  1199. goto copy_image_data;
  1200. copy_image_data_return_1:
  1201. goto L4609;}}
  1202. else {
  1203. merged_arg3K0 = start_146X;
  1204. merged_arg0K1 = size_147X;
  1205. copy_image_data_return_tag = 2;
  1206. goto copy_image_data;
  1207. copy_image_data_return_2:
  1208. goto L4609;}}}
  1209. else {
  1210. goto L4372;}}
  1211. L5214: {
  1212. arg0K0 = (1 + i_138X);
  1213. goto L5212;}
  1214. L3650: {
  1215. arg0K0 = (have_140X->new_descriptor);
  1216. goto L3601;}
  1217. L3601: {
  1218. value_150X = arg0K0;
  1219. if ((3 == (3 & value_150X))) {
  1220. arg0K0 = (-4 & value_150X);
  1221. goto L3603;}
  1222. else {
  1223. arg0K0 = value_150X;
  1224. goto L3603;}}
  1225. L4032: {
  1226. next_151X = arg0K0;
  1227. header_152X = *((long *) ((((char *) (-3 + stob_106X))) + -4));
  1228. merged_arg0K0 = header_152X;
  1229. write_descriptor_return_tag = 12;
  1230. goto write_descriptor;
  1231. write_descriptor_return_12:
  1232. start_153X = ((char *) (-3 + stob_106X));
  1233. arg3K0 = start_153X;
  1234. goto L4092;}
  1235. L3922: {
  1236. next_154X = arg0K0;
  1237. if ((3 == (3 & next_154X))) {
  1238. v_155X = table_ref((Sstob_tableS), next_154X);
  1239. if ((NULL == v_155X)) {
  1240. link_156X = *((long *) ((((char *) (-3 + next_154X))) + 12));
  1241. if ((0 == (3 & link_156X))) {
  1242. arg0K0 = (3 + (-4 & link_156X));
  1243. goto L3922;}
  1244. else {
  1245. arg0K0 = link_156X;
  1246. goto L3922;}}
  1247. else {
  1248. arg0K0 = next_154X;
  1249. goto L3875;}}
  1250. else {
  1251. arg0K0 = next_154X;
  1252. goto L3875;}}
  1253. L4372: {
  1254. arg3K0 = start_146X;
  1255. goto L4474;}
  1256. L2922: {
  1257. Simage_buffer_pointerS = (Simage_bufferS);
  1258. goto L2896;}
  1259. L2896: {
  1260. if (((SstatusS) == NO_ERRORS)) {
  1261. SstatusS = (ps_write_block((Simage_portS), ((char *) start_146X), size_147X));
  1262. goto L4609;}
  1263. else {
  1264. goto L4609;}}
  1265. L3603: {
  1266. v_157X = arg0K0;
  1267. merged_arg0K0 = v_157X;
  1268. write_descriptor_return_tag = 13;
  1269. goto write_descriptor;
  1270. write_descriptor_return_13:
  1271. arg0K0 = (1 + i_111X);
  1272. goto L3587;}
  1273. L4092: {
  1274. addr_158X = arg3K0;
  1275. if ((addr_158X == (start_153X + (-4 + (-4 & (3 + ((long)(((unsigned long)header_152X)>>8)))))))) {
  1276. if ((3 == (3 & next_151X))) {
  1277. have_159X = table_ref((Sstob_tableS), next_151X);
  1278. if ((NULL == have_159X)) {
  1279. ps_error("traced object has no descriptor in image", 0);
  1280. goto L4122;}
  1281. else {
  1282. goto L4122;}}
  1283. else {
  1284. arg0K0 = next_151X;
  1285. goto L4045;}}
  1286. else {
  1287. thing_160X = *((long *) addr_158X);
  1288. if ((3 == (3 & thing_160X))) {
  1289. have_161X = table_ref((Sstob_tableS), thing_160X);
  1290. if ((NULL == have_161X)) {
  1291. ps_error("traced object has no descriptor in image", 0);
  1292. goto L4106;}
  1293. else {
  1294. goto L4106;}}
  1295. else {
  1296. arg0K0 = thing_160X;
  1297. goto L4097;}}}
  1298. L3875: {
  1299. next_162X = arg0K0;
  1300. header_163X = *((long *) ((((char *) (-3 + stob_106X))) + -4));
  1301. merged_arg0K0 = header_163X;
  1302. write_descriptor_return_tag = 14;
  1303. goto write_descriptor;
  1304. write_descriptor_return_14:
  1305. start_164X = ((char *) (-3 + stob_106X));
  1306. arg3K0 = start_164X;
  1307. goto L3951;}
  1308. L4474: {
  1309. addr_165X = arg3K0;
  1310. if ((addr_165X == (start_146X + (-4 & (3 + ((long)(((unsigned long)header_145X)>>8))))))) {
  1311. goto L4609;}
  1312. else {
  1313. thing_166X = *((long *) addr_165X);
  1314. if ((3 == (3 & thing_166X))) {
  1315. have_167X = table_ref((Sstob_tableS), thing_166X);
  1316. if ((NULL == have_167X)) {
  1317. ps_error("traced object has no descriptor in image", 0);
  1318. goto L4488;}
  1319. else {
  1320. goto L4488;}}
  1321. else {
  1322. arg0K0 = thing_166X;
  1323. goto L4479;}}}
  1324. L4122: {
  1325. arg0K0 = (have_159X->new_descriptor);
  1326. goto L4045;}
  1327. L4045: {
  1328. value_168X = arg0K0;
  1329. if ((3 == (3 & value_168X))) {
  1330. merged_arg0K0 = (-4 & value_168X);
  1331. write_descriptor_return_tag = 15;
  1332. goto write_descriptor;
  1333. write_descriptor_return_15:
  1334. goto L4609;}
  1335. else {
  1336. merged_arg0K0 = value_168X;
  1337. write_descriptor_return_tag = 16;
  1338. goto write_descriptor;
  1339. write_descriptor_return_16:
  1340. goto L4609;}}
  1341. L4106: {
  1342. arg0K0 = (have_161X->new_descriptor);
  1343. goto L4097;}
  1344. L4097: {
  1345. v_169X = arg0K0;
  1346. merged_arg0K0 = v_169X;
  1347. write_descriptor_return_tag = 17;
  1348. goto write_descriptor;
  1349. write_descriptor_return_17:
  1350. arg3K0 = (addr_158X + 4);
  1351. goto L4092;}
  1352. L3951: {
  1353. addr_170X = arg3K0;
  1354. if ((addr_170X == (start_164X + (-8 + (-4 & (3 + ((long)(((unsigned long)header_163X)>>8)))))))) {
  1355. x_171X = *((long *) ((((char *) (-3 + stob_106X))) + 4));
  1356. if ((5 == x_171X)) {
  1357. arg0K0 = 529;
  1358. goto L3900;}
  1359. else {
  1360. thing_172X = *((long *) ((((char *) (-3 + stob_106X))) + 8));
  1361. if ((3 == (3 & thing_172X))) {
  1362. have_173X = table_ref((Sstob_tableS), thing_172X);
  1363. if ((NULL == have_173X)) {
  1364. ps_error("traced object has no descriptor in image", 0);
  1365. goto L4012;}
  1366. else {
  1367. goto L4012;}}
  1368. else {
  1369. arg0K0 = thing_172X;
  1370. goto L3900;}}}
  1371. else {
  1372. thing_174X = *((long *) addr_170X);
  1373. if ((3 == (3 & thing_174X))) {
  1374. have_175X = table_ref((Sstob_tableS), thing_174X);
  1375. if ((NULL == have_175X)) {
  1376. ps_error("traced object has no descriptor in image", 0);
  1377. goto L3965;}
  1378. else {
  1379. goto L3965;}}
  1380. else {
  1381. arg0K0 = thing_174X;
  1382. goto L3956;}}}
  1383. L4488: {
  1384. arg0K0 = (have_167X->new_descriptor);
  1385. goto L4479;}
  1386. L4479: {
  1387. v_176X = arg0K0;
  1388. merged_arg0K0 = v_176X;
  1389. write_descriptor_return_tag = 18;
  1390. goto write_descriptor;
  1391. write_descriptor_return_18:
  1392. arg3K0 = (addr_165X + 4);
  1393. goto L4474;}
  1394. L3900: {
  1395. v_177X = arg0K0;
  1396. merged_arg0K0 = v_177X;
  1397. write_descriptor_return_tag = 19;
  1398. goto write_descriptor;
  1399. write_descriptor_return_19:
  1400. if ((3 == (3 & next_162X))) {
  1401. have_178X = table_ref((Sstob_tableS), next_162X);
  1402. if ((NULL == have_178X)) {
  1403. ps_error("traced object has no descriptor in image", 0);
  1404. goto L3988;}
  1405. else {
  1406. goto L3988;}}
  1407. else {
  1408. arg0K0 = next_162X;
  1409. goto L3904;}}
  1410. L4012: {
  1411. arg0K0 = (have_173X->new_descriptor);
  1412. goto L3900;}
  1413. L3965: {
  1414. arg0K0 = (have_175X->new_descriptor);
  1415. goto L3956;}
  1416. L3956: {
  1417. v_179X = arg0K0;
  1418. merged_arg0K0 = v_179X;
  1419. write_descriptor_return_tag = 20;
  1420. goto write_descriptor;
  1421. write_descriptor_return_20:
  1422. arg3K0 = (addr_170X + 4);
  1423. goto L3951;}
  1424. L3988: {
  1425. arg0K0 = (have_178X->new_descriptor);
  1426. goto L3904;}
  1427. L3904: {
  1428. value_180X = arg0K0;
  1429. if ((3 == (3 & value_180X))) {
  1430. merged_arg0K0 = (-4 & value_180X);
  1431. write_descriptor_return_tag = 21;
  1432. goto write_descriptor;
  1433. write_descriptor_return_21:
  1434. goto L4609;}
  1435. else {
  1436. merged_arg0K0 = value_180X;
  1437. write_descriptor_return_tag = 22;
  1438. goto write_descriptor;
  1439. write_descriptor_return_22:
  1440. goto L4609;}}
  1441. write_shared_table: {
  1442. table_54X = merged_arg0K0;{
  1443. merged_arg0K0 = (*((long *) ((((char *) (-3 + table_54X))) + -4)));
  1444. write_descriptor_return_tag = 23;
  1445. goto write_descriptor;
  1446. write_descriptor_return_23:
  1447. arg0K0 = 0;
  1448. goto L3497;}
  1449. L3497: {
  1450. i_181X = arg0K0;
  1451. temp_182X = i_181X == ((((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + table_54X))) + -4))))>>8))))>>2));
  1452. if (temp_182X) {
  1453. write_shared_table0_return_value = temp_182X;
  1454. goto write_shared_table_return;}
  1455. else {
  1456. link_183X = *((long *) ((((char *) (-3 + table_54X))) + (((i_181X)<<2))));
  1457. if ((0 == (3 & link_183X))) {
  1458. arg0K0 = (3 + (-4 & link_183X));
  1459. goto L3507;}
  1460. else {
  1461. arg0K0 = link_183X;
  1462. goto L3507;}}}
  1463. L3507: {
  1464. shared_184X = arg0K0;
  1465. arg0K0 = shared_184X;
  1466. goto L3541;}
  1467. L3541: {
  1468. next_185X = arg0K0;
  1469. if ((3 == (3 & next_185X))) {
  1470. v_186X = table_ref((Sstob_tableS), next_185X);
  1471. if ((NULL == v_186X)) {
  1472. link_187X = *((long *) ((((char *) (-3 + next_185X))) + 12));
  1473. if ((0 == (3 & link_187X))) {
  1474. arg0K0 = (3 + (-4 & link_187X));
  1475. goto L3541;}
  1476. else {
  1477. arg0K0 = link_187X;
  1478. goto L3541;}}
  1479. else {
  1480. arg0K0 = next_185X;
  1481. goto L3509;}}
  1482. else {
  1483. arg0K0 = next_185X;
  1484. goto L3509;}}
  1485. L3509: {
  1486. thing_188X = arg0K0;
  1487. if ((3 == (3 & thing_188X))) {
  1488. have_189X = table_ref((Sstob_tableS), thing_188X);
  1489. if ((NULL == have_189X)) {
  1490. ps_error("traced object has no descriptor in image", 0);
  1491. goto L3560;}
  1492. else {
  1493. goto L3560;}}
  1494. else {
  1495. arg0K0 = thing_188X;
  1496. goto L3511;}}
  1497. L3560: {
  1498. arg0K0 = (have_189X->new_descriptor);
  1499. goto L3511;}
  1500. L3511: {
  1501. value_190X = arg0K0;
  1502. if ((3 == (3 & value_190X))) {
  1503. arg0K0 = (-4 & value_190X);
  1504. goto L3513;}
  1505. else {
  1506. arg0K0 = value_190X;
  1507. goto L3513;}}
  1508. L3513: {
  1509. v_191X = arg0K0;
  1510. merged_arg0K0 = v_191X;
  1511. write_descriptor_return_tag = 24;
  1512. goto write_descriptor;
  1513. write_descriptor_return_24:
  1514. arg0K0 = (1 + i_181X);
  1515. goto L3497;}
  1516. write_shared_table_return:
  1517. switch (write_shared_table_return_tag) {
  1518. case 0: goto write_shared_table_return_0;
  1519. default: goto write_shared_table_return_1;
  1520. }}
  1521. write_descriptor: {
  1522. descriptor_53X = merged_arg0K0;{
  1523. *((long *) (Simage_buffer_pointerS)) = (long) (descriptor_53X);
  1524. Simage_buffer_pointerS = ((Simage_buffer_pointerS) + 4);
  1525. if ((4096 == ((Simage_buffer_pointerS) - (Simage_bufferS)))) {
  1526. have_192X = (Simage_buffer_pointerS) - (Simage_bufferS);
  1527. if ((0 < have_192X)) {
  1528. if (((SstatusS) == NO_ERRORS)) {
  1529. SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_192X));
  1530. goto L2173;}
  1531. else {
  1532. goto L2173;}}
  1533. else {
  1534. goto write_descriptor_return;}}
  1535. else {
  1536. goto write_descriptor_return;}}
  1537. L2173: {
  1538. Simage_buffer_pointerS = (Simage_bufferS);
  1539. goto write_descriptor_return;}
  1540. write_descriptor_return:
  1541. switch (write_descriptor_return_tag) {
  1542. case 0: goto write_descriptor_return_0;
  1543. case 1: goto write_descriptor_return_1;
  1544. case 2: goto write_descriptor_return_2;
  1545. case 3: goto write_descriptor_return_3;
  1546. case 4: goto write_descriptor_return_4;
  1547. case 5: goto write_descriptor_return_5;
  1548. case 6: goto write_descriptor_return_6;
  1549. case 7: goto write_descriptor_return_7;
  1550. case 8: goto write_descriptor_return_8;
  1551. case 9: goto write_descriptor_return_9;
  1552. case 10: goto write_descriptor_return_10;
  1553. case 11: goto write_descriptor_return_11;
  1554. case 12: goto write_descriptor_return_12;
  1555. case 13: goto write_descriptor_return_13;
  1556. case 14: goto write_descriptor_return_14;
  1557. case 15: goto write_descriptor_return_15;
  1558. case 16: goto write_descriptor_return_16;
  1559. case 17: goto write_descriptor_return_17;
  1560. case 18: goto write_descriptor_return_18;
  1561. case 19: goto write_descriptor_return_19;
  1562. case 20: goto write_descriptor_return_20;
  1563. case 21: goto write_descriptor_return_21;
  1564. case 22: goto write_descriptor_return_22;
  1565. case 23: goto write_descriptor_return_23;
  1566. default: goto write_descriptor_return_24;
  1567. }}
  1568. copy_image_data: {
  1569. start_51X = merged_arg3K0;
  1570. size_52X = merged_arg0K1;{
  1571. memmove((void *)(Simage_buffer_pointerS), (void *)start_51X,size_52X);
  1572. Simage_buffer_pointerS = ((Simage_buffer_pointerS) + size_52X);
  1573. if ((4096 == ((Simage_buffer_pointerS) - (Simage_bufferS)))) {
  1574. have_193X = (Simage_buffer_pointerS) - (Simage_bufferS);
  1575. if ((0 < have_193X)) {
  1576. if (((SstatusS) == NO_ERRORS)) {
  1577. SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_193X));
  1578. goto L2198;}
  1579. else {
  1580. goto L2198;}}
  1581. else {
  1582. goto copy_image_data_return;}}
  1583. else {
  1584. goto copy_image_data_return;}}
  1585. L2198: {
  1586. Simage_buffer_pointerS = (Simage_bufferS);
  1587. goto copy_image_data_return;}
  1588. copy_image_data_return:
  1589. switch (copy_image_data_return_tag) {
  1590. case 0: goto copy_image_data_return_0;
  1591. case 1: goto copy_image_data_return_1;
  1592. default: goto copy_image_data_return_2;
  1593. }}
  1594. }void
  1595. s48_write_image_init(void)
  1596. {
  1597. SstatusS = NO_ERRORS;
  1598. }