⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 deflate.cod

📁 microsoft visual c++ 2005、windows mobile 5 远程控制PC.通过阅读项目源码能让你熟悉Active Sync RAPI
💻 COD
📖 第 1 页 / 共 5 页
字号:
; Listing generated by Microsoft (R) Optimizing Compiler Version 14.00.50727.762 

	TITLE	d:\src\VS2005\cpp\CeRemoteClient\zlib123\deflate.c
	.686P
	.XMM
	include listing.inc
	.model	flat

INCLUDELIB OLDNAMES

PUBLIC	_deflate_copyright
_deflate_copyright DB ' deflate 1.2.3 Copyright 1995-2005 Jean-loup Gaill'
	DB	'y ', 00H
	ORG $+3
_configuration_table DW 00H
	DW	00H
	DW	00H
	DW	00H
	DD	FLAT:_deflate_stored
	DW	04H
	DW	04H
	DW	08H
	DW	04H
	DD	FLAT:_deflate_fast
	DW	04H
	DW	05H
	DW	010H
	DW	08H
	DD	FLAT:_deflate_fast
	DW	04H
	DW	06H
	DW	020H
	DW	020H
	DD	FLAT:_deflate_fast
	DW	04H
	DW	04H
	DW	010H
	DW	010H
	DD	FLAT:_deflate_slow
	DW	08H
	DW	010H
	DW	020H
	DW	020H
	DD	FLAT:_deflate_slow
	DW	08H
	DW	010H
	DW	080H
	DW	080H
	DD	FLAT:_deflate_slow
	DW	08H
	DW	020H
	DW	080H
	DW	0100H
	DD	FLAT:_deflate_slow
	DW	020H
	DW	080H
	DW	0102H
	DW	0400H
	DD	FLAT:_deflate_slow
	DW	020H
	DW	0102H
	DW	0102H
	DW	01000H
	DD	FLAT:_deflate_slow
?my_version@?1??deflateInit2_@@9@9 DB '1.2.3', 00H	; `deflateInit2_'::`2'::my_version
; Function compile flags: /Ogtpy
; File d:\src\vs2005\cpp\ceremoteclient\zlib123\deflate.c
;	COMDAT _longest_match_fast
_TEXT	SEGMENT
_cur_match$ = 8						; size = 4
_longest_match_fast PROC				; COMDAT
; _s$ = esi

; 1179 :     register Bytef *scan = s->window + s->strstart; /* current string */

  00000	8b 4e 38	 mov	 ecx, DWORD PTR [esi+56]
  00003	8b 46 6c	 mov	 eax, DWORD PTR [esi+108]
  00006	55		 push	 ebp
  00007	8b 6c 24 08	 mov	 ebp, DWORD PTR _cur_match$[esp]

; 1180 :     register Bytef *match;                       /* matched string */
; 1181 :     register int len;                           /* length of current match */
; 1182 :     register Bytef *strend = s->window + s->strstart + MAX_MATCH;
; 1183 : 
; 1184 :     /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
; 1185 :      * It is easy to get rid of this optimization if necessary.
; 1186 :      */
; 1187 :     Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
; 1188 : 
; 1189 :     Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
; 1190 : 
; 1191 :     Assert(cur_match < s->strstart, "no future");
; 1192 : 
; 1193 :     match = s->window + cur_match;
; 1194 : 
; 1195 :     /* Return failure if the match length is less than 2:
; 1196 :      */
; 1197 :     if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;

  0000b	8a 14 29	 mov	 dl, BYTE PTR [ecx+ebp]
  0000e	03 c1		 add	 eax, ecx
  00010	03 cd		 add	 ecx, ebp
  00012	3a 10		 cmp	 dl, BYTE PTR [eax]
  00014	57		 push	 edi
  00015	8d b8 02 01 00
	00		 lea	 edi, DWORD PTR [eax+258]
  0001b	0f 85 99 00 00
	00		 jne	 $LN6@longest_ma@2
  00021	8a 51 01	 mov	 dl, BYTE PTR [ecx+1]
  00024	3a 50 01	 cmp	 dl, BYTE PTR [eax+1]
  00027	0f 85 8d 00 00
	00		 jne	 $LN6@longest_ma@2

; 1198 : 
; 1199 :     /* The check at best_len-1 can be removed because it will be made
; 1200 :      * again later. (This heuristic is not always a win.)
; 1201 :      * It is not necessary to compare scan[2] and match[2] since they
; 1202 :      * are always equal when the other bytes match, given that
; 1203 :      * the hash keys are equal and that HASH_BITS >= 8.
; 1204 :      */
; 1205 :     scan += 2, match += 2;

  0002d	83 c0 02	 add	 eax, 2
  00030	83 c1 02	 add	 ecx, 2
$LL5@longest_ma@2:

