4 ;;;GLOBAL _inflate_fast
26 jmp inflate_fast_entry
31 db 'Fast decoding Code from Chris Anderson'
35 invalid_literal_length_code_msg:
36 db 'invalid literal/length code'
40 invalid_distance_code_msg:
41 db 'invalid distance code'
45 invalid_distance_too_far_msg:
46 db 'invalid distance too far back'
88 mode_state equ 0 ;/* state->mode */
89 wsize_state equ 32 ;/* state->wsize */
90 write_state equ (36+4) ;/* state->write */
91 window_state equ (40+4) ;/* state->window */
92 hold_state equ (44+4) ;/* state->hold */
93 bits_state equ (48+4) ;/* state->bits */
94 lencode_state equ (64+4) ;/* state->lencode */
95 distcode_state equ (68+4) ;/* state->distcode */
96 lenbits_state equ (72+4) ;/* state->lenbits */
97 distbits_state equ (76+4) ;/* state->distbits */
102 ;GLOBAL inflate_fast_use_mmx
107 ; GLOBAL inflate_fast_use_mmx:object
108 ;.size inflate_fast_use_mmx, 4
158 mov eax, [edi+lencode_state]
159 mov ecx, [edi+distcode_state]
165 mov ecx, [edi+lenbits_state]
171 mov ecx, [edi+distbits_state]
176 mov eax, [edi+wsize_state]
177 mov ecx, [edi+write_state]
178 mov edx, [edi+window_state]
184 mov ebp, [edi+hold_state]
185 mov ebx, [edi+bits_state]
222 cmp dword ptr [inflate_fast_use_mmx],2
232 xor dword ptr [esp],0200000h
260 mov dword ptr [inflate_fast_use_mmx],2
263 mov dword ptr [inflate_fast_use_mmx],3
307 jnz L_test_for_length_base
322 L_test_for_length_base:
329 jz L_test_for_second_level_length
333 jae L_add_bits_to_len
360 ja L_get_distance_code
386 jz L_test_for_second_level_dist
390 jae L_add_bits_to_dist
459 L_test_for_second_level_length:
465 jnz L_test_for_end_of_block
477 L_test_for_second_level_dist:
483 jnz L_invalid_distance_code
503 jb L_invalid_distance_too_far
506 cmp dword ptr [esp+48],0
507 jne L_wrap_around_window
531 L_wrap_around_window:
535 jbe L_contiguous_in_window
560 L_contiguous_in_window:
607 ja L_get_length_code_mmx
616 L_get_length_code_mmx:
628 jnz L_test_for_length_base_mmx
643 L_test_for_length_base_mmx:
649 jz L_test_for_second_level_length_mmx
651 jz L_decode_distance_mmx
657 and ecx, [inflate_fast_mask+eax*4]
660 L_decode_distance_mmx:
664 ja L_get_dist_code_mmx
689 jz L_test_for_second_level_dist_mmx
691 jz L_check_dist_one_mmx
693 L_add_bits_to_dist_mmx:
698 and ecx, [inflate_fast_mask+eax*4]
729 L_check_dist_one_mmx:
731 jne L_check_window_mmx
733 je L_check_window_mmx
750 L_test_for_second_level_length_mmx:
752 jnz L_test_for_end_of_block
757 and ecx, [inflate_fast_mask+eax*4]
763 L_test_for_second_level_dist_mmx:
765 jnz L_invalid_distance_code
770 and ecx, [inflate_fast_mask+eax*4]
785 jb L_invalid_distance_too_far
788 cmp dword ptr [esp+48],0
789 jne L_wrap_around_window_mmx
812 L_wrap_around_window_mmx:
816 jbe L_contiguous_in_window_mmx
840 L_contiguous_in_window_mmx:
864 L_invalid_distance_code:
870 mov ecx, invalid_distance_code_msg
872 jmp L_update_stream_state
874 L_test_for_end_of_block:
881 jz L_invalid_literal_length_code
885 jmp L_update_stream_state
887 L_invalid_literal_length_code:
893 mov ecx, invalid_literal_length_code_msg
895 jmp L_update_stream_state
897 L_invalid_distance_too_far:
902 mov ecx, invalid_distance_too_far_msg
904 jmp L_update_stream_state
906 L_update_stream_state:
914 mov [eax+mode_state],edx
920 cmp dword ptr [inflate_fast_use_mmx],2
937 mov [edx+bits_state],ebx
963 cmp dword ptr [inflate_fast_use_mmx],2
978 mov [edx+hold_state],ebp
985 jbe L_last_is_smaller
1004 jbe L_end_is_smaller