Microsoft (R) Macro Assembler Version 9.00.21022.08 11/30/10 11:14:02 inffas32.asm Page 1 - 1 ;/* inffas32.asm is a hand tuned assembler version of inffast.c -- fast decoding ; * ; * inffas32.asm is derivated from inffas86.c, with translation of assembly code ; * ; * Copyright (C) 1995-2003 Mark Adler ; * For conditions of distribution and use, see copyright notice in zlib.h ; * ; * Copyright (C) 2003 Chris Anderson ; * Please use the copyright conditions above. ; * ; * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from ; * the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at ; * the moment. I have successfully compiled and tested this code with gcc2.96, ; * gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S ; * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX ; * enabled. I will attempt to merge the MMX code into this version. Newer ; * versions of this and inffast.S can be found at ; * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/ ; * ; * 2005 : modification by Gilles Vollant ; */ ; For Visual C++ 4.x and higher and ML 6.x and higher ; ml.exe is in directory \MASM611C of Win95 DDK ; ml.exe is also distributed in http://www.masm32.com/masmdl.htm ; and in VC++2003 toolkit at http://msdn.microsoft.com/visualc/vctoolkit2003/ ; ; ; compile with command line option ; ml /coff /Zi /c /Flinffas32.lst inffas32.asm ; if you define NO_GZIP (see inflate.h), compile with ; ml /coff /Zi /c /Flinffas32.lst /DNO_GUNZIP inffas32.asm ; zlib122sup is 0 fort zlib 1.2.2.1 and lower ; zlib122sup is 8 fort zlib 1.2.2.2 and more (with addition of dmax and head ; in inflate_state in inflate.h) = 00000008 zlib1222sup equ 8 IFDEF GUNZIP ELSE IFNDEF NO_GUNZIP = 0000000B INFLATE_MODE_TYPE equ 11 = 0000001A INFLATE_MODE_BAD equ 26 ELSE ENDIF ENDIF ; 75 "inffast.S" ;FILE "inffast.S" ;;;GLOBAL _inflate_fast ;;;SECTION .text .586p .mmx name inflate_fast_x86 .MODEL FLAT 00000000 _DATA segment 00000000 inflate_fast_use_mmx: 00000000 00000001 dd 1 00000000 _TEXT segment PUBLIC _inflate_fast ALIGN 4 00000000 _inflate_fast: 00000000 E9 00000103 jmp inflate_fast_entry ALIGN 4 00000008 46 61 73 74 20 db 'Fast decoding Code from Chris Anderson' 64 65 63 6F 64 69 6E 67 20 43 6F 64 65 20 66 72 6F 6D 20 43 68 72 69 73 20 41 6E 64 65 72 73 6F 6E 0000002E 00 db 0 ALIGN 4 00000030 invalid_literal_length_code_msg: 00000030 69 6E 76 61 6C db 'invalid literal/length code' 69 64 20 6C 69 74 65 72 61 6C 2F 6C 65 6E 67 74 68 20 63 6F 64 65 0000004B 00 db 0 ALIGN 4 0000004C invalid_distance_code_msg: 0000004C 69 6E 76 61 6C db 'invalid distance code' 69 64 20 64 69 73 74 61 6E 63 65 20 63 6F 64 65 00000061 00 db 0 ALIGN 4 00000064 invalid_distance_too_far_msg: 00000064 69 6E 76 61 6C db 'invalid distance too far back' 69 64 20 64 69 73 74 61 6E 63 65 20 74 6F 6F 20 66 61 72 20 62 61 63 6B 00000081 00 db 0 ALIGN 4 00000084 inflate_fast_mask: 00000084 00000000 dd 0 00000088 00000001 dd 1 0000008C 00000003 dd 3 00000090 00000007 dd 7 00000094 0000000F dd 15 00000098 0000001F dd 31 0000009C 0000003F dd 63 000000A0 0000007F dd 127 000000A4 000000FF dd 255 000000A8 000001FF dd 511 000000AC 000003FF dd 1023 000000B0 000007FF dd 2047 000000B4 00000FFF dd 4095 000000B8 00001FFF dd 8191 000000BC 00003FFF dd 16383 000000C0 00007FFF dd 32767 000000C4 0000FFFF dd 65535 000000C8 0001FFFF dd 131071 000000CC 0003FFFF dd 262143 000000D0 0007FFFF dd 524287 000000D4 000FFFFF dd 1048575 000000D8 001FFFFF dd 2097151 000000DC 003FFFFF dd 4194303 000000E0 007FFFFF dd 8388607 000000E4 00FFFFFF dd 16777215 000000E8 01FFFFFF dd 33554431 000000EC 03FFFFFF dd 67108863 000000F0 07FFFFFF dd 134217727 000000F4 0FFFFFFF dd 268435455 000000F8 1FFFFFFF dd 536870911 000000FC 3FFFFFFF dd 1073741823 00000100 7FFFFFFF dd 2147483647 00000104 FFFFFFFF dd 4294967295 = 00000000 mode_state equ 0 ;/* state->mode */ = 00000028 wsize_state equ (32+zlib1222sup) ;/* state->wsize */ = 00000030 write_state equ (36+4+zlib1222sup) ;/* state->write */ = 00000034 window_state equ (40+4+zlib1222sup) ;/* state->window */ = 00000038 hold_state equ (44+4+zlib1222sup) ;/* state->hold */ = 0000003C bits_state equ (48+4+zlib1222sup) ;/* state->bits */ = 0000004C lencode_state equ (64+4+zlib1222sup) ;/* state->lencode */ = 00000050 distcode_state equ (68+4+zlib1222sup) ;/* state->distcode */ = 00000054 lenbits_state equ (72+4+zlib1222sup) ;/* state->lenbits */ = 00000058 distbits_state equ (76+4+zlib1222sup) ;/* state->distbits */ ;;SECTION .text ; 205 "inffast.S" ;GLOBAL inflate_fast_use_mmx ;SECTION .data ; GLOBAL inflate_fast_use_mmx:object ;.size inflate_fast_use_mmx, 4 ; 226 "inffast.S" ;SECTION .text ALIGN 4 00000108 inflate_fast_entry: 00000108 57 push edi 00000109 56 push esi 0000010A 55 push ebp 0000010B 53 push ebx 0000010C 9C pushfd 0000010D 83 EC 40 sub esp,64 00000110 FC cld 00000111 8B 74 24 58 mov esi, [esp+88] 00000115 8B 7E 1C mov edi, [esi+28] 00000118 8B 56 04 mov edx, [esi+4] 0000011B 8B 06 mov eax, [esi+0] 0000011D 03 D0 add edx,eax 0000011F 83 EA 0B sub edx,11 00000122 89 44 24 2C mov [esp+44],eax 00000126 89 54 24 14 mov [esp+20],edx 0000012A 8B 6C 24 5C mov ebp, [esp+92] 0000012E 8B 4E 10 mov ecx, [esi+16] 00000131 8B 5E 0C mov ebx, [esi+12] 00000134 2B E9 sub ebp,ecx 00000136 F7 DD neg ebp 00000138 03 EB add ebp,ebx 0000013A 81 E9 00000101 sub ecx,257 00000140 03 CB add ecx,ebx 00000142 89 5C 24 3C mov [esp+60],ebx 00000146 89 6C 24 28 mov [esp+40],ebp 0000014A 89 4C 24 10 mov [esp+16],ecx ; 285 "inffast.S" 0000014E 8B 47 4C mov eax, [edi+lencode_state] 00000151 8B 4F 50 mov ecx, [edi+distcode_state] 00000154 89 44 24 08 mov [esp+8],eax 00000158 89 4C 24 0C mov [esp+12],ecx 0000015C B8 00000001 mov eax,1 00000161 8B 4F 54 mov ecx, [edi+lenbits_state] 00000164 D3 E0 shl eax,cl 00000166 48 dec eax 00000167 89 04 24 mov [esp+0],eax 0000016A B8 00000001 mov eax,1 0000016F 8B 4F 58 mov ecx, [edi+distbits_state] 00000172 D3 E0 shl eax,cl 00000174 48 dec eax 00000175 89 44 24 04 mov [esp+4],eax 00000179 8B 47 28 mov eax, [edi+wsize_state] 0000017C 8B 4F 30 mov ecx, [edi+write_state] 0000017F 8B 57 34 mov edx, [edi+window_state] 00000182 89 44 24 34 mov [esp+52],eax 00000186 89 4C 24 30 mov [esp+48],ecx 0000018A 89 54 24 38 mov [esp+56],edx 0000018E 8B 6F 38 mov ebp, [edi+hold_state] 00000191 8B 5F 3C mov ebx, [edi+bits_state] ; 321 "inffast.S" 00000194 8B 74 24 2C mov esi, [esp+44] 00000198 8B 4C 24 14 mov ecx, [esp+20] 0000019C 3B CE cmp ecx,esi 0000019E 77 22 ja L_align_long 000001A0 83 C1 0B add ecx,11 000001A3 2B CE sub ecx,esi 000001A5 B8 0000000C mov eax,12 000001AA 2B C1 sub eax,ecx 000001AC 8D 7C 24 1C lea edi, [esp+28] 000001B0 F3/ A4 rep movsb 000001B2 8B C8 mov ecx,eax 000001B4 33 C0 xor eax,eax 000001B6 F3/ AA rep stosb 000001B8 8D 74 24 1C lea esi, [esp+28] 000001BC 89 74 24 14 mov [esp+20],esi 000001C0 EB 18 jmp L_is_aligned 000001C2 L_align_long: 000001C2 F7 C6 00000003 test esi,3 000001C8 74 10 jz L_is_aligned 000001CA 33 C0 xor eax,eax 000001CC 8A 06 mov al, [esi] 000001CE 46 inc esi 000001CF 8B CB mov ecx,ebx 000001D1 83 C3 08 add ebx,8 000001D4 D3 E0 shl eax,cl 000001D6 0B E8 or ebp,eax 000001D8 EB E8 jmp L_align_long 000001DA L_is_aligned: 000001DA 8B 7C 24 3C mov edi, [esp+60] ; 366 "inffast.S" 000001DE L_check_mmx: 000001DE 83 3D 00000000 R cmp dword ptr [inflate_fast_use_mmx],2 02 000001E5 0F 84 00000289 je L_init_mmx 000001EB 77 6B ja L_do_loop 000001ED 50 push eax 000001EE 53 push ebx 000001EF 51 push ecx 000001F0 52 push edx 000001F1 9C pushfd 000001F2 8B 04 24 mov eax, [esp] 000001F5 81 34 24 xor dword ptr [esp],0200000h 00200000 000001FC 9D popfd 000001FD 9C pushfd 000001FE 5A pop edx 000001FF 33 D0 xor edx,eax 00000201 74 44 jz L_dont_use_mmx 00000203 33 C0 xor eax,eax 00000205 0F A2 cpuid 00000207 81 FB 756E6547 cmp ebx,0756e6547h 0000020D 75 38 jne L_dont_use_mmx 0000020F 81 F9 6C65746E cmp ecx,06c65746eh 00000215 75 30 jne L_dont_use_mmx 00000217 81 FA 49656E69 cmp edx,049656e69h 0000021D 75 28 jne L_dont_use_mmx 0000021F B8 00000001 mov eax,1 00000224 0F A2 cpuid 00000226 C1 E8 08 shr eax,8 00000229 83 E0 0F and eax,15 0000022C 83 F8 06 cmp eax,6 0000022F 75 16 jne L_dont_use_mmx 00000231 F7 C2 00800000 test edx,0800000h 00000237 75 02 jnz L_use_mmx 00000239 EB 0C jmp L_dont_use_mmx 0000023B L_use_mmx: 0000023B C7 05 00000000 R mov dword ptr [inflate_fast_use_mmx],2 00000002 00000245 EB 0A jmp L_check_mmx_pop 00000247 L_dont_use_mmx: 00000247 C7 05 00000000 R mov dword ptr [inflate_fast_use_mmx],3 00000003 00000251 L_check_mmx_pop: 00000251 5A pop edx 00000252 59 pop ecx 00000253 5B pop ebx 00000254 58 pop eax 00000255 EB 87 jmp L_check_mmx ; 426 "inffast.S" ALIGN 4 00000258 L_do_loop: ; 437 "inffast.S" 00000258 80 FB 0F cmp bl,15 0000025B 77 0D ja L_get_length_code 0000025D 33 C0 xor eax,eax 0000025F 66| AD lodsw 00000261 8A CB mov cl,bl 00000263 80 C3 10 add bl,16 00000266 D3 E0 shl eax,cl 00000268 0B E8 or ebp,eax 0000026A L_get_length_code: 0000026A 8B 14 24 mov edx, [esp+0] 0000026D 8B 4C 24 08 mov ecx, [esp+8] 00000271 23 D5 and edx,ebp 00000273 8B 04 91 mov eax, [ecx+edx*4] 00000276 L_dolen: 00000276 8A CC mov cl,ah 00000278 2A DC sub bl,ah 0000027A D3 ED shr ebp,cl 0000027C 84 C0 test al,al 0000027E 75 19 jnz L_test_for_length_base 00000280 C1 E8 10 shr eax,16 00000283 AA stosb 00000284 L_while_test: 00000284 39 7C 24 10 cmp [esp+16],edi 00000288 0F 86 00000462 jbe L_break_loop 0000028E 39 74 24 14 cmp [esp+20],esi 00000292 77 C4 ja L_do_loop 00000294 E9 00000457 jmp L_break_loop 00000299 L_test_for_length_base: ; 502 "inffast.S" 00000299 8B D0 mov edx,eax 0000029B C1 EA 10 shr edx,16 0000029E 8A C8 mov cl,al 000002A0 A8 10 test al,16 000002A2 0F 84 000000F4 jz L_test_for_second_level_length 000002A8 80 E1 0F and cl,15 000002AB 74 25 jz L_save_len 000002AD 3A D9 cmp bl,cl 000002AF 73 11 jae L_add_bits_to_len 000002B1 8A E9 mov ch,cl 000002B3 33 C0 xor eax,eax 000002B5 66| AD lodsw 000002B7 8A CB mov cl,bl 000002B9 80 C3 10 add bl,16 000002BC D3 E0 shl eax,cl 000002BE 0B E8 or ebp,eax 000002C0 8A CD mov cl,ch 000002C2 L_add_bits_to_len: 000002C2 B8 00000001 mov eax,1 000002C7 D3 E0 shl eax,cl 000002C9 48 dec eax 000002CA 2A D9 sub bl,cl 000002CC 23 C5 and eax,ebp 000002CE D3 ED shr ebp,cl 000002D0 03 D0 add edx,eax 000002D2 L_save_len: 000002D2 89 54 24 18 mov [esp+24],edx 000002D6 L_decode_distance: ; 549 "inffast.S" 000002D6 80 FB 0F cmp bl,15 000002D9 77 0D ja L_get_distance_code 000002DB 33 C0 xor eax,eax 000002DD 66| AD lodsw 000002DF 8A CB mov cl,bl 000002E1 80 C3 10 add bl,16 000002E4 D3 E0 shl eax,cl 000002E6 0B E8 or ebp,eax 000002E8 L_get_distance_code: 000002E8 8B 54 24 04 mov edx, [esp+4] 000002EC 8B 4C 24 0C mov ecx, [esp+12] 000002F0 23 D5 and edx,ebp 000002F2 8B 04 91 mov eax, [ecx+edx*4] 000002F5 L_dodist: 000002F5 8B D0 mov edx,eax 000002F7 C1 EA 10 shr edx,16 000002FA 8A CC mov cl,ah 000002FC 2A DC sub bl,ah 000002FE D3 ED shr ebp,cl ; 584 "inffast.S" 00000300 8A C8 mov cl,al 00000302 A8 10 test al,16 00000304 0F 84 000000B2 jz L_test_for_second_level_dist 0000030A 80 E1 0F and cl,15 0000030D 74 65 jz L_check_dist_one 0000030F 3A D9 cmp bl,cl 00000311 73 11 jae L_add_bits_to_dist 00000313 8A E9 mov ch,cl 00000315 33 C0 xor eax,eax 00000317 66| AD lodsw 00000319 8A CB mov cl,bl 0000031B 80 C3 10 add bl,16 0000031E D3 E0 shl eax,cl 00000320 0B E8 or ebp,eax 00000322 8A CD mov cl,ch 00000324 L_add_bits_to_dist: 00000324 B8 00000001 mov eax,1 00000329 D3 E0 shl eax,cl 0000032B 48 dec eax 0000032C 2A D9 sub bl,cl 0000032E 23 C5 and eax,ebp 00000330 D3 ED shr ebp,cl 00000332 03 D0 add edx,eax 00000334 EB 00 jmp L_check_window 00000336 L_check_window: ; 625 "inffast.S" 00000336 89 74 24 2C mov [esp+44],esi 0000033A 8B C7 mov eax,edi 0000033C 2B 44 24 28 sub eax, [esp+40] 00000340 3B C2 cmp eax,edx 00000342 0F 82 00000094 jb L_clip_window 00000348 8B 4C 24 18 mov ecx, [esp+24] 0000034C 8B F7 mov esi,edi 0000034E 2B F2 sub esi,edx 00000350 83 E9 03 sub ecx,3 00000353 8A 06 mov al, [esi] 00000355 88 07 mov [edi],al 00000357 8A 46 01 mov al, [esi+1] 0000035A 8A 56 02 mov dl, [esi+2] 0000035D 83 C6 03 add esi,3 00000360 88 47 01 mov [edi+1],al 00000363 88 57 02 mov [edi+2],dl 00000366 83 C7 03 add edi,3 00000369 F3/ A4 rep movsb 0000036B 8B 74 24 2C mov esi, [esp+44] 0000036F E9 FFFFFF10 jmp L_while_test ALIGN 4 00000374 L_check_dist_one: 00000374 83 FA 01 cmp edx,1 00000377 75 BD jne L_check_window 00000379 39 7C 24 28 cmp [esp+40],edi 0000037D 74 B7 je L_check_window 0000037F 4F dec edi 00000380 8B 4C 24 18 mov ecx, [esp+24] 00000384 8A 07 mov al, [edi] 00000386 83 E9 03 sub ecx,3 00000389 88 47 01 mov [edi+1],al 0000038C 88 47 02 mov [edi+2],al 0000038F 88 47 03 mov [edi+3],al 00000392 83 C7 04 add edi,4 00000395 F3/ AA rep stosb 00000397 E9 FFFFFEE8 jmp L_while_test ALIGN 4 0000039C L_test_for_second_level_length: 0000039C A8 40 test al,64 0000039E 0F 85 0000030E jnz L_test_for_end_of_block 000003A4 B8 00000001 mov eax,1 000003A9 D3 E0 shl eax,cl 000003AB 48 dec eax 000003AC 23 C5 and eax,ebp 000003AE 03 C2 add eax,edx 000003B0 8B 54 24 08 mov edx, [esp+8] 000003B4 8B 04 82 mov eax, [edx+eax*4] 000003B7 E9 FFFFFEBA jmp L_dolen ALIGN 4 000003BC L_test_for_second_level_dist: 000003BC A8 40 test al,64 000003BE 0F 85 000002E2 jnz L_invalid_distance_code 000003C4 B8 00000001 mov eax,1 000003C9 D3 E0 shl eax,cl 000003CB 48 dec eax 000003CC 23 C5 and eax,ebp 000003CE 03 C2 add eax,edx 000003D0 8B 54 24 0C mov edx, [esp+12] 000003D4 8B 04 82 mov eax, [edx+eax*4] 000003D7 E9 FFFFFF19 jmp L_dodist ALIGN 4 000003DC L_clip_window: ; 721 "inffast.S" 000003DC 8B C8 mov ecx,eax 000003DE 8B 44 24 34 mov eax, [esp+52] 000003E2 F7 D9 neg ecx 000003E4 8B 74 24 38 mov esi, [esp+56] 000003E8 3B C2 cmp eax,edx 000003EA 0F 82 000002DE jb L_invalid_distance_too_far 000003F0 03 CA add ecx,edx 000003F2 83 7C 24 30 00 cmp dword ptr [esp+48],0 000003F7 75 24 jne L_wrap_around_window 000003F9 2B C1 sub eax,ecx 000003FB 03 F0 add esi,eax ; 749 "inffast.S" 000003FD 8B 44 24 18 mov eax, [esp+24] 00000401 3B C1 cmp eax,ecx 00000403 76 60 jbe L_do_copy1 00000405 2B C1 sub eax,ecx 00000407 F3/ A4 rep movsb 00000409 8B F7 mov esi,edi 0000040B 2B F2 sub esi,edx 0000040D EB 56 jmp L_do_copy1 0000040F 3B C1 cmp eax,ecx 00000411 76 52 jbe L_do_copy1 00000413 2B C1 sub eax,ecx 00000415 F3/ A4 rep movsb 00000417 8B F7 mov esi,edi 00000419 2B F2 sub esi,edx 0000041B EB 48 jmp L_do_copy1 0000041D L_wrap_around_window: ; 793 "inffast.S" 0000041D 8B 44 24 30 mov eax, [esp+48] 00000421 3B C8 cmp ecx,eax 00000423 76 2C jbe L_contiguous_in_window 00000425 03 74 24 34 add esi, [esp+52] 00000429 03 F0 add esi,eax 0000042B 2B F1 sub esi,ecx 0000042D 2B C8 sub ecx,eax 0000042F 8B 44 24 18 mov eax, [esp+24] 00000433 3B C1 cmp eax,ecx 00000435 76 2E jbe L_do_copy1 00000437 2B C1 sub eax,ecx 00000439 F3/ A4 rep movsb 0000043B 8B 74 24 38 mov esi, [esp+56] 0000043F 8B 4C 24 30 mov ecx, [esp+48] 00000443 3B C1 cmp eax,ecx 00000445 76 1E jbe L_do_copy1 00000447 2B C1 sub eax,ecx 00000449 F3/ A4 rep movsb 0000044B 8B F7 mov esi,edi 0000044D 2B F2 sub esi,edx 0000044F EB 14 jmp L_do_copy1 00000451 L_contiguous_in_window: ; 836 "inffast.S" 00000451 03 F0 add esi,eax 00000453 2B F1 sub esi,ecx 00000455 8B 44 24 18 mov eax, [esp+24] 00000459 3B C1 cmp eax,ecx 0000045B 76 08 jbe L_do_copy1 0000045D 2B C1 sub eax,ecx 0000045F F3/ A4 rep movsb 00000461 8B F7 mov esi,edi 00000463 2B F2 sub esi,edx 00000465 L_do_copy1: ; 862 "inffast.S" 00000465 8B C8 mov ecx,eax 00000467 F3/ A4 rep movsb 00000469 8B 74 24 2C mov esi, [esp+44] 0000046D E9 FFFFFE12 jmp L_while_test ; 878 "inffast.S" ALIGN 4 00000474 L_init_mmx: 00000474 0F 77 emms 00000476 0F 6E C5 movd mm0,ebp 00000479 8B EB mov ebp,ebx ; 896 "inffast.S" 0000047B 0F 6E 24 24 movd mm4,dword ptr [esp+0] 0000047F 0F 7F E3 movq mm3,mm4 00000482 0F 6E 6C 24 04 movd mm5,dword ptr [esp+4] 00000487 0F 7F EA movq mm2,mm5 0000048A 0F EF C9 pxor mm1,mm1 0000048D 8B 5C 24 08 mov ebx, [esp+8] 00000491 EB 01 jmp L_do_loop_mmx ALIGN 4 00000494 L_do_loop_mmx: 00000494 0F D3 C1 psrlq mm0,mm1 00000497 83 FD 20 cmp ebp,32 0000049A 77 12 ja L_get_length_code_mmx 0000049C 0F 6E F5 movd mm6,ebp 0000049F 0F 6E 3E movd mm7,dword ptr [esi] 000004A2 83 C6 04 add esi,4 000004A5 0F F3 FE psllq mm7,mm6 000004A8 83 C5 20 add ebp,32 000004AB 0F EB C7 por mm0,mm7 000004AE L_get_length_code_mmx: 000004AE 0F DB E0 pand mm4,mm0 000004B1 0F 7E E0 movd eax,mm4 000004B4 0F 7F DC movq mm4,mm3 000004B7 8B 04 83 mov eax, [ebx+eax*4] 000004BA L_dolen_mmx: 000004BA 0F B6 CC movzx ecx,ah 000004BD 0F 6E C9 movd mm1,ecx 000004C0 2B E9 sub ebp,ecx 000004C2 84 C0 test al,al 000004C4 75 19 jnz L_test_for_length_base_mmx 000004C6 C1 E8 10 shr eax,16 000004C9 AA stosb 000004CA L_while_test_mmx: 000004CA 39 7C 24 10 cmp [esp+16],edi 000004CE 0F 86 0000021C jbe L_break_loop 000004D4 39 74 24 14 cmp [esp+20],esi 000004D8 77 BA ja L_do_loop_mmx 000004DA E9 00000211 jmp L_break_loop 000004DF L_test_for_length_base_mmx: 000004DF 8B D0 mov edx,eax 000004E1 C1 EA 10 shr edx,16 000004E4 A8 10 test al,16 000004E6 0F 84 000000E0 jz L_test_for_second_level_length_mmx 000004EC 83 E0 0F and eax,15 000004EF 74 14 jz L_decode_distance_mmx 000004F1 0F D3 C1 psrlq mm0,mm1 000004F4 0F 6E C8 movd mm1,eax 000004F7 0F 7E C1 movd ecx,mm0 000004FA 2B E8 sub ebp,eax 000004FC 23 0C 85 and ecx, [inflate_fast_mask+eax*4] 00000084 R 00000503 03 D1 add edx,ecx 00000505 L_decode_distance_mmx: 00000505 0F D3 C1 psrlq mm0,mm1 00000508 83 FD 20 cmp ebp,32 0000050B 77 12 ja L_get_dist_code_mmx 0000050D 0F 6E F5 movd mm6,ebp 00000510 0F 6E 3E movd mm7,dword ptr [esi] 00000513 83 C6 04 add esi,4 00000516 0F F3 FE psllq mm7,mm6 00000519 83 C5 20 add ebp,32 0000051C 0F EB C7 por mm0,mm7 0000051F L_get_dist_code_mmx: 0000051F 8B 5C 24 0C mov ebx, [esp+12] 00000523 0F DB E8 pand mm5,mm0 00000526 0F 7E E8 movd eax,mm5 00000529 0F 7F D5 movq mm5,mm2 0000052C 8B 04 83 mov eax, [ebx+eax*4] 0000052F L_dodist_mmx: 0000052F 0F B6 CC movzx ecx,ah 00000532 8B D8 mov ebx,eax 00000534 C1 EB 10 shr ebx,16 00000537 2B E9 sub ebp,ecx 00000539 0F 6E C9 movd mm1,ecx 0000053C A8 10 test al,16 0000053E 0F 84 000000AC jz L_test_for_second_level_dist_mmx 00000544 83 E0 0F and eax,15 00000547 74 57 jz L_check_dist_one_mmx 00000549 L_add_bits_to_dist_mmx: 00000549 0F D3 C1 psrlq mm0,mm1 0000054C 0F 6E C8 movd mm1,eax 0000054F 0F 7E C1 movd ecx,mm0 00000552 2B E8 sub ebp,eax 00000554 23 0C 85 and ecx, [inflate_fast_mask+eax*4] 00000084 R 0000055B 03 D9 add ebx,ecx 0000055D L_check_window_mmx: 0000055D 89 74 24 2C mov [esp+44],esi 00000561 8B C7 mov eax,edi 00000563 2B 44 24 28 sub eax, [esp+40] 00000567 3B C3 cmp eax,ebx 00000569 0F 82 000000A9 jb L_clip_window_mmx 0000056F 8B CA mov ecx,edx 00000571 8B F7 mov esi,edi 00000573 2B F3 sub esi,ebx 00000575 83 E9 03 sub ecx,3 00000578 8A 06 mov al, [esi] 0000057A 88 07 mov [edi],al 0000057C 8A 46 01 mov al, [esi+1] 0000057F 8A 56 02 mov dl, [esi+2] 00000582 83 C6 03 add esi,3 00000585 88 47 01 mov [edi+1],al 00000588 88 57 02 mov [edi+2],dl 0000058B 83 C7 03 add edi,3 0000058E F3/ A4 rep movsb 00000590 8B 74 24 2C mov esi, [esp+44] 00000594 8B 5C 24 08 mov ebx, [esp+8] 00000598 E9 FFFFFF2D jmp L_while_test_mmx ALIGN 4 000005A0 L_check_dist_one_mmx: 000005A0 83 FB 01 cmp ebx,1 000005A3 75 B8 jne L_check_window_mmx 000005A5 39 7C 24 28 cmp [esp+40],edi 000005A9 74 B2 je L_check_window_mmx 000005AB 4F dec edi 000005AC 8B CA mov ecx,edx 000005AE 8A 07 mov al, [edi] 000005B0 83 E9 03 sub ecx,3 000005B3 88 47 01 mov [edi+1],al 000005B6 88 47 02 mov [edi+2],al 000005B9 88 47 03 mov [edi+3],al 000005BC 83 C7 04 add edi,4 000005BF F3/ AA rep stosb 000005C1 8B 5C 24 08 mov ebx, [esp+8] 000005C5 E9 FFFFFF00 jmp L_while_test_mmx ALIGN 4 000005CC L_test_for_second_level_length_mmx: 000005CC A8 40 test al,64 000005CE 0F 85 000000DE jnz L_test_for_end_of_block 000005D4 83 E0 0F and eax,15 000005D7 0F D3 C1 psrlq mm0,mm1 000005DA 0F 7E C1 movd ecx,mm0 000005DD 23 0C 85 and ecx, [inflate_fast_mask+eax*4] 00000084 R 000005E4 03 CA add ecx,edx 000005E6 8B 04 8B mov eax, [ebx+ecx*4] 000005E9 E9 FFFFFECC jmp L_dolen_mmx ALIGN 4 000005F0 L_test_for_second_level_dist_mmx: 000005F0 A8 40 test al,64 000005F2 0F 85 000000AE jnz L_invalid_distance_code 000005F8 83 E0 0F and eax,15 000005FB 0F D3 C1 psrlq mm0,mm1 000005FE 0F 7E C1 movd ecx,mm0 00000601 23 0C 85 and ecx, [inflate_fast_mask+eax*4] 00000084 R 00000608 8B 44 24 0C mov eax, [esp+12] 0000060C 03 CB add ecx,ebx 0000060E 8B 04 88 mov eax, [eax+ecx*4] 00000611 E9 FFFFFF19 jmp L_dodist_mmx ALIGN 4 00000618 L_clip_window_mmx: 00000618 8B C8 mov ecx,eax 0000061A 8B 44 24 34 mov eax, [esp+52] 0000061E F7 D9 neg ecx 00000620 8B 74 24 38 mov esi, [esp+56] 00000624 3B C3 cmp eax,ebx 00000626 0F 82 000000A2 jb L_invalid_distance_too_far 0000062C 03 CB add ecx,ebx 0000062E 83 7C 24 30 00 cmp dword ptr [esp+48],0 00000633 75 20 jne L_wrap_around_window_mmx 00000635 2B C1 sub eax,ecx 00000637 03 F0 add esi,eax 00000639 3B D1 cmp edx,ecx 0000063B 76 58 jbe L_do_copy1_mmx 0000063D 2B D1 sub edx,ecx 0000063F F3/ A4 rep movsb 00000641 8B F7 mov esi,edi 00000643 2B F3 sub esi,ebx 00000645 EB 4E jmp L_do_copy1_mmx 00000647 3B D1 cmp edx,ecx 00000649 76 4A jbe L_do_copy1_mmx 0000064B 2B D1 sub edx,ecx 0000064D F3/ A4 rep movsb 0000064F 8B F7 mov esi,edi 00000651 2B F3 sub esi,ebx 00000653 EB 40 jmp L_do_copy1_mmx 00000655 L_wrap_around_window_mmx: 00000655 8B 44 24 30 mov eax, [esp+48] 00000659 3B C8 cmp ecx,eax 0000065B 76 28 jbe L_contiguous_in_window_mmx 0000065D 03 74 24 34 add esi, [esp+52] 00000661 03 F0 add esi,eax 00000663 2B F1 sub esi,ecx 00000665 2B C8 sub ecx,eax 00000667 3B D1 cmp edx,ecx 00000669 76 2A jbe L_do_copy1_mmx 0000066B 2B D1 sub edx,ecx 0000066D F3/ A4 rep movsb 0000066F 8B 74 24 38 mov esi, [esp+56] 00000673 8B 4C 24 30 mov ecx, [esp+48] 00000677 3B D1 cmp edx,ecx 00000679 76 1A jbe L_do_copy1_mmx 0000067B 2B D1 sub edx,ecx 0000067D F3/ A4 rep movsb 0000067F 8B F7 mov esi,edi 00000681 2B F3 sub esi,ebx 00000683 EB 10 jmp L_do_copy1_mmx 00000685 L_contiguous_in_window_mmx: 00000685 03 F0 add esi,eax 00000687 2B F1 sub esi,ecx 00000689 3B D1 cmp edx,ecx 0000068B 76 08 jbe L_do_copy1_mmx 0000068D 2B D1 sub edx,ecx 0000068F F3/ A4 rep movsb 00000691 8B F7 mov esi,edi 00000693 2B F3 sub esi,ebx 00000695 L_do_copy1_mmx: 00000695 8B CA mov ecx,edx 00000697 F3/ A4 rep movsb 00000699 8B 74 24 2C mov esi, [esp+44] 0000069D 8B 5C 24 08 mov ebx, [esp+8] 000006A1 E9 FFFFFE24 jmp L_while_test_mmx ; 1174 "inffast.S" 000006A6 L_invalid_distance_code: 000006A6 B9 0000004C R mov ecx, invalid_distance_code_msg 000006AB BA 0000001A mov edx,INFLATE_MODE_BAD 000006B0 EB 2C jmp L_update_stream_state 000006B2 L_test_for_end_of_block: 000006B2 A8 20 test al,32 000006B4 74 0C jz L_invalid_literal_length_code 000006B6 B9 00000000 mov ecx,0 000006BB BA 0000000B mov edx,INFLATE_MODE_TYPE 000006C0 EB 1C jmp L_update_stream_state 000006C2 L_invalid_literal_length_code: 000006C2 B9 00000030 R mov ecx, invalid_literal_length_code_msg 000006C7 BA 0000001A mov edx,INFLATE_MODE_BAD 000006CC EB 10 jmp L_update_stream_state 000006CE L_invalid_distance_too_far: 000006CE 8B 74 24 2C mov esi, [esp+44] 000006D2 B9 00000064 R mov ecx, invalid_distance_too_far_msg 000006D7 BA 0000001A mov edx,INFLATE_MODE_BAD 000006DC EB 00 jmp L_update_stream_state 000006DE L_update_stream_state: 000006DE 8B 44 24 58 mov eax, [esp+88] 000006E2 85 C9 test ecx,ecx 000006E4 74 03 jz L_skip_msg 000006E6 89 48 18 mov [eax+24],ecx 000006E9 L_skip_msg: 000006E9 8B 40 1C mov eax, [eax+28] 000006EC 89 10 mov [eax+mode_state],edx 000006EE EB 00 jmp L_break_loop ALIGN 4 000006F0 L_break_loop: ; 1243 "inffast.S" 000006F0 83 3D 00000000 R cmp dword ptr [inflate_fast_use_mmx],2 02 000006F7 75 02 jne L_update_next_in 000006F9 8B DD mov ebx,ebp 000006FB L_update_next_in: ; 1266 "inffast.S" 000006FB 8B 44 24 58 mov eax, [esp+88] 000006FF 8B CB mov ecx,ebx 00000701 8B 50 1C mov edx, [eax+28] 00000704 C1 E9 03 shr ecx,3 00000707 2B F1 sub esi,ecx 00000709 C1 E1 03 shl ecx,3 0000070C 2B D9 sub ebx,ecx 0000070E 89 78 0C mov [eax+12],edi 00000711 89 5A 3C mov [edx+bits_state],ebx 00000714 8B CB mov ecx,ebx 00000716 8D 5C 24 1C lea ebx, [esp+28] 0000071A 39 5C 24 14 cmp [esp+20],ebx 0000071E 75 14 jne L_buf_not_used 00000720 2B F3 sub esi,ebx 00000722 8B 18 mov ebx, [eax+0] 00000724 89 5C 24 14 mov [esp+20],ebx 00000728 03 F3 add esi,ebx 0000072A 8B 58 04 mov ebx, [eax+4] 0000072D 83 EB 0B sub ebx,11 00000730 01 5C 24 14 add [esp+20],ebx 00000734 L_buf_not_used: 00000734 89 30 mov [eax+0],esi 00000736 BB 00000001 mov ebx,1 0000073B D3 E3 shl ebx,cl 0000073D 4B dec ebx 0000073E 83 3D 00000000 R cmp dword ptr [inflate_fast_use_mmx],2 02 00000745 75 08 jne L_update_hold 00000747 0F D3 C1 psrlq mm0,mm1 0000074A 0F 7E C5 movd ebp,mm0 0000074D 0F 77 emms 0000074F L_update_hold: 0000074F 23 EB and ebp,ebx 00000751 89 6A 38 mov [edx+hold_state],ebp 00000754 8B 5C 24 14 mov ebx, [esp+20] 00000758 3B DE cmp ebx,esi 0000075A 76 0A jbe L_last_is_smaller 0000075C 2B DE sub ebx,esi 0000075E 83 C3 0B add ebx,11 00000761 89 58 04 mov [eax+4],ebx 00000764 EB 0A jmp L_fixup_out 00000766 L_last_is_smaller: 00000766 2B F3 sub esi,ebx 00000768 F7 DE neg esi 0000076A 83 C6 0B add esi,11 0000076D 89 70 04 mov [eax+4],esi 00000770 L_fixup_out: 00000770 8B 5C 24 10 mov ebx, [esp+16] 00000774 3B DF cmp ebx,edi 00000776 76 0D jbe L_end_is_smaller 00000778 2B DF sub ebx,edi 0000077A 81 C3 00000101 add ebx,257 00000780 89 58 10 mov [eax+16],ebx 00000783 EB 0D jmp L_done 00000785 L_end_is_smaller: 00000785 2B FB sub edi,ebx 00000787 F7 DF neg edi 00000789 81 C7 00000101 add edi,257 0000078F 89 78 10 mov [eax+16],edi 00000792 L_done: 00000792 83 C4 40 add esp,64 00000795 9D popfd 00000796 5B pop ebx 00000797 5D pop ebp 00000798 5E pop esi 00000799 5F pop edi 0000079A C3 ret 00000004 _TEXT ends end Microsoft (R) Macro Assembler Version 9.00.21022.08 11/30/10 11:14:02 inffas32.asm Symbols 2 - 1 Segments and Groups: N a m e Size Length Align Combine Class FLAT . . . . . . . . . . . . . . GROUP _DATA . . . . . . . . . . . . . 32 Bit 00000004 Para Public 'DATA' _TEXT . . . . . . . . . . . . . 32 Bit 0000079B Para Public 'CODE' Symbols: N a m e Type Value Attr @CodeSize . . . . . . . . . . . Number 00000000h @DataSize . . . . . . . . . . . Number 00000000h @Interface . . . . . . . . . . . Number 00000000h @Model . . . . . . . . . . . . . Number 00000007h @code . . . . . . . . . . . . . Text _TEXT @data . . . . . . . . . . . . . Text FLAT @fardata? . . . . . . . . . . . Text FLAT @fardata . . . . . . . . . . . . Text FLAT @stack . . . . . . . . . . . . . Text FLAT INFLATE_MODE_BAD . . . . . . . . Number 0000001Ah INFLATE_MODE_TYPE . . . . . . . Number 0000000Bh L_add_bits_to_dist_mmx . . . . . L Near 00000549 _TEXT L_add_bits_to_dist . . . . . . . L Near 00000324 _TEXT L_add_bits_to_len . . . . . . . L Near 000002C2 _TEXT L_align_long . . . . . . . . . . L Near 000001C2 _TEXT L_break_loop . . . . . . . . . . L Near 000006F0 _TEXT L_buf_not_used . . . . . . . . . L Near 00000734 _TEXT L_check_dist_one_mmx . . . . . . L Near 000005A0 _TEXT L_check_dist_one . . . . . . . . L Near 00000374 _TEXT L_check_mmx_pop . . . . . . . . L Near 00000251 _TEXT L_check_mmx . . . . . . . . . . L Near 000001DE _TEXT L_check_window_mmx . . . . . . . L Near 0000055D _TEXT L_check_window . . . . . . . . . L Near 00000336 _TEXT L_clip_window_mmx . . . . . . . L Near 00000618 _TEXT L_clip_window . . . . . . . . . L Near 000003DC _TEXT L_contiguous_in_window_mmx . . . L Near 00000685 _TEXT L_contiguous_in_window . . . . . L Near 00000451 _TEXT L_decode_distance_mmx . . . . . L Near 00000505 _TEXT L_decode_distance . . . . . . . L Near 000002D6 _TEXT L_do_copy1_mmx . . . . . . . . . L Near 00000695 _TEXT L_do_copy1 . . . . . . . . . . . L Near 00000465 _TEXT L_do_loop_mmx . . . . . . . . . L Near 00000494 _TEXT L_do_loop . . . . . . . . . . . L Near 00000258 _TEXT L_dodist_mmx . . . . . . . . . . L Near 0000052F _TEXT L_dodist . . . . . . . . . . . . L Near 000002F5 _TEXT L_dolen_mmx . . . . . . . . . . L Near 000004BA _TEXT L_dolen . . . . . . . . . . . . L Near 00000276 _TEXT L_done . . . . . . . . . . . . . L Near 00000792 _TEXT L_dont_use_mmx . . . . . . . . . L Near 00000247 _TEXT L_end_is_smaller . . . . . . . . L Near 00000785 _TEXT L_fixup_out . . . . . . . . . . L Near 00000770 _TEXT L_get_dist_code_mmx . . . . . . L Near 0000051F _TEXT L_get_distance_code . . . . . . L Near 000002E8 _TEXT L_get_length_code_mmx . . . . . L Near 000004AE _TEXT L_get_length_code . . . . . . . L Near 0000026A _TEXT L_init_mmx . . . . . . . . . . . L Near 00000474 _TEXT L_invalid_distance_code . . . . L Near 000006A6 _TEXT L_invalid_distance_too_far . . . L Near 000006CE _TEXT L_invalid_literal_length_code . L Near 000006C2 _TEXT L_is_aligned . . . . . . . . . . L Near 000001DA _TEXT L_last_is_smaller . . . . . . . L Near 00000766 _TEXT L_save_len . . . . . . . . . . . L Near 000002D2 _TEXT L_skip_msg . . . . . . . . . . . L Near 000006E9 _TEXT L_test_for_end_of_block . . . . L Near 000006B2 _TEXT L_test_for_length_base_mmx . . . L Near 000004DF _TEXT L_test_for_length_base . . . . . L Near 00000299 _TEXT L_test_for_second_level_dist_mmx . L Near 000005F0 _TEXT L_test_for_second_level_dist . . L Near 000003BC _TEXT L_test_for_second_level_length_mmx . L Near 000005CC _TEXT L_test_for_second_level_length . L Near 0000039C _TEXT L_update_hold . . . . . . . . . L Near 0000074F _TEXT L_update_next_in . . . . . . . . L Near 000006FB _TEXT L_update_stream_state . . . . . L Near 000006DE _TEXT L_use_mmx . . . . . . . . . . . L Near 0000023B _TEXT L_while_test_mmx . . . . . . . . L Near 000004CA _TEXT L_while_test . . . . . . . . . . L Near 00000284 _TEXT L_wrap_around_window_mmx . . . . L Near 00000655 _TEXT L_wrap_around_window . . . . . . L Near 0000041D _TEXT _inflate_fast . . . . . . . . . L Near 00000000 _TEXT Public bits_state . . . . . . . . . . . Number 0000003Ch distbits_state . . . . . . . . . Number 00000058h distcode_state . . . . . . . . . Number 00000050h hold_state . . . . . . . . . . . Number 00000038h inflate_fast_entry . . . . . . . L Near 00000108 _TEXT inflate_fast_mask . . . . . . . L Near 00000084 _TEXT inflate_fast_use_mmx . . . . . . L Near 00000000 _DATA invalid_distance_code_msg . . . L Near 0000004C _TEXT invalid_distance_too_far_msg . . L Near 00000064 _TEXT invalid_literal_length_code_msg L Near 00000030 _TEXT lenbits_state . . . . . . . . . Number 00000054h lencode_state . . . . . . . . . Number 0000004Ch mode_state . . . . . . . . . . . Number 00000000h window_state . . . . . . . . . . Number 00000034h write_state . . . . . . . . . . Number 00000030h wsize_state . . . . . . . . . . Number 00000028h zlib1222sup . . . . . . . . . . Number 00000008h 0 Warnings 0 Errors