; 1206 :     Assert(*scan == *match, "match[2]?");
; 1207 : 
; 1208 :     /* We check for insufficient lookahead only every 8th comparison;
; 1209 :      * the 256th check will be made at strstart+258.
; 1210 :      */
; 1211 :     do {
; 1212 :     } while (*++scan == *++match && *++scan == *++match &&
; 1213 :              *++scan == *++match && *++scan == *++match &&
; 1214 :              *++scan == *++match && *++scan == *++match &&
; 1215 :              *++scan == *++match && *++scan == *++match &&
; 1216 :              scan < strend);

  00033	8a 50 01	 mov	 dl, BYTE PTR [eax+1]
  00036	83 c0 01	 add	 eax, 1
  00039	83 c1 01	 add	 ecx, 1
  0003c	3a 11		 cmp	 dl, BYTE PTR [ecx]
  0003e	75 5f		 jne	 SHORT $LN2@longest_ma@2
  00040	8a 50 01	 mov	 dl, BYTE PTR [eax+1]
  00043	83 c0 01	 add	 eax, 1
  00046	83 c1 01	 add	 ecx, 1
  00049	3a 11		 cmp	 dl, BYTE PTR [ecx]
  0004b	75 52		 jne	 SHORT $LN2@longest_ma@2
  0004d	8a 50 01	 mov	 dl, BYTE PTR [eax+1]
  00050	83 c0 01	 add	 eax, 1
  00053	83 c1 01	 add	 ecx, 1
  00056	3a 11		 cmp	 dl, BYTE PTR [ecx]
  00058	75 45		 jne	 SHORT $LN2@longest_ma@2
  0005a	8a 50 01	 mov	 dl, BYTE PTR [eax+1]
  0005d	83 c0 01	 add	 eax, 1
  00060	83 c1 01	 add	 ecx, 1
  00063	3a 11		 cmp	 dl, BYTE PTR [ecx]
  00065	75 38		 jne	 SHORT $LN2@longest_ma@2
  00067	8a 50 01	 mov	 dl, BYTE PTR [eax+1]
  0006a	83 c0 01	 add	 eax, 1
  0006d	83 c1 01	 add	 ecx, 1
  00070	3a 11		 cmp	 dl, BYTE PTR [ecx]
  00072	75 2b		 jne	 SHORT $LN2@longest_ma@2
  00074	8a 50 01	 mov	 dl, BYTE PTR [eax+1]
  00077	83 c0 01	 add	 eax, 1
  0007a	83 c1 01	 add	 ecx, 1
  0007d	3a 11		 cmp	 dl, BYTE PTR [ecx]
  0007f	75 1e		 jne	 SHORT $LN2@longest_ma@2
  00081	8a 50 01	 mov	 dl, BYTE PTR [eax+1]
  00084	83 c0 01	 add	 eax, 1
  00087	83 c1 01	 add	 ecx, 1
  0008a	3a 11		 cmp	 dl, BYTE PTR [ecx]
  0008c	75 11		 jne	 SHORT $LN2@longest_ma@2
  0008e	8a 50 01	 mov	 dl, BYTE PTR [eax+1]
  00091	83 c0 01	 add	 eax, 1
  00094	83 c1 01	 add	 ecx, 1
  00097	3a 11		 cmp	 dl, BYTE PTR [ecx]
  00099	75 04		 jne	 SHORT $LN2@longest_ma@2
  0009b	3b c7		 cmp	 eax, edi
  0009d	72 94		 jb	 SHORT $LL5@longest_ma@2
$LN2@longest_ma@2:

; 1217 : 
; 1218 :     Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
; 1219 : 
; 1220 :     len = MAX_MATCH - (int)(strend - scan);

  0009f	2b c7		 sub	 eax, edi
  000a1	05 02 01 00 00	 add	 eax, 258		; 00000102H

; 1221 : 
; 1222 :     if (len < MIN_MATCH) return MIN_MATCH - 1;

  000a6	83 f8 03	 cmp	 eax, 3
  000a9	7c 0f		 jl	 SHORT $LN6@longest_ma@2

; 1223 : 
; 1224 :     s->match_start = cur_match;
; 1225 :     return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;

  000ab	8b 4e 74	 mov	 ecx, DWORD PTR [esi+116]
  000ae	3b c1		 cmp	 eax, ecx
  000b0	89 6e 70	 mov	 DWORD PTR [esi+112], ebp
  000b3	76 0a		 jbe	 SHORT $LN8@longest_ma@2
  000b5	5f		 pop	 edi
  000b6	8b c1		 mov	 eax, ecx
  000b8	5d		 pop	 ebp

; 1226 : }

  000b9	c3		 ret	 0
$LN6@longest_ma@2:

