DHAMP.b 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. /*
  2. * Input file : ./tests/inputs/DHAMP.EXE
  3. * File type : EXE
  4. */
  5. #include "dcc.h"
  6. int proc_2 (long arg0, long arg1)
  7. /* Takes 8 bytes of parameters.
  8. * High-level language prologue code.
  9. * C calling convention.
  10. */
  11. {
  12. char loc1; /* al */
  13. int loc2; /* al */
  14. int loc3; /* bx */
  15. do {
  16. arg0 = (arg0 + 1);
  17. loc1 = es[bx];
  18. arg1 = (arg1 + 1);
  19. es[bx] = loc1;
  20. } while ((loc2 != 0));
  21. return (loc3);
  22. }
  23. int proc_3 (long arg0, long arg1)
  24. /* Takes 8 bytes of parameters.
  25. * High-level language prologue code.
  26. * C calling convention.
  27. */
  28. {
  29. int loc1; /* ax */
  30. while ((es[bx] == es[bx])) {
  31. if (es[bx] == 0) {
  32. loc1 = 0;
  33. return (loc1);
  34. }
  35. else {
  36. arg0 = (arg0 + 1);
  37. arg1 = (arg1 + 1);
  38. }
  39. } /* end of while */
  40. loc1 = (es[bx] - es[bx]);
  41. }
  42. int proc_1 (int arg0, int arg1, int arg2, int arg3)
  43. /* Takes 8 bytes of parameters.
  44. * High-level language prologue code.
  45. * C calling convention.
  46. */
  47. {
  48. int loc1; /* si */
  49. int loc2; /* di */
  50. loc1 = 0;
  51. loc2 = 0;
  52. while ((loc1 < 0x2328)) {
  53. proc_2 (arg1, arg0, 311);
  54. proc_2 (arg3, arg2, 328);
  55. loc2 = (loc2 + proc_3 (arg1, arg0, arg3, arg2));
  56. loc1 = (loc1 + 1);
  57. } /* end of while */
  58. return (loc2);
  59. }
  60. int proc_4 ()
  61. /* Takes no parameters.
  62. * High-level language prologue code.
  63. */
  64. {
  65. int loc1;
  66. int loc2;
  67. int loc3;
  68. int loc4;
  69. loc3 = 0;
  70. while ((loc3 < 0x3e8)) {
  71. loc1 = 0;
  72. loc4 = 0;
  73. loc2 = 1;
  74. while ((loc4 < 179)) {
  75. loc1 = (loc1 + loc2);
  76. loc2 = (loc2 + 2);
  77. loc4 = (loc4 + 1);
  78. } /* end of while */
  79. loc3 = (loc3 + 1);
  80. } /* end of while */
  81. return (loc1);
  82. }
  83. int proc_5 (int arg0)
  84. /* Takes 2 bytes of parameters.
  85. * High-level language prologue code.
  86. * C calling convention.
  87. */
  88. {
  89. int loc1; /* si */
  90. int loc2; /* ax */
  91. loc1 = arg0;
  92. if (loc1 > 2) {
  93. loc2 = (proc_5 ((loc1 - 1)) + proc_5 ((loc1 + 0xfffe)));
  94. }
  95. else {
  96. loc2 = 1;
  97. }
  98. return (loc2);
  99. }
  100. long proc_6 (int arg0, int arg1)
  101. /* Takes 4 bytes of parameters.
  102. * High-level language prologue code.
  103. * C calling convention.
  104. */
  105. {
  106. long loc1;
  107. int loc2; /* si */
  108. if ((arg0 | arg1) == 0) {
  109. loc2 = 0;
  110. while ((loc2 < 0x2328)) {
  111. loc1 = (loc1 + [23798]);
  112. [23798] = ([23798] + 2);
  113. loc2 = (loc2 + 1);
  114. } /* end of while */
  115. }
  116. else {
  117. loc2 = 0;
  118. while ((loc2 < 0x2328)) {
  119. [23798] = ([23798] - 2);
  120. loc1 = (loc1 - [23798]);
  121. loc2 = (loc2 + 1);
  122. } /* end of while */
  123. }
  124. return (loc1);
  125. }
  126. void proc_8 (int arg0)
  127. /* Takes 8 bytes of parameters.
  128. * High-level language prologue code.
  129. * Untranslatable routine. Assembler provided.
  130. * C calling convention.
  131. * Contains instructions not normally used by compilers.
  132. * Contains coprocessor instructions.
  133. */
  134. {
  135. PUSH bp
  136. MOV bp, sp
  137. ESC FLD qword ptr [126h]
  138. ESC FLD qword ptr [bp+6]
  139. ESC FCOMPP
  140. ESC FSTSW qword ptr [62Ch]
  141. INT 3Dh /* Unknown int */
  142. MOV ah, [62Dh]
  143. SAHF
  144. JAE L1
  145. ESC FLD qword ptr [bp+6]
  146. ESC FCHS
  147. L2: POP bp
  148. RETF
  149. L1: ESC FLD qword ptr [bp+6]
  150. JMP L2 ;Synthetic inst
  151. }
  152. proc_7 (int arg0, int arg1, int arg2, int arg3)
  153. /* Takes 8 bytes of parameters.
  154. * High-level language prologue code.
  155. * Untranslatable routine. Assembler provided.
  156. * C calling convention.
  157. * Contains instructions not normally used by compilers.
  158. * Contains coprocessor instructions.
  159. */
  160. {
  161. PUSH bp
  162. MOV bp, sp
  163. SUB sp, 10h
  164. ESC FLD qword ptr [bp+6]
  165. ESC FDIV qword ptr [127h]
  166. ESC FSTP qword ptr [bp-8]
  167. INT 3Dh /* Unknown int */
  168. MOV ax, [bp+0Ch]
  169. MOV [bp-0Ah], ax
  170. MOV ax, [bp+0Ah]
  171. MOV [bp-0Ch], ax
  172. MOV ax, [bp+8]
  173. MOV [bp-0Eh], ax
  174. MOV ax, [bp+6]
  175. MOV [bp-10h], ax
  176. L1: ESC FLD qword ptr [12Fh]
  177. ESC FMUL qword ptr [bp-8]
  178. ESC FCOMP qword ptr [bp-10h]
  179. ESC FSTSW qword ptr [62Ch]
  180. INT 3Dh /* Unknown int */
  181. MOV ah, [62Dh]
  182. SAHF
  183. JB L2
  184. ESC FLD qword ptr [bp-8]
  185. MOV sp, bp
  186. POP bp
  187. RETF
  188. L2: ESC FLD qword ptr [bp+6]
  189. ESC FDIV qword ptr [bp-8]
  190. ESC FSUB qword ptr [bp-8]
  191. ESC FSTP qword ptr [bp-10h]
  192. INT 3Dh /* Unknown int */
  193. PUSH word ptr [bp-0Ah]
  194. PUSH word ptr [bp-0Ch]
  195. PUSH word ptr [bp-0Eh]
  196. PUSH word ptr [bp-10h]
  197. CALL far ptr proc_8
  198. ADD sp, 8
  199. ESC FSTP qword ptr [bp-10h]
  200. INT 3Dh /* Unknown int */
  201. ESC FLD qword ptr [bp+6]
  202. ESC FDIV qword ptr [bp-8]
  203. ESC FADD qword ptr [bp-8]
  204. ESC FDIV qword ptr [127h]
  205. ESC FSTP qword ptr [bp-8]
  206. INT 3Dh /* Unknown int */
  207. JMP L1 ;Synthetic inst
  208. }
  209. proc_9 (int arg0)
  210. /* Takes 8 bytes of parameters.
  211. * High-level language prologue code.
  212. * C calling convention.
  213. * Contains instructions not normally used by compilers.
  214. * Contains coprocessor instructions.
  215. */
  216. {
  217. int loc1;
  218. int loc2;
  219. int loc3; /* ax */
  220. loc2 = 100;
  221. loc3 = loc2;
  222. loc2 = (loc2 - 1);
  223. while (((loc3 | loc3) != 0)) {
  224. loc3 = loc2;
  225. loc2 = (loc2 - 1);
  226. } /* end of while */
  227. return (var06278);
  228. }
  229. int proc_10 ()
  230. /* Takes no parameters.
  231. * High-level language prologue code.
  232. * Untranslatable routine. Assembler provided.
  233. * Return value in register ax.
  234. * Contains instructions not normally used by compilers.
  235. */
  236. {
  237. PUSH bp
  238. MOV bp, sp
  239. SUB sp, 68h
  240. PUSH si
  241. PUSH di
  242. PUSH ds
  243. MOV ax, 159h
  244. PUSH ax
  245. PUSH ss
  246. LEA ax, [bp-64h]
  247. PUSH ax
  248. PUSH cs
  249. CALL near ptr proc_2
  250. ADD sp, 8
  251. PUSH ds
  252. MOV ax, 170h
  253. PUSH ax
  254. PUSH ds
  255. MOV ax, 167h
  256. PUSH ax
  257. CALL far ptr fopen
  258. ADD sp, 8
  259. MOV [bp-66h], dx
  260. MOV [bp-68h], ax
  261. OR dx, ax
  262. JNE L1
  263. PUSH ds
  264. MOV ax, 172h
  265. PUSH ax
  266. CALL far ptr printf
  267. POP cx
  268. POP cx
  269. MOV ax, 0FFFFh
  270. PUSH ax
  271. CALL far ptr exit
  272. POP cx
  273. L1: XOR di, 0
  274. L2: INC di
  275. MOV ax, di
  276. CMP ax, 3E8h
  277. JL L3
  278. PUSH word ptr [bp-66h]
  279. PUSH word ptr [bp-68h]
  280. CALL far ptr fclose
  281. POP cx
  282. POP cx
  283. MOV ax, di
  284. POP di
  285. POP si
  286. MOV sp, bp
  287. POP bp
  288. RETF
  289. L3: XOR si, 0
  290. L4: CMP byte ptr ss:[bp+si-64h], 0
  291. JNE L5
  292. L5: LES bx, dword ptr[bp-68h]
  293. INC word ptr es:[bx]
  294. JGE L6
  295. MOV al, ss:[bp+si-64h]
  296. LES bx, dword ptr[bp-68h]
  297. INC word ptr es:[bx+0Ch]
  298. LES bx, dword ptres:[bx+0Ch]
  299. DEC bx
  300. MOV es:[bx], al
  301. MOV ah, 0
  302. L7: INC si
  303. JMP L4 ;Synthetic inst
  304. L6: PUSH word ptr [bp-66h]
  305. PUSH word ptr [bp-68h]
  306. PUSH word ptr ss:[bp+si-64h]
  307. CALL far ptr _fputc
  308. ADD sp, 6
  309. JMP L7 ;Synthetic inst
  310. }
  311. void main ()
  312. /* Takes no parameters.
  313. * High-level language prologue code.
  314. * Contains instructions not normally used by compilers.
  315. * Contains coprocessor instructions.
  316. */
  317. {
  318. int loc1;
  319. int loc2;
  320. int loc3;
  321. int loc4;
  322. int loc5;
  323. int loc6;
  324. int loc7;
  325. int loc8;
  326. int loc9;
  327. int loc10;
  328. int loc11;
  329. int loc12; /* ax */
  330. int loc13; /* bx */
  331. printf ("Start...%c\n\n", 7);
  332. while ((loc11 < 6)) {
  333. loc12 = loc11;
  334. if (loc12 <= 5) {
  335. loc13 = (loc12 << 1);
  336. var06278 = proc_1 (&loc2, &loc1, , );
  337. printf ("\ncresult = %d\n", var06278);
  338. }
  339. loc11 = (loc11 + 1);
  340. } /* end of while */
  341. printf ("\n\n...End%c", 7);
  342. }