home *** CD-ROM | disk | FTP | other *** search
/ Spidla DivX / DivX.bin / LocoCodec / loco.asm < prev    next >
Encoding:
Assembly Source File  |  2003-04-10  |  49.7 KB  |  2,531 lines

  1. ; Listing generated by Microsoft (R) Optimizing Compiler Version 12.00.9044.0 
  2.  
  3.     TITLE    loco.c
  4.     .386P
  5. include listing.inc
  6. if @Version gt 510
  7. .model FLAT
  8. else
  9. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  10. _TEXT    ENDS
  11. _DATA    SEGMENT DWORD USE32 PUBLIC 'DATA'
  12. _DATA    ENDS
  13. CONST    SEGMENT DWORD USE32 PUBLIC 'CONST'
  14. CONST    ENDS
  15. _BSS    SEGMENT DWORD USE32 PUBLIC 'BSS'
  16. _BSS    ENDS
  17. $$SYMBOLS    SEGMENT BYTE USE32 'DEBSYM'
  18. $$SYMBOLS    ENDS
  19. _TLS    SEGMENT DWORD USE32 PUBLIC 'TLS'
  20. _TLS    ENDS
  21. ;    COMDAT ??_C@_0O@POKJ@lococodec?4ini?$AA@
  22. _DATA    SEGMENT DWORD USE32 PUBLIC 'DATA'
  23. _DATA    ENDS
  24. ;    COMDAT ??_C@_03BGKD@log?$AA@
  25. _DATA    SEGMENT DWORD USE32 PUBLIC 'DATA'
  26. _DATA    ENDS
  27. ;    COMDAT ??_C@_05FLHP@debug?$AA@
  28. _DATA    SEGMENT DWORD USE32 PUBLIC 'DATA'
  29. _DATA    ENDS
  30. ;    COMDAT _write_bit_buffer
  31. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  32. _TEXT    ENDS
  33. ;    COMDAT _flush_bits
  34. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  35. _TEXT    ENDS
  36. ;    COMDAT _output_zero_bits
  37. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  38. _TEXT    ENDS
  39. ;    COMDAT _output_one_bit
  40. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  41. _TEXT    ENDS
  42. ;    COMDAT _copy_bits
  43. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  44. _TEXT    ENDS
  45. ;    COMDAT _input_bit
  46. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  47. _TEXT    ENDS
  48. ;    COMDAT _flush_run_length
  49. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  50. _TEXT    ENDS
  51. ;    COMDAT _rice_encode
  52. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  53. _TEXT    ENDS
  54. ;    COMDAT _rice_decode
  55. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  56. _TEXT    ENDS
  57. ;    COMDAT _calcLoco
  58. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  59. _TEXT    ENDS
  60. ;    COMDAT _calcLoco16
  61. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  62. _TEXT    ENDS
  63. ;    COMDAT _calcLocoTop
  64. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  65. _TEXT    ENDS
  66. ;    COMDAT _calcLocoLeft
  67. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  68. _TEXT    ENDS
  69. ;    COMDAT _rice_param
  70. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  71. _TEXT    ENDS
  72. ;    COMDAT _comp_one_pel
  73. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  74. _TEXT    ENDS
  75. ;    COMDAT _comp_one_pel_lossy
  76. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  77. _TEXT    ENDS
  78. ;    COMDAT _comp_16_pel
  79. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  80. _TEXT    ENDS
  81. ;    COMDAT _decomp_one_pel
  82. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  83. _TEXT    ENDS
  84. ;    COMDAT _initialize_pi
  85. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  86. _TEXT    ENDS
  87. ;    COMDAT _copyLine
  88. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  89. _TEXT    ENDS
  90. ;    COMDAT _copyLine1
  91. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  92. _TEXT    ENDS
  93. ;    COMDAT _copyLine2
  94. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  95. _TEXT    ENDS
  96. ;    COMDAT _copyLine3
  97. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  98. _TEXT    ENDS
  99. ;    COMDAT _copyLine4
  100. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  101. _TEXT    ENDS
  102. ;    COMDAT _alloc_buffers
  103. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  104. _TEXT    ENDS
  105. ;    COMDAT _loco_codec_compress
  106. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  107. _TEXT    ENDS
  108. ;    COMDAT _loco_codec_compress_lossy
  109. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  110. _TEXT    ENDS
  111. ;    COMDAT _loco_codec_decompress
  112. _TEXT    SEGMENT PARA USE32 PUBLIC 'CODE'
  113. _TEXT    ENDS
  114. FLAT    GROUP _DATA, CONST, _BSS
  115.     ASSUME    CS: FLAT, DS: FLAT, SS: FLAT
  116. endif
  117.  
  118. INCLUDELIB LIBC
  119. INCLUDELIB OLDNAMES
  120.  
  121. PUBLIC    _copy_line_array
  122. _BSS    SEGMENT
  123. _this_line DD    01H DUP (?)
  124. ?debug@?1??Msg@@9@9 DD 01H DUP (?)            ; debug
  125. ?startup@?2??Msg@@9@9 DD 01H DUP (?)            ; startup
  126. _BSS    ENDS
  127. _DATA    SEGMENT
  128. _copy_line_array DD FLAT:_copyLine1
  129.     DD    FLAT:_copyLine2
  130.     DD    FLAT:_copyLine3
  131.     DD    FLAT:_copyLine4
  132. _DATA    ENDS
  133. PUBLIC    _initialize_pi
  134. ; Function compile flags: /Ogty
  135. ;    COMDAT _initialize_pi
  136. _TEXT    SEGMENT
  137. _pi$ = 8
  138. _imageBuffer$ = 12
  139. _outBuffer$ = 16
  140. _height$ = 20
  141. _width$ = 24
  142. _xOffset$ = 28
  143. _xStep$ = 32
  144. _yOffset$ = 36
  145. _yStep$ = 40
  146. _maxLoss$ = 44
  147. _initialize_pi PROC NEAR                ; COMDAT
  148. ; File loco.c
  149. ; Line 510
  150.     mov    eax, DWORD PTR _height$[esp-4]
  151.     cdq
  152.     push    ebx
  153.     push    ebp
  154.     mov    ebp, DWORD PTR _yStep$[esp+4]
  155.     idiv    ebp
  156.     mov    ebx, DWORD PTR _width$[esp+4]
  157.     push    esi
  158.     mov    esi, ebx
  159.     imul    esi, ebp
  160.     push    edi
  161.     mov    edi, DWORD PTR _xStep$[esp+12]
  162.     mov    ecx, DWORD PTR _pi$[esp+12]
  163.     mov    DWORD PTR [ecx+32], esi
  164. ; Line 513
  165.     imul    esi, DWORD PTR _yOffset$[esp+12]
  166.     mov    ebp, eax
  167.     mov    eax, DWORD PTR _yOffset$[esp+12]
  168.     cdq
  169.     idiv    DWORD PTR _yStep$[esp+12]
  170.     mov    DWORD PTR [ecx+28], edi
  171. ; Line 519
  172.     mov    DWORD PTR [ecx+44], 8
  173. ; Line 520
  174.     mov    DWORD PTR [ecx+40], 1
  175.     sub    ebp, eax
  176.     mov    eax, ebx
  177.     cdq
  178.     idiv    edi
  179.     mov    ebx, DWORD PTR _xOffset$[esp+12]
  180.     mov    DWORD PTR [ecx+20], ebp
  181.     mov    ebp, eax
  182.     mov    eax, ebx
  183.     cdq
  184.     idiv    edi
  185.     mov    edx, DWORD PTR _maxLoss$[esp+12]
  186.     pop    edi
  187.     mov    DWORD PTR [ecx+48], edx
  188.     sub    ebp, eax
  189.     mov    eax, DWORD PTR _outBuffer$[esp+8]
  190.     mov    DWORD PTR [ecx], eax
  191.     add    esi, DWORD PTR _imageBuffer$[esp+8]
  192.     add    esi, ebx
  193.     xor    eax, eax
  194.     mov    DWORD PTR [ecx+4], esi
  195.     mov    DWORD PTR [ecx+8], esi
  196.     pop    esi
  197.     mov    DWORD PTR [ecx+24], ebp
  198.     pop    ebp
  199.     mov    DWORD PTR [ecx+16], eax
  200.     mov    BYTE PTR [ecx+12], al
  201. ; Line 521
  202.     mov    DWORD PTR [ecx+52], eax
  203. ; Line 522
  204.     mov    DWORD PTR [ecx+60], eax
  205. ; Line 523
  206.     mov    DWORD PTR [ecx+56], eax
  207.     pop    ebx
  208. ; Line 525
  209.     ret    0
  210. _initialize_pi ENDP
  211. ; Function compile flags: /Ogty
  212. _TEXT    ENDS
  213. ;    COMDAT _copyLine1
  214. _TEXT    SEGMENT
  215. _dest$ = 8
  216. _src$ = 12
  217. _xOffset$ = 16
  218. _width$ = 20
  219. _end_ptr$ = 20
  220. _copyLine1 PROC NEAR                    ; COMDAT
  221. ; Line 538
  222.     push    ebp
  223.     mov    ebp, esp
  224. ; Line 543
  225.     mov    edx, DWORD PTR _width$[ebp]
  226. ; Line 544
  227.     lea    eax, DWORD PTR [edx-1]
  228.     and    eax, -2147483633            ; 8000000fH
  229.     mov    ecx, edx
  230.     jns    SHORT $L53793
  231.     dec    eax
  232.     or    eax, -16                ; fffffff0H
  233.     inc    eax
  234. $L53793:
  235.     je    SHORT $L53573
  236. ; Line 546
  237.     mov    ecx, edx
  238.     sub    ecx, eax
  239. $L53573:
  240.     push    ebx
  241.     push    edi
  242. ; Line 548
  243.     mov    edi, DWORD PTR _dest$[ebp]
  244.     lea    eax, DWORD PTR [ecx+edi]
  245.     mov    DWORD PTR _end_ptr$[ebp], eax
  246. ; Line 550
  247.     mov    eax, DWORD PTR _dest$[ebp]
  248. ; Line 551
  249.     mov    ebx, DWORD PTR _xOffset$[ebp+ebp]
  250. $START_LOOP_1$53574:
  251. ; Line 553
  252.     movdqu    xmm0, XMMWORD PTR [ebx]
  253. ; Line 554
  254.     add    ebx, 16                    ; 00000010H
  255. ; Line 555
  256.     movdqa    XMMWORD PTR [eax], xmm0
  257. ; Line 556
  258.     add    eax, 16                    ; 00000010H
  259. ; Line 557
  260.     cmp    eax, DWORD PTR _end_ptr$[ebp]
  261. ; Line 558
  262.     jl    SHORT $START_LOOP_1$53574
  263. ; Line 560
  264.     cmp    ecx, edx
  265.     mov    eax, ecx
  266.     jge    SHORT $L53577
  267.     mov    ecx, DWORD PTR _xOffset$[ebp]
  268.     push    esi
  269.     mov    esi, DWORD PTR _src$[ebp]
  270.     add    esi, ecx
  271. $L53575:
  272. ; Line 562
  273.     mov    cl, BYTE PTR [esi+eax]
  274.     mov    BYTE PTR [eax+edi], cl
  275.     inc    eax
  276.     cmp    eax, edx
  277.     jl    SHORT $L53575
  278.     pop    esi
  279. $L53577:
  280.     pop    edi
  281.     pop    ebx
  282. ; Line 567
  283.     pop    ebp
  284.     ret    0
  285. _copyLine1 ENDP
  286. ; Function compile flags: /Ogty
  287. _TEXT    ENDS
  288. ;    COMDAT _copyLine2
  289. _TEXT    SEGMENT
  290. _copyLine2 PROC NEAR                    ; COMDAT
  291. ; Line 575
  292.     ret    0
  293. _copyLine2 ENDP
  294. ; Function compile flags: /Ogty
  295. _TEXT    ENDS
  296. ;    COMDAT _copyLine3
  297. _TEXT    SEGMENT
  298. _copyLine3 PROC NEAR                    ; COMDAT
  299. ; Line 583
  300.     ret    0
  301. _copyLine3 ENDP
  302. ; Function compile flags: /Ogty
  303. _TEXT    ENDS
  304. ;    COMDAT _copyLine4
  305. _TEXT    SEGMENT
  306. _copyLine4 PROC NEAR                    ; COMDAT
  307. ; Line 591
  308.     ret    0
  309. _copyLine4 ENDP
  310. _TEXT    ENDS
  311. PUBLIC    _loco_codec_compress
  312. EXTRN    _free:NEAR
  313. EXTRN    _malloc:NEAR
  314. ; Function compile flags: /Ogty
  315. ;    COMDAT _loco_codec_compress
  316. _TEXT    SEGMENT
  317. _minab$53865 = 32
  318. _inBuffer$ = 8
  319. _outBuffer$ = 12
  320. _height$ = 16
  321. _width$ = 20
  322. _xOffset$ = 24
  323. _xStep$ = 28
  324. _yOffset$ = 32
  325. _yStep$ = 36
  326. _i$ = 20
  327. _j$ = 28
  328. _end$ = 36
  329. _pi$ = -72
  330. _currentBuffer$ = 12
  331. _prevBuffer$ = 16
  332. _tmp_buffer$ = -76
  333. _copy_line_ptr$ = -92
  334. _prev$53837 = -80
  335. _curr$53838 = -84
  336. _coded$53839 = 32
  337. _abs_err$53840 = -88
  338. _loco_codec_compress PROC NEAR                ; COMDAT
  339. ; Line 607
  340.     sub    esp, 92                    ; 0000005cH
  341. ; Line 616
  342.     mov    ecx, DWORD PTR _yStep$[esp+88]
  343.     mov    edx, DWORD PTR _yOffset$[esp+88]
  344.     mov    eax, DWORD PTR _xStep$[esp+88]
  345.     push    ebx
  346.     mov    ebx, DWORD PTR _copy_line_array[eax*4-4]
  347.     push    ebp
  348.     mov    ebp, DWORD PTR _xOffset$[esp+96]
  349.     push    esi
  350.     push    edi
  351.     push    0
  352.     push    ecx
  353.     mov    ecx, DWORD PTR _height$[esp+112]
  354.     push    edx
  355.     mov    edx, DWORD PTR _outBuffer$[esp+116]
  356.     push    eax
  357.     mov    eax, DWORD PTR _width$[esp+120]
  358.     push    ebp
  359.     push    eax
  360.     mov    eax, DWORD PTR _inBuffer$[esp+128]
  361.     push    ecx
  362.     push    edx
  363.     push    eax
  364.     lea    ecx, DWORD PTR _pi$[esp+144]
  365.     push    ecx
  366.     mov    DWORD PTR _copy_line_ptr$[esp+148], ebx
  367.     call    _initialize_pi
  368. ; Line 618
  369.     mov    edx, DWORD PTR _pi$[esp+172]
  370.     lea    eax, DWORD PTR [edx+edx+96]
  371.     push    eax
  372.     call    _malloc
  373.     mov    DWORD PTR _tmp_buffer$[esp+152], eax
  374. ; Line 621
  375.     add    eax, 15                    ; 0000000fH
  376.     and    eax, -16                ; fffffff0H
  377.     mov    DWORD PTR _pi$[esp+220], eax
  378. ; Line 622
  379.     add    eax, 32                    ; 00000020H
  380. ; Line 623
  381.     lea    edi, DWORD PTR [eax+32]
  382.     mov    DWORD PTR _pi$[esp+216], eax
  383. ; Line 625
  384.     mov    eax, DWORD PTR _pi$[esp+176]
  385.     lea    esi, DWORD PTR [eax+edi+15]
  386. ; Line 629
  387.     lea    ecx, DWORD PTR [eax-1]
  388.     add    esp, 44                    ; 0000002cH
  389.     and    esi, -16                ; fffffff0H
  390.     and    ecx, -2147483633            ; 8000000fH
  391.     mov    DWORD PTR _pi$[esp+136], 1
  392.     mov    DWORD PTR _end$[esp+104], eax
  393.     jns    SHORT $L53927
  394.     dec    ecx
  395.     or    ecx, -16                ; fffffff0H
  396.     inc    ecx
  397. $L53927:
  398.     je    SHORT $L53663
  399. ; Line 631
  400.     mov    edx, eax
  401.     sub    edx, ecx
  402.     mov    DWORD PTR _end$[esp+104], edx
  403. $L53663:
  404. ; Line 633
  405.     push    eax
  406.     mov    eax, DWORD PTR _inBuffer$[esp+108]
  407.     push    ebp
  408.     push    eax
  409.     push    edi
  410.     call    ebx
  411. ; Line 636
  412.     mov    eax, DWORD PTR _pi$[esp+148]
  413.     add    esp, 16                    ; 00000010H
  414.     mov    ecx, edi
  415.     xor    ebp, ebp
  416.     test    eax, eax
  417.     mov    DWORD PTR _pi$[esp+112], ecx
  418.     jle    $L53666
  419.     jmp    SHORT $L53664
  420. $L53922:
  421.     mov    ecx, DWORD PTR _pi$[esp+112]
  422. ; Line 671
  423.     npad    1
  424. $L53664:
  425. ; Line 637
  426.     test    ebp, ebp
  427.     jle    SHORT $L53807
  428.     sub    ecx, DWORD PTR _pi$[esp+136]
  429.     movzx    ecx, BYTE PTR [ecx]
  430.     mov    DWORD PTR _pi$[esp+144], ecx
  431.     jmp    SHORT $L53808
  432. $L53807:
  433.     mov    DWORD PTR _pi$[esp+144], 128        ; 00000080H
  434. $L53808:
  435. ; Line 638
  436.     lea    edx, DWORD PTR _pi$[esp+108]
  437.     push    edx
  438.     call    _rice_param
  439.     mov    edx, DWORD PTR _pi$[esp+116]
  440.     movzx    ebx, BYTE PTR [edx]
  441.     mov    ecx, DWORD PTR _pi$[esp+148]
  442.     sub    ecx, ebx
  443.     add    edx, DWORD PTR _pi$[esp+140]
  444.     add    esp, 4
  445.     test    ecx, ecx
  446.     mov    DWORD PTR _pi$[esp+112], edx
  447.     mov    edx, ecx
  448.     jg    SHORT $L53820
  449.     neg    edx
  450. $L53820:
  451.     add    DWORD PTR _pi$[esp+152], edx
  452.     mov    ebx, DWORD PTR _pi$[esp+148]
  453.     push    eax
  454.     xor    eax, eax
  455.     inc    ebx
  456.     cmp    ecx, 1
  457.     setge    al
  458.     lea    ecx, DWORD PTR [edx+edx]
  459.     lea    edx, DWORD PTR _pi$[esp+112]
  460.     mov    DWORD PTR _pi$[esp+152], ebx
  461.     sub    ecx, eax
  462.     push    ecx
  463.     push    edx
  464.     call    _rice_encode
  465.     mov    eax, DWORD PTR _pi$[esp+160]
  466.     add    esp, 12                    ; 0000000cH
  467.     cmp    eax, 16                    ; 00000010H
  468.     jne    SHORT $L53665
  469.     mov    eax, DWORD PTR _pi$[esp+152]
  470.     sar    eax, 1
  471.     mov    DWORD PTR _pi$[esp+148], 8
  472.     mov    DWORD PTR _pi$[esp+152], eax
  473. $L53665:
  474.     mov    eax, DWORD PTR _pi$[esp+132]
  475.     inc    ebp
  476.     cmp    ebp, eax
  477.     jl    $L53922
  478. $L53666:
  479. ; Line 641
  480.     mov    ecx, DWORD PTR _pi$[esp+128]
  481.     mov    edx, 1
  482.     cmp    ecx, edx
  483.     mov    DWORD PTR _i$[esp+104], edx
  484.     jle    $L53669
  485.     jmp    SHORT $L53667
  486. $L53924:
  487.     mov    edi, DWORD PTR _currentBuffer$[esp+104]
  488.     mov    esi, DWORD PTR _prevBuffer$[esp+104]
  489. $L53667:
  490. ; Line 647
  491.     mov    ebp, DWORD PTR _inBuffer$[esp+104]
  492.     mov    ecx, edi
  493.     mov    DWORD PTR _prevBuffer$[esp+104], ecx
  494.     mov    DWORD PTR _pi$[esp+116], ecx
  495.     mov    ecx, DWORD PTR _pi$[esp+140]
  496.     imul    ecx, edx
  497.     push    eax
  498.     mov    eax, DWORD PTR _xOffset$[esp+108]
  499.     push    eax
  500.     add    ecx, ebp
  501.     push    ecx
  502.     push    esi
  503.     mov    DWORD PTR _currentBuffer$[esp+120], esi
  504.     call    DWORD PTR _copy_line_ptr$[esp+124]
  505. ; Line 650
  506.     mov    eax, DWORD PTR _pi$[esp+132]
  507.     mov    ecx, DWORD PTR _pi$[esp+152]
  508.     mov    DWORD PTR _pi$[esp+128], esi
  509.     movzx    edx, BYTE PTR [eax]
  510.     add    eax, ecx
  511.     mov    DWORD PTR _pi$[esp+132], eax
  512. ; Line 651
  513.     lea    eax, DWORD PTR _pi$[esp+124]
  514.     push    eax
  515.     mov    DWORD PTR _pi$[esp+164], edx
  516.     call    _rice_param
  517.     mov    edx, DWORD PTR _pi$[esp+132]
  518.     movzx    esi, BYTE PTR [edx]
  519.     mov    ecx, DWORD PTR _pi$[esp+164]
  520.     sub    ecx, esi
  521.     add    edx, DWORD PTR _pi$[esp+156]
  522.     add    esp, 20                    ; 00000014H
  523.     test    ecx, ecx
  524.     mov    DWORD PTR _pi$[esp+112], edx
  525.     mov    edx, ecx
  526.     jg    SHORT $L53834
  527.     neg    edx
  528. $L53834:
  529.     mov    ebx, DWORD PTR _pi$[esp+152]
  530.     mov    edi, DWORD PTR _pi$[esp+148]
  531.     add    ebx, edx
  532.     push    eax
  533.     xor    eax, eax
  534.     inc    edi
  535.     cmp    ecx, 1
  536.     setge    al
  537.     lea    ecx, DWORD PTR [edx+edx]
  538.     lea    edx, DWORD PTR _pi$[esp+112]
  539.     mov    DWORD PTR _pi$[esp+156], ebx
  540.     mov    DWORD PTR _pi$[esp+152], edi
  541.     sub    ecx, eax
  542.     push    ecx
  543.     push    edx
  544.     call    _rice_encode
  545.     mov    eax, DWORD PTR _pi$[esp+160]
  546.     mov    edi, 16                    ; 00000010H
  547.     add    esp, 12                    ; 0000000cH
  548.     cmp    eax, edi
  549.     jne    SHORT $L53831
  550.     mov    eax, DWORD PTR _pi$[esp+152]
  551.     sar    eax, 1
  552.     mov    DWORD PTR _pi$[esp+148], 8
  553.     mov    DWORD PTR _pi$[esp+152], eax
  554. $L53831:
  555. ; Line 652
  556.     mov    ebp, DWORD PTR _end$[esp+104]
  557.     cmp    ebp, 1
  558.     mov    DWORD PTR _j$[esp+104], 1
  559.     jle    $L53672
  560.     add    ebp, -2                    ; fffffffeH
  561.     shr    ebp, 4
  562.     inc    ebp
  563.     mov    eax, ebp
  564.     shl    eax, 4
  565.     inc    eax
  566.     mov    DWORD PTR _j$[esp+104], eax
  567. $L53670:
  568. ; Line 653
  569.     mov    eax, DWORD PTR _pi$[esp+116]
  570.     mov    ecx, DWORD PTR _pi$[esp+112]
  571.     mov    edx, DWORD PTR _pi$[esp+172]
  572.     mov    DWORD PTR _prev$53837[esp+108], eax
  573.     mov    eax, DWORD PTR _pi$[esp+176]
  574.     mov    DWORD PTR _curr$53838[esp+108], ecx
  575.     mov    DWORD PTR _coded$53839[esp+104], edx
  576.     mov    DWORD PTR _abs_err$53840[esp+108], eax
  577.     mov    eax, DWORD PTR _prev$53837[esp+108]
  578.     movdqa    xmm2, XMMWORD PTR [eax-1]
  579.     movdqu    xmm0, XMMWORD PTR [eax]
  580.     mov    ebx, DWORD PTR _curr$53838[esp+108]
  581.     movdqa    xmm1, XMMWORD PTR [ebx-1]
  582.     movdqa    xmm3, xmm0
  583.     pminub    xmm0, xmm1
  584.     pmaxub    xmm1, xmm3
  585.     movdqa    xmm4, xmm2
  586.     pminub    xmm4, xmm0
  587.     movdqa    xmm3, xmm2
  588.     pmaxub    xmm3, xmm1
  589.     pcmpeqb    xmm4, xmm2
  590.     pcmpeqb    xmm3, xmm2
  591.     movdqa    xmm7, xmm3
  592.     por    xmm7, xmm4
  593.     pandn    xmm7, xmm2
  594.     movdqa    xmm2, xmm4
  595.     pandn    xmm2, xmm0
  596.     pandn    xmm4, xmm3
  597.     pandn    xmm4, xmm1
  598.     movdqu    xmm5, XMMWORD PTR [ebx]
  599.     pxor    xmm1, xmm1
  600.     punpcklbw xmm1, xmm2
  601.     pslrdq    xmm1, 1
  602.     pxor    xmm3, xmm3
  603.     punpcklbw xmm3, xmm4
  604.     pslrdq    xmm3, 1
  605.     paddsw    xmm1, xmm3
  606.     pxor    xmm3, xmm3
  607.     punpcklbw xmm3, xmm7
  608.     pslrdq    xmm3, 1
  609.     psubsw    xmm1, xmm3
  610.     pxor    xmm3, xmm3
  611.     punpcklbw xmm3, xmm5
  612.     pslrdq    xmm3, 1
  613.     psubsw    xmm1, xmm3
  614.     pxor    xmm3, xmm3
  615.     psubsw    xmm3, xmm1
  616.     pmaxsw    xmm3, xmm1
  617.     pxor    xmm0, xmm0
  618.     mov    ebx, DWORD PTR _abs_err$53840[esp+108]
  619.     movdqa    XMMWORD PTR [ebx], xmm3
  620.     mov    eax, DWORD PTR _coded$53839[esp+104]
  621.     psllw    xmm3, 1
  622.     pcmpgtw    xmm1, xmm0
  623.     psrlw    xmm1, 15                ; 0000000fH
  624.     psubsw    xmm3, xmm1
  625.     movdqa    XMMWORD PTR [eax], xmm3
  626.     pxor    xmm3, xmm3
  627.     punpckhbw xmm2, xmm3
  628.     punpckhbw xmm4, xmm3
  629.     paddsw    xmm2, xmm4
  630.     punpckhbw xmm7, xmm3
  631.     psubsw    xmm2, xmm7
  632.     punpckhbw xmm5, xmm3
  633.     psubsw    xmm2, xmm5
  634.     psubsw    xmm3, xmm2
  635.     pmaxsw    xmm3, xmm2
  636.     movdqa    XMMWORD PTR [ebx+16], xmm3
  637.     psllw    xmm3, 1
  638.     pcmpgtw    xmm2, xmm0
  639.     psrlw    xmm2, 15                ; 0000000fH
  640.     psubsw    xmm3, xmm2
  641.     movdqa    XMMWORD PTR [eax+16], xmm3
  642.     mov    ecx, DWORD PTR _pi$[esp+116]
  643.     mov    eax, DWORD PTR _pi$[esp+112]
  644.     add    ecx, edi
  645.     add    eax, edi
  646.     mov    DWORD PTR _pi$[esp+116], ecx
  647.     mov    DWORD PTR _pi$[esp+112], eax
  648.     xor    esi, esi
  649. ; Line 671
  650.     npad    4
  651. ; Line 654
  652. $L53845:
  653.     lea    ecx, DWORD PTR _pi$[esp+108]
  654.     push    ecx
  655.     call    _rice_param
  656.     mov    edx, DWORD PTR _pi$[esp+180]
  657.     movsx    ecx, WORD PTR [esi+edx]
  658.     mov    ebx, DWORD PTR _pi$[esp+156]
  659.     mov    edx, DWORD PTR _pi$[esp+152]
  660.     add    ebx, ecx
  661.     inc    edx
  662.     mov    DWORD PTR _pi$[esp+152], edx
  663.     mov    edx, DWORD PTR _pi$[esp+176]
  664.     push    eax
  665.     mov    DWORD PTR _pi$[esp+160], ebx
  666.     movsx    eax, WORD PTR [esi+edx]
  667.     push    eax
  668.     lea    ecx, DWORD PTR _pi$[esp+120]
  669.     push    ecx
  670.     call    _rice_encode
  671.     mov    eax, DWORD PTR _pi$[esp+164]
  672.     add    esp, 16                    ; 00000010H
  673.     cmp    eax, edi
  674.     jne    SHORT $L53846
  675.     mov    eax, DWORD PTR _pi$[esp+152]
  676.     sar    eax, 1
  677.     mov    DWORD PTR _pi$[esp+148], 8
  678.     mov    DWORD PTR _pi$[esp+152], eax
  679. $L53846:
  680.     add    esi, 2
  681.     cmp    esi, 32                    ; 00000020H
  682.     jl    SHORT $L53845
  683. ; Line 652
  684.     dec    ebp
  685.     jne    $L53670
  686. $L53672:
  687. ; Line 656
  688.     mov    eax, DWORD PTR _pi$[esp+132]
  689.     cmp    DWORD PTR _j$[esp+104], eax
  690.     jge    $L53668
  691. $L53673:
  692. ; Line 658
  693.     mov    ebx, DWORD PTR _pi$[esp+136]
  694.     mov    eax, DWORD PTR _pi$[esp+112]
  695.     mov    edi, DWORD PTR _pi$[esp+116]
  696.     movzx    ecx, BYTE PTR [edi]
  697.     sub    eax, ebx
  698.     movzx    eax, BYTE PTR [eax]
  699.     mov    edx, edi
  700.     sub    edx, ebx
  701.     cmp    ecx, eax
  702.     movzx    edx, BYTE PTR [edx]
  703.     mov    ebp, ecx
  704.     jl    SHORT $L53928
  705.     mov    ebp, eax
  706. $L53928:
  707.     cmp    ecx, eax
  708.     mov    DWORD PTR _minab$53865[esp+104], ebp
  709.     mov    esi, ecx
  710.     jg    SHORT $L53860
  711.     mov    esi, eax
  712. $L53860:
  713.     cmp    edx, esi
  714.     jl    SHORT $L53868
  715.     mov    eax, ebp
  716.     jmp    SHORT $L53871
  717. $L53868:
  718.     cmp    edx, DWORD PTR _minab$53865[esp+104]
  719.     jg    SHORT $L53870
  720.     mov    eax, esi
  721.     jmp    SHORT $L53871
  722. $L53870:
  723.     sub    eax, edx
  724.     add    eax, ecx
  725. $L53871:
  726. ; Line 659
  727.     lea    ecx, DWORD PTR _pi$[esp+108]
  728.     add    edi, ebx
  729.     push    ecx
  730.     mov    DWORD PTR _pi$[esp+120], edi
  731.     mov    DWORD PTR _pi$[esp+148], eax
  732.     call    _rice_param
  733.     mov    edx, DWORD PTR _pi$[esp+116]
  734.     movzx    esi, BYTE PTR [edx]
  735.     mov    ecx, DWORD PTR _pi$[esp+148]
  736.     sub    ecx, esi
  737.     add    edx, DWORD PTR _pi$[esp+140]
  738.     add    esp, 4
  739.     test    ecx, ecx
  740.     mov    DWORD PTR _pi$[esp+112], edx
  741.     mov    edx, ecx
  742.     jg    SHORT $L53877
  743.     neg    edx
  744. $L53877:
  745.     mov    ebx, DWORD PTR _pi$[esp+152]
  746.     mov    edi, DWORD PTR _pi$[esp+148]
  747.     add    ebx, edx
  748.     push    eax
  749.     xor    eax, eax
  750.     inc    edi
  751.     cmp    ecx, 1
  752.     setge    al
  753.     lea    ecx, DWORD PTR [edx+edx]
  754.     lea    edx, DWORD PTR _pi$[esp+112]
  755.     mov    DWORD PTR _pi$[esp+156], ebx
  756.     mov    DWORD PTR _pi$[esp+152], edi
  757.     sub    ecx, eax
  758.     push    ecx
  759.     push    edx
  760.     call    _rice_encode
  761.     mov    eax, DWORD PTR _pi$[esp+160]
  762.     add    esp, 12                    ; 0000000cH
  763.     cmp    eax, 16                    ; 00000010H
  764.     jne    SHORT $L53674
  765.     mov    eax, DWORD PTR _pi$[esp+152]
  766.     sar    eax, 1
  767.     mov    DWORD PTR _pi$[esp+148], 8
  768.     mov    DWORD PTR _pi$[esp+152], eax
  769. $L53674:
  770.     mov    ecx, DWORD PTR _j$[esp+104]
  771.     mov    eax, DWORD PTR _pi$[esp+132]
  772.     inc    ecx
  773.     cmp    ecx, eax
  774.     mov    DWORD PTR _j$[esp+104], ecx
  775.     jl    $L53673
  776. $L53668:
  777. ; Line 641
  778.     mov    edx, DWORD PTR _i$[esp+104]
  779.     mov    ecx, DWORD PTR _pi$[esp+128]
  780.     inc    edx
  781.     cmp    edx, ecx
  782.     mov    DWORD PTR _i$[esp+104], edx
  783.     jl    $L53924
  784. $L53669:
  785. ; Line 666
  786.     mov    eax, DWORD PTR _pi$[esp+160]
  787.     xor    edi, edi
  788.     cmp    eax, edi
  789.     jle    SHORT $L53895
  790.     cmp    DWORD PTR _pi$[esp+164], edi
  791.     jl    SHORT $L53895
  792.     mov    ecx, DWORD PTR _pi$[esp+124]
  793.     dec    eax
  794.     mov    esi, eax
  795.     sar    eax, 2
  796.     add    ecx, eax
  797.     and    esi, 3
  798.     cmp    ecx, 8
  799.     mov    DWORD PTR _pi$[esp+124], ecx
  800.     jb    SHORT $L53893
  801.     mov    cl, BYTE PTR _pi$[esp+120]
  802. ; Line 671
  803.     npad    5
  804. ; Line 666
  805. $L53892:
  806.     mov    eax, DWORD PTR _pi$[esp+108]
  807.     mov    BYTE PTR [eax], cl
  808.     mov    eax, DWORD PTR _pi$[esp+124]
  809.     mov    ebp, DWORD PTR _pi$[esp+108]
  810.     sub    eax, 8
  811.     inc    ebp
  812.     xor    cl, cl
  813.     cmp    eax, 8
  814.     mov    DWORD PTR _pi$[esp+108], ebp
  815.     mov    DWORD PTR _pi$[esp+124], eax
  816.     jae    SHORT $L53892
  817.     mov    BYTE PTR _pi$[esp+120], cl
  818. $L53893:
  819.     lea    ecx, DWORD PTR _pi$[esp+108]
  820.     push    ecx
  821.     call    _output_one_bit
  822.     push    2
  823.     lea    edx, DWORD PTR _pi$[esp+116]
  824.     push    esi
  825.     push    edx
  826.     call    _copy_bits
  827.     mov    eax, DWORD PTR _pi$[esp+176]
  828.     add    esp, 16                    ; 00000010H
  829. $L53895:
  830.     cmp    eax, 2
  831.     jle    SHORT $L53899
  832.     add    DWORD PTR _pi$[esp+164], eax
  833.     jmp    SHORT $L53900
  834. $L53899:
  835.     sub    DWORD PTR _pi$[esp+164], 3
  836. $L53900:
  837. ; Line 667
  838.     cmp    DWORD PTR _pi$[esp+124], edi
  839.     mov    DWORD PTR _pi$[esp+160], edi
  840.     jbe    SHORT $L53907
  841.     mov    eax, DWORD PTR _pi$[esp+108]
  842.     mov    cl, BYTE PTR _pi$[esp+120]
  843.     mov    BYTE PTR [eax], cl
  844.     inc    DWORD PTR _pi$[esp+108]
  845.     mov    DWORD PTR _pi$[esp+124], edi
  846.     mov    BYTE PTR _pi$[esp+120], 0
  847. $L53907:
  848. ; Line 668
  849.     mov    edx, DWORD PTR _tmp_buffer$[esp+108]
  850.     push    edx
  851.     call    _free
  852. ; Line 670
  853.     mov    eax, DWORD PTR _pi$[esp+112]
  854.     add    esp, 4
  855.     pop    edi
  856.     pop    esi
  857.     pop    ebp
  858.     pop    ebx
  859. ; Line 671
  860.     add    esp, 92                    ; 0000005cH
  861.     ret    0
  862. _loco_codec_compress ENDP
  863. ; Function compile flags: /Ogty
  864. _TEXT    ENDS
  865. ;    COMDAT _output_one_bit
  866. _TEXT    SEGMENT
  867. _pi$ = 8
  868. _output_one_bit PROC NEAR                ; COMDAT
  869. ; Line 104
  870.     mov    eax, DWORD PTR _pi$[esp-4]
  871.     push    esi
  872.     mov    esi, DWORD PTR [eax+16]
  873.     mov    ecx, 7
  874.     sub    ecx, esi
  875.     mov    dl, 1
  876.     shl    dl, cl
  877.     or    BYTE PTR [eax+12], dl
  878. ; Line 105
  879.     lea    ecx, DWORD PTR [esi+1]
  880. ; Line 107
  881.     cmp    ecx, 8
  882.     mov    DWORD PTR [eax+16], ecx
  883.     pop    esi
  884.     jne    SHORT $L53933
  885. ; Line 108
  886.     mov    ecx, DWORD PTR [eax]
  887.     mov    dl, BYTE PTR [eax+12]
  888.     mov    BYTE PTR [ecx], dl
  889.     inc    DWORD PTR [eax]
  890.     xor    ecx, ecx
  891.     mov    DWORD PTR [eax+16], ecx
  892.     mov    BYTE PTR [eax+12], cl
  893. $L53933:
  894. ; Line 109
  895.     ret    0
  896. _output_one_bit ENDP
  897. ; Function compile flags: /Ogty
  898. _TEXT    ENDS
  899. ;    COMDAT _copy_bits
  900. _TEXT    SEGMENT
  901. _pi$ = 8
  902. _from$ = 12
  903. _len$ = 16
  904. _copy_bits PROC NEAR                    ; COMDAT
  905. ; Line 112
  906.     push    ebx
  907.     push    esi
  908. ; Line 113
  909.     mov    esi, DWORD PTR _len$[esp+4]
  910.     xor    ebx, ebx
  911.     cmp    esi, ebx
  912.     push    edi
  913.     je    $L53938
  914. ; Line 114
  915.     mov    edx, DWORD PTR _from$[esp+8]
  916.     mov    ecx, esi
  917.     mov    eax, 1
  918.     shl    eax, cl
  919. ; Line 115
  920.     mov    ecx, 8
  921.     dec    eax
  922.     and    edx, eax
  923.     mov    eax, DWORD PTR _pi$[esp+8]
  924.     sub    ecx, DWORD PTR [eax+16]
  925.     cmp    esi, ecx
  926.     jbe    SHORT $L53371
  927. $L53370:
  928. ; Line 117
  929.     mov    ecx, DWORD PTR [eax+16]
  930.     add    esi, ecx
  931.     lea    ecx, DWORD PTR [esi-8]
  932.     mov    ebx, edx
  933.     shr    ebx, cl
  934.     mov    cl, BYTE PTR [eax+12]
  935. ; Line 118
  936.     add    esi, -8                    ; fffffff8H
  937. ; Line 119
  938.     mov    edi, 1
  939.     or    cl, bl
  940.     mov    BYTE PTR [eax+12], cl
  941. ; Line 120
  942.     mov    bl, BYTE PTR [eax+12]
  943.     lea    ecx, DWORD PTR [esi+1]
  944.     shl    edi, cl
  945.     mov    ecx, DWORD PTR [eax]
  946.     mov    BYTE PTR [ecx], bl
  947. ; Line 122
  948.     xor    ebx, ebx
  949.     dec    edi
  950.     and    edx, edi
  951.     mov    edi, DWORD PTR [eax]
  952.     inc    edi
  953.     cmp    esi, 8
  954.     mov    DWORD PTR [eax], edi
  955.     mov    DWORD PTR [eax+16], ebx
  956. ; Line 123
  957.     mov    BYTE PTR [eax+12], bl
  958.     ja    SHORT $L53370
  959. $L53371:
  960. ; Line 126
  961.     cmp    esi, ebx
  962.     je    SHORT $L53938
  963. ; Line 127
  964.     mov    edi, DWORD PTR [eax+16]
  965.     mov    ecx, 8
  966.     sub    ecx, edi
  967.     sub    ecx, esi
  968.     shl    dl, cl
  969.     mov    cl, BYTE PTR [eax+12]
  970. ; Line 128
  971.     add    esi, edi
  972.     mov    DWORD PTR [eax+16], esi
  973.     or    cl, dl
  974. ; Line 129
  975.     cmp    esi, 8
  976.     mov    BYTE PTR [eax+12], cl
  977.     jne    SHORT $L53938
  978. ; Line 130
  979.     mov    edx, DWORD PTR [eax]
  980.     mov    BYTE PTR [edx], cl
  981.     inc    DWORD PTR [eax]
  982.     mov    DWORD PTR [eax+16], ebx
  983.     mov    BYTE PTR [eax+12], bl
  984. $L53938:
  985.     pop    edi
  986.     pop    esi
  987.     pop    ebx
  988. ; Line 131
  989.     ret    0
  990. _copy_bits ENDP
  991. ; Function compile flags: /Ogty
  992. _TEXT    ENDS
  993. ;    COMDAT _rice_encode
  994. _TEXT    SEGMENT
  995. _pip$ = 8
  996. _x$ = 12
  997. _log_b$ = 16
  998. _rem$53403 = 12
  999. _rice_encode PROC NEAR                    ; COMDAT
  1000. ; Line 172
  1001.     mov    eax, DWORD PTR _x$[esp-4]
  1002.     test    eax, eax
  1003.     push    ebx
  1004.     push    ebp
  1005.     push    esi
  1006.     push    edi
  1007.     jne    $L53398
  1008. ; Line 174
  1009.     mov    eax, DWORD PTR _pip$[esp+12]
  1010.     mov    ecx, DWORD PTR [eax+52]
  1011.     test    ecx, ecx
  1012.     je    SHORT $L53400
  1013.     mov    ecx, DWORD PTR [eax+56]
  1014.     test    ecx, ecx
  1015.     jge    SHORT $L53956
  1016. $L53400:
  1017. ; Line 176
  1018.     mov    esi, DWORD PTR [eax+16]
  1019.     mov    bl, BYTE PTR [eax+12]
  1020.     mov    ecx, 7
  1021.     sub    ecx, esi
  1022.     mov    dl, 1
  1023.     shl    dl, cl
  1024.     lea    ecx, DWORD PTR [esi+1]
  1025.     mov    DWORD PTR [eax+16], ecx
  1026.     or    bl, dl
  1027.     cmp    ecx, 8
  1028.     mov    BYTE PTR [eax+12], bl
  1029.     jne    SHORT $L53949
  1030.     mov    ecx, DWORD PTR [eax]
  1031.     mov    dl, bl
  1032.     mov    BYTE PTR [ecx], dl
  1033.     inc    DWORD PTR [eax]
  1034.     mov    DWORD PTR [eax+16], 0
  1035.     mov    BYTE PTR [eax+12], 0
  1036. $L53949:
  1037. ; Line 177
  1038.     mov    ecx, DWORD PTR _log_b$[esp+12]
  1039.     mov    edx, DWORD PTR [eax+16]
  1040.     add    edx, ecx
  1041.     mov    ecx, edx
  1042.     cmp    ecx, 8
  1043.     mov    DWORD PTR [eax+16], edx
  1044.     jb    SHORT $L53956
  1045. ; Line 195
  1046.     npad    7
  1047. ; Line 177
  1048. $L53955:
  1049.     mov    cl, BYTE PTR [eax+12]
  1050.     mov    edx, DWORD PTR [eax]
  1051.     mov    BYTE PTR [edx], cl
  1052.     mov    esi, DWORD PTR [eax+16]
  1053.     mov    edi, DWORD PTR [eax]
  1054.     add    esi, -8                    ; fffffff8H
  1055.     inc    edi
  1056.     mov    ecx, esi
  1057.     cmp    ecx, 8
  1058.     mov    DWORD PTR [eax], edi
  1059.     mov    DWORD PTR [eax+16], esi
  1060.     mov    BYTE PTR [eax+12], 0
  1061.     jae    SHORT $L53955
  1062. $L53956:
  1063. ; Line 179
  1064.     mov    ecx, DWORD PTR [eax+52]
  1065.     pop    edi
  1066.     pop    esi
  1067.     inc    ecx
  1068.     pop    ebp
  1069.     mov    DWORD PTR [eax+52], ecx
  1070.     pop    ebx
  1071. ; Line 195
  1072.     ret    0
  1073. $L53398:
  1074. ; Line 183
  1075.     mov    ecx, DWORD PTR _log_b$[esp+12]
  1076. ; Line 185
  1077.     mov    esi, DWORD PTR _pip$[esp+12]
  1078.     mov    edx, 1
  1079.     shl    edx, cl
  1080.     mov    edi, eax
  1081.     shr    edi, cl
  1082.     lea    ebx, DWORD PTR [edx-1]
  1083.     mov    ecx, ebx
  1084.     and    ecx, eax
  1085.     mov    eax, DWORD PTR [esi+52]
  1086.     test    eax, eax
  1087.     mov    DWORD PTR _rem$53403[esp+12], ecx
  1088.     jle    $L53975
  1089. ; Line 187
  1090.     mov    ecx, DWORD PTR [esi+56]
  1091.     test    ecx, ecx
  1092.     jl    SHORT $L53976
  1093.     mov    ecx, DWORD PTR [esi+16]
  1094.     dec    eax
  1095.     mov    ebp, eax
  1096.     sar    eax, 2
  1097.     add    ecx, eax
  1098.     mov    eax, ecx
  1099.     and    ebp, 3
  1100.     cmp    eax, 8
  1101.     mov    DWORD PTR [esi+16], ecx
  1102.     jb    SHORT $L53971
  1103. $L53970:
  1104.     mov    eax, DWORD PTR [esi]
  1105.     mov    cl, BYTE PTR [esi+12]
  1106.     mov    BYTE PTR [eax], cl
  1107.     mov    eax, DWORD PTR [esi]
  1108.     mov    edx, DWORD PTR [esi+16]
  1109.     inc    eax
  1110.     add    edx, -8                    ; fffffff8H
  1111.     mov    DWORD PTR [esi], eax
  1112.     mov    eax, edx
  1113.     cmp    eax, 8
  1114.     mov    DWORD PTR [esi+16], edx
  1115.     mov    BYTE PTR [esi+12], 0
  1116.     jae    SHORT $L53970
  1117. $L53971:
  1118.     mov    eax, DWORD PTR [esi+16]
  1119.     mov    ecx, 7
  1120.     sub    ecx, eax
  1121.     mov    dl, 1
  1122.     shl    dl, cl
  1123.     mov    cl, BYTE PTR [esi+12]
  1124.     or    cl, dl
  1125.     inc    eax
  1126.     cmp    eax, 8
  1127.     mov    BYTE PTR [esi+12], cl
  1128.     mov    DWORD PTR [esi+16], eax
  1129.     jne    SHORT $L53974
  1130.     push    esi
  1131.     call    _write_bit_buffer
  1132.     add    esp, 4
  1133. $L53974:
  1134.     push    2
  1135.     push    ebp
  1136.     push    esi
  1137.     call    _copy_bits
  1138.     add    esp, 12                    ; 0000000cH
  1139. $L53976:
  1140.     mov    eax, DWORD PTR [esi+52]
  1141.     cmp    eax, 2
  1142.     jle    SHORT $L53980
  1143.     add    DWORD PTR [esi+56], eax
  1144.     jmp    SHORT $L53981
  1145. $L53980:
  1146.     add    DWORD PTR [esi+56], -3            ; fffffffdH
  1147. $L53981:
  1148.     mov    DWORD PTR [esi+52], 0
  1149. $L53975:
  1150. ; Line 189
  1151.     mov    ecx, DWORD PTR [esi+16]
  1152.     add    ecx, edi
  1153.     mov    eax, ecx
  1154.     cmp    eax, 8
  1155.     mov    DWORD PTR [esi+16], ecx
  1156.     jb    SHORT $L53986
  1157. ; Line 195
  1158.     npad    1
  1159. ; Line 189
  1160. $L53985:
  1161.     mov    eax, DWORD PTR [esi]
  1162.     mov    cl, BYTE PTR [esi+12]
  1163.     mov    BYTE PTR [eax], cl
  1164.     mov    edx, DWORD PTR [esi+16]
  1165.     mov    edi, DWORD PTR [esi]
  1166.     add    edx, -8                    ; fffffff8H
  1167.     inc    edi
  1168.     mov    eax, edx
  1169.     cmp    eax, 8
  1170.     mov    DWORD PTR [esi], edi
  1171.     mov    DWORD PTR [esi+16], edx
  1172.     mov    BYTE PTR [esi+12], 0
  1173.     jae    SHORT $L53985
  1174. $L53986:
  1175. ; Line 190
  1176.     mov    eax, DWORD PTR [esi+16]
  1177.     mov    ecx, 7
  1178.     sub    ecx, eax
  1179.     mov    dl, 1
  1180.     shl    dl, cl
  1181.     mov    cl, BYTE PTR [esi+12]
  1182.     or    cl, dl
  1183.     inc    eax
  1184.     cmp    eax, 8
  1185.     mov    BYTE PTR [esi+12], cl
  1186.     mov    DWORD PTR [esi+16], eax
  1187.     jne    SHORT $L54019
  1188.     mov    eax, DWORD PTR [esi]
  1189.     mov    BYTE PTR [eax], cl
  1190.     mov    eax, DWORD PTR [esi]
  1191.     inc    eax
  1192.     xor    ebp, ebp
  1193.     mov    DWORD PTR [esi], eax
  1194.     mov    DWORD PTR [esi+16], ebp
  1195.     mov    BYTE PTR [esi+12], 0
  1196.     jmp    SHORT $L53993
  1197. $L54019:
  1198.     xor    ebp, ebp
  1199. $L53993:
  1200. ; Line 192
  1201.     mov    eax, DWORD PTR _log_b$[esp+12]
  1202.     cmp    eax, ebp
  1203.     je    $L54002
  1204.     and    ebx, DWORD PTR _rem$53403[esp+12]
  1205.     mov    edx, ebx
  1206.     mov    ebx, DWORD PTR [esi+16]
  1207.     mov    ecx, 8
  1208.     sub    ecx, ebx
  1209.     cmp    eax, ecx
  1210.     jbe    SHORT $L54006
  1211. $L54005:
  1212.     mov    ecx, DWORD PTR [esi+16]
  1213.     lea    edi, DWORD PTR [ecx+eax]
  1214.     lea    ecx, DWORD PTR [edi-8]
  1215.     mov    eax, edx
  1216.     shr    eax, cl
  1217.     mov    cl, BYTE PTR [esi+12]
  1218.     or    cl, al
  1219.     lea    eax, DWORD PTR [edi-8]
  1220.     mov    BYTE PTR [esi+12], cl
  1221.     mov    bl, BYTE PTR [esi+12]
  1222.     lea    ecx, DWORD PTR [eax+1]
  1223.     mov    edi, 1
  1224.     shl    edi, cl
  1225.     mov    ecx, DWORD PTR [esi]
  1226.     mov    BYTE PTR [ecx], bl
  1227.     mov    DWORD PTR [esi+16], ebp
  1228.     dec    edi
  1229.     and    edx, edi
  1230.     mov    edi, DWORD PTR [esi]
  1231.     inc    edi
  1232.     cmp    eax, 8
  1233.     mov    DWORD PTR [esi], edi
  1234.     mov    BYTE PTR [esi+12], 0
  1235.     ja    SHORT $L54005
  1236. $L54006:
  1237.     cmp    eax, ebp
  1238.     je    SHORT $L54002
  1239.     mov    edi, DWORD PTR [esi+16]
  1240.     mov    bl, BYTE PTR [esi+12]
  1241.     mov    ecx, 8
  1242.     sub    ecx, edi
  1243.     sub    ecx, eax
  1244.     shl    dl, cl
  1245.     add    eax, edi
  1246.     mov    DWORD PTR [esi+16], eax
  1247.     or    bl, dl
  1248.     cmp    eax, 8
  1249.     mov    BYTE PTR [esi+12], bl
  1250.     jne    SHORT $L54002
  1251.     mov    edx, DWORD PTR [esi]
  1252.     mov    al, bl
  1253.     mov    BYTE PTR [edx], al
  1254.     inc    DWORD PTR [esi]
  1255.     mov    DWORD PTR [esi+16], ebp
  1256.     mov    BYTE PTR [esi+12], 0
  1257. $L54002:
  1258.     pop    edi
  1259.     pop    esi
  1260.     pop    ebp
  1261.     pop    ebx
  1262. ; Line 195
  1263.     ret    0
  1264. _rice_encode ENDP
  1265. ; Function compile flags: /Ogty
  1266. _TEXT    ENDS
  1267. ;    COMDAT _write_bit_buffer
  1268. _TEXT    SEGMENT
  1269. _pi$ = 8
  1270. _write_bit_buffer PROC NEAR                ; COMDAT
  1271. ; Line 72
  1272.     mov    eax, DWORD PTR _pi$[esp-4]
  1273.     mov    ecx, DWORD PTR [eax]
  1274.     mov    dl, BYTE PTR [eax+12]
  1275.     mov    BYTE PTR [ecx], dl
  1276. ; Line 73
  1277.     inc    DWORD PTR [eax]
  1278. ; Line 74
  1279.     xor    ecx, ecx
  1280.     mov    DWORD PTR [eax+16], ecx
  1281. ; Line 75
  1282.     mov    BYTE PTR [eax+12], cl
  1283. ; Line 77
  1284.     ret    0
  1285. _write_bit_buffer ENDP
  1286. ; Function compile flags: /Ogty
  1287. _TEXT    ENDS
  1288. ;    COMDAT _rice_param
  1289. _TEXT    SEGMENT
  1290. _pip$ = 8
  1291. _rice_param PROC NEAR                    ; COMDAT
  1292. ; Line 381
  1293.     mov    eax, DWORD PTR _pip$[esp-4]
  1294.     mov    ecx, DWORD PTR [eax+40]
  1295. ; Line 382
  1296.     mov    eax, DWORD PTR [eax+44]
  1297. ; Line 384
  1298.     cmp    ecx, eax
  1299.     jl    SHORT $L53476
  1300.     xor    eax, eax
  1301. ; Line 394
  1302.     ret    0
  1303. $L53476:
  1304. ; Line 385
  1305.     add    ecx, ecx
  1306.     cmp    ecx, eax
  1307.     jl    SHORT $L53477
  1308.     mov    eax, 1
  1309. ; Line 394
  1310.     ret    0
  1311. $L53477:
  1312. ; Line 386
  1313.     add    ecx, ecx
  1314.     cmp    ecx, eax
  1315.     jl    SHORT $L53478
  1316.     mov    eax, 2
  1317. ; Line 394
  1318.     ret    0
  1319. $L53478:
  1320. ; Line 387
  1321.     add    ecx, ecx
  1322.     cmp    ecx, eax
  1323.     jl    SHORT $L53479
  1324.     mov    eax, 3
  1325. ; Line 394
  1326.     ret    0
  1327. $L53479:
  1328. ; Line 388
  1329.     add    ecx, ecx
  1330.     cmp    ecx, eax
  1331.     jl    SHORT $L53480
  1332.     mov    eax, 4
  1333. ; Line 394
  1334.     ret    0
  1335. $L53480:
  1336. ; Line 389
  1337.     add    ecx, ecx
  1338.     cmp    ecx, eax
  1339.     jl    SHORT $L53481
  1340.     mov    eax, 5
  1341. ; Line 394
  1342.     ret    0
  1343. $L53481:
  1344. ; Line 390
  1345.     add    ecx, ecx
  1346.     cmp    ecx, eax
  1347.     jl    SHORT $L53482
  1348.     mov    eax, 6
  1349. ; Line 394
  1350.     ret    0
  1351. $L53482:
  1352. ; Line 391
  1353.     add    ecx, ecx
  1354.     cmp    ecx, eax
  1355.     jl    SHORT $L53483
  1356.     mov    eax, 7
  1357. ; Line 394
  1358.     ret    0
  1359. $L53483:
  1360. ; Line 392
  1361.     xor    edx, edx
  1362.     add    ecx, ecx
  1363.     cmp    ecx, eax
  1364.     setl    dl
  1365.     add    edx, 8
  1366.     mov    eax, edx
  1367. ; Line 394
  1368.     ret    0
  1369. _rice_param ENDP
  1370. _TEXT    ENDS
  1371. PUBLIC    _loco_codec_compress_lossy
  1372. ; Function compile flags: /Ogty
  1373. ;    COMDAT _loco_codec_compress_lossy
  1374. _TEXT    SEGMENT
  1375. _minab$54097 = 32
  1376. _maxab$54098 = 20
  1377. _inBuffer$ = 8
  1378. _outBuffer$ = 12
  1379. _height$ = 16
  1380. _width$ = 20
  1381. _xOffset$ = 24
  1382. _xStep$ = 28
  1383. _yOffset$ = 32
  1384. _yStep$ = 36
  1385. _maxLoss$ = 40
  1386. _i$ = 16
  1387. _j$ = 36
  1388. _pi$ = -72
  1389. _currentBuffer$ = 40
  1390. _prevBuffer$ = 12
  1391. _tmp_buffer$ = -76
  1392. _loco_codec_compress_lossy PROC NEAR            ; COMDAT
  1393. ; Line 681
  1394.     mov    eax, DWORD PTR _maxLoss$[esp-4]
  1395.     sub    esp, 76                    ; 0000004cH
  1396.     test    eax, eax
  1397.     jne    SHORT $L53702
  1398. ; Line 682
  1399.     mov    eax, DWORD PTR _yStep$[esp+72]
  1400.     mov    ecx, DWORD PTR _yOffset$[esp+72]
  1401.     mov    edx, DWORD PTR _xStep$[esp+72]
  1402.     push    eax
  1403.     mov    eax, DWORD PTR _xOffset$[esp+76]
  1404.     push    ecx
  1405.     mov    ecx, DWORD PTR _width$[esp+80]
  1406.     push    edx
  1407.     mov    edx, DWORD PTR _height$[esp+84]
  1408.     push    eax
  1409.     mov    eax, DWORD PTR _outBuffer$[esp+88]
  1410.     push    ecx
  1411.     mov    ecx, DWORD PTR _inBuffer$[esp+92]
  1412.     push    edx
  1413.     push    eax
  1414.     push    ecx
  1415.     call    _loco_codec_compress
  1416.     add    esp, 32                    ; 00000020H
  1417. ; Line 730
  1418.     add    esp, 76                    ; 0000004cH
  1419.     ret    0
  1420. $L53702:
  1421. ; Line 684
  1422.     mov    edx, DWORD PTR _yStep$[esp+72]
  1423.     mov    ecx, DWORD PTR _width$[esp+72]
  1424.     push    ebx
  1425.     mov    ebx, DWORD PTR _xOffset$[esp+76]
  1426.     push    ebp
  1427.     push    esi
  1428.     mov    esi, DWORD PTR _xStep$[esp+84]
  1429.     push    edi
  1430.     push    eax
  1431.     mov    eax, DWORD PTR _yOffset$[esp+92]
  1432.     push    edx
  1433.     mov    edx, DWORD PTR _height$[esp+96]
  1434.     push    eax
  1435.     mov    eax, DWORD PTR _outBuffer$[esp+100]
  1436.     push    esi
  1437.     push    ebx
  1438.     push    ecx
  1439.     mov    ecx, DWORD PTR _inBuffer$[esp+112]
  1440.     push    edx
  1441.     push    eax
  1442.     push    ecx
  1443.     lea    edx, DWORD PTR _pi$[esp+128]
  1444.     push    edx
  1445.     call    _initialize_pi
  1446. ; Line 686
  1447.     mov    eax, DWORD PTR _pi$[esp+156]
  1448.     lea    eax, DWORD PTR [eax+eax+96]
  1449.     push    eax
  1450.     call    _malloc
  1451.     mov    DWORD PTR _tmp_buffer$[esp+136], eax
  1452. ; Line 689
  1453.     add    eax, 15                    ; 0000000fH
  1454.     and    eax, -16                ; fffffff0H
  1455.     mov    DWORD PTR _pi$[esp+204], eax
  1456. ; Line 690
  1457.     add    eax, 32                    ; 00000020H
  1458. ; Line 691
  1459.     lea    edi, DWORD PTR [eax+32]
  1460.     mov    DWORD PTR _pi$[esp+200], eax
  1461. ; Line 693
  1462.     mov    eax, DWORD PTR _pi$[esp+160]
  1463.     lea    ebp, DWORD PTR [eax+edi+15]
  1464.     add    esp, 44                    ; 0000002cH
  1465.     and    ebp, -16                ; fffffff0H
  1466. ; Line 697
  1467.     xor    ecx, ecx
  1468.     test    eax, eax
  1469.     mov    DWORD PTR _pi$[esp+120], 1
  1470.     jle    SHORT $L54037
  1471.     mov    edx, DWORD PTR _inBuffer$[esp+88]
  1472.     add    edx, ebx
  1473. $L54035:
  1474.     mov    bl, BYTE PTR [edx]
  1475.     mov    BYTE PTR [ecx+edi], bl
  1476.     inc    ecx
  1477.     add    edx, esi
  1478.     cmp    ecx, eax
  1479.     jl    SHORT $L54035
  1480.     mov    eax, DWORD PTR _pi$[esp+116]
  1481. $L54037:
  1482. ; Line 700
  1483.     test    eax, eax
  1484.     mov    ebx, edi
  1485.     mov    DWORD PTR _pi$[esp+96], ebx
  1486.     mov    DWORD PTR _j$[esp+88], 0
  1487.     jle    $L53710
  1488.     jmp    SHORT $L53708
  1489. $L54145:
  1490.     mov    ebx, DWORD PTR _pi$[esp+96]
  1491. $L53708:
  1492. ; Line 701
  1493.     mov    eax, DWORD PTR _j$[esp+88]
  1494.     test    eax, eax
  1495.     jle    SHORT $L54042
  1496.     mov    ecx, DWORD PTR _pi$[esp+120]
  1497.     mov    eax, ebx
  1498.     sub    eax, ecx
  1499.     movzx    esi, BYTE PTR [eax]
  1500.     jmp    SHORT $L54152
  1501. $L54042:
  1502.     mov    esi, 128                ; 00000080H
  1503. $L54152:
  1504. ; Line 702
  1505.     lea    ecx, DWORD PTR _pi$[esp+92]
  1506.     push    ecx
  1507.     mov    DWORD PTR _pi$[esp+132], esi
  1508.     call    _rice_param
  1509.     movzx    edx, BYTE PTR [ebx]
  1510.     sub    esi, edx
  1511.     add    esp, 4
  1512.     test    esi, esi
  1513.     mov    ecx, esi
  1514.     jg    SHORT $L54049
  1515.     neg    ecx
  1516. $L54049:
  1517.     cmp    ecx, DWORD PTR _pi$[esp+140]
  1518.     jg    SHORT $L54054
  1519.     mov    cl, BYTE PTR _pi$[esp+128]
  1520.     mov    BYTE PTR [ebx], cl
  1521.     mov    ebx, DWORD PTR _pi$[esp+96]
  1522.     xor    ecx, ecx
  1523.     jmp    SHORT $L54055
  1524. $L54054:
  1525.     add    DWORD PTR _pi$[esp+136], ecx
  1526.     xor    edx, edx
  1527.     cmp    esi, 1
  1528.     setge    dl
  1529.     add    ecx, ecx
  1530.     sub    ecx, edx
  1531. $L54055:
  1532.     mov    esi, DWORD PTR _pi$[esp+120]
  1533.     mov    edx, DWORD PTR _pi$[esp+132]
  1534.     push    eax
  1535.     add    ebx, esi
  1536.     push    ecx
  1537.     lea    eax, DWORD PTR _pi$[esp+100]
  1538.     inc    edx
  1539.     push    eax
  1540.     mov    DWORD PTR _pi$[esp+108], ebx
  1541.     mov    DWORD PTR _pi$[esp+144], edx
  1542.     call    _rice_encode
  1543.     mov    eax, DWORD PTR _pi$[esp+144]
  1544.     add    esp, 12                    ; 0000000cH
  1545.     cmp    eax, 16                    ; 00000010H
  1546.     jne    SHORT $L53709
  1547.     mov    eax, DWORD PTR _pi$[esp+136]
  1548.     sar    eax, 1
  1549.     mov    DWORD PTR _pi$[esp+132], 8
  1550.     mov    DWORD PTR _pi$[esp+136], eax
  1551. $L53709:
  1552.     mov    ecx, DWORD PTR _j$[esp+88]
  1553.     mov    eax, DWORD PTR _pi$[esp+116]
  1554.     inc    ecx
  1555.     cmp    ecx, eax
  1556.     mov    DWORD PTR _j$[esp+88], ecx
  1557.     jl    $L54145
  1558. $L53710:
  1559. ; Line 705
  1560.     mov    ecx, DWORD PTR _pi$[esp+112]
  1561.     mov    ebx, 1
  1562.     cmp    ecx, ebx
  1563.     mov    DWORD PTR _i$[esp+88], ebx
  1564.     jle    $L53713
  1565.     jmp    SHORT $L53711
  1566. $L54148:
  1567.     mov    edi, DWORD PTR _currentBuffer$[esp+88]
  1568.     mov    ebp, DWORD PTR _prevBuffer$[esp+88]
  1569. $L53711:
  1570. ; Line 711
  1571.     mov    edx, DWORD PTR _inBuffer$[esp+88]
  1572.     mov    ecx, edi
  1573.     mov    DWORD PTR _prevBuffer$[esp+88], ecx
  1574.     mov    DWORD PTR _pi$[esp+100], ecx
  1575.     mov    ecx, DWORD PTR _pi$[esp+124]
  1576.     imul    ecx, ebx
  1577.     add    ecx, edx
  1578.     mov    esi, ebp
  1579.     xor    edx, edx
  1580.     test    eax, eax
  1581.     mov    DWORD PTR _currentBuffer$[esp+88], esi
  1582.     mov    edi, eax
  1583.     jle    SHORT $L54064
  1584.     mov    eax, DWORD PTR _xOffset$[esp+88]
  1585.     add    ecx, eax
  1586. ; Line 730
  1587.     npad    2
  1588. ; Line 711
  1589. $L54062:
  1590.     mov    al, BYTE PTR [ecx]
  1591.     mov    ebp, DWORD PTR _xStep$[esp+88]
  1592.     mov    BYTE PTR [edx+esi], al
  1593.     inc    edx
  1594.     add    ecx, ebp
  1595.     cmp    edx, edi
  1596.     jl    SHORT $L54062
  1597. $L54064:
  1598. ; Line 714
  1599.     mov    eax, DWORD PTR _pi$[esp+100]
  1600.     mov    ebp, DWORD PTR _pi$[esp+120]
  1601.     mov    DWORD PTR _pi$[esp+96], esi
  1602.     movzx    edi, BYTE PTR [eax]
  1603. ; Line 715
  1604.     lea    ecx, DWORD PTR _pi$[esp+92]
  1605.     add    eax, ebp
  1606.     push    ecx
  1607.     mov    DWORD PTR _pi$[esp+132], edi
  1608.     mov    DWORD PTR _pi$[esp+104], eax
  1609.     call    _rice_param
  1610.     movzx    edx, BYTE PTR [esi]
  1611.     sub    edi, edx
  1612.     add    esp, 4
  1613.     test    edi, edi
  1614.     mov    ecx, edi
  1615.     jg    SHORT $L54075
  1616.     neg    ecx
  1617. $L54075:
  1618.     cmp    ecx, DWORD PTR _pi$[esp+140]
  1619.     jg    SHORT $L54080
  1620.     mov    cl, BYTE PTR _pi$[esp+128]
  1621.     mov    BYTE PTR [esi], cl
  1622.     xor    ecx, ecx
  1623.     jmp    SHORT $L54081
  1624. $L54080:
  1625.     add    DWORD PTR _pi$[esp+136], ecx
  1626.     xor    edx, edx
  1627.     cmp    edi, 1
  1628.     setge    dl
  1629.     add    ecx, ecx
  1630.     sub    ecx, edx
  1631. $L54081:
  1632.     mov    esi, DWORD PTR _pi$[esp+96]
  1633.     mov    edx, DWORD PTR _pi$[esp+120]
  1634.     mov    ebp, DWORD PTR _pi$[esp+132]
  1635.     push    eax
  1636.     add    esi, edx
  1637.     push    ecx
  1638.     lea    eax, DWORD PTR _pi$[esp+100]
  1639.     inc    ebp
  1640.     push    eax
  1641.     mov    DWORD PTR _pi$[esp+108], esi
  1642.     mov    DWORD PTR _pi$[esp+144], ebp
  1643.     call    _rice_encode
  1644.     mov    eax, DWORD PTR _pi$[esp+144]
  1645.     add    esp, 12                    ; 0000000cH
  1646.     cmp    eax, 16                    ; 00000010H
  1647.     jne    SHORT $L54082
  1648.     mov    eax, DWORD PTR _pi$[esp+136]
  1649.     sar    eax, 1
  1650.     mov    DWORD PTR _pi$[esp+132], 8
  1651.     mov    DWORD PTR _pi$[esp+136], eax
  1652. $L54082:
  1653. ; Line 716
  1654.     mov    eax, DWORD PTR _pi$[esp+116]
  1655.     cmp    eax, 1
  1656.     mov    DWORD PTR _j$[esp+88], 1
  1657.     jle    $L53712
  1658. ; Line 730
  1659.     npad    7
  1660. $L53714:
  1661. ; Line 717
  1662.     mov    ebp, DWORD PTR _pi$[esp+100]
  1663.     mov    edi, DWORD PTR _pi$[esp+120]
  1664.     mov    esi, DWORD PTR _pi$[esp+96]
  1665.     mov    ecx, ebp
  1666.     sub    ecx, edi
  1667.     movzx    edx, BYTE PTR [ecx]
  1668.     movzx    ecx, BYTE PTR [ebp]
  1669.     mov    eax, esi
  1670.     sub    eax, edi
  1671.     movzx    eax, BYTE PTR [eax]
  1672.     cmp    ecx, eax
  1673.     mov    DWORD PTR _minab$54097[esp+88], ecx
  1674.     jl    SHORT $L54091
  1675.     mov    DWORD PTR _minab$54097[esp+88], eax
  1676.     mov    ebx, ecx
  1677.     jg    SHORT $L54154
  1678. $L54091:
  1679.     mov    ebx, eax
  1680. $L54154:
  1681.     mov    DWORD PTR _maxab$54098[esp+88], ebx
  1682.     cmp    edx, ebx
  1683.     mov    ebx, DWORD PTR _minab$54097[esp+88]
  1684.     jge    SHORT $L54103
  1685.     cmp    edx, ebx
  1686.     jg    SHORT $L54102
  1687.     mov    ebx, DWORD PTR _maxab$54098[esp+88]
  1688.     jmp    SHORT $L54103
  1689. $L54102:
  1690.     sub    eax, edx
  1691.     add    eax, ecx
  1692.     mov    ebx, eax
  1693. $L54103:
  1694. ; Line 718
  1695.     lea    ecx, DWORD PTR _pi$[esp+92]
  1696.     add    ebp, edi
  1697.     push    ecx
  1698.     mov    DWORD PTR _pi$[esp+104], ebp
  1699.     mov    DWORD PTR _pi$[esp+132], ebx
  1700.     call    _rice_param
  1701.     movzx    edx, BYTE PTR [esi]
  1702.     mov    ecx, ebx
  1703.     sub    ecx, edx
  1704.     add    esp, 4
  1705.     test    ecx, ecx
  1706.     mov    ebp, eax
  1707.     mov    edx, ecx
  1708.     jg    SHORT $L54109
  1709.     neg    edx
  1710. $L54109:
  1711.     cmp    edx, DWORD PTR _pi$[esp+140]
  1712.     jg    SHORT $L54114
  1713.     mov    BYTE PTR [esi], bl
  1714.     mov    esi, DWORD PTR _pi$[esp+96]
  1715.     mov    edi, DWORD PTR _pi$[esp+120]
  1716.     xor    ecx, ecx
  1717.     jmp    SHORT $L54115
  1718. $L54114:
  1719.     add    DWORD PTR _pi$[esp+136], edx
  1720.     xor    eax, eax
  1721.     cmp    ecx, 1
  1722.     setge    al
  1723.     lea    ecx, DWORD PTR [edx+edx]
  1724.     sub    ecx, eax
  1725. $L54115:
  1726.     mov    ebx, DWORD PTR _pi$[esp+132]
  1727.     push    ebp
  1728.     push    ecx
  1729.     add    esi, edi
  1730.     lea    ecx, DWORD PTR _pi$[esp+100]
  1731.     inc    ebx
  1732.     push    ecx
  1733.     mov    DWORD PTR _pi$[esp+108], esi
  1734.     mov    DWORD PTR _pi$[esp+144], ebx
  1735.     call    _rice_encode
  1736.     mov    eax, DWORD PTR _pi$[esp+144]
  1737.     add    esp, 12                    ; 0000000cH
  1738.     cmp    eax, 16                    ; 00000010H
  1739.     jne    SHORT $L53715
  1740.     mov    eax, DWORD PTR _pi$[esp+136]
  1741.     sar    eax, 1
  1742.     mov    DWORD PTR _pi$[esp+132], 8
  1743.     mov    DWORD PTR _pi$[esp+136], eax
  1744. $L53715:
  1745.     mov    ecx, DWORD PTR _j$[esp+88]
  1746.     mov    eax, DWORD PTR _pi$[esp+116]
  1747.     inc    ecx
  1748.     cmp    ecx, eax
  1749.     mov    DWORD PTR _j$[esp+88], ecx
  1750.     jl    $L53714
  1751. ; Line 716
  1752.     mov    ebx, DWORD PTR _i$[esp+88]
  1753. $L53712:
  1754. ; Line 705
  1755.     mov    ecx, DWORD PTR _pi$[esp+112]
  1756.     inc    ebx
  1757.     cmp    ebx, ecx
  1758.     mov    DWORD PTR _i$[esp+88], ebx
  1759.     jl    $L54148
  1760. $L53713:
  1761. ; Line 725
  1762.     mov    esi, DWORD PTR _pi$[esp+144]
  1763.     test    esi, esi
  1764.     jle    SHORT $L54120
  1765.     mov    eax, DWORD PTR _pi$[esp+148]
  1766.     test    eax, eax
  1767.     jl    SHORT $L54120
  1768.     dec    esi
  1769.     mov    edx, esi
  1770.     sar    edx, 2
  1771.     push    edx
  1772.     lea    eax, DWORD PTR _pi$[esp+96]
  1773.     push    eax
  1774.     call    _output_zero_bits
  1775.     lea    ecx, DWORD PTR _pi$[esp+100]
  1776.     push    ecx
  1777.     call    _output_one_bit
  1778.     push    2
  1779.     and    esi, 3
  1780.     lea    edx, DWORD PTR _pi$[esp+108]
  1781.     push    esi
  1782.     push    edx
  1783.     call    _copy_bits
  1784.     mov    esi, DWORD PTR _pi$[esp+168]
  1785.     add    esp, 24                    ; 00000018H
  1786. $L54120:
  1787.     cmp    esi, 2
  1788.     mov    eax, DWORD PTR _pi$[esp+148]
  1789.     jle    SHORT $L54124
  1790.     add    eax, esi
  1791.     jmp    SHORT $L54155
  1792. $L54124:
  1793.     sub    eax, 3
  1794. $L54155:
  1795. ; Line 726
  1796.     mov    ecx, DWORD PTR _pi$[esp+108]
  1797.     pop    edi
  1798.     pop    esi
  1799.     mov    DWORD PTR _pi$[esp+140], eax
  1800.     xor    eax, eax
  1801.     cmp    ecx, eax
  1802.     pop    ebp
  1803.     mov    DWORD PTR _pi$[esp+132], eax
  1804.     pop    ebx
  1805.     jbe    SHORT $L54132
  1806.     mov    ecx, DWORD PTR _pi$[esp+76]
  1807.     mov    dl, BYTE PTR _pi$[esp+88]
  1808.     mov    BYTE PTR [ecx], dl
  1809.     inc    DWORD PTR _pi$[esp+76]
  1810.     mov    DWORD PTR _pi$[esp+92], eax
  1811.     mov    BYTE PTR _pi$[esp+88], al
  1812. $L54132:
  1813. ; Line 727
  1814.     mov    eax, DWORD PTR _tmp_buffer$[esp+76]
  1815.     push    eax
  1816.     call    _free
  1817. ; Line 729
  1818.     mov    eax, DWORD PTR _pi$[esp+80]
  1819.     add    esp, 4
  1820. ; Line 730
  1821.     add    esp, 76                    ; 0000004cH
  1822.     ret    0
  1823. _loco_codec_compress_lossy ENDP
  1824. ; Function compile flags: /Ogty
  1825. _TEXT    ENDS
  1826. ;    COMDAT _output_zero_bits
  1827. _TEXT    SEGMENT
  1828. _pi$ = 8
  1829. _bits$ = 12
  1830. _output_zero_bits PROC NEAR                ; COMDAT
  1831. ; Line 89
  1832.     mov    eax, DWORD PTR _pi$[esp-4]
  1833.     mov    ecx, DWORD PTR _bits$[esp-4]
  1834.     push    ebx
  1835.     mov    ebx, DWORD PTR [eax+16]
  1836.     add    ebx, ecx
  1837.     mov    ecx, ebx
  1838. ; Line 91
  1839.     cmp    ecx, 8
  1840.     mov    DWORD PTR [eax+16], ebx
  1841.     jb    SHORT $L53354
  1842.     xor    dl, dl
  1843. ; Line 99
  1844.     npad    6
  1845. $L53353:
  1846. ; Line 93
  1847.     mov    ecx, DWORD PTR [eax]
  1848.     mov    bl, BYTE PTR [eax+12]
  1849.     mov    BYTE PTR [ecx], bl
  1850. ; Line 96
  1851.     mov    ecx, DWORD PTR [eax+16]
  1852.     mov    ebx, DWORD PTR [eax]
  1853.     add    ecx, -8                    ; fffffff8H
  1854.     inc    ebx
  1855.     cmp    ecx, 8
  1856.     mov    DWORD PTR [eax], ebx
  1857.     mov    DWORD PTR [eax+16], ecx
  1858. ; Line 97
  1859.     mov    BYTE PTR [eax+12], dl
  1860.     jae    SHORT $L53353
  1861. $L53354:
  1862.     pop    ebx
  1863. ; Line 99
  1864.     ret    0
  1865. _output_zero_bits ENDP
  1866. _TEXT    ENDS
  1867. PUBLIC    _loco_codec_decompress
  1868. ; Function compile flags: /Ogty
  1869. ;    COMDAT _loco_codec_decompress
  1870. _TEXT    SEGMENT
  1871. _minab$54268 = 36
  1872. _inBuffer$ = 8
  1873. _outBuffer$ = 12
  1874. _height$ = 16
  1875. _width$ = 20
  1876. _xOffset$ = 24
  1877. _xStep$ = 28
  1878. _yOffset$ = 32
  1879. _yStep$ = 36
  1880. _i$ = 28
  1881. _j$ = 32
  1882. _pi$ = -72
  1883. _loco_codec_decompress PROC NEAR            ; COMDAT
  1884. ; Line 738
  1885.     mov    eax, DWORD PTR _yStep$[esp-4]
  1886.     mov    ecx, DWORD PTR _yOffset$[esp-4]
  1887.     mov    edx, DWORD PTR _xStep$[esp-4]
  1888.     sub    esp, 72                    ; 00000048H
  1889.     push    ebx
  1890.     push    ebp
  1891.     push    esi
  1892.     push    edi
  1893.     push    0
  1894.     push    eax
  1895.     mov    eax, DWORD PTR _xOffset$[esp+92]
  1896.     push    ecx
  1897.     mov    ecx, DWORD PTR _width$[esp+96]
  1898.     push    edx
  1899.     mov    edx, DWORD PTR _height$[esp+100]
  1900.     push    eax
  1901.     mov    eax, DWORD PTR _inBuffer$[esp+104]
  1902.     push    ecx
  1903.     mov    ecx, DWORD PTR _outBuffer$[esp+108]
  1904.     push    edx
  1905.     push    eax
  1906.     push    ecx
  1907.     lea    edx, DWORD PTR _pi$[esp+124]
  1908.     push    edx
  1909.     call    _initialize_pi
  1910. ; Line 740
  1911.     mov    eax, DWORD PTR _pi$[esp+152]
  1912.     mov    edx, DWORD PTR _pi$[esp+156]
  1913.     add    esp, 40                    ; 00000028H
  1914.     xor    esi, esi
  1915.     test    eax, eax
  1916.     mov    ebp, 1
  1917.     mov    ebx, 8
  1918.     jle    $L53739
  1919.     mov    eax, DWORD PTR _pi$[esp+92]
  1920.     mov    edi, 128                ; 00000080H
  1921. $L53737:
  1922. ; Line 741
  1923.     test    esi, esi
  1924.     jle    SHORT $L54165
  1925.     sub    eax, edx
  1926.     movzx    eax, BYTE PTR [eax]
  1927.     mov    DWORD PTR _pi$[esp+124], eax
  1928.     jmp    SHORT $L54166
  1929. $L54165:
  1930.     mov    DWORD PTR _pi$[esp+124], edi
  1931. $L54166:
  1932. ; Line 742
  1933.     mov    ecx, DWORD PTR _pi$[esp+128]
  1934.     mov    eax, DWORD PTR _pi$[esp+132]
  1935.     cmp    ecx, eax
  1936.     jl    SHORT $L54195
  1937.     xor    eax, eax
  1938.     jmp    SHORT $L54203
  1939. $L54195:
  1940.     add    ecx, ecx
  1941.     cmp    ecx, eax
  1942.     jl    SHORT $L54196
  1943.     mov    eax, ebp
  1944.     jmp    SHORT $L54203
  1945. $L54196:
  1946.     add    ecx, ecx
  1947.     cmp    ecx, eax
  1948.     jl    SHORT $L54197
  1949.     mov    eax, 2
  1950.     jmp    SHORT $L54203
  1951. $L54197:
  1952.     add    ecx, ecx
  1953.     cmp    ecx, eax
  1954.     jl    SHORT $L54198
  1955.     mov    eax, 3
  1956.     jmp    SHORT $L54203
  1957. $L54198:
  1958.     add    ecx, ecx
  1959.     cmp    ecx, eax
  1960.     jl    SHORT $L54199
  1961.     mov    eax, 4
  1962.     jmp    SHORT $L54203
  1963. $L54199:
  1964.     add    ecx, ecx
  1965.     cmp    ecx, eax
  1966.     jl    SHORT $L54200
  1967.     mov    eax, 5
  1968.     jmp    SHORT $L54203
  1969. $L54200:
  1970.     add    ecx, ecx
  1971.     cmp    ecx, eax
  1972.     jl    SHORT $L54201
  1973.     mov    eax, 6
  1974.     jmp    SHORT $L54203
  1975. $L54201:
  1976.     add    ecx, ecx
  1977.     cmp    ecx, eax
  1978.     jl    SHORT $L54202
  1979.     mov    eax, 7
  1980.     jmp    SHORT $L54203
  1981. $L54202:
  1982.     add    ecx, ecx
  1983.     xor    edx, edx
  1984.     cmp    ecx, eax
  1985.     setl    dl
  1986.     add    edx, ebx
  1987.     mov    eax, edx
  1988. $L54203:
  1989.     push    eax
  1990.     lea    eax, DWORD PTR _pi$[esp+92]
  1991.     push    eax
  1992.     call    _rice_decode
  1993.     add    esp, 8
  1994.     test    al, 1
  1995.     je    SHORT $L54187
  1996.     inc    eax
  1997.     sar    eax, 1
  1998.     jmp    SHORT $L54188
  1999. $L54187:
  2000.     sar    eax, 1
  2001.     neg    eax
  2002. $L54188:
  2003.     test    eax, eax
  2004.     mov    ecx, eax
  2005.     jg    SHORT $L54190
  2006.     neg    ecx
  2007. $L54190:
  2008.     mov    edx, DWORD PTR _pi$[esp+132]
  2009.     add    edx, ecx
  2010.     mov    ecx, DWORD PTR _pi$[esp+128]
  2011.     inc    ecx
  2012.     cmp    ecx, 16                    ; 00000010H
  2013.     mov    DWORD PTR _pi$[esp+132], edx
  2014.     mov    DWORD PTR _pi$[esp+128], ecx
  2015.     jne    SHORT $L54208
  2016.     mov    ecx, edx
  2017.     sar    ecx, 1
  2018.     mov    DWORD PTR _pi$[esp+128], ebx
  2019.     mov    DWORD PTR _pi$[esp+132], ecx
  2020. $L54208:
  2021.     mov    cl, BYTE PTR _pi$[esp+124]
  2022.     mov    edx, DWORD PTR _pi$[esp+92]
  2023.     sub    cl, al
  2024.     mov    BYTE PTR [edx], cl
  2025.     mov    eax, DWORD PTR _pi$[esp+92]
  2026.     mov    edx, DWORD PTR _pi$[esp+116]
  2027.     mov    ecx, DWORD PTR _pi$[esp+112]
  2028.     add    eax, edx
  2029.     inc    esi
  2030.     cmp    esi, ecx
  2031.     mov    DWORD PTR _pi$[esp+92], eax
  2032.     jl    $L53737
  2033. $L53739:
  2034. ; Line 745
  2035.     cmp    DWORD PTR _pi$[esp+108], ebp
  2036.     mov    DWORD PTR _i$[esp+84], ebp
  2037.     jle    $L54323
  2038.     jmp    SHORT $L53740
  2039. $L54325:
  2040.     mov    ebp, 1
  2041.     mov    ebx, 8
  2042. $L53740:
  2043. ; Line 747
  2044.     mov    eax, DWORD PTR _pi$[esp+96]
  2045.     movzx    ecx, BYTE PTR [eax]
  2046.     add    eax, edx
  2047.     mov    DWORD PTR _pi$[esp+124], ecx
  2048. ; Line 748
  2049.     mov    ecx, DWORD PTR _pi$[esp+128]
  2050.     mov    DWORD PTR _pi$[esp+96], eax
  2051.     mov    eax, DWORD PTR _pi$[esp+132]
  2052.     cmp    ecx, eax
  2053.     jl    SHORT $L54240
  2054.     xor    eax, eax
  2055.     jmp    SHORT $L54248
  2056. $L54240:
  2057.     add    ecx, ecx
  2058.     cmp    ecx, eax
  2059.     jl    SHORT $L54241
  2060.     mov    eax, ebp
  2061.     jmp    SHORT $L54248
  2062. $L54241:
  2063.     add    ecx, ecx
  2064.     cmp    ecx, eax
  2065.     jl    SHORT $L54242
  2066.     mov    eax, 2
  2067.     jmp    SHORT $L54248
  2068. $L54242:
  2069.     add    ecx, ecx
  2070.     cmp    ecx, eax
  2071.     jl    SHORT $L54243
  2072.     mov    eax, 3
  2073.     jmp    SHORT $L54248
  2074. $L54243:
  2075.     add    ecx, ecx
  2076.     cmp    ecx, eax
  2077.     jl    SHORT $L54244
  2078.     mov    eax, 4
  2079.     jmp    SHORT $L54248
  2080. $L54244:
  2081.     add    ecx, ecx
  2082.     cmp    ecx, eax
  2083.     jl    SHORT $L54245
  2084.     mov    eax, 5
  2085.     jmp    SHORT $L54248
  2086. $L54245:
  2087.     add    ecx, ecx
  2088.     cmp    ecx, eax
  2089.     jl    SHORT $L54246
  2090.     mov    eax, 6
  2091.     jmp    SHORT $L54248
  2092. $L54246:
  2093.     add    ecx, ecx
  2094.     cmp    ecx, eax
  2095.     jl    SHORT $L54247
  2096.     mov    eax, 7
  2097.     jmp    SHORT $L54248
  2098. $L54247:
  2099.     lea    edx, DWORD PTR [ecx+ecx]
  2100.     xor    ecx, ecx
  2101.     cmp    edx, eax
  2102.     setl    cl
  2103.     add    ecx, ebx
  2104.     mov    eax, ecx
  2105. $L54248:
  2106.     push    eax
  2107.     lea    edx, DWORD PTR _pi$[esp+92]
  2108.     push    edx
  2109.     call    _rice_decode
  2110.     add    esp, 8
  2111.     test    al, 1
  2112.     je    SHORT $L54232
  2113.     inc    eax
  2114.     sar    eax, 1
  2115.     jmp    SHORT $L54233
  2116. $L54232:
  2117.     sar    eax, 1
  2118.     neg    eax
  2119. $L54233:
  2120.     test    eax, eax
  2121.     mov    ecx, eax
  2122.     jg    SHORT $L54235
  2123.     neg    ecx
  2124. $L54235:
  2125.     mov    edi, DWORD PTR _pi$[esp+132]
  2126.     add    edi, ecx
  2127.     mov    ecx, DWORD PTR _pi$[esp+128]
  2128.     inc    ecx
  2129.     cmp    ecx, 16                    ; 00000010H
  2130.     mov    DWORD PTR _pi$[esp+132], edi
  2131.     mov    DWORD PTR _pi$[esp+128], ecx
  2132.     jne    SHORT $L54253
  2133.     mov    ecx, edi
  2134.     sar    ecx, 1
  2135.     mov    DWORD PTR _pi$[esp+128], ebx
  2136.     mov    DWORD PTR _pi$[esp+132], ecx
  2137. $L54253:
  2138.     mov    cl, BYTE PTR _pi$[esp+124]
  2139.     mov    edx, DWORD PTR _pi$[esp+92]
  2140.     sub    cl, al
  2141.     mov    BYTE PTR [edx], cl
  2142.     mov    eax, DWORD PTR _pi$[esp+92]
  2143.     mov    edx, DWORD PTR _pi$[esp+116]
  2144. ; Line 749
  2145.     mov    ecx, DWORD PTR _pi$[esp+112]
  2146.     add    eax, edx
  2147.     cmp    ecx, ebp
  2148.     mov    DWORD PTR _pi$[esp+92], eax
  2149.     mov    DWORD PTR _j$[esp+84], ebp
  2150.     jle    $L53741
  2151. ; Line 757
  2152.     npad    5
  2153. $L53743:
  2154. ; Line 750
  2155.     mov    ebp, DWORD PTR _pi$[esp+96]
  2156.     mov    ecx, ebp
  2157.     sub    ecx, edx
  2158.     movzx    esi, BYTE PTR [ecx]
  2159.     movzx    ecx, BYTE PTR [ebp]
  2160.     sub    eax, edx
  2161.     movzx    eax, BYTE PTR [eax]
  2162.     cmp    ecx, eax
  2163.     mov    ebx, ecx
  2164.     jl    SHORT $L54326
  2165.     mov    ebx, eax
  2166. $L54326:
  2167.     cmp    ecx, eax
  2168.     mov    DWORD PTR _minab$54268[esp+84], ebx
  2169.     mov    edi, ecx
  2170.     jg    SHORT $L54263
  2171.     mov    edi, eax
  2172. $L54263:
  2173.     cmp    esi, edi
  2174.     jl    SHORT $L54271
  2175.     mov    eax, ebx
  2176.     jmp    SHORT $L54274
  2177. $L54271:
  2178.     cmp    esi, DWORD PTR _minab$54268[esp+84]
  2179.     jg    SHORT $L54273
  2180.     mov    eax, edi
  2181.     jmp    SHORT $L54274
  2182. $L54273:
  2183.     sub    eax, esi
  2184.     add    eax, ecx
  2185. $L54274:
  2186. ; Line 751
  2187.     mov    ecx, DWORD PTR _pi$[esp+128]
  2188.     mov    DWORD PTR _pi$[esp+124], eax
  2189.     mov    eax, DWORD PTR _pi$[esp+132]
  2190.     add    ebp, edx
  2191.     cmp    ecx, eax
  2192.     mov    DWORD PTR _pi$[esp+96], ebp
  2193.     jl    SHORT $L54303
  2194.     xor    eax, eax
  2195.     jmp    SHORT $L54311
  2196. $L54303:
  2197.     add    ecx, ecx
  2198.     cmp    ecx, eax
  2199.     jl    SHORT $L54304
  2200.     mov    eax, 1
  2201.     jmp    SHORT $L54311
  2202. $L54304:
  2203.     add    ecx, ecx
  2204.     cmp    ecx, eax
  2205.     jl    SHORT $L54305
  2206.     mov    eax, 2
  2207.     jmp    SHORT $L54311
  2208. $L54305:
  2209.     add    ecx, ecx
  2210.     cmp    ecx, eax
  2211.     jl    SHORT $L54306
  2212.     mov    eax, 3
  2213.     jmp    SHORT $L54311
  2214. $L54306:
  2215.     add    ecx, ecx
  2216.     cmp    ecx, eax
  2217.     jl    SHORT $L54307
  2218.     mov    eax, 4
  2219.     jmp    SHORT $L54311
  2220. $L54307:
  2221.     add    ecx, ecx
  2222.     cmp    ecx, eax
  2223.     jl    SHORT $L54308
  2224.     mov    eax, 5
  2225.     jmp    SHORT $L54311
  2226. $L54308:
  2227.     add    ecx, ecx
  2228.     cmp    ecx, eax
  2229.     jl    SHORT $L54309
  2230.     mov    eax, 6
  2231.     jmp    SHORT $L54311
  2232. $L54309:
  2233.     add    ecx, ecx
  2234.     cmp    ecx, eax
  2235.     jl    SHORT $L54310
  2236.     mov    eax, 7
  2237.     jmp    SHORT $L54311
  2238. $L54310:
  2239.     lea    edx, DWORD PTR [ecx+ecx]
  2240.     xor    ecx, ecx
  2241.     cmp    edx, eax
  2242.     setl    cl
  2243.     add    ecx, 8
  2244.     mov    eax, ecx
  2245. $L54311:
  2246.     push    eax
  2247.     lea    edx, DWORD PTR _pi$[esp+92]
  2248.     push    edx
  2249.     call    _rice_decode
  2250.     add    esp, 8
  2251.     test    al, 1
  2252.     je    SHORT $L54295
  2253.     inc    eax
  2254.     sar    eax, 1
  2255.     jmp    SHORT $L54296
  2256. $L54295:
  2257.     sar    eax, 1
  2258.     neg    eax
  2259. $L54296:
  2260.     test    eax, eax
  2261.     mov    ecx, eax
  2262.     jg    SHORT $L54298
  2263.     neg    ecx
  2264. $L54298:
  2265.     mov    edi, DWORD PTR _pi$[esp+132]
  2266.     add    edi, ecx
  2267.     mov    ecx, DWORD PTR _pi$[esp+128]
  2268.     inc    ecx
  2269.     cmp    ecx, 16                    ; 00000010H
  2270.     mov    DWORD PTR _pi$[esp+132], edi
  2271.     mov    DWORD PTR _pi$[esp+128], ecx
  2272.     jne    SHORT $L54316
  2273.     mov    ecx, edi
  2274.     sar    ecx, 1
  2275.     mov    DWORD PTR _pi$[esp+128], 8
  2276.     mov    DWORD PTR _pi$[esp+132], ecx
  2277. $L54316:
  2278.     mov    cl, BYTE PTR _pi$[esp+124]
  2279.     mov    edx, DWORD PTR _pi$[esp+92]
  2280.     sub    cl, al
  2281.     mov    BYTE PTR [edx], cl
  2282.     mov    eax, DWORD PTR _pi$[esp+92]
  2283.     mov    edx, DWORD PTR _pi$[esp+116]
  2284.     mov    ecx, DWORD PTR _j$[esp+84]
  2285.     mov    esi, DWORD PTR _pi$[esp+112]
  2286.     add    eax, edx
  2287.     inc    ecx
  2288.     cmp    ecx, esi
  2289.     mov    DWORD PTR _pi$[esp+92], eax
  2290.     mov    DWORD PTR _j$[esp+84], ecx
  2291.     jl    $L53743
  2292. $L53741:
  2293. ; Line 745
  2294.     mov    eax, DWORD PTR _i$[esp+84]
  2295.     mov    ecx, DWORD PTR _pi$[esp+108]
  2296.     inc    eax
  2297.     cmp    eax, ecx
  2298.     mov    DWORD PTR _i$[esp+84], eax
  2299.     jl    $L54325
  2300. $L54323:
  2301. ; Line 755
  2302.     mov    eax, DWORD PTR _pi$[esp+88]
  2303.     pop    edi
  2304.     pop    esi
  2305.     pop    ebp
  2306.     pop    ebx
  2307. ; Line 757
  2308.     add    esp, 72                    ; 00000048H
  2309.     ret    0
  2310. _loco_codec_decompress ENDP
  2311. ; Function compile flags: /Ogty
  2312. _TEXT    ENDS
  2313. ;    COMDAT _rice_decode
  2314. _TEXT    SEGMENT
  2315. _pip$ = 8
  2316. _log_b$ = 12
  2317. _rice_decode PROC NEAR                    ; COMDAT
  2318. ; Line 203
  2319.     mov    edx, DWORD PTR _pip$[esp-4]
  2320.     mov    eax, DWORD PTR [edx+52]
  2321.     test    eax, eax
  2322.     jle    SHORT $L53414
  2323. ; Line 205
  2324.     dec    eax
  2325.     mov    DWORD PTR [edx+52], eax
  2326. ; Line 206
  2327.     xor    eax, eax
  2328. ; Line 231
  2329.     ret    0
  2330. $L53414:
  2331.     push    ebx
  2332.     push    ebp
  2333.     push    esi
  2334.     push    edi
  2335. ; Line 209
  2336.     xor    edi, edi
  2337.     mov    ebp, 8
  2338. ; Line 231
  2339.     npad    3
  2340. ; Line 209
  2341. $L53415:
  2342.     mov    eax, DWORD PTR [edx+16]
  2343.     test    eax, eax
  2344.     jne    SHORT $L54332
  2345.     mov    eax, DWORD PTR [edx]
  2346.     mov    cl, BYTE PTR [eax]
  2347.     inc    eax
  2348.     mov    BYTE PTR [edx+12], cl
  2349.     mov    DWORD PTR [edx], eax
  2350.     mov    DWORD PTR [edx+16], ebp
  2351. $L54332:
  2352.     mov    eax, DWORD PTR [edx+16]
  2353.     dec    eax
  2354.     mov    esi, eax
  2355.     mov    DWORD PTR [edx+16], eax
  2356.     mov    ecx, esi
  2357.     mov    eax, 1
  2358.     shl    eax, cl
  2359.     movzx    ecx, BYTE PTR [edx+12]
  2360.     test    eax, ecx
  2361.     jg    SHORT $L53417
  2362.     inc    edi
  2363.     jmp    SHORT $L53415
  2364. $L53417:
  2365. ; Line 210
  2366.     mov    ecx, DWORD PTR _log_b$[esp+12]
  2367.     shl    edi, cl
  2368.     mov    eax, edi
  2369. ; Line 211
  2370.     lea    edi, DWORD PTR [ecx-1]
  2371.     test    edi, edi
  2372.     jl    SHORT $L53420
  2373. $L53418:
  2374.     test    esi, esi
  2375.     jne    SHORT $L54336
  2376.     mov    ecx, DWORD PTR [edx]
  2377.     mov    bl, BYTE PTR [ecx]
  2378.     inc    ecx
  2379.     mov    esi, 8
  2380.     mov    BYTE PTR [edx+12], bl
  2381.     mov    DWORD PTR [edx], ecx
  2382.     mov    DWORD PTR [edx+16], esi
  2383. $L54336:
  2384.     mov    ecx, DWORD PTR [edx+16]
  2385.     dec    ecx
  2386.     mov    ebx, 1
  2387.     shl    ebx, cl
  2388.     mov    DWORD PTR [edx+16], ecx
  2389.     mov    esi, ecx
  2390.     movzx    ecx, BYTE PTR [edx+12]
  2391.     test    ebx, ecx
  2392.     mov    ebx, 0
  2393.     setg    bl
  2394.     mov    ecx, edi
  2395.     shl    ebx, cl
  2396.     or    eax, ebx
  2397.     dec    edi
  2398.     jns    SHORT $L53418
  2399. $L53420:
  2400. ; Line 212
  2401.     xor    edi, edi
  2402.     cmp    eax, edi
  2403.     jne    $L53421
  2404. ; Line 214
  2405.     mov    ebp, DWORD PTR [edx+56]
  2406.     cmp    ebp, edi
  2407.     jl    $L53422
  2408. $L53423:
  2409. ; Line 216
  2410.     test    esi, esi
  2411.     jne    SHORT $L54340
  2412.     mov    ecx, DWORD PTR [edx]
  2413.     mov    bl, BYTE PTR [ecx]
  2414.     inc    ecx
  2415.     mov    esi, 8
  2416.     mov    BYTE PTR [edx+12], bl
  2417.     mov    DWORD PTR [edx], ecx
  2418.     mov    DWORD PTR [edx+16], esi
  2419. $L54340:
  2420.     mov    ecx, DWORD PTR [edx+16]
  2421.     dec    ecx
  2422.     mov    ebx, 1
  2423.     shl    ebx, cl
  2424.     mov    DWORD PTR [edx+16], ecx
  2425.     mov    esi, ecx
  2426.     movzx    ecx, BYTE PTR [edx+12]
  2427.     test    ebx, ecx
  2428.     jg    SHORT $L53425
  2429.     inc    edi
  2430.     jmp    SHORT $L53423
  2431. $L53425:
  2432. ; Line 217
  2433.     lea    ecx, DWORD PTR [edi*4]
  2434.     mov    DWORD PTR [edx+52], ecx
  2435. ; Line 218
  2436.     mov    edi, 1
  2437. $L53426:
  2438.     test    esi, esi
  2439.     jne    SHORT $L54344
  2440.     mov    ecx, DWORD PTR [edx]
  2441.     mov    bl, BYTE PTR [ecx]
  2442.     inc    ecx
  2443.     mov    esi, 8
  2444.     mov    BYTE PTR [edx+12], bl
  2445.     mov    DWORD PTR [edx], ecx
  2446.     mov    DWORD PTR [edx+16], esi
  2447. $L54344:
  2448.     mov    esi, DWORD PTR [edx+16]
  2449.     dec    esi
  2450.     mov    ecx, esi
  2451.     mov    ebx, 1
  2452.     shl    ebx, cl
  2453.     movzx    ecx, BYTE PTR [edx+12]
  2454.     test    ebx, ecx
  2455.     mov    ebx, 0
  2456.     setg    bl
  2457.     mov    ecx, edi
  2458.     mov    DWORD PTR [edx+16], esi
  2459.     shl    ebx, cl
  2460.     mov    ecx, DWORD PTR [edx+52]
  2461.     or    ecx, ebx
  2462.     dec    edi
  2463.     mov    DWORD PTR [edx+52], ecx
  2464.     jns    SHORT $L53426
  2465. ; Line 219
  2466.     cmp    ecx, 1
  2467.     jle    SHORT $L53429
  2468.     pop    edi
  2469.     pop    esi
  2470.     lea    ecx, DWORD PTR [ecx+ebp+1]
  2471.     pop    ebp
  2472.     mov    DWORD PTR [edx+56], ecx
  2473.     pop    ebx
  2474. ; Line 231
  2475.     ret    0
  2476. $L53429:
  2477.     pop    edi
  2478. ; Line 220
  2479.     add    ebp, -3                    ; fffffffdH
  2480.     pop    esi
  2481.     mov    DWORD PTR [edx+56], ebp
  2482.     pop    ebp
  2483.     pop    ebx
  2484. ; Line 231
  2485.     ret    0
  2486. $L53422:
  2487. ; Line 222
  2488.     mov    ecx, DWORD PTR [edx+60]
  2489.     pop    edi
  2490.     pop    esi
  2491.     inc    ecx
  2492.     pop    ebp
  2493.     mov    DWORD PTR [edx+60], ecx
  2494.     pop    ebx
  2495. ; Line 231
  2496.     ret    0
  2497. $L53421:
  2498. ; Line 224
  2499.     mov    ecx, DWORD PTR [edx+60]
  2500.     cmp    ecx, edi
  2501.     jle    SHORT $L53433
  2502. ; Line 226
  2503.     cmp    ecx, 2
  2504.     jle    SHORT $L53434
  2505.     mov    esi, DWORD PTR [edx+56]
  2506.     add    esi, ecx
  2507. ; Line 228
  2508.     mov    DWORD PTR [edx+60], edi
  2509.     pop    edi
  2510.     mov    DWORD PTR [edx+56], esi
  2511.     pop    esi
  2512.     pop    ebp
  2513.     pop    ebx
  2514. ; Line 231
  2515.     ret    0
  2516. $L53434:
  2517. ; Line 227
  2518.     add    DWORD PTR [edx+56], -3            ; fffffffdH
  2519. ; Line 228
  2520.     mov    DWORD PTR [edx+60], edi
  2521. $L53433:
  2522.     pop    edi
  2523.     pop    esi
  2524.     pop    ebp
  2525.     pop    ebx
  2526. ; Line 231
  2527.     ret    0
  2528. _rice_decode ENDP
  2529. _TEXT    ENDS
  2530. END
  2531.