; 1180 :     register Bytef *match;                       /* matched string */
; 1181 :     register int len;                           /* length of current match */
; 1182 :     register Bytef *strend = s->window + s->strstart + MAX_MATCH;
; 1183 : 
; 1184 :     /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
; 1185 :      * It is easy to get rid of this optimization if necessary.
; 1186 :      */
; 1187 :     Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
; 1188 : 
; 1189 :     Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
; 1190 : 
; 1191 :     Assert(cur_match < s->strstart, "no future");
; 1192 : 
; 1193 :     match = s->window + cur_match;
; 1194 : 
; 1195 :     /* Return failure if the match length is less than 2:
; 1196 :      */
; 1197 :     if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;

  000ba	b8 02 00 00 00	 mov	 eax, 2
$LN8@longest_ma@2:
  000bf	5f		 pop	 edi
  000c0	5d		 pop	 ebp

; 1226 : }

  000c1	c3		 ret	 0
_longest_match_fast ENDP
; Function compile flags: /Ogtpy
_TEXT	ENDS
;	COMDAT _lm_init
_TEXT	SEGMENT
_lm_init PROC						; COMDAT
; _s$ = esi

; 989  :     s->window_size = (ulg)2L*s->w_size;

  00000	8b 46 2c	 mov	 eax, DWORD PTR [esi+44]

; 990  : 
; 991  :     CLEAR_HASH(s);

  00003	8b 4e 4c	 mov	 ecx, DWORD PTR [esi+76]
  00006	8b 56 44	 mov	 edx, DWORD PTR [esi+68]
  00009	57		 push	 edi
  0000a	03 c0		 add	 eax, eax
  0000c	89 46 3c	 mov	 DWORD PTR [esi+60], eax
  0000f	33 ff		 xor	 edi, edi
  00011	66 89 7c 4a fe	 mov	 WORD PTR [edx+ecx*2-2], di
  00016	8b 46 4c	 mov	 eax, DWORD PTR [esi+76]
  00019	8b 56 44	 mov	 edx, DWORD PTR [esi+68]
  0001c	8d 4c 00 fe	 lea	 ecx, DWORD PTR [eax+eax-2]
  00020	51		 push	 ecx
  00021	57		 push	 edi
  00022	52		 push	 edx
  00023	e8 00 00 00 00	 call	 _memset

; 992  : 
; 993  :     /* Set the default configuration parameters:
; 994  :      */
; 995  :     s->max_lazy_match   = configuration_table[s->level].max_lazy;

  00028	8b 86 84 00 00
	00		 mov	 eax, DWORD PTR [esi+132]
  0002e	8d 04 40	 lea	 eax, DWORD PTR [eax+eax*2]
  00031	03 c0		 add	 eax, eax
  00033	0f b7 8c 00 02
	00 00 00	 movzx	 ecx, WORD PTR _configuration_table[eax+eax+2]
  0003b	83 c4 0c	 add	 esp, 12			; 0000000cH
  0003e	03 c0		 add	 eax, eax
  00040	89 8e 80 00 00
	00		 mov	 DWORD PTR [esi+128], ecx

; 996  :     s->good_match       = configuration_table[s->level].good_length;

  00046	0f b7 90 00 00
	00 00		 movzx	 edx, WORD PTR _configuration_table[eax]
  0004d	89 96 8c 00 00
	00		 mov	 DWORD PTR [esi+140], edx

; 997  :     s->nice_match       = configuration_table[s->level].nice_length;

  00053	0f b7 88 04 00
	00 00		 movzx	 ecx, WORD PTR _configuration_table[eax+4]
  0005a	89 8e 90 00 00
	00		 mov	 DWORD PTR [esi+144], ecx

; 998  :     s->max_chain_length = configuration_table[s->level].max_chain;

  00060	0f b7 90 06 00
	00 00		 movzx	 edx, WORD PTR _configuration_table[eax+6]

; 999  : 
; 1000 :     s->strstart = 0;
; 1001 :     s->block_start = 0L;
; 1002 :     s->lookahead = 0;
; 1003 :     s->match_length = s->prev_length = MIN_MATCH-1;

  00067	b8 02 00 00 00	 mov	 eax, 2
  0006c	89 7e 6c	 mov	 DWORD PTR [esi+108], edi
  0006f	89 7e 5c	 mov	 DWORD PTR [esi+92], edi
  00072	89 7e 74	 mov	 DWORD PTR [esi+116], edi

; 1004 :     s->match_available = 0;

  00075	89 7e 68	 mov	 DWORD PTR [esi+104], edi

; 1005 :     s->ins_h = 0;

  00078	89 7e 48	 mov	 DWORD PTR [esi+72], edi
  0007b	89 56 7c	 mov	 DWORD PTR [esi+124], edx
  0007e	89 46 78	 mov	 DWORD PTR [esi+120], eax
  00081	89 46 60	 mov	 DWORD PTR [esi+96], eax
  00084	5f		 pop	 edi

