home *** CD-ROM | disk | FTP | other *** search
- ; Listing generated by Microsoft (R) Optimizing Compiler Version 12.00.9044.0
-
- TITLE loco.c
- .386P
- include listing.inc
- if @Version gt 510
- .model FLAT
- else
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- _DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
- _DATA ENDS
- CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
- CONST ENDS
- _BSS SEGMENT DWORD USE32 PUBLIC 'BSS'
- _BSS ENDS
- $$SYMBOLS SEGMENT BYTE USE32 'DEBSYM'
- $$SYMBOLS ENDS
- _TLS SEGMENT DWORD USE32 PUBLIC 'TLS'
- _TLS ENDS
- ; COMDAT ??_C@_0O@POKJ@lococodec?4ini?$AA@
- _DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
- _DATA ENDS
- ; COMDAT ??_C@_03BGKD@log?$AA@
- _DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
- _DATA ENDS
- ; COMDAT ??_C@_05FLHP@debug?$AA@
- _DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
- _DATA ENDS
- ; COMDAT _write_bit_buffer
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _flush_bits
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _output_zero_bits
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _output_one_bit
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _copy_bits
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _input_bit
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _flush_run_length
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _rice_encode
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _rice_decode
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _calcLoco
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _calcLoco16
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _calcLocoTop
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _calcLocoLeft
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _rice_param
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _comp_one_pel
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _comp_one_pel_lossy
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _comp_16_pel
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _decomp_one_pel
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _initialize_pi
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _copyLine
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _copyLine1
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _copyLine2
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _copyLine3
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _copyLine4
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _alloc_buffers
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _loco_codec_compress
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _loco_codec_compress_lossy
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- ; COMDAT _loco_codec_decompress
- _TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
- _TEXT ENDS
- FLAT GROUP _DATA, CONST, _BSS
- ASSUME CS: FLAT, DS: FLAT, SS: FLAT
- endif
-
- INCLUDELIB LIBC
- INCLUDELIB OLDNAMES
-
- PUBLIC _copy_line_array
- _BSS SEGMENT
- _this_line DD 01H DUP (?)
- ?debug@?1??Msg@@9@9 DD 01H DUP (?) ; debug
- ?startup@?2??Msg@@9@9 DD 01H DUP (?) ; startup
- _BSS ENDS
- _DATA SEGMENT
- _copy_line_array DD FLAT:_copyLine1
- DD FLAT:_copyLine2
- DD FLAT:_copyLine3
- DD FLAT:_copyLine4
- _DATA ENDS
- PUBLIC _initialize_pi
- ; Function compile flags: /Ogty
- ; COMDAT _initialize_pi
- _TEXT SEGMENT
- _pi$ = 8
- _imageBuffer$ = 12
- _outBuffer$ = 16
- _height$ = 20
- _width$ = 24
- _xOffset$ = 28
- _xStep$ = 32
- _yOffset$ = 36
- _yStep$ = 40
- _maxLoss$ = 44
- _initialize_pi PROC NEAR ; COMDAT
- ; File loco.c
- ; Line 510
- mov eax, DWORD PTR _height$[esp-4]
- cdq
- push ebx
- push ebp
- mov ebp, DWORD PTR _yStep$[esp+4]
- idiv ebp
- mov ebx, DWORD PTR _width$[esp+4]
- push esi
- mov esi, ebx
- imul esi, ebp
- push edi
- mov edi, DWORD PTR _xStep$[esp+12]
- mov ecx, DWORD PTR _pi$[esp+12]
- mov DWORD PTR [ecx+32], esi
- ; Line 513
- imul esi, DWORD PTR _yOffset$[esp+12]
- mov ebp, eax
- mov eax, DWORD PTR _yOffset$[esp+12]
- cdq
- idiv DWORD PTR _yStep$[esp+12]
- mov DWORD PTR [ecx+28], edi
- ; Line 519
- mov DWORD PTR [ecx+44], 8
- ; Line 520
- mov DWORD PTR [ecx+40], 1
- sub ebp, eax
- mov eax, ebx
- cdq
- idiv edi
- mov ebx, DWORD PTR _xOffset$[esp+12]
- mov DWORD PTR [ecx+20], ebp
- mov ebp, eax
- mov eax, ebx
- cdq
- idiv edi
- mov edx, DWORD PTR _maxLoss$[esp+12]
- pop edi
- mov DWORD PTR [ecx+48], edx
- sub ebp, eax
- mov eax, DWORD PTR _outBuffer$[esp+8]
- mov DWORD PTR [ecx], eax
- add esi, DWORD PTR _imageBuffer$[esp+8]
- add esi, ebx
- xor eax, eax
- mov DWORD PTR [ecx+4], esi
- mov DWORD PTR [ecx+8], esi
- pop esi
- mov DWORD PTR [ecx+24], ebp
- pop ebp
- mov DWORD PTR [ecx+16], eax
- mov BYTE PTR [ecx+12], al
- ; Line 521
- mov DWORD PTR [ecx+52], eax
- ; Line 522
- mov DWORD PTR [ecx+60], eax
- ; Line 523
- mov DWORD PTR [ecx+56], eax
- pop ebx
- ; Line 525
- ret 0
- _initialize_pi ENDP
- ; Function compile flags: /Ogty
- _TEXT ENDS
- ; COMDAT _copyLine1
- _TEXT SEGMENT
- _dest$ = 8
- _src$ = 12
- _xOffset$ = 16
- _width$ = 20
- _end_ptr$ = 20
- _copyLine1 PROC NEAR ; COMDAT
- ; Line 538
- push ebp
- mov ebp, esp
- ; Line 543
- mov edx, DWORD PTR _width$[ebp]
- ; Line 544
- lea eax, DWORD PTR [edx-1]
- and eax, -2147483633 ; 8000000fH
- mov ecx, edx
- jns SHORT $L53793
- dec eax
- or eax, -16 ; fffffff0H
- inc eax
- $L53793:
- je SHORT $L53573
- ; Line 546
- mov ecx, edx
- sub ecx, eax
- $L53573:
- push ebx
- push edi
- ; Line 548
- mov edi, DWORD PTR _dest$[ebp]
- lea eax, DWORD PTR [ecx+edi]
- mov DWORD PTR _end_ptr$[ebp], eax
- ; Line 550
- mov eax, DWORD PTR _dest$[ebp]
- ; Line 551
- mov ebx, DWORD PTR _xOffset$[ebp+ebp]
- $START_LOOP_1$53574:
- ; Line 553
- movdqu xmm0, XMMWORD PTR [ebx]
- ; Line 554
- add ebx, 16 ; 00000010H
- ; Line 555
- movdqa XMMWORD PTR [eax], xmm0
- ; Line 556
- add eax, 16 ; 00000010H
- ; Line 557
- cmp eax, DWORD PTR _end_ptr$[ebp]
- ; Line 558
- jl SHORT $START_LOOP_1$53574
- ; Line 560
- cmp ecx, edx
- mov eax, ecx
- jge SHORT $L53577
- mov ecx, DWORD PTR _xOffset$[ebp]
- push esi
- mov esi, DWORD PTR _src$[ebp]
- add esi, ecx
- $L53575:
- ; Line 562
- mov cl, BYTE PTR [esi+eax]
- mov BYTE PTR [eax+edi], cl
- inc eax
- cmp eax, edx
- jl SHORT $L53575
- pop esi
- $L53577:
- pop edi
- pop ebx
- ; Line 567
- pop ebp
- ret 0
- _copyLine1 ENDP
- ; Function compile flags: /Ogty
- _TEXT ENDS
- ; COMDAT _copyLine2
- _TEXT SEGMENT
- _copyLine2 PROC NEAR ; COMDAT
- ; Line 575
- ret 0
- _copyLine2 ENDP
- ; Function compile flags: /Ogty
- _TEXT ENDS
- ; COMDAT _copyLine3
- _TEXT SEGMENT
- _copyLine3 PROC NEAR ; COMDAT
- ; Line 583
- ret 0
- _copyLine3 ENDP
- ; Function compile flags: /Ogty
- _TEXT ENDS
- ; COMDAT _copyLine4
- _TEXT SEGMENT
- _copyLine4 PROC NEAR ; COMDAT
- ; Line 591
- ret 0
- _copyLine4 ENDP
- _TEXT ENDS
- PUBLIC _loco_codec_compress
- EXTRN _free:NEAR
- EXTRN _malloc:NEAR
- ; Function compile flags: /Ogty
- ; COMDAT _loco_codec_compress
- _TEXT SEGMENT
- _minab$53865 = 32
- _inBuffer$ = 8
- _outBuffer$ = 12
- _height$ = 16
- _width$ = 20
- _xOffset$ = 24
- _xStep$ = 28
- _yOffset$ = 32
- _yStep$ = 36
- _i$ = 20
- _j$ = 28
- _end$ = 36
- _pi$ = -72
- _currentBuffer$ = 12
- _prevBuffer$ = 16
- _tmp_buffer$ = -76
- _copy_line_ptr$ = -92
- _prev$53837 = -80
- _curr$53838 = -84
- _coded$53839 = 32
- _abs_err$53840 = -88
- _loco_codec_compress PROC NEAR ; COMDAT
- ; Line 607
- sub esp, 92 ; 0000005cH
- ; Line 616
- mov ecx, DWORD PTR _yStep$[esp+88]
- mov edx, DWORD PTR _yOffset$[esp+88]
- mov eax, DWORD PTR _xStep$[esp+88]
- push ebx
- mov ebx, DWORD PTR _copy_line_array[eax*4-4]
- push ebp
- mov ebp, DWORD PTR _xOffset$[esp+96]
- push esi
- push edi
- push 0
- push ecx
- mov ecx, DWORD PTR _height$[esp+112]
- push edx
- mov edx, DWORD PTR _outBuffer$[esp+116]
- push eax
- mov eax, DWORD PTR _width$[esp+120]
- push ebp
- push eax
- mov eax, DWORD PTR _inBuffer$[esp+128]
- push ecx
- push edx
- push eax
- lea ecx, DWORD PTR _pi$[esp+144]
- push ecx
- mov DWORD PTR _copy_line_ptr$[esp+148], ebx
- call _initialize_pi
- ; Line 618
- mov edx, DWORD PTR _pi$[esp+172]
- lea eax, DWORD PTR [edx+edx+96]
- push eax
- call _malloc
- mov DWORD PTR _tmp_buffer$[esp+152], eax
- ; Line 621
- add eax, 15 ; 0000000fH
- and eax, -16 ; fffffff0H
- mov DWORD PTR _pi$[esp+220], eax
- ; Line 622
- add eax, 32 ; 00000020H
- ; Line 623
- lea edi, DWORD PTR [eax+32]
- mov DWORD PTR _pi$[esp+216], eax
- ; Line 625
- mov eax, DWORD PTR _pi$[esp+176]
- lea esi, DWORD PTR [eax+edi+15]
- ; Line 629
- lea ecx, DWORD PTR [eax-1]
- add esp, 44 ; 0000002cH
- and esi, -16 ; fffffff0H
- and ecx, -2147483633 ; 8000000fH
- mov DWORD PTR _pi$[esp+136], 1
- mov DWORD PTR _end$[esp+104], eax
- jns SHORT $L53927
- dec ecx
- or ecx, -16 ; fffffff0H
- inc ecx
- $L53927:
- je SHORT $L53663
- ; Line 631
- mov edx, eax
- sub edx, ecx
- mov DWORD PTR _end$[esp+104], edx
- $L53663:
- ; Line 633
- push eax
- mov eax, DWORD PTR _inBuffer$[esp+108]
- push ebp
- push eax
- push edi
- call ebx
- ; Line 636
- mov eax, DWORD PTR _pi$[esp+148]
- add esp, 16 ; 00000010H
- mov ecx, edi
- xor ebp, ebp
- test eax, eax
- mov DWORD PTR _pi$[esp+112], ecx
- jle $L53666
- jmp SHORT $L53664
- $L53922:
- mov ecx, DWORD PTR _pi$[esp+112]
- ; Line 671
- npad 1
- $L53664:
- ; Line 637
- test ebp, ebp
- jle SHORT $L53807
- sub ecx, DWORD PTR _pi$[esp+136]
- movzx ecx, BYTE PTR [ecx]
- mov DWORD PTR _pi$[esp+144], ecx
- jmp SHORT $L53808
- $L53807:
- mov DWORD PTR _pi$[esp+144], 128 ; 00000080H
- $L53808:
- ; Line 638
- lea edx, DWORD PTR _pi$[esp+108]
- push edx
- call _rice_param
- mov edx, DWORD PTR _pi$[esp+116]
- movzx ebx, BYTE PTR [edx]
- mov ecx, DWORD PTR _pi$[esp+148]
- sub ecx, ebx
- add edx, DWORD PTR _pi$[esp+140]
- add esp, 4
- test ecx, ecx
- mov DWORD PTR _pi$[esp+112], edx
- mov edx, ecx
- jg SHORT $L53820
- neg edx
- $L53820:
- add DWORD PTR _pi$[esp+152], edx
- mov ebx, DWORD PTR _pi$[esp+148]
- push eax
- xor eax, eax
- inc ebx
- cmp ecx, 1
- setge al
- lea ecx, DWORD PTR [edx+edx]
- lea edx, DWORD PTR _pi$[esp+112]
- mov DWORD PTR _pi$[esp+152], ebx
- sub ecx, eax
- push ecx
- push edx
- call _rice_encode
- mov eax, DWORD PTR _pi$[esp+160]
- add esp, 12 ; 0000000cH
- cmp eax, 16 ; 00000010H
- jne SHORT $L53665
- mov eax, DWORD PTR _pi$[esp+152]
- sar eax, 1
- mov DWORD PTR _pi$[esp+148], 8
- mov DWORD PTR _pi$[esp+152], eax
- $L53665:
- mov eax, DWORD PTR _pi$[esp+132]
- inc ebp
- cmp ebp, eax
- jl $L53922
- $L53666:
- ; Line 641
- mov ecx, DWORD PTR _pi$[esp+128]
- mov edx, 1
- cmp ecx, edx
- mov DWORD PTR _i$[esp+104], edx
- jle $L53669
- jmp SHORT $L53667
- $L53924:
- mov edi, DWORD PTR _currentBuffer$[esp+104]
- mov esi, DWORD PTR _prevBuffer$[esp+104]
- $L53667:
- ; Line 647
- mov ebp, DWORD PTR _inBuffer$[esp+104]
- mov ecx, edi
- mov DWORD PTR _prevBuffer$[esp+104], ecx
- mov DWORD PTR _pi$[esp+116], ecx
- mov ecx, DWORD PTR _pi$[esp+140]
- imul ecx, edx
- push eax
- mov eax, DWORD PTR _xOffset$[esp+108]
- push eax
- add ecx, ebp
- push ecx
- push esi
- mov DWORD PTR _currentBuffer$[esp+120], esi
- call DWORD PTR _copy_line_ptr$[esp+124]
- ; Line 650
- mov eax, DWORD PTR _pi$[esp+132]
- mov ecx, DWORD PTR _pi$[esp+152]
- mov DWORD PTR _pi$[esp+128], esi
- movzx edx, BYTE PTR [eax]
- add eax, ecx
- mov DWORD PTR _pi$[esp+132], eax
- ; Line 651
- lea eax, DWORD PTR _pi$[esp+124]
- push eax
- mov DWORD PTR _pi$[esp+164], edx
- call _rice_param
- mov edx, DWORD PTR _pi$[esp+132]
- movzx esi, BYTE PTR [edx]
- mov ecx, DWORD PTR _pi$[esp+164]
- sub ecx, esi
- add edx, DWORD PTR _pi$[esp+156]
- add esp, 20 ; 00000014H
- test ecx, ecx
- mov DWORD PTR _pi$[esp+112], edx
- mov edx, ecx
- jg SHORT $L53834
- neg edx
- $L53834:
- mov ebx, DWORD PTR _pi$[esp+152]
- mov edi, DWORD PTR _pi$[esp+148]
- add ebx, edx
- push eax
- xor eax, eax
- inc edi
- cmp ecx, 1
- setge al
- lea ecx, DWORD PTR [edx+edx]
- lea edx, DWORD PTR _pi$[esp+112]
- mov DWORD PTR _pi$[esp+156], ebx
- mov DWORD PTR _pi$[esp+152], edi
- sub ecx, eax
- push ecx
- push edx
- call _rice_encode
- mov eax, DWORD PTR _pi$[esp+160]
- mov edi, 16 ; 00000010H
- add esp, 12 ; 0000000cH
- cmp eax, edi
- jne SHORT $L53831
- mov eax, DWORD PTR _pi$[esp+152]
- sar eax, 1
- mov DWORD PTR _pi$[esp+148], 8
- mov DWORD PTR _pi$[esp+152], eax
- $L53831:
- ; Line 652
- mov ebp, DWORD PTR _end$[esp+104]
- cmp ebp, 1
- mov DWORD PTR _j$[esp+104], 1
- jle $L53672
- add ebp, -2 ; fffffffeH
- shr ebp, 4
- inc ebp
- mov eax, ebp
- shl eax, 4
- inc eax
- mov DWORD PTR _j$[esp+104], eax
- $L53670:
- ; Line 653
- mov eax, DWORD PTR _pi$[esp+116]
- mov ecx, DWORD PTR _pi$[esp+112]
- mov edx, DWORD PTR _pi$[esp+172]
- mov DWORD PTR _prev$53837[esp+108], eax
- mov eax, DWORD PTR _pi$[esp+176]
- mov DWORD PTR _curr$53838[esp+108], ecx
- mov DWORD PTR _coded$53839[esp+104], edx
- mov DWORD PTR _abs_err$53840[esp+108], eax
- mov eax, DWORD PTR _prev$53837[esp+108]
- movdqa xmm2, XMMWORD PTR [eax-1]
- movdqu xmm0, XMMWORD PTR [eax]
- mov ebx, DWORD PTR _curr$53838[esp+108]
- movdqa xmm1, XMMWORD PTR [ebx-1]
- movdqa xmm3, xmm0
- pminub xmm0, xmm1
- pmaxub xmm1, xmm3
- movdqa xmm4, xmm2
- pminub xmm4, xmm0
- movdqa xmm3, xmm2
- pmaxub xmm3, xmm1
- pcmpeqb xmm4, xmm2
- pcmpeqb xmm3, xmm2
- movdqa xmm7, xmm3
- por xmm7, xmm4
- pandn xmm7, xmm2
- movdqa xmm2, xmm4
- pandn xmm2, xmm0
- pandn xmm4, xmm3
- pandn xmm4, xmm1
- movdqu xmm5, XMMWORD PTR [ebx]
- pxor xmm1, xmm1
- punpcklbw xmm1, xmm2
- pslrdq xmm1, 1
- pxor xmm3, xmm3
- punpcklbw xmm3, xmm4
- pslrdq xmm3, 1
- paddsw xmm1, xmm3
- pxor xmm3, xmm3
- punpcklbw xmm3, xmm7
- pslrdq xmm3, 1
- psubsw xmm1, xmm3
- pxor xmm3, xmm3
- punpcklbw xmm3, xmm5
- pslrdq xmm3, 1
- psubsw xmm1, xmm3
- pxor xmm3, xmm3
- psubsw xmm3, xmm1
- pmaxsw xmm3, xmm1
- pxor xmm0, xmm0
- mov ebx, DWORD PTR _abs_err$53840[esp+108]
- movdqa XMMWORD PTR [ebx], xmm3
- mov eax, DWORD PTR _coded$53839[esp+104]
- psllw xmm3, 1
- pcmpgtw xmm1, xmm0
- psrlw xmm1, 15 ; 0000000fH
- psubsw xmm3, xmm1
- movdqa XMMWORD PTR [eax], xmm3
- pxor xmm3, xmm3
- punpckhbw xmm2, xmm3
- punpckhbw xmm4, xmm3
- paddsw xmm2, xmm4
- punpckhbw xmm7, xmm3
- psubsw xmm2, xmm7
- punpckhbw xmm5, xmm3
- psubsw xmm2, xmm5
- psubsw xmm3, xmm2
- pmaxsw xmm3, xmm2
- movdqa XMMWORD PTR [ebx+16], xmm3
- psllw xmm3, 1
- pcmpgtw xmm2, xmm0
- psrlw xmm2, 15 ; 0000000fH
- psubsw xmm3, xmm2
- movdqa XMMWORD PTR [eax+16], xmm3
- mov ecx, DWORD PTR _pi$[esp+116]
- mov eax, DWORD PTR _pi$[esp+112]
- add ecx, edi
- add eax, edi
- mov DWORD PTR _pi$[esp+116], ecx
- mov DWORD PTR _pi$[esp+112], eax
- xor esi, esi
- ; Line 671
- npad 4
- ; Line 654
- $L53845:
- lea ecx, DWORD PTR _pi$[esp+108]
- push ecx
- call _rice_param
- mov edx, DWORD PTR _pi$[esp+180]
- movsx ecx, WORD PTR [esi+edx]
- mov ebx, DWORD PTR _pi$[esp+156]
- mov edx, DWORD PTR _pi$[esp+152]
- add ebx, ecx
- inc edx
- mov DWORD PTR _pi$[esp+152], edx
- mov edx, DWORD PTR _pi$[esp+176]
- push eax
- mov DWORD PTR _pi$[esp+160], ebx
- movsx eax, WORD PTR [esi+edx]
- push eax
- lea ecx, DWORD PTR _pi$[esp+120]
- push ecx
- call _rice_encode
- mov eax, DWORD PTR _pi$[esp+164]
- add esp, 16 ; 00000010H
- cmp eax, edi
- jne SHORT $L53846
- mov eax, DWORD PTR _pi$[esp+152]
- sar eax, 1
- mov DWORD PTR _pi$[esp+148], 8
- mov DWORD PTR _pi$[esp+152], eax
- $L53846:
- add esi, 2
- cmp esi, 32 ; 00000020H
- jl SHORT $L53845
- ; Line 652
- dec ebp
- jne $L53670
- $L53672:
- ; Line 656
- mov eax, DWORD PTR _pi$[esp+132]
- cmp DWORD PTR _j$[esp+104], eax
- jge $L53668
- $L53673:
- ; Line 658
- mov ebx, DWORD PTR _pi$[esp+136]
- mov eax, DWORD PTR _pi$[esp+112]
- mov edi, DWORD PTR _pi$[esp+116]
- movzx ecx, BYTE PTR [edi]
- sub eax, ebx
- movzx eax, BYTE PTR [eax]
- mov edx, edi
- sub edx, ebx
- cmp ecx, eax
- movzx edx, BYTE PTR [edx]
- mov ebp, ecx
- jl SHORT $L53928
- mov ebp, eax
- $L53928:
- cmp ecx, eax
- mov DWORD PTR _minab$53865[esp+104], ebp
- mov esi, ecx
- jg SHORT $L53860
- mov esi, eax
- $L53860:
- cmp edx, esi
- jl SHORT $L53868
- mov eax, ebp
- jmp SHORT $L53871
- $L53868:
- cmp edx, DWORD PTR _minab$53865[esp+104]
- jg SHORT $L53870
- mov eax, esi
- jmp SHORT $L53871
- $L53870:
- sub eax, edx
- add eax, ecx
- $L53871:
- ; Line 659
- lea ecx, DWORD PTR _pi$[esp+108]
- add edi, ebx
- push ecx
- mov DWORD PTR _pi$[esp+120], edi
- mov DWORD PTR _pi$[esp+148], eax
- call _rice_param
- mov edx, DWORD PTR _pi$[esp+116]
- movzx esi, BYTE PTR [edx]
- mov ecx, DWORD PTR _pi$[esp+148]
- sub ecx, esi
- add edx, DWORD PTR _pi$[esp+140]
- add esp, 4
- test ecx, ecx
- mov DWORD PTR _pi$[esp+112], edx
- mov edx, ecx
- jg SHORT $L53877
- neg edx
- $L53877:
- mov ebx, DWORD PTR _pi$[esp+152]
- mov edi, DWORD PTR _pi$[esp+148]
- add ebx, edx
- push eax
- xor eax, eax
- inc edi
- cmp ecx, 1
- setge al
- lea ecx, DWORD PTR [edx+edx]
- lea edx, DWORD PTR _pi$[esp+112]
- mov DWORD PTR _pi$[esp+156], ebx
- mov DWORD PTR _pi$[esp+152], edi
- sub ecx, eax
- push ecx
- push edx
- call _rice_encode
- mov eax, DWORD PTR _pi$[esp+160]
- add esp, 12 ; 0000000cH
- cmp eax, 16 ; 00000010H
- jne SHORT $L53674
- mov eax, DWORD PTR _pi$[esp+152]
- sar eax, 1
- mov DWORD PTR _pi$[esp+148], 8
- mov DWORD PTR _pi$[esp+152], eax
- $L53674:
- mov ecx, DWORD PTR _j$[esp+104]
- mov eax, DWORD PTR _pi$[esp+132]
- inc ecx
- cmp ecx, eax
- mov DWORD PTR _j$[esp+104], ecx
- jl $L53673
- $L53668:
- ; Line 641
- mov edx, DWORD PTR _i$[esp+104]
- mov ecx, DWORD PTR _pi$[esp+128]
- inc edx
- cmp edx, ecx
- mov DWORD PTR _i$[esp+104], edx
- jl $L53924
- $L53669:
- ; Line 666
- mov eax, DWORD PTR _pi$[esp+160]
- xor edi, edi
- cmp eax, edi
- jle SHORT $L53895
- cmp DWORD PTR _pi$[esp+164], edi
- jl SHORT $L53895
- mov ecx, DWORD PTR _pi$[esp+124]
- dec eax
- mov esi, eax
- sar eax, 2
- add ecx, eax
- and esi, 3
- cmp ecx, 8
- mov DWORD PTR _pi$[esp+124], ecx
- jb SHORT $L53893
- mov cl, BYTE PTR _pi$[esp+120]
- ; Line 671
- npad 5
- ; Line 666
- $L53892:
- mov eax, DWORD PTR _pi$[esp+108]
- mov BYTE PTR [eax], cl
- mov eax, DWORD PTR _pi$[esp+124]
- mov ebp, DWORD PTR _pi$[esp+108]
- sub eax, 8
- inc ebp
- xor cl, cl
- cmp eax, 8
- mov DWORD PTR _pi$[esp+108], ebp
- mov DWORD PTR _pi$[esp+124], eax
- jae SHORT $L53892
- mov BYTE PTR _pi$[esp+120], cl
- $L53893:
- lea ecx, DWORD PTR _pi$[esp+108]
- push ecx
- call _output_one_bit
- push 2
- lea edx, DWORD PTR _pi$[esp+116]
- push esi
- push edx
- call _copy_bits
- mov eax, DWORD PTR _pi$[esp+176]
- add esp, 16 ; 00000010H
- $L53895:
- cmp eax, 2
- jle SHORT $L53899
- add DWORD PTR _pi$[esp+164], eax
- jmp SHORT $L53900
- $L53899:
- sub DWORD PTR _pi$[esp+164], 3
- $L53900:
- ; Line 667
- cmp DWORD PTR _pi$[esp+124], edi
- mov DWORD PTR _pi$[esp+160], edi
- jbe SHORT $L53907
- mov eax, DWORD PTR _pi$[esp+108]
- mov cl, BYTE PTR _pi$[esp+120]
- mov BYTE PTR [eax], cl
- inc DWORD PTR _pi$[esp+108]
- mov DWORD PTR _pi$[esp+124], edi
- mov BYTE PTR _pi$[esp+120], 0
- $L53907:
- ; Line 668
- mov edx, DWORD PTR _tmp_buffer$[esp+108]
- push edx
- call _free
- ; Line 670
- mov eax, DWORD PTR _pi$[esp+112]
- add esp, 4
- pop edi
- pop esi
- pop ebp
- pop ebx
- ; Line 671
- add esp, 92 ; 0000005cH
- ret 0
- _loco_codec_compress ENDP
- ; Function compile flags: /Ogty
- _TEXT ENDS
- ; COMDAT _output_one_bit
- _TEXT SEGMENT
- _pi$ = 8
- _output_one_bit PROC NEAR ; COMDAT
- ; Line 104
- mov eax, DWORD PTR _pi$[esp-4]
- push esi
- mov esi, DWORD PTR [eax+16]
- mov ecx, 7
- sub ecx, esi
- mov dl, 1
- shl dl, cl
- or BYTE PTR [eax+12], dl
- ; Line 105
- lea ecx, DWORD PTR [esi+1]
- ; Line 107
- cmp ecx, 8
- mov DWORD PTR [eax+16], ecx
- pop esi
- jne SHORT $L53933
- ; Line 108
- mov ecx, DWORD PTR [eax]
- mov dl, BYTE PTR [eax+12]
- mov BYTE PTR [ecx], dl
- inc DWORD PTR [eax]
- xor ecx, ecx
- mov DWORD PTR [eax+16], ecx
- mov BYTE PTR [eax+12], cl
- $L53933:
- ; Line 109
- ret 0
- _output_one_bit ENDP
- ; Function compile flags: /Ogty
- _TEXT ENDS
- ; COMDAT _copy_bits
- _TEXT SEGMENT
- _pi$ = 8
- _from$ = 12
- _len$ = 16
- _copy_bits PROC NEAR ; COMDAT
- ; Line 112
- push ebx
- push esi
- ; Line 113
- mov esi, DWORD PTR _len$[esp+4]
- xor ebx, ebx
- cmp esi, ebx
- push edi
- je $L53938
- ; Line 114
- mov edx, DWORD PTR _from$[esp+8]
- mov ecx, esi
- mov eax, 1
- shl eax, cl
- ; Line 115
- mov ecx, 8
- dec eax
- and edx, eax
- mov eax, DWORD PTR _pi$[esp+8]
- sub ecx, DWORD PTR [eax+16]
- cmp esi, ecx
- jbe SHORT $L53371
- $L53370:
- ; Line 117
- mov ecx, DWORD PTR [eax+16]
- add esi, ecx
- lea ecx, DWORD PTR [esi-8]
- mov ebx, edx
- shr ebx, cl
- mov cl, BYTE PTR [eax+12]
- ; Line 118
- add esi, -8 ; fffffff8H
- ; Line 119
- mov edi, 1
- or cl, bl
- mov BYTE PTR [eax+12], cl
- ; Line 120
- mov bl, BYTE PTR [eax+12]
- lea ecx, DWORD PTR [esi+1]
- shl edi, cl
- mov ecx, DWORD PTR [eax]
- mov BYTE PTR [ecx], bl
- ; Line 122
- xor ebx, ebx
- dec edi
- and edx, edi
- mov edi, DWORD PTR [eax]
- inc edi
- cmp esi, 8
- mov DWORD PTR [eax], edi
- mov DWORD PTR [eax+16], ebx
- ; Line 123
- mov BYTE PTR [eax+12], bl
- ja SHORT $L53370
- $L53371:
- ; Line 126
- cmp esi, ebx
- je SHORT $L53938
- ; Line 127
- mov edi, DWORD PTR [eax+16]
- mov ecx, 8
- sub ecx, edi
- sub ecx, esi
- shl dl, cl
- mov cl, BYTE PTR [eax+12]
- ; Line 128
- add esi, edi
- mov DWORD PTR [eax+16], esi
- or cl, dl
- ; Line 129
- cmp esi, 8
- mov BYTE PTR [eax+12], cl
- jne SHORT $L53938
- ; Line 130
- mov edx, DWORD PTR [eax]
- mov BYTE PTR [edx], cl
- inc DWORD PTR [eax]
- mov DWORD PTR [eax+16], ebx
- mov BYTE PTR [eax+12], bl
- $L53938:
- pop edi
- pop esi
- pop ebx
- ; Line 131
- ret 0
- _copy_bits ENDP
- ; Function compile flags: /Ogty
- _TEXT ENDS
- ; COMDAT _rice_encode
- _TEXT SEGMENT
- _pip$ = 8
- _x$ = 12
- _log_b$ = 16
- _rem$53403 = 12
- _rice_encode PROC NEAR ; COMDAT
- ; Line 172
- mov eax, DWORD PTR _x$[esp-4]
- test eax, eax
- push ebx
- push ebp
- push esi
- push edi
- jne $L53398
- ; Line 174
- mov eax, DWORD PTR _pip$[esp+12]
- mov ecx, DWORD PTR [eax+52]
- test ecx, ecx
- je SHORT $L53400
- mov ecx, DWORD PTR [eax+56]
- test ecx, ecx
- jge SHORT $L53956
- $L53400:
- ; Line 176
- mov esi, DWORD PTR [eax+16]
- mov bl, BYTE PTR [eax+12]
- mov ecx, 7
- sub ecx, esi
- mov dl, 1
- shl dl, cl
- lea ecx, DWORD PTR [esi+1]
- mov DWORD PTR [eax+16], ecx
- or bl, dl
- cmp ecx, 8
- mov BYTE PTR [eax+12], bl
- jne SHORT $L53949
- mov ecx, DWORD PTR [eax]
- mov dl, bl
- mov BYTE PTR [ecx], dl
- inc DWORD PTR [eax]
- mov DWORD PTR [eax+16], 0
- mov BYTE PTR [eax+12], 0
- $L53949:
- ; Line 177
- mov ecx, DWORD PTR _log_b$[esp+12]
- mov edx, DWORD PTR [eax+16]
- add edx, ecx
- mov ecx, edx
- cmp ecx, 8
- mov DWORD PTR [eax+16], edx
- jb SHORT $L53956
- ; Line 195
- npad 7
- ; Line 177
- $L53955:
- mov cl, BYTE PTR [eax+12]
- mov edx, DWORD PTR [eax]
- mov BYTE PTR [edx], cl
- mov esi, DWORD PTR [eax+16]
- mov edi, DWORD PTR [eax]
- add esi, -8 ; fffffff8H
- inc edi
- mov ecx, esi
- cmp ecx, 8
- mov DWORD PTR [eax], edi
- mov DWORD PTR [eax+16], esi
- mov BYTE PTR [eax+12], 0
- jae SHORT $L53955
- $L53956:
- ; Line 179
- mov ecx, DWORD PTR [eax+52]
- pop edi
- pop esi
- inc ecx
- pop ebp
- mov DWORD PTR [eax+52], ecx
- pop ebx
- ; Line 195
- ret 0
- $L53398:
- ; Line 183
- mov ecx, DWORD PTR _log_b$[esp+12]
- ; Line 185
- mov esi, DWORD PTR _pip$[esp+12]
- mov edx, 1
- shl edx, cl
- mov edi, eax
- shr edi, cl
- lea ebx, DWORD PTR [edx-1]
- mov ecx, ebx
- and ecx, eax
- mov eax, DWORD PTR [esi+52]
- test eax, eax
- mov DWORD PTR _rem$53403[esp+12], ecx
- jle $L53975
- ; Line 187
- mov ecx, DWORD PTR [esi+56]
- test ecx, ecx
- jl SHORT $L53976
- mov ecx, DWORD PTR [esi+16]
- dec eax
- mov ebp, eax
- sar eax, 2
- add ecx, eax
- mov eax, ecx
- and ebp, 3
- cmp eax, 8
- mov DWORD PTR [esi+16], ecx
- jb SHORT $L53971
- $L53970:
- mov eax, DWORD PTR [esi]
- mov cl, BYTE PTR [esi+12]
- mov BYTE PTR [eax], cl
- mov eax, DWORD PTR [esi]
- mov edx, DWORD PTR [esi+16]
- inc eax
- add edx, -8 ; fffffff8H
- mov DWORD PTR [esi], eax
- mov eax, edx
- cmp eax, 8
- mov DWORD PTR [esi+16], edx
- mov BYTE PTR [esi+12], 0
- jae SHORT $L53970
- $L53971:
- mov eax, DWORD PTR [esi+16]
- mov ecx, 7
- sub ecx, eax
- mov dl, 1
- shl dl, cl
- mov cl, BYTE PTR [esi+12]
- or cl, dl
- inc eax
- cmp eax, 8
- mov BYTE PTR [esi+12], cl
- mov DWORD PTR [esi+16], eax
- jne SHORT $L53974
- push esi
- call _write_bit_buffer
- add esp, 4
- $L53974:
- push 2
- push ebp
- push esi
- call _copy_bits
- add esp, 12 ; 0000000cH
- $L53976:
- mov eax, DWORD PTR [esi+52]
- cmp eax, 2
- jle SHORT $L53980
- add DWORD PTR [esi+56], eax
- jmp SHORT $L53981
- $L53980:
- add DWORD PTR [esi+56], -3 ; fffffffdH
- $L53981:
- mov DWORD PTR [esi+52], 0
- $L53975:
- ; Line 189
- mov ecx, DWORD PTR [esi+16]
- add ecx, edi
- mov eax, ecx
- cmp eax, 8
- mov DWORD PTR [esi+16], ecx
- jb SHORT $L53986
- ; Line 195
- npad 1
- ; Line 189
- $L53985:
- mov eax, DWORD PTR [esi]
- mov cl, BYTE PTR [esi+12]
- mov BYTE PTR [eax], cl
- mov edx, DWORD PTR [esi+16]
- mov edi, DWORD PTR [esi]
- add edx, -8 ; fffffff8H
- inc edi
- mov eax, edx
- cmp eax, 8
- mov DWORD PTR [esi], edi
- mov DWORD PTR [esi+16], edx
- mov BYTE PTR [esi+12], 0
- jae SHORT $L53985
- $L53986:
- ; Line 190
- mov eax, DWORD PTR [esi+16]
- mov ecx, 7
- sub ecx, eax
- mov dl, 1
- shl dl, cl
- mov cl, BYTE PTR [esi+12]
- or cl, dl
- inc eax
- cmp eax, 8
- mov BYTE PTR [esi+12], cl
- mov DWORD PTR [esi+16], eax
- jne SHORT $L54019
- mov eax, DWORD PTR [esi]
- mov BYTE PTR [eax], cl
- mov eax, DWORD PTR [esi]
- inc eax
- xor ebp, ebp
- mov DWORD PTR [esi], eax
- mov DWORD PTR [esi+16], ebp
- mov BYTE PTR [esi+12], 0
- jmp SHORT $L53993
- $L54019:
- xor ebp, ebp
- $L53993:
- ; Line 192
- mov eax, DWORD PTR _log_b$[esp+12]
- cmp eax, ebp
- je $L54002
- and ebx, DWORD PTR _rem$53403[esp+12]
- mov edx, ebx
- mov ebx, DWORD PTR [esi+16]
- mov ecx, 8
- sub ecx, ebx
- cmp eax, ecx
- jbe SHORT $L54006
- $L54005:
- mov ecx, DWORD PTR [esi+16]
- lea edi, DWORD PTR [ecx+eax]
- lea ecx, DWORD PTR [edi-8]
- mov eax, edx
- shr eax, cl
- mov cl, BYTE PTR [esi+12]
- or cl, al
- lea eax, DWORD PTR [edi-8]
- mov BYTE PTR [esi+12], cl
- mov bl, BYTE PTR [esi+12]
- lea ecx, DWORD PTR [eax+1]
- mov edi, 1
- shl edi, cl
- mov ecx, DWORD PTR [esi]
- mov BYTE PTR [ecx], bl
- mov DWORD PTR [esi+16], ebp
- dec edi
- and edx, edi
- mov edi, DWORD PTR [esi]
- inc edi
- cmp eax, 8
- mov DWORD PTR [esi], edi
- mov BYTE PTR [esi+12], 0
- ja SHORT $L54005
- $L54006:
- cmp eax, ebp
- je SHORT $L54002
- mov edi, DWORD PTR [esi+16]
- mov bl, BYTE PTR [esi+12]
- mov ecx, 8
- sub ecx, edi
- sub ecx, eax
- shl dl, cl
- add eax, edi
- mov DWORD PTR [esi+16], eax
- or bl, dl
- cmp eax, 8
- mov BYTE PTR [esi+12], bl
- jne SHORT $L54002
- mov edx, DWORD PTR [esi]
- mov al, bl
- mov BYTE PTR [edx], al
- inc DWORD PTR [esi]
- mov DWORD PTR [esi+16], ebp
- mov BYTE PTR [esi+12], 0
- $L54002:
- pop edi
- pop esi
- pop ebp
- pop ebx
- ; Line 195
- ret 0
- _rice_encode ENDP
- ; Function compile flags: /Ogty
- _TEXT ENDS
- ; COMDAT _write_bit_buffer
- _TEXT SEGMENT
- _pi$ = 8
- _write_bit_buffer PROC NEAR ; COMDAT
- ; Line 72
- mov eax, DWORD PTR _pi$[esp-4]
- mov ecx, DWORD PTR [eax]
- mov dl, BYTE PTR [eax+12]
- mov BYTE PTR [ecx], dl
- ; Line 73
- inc DWORD PTR [eax]
- ; Line 74
- xor ecx, ecx
- mov DWORD PTR [eax+16], ecx
- ; Line 75
- mov BYTE PTR [eax+12], cl
- ; Line 77
- ret 0
- _write_bit_buffer ENDP
- ; Function compile flags: /Ogty
- _TEXT ENDS
- ; COMDAT _rice_param
- _TEXT SEGMENT
- _pip$ = 8
- _rice_param PROC NEAR ; COMDAT
- ; Line 381
- mov eax, DWORD PTR _pip$[esp-4]
- mov ecx, DWORD PTR [eax+40]
- ; Line 382
- mov eax, DWORD PTR [eax+44]
- ; Line 384
- cmp ecx, eax
- jl SHORT $L53476
- xor eax, eax
- ; Line 394
- ret 0
- $L53476:
- ; Line 385
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L53477
- mov eax, 1
- ; Line 394
- ret 0
- $L53477:
- ; Line 386
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L53478
- mov eax, 2
- ; Line 394
- ret 0
- $L53478:
- ; Line 387
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L53479
- mov eax, 3
- ; Line 394
- ret 0
- $L53479:
- ; Line 388
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L53480
- mov eax, 4
- ; Line 394
- ret 0
- $L53480:
- ; Line 389
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L53481
- mov eax, 5
- ; Line 394
- ret 0
- $L53481:
- ; Line 390
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L53482
- mov eax, 6
- ; Line 394
- ret 0
- $L53482:
- ; Line 391
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L53483
- mov eax, 7
- ; Line 394
- ret 0
- $L53483:
- ; Line 392
- xor edx, edx
- add ecx, ecx
- cmp ecx, eax
- setl dl
- add edx, 8
- mov eax, edx
- ; Line 394
- ret 0
- _rice_param ENDP
- _TEXT ENDS
- PUBLIC _loco_codec_compress_lossy
- ; Function compile flags: /Ogty
- ; COMDAT _loco_codec_compress_lossy
- _TEXT SEGMENT
- _minab$54097 = 32
- _maxab$54098 = 20
- _inBuffer$ = 8
- _outBuffer$ = 12
- _height$ = 16
- _width$ = 20
- _xOffset$ = 24
- _xStep$ = 28
- _yOffset$ = 32
- _yStep$ = 36
- _maxLoss$ = 40
- _i$ = 16
- _j$ = 36
- _pi$ = -72
- _currentBuffer$ = 40
- _prevBuffer$ = 12
- _tmp_buffer$ = -76
- _loco_codec_compress_lossy PROC NEAR ; COMDAT
- ; Line 681
- mov eax, DWORD PTR _maxLoss$[esp-4]
- sub esp, 76 ; 0000004cH
- test eax, eax
- jne SHORT $L53702
- ; Line 682
- mov eax, DWORD PTR _yStep$[esp+72]
- mov ecx, DWORD PTR _yOffset$[esp+72]
- mov edx, DWORD PTR _xStep$[esp+72]
- push eax
- mov eax, DWORD PTR _xOffset$[esp+76]
- push ecx
- mov ecx, DWORD PTR _width$[esp+80]
- push edx
- mov edx, DWORD PTR _height$[esp+84]
- push eax
- mov eax, DWORD PTR _outBuffer$[esp+88]
- push ecx
- mov ecx, DWORD PTR _inBuffer$[esp+92]
- push edx
- push eax
- push ecx
- call _loco_codec_compress
- add esp, 32 ; 00000020H
- ; Line 730
- add esp, 76 ; 0000004cH
- ret 0
- $L53702:
- ; Line 684
- mov edx, DWORD PTR _yStep$[esp+72]
- mov ecx, DWORD PTR _width$[esp+72]
- push ebx
- mov ebx, DWORD PTR _xOffset$[esp+76]
- push ebp
- push esi
- mov esi, DWORD PTR _xStep$[esp+84]
- push edi
- push eax
- mov eax, DWORD PTR _yOffset$[esp+92]
- push edx
- mov edx, DWORD PTR _height$[esp+96]
- push eax
- mov eax, DWORD PTR _outBuffer$[esp+100]
- push esi
- push ebx
- push ecx
- mov ecx, DWORD PTR _inBuffer$[esp+112]
- push edx
- push eax
- push ecx
- lea edx, DWORD PTR _pi$[esp+128]
- push edx
- call _initialize_pi
- ; Line 686
- mov eax, DWORD PTR _pi$[esp+156]
- lea eax, DWORD PTR [eax+eax+96]
- push eax
- call _malloc
- mov DWORD PTR _tmp_buffer$[esp+136], eax
- ; Line 689
- add eax, 15 ; 0000000fH
- and eax, -16 ; fffffff0H
- mov DWORD PTR _pi$[esp+204], eax
- ; Line 690
- add eax, 32 ; 00000020H
- ; Line 691
- lea edi, DWORD PTR [eax+32]
- mov DWORD PTR _pi$[esp+200], eax
- ; Line 693
- mov eax, DWORD PTR _pi$[esp+160]
- lea ebp, DWORD PTR [eax+edi+15]
- add esp, 44 ; 0000002cH
- and ebp, -16 ; fffffff0H
- ; Line 697
- xor ecx, ecx
- test eax, eax
- mov DWORD PTR _pi$[esp+120], 1
- jle SHORT $L54037
- mov edx, DWORD PTR _inBuffer$[esp+88]
- add edx, ebx
- $L54035:
- mov bl, BYTE PTR [edx]
- mov BYTE PTR [ecx+edi], bl
- inc ecx
- add edx, esi
- cmp ecx, eax
- jl SHORT $L54035
- mov eax, DWORD PTR _pi$[esp+116]
- $L54037:
- ; Line 700
- test eax, eax
- mov ebx, edi
- mov DWORD PTR _pi$[esp+96], ebx
- mov DWORD PTR _j$[esp+88], 0
- jle $L53710
- jmp SHORT $L53708
- $L54145:
- mov ebx, DWORD PTR _pi$[esp+96]
- $L53708:
- ; Line 701
- mov eax, DWORD PTR _j$[esp+88]
- test eax, eax
- jle SHORT $L54042
- mov ecx, DWORD PTR _pi$[esp+120]
- mov eax, ebx
- sub eax, ecx
- movzx esi, BYTE PTR [eax]
- jmp SHORT $L54152
- $L54042:
- mov esi, 128 ; 00000080H
- $L54152:
- ; Line 702
- lea ecx, DWORD PTR _pi$[esp+92]
- push ecx
- mov DWORD PTR _pi$[esp+132], esi
- call _rice_param
- movzx edx, BYTE PTR [ebx]
- sub esi, edx
- add esp, 4
- test esi, esi
- mov ecx, esi
- jg SHORT $L54049
- neg ecx
- $L54049:
- cmp ecx, DWORD PTR _pi$[esp+140]
- jg SHORT $L54054
- mov cl, BYTE PTR _pi$[esp+128]
- mov BYTE PTR [ebx], cl
- mov ebx, DWORD PTR _pi$[esp+96]
- xor ecx, ecx
- jmp SHORT $L54055
- $L54054:
- add DWORD PTR _pi$[esp+136], ecx
- xor edx, edx
- cmp esi, 1
- setge dl
- add ecx, ecx
- sub ecx, edx
- $L54055:
- mov esi, DWORD PTR _pi$[esp+120]
- mov edx, DWORD PTR _pi$[esp+132]
- push eax
- add ebx, esi
- push ecx
- lea eax, DWORD PTR _pi$[esp+100]
- inc edx
- push eax
- mov DWORD PTR _pi$[esp+108], ebx
- mov DWORD PTR _pi$[esp+144], edx
- call _rice_encode
- mov eax, DWORD PTR _pi$[esp+144]
- add esp, 12 ; 0000000cH
- cmp eax, 16 ; 00000010H
- jne SHORT $L53709
- mov eax, DWORD PTR _pi$[esp+136]
- sar eax, 1
- mov DWORD PTR _pi$[esp+132], 8
- mov DWORD PTR _pi$[esp+136], eax
- $L53709:
- mov ecx, DWORD PTR _j$[esp+88]
- mov eax, DWORD PTR _pi$[esp+116]
- inc ecx
- cmp ecx, eax
- mov DWORD PTR _j$[esp+88], ecx
- jl $L54145
- $L53710:
- ; Line 705
- mov ecx, DWORD PTR _pi$[esp+112]
- mov ebx, 1
- cmp ecx, ebx
- mov DWORD PTR _i$[esp+88], ebx
- jle $L53713
- jmp SHORT $L53711
- $L54148:
- mov edi, DWORD PTR _currentBuffer$[esp+88]
- mov ebp, DWORD PTR _prevBuffer$[esp+88]
- $L53711:
- ; Line 711
- mov edx, DWORD PTR _inBuffer$[esp+88]
- mov ecx, edi
- mov DWORD PTR _prevBuffer$[esp+88], ecx
- mov DWORD PTR _pi$[esp+100], ecx
- mov ecx, DWORD PTR _pi$[esp+124]
- imul ecx, ebx
- add ecx, edx
- mov esi, ebp
- xor edx, edx
- test eax, eax
- mov DWORD PTR _currentBuffer$[esp+88], esi
- mov edi, eax
- jle SHORT $L54064
- mov eax, DWORD PTR _xOffset$[esp+88]
- add ecx, eax
- ; Line 730
- npad 2
- ; Line 711
- $L54062:
- mov al, BYTE PTR [ecx]
- mov ebp, DWORD PTR _xStep$[esp+88]
- mov BYTE PTR [edx+esi], al
- inc edx
- add ecx, ebp
- cmp edx, edi
- jl SHORT $L54062
- $L54064:
- ; Line 714
- mov eax, DWORD PTR _pi$[esp+100]
- mov ebp, DWORD PTR _pi$[esp+120]
- mov DWORD PTR _pi$[esp+96], esi
- movzx edi, BYTE PTR [eax]
- ; Line 715
- lea ecx, DWORD PTR _pi$[esp+92]
- add eax, ebp
- push ecx
- mov DWORD PTR _pi$[esp+132], edi
- mov DWORD PTR _pi$[esp+104], eax
- call _rice_param
- movzx edx, BYTE PTR [esi]
- sub edi, edx
- add esp, 4
- test edi, edi
- mov ecx, edi
- jg SHORT $L54075
- neg ecx
- $L54075:
- cmp ecx, DWORD PTR _pi$[esp+140]
- jg SHORT $L54080
- mov cl, BYTE PTR _pi$[esp+128]
- mov BYTE PTR [esi], cl
- xor ecx, ecx
- jmp SHORT $L54081
- $L54080:
- add DWORD PTR _pi$[esp+136], ecx
- xor edx, edx
- cmp edi, 1
- setge dl
- add ecx, ecx
- sub ecx, edx
- $L54081:
- mov esi, DWORD PTR _pi$[esp+96]
- mov edx, DWORD PTR _pi$[esp+120]
- mov ebp, DWORD PTR _pi$[esp+132]
- push eax
- add esi, edx
- push ecx
- lea eax, DWORD PTR _pi$[esp+100]
- inc ebp
- push eax
- mov DWORD PTR _pi$[esp+108], esi
- mov DWORD PTR _pi$[esp+144], ebp
- call _rice_encode
- mov eax, DWORD PTR _pi$[esp+144]
- add esp, 12 ; 0000000cH
- cmp eax, 16 ; 00000010H
- jne SHORT $L54082
- mov eax, DWORD PTR _pi$[esp+136]
- sar eax, 1
- mov DWORD PTR _pi$[esp+132], 8
- mov DWORD PTR _pi$[esp+136], eax
- $L54082:
- ; Line 716
- mov eax, DWORD PTR _pi$[esp+116]
- cmp eax, 1
- mov DWORD PTR _j$[esp+88], 1
- jle $L53712
- ; Line 730
- npad 7
- $L53714:
- ; Line 717
- mov ebp, DWORD PTR _pi$[esp+100]
- mov edi, DWORD PTR _pi$[esp+120]
- mov esi, DWORD PTR _pi$[esp+96]
- mov ecx, ebp
- sub ecx, edi
- movzx edx, BYTE PTR [ecx]
- movzx ecx, BYTE PTR [ebp]
- mov eax, esi
- sub eax, edi
- movzx eax, BYTE PTR [eax]
- cmp ecx, eax
- mov DWORD PTR _minab$54097[esp+88], ecx
- jl SHORT $L54091
- mov DWORD PTR _minab$54097[esp+88], eax
- mov ebx, ecx
- jg SHORT $L54154
- $L54091:
- mov ebx, eax
- $L54154:
- mov DWORD PTR _maxab$54098[esp+88], ebx
- cmp edx, ebx
- mov ebx, DWORD PTR _minab$54097[esp+88]
- jge SHORT $L54103
- cmp edx, ebx
- jg SHORT $L54102
- mov ebx, DWORD PTR _maxab$54098[esp+88]
- jmp SHORT $L54103
- $L54102:
- sub eax, edx
- add eax, ecx
- mov ebx, eax
- $L54103:
- ; Line 718
- lea ecx, DWORD PTR _pi$[esp+92]
- add ebp, edi
- push ecx
- mov DWORD PTR _pi$[esp+104], ebp
- mov DWORD PTR _pi$[esp+132], ebx
- call _rice_param
- movzx edx, BYTE PTR [esi]
- mov ecx, ebx
- sub ecx, edx
- add esp, 4
- test ecx, ecx
- mov ebp, eax
- mov edx, ecx
- jg SHORT $L54109
- neg edx
- $L54109:
- cmp edx, DWORD PTR _pi$[esp+140]
- jg SHORT $L54114
- mov BYTE PTR [esi], bl
- mov esi, DWORD PTR _pi$[esp+96]
- mov edi, DWORD PTR _pi$[esp+120]
- xor ecx, ecx
- jmp SHORT $L54115
- $L54114:
- add DWORD PTR _pi$[esp+136], edx
- xor eax, eax
- cmp ecx, 1
- setge al
- lea ecx, DWORD PTR [edx+edx]
- sub ecx, eax
- $L54115:
- mov ebx, DWORD PTR _pi$[esp+132]
- push ebp
- push ecx
- add esi, edi
- lea ecx, DWORD PTR _pi$[esp+100]
- inc ebx
- push ecx
- mov DWORD PTR _pi$[esp+108], esi
- mov DWORD PTR _pi$[esp+144], ebx
- call _rice_encode
- mov eax, DWORD PTR _pi$[esp+144]
- add esp, 12 ; 0000000cH
- cmp eax, 16 ; 00000010H
- jne SHORT $L53715
- mov eax, DWORD PTR _pi$[esp+136]
- sar eax, 1
- mov DWORD PTR _pi$[esp+132], 8
- mov DWORD PTR _pi$[esp+136], eax
- $L53715:
- mov ecx, DWORD PTR _j$[esp+88]
- mov eax, DWORD PTR _pi$[esp+116]
- inc ecx
- cmp ecx, eax
- mov DWORD PTR _j$[esp+88], ecx
- jl $L53714
- ; Line 716
- mov ebx, DWORD PTR _i$[esp+88]
- $L53712:
- ; Line 705
- mov ecx, DWORD PTR _pi$[esp+112]
- inc ebx
- cmp ebx, ecx
- mov DWORD PTR _i$[esp+88], ebx
- jl $L54148
- $L53713:
- ; Line 725
- mov esi, DWORD PTR _pi$[esp+144]
- test esi, esi
- jle SHORT $L54120
- mov eax, DWORD PTR _pi$[esp+148]
- test eax, eax
- jl SHORT $L54120
- dec esi
- mov edx, esi
- sar edx, 2
- push edx
- lea eax, DWORD PTR _pi$[esp+96]
- push eax
- call _output_zero_bits
- lea ecx, DWORD PTR _pi$[esp+100]
- push ecx
- call _output_one_bit
- push 2
- and esi, 3
- lea edx, DWORD PTR _pi$[esp+108]
- push esi
- push edx
- call _copy_bits
- mov esi, DWORD PTR _pi$[esp+168]
- add esp, 24 ; 00000018H
- $L54120:
- cmp esi, 2
- mov eax, DWORD PTR _pi$[esp+148]
- jle SHORT $L54124
- add eax, esi
- jmp SHORT $L54155
- $L54124:
- sub eax, 3
- $L54155:
- ; Line 726
- mov ecx, DWORD PTR _pi$[esp+108]
- pop edi
- pop esi
- mov DWORD PTR _pi$[esp+140], eax
- xor eax, eax
- cmp ecx, eax
- pop ebp
- mov DWORD PTR _pi$[esp+132], eax
- pop ebx
- jbe SHORT $L54132
- mov ecx, DWORD PTR _pi$[esp+76]
- mov dl, BYTE PTR _pi$[esp+88]
- mov BYTE PTR [ecx], dl
- inc DWORD PTR _pi$[esp+76]
- mov DWORD PTR _pi$[esp+92], eax
- mov BYTE PTR _pi$[esp+88], al
- $L54132:
- ; Line 727
- mov eax, DWORD PTR _tmp_buffer$[esp+76]
- push eax
- call _free
- ; Line 729
- mov eax, DWORD PTR _pi$[esp+80]
- add esp, 4
- ; Line 730
- add esp, 76 ; 0000004cH
- ret 0
- _loco_codec_compress_lossy ENDP
- ; Function compile flags: /Ogty
- _TEXT ENDS
- ; COMDAT _output_zero_bits
- _TEXT SEGMENT
- _pi$ = 8
- _bits$ = 12
- _output_zero_bits PROC NEAR ; COMDAT
- ; Line 89
- mov eax, DWORD PTR _pi$[esp-4]
- mov ecx, DWORD PTR _bits$[esp-4]
- push ebx
- mov ebx, DWORD PTR [eax+16]
- add ebx, ecx
- mov ecx, ebx
- ; Line 91
- cmp ecx, 8
- mov DWORD PTR [eax+16], ebx
- jb SHORT $L53354
- xor dl, dl
- ; Line 99
- npad 6
- $L53353:
- ; Line 93
- mov ecx, DWORD PTR [eax]
- mov bl, BYTE PTR [eax+12]
- mov BYTE PTR [ecx], bl
- ; Line 96
- mov ecx, DWORD PTR [eax+16]
- mov ebx, DWORD PTR [eax]
- add ecx, -8 ; fffffff8H
- inc ebx
- cmp ecx, 8
- mov DWORD PTR [eax], ebx
- mov DWORD PTR [eax+16], ecx
- ; Line 97
- mov BYTE PTR [eax+12], dl
- jae SHORT $L53353
- $L53354:
- pop ebx
- ; Line 99
- ret 0
- _output_zero_bits ENDP
- _TEXT ENDS
- PUBLIC _loco_codec_decompress
- ; Function compile flags: /Ogty
- ; COMDAT _loco_codec_decompress
- _TEXT SEGMENT
- _minab$54268 = 36
- _inBuffer$ = 8
- _outBuffer$ = 12
- _height$ = 16
- _width$ = 20
- _xOffset$ = 24
- _xStep$ = 28
- _yOffset$ = 32
- _yStep$ = 36
- _i$ = 28
- _j$ = 32
- _pi$ = -72
- _loco_codec_decompress PROC NEAR ; COMDAT
- ; Line 738
- mov eax, DWORD PTR _yStep$[esp-4]
- mov ecx, DWORD PTR _yOffset$[esp-4]
- mov edx, DWORD PTR _xStep$[esp-4]
- sub esp, 72 ; 00000048H
- push ebx
- push ebp
- push esi
- push edi
- push 0
- push eax
- mov eax, DWORD PTR _xOffset$[esp+92]
- push ecx
- mov ecx, DWORD PTR _width$[esp+96]
- push edx
- mov edx, DWORD PTR _height$[esp+100]
- push eax
- mov eax, DWORD PTR _inBuffer$[esp+104]
- push ecx
- mov ecx, DWORD PTR _outBuffer$[esp+108]
- push edx
- push eax
- push ecx
- lea edx, DWORD PTR _pi$[esp+124]
- push edx
- call _initialize_pi
- ; Line 740
- mov eax, DWORD PTR _pi$[esp+152]
- mov edx, DWORD PTR _pi$[esp+156]
- add esp, 40 ; 00000028H
- xor esi, esi
- test eax, eax
- mov ebp, 1
- mov ebx, 8
- jle $L53739
- mov eax, DWORD PTR _pi$[esp+92]
- mov edi, 128 ; 00000080H
- $L53737:
- ; Line 741
- test esi, esi
- jle SHORT $L54165
- sub eax, edx
- movzx eax, BYTE PTR [eax]
- mov DWORD PTR _pi$[esp+124], eax
- jmp SHORT $L54166
- $L54165:
- mov DWORD PTR _pi$[esp+124], edi
- $L54166:
- ; Line 742
- mov ecx, DWORD PTR _pi$[esp+128]
- mov eax, DWORD PTR _pi$[esp+132]
- cmp ecx, eax
- jl SHORT $L54195
- xor eax, eax
- jmp SHORT $L54203
- $L54195:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54196
- mov eax, ebp
- jmp SHORT $L54203
- $L54196:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54197
- mov eax, 2
- jmp SHORT $L54203
- $L54197:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54198
- mov eax, 3
- jmp SHORT $L54203
- $L54198:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54199
- mov eax, 4
- jmp SHORT $L54203
- $L54199:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54200
- mov eax, 5
- jmp SHORT $L54203
- $L54200:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54201
- mov eax, 6
- jmp SHORT $L54203
- $L54201:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54202
- mov eax, 7
- jmp SHORT $L54203
- $L54202:
- add ecx, ecx
- xor edx, edx
- cmp ecx, eax
- setl dl
- add edx, ebx
- mov eax, edx
- $L54203:
- push eax
- lea eax, DWORD PTR _pi$[esp+92]
- push eax
- call _rice_decode
- add esp, 8
- test al, 1
- je SHORT $L54187
- inc eax
- sar eax, 1
- jmp SHORT $L54188
- $L54187:
- sar eax, 1
- neg eax
- $L54188:
- test eax, eax
- mov ecx, eax
- jg SHORT $L54190
- neg ecx
- $L54190:
- mov edx, DWORD PTR _pi$[esp+132]
- add edx, ecx
- mov ecx, DWORD PTR _pi$[esp+128]
- inc ecx
- cmp ecx, 16 ; 00000010H
- mov DWORD PTR _pi$[esp+132], edx
- mov DWORD PTR _pi$[esp+128], ecx
- jne SHORT $L54208
- mov ecx, edx
- sar ecx, 1
- mov DWORD PTR _pi$[esp+128], ebx
- mov DWORD PTR _pi$[esp+132], ecx
- $L54208:
- mov cl, BYTE PTR _pi$[esp+124]
- mov edx, DWORD PTR _pi$[esp+92]
- sub cl, al
- mov BYTE PTR [edx], cl
- mov eax, DWORD PTR _pi$[esp+92]
- mov edx, DWORD PTR _pi$[esp+116]
- mov ecx, DWORD PTR _pi$[esp+112]
- add eax, edx
- inc esi
- cmp esi, ecx
- mov DWORD PTR _pi$[esp+92], eax
- jl $L53737
- $L53739:
- ; Line 745
- cmp DWORD PTR _pi$[esp+108], ebp
- mov DWORD PTR _i$[esp+84], ebp
- jle $L54323
- jmp SHORT $L53740
- $L54325:
- mov ebp, 1
- mov ebx, 8
- $L53740:
- ; Line 747
- mov eax, DWORD PTR _pi$[esp+96]
- movzx ecx, BYTE PTR [eax]
- add eax, edx
- mov DWORD PTR _pi$[esp+124], ecx
- ; Line 748
- mov ecx, DWORD PTR _pi$[esp+128]
- mov DWORD PTR _pi$[esp+96], eax
- mov eax, DWORD PTR _pi$[esp+132]
- cmp ecx, eax
- jl SHORT $L54240
- xor eax, eax
- jmp SHORT $L54248
- $L54240:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54241
- mov eax, ebp
- jmp SHORT $L54248
- $L54241:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54242
- mov eax, 2
- jmp SHORT $L54248
- $L54242:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54243
- mov eax, 3
- jmp SHORT $L54248
- $L54243:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54244
- mov eax, 4
- jmp SHORT $L54248
- $L54244:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54245
- mov eax, 5
- jmp SHORT $L54248
- $L54245:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54246
- mov eax, 6
- jmp SHORT $L54248
- $L54246:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54247
- mov eax, 7
- jmp SHORT $L54248
- $L54247:
- lea edx, DWORD PTR [ecx+ecx]
- xor ecx, ecx
- cmp edx, eax
- setl cl
- add ecx, ebx
- mov eax, ecx
- $L54248:
- push eax
- lea edx, DWORD PTR _pi$[esp+92]
- push edx
- call _rice_decode
- add esp, 8
- test al, 1
- je SHORT $L54232
- inc eax
- sar eax, 1
- jmp SHORT $L54233
- $L54232:
- sar eax, 1
- neg eax
- $L54233:
- test eax, eax
- mov ecx, eax
- jg SHORT $L54235
- neg ecx
- $L54235:
- mov edi, DWORD PTR _pi$[esp+132]
- add edi, ecx
- mov ecx, DWORD PTR _pi$[esp+128]
- inc ecx
- cmp ecx, 16 ; 00000010H
- mov DWORD PTR _pi$[esp+132], edi
- mov DWORD PTR _pi$[esp+128], ecx
- jne SHORT $L54253
- mov ecx, edi
- sar ecx, 1
- mov DWORD PTR _pi$[esp+128], ebx
- mov DWORD PTR _pi$[esp+132], ecx
- $L54253:
- mov cl, BYTE PTR _pi$[esp+124]
- mov edx, DWORD PTR _pi$[esp+92]
- sub cl, al
- mov BYTE PTR [edx], cl
- mov eax, DWORD PTR _pi$[esp+92]
- mov edx, DWORD PTR _pi$[esp+116]
- ; Line 749
- mov ecx, DWORD PTR _pi$[esp+112]
- add eax, edx
- cmp ecx, ebp
- mov DWORD PTR _pi$[esp+92], eax
- mov DWORD PTR _j$[esp+84], ebp
- jle $L53741
- ; Line 757
- npad 5
- $L53743:
- ; Line 750
- mov ebp, DWORD PTR _pi$[esp+96]
- mov ecx, ebp
- sub ecx, edx
- movzx esi, BYTE PTR [ecx]
- movzx ecx, BYTE PTR [ebp]
- sub eax, edx
- movzx eax, BYTE PTR [eax]
- cmp ecx, eax
- mov ebx, ecx
- jl SHORT $L54326
- mov ebx, eax
- $L54326:
- cmp ecx, eax
- mov DWORD PTR _minab$54268[esp+84], ebx
- mov edi, ecx
- jg SHORT $L54263
- mov edi, eax
- $L54263:
- cmp esi, edi
- jl SHORT $L54271
- mov eax, ebx
- jmp SHORT $L54274
- $L54271:
- cmp esi, DWORD PTR _minab$54268[esp+84]
- jg SHORT $L54273
- mov eax, edi
- jmp SHORT $L54274
- $L54273:
- sub eax, esi
- add eax, ecx
- $L54274:
- ; Line 751
- mov ecx, DWORD PTR _pi$[esp+128]
- mov DWORD PTR _pi$[esp+124], eax
- mov eax, DWORD PTR _pi$[esp+132]
- add ebp, edx
- cmp ecx, eax
- mov DWORD PTR _pi$[esp+96], ebp
- jl SHORT $L54303
- xor eax, eax
- jmp SHORT $L54311
- $L54303:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54304
- mov eax, 1
- jmp SHORT $L54311
- $L54304:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54305
- mov eax, 2
- jmp SHORT $L54311
- $L54305:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54306
- mov eax, 3
- jmp SHORT $L54311
- $L54306:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54307
- mov eax, 4
- jmp SHORT $L54311
- $L54307:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54308
- mov eax, 5
- jmp SHORT $L54311
- $L54308:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54309
- mov eax, 6
- jmp SHORT $L54311
- $L54309:
- add ecx, ecx
- cmp ecx, eax
- jl SHORT $L54310
- mov eax, 7
- jmp SHORT $L54311
- $L54310:
- lea edx, DWORD PTR [ecx+ecx]
- xor ecx, ecx
- cmp edx, eax
- setl cl
- add ecx, 8
- mov eax, ecx
- $L54311:
- push eax
- lea edx, DWORD PTR _pi$[esp+92]
- push edx
- call _rice_decode
- add esp, 8
- test al, 1
- je SHORT $L54295
- inc eax
- sar eax, 1
- jmp SHORT $L54296
- $L54295:
- sar eax, 1
- neg eax
- $L54296:
- test eax, eax
- mov ecx, eax
- jg SHORT $L54298
- neg ecx
- $L54298:
- mov edi, DWORD PTR _pi$[esp+132]
- add edi, ecx
- mov ecx, DWORD PTR _pi$[esp+128]
- inc ecx
- cmp ecx, 16 ; 00000010H
- mov DWORD PTR _pi$[esp+132], edi
- mov DWORD PTR _pi$[esp+128], ecx
- jne SHORT $L54316
- mov ecx, edi
- sar ecx, 1
- mov DWORD PTR _pi$[esp+128], 8
- mov DWORD PTR _pi$[esp+132], ecx
- $L54316:
- mov cl, BYTE PTR _pi$[esp+124]
- mov edx, DWORD PTR _pi$[esp+92]
- sub cl, al
- mov BYTE PTR [edx], cl
- mov eax, DWORD PTR _pi$[esp+92]
- mov edx, DWORD PTR _pi$[esp+116]
- mov ecx, DWORD PTR _j$[esp+84]
- mov esi, DWORD PTR _pi$[esp+112]
- add eax, edx
- inc ecx
- cmp ecx, esi
- mov DWORD PTR _pi$[esp+92], eax
- mov DWORD PTR _j$[esp+84], ecx
- jl $L53743
- $L53741:
- ; Line 745
- mov eax, DWORD PTR _i$[esp+84]
- mov ecx, DWORD PTR _pi$[esp+108]
- inc eax
- cmp eax, ecx
- mov DWORD PTR _i$[esp+84], eax
- jl $L54325
- $L54323:
- ; Line 755
- mov eax, DWORD PTR _pi$[esp+88]
- pop edi
- pop esi
- pop ebp
- pop ebx
- ; Line 757
- add esp, 72 ; 00000048H
- ret 0
- _loco_codec_decompress ENDP
- ; Function compile flags: /Ogty
- _TEXT ENDS
- ; COMDAT _rice_decode
- _TEXT SEGMENT
- _pip$ = 8
- _log_b$ = 12
- _rice_decode PROC NEAR ; COMDAT
- ; Line 203
- mov edx, DWORD PTR _pip$[esp-4]
- mov eax, DWORD PTR [edx+52]
- test eax, eax
- jle SHORT $L53414
- ; Line 205
- dec eax
- mov DWORD PTR [edx+52], eax
- ; Line 206
- xor eax, eax
- ; Line 231
- ret 0
- $L53414:
- push ebx
- push ebp
- push esi
- push edi
- ; Line 209
- xor edi, edi
- mov ebp, 8
- ; Line 231
- npad 3
- ; Line 209
- $L53415:
- mov eax, DWORD PTR [edx+16]
- test eax, eax
- jne SHORT $L54332
- mov eax, DWORD PTR [edx]
- mov cl, BYTE PTR [eax]
- inc eax
- mov BYTE PTR [edx+12], cl
- mov DWORD PTR [edx], eax
- mov DWORD PTR [edx+16], ebp
- $L54332:
- mov eax, DWORD PTR [edx+16]
- dec eax
- mov esi, eax
- mov DWORD PTR [edx+16], eax
- mov ecx, esi
- mov eax, 1
- shl eax, cl
- movzx ecx, BYTE PTR [edx+12]
- test eax, ecx
- jg SHORT $L53417
- inc edi
- jmp SHORT $L53415
- $L53417:
- ; Line 210
- mov ecx, DWORD PTR _log_b$[esp+12]
- shl edi, cl
- mov eax, edi
- ; Line 211
- lea edi, DWORD PTR [ecx-1]
- test edi, edi
- jl SHORT $L53420
- $L53418:
- test esi, esi
- jne SHORT $L54336
- mov ecx, DWORD PTR [edx]
- mov bl, BYTE PTR [ecx]
- inc ecx
- mov esi, 8
- mov BYTE PTR [edx+12], bl
- mov DWORD PTR [edx], ecx
- mov DWORD PTR [edx+16], esi
- $L54336:
- mov ecx, DWORD PTR [edx+16]
- dec ecx
- mov ebx, 1
- shl ebx, cl
- mov DWORD PTR [edx+16], ecx
- mov esi, ecx
- movzx ecx, BYTE PTR [edx+12]
- test ebx, ecx
- mov ebx, 0
- setg bl
- mov ecx, edi
- shl ebx, cl
- or eax, ebx
- dec edi
- jns SHORT $L53418
- $L53420:
- ; Line 212
- xor edi, edi
- cmp eax, edi
- jne $L53421
- ; Line 214
- mov ebp, DWORD PTR [edx+56]
- cmp ebp, edi
- jl $L53422
- $L53423:
- ; Line 216
- test esi, esi
- jne SHORT $L54340
- mov ecx, DWORD PTR [edx]
- mov bl, BYTE PTR [ecx]
- inc ecx
- mov esi, 8
- mov BYTE PTR [edx+12], bl
- mov DWORD PTR [edx], ecx
- mov DWORD PTR [edx+16], esi
- $L54340:
- mov ecx, DWORD PTR [edx+16]
- dec ecx
- mov ebx, 1
- shl ebx, cl
- mov DWORD PTR [edx+16], ecx
- mov esi, ecx
- movzx ecx, BYTE PTR [edx+12]
- test ebx, ecx
- jg SHORT $L53425
- inc edi
- jmp SHORT $L53423
- $L53425:
- ; Line 217
- lea ecx, DWORD PTR [edi*4]
- mov DWORD PTR [edx+52], ecx
- ; Line 218
- mov edi, 1
- $L53426:
- test esi, esi
- jne SHORT $L54344
- mov ecx, DWORD PTR [edx]
- mov bl, BYTE PTR [ecx]
- inc ecx
- mov esi, 8
- mov BYTE PTR [edx+12], bl
- mov DWORD PTR [edx], ecx
- mov DWORD PTR [edx+16], esi
- $L54344:
- mov esi, DWORD PTR [edx+16]
- dec esi
- mov ecx, esi
- mov ebx, 1
- shl ebx, cl
- movzx ecx, BYTE PTR [edx+12]
- test ebx, ecx
- mov ebx, 0
- setg bl
- mov ecx, edi
- mov DWORD PTR [edx+16], esi
- shl ebx, cl
- mov ecx, DWORD PTR [edx+52]
- or ecx, ebx
- dec edi
- mov DWORD PTR [edx+52], ecx
- jns SHORT $L53426
- ; Line 219
- cmp ecx, 1
- jle SHORT $L53429
- pop edi
- pop esi
- lea ecx, DWORD PTR [ecx+ebp+1]
- pop ebp
- mov DWORD PTR [edx+56], ecx
- pop ebx
- ; Line 231
- ret 0
- $L53429:
- pop edi
- ; Line 220
- add ebp, -3 ; fffffffdH
- pop esi
- mov DWORD PTR [edx+56], ebp
- pop ebp
- pop ebx
- ; Line 231
- ret 0
- $L53422:
- ; Line 222
- mov ecx, DWORD PTR [edx+60]
- pop edi
- pop esi
- inc ecx
- pop ebp
- mov DWORD PTR [edx+60], ecx
- pop ebx
- ; Line 231
- ret 0
- $L53421:
- ; Line 224
- mov ecx, DWORD PTR [edx+60]
- cmp ecx, edi
- jle SHORT $L53433
- ; Line 226
- cmp ecx, 2
- jle SHORT $L53434
- mov esi, DWORD PTR [edx+56]
- add esi, ecx
- ; Line 228
- mov DWORD PTR [edx+60], edi
- pop edi
- mov DWORD PTR [edx+56], esi
- pop esi
- pop ebp
- pop ebx
- ; Line 231
- ret 0
- $L53434:
- ; Line 227
- add DWORD PTR [edx+56], -3 ; fffffffdH
- ; Line 228
- mov DWORD PTR [edx+60], edi
- $L53433:
- pop edi
- pop esi
- pop ebp
- pop ebx
- ; Line 231
- ret 0
- _rice_decode ENDP
- _TEXT ENDS
- END
-