; 1006 : #ifndef FASTEST
; 1007 : #ifdef ASMV
; 1008 :     match_init(); /* initialize the asm code */

  00085	e9 00 00 00 00	 jmp	 _match_init
_lm_init ENDP
_TEXT	ENDS
PUBLIC	_deflateEnd@4
; Function compile flags: /Ogtpy
;	COMDAT _deflateEnd@4
_TEXT	SEGMENT
_strm$ = 8						; size = 4
_deflateEnd@4 PROC					; COMDAT

; 861  : {

  00000	56		 push	 esi

; 862  :     int status;
; 863  : 
; 864  :     if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;

  00001	8b 74 24 08	 mov	 esi, DWORD PTR _strm$[esp]
  00005	85 f6		 test	 esi, esi
  00007	0f 84 c2 00 00
	00		 je	 $LN6@deflateEnd
  0000d	8b 46 1c	 mov	 eax, DWORD PTR [esi+28]
  00010	85 c0		 test	 eax, eax
  00012	0f 84 b7 00 00
	00		 je	 $LN6@deflateEnd
  00018	57		 push	 edi

; 865  : 
; 866  :     status = strm->state->status;

  00019	8b 78 04	 mov	 edi, DWORD PTR [eax+4]

; 867  :     if (status != INIT_STATE &&
; 868  :         status != EXTRA_STATE &&
; 869  :         status != NAME_STATE &&
; 870  :         status != COMMENT_STATE &&
; 871  :         status != HCRC_STATE &&
; 872  :         status != BUSY_STATE &&
; 873  :         status != FINISH_STATE) {

  0001c	83 ff 2a	 cmp	 edi, 42			; 0000002aH
  0001f	74 2b		 je	 SHORT $LN5@deflateEnd
  00021	83 ff 45	 cmp	 edi, 69			; 00000045H
  00024	74 26		 je	 SHORT $LN5@deflateEnd
  00026	83 ff 49	 cmp	 edi, 73			; 00000049H
  00029	74 21		 je	 SHORT $LN5@deflateEnd
  0002b	83 ff 5b	 cmp	 edi, 91			; 0000005bH
  0002e	74 1c		 je	 SHORT $LN5@deflateEnd
  00030	83 ff 67	 cmp	 edi, 103		; 00000067H
  00033	74 17		 je	 SHORT $LN5@deflateEnd
  00035	83 ff 71	 cmp	 edi, 113		; 00000071H
  00038	74 12		 je	 SHORT $LN5@deflateEnd
  0003a	81 ff 9a 02 00
	00		 cmp	 edi, 666		; 0000029aH
  00040	74 0a		 je	 SHORT $LN5@deflateEnd
  00042	5f		 pop	 edi

; 874  :       return Z_STREAM_ERROR;

  00043	b8 fe ff ff ff	 mov	 eax, -2			; fffffffeH
  00048	5e		 pop	 esi

; 887  : }

  00049	c2 04 00	 ret	 4
$LN5@deflateEnd:

; 875  :     }
; 876  : 
; 877  :     /* Deallocate in reverse order of allocations: */
; 878  :     TRY_FREE(strm, strm->state->pending_buf);

  0004c	8b 40 08	 mov	 eax, DWORD PTR [eax+8]
  0004f	85 c0		 test	 eax, eax
  00051	74 0d		 je	 SHORT $LN4@deflateEnd
  00053	8b 4e 24	 mov	 ecx, DWORD PTR [esi+36]
  00056	50		 push	 eax
  00057	8b 46 28	 mov	 eax, DWORD PTR [esi+40]
  0005a	50		 push	 eax
  0005b	ff d1		 call	 ecx
  0005d	83 c4 08	 add	 esp, 8
$LN4@deflateEnd:

; 879  :     TRY_FREE(strm, strm->state->head);

  00060	8b 56 1c	 mov	 edx, DWORD PTR [esi+28]
  00063	8b 42 44	 mov	 eax, DWORD PTR [edx+68]
  00066	85 c0		 test	 eax, eax
  00068	74 0d		 je	 SHORT $LN3@deflateEnd
  0006a	8b 4e 24	 mov	 ecx, DWORD PTR [esi+36]
  0006d	50		 push	 eax
  0006e	8b 46 28	 mov	 eax, DWORD PTR [esi+40]
  00071	50		 push	 eax
  00072	ff d1		 call	 ecx
  00074	83 c4 08	 add	 esp, 8
$LN3@deflateEnd:

; 880  :     TRY_FREE(strm, strm->state->prev);

  00077	8b 56 1c	 mov	 edx, DWORD PTR [esi+28]

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -