1 ; Listing generated by Microsoft (R) Optimizing Compiler Version 16.00.30319.01
\r
3 TITLE C:\Workspaces\Sysdyn\org.simantics.fmu\FMUSolution\zlib-1.2.6\inffast.c
\r
11 PUBLIC _inflate_fast
\r
12 ; Function compile flags: /Ogtp
\r
13 ; File c:\workspaces\sysdyn\org.simantics.fmu\fmusolution\zlib-1.2.6\inffast.c
\r
14 ; COMDAT _inflate_fast
\r
16 _lmask$ = -60 ; size = 4
\r
17 _whave$ = -56 ; size = 4
\r
18 _beg$ = -52 ; size = 4
\r
19 _dmask$ = -48 ; size = 4
\r
20 _end$ = -44 ; size = 4
\r
21 _window$ = -40 ; size = 4
\r
22 _wsize$ = -36 ; size = 4
\r
23 _dcode$ = -32 ; size = 4
\r
24 _lcode$ = -28 ; size = 4
\r
25 tv565 = -24 ; size = 4
\r
26 tv563 = -24 ; size = 4
\r
27 _op$ = -24 ; size = 4
\r
28 _here$ = -24 ; size = 4
\r
29 _wnext$ = -20 ; size = 4
\r
30 _state$ = -16 ; size = 4
\r
31 _last$ = -12 ; size = 4
\r
32 _dist$ = -8 ; size = 4
\r
33 _in$ = -4 ; size = 4
\r
34 _strm$ = 8 ; size = 4
\r
35 tv870 = 12 ; size = 4
\r
36 tv567 = 12 ; size = 4
\r
37 _len$ = 12 ; size = 4
\r
38 _start$ = 12 ; size = 4
\r
39 _inflate_fast PROC ; COMDAT
\r
44 00001 8b ec mov ebp, esp
\r
45 00003 83 ec 3c sub esp, 60 ; 0000003cH
\r
47 ; 99 : in = strm->next_in - OFF;
\r
51 ; 100 : last = in + (strm->avail_in - 5);
\r
52 ; 101 : out = strm->next_out - OFF;
\r
53 ; 102 : beg = out - (start - strm->avail_out);
\r
54 ; 103 : end = out + (strm->avail_out - 257);
\r
55 ; 104 : #ifdef INFLATE_STRICT
\r
56 ; 105 : dmax = state->dmax;
\r
58 ; 107 : wsize = state->wsize;
\r
59 ; 108 : whave = state->whave;
\r
60 ; 109 : wnext = state->wnext;
\r
61 ; 110 : window = state->window;
\r
62 ; 111 : hold = state->hold;
\r
66 ; 116 : dmask = (1U << state->distbits) - 1;
\r
70 ; 71 : struct inflate_state FAR *state;
\r
71 ; 72 : unsigned char FAR *in; /* local strm->next_in */
\r
72 ; 73 : unsigned char FAR *last; /* while in < last, enough input available */
\r
73 ; 74 : unsigned char FAR *out; /* local strm->next_out */
\r
74 ; 75 : unsigned char FAR *beg; /* inflate()'s initial strm->next_out */
\r
75 ; 76 : unsigned char FAR *end; /* while out < end, enough space available */
\r
76 ; 77 : #ifdef INFLATE_STRICT
\r
77 ; 78 : unsigned dmax; /* maximum distance from zlib header */
\r
79 ; 80 : unsigned wsize; /* window size or zero if not using window */
\r
80 ; 81 : unsigned whave; /* valid bytes in the window */
\r
81 ; 82 : unsigned wnext; /* window write index */
\r
82 ; 83 : unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */
\r
83 ; 84 : unsigned long hold; /* local strm->hold */
\r
84 ; 85 : unsigned bits; /* local strm->bits */
\r
85 ; 86 : code const FAR *lcode; /* local strm->lencode */
\r
86 ; 87 : code const FAR *dcode; /* local strm->distcode */
\r
87 ; 88 : unsigned lmask; /* mask for first level of length codes */
\r
88 ; 89 : unsigned dmask; /* mask for first level of distance codes */
\r
89 ; 90 : code here; /* retrieved table entry */
\r
90 ; 91 : unsigned op; /* code bits, operation, extra bits, or */
\r
91 ; 92 : /* window position, window bytes to copy */
\r
92 ; 93 : unsigned len; /* match length, unused bytes */
\r
93 ; 94 : unsigned dist; /* match distance */
\r
94 ; 95 : unsigned char FAR *from; /* where to copy match from */
\r
96 ; 97 : /* copy state to local variables */
\r
97 ; 98 : state = (struct inflate_state FAR *)strm->state;
\r
99 00009 8b 4d 08 mov ecx, DWORD PTR _strm$[ebp]
\r
100 0000c 8b 41 1c mov eax, DWORD PTR [ecx+28]
\r
102 ; 99 : in = strm->next_in - OFF;
\r
104 0000f 8b 11 mov edx, DWORD PTR [ecx]
\r
106 00012 89 55 fc mov DWORD PTR _in$[ebp], edx
\r
108 ; 100 : last = in + (strm->avail_in - 5);
\r
109 ; 101 : out = strm->next_out - OFF;
\r
110 ; 102 : beg = out - (start - strm->avail_out);
\r
111 ; 103 : end = out + (strm->avail_out - 257);
\r
112 ; 104 : #ifdef INFLATE_STRICT
\r
113 ; 105 : dmax = state->dmax;
\r
115 ; 107 : wsize = state->wsize;
\r
116 ; 108 : whave = state->whave;
\r
117 ; 109 : wnext = state->wnext;
\r
118 ; 110 : window = state->window;
\r
119 ; 111 : hold = state->hold;
\r
121 00015 8b 58 38 mov ebx, DWORD PTR [eax+56]
\r
122 00018 8b 71 04 mov esi, DWORD PTR [ecx+4]
\r
123 0001b 8d 54 16 fb lea edx, DWORD PTR [esi+edx-5]
\r
124 0001f 8b 71 0c mov esi, DWORD PTR [ecx+12]
\r
125 00022 8b 49 10 mov ecx, DWORD PTR [ecx+16]
\r
126 00025 89 55 f4 mov DWORD PTR _last$[ebp], edx
\r
127 00028 8b d1 mov edx, ecx
\r
128 0002a 2b 55 0c sub edx, DWORD PTR _start$[ebp]
\r
130 0002e 03 d6 add edx, esi
\r
131 00030 8d 8c 31 ff fe
\r
132 ff ff lea ecx, DWORD PTR [ecx+esi-257]
\r
133 00037 89 55 cc mov DWORD PTR _beg$[ebp], edx
\r
134 0003a 8b 50 28 mov edx, DWORD PTR [eax+40]
\r
135 0003d 89 4d d4 mov DWORD PTR _end$[ebp], ecx
\r
136 00040 8b 48 2c mov ecx, DWORD PTR [eax+44]
\r
137 00043 89 55 dc mov DWORD PTR _wsize$[ebp], edx
\r
138 00046 8b 50 30 mov edx, DWORD PTR [eax+48]
\r
139 00049 89 4d c8 mov DWORD PTR _whave$[ebp], ecx
\r
140 0004c 8b 48 34 mov ecx, DWORD PTR [eax+52]
\r
141 0004f 89 55 ec mov DWORD PTR _wnext$[ebp], edx
\r
143 ; 112 : bits = state->bits;
\r
144 ; 113 : lcode = state->lencode;
\r
146 00052 8b 50 4c mov edx, DWORD PTR [eax+76]
\r
147 00055 89 4d d8 mov DWORD PTR _window$[ebp], ecx
\r
149 ; 114 : dcode = state->distcode;
\r
151 00058 8b 48 50 mov ecx, DWORD PTR [eax+80]
\r
152 0005b 89 55 e4 mov DWORD PTR _lcode$[ebp], edx
\r
153 0005e 89 4d e0 mov DWORD PTR _dcode$[ebp], ecx
\r
155 ; 115 : lmask = (1U << state->lenbits) - 1;
\r
157 00061 8b 48 54 mov ecx, DWORD PTR [eax+84]
\r
158 00064 ba 01 00 00 00 mov edx, 1
\r
159 00069 d3 e2 shl edx, cl
\r
161 ; 116 : dmask = (1U << state->distbits) - 1;
\r
163 0006b 8b 48 58 mov ecx, DWORD PTR [eax+88]
\r
164 0006e 89 45 f0 mov DWORD PTR _state$[ebp], eax
\r
165 00071 8b 78 3c mov edi, DWORD PTR [eax+60]
\r
166 00074 c7 45 0c 01 00
\r
167 00 00 mov DWORD PTR tv870[ebp], 1
\r
168 0007b 8b 45 0c mov eax, DWORD PTR tv870[ebp]
\r
169 0007e d3 e0 shl eax, cl
\r
171 00081 89 55 c4 mov DWORD PTR _lmask$[ebp], edx
\r
173 00085 89 45 d0 mov DWORD PTR _dmask$[ebp], eax
\r
177 ; 118 : /* decode literals and length/distances until end-of-block or not enough
\r
178 ; 119 : input data or output space */
\r
180 ; 121 : if (bits < 15) {
\r
182 00088 83 ff 0f cmp edi, 15 ; 0000000fH
\r
183 0008b 73 24 jae SHORT $LN52@inflate_fa
\r
185 ; 122 : hold += (unsigned long)(PUP(in)) << bits;
\r
187 0008d 8b 45 fc mov eax, DWORD PTR _in$[ebp]
\r
189 00091 89 45 fc mov DWORD PTR _in$[ebp], eax
\r
190 00094 0f b6 00 movzx eax, BYTE PTR [eax]
\r
191 00097 8b cf mov ecx, edi
\r
192 00099 d3 e0 shl eax, cl
\r
195 ; 124 : hold += (unsigned long)(PUP(in)) << bits;
\r
197 0009b 8d 4f 08 lea ecx, DWORD PTR [edi+8]
\r
198 0009e 03 d8 add ebx, eax
\r
199 000a0 8b 45 fc mov eax, DWORD PTR _in$[ebp]
\r
201 000a4 89 45 fc mov DWORD PTR _in$[ebp], eax
\r
202 000a7 0f b6 00 movzx eax, BYTE PTR [eax]
\r
203 000aa d3 e0 shl eax, cl
\r
204 000ac 03 d8 add ebx, eax
\r
208 000ae 83 c7 10 add edi, 16 ; 00000010H
\r
212 ; 127 : here = lcode[hold & lmask];
\r
214 000b1 8b 4d e4 mov ecx, DWORD PTR _lcode$[ebp]
\r
215 000b4 23 d3 and edx, ebx
\r
216 000b6 8b 04 91 mov eax, DWORD PTR [ecx+edx*4]
\r
219 ; 129 : op = (unsigned)(here.bits);
\r
221 000b9 8b d0 mov edx, eax
\r
222 000bb c1 ea 08 shr edx, 8
\r
223 000be 0f b6 ca movzx ecx, dl
\r
225 ; 130 : hold >>= op;
\r
227 000c1 d3 eb shr ebx, cl
\r
229 ; 131 : bits -= op;
\r
231 000c3 2b f9 sub edi, ecx
\r
233 ; 132 : op = (unsigned)(here.op);
\r
235 000c5 0f b6 d0 movzx edx, al
\r
237 ; 133 : if (op == 0) { /* literal */
\r
239 000c8 84 c0 test al, al
\r
240 000ca 74 3c je SHORT $LN72@inflate_fa
\r
241 000cc 8d 64 24 00 npad 4
\r
245 ; 139 : else if (op & 16) { /* length base */
\r
247 000d0 f6 c2 10 test dl, 16 ; 00000010H
\r
248 000d3 75 3c jne SHORT $LN73@inflate_fa
\r
252 ; 293 : else if ((op & 64) == 0) { /* 2nd level length code */
\r
254 000d5 f6 c2 40 test dl, 64 ; 00000040H
\r
255 000d8 0f 85 ab 02 00
\r
256 00 jne $LN5@inflate_fa
\r
258 ; 294 : here = lcode[here.val + (hold & ((1U << op) - 1))];
\r
260 000de 8b ca mov ecx, edx
\r
261 000e0 ba 01 00 00 00 mov edx, 1
\r
262 000e5 d3 e2 shl edx, cl
\r
263 000e7 c1 e8 10 shr eax, 16 ; 00000010H
\r
265 000eb 23 d3 and edx, ebx
\r
266 000ed 03 d0 add edx, eax
\r
267 000ef 8b 45 e4 mov eax, DWORD PTR _lcode$[ebp]
\r
268 000f2 8b 04 90 mov eax, DWORD PTR [eax+edx*4]
\r
269 000f5 8b c8 mov ecx, eax
\r
270 000f7 c1 e9 08 shr ecx, 8
\r
271 000fa 0f b6 c9 movzx ecx, cl
\r
272 000fd d3 eb shr ebx, cl
\r
273 000ff 2b f9 sub edi, ecx
\r
274 00101 0f b6 d0 movzx edx, al
\r
275 00104 84 c0 test al, al
\r
276 00106 75 c8 jne SHORT $dolen$80287
\r
279 ; 134 : Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
\r
280 ; 135 : "inflate: literal '%c'\n" :
\r
281 ; 136 : "inflate: literal 0x%02x\n", here.val));
\r
282 ; 137 : PUP(out) = (unsigned char)(here.val);
\r
285 00109 c1 e8 10 shr eax, 16 ; 00000010H
\r
286 0010c e9 49 02 00 00 jmp $LN84@inflate_fa
\r
289 ; 140 : len = (unsigned)(here.val);
\r
291 00111 c1 e8 10 shr eax, 16 ; 00000010H
\r
293 ; 141 : op &= 15; /* number of extra bits */
\r
295 00114 83 e2 0f and edx, 15 ; 0000000fH
\r
296 00117 89 45 0c mov DWORD PTR _len$[ebp], eax
\r
300 0011a 74 2a je SHORT $LN48@inflate_fa
\r
302 ; 143 : if (bits < op) {
\r
304 0011c 3b fa cmp edi, edx
\r
305 0011e 73 13 jae SHORT $LN47@inflate_fa
\r
307 ; 144 : hold += (unsigned long)(PUP(in)) << bits;
\r
309 00120 8b 45 fc mov eax, DWORD PTR _in$[ebp]
\r
311 00124 89 45 fc mov DWORD PTR _in$[ebp], eax
\r
312 00127 0f b6 00 movzx eax, BYTE PTR [eax]
\r
313 0012a 8b cf mov ecx, edi
\r
314 0012c d3 e0 shl eax, cl
\r
315 0012e 03 d8 add ebx, eax
\r
319 00130 83 c7 08 add edi, 8
\r
323 ; 147 : len += (unsigned)hold & ((1U << op) - 1);
\r
325 00133 8b ca mov ecx, edx
\r
326 00135 b8 01 00 00 00 mov eax, 1
\r
327 0013a d3 e0 shl eax, cl
\r
329 0013d 23 c3 and eax, ebx
\r
330 0013f 01 45 0c add DWORD PTR _len$[ebp], eax
\r
332 ; 148 : hold >>= op;
\r
334 00142 d3 eb shr ebx, cl
\r
336 ; 149 : bits -= op;
\r
338 00144 2b fa sub edi, edx
\r
342 ; 151 : Tracevv((stderr, "inflate: length %u\n", len));
\r
343 ; 152 : if (bits < 15) {
\r
345 00146 83 ff 0f cmp edi, 15 ; 0000000fH
\r
346 00149 73 20 jae SHORT $LN46@inflate_fa
\r
348 ; 153 : hold += (unsigned long)(PUP(in)) << bits;
\r
350 0014b 8b 45 fc mov eax, DWORD PTR _in$[ebp]
\r
351 0014e 0f b6 50 01 movzx edx, BYTE PTR [eax+1]
\r
354 ; 155 : hold += (unsigned long)(PUP(in)) << bits;
\r
356 00152 83 c0 02 add eax, 2
\r
357 00155 8b cf mov ecx, edi
\r
358 00157 89 45 fc mov DWORD PTR _in$[ebp], eax
\r
359 0015a 0f b6 00 movzx eax, BYTE PTR [eax]
\r
360 0015d d3 e2 shl edx, cl
\r
361 0015f 8d 4f 08 lea ecx, DWORD PTR [edi+8]
\r
362 00162 d3 e0 shl eax, cl
\r
363 00164 03 da add ebx, edx
\r
364 00166 03 d8 add ebx, eax
\r
368 00168 83 c7 10 add edi, 16 ; 00000010H
\r
372 ; 158 : here = dcode[hold & dmask];
\r
374 0016b 8b 4d d0 mov ecx, DWORD PTR _dmask$[ebp]
\r
375 0016e 8b 55 e0 mov edx, DWORD PTR _dcode$[ebp]
\r
376 00171 23 cb and ecx, ebx
\r
377 00173 8b 14 8a mov edx, DWORD PTR [edx+ecx*4]
\r
380 ; 160 : op = (unsigned)(here.bits);
\r
382 00176 8b c2 mov eax, edx
\r
383 00178 c1 e8 08 shr eax, 8
\r
384 0017b 0f b6 c8 movzx ecx, al
\r
386 ; 161 : hold >>= op;
\r
387 ; 162 : bits -= op;
\r
388 ; 163 : op = (unsigned)(here.op);
\r
390 0017e 0f b6 c2 movzx eax, dl
\r
391 00181 d3 eb shr ebx, cl
\r
392 00183 2b f9 sub edi, ecx
\r
393 00185 89 55 e8 mov DWORD PTR _here$[ebp], edx
\r
395 ; 164 : if (op & 16) { /* distance base */
\r
397 00188 a8 10 test al, 16 ; 00000010H
\r
398 0018a 75 3a jne SHORT $LN74@inflate_fa
\r
399 0018c 8d 64 24 00 npad 4
\r
405 ; 283 : else if ((op & 64) == 0) { /* 2nd level distance code */
\r
407 00190 a8 40 test al, 64 ; 00000040H
\r
408 00192 0f 85 e5 01 00
\r
409 00 jne $LN8@inflate_fa
\r
411 ; 284 : here = dcode[here.val + (hold & ((1U << op) - 1))];
\r
413 00198 8b c8 mov ecx, eax
\r
414 0019a 0f b7 45 ea movzx eax, WORD PTR _here$[ebp+2]
\r
415 0019e ba 01 00 00 00 mov edx, 1
\r
416 001a3 d3 e2 shl edx, cl
\r
417 001a5 8b 4d e0 mov ecx, DWORD PTR _dcode$[ebp]
\r
419 001a9 23 d3 and edx, ebx
\r
420 001ab 03 d0 add edx, eax
\r
421 001ad 8b 14 91 mov edx, DWORD PTR [ecx+edx*4]
\r
422 001b0 8b c2 mov eax, edx
\r
423 001b2 c1 e8 08 shr eax, 8
\r
424 001b5 0f b6 c8 movzx ecx, al
\r
425 001b8 0f b6 c2 movzx eax, dl
\r
426 001bb d3 eb shr ebx, cl
\r
427 001bd 2b f9 sub edi, ecx
\r
428 001bf 89 55 e8 mov DWORD PTR _here$[ebp], edx
\r
429 001c2 a8 10 test al, 16 ; 00000010H
\r
430 001c4 74 ca je SHORT $dodist$80302
\r
433 ; 165 : dist = (unsigned)(here.val);
\r
435 001c6 c1 ea 10 shr edx, 16 ; 00000010H
\r
437 ; 166 : op &= 15; /* number of extra bits */
\r
439 001c9 83 e0 0f and eax, 15 ; 0000000fH
\r
440 001cc 89 55 f8 mov DWORD PTR _dist$[ebp], edx
\r
442 ; 167 : if (bits < op) {
\r
444 001cf 3b f8 cmp edi, eax
\r
445 001d1 73 2c jae SHORT $LN43@inflate_fa
\r
447 ; 168 : hold += (unsigned long)(PUP(in)) << bits;
\r
449 001d3 8b 4d fc mov ecx, DWORD PTR _in$[ebp]
\r
450 001d6 0f b6 51 01 movzx edx, BYTE PTR [ecx+1]
\r
452 001db 89 4d fc mov DWORD PTR _in$[ebp], ecx
\r
453 001de 8b cf mov ecx, edi
\r
454 001e0 d3 e2 shl edx, cl
\r
458 001e2 83 c7 08 add edi, 8
\r
459 001e5 03 da add ebx, edx
\r
461 ; 170 : if (bits < op) {
\r
463 001e7 3b f8 cmp edi, eax
\r
464 001e9 73 14 jae SHORT $LN43@inflate_fa
\r
466 ; 171 : hold += (unsigned long)(PUP(in)) << bits;
\r
468 001eb 8b 4d fc mov ecx, DWORD PTR _in$[ebp]
\r
469 001ee 0f b6 51 01 movzx edx, BYTE PTR [ecx+1]
\r
471 001f3 89 4d fc mov DWORD PTR _in$[ebp], ecx
\r
472 001f6 8b cf mov ecx, edi
\r
473 001f8 d3 e2 shl edx, cl
\r
474 001fa 03 da add ebx, edx
\r
478 001fc 83 c7 08 add edi, 8
\r
483 ; 175 : dist += (unsigned)hold & ((1U << op) - 1);
\r
485 001ff ba 01 00 00 00 mov edx, 1
\r
486 00204 8b c8 mov ecx, eax
\r
487 00206 d3 e2 shl edx, cl
\r
489 ; 176 : #ifdef INFLATE_STRICT
\r
490 ; 177 : if (dist > dmax) {
\r
491 ; 178 : strm->msg = (char *)"invalid distance too far back";
\r
492 ; 179 : state->mode = BAD;
\r
496 ; 183 : hold >>= op;
\r
497 ; 184 : bits -= op;
\r
499 00208 2b f8 sub edi, eax
\r
501 0020b 23 d3 and edx, ebx
\r
502 0020d d3 eb shr ebx, cl
\r
503 0020f 89 55 e8 mov DWORD PTR tv563[ebp], edx
\r
504 00212 8b 55 f8 mov edx, DWORD PTR _dist$[ebp]
\r
505 00215 03 55 e8 add edx, DWORD PTR tv563[ebp]
\r
507 ; 185 : Tracevv((stderr, "inflate: distance %u\n", dist));
\r
508 ; 186 : op = (unsigned)(out - beg); /* max distance in output */
\r
510 00218 8b ce mov ecx, esi
\r
511 0021a 2b 4d cc sub ecx, DWORD PTR _beg$[ebp]
\r
512 0021d 89 55 f8 mov DWORD PTR _dist$[ebp], edx
\r
514 ; 187 : if (dist > op) { /* see if copy from window */
\r
516 00220 3b d1 cmp edx, ecx
\r
517 00222 0f 86 f4 00 00
\r
518 00 jbe $LN42@inflate_fa
\r
520 ; 188 : op = dist - op; /* distance back in window */
\r
522 00228 8b c2 mov eax, edx
\r
523 0022a 2b c1 sub eax, ecx
\r
524 0022c 89 45 e8 mov DWORD PTR _op$[ebp], eax
\r
526 ; 189 : if (op > whave) {
\r
528 0022f 3b 45 c8 cmp eax, DWORD PTR _whave$[ebp]
\r
529 00232 76 10 jbe SHORT $LN79@inflate_fa
\r
531 ; 190 : if (state->sane) {
\r
533 00234 8b 4d f0 mov ecx, DWORD PTR _state$[ebp]
\r
534 00237 83 b9 c0 1b 00
\r
535 00 00 cmp DWORD PTR [ecx+7104], 0
\r
536 0023e 0f 85 2d 01 00
\r
537 00 jne $LN75@inflate_fa
\r
541 ; 196 : #ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
\r
542 ; 197 : if (len <= op - whave) {
\r
544 ; 199 : PUP(out) = 0;
\r
545 ; 200 : } while (--len);
\r
548 ; 203 : len -= op - whave;
\r
550 ; 205 : PUP(out) = 0;
\r
551 ; 206 : } while (--op > whave);
\r
552 ; 207 : if (op == 0) {
\r
553 ; 208 : from = out - dist;
\r
555 ; 210 : PUP(out) = PUP(from);
\r
556 ; 211 : } while (--len);
\r
561 ; 216 : from = window - OFF;
\r
563 00244 8b 4d d8 mov ecx, DWORD PTR _window$[ebp]
\r
565 ; 217 : if (wnext == 0) { /* very common case */
\r
567 00247 8b 55 ec mov edx, DWORD PTR _wnext$[ebp]
\r
569 0024b 85 d2 test edx, edx
\r
570 0024d 75 1d jne SHORT $LN39@inflate_fa
\r
572 ; 218 : from += wsize - op;
\r
574 0024f 8b 55 dc mov edx, DWORD PTR _wsize$[ebp]
\r
575 00252 2b d0 sub edx, eax
\r
576 00254 03 ca add ecx, edx
\r
578 ; 219 : if (op < len) { /* some from window */
\r
580 00256 3b 45 0c cmp eax, DWORD PTR _len$[ebp]
\r
581 00259 73 74 jae SHORT $LN80@inflate_fa
\r
585 0025b 29 45 0c sub DWORD PTR _len$[ebp], eax
\r
590 ; 222 : PUP(out) = PUP(from);
\r
592 00260 8a 51 01 mov dl, BYTE PTR [ecx+1]
\r
596 ; 223 : } while (--op);
\r
599 00266 88 16 mov BYTE PTR [esi], dl
\r
600 00268 75 f6 jne SHORT $LL37@inflate_fa
\r
602 ; 224 : from = out - dist; /* rest from output */
\r
605 0026a eb 5e jmp SHORT $LN85@inflate_fa
\r
609 ; 227 : else if (wnext < op) { /* wrap around window */
\r
611 0026c 3b d0 cmp edx, eax
\r
612 0026e 73 3f jae SHORT $LN33@inflate_fa
\r
614 ; 228 : from += wsize + wnext - op;
\r
616 00270 2b d0 sub edx, eax
\r
617 00272 03 55 dc add edx, DWORD PTR _wsize$[ebp]
\r
619 ; 229 : op -= wnext;
\r
621 00275 8b 45 e8 mov eax, DWORD PTR _op$[ebp]
\r
622 00278 2b 45 ec sub eax, DWORD PTR _wnext$[ebp]
\r
623 0027b 03 ca add ecx, edx
\r
625 ; 230 : if (op < len) { /* some from end of window */
\r
627 0027d 3b 45 0c cmp eax, DWORD PTR _len$[ebp]
\r
628 00280 73 4d jae SHORT $LN80@inflate_fa
\r
632 00282 29 45 0c sub DWORD PTR _len$[ebp], eax
\r
634 ; 234 : } while (--op);
\r
636 00285 2b ce sub ecx, esi
\r
640 ; 233 : PUP(out) = PUP(from);
\r
642 00287 8a 54 31 01 mov dl, BYTE PTR [ecx+esi+1]
\r
645 ; 234 : } while (--op);
\r
648 0028d 88 16 mov BYTE PTR [esi], dl
\r
649 0028f 75 f6 jne SHORT $LL31@inflate_fa
\r
651 ; 235 : from = window - OFF;
\r
653 00291 8b 4d d8 mov ecx, DWORD PTR _window$[ebp]
\r
655 ; 236 : if (wnext < len) { /* some from start of window */
\r
657 00294 8b 45 ec mov eax, DWORD PTR _wnext$[ebp]
\r
659 00298 3b 45 0c cmp eax, DWORD PTR _len$[ebp]
\r
660 0029b 73 32 jae SHORT $LN80@inflate_fa
\r
662 ; 237 : op = wnext;
\r
665 0029d 29 45 0c sub DWORD PTR _len$[ebp], eax
\r
666 002a0 89 45 e8 mov DWORD PTR _op$[ebp], eax
\r
670 ; 240 : PUP(out) = PUP(from);
\r
672 002a3 8a 51 01 mov dl, BYTE PTR [ecx+1]
\r
676 ; 241 : } while (--op);
\r
679 002a9 88 16 mov BYTE PTR [esi], dl
\r
680 002ab 75 f6 jne SHORT $LL27@inflate_fa
\r
682 ; 242 : from = out - dist; /* rest from output */
\r
686 ; 246 : else { /* contiguous in window */
\r
688 002ad eb 1b jmp SHORT $LN85@inflate_fa
\r
691 ; 247 : from += wnext - op;
\r
693 002af 2b d0 sub edx, eax
\r
694 002b1 03 ca add ecx, edx
\r
696 ; 248 : if (op < len) { /* some from window */
\r
698 002b3 3b 45 0c cmp eax, DWORD PTR _len$[ebp]
\r
699 002b6 73 17 jae SHORT $LN80@inflate_fa
\r
703 002b8 29 45 0c sub DWORD PTR _len$[ebp], eax
\r
704 002bb eb 03 8d 49 00 npad 5
\r
708 ; 251 : PUP(out) = PUP(from);
\r
710 002c0 8a 51 01 mov dl, BYTE PTR [ecx+1]
\r
714 ; 252 : } while (--op);
\r
717 002c6 88 16 mov BYTE PTR [esi], dl
\r
718 002c8 75 f6 jne SHORT $LL22@inflate_fa
\r
721 ; 253 : from = out - dist; /* rest from output */
\r
723 002ca 8b ce mov ecx, esi
\r
724 002cc 2b 4d f8 sub ecx, DWORD PTR _dist$[ebp]
\r
729 ; 256 : while (len > 2) {
\r
731 002cf 8b 45 0c mov eax, DWORD PTR _len$[ebp]
\r
732 002d2 83 f8 02 cmp eax, 2
\r
733 002d5 76 2e jbe SHORT $LN18@inflate_fa
\r
734 002d7 8d 50 fd lea edx, DWORD PTR [eax-3]
\r
735 002da b8 ab aa aa aa mov eax, -1431655765 ; aaaaaaabH
\r
736 002df f7 e2 mul edx
\r
737 002e1 d1 ea shr edx, 1
\r
741 ; 257 : PUP(out) = PUP(from);
\r
743 002e4 0f b6 41 01 movzx eax, BYTE PTR [ecx+1]
\r
745 ; 258 : PUP(out) = PUP(from);
\r
746 ; 259 : PUP(out) = PUP(from);
\r
749 002e8 83 6d 0c 03 sub DWORD PTR _len$[ebp], 3
\r
750 002ec 88 46 01 mov BYTE PTR [esi+1], al
\r
751 002ef 0f b6 41 02 movzx eax, BYTE PTR [ecx+2]
\r
752 002f3 88 46 02 mov BYTE PTR [esi+2], al
\r
753 002f6 0f b6 41 03 movzx eax, BYTE PTR [ecx+3]
\r
754 002fa 83 c1 03 add ecx, 3
\r
755 002fd 83 c6 03 add esi, 3
\r
757 00301 88 06 mov BYTE PTR [esi], al
\r
758 00303 75 df jne SHORT $LL19@inflate_fa
\r
764 00305 8b 45 0c mov eax, DWORD PTR _len$[ebp]
\r
765 00308 85 c0 test eax, eax
\r
766 0030a 74 50 je SHORT $LN54@inflate_fa
\r
768 ; 263 : PUP(out) = PUP(from);
\r
770 0030c 8a 51 01 mov dl, BYTE PTR [ecx+1]
\r
772 00310 88 16 mov BYTE PTR [esi], dl
\r
774 ; 264 : if (len > 1)
\r
776 00312 83 f8 01 cmp eax, 1
\r
777 00315 76 45 jbe SHORT $LN54@inflate_fa
\r
779 ; 265 : PUP(out) = PUP(from);
\r
781 00317 8a 41 02 mov al, BYTE PTR [ecx+2]
\r
787 0031a eb 3d jmp SHORT $LN86@inflate_fa
\r
790 ; 269 : from = out - dist; /* copy direct from output */
\r
792 0031c 8b c6 mov eax, esi
\r
793 0031e 2b c2 sub eax, edx
\r
796 ; 270 : do { /* minimum length is three */
\r
797 ; 271 : PUP(out) = PUP(from);
\r
799 00320 0f b6 48 01 movzx ecx, BYTE PTR [eax+1]
\r
800 00324 88 4e 01 mov BYTE PTR [esi+1], cl
\r
802 ; 272 : PUP(out) = PUP(from);
\r
804 00327 8a 50 02 mov dl, BYTE PTR [eax+2]
\r
805 0032a 88 56 02 mov BYTE PTR [esi+2], dl
\r
807 ; 273 : PUP(out) = PUP(from);
\r
809 0032d 0f b6 48 03 movzx ecx, BYTE PTR [eax+3]
\r
810 00331 83 c0 03 add eax, 3
\r
811 00334 83 c6 03 add esi, 3
\r
812 00337 88 0e mov BYTE PTR [esi], cl
\r
816 00339 8b 4d 0c mov ecx, DWORD PTR _len$[ebp]
\r
817 0033c 83 e9 03 sub ecx, 3
\r
818 0033f 89 4d 0c mov DWORD PTR _len$[ebp], ecx
\r
820 ; 275 : } while (len > 2);
\r
822 00342 83 f9 02 cmp ecx, 2
\r
823 00345 77 d9 ja SHORT $LL14@inflate_fa
\r
827 00347 85 c9 test ecx, ecx
\r
828 00349 74 11 je SHORT $LN54@inflate_fa
\r
830 ; 277 : PUP(out) = PUP(from);
\r
832 0034b 8a 50 01 mov dl, BYTE PTR [eax+1]
\r
834 0034f 88 16 mov BYTE PTR [esi], dl
\r
836 ; 278 : if (len > 1)
\r
838 00351 83 f9 01 cmp ecx, 1
\r
839 00354 76 06 jbe SHORT $LN54@inflate_fa
\r
841 ; 279 : PUP(out) = PUP(from);
\r
843 00356 8a 40 02 mov al, BYTE PTR [eax+2]
\r
847 0035a 88 06 mov BYTE PTR [esi], al
\r
852 ; 307 : } while (in < last && out < end);
\r
854 0035c 8b 55 f4 mov edx, DWORD PTR _last$[ebp]
\r
855 0035f 39 55 fc cmp DWORD PTR _in$[ebp], edx
\r
856 00362 73 4b jae SHORT $LN53@inflate_fa
\r
857 00364 3b 75 d4 cmp esi, DWORD PTR _end$[ebp]
\r
858 00367 73 46 jae SHORT $LN53@inflate_fa
\r
860 ; 319 : strm->avail_out = (unsigned)(out < end ?
\r
861 ; 320 : 257 + (end - out) : 257 - (out - end));
\r
863 00369 8b 55 c4 mov edx, DWORD PTR _lmask$[ebp]
\r
864 0036c e9 17 fd ff ff jmp $LL55@inflate_fa
\r
867 ; 191 : strm->msg =
\r
868 ; 192 : (char *)"invalid distance too far back";
\r
870 00371 8b 55 08 mov edx, DWORD PTR _strm$[ebp]
\r
871 00374 c7 42 18 00 00
\r
872 00 00 mov DWORD PTR [edx+24], OFFSET ??_C@_0BO@ECPMAOGG@invalid?5distance?5too?5far?5back?$AA@
\r
874 ; 193 : state->mode = BAD;
\r
877 0037b eb 29 jmp SHORT $LN87@inflate_fa
\r
880 ; 285 : goto dodist;
\r
883 ; 288 : strm->msg = (char *)"invalid distance code";
\r
885 0037d 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
\r
886 00380 c7 40 18 00 00
\r
887 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BG@LBKINIKP@invalid?5distance?5code?$AA@
\r
889 ; 289 : state->mode = BAD;
\r
892 00387 eb 1a jmp SHORT $LN88@inflate_fa
\r
895 ; 295 : goto dolen;
\r
897 ; 297 : else if (op & 32) { /* end-of-block */
\r
899 00389 f6 c2 20 test dl, 32 ; 00000020H
\r
900 0038c 74 0b je SHORT $LN3@inflate_fa
\r
902 ; 298 : Tracevv((stderr, "inflate: end of block\n"));
\r
903 ; 299 : state->mode = TYPE;
\r
905 0038e 8b 55 f0 mov edx, DWORD PTR _state$[ebp]
\r
906 00391 c7 02 0b 00 00
\r
907 00 mov DWORD PTR [edx], 11 ; 0000000bH
\r
911 00397 eb 13 jmp SHORT $LN89@inflate_fa
\r
916 ; 303 : strm->msg = (char *)"invalid literal/length code";
\r
918 00399 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
\r
919 0039c c7 40 18 00 00
\r
920 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BM@FFFLPBBC@invalid?5literal?1length?5code?$AA@
\r
923 ; 304 : state->mode = BAD;
\r
925 003a3 8b 4d f0 mov ecx, DWORD PTR _state$[ebp]
\r
927 003a6 c7 01 1d 00 00
\r
928 00 mov DWORD PTR [ecx], 29 ; 0000001dH
\r
930 003ac 8b 55 f4 mov edx, DWORD PTR _last$[ebp]
\r
934 ; 309 : /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
\r
935 ; 310 : len = bits >> 3;
\r
937 003af 8b c7 mov eax, edi
\r
938 003b1 c1 e8 03 shr eax, 3
\r
942 003b4 29 45 fc sub DWORD PTR _in$[ebp], eax
\r
944 ; 312 : bits -= len << 3;
\r
946 003b7 03 c0 add eax, eax
\r
947 003b9 03 c0 add eax, eax
\r
948 003bb 03 c0 add eax, eax
\r
949 003bd 2b f8 sub edi, eax
\r
951 ; 313 : hold &= (1U << bits) - 1;
\r
953 003bf 8b cf mov ecx, edi
\r
954 003c1 b8 01 00 00 00 mov eax, 1
\r
955 003c6 d3 e0 shl eax, cl
\r
958 ; 315 : /* update state and return */
\r
959 ; 316 : strm->next_in = in + OFF;
\r
961 003c8 8b 4d 08 mov ecx, DWORD PTR _strm$[ebp]
\r
963 003cc 23 d8 and ebx, eax
\r
964 003ce 8b 45 fc mov eax, DWORD PTR _in$[ebp]
\r
966 003d2 89 01 mov DWORD PTR [ecx], eax
\r
968 ; 317 : strm->next_out = out + OFF;
\r
970 003d4 8d 46 01 lea eax, DWORD PTR [esi+1]
\r
971 003d7 89 41 0c mov DWORD PTR [ecx+12], eax
\r
973 ; 318 : strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
\r
975 003da 8b 45 fc mov eax, DWORD PTR _in$[ebp]
\r
976 003dd 2b d0 sub edx, eax
\r
978 ; 319 : strm->avail_out = (unsigned)(out < end ?
\r
979 ; 320 : 257 + (end - out) : 257 - (out - end));
\r
981 003df 8b 45 d4 mov eax, DWORD PTR _end$[ebp]
\r
982 003e2 2b c6 sub eax, esi
\r
983 003e4 83 c2 05 add edx, 5
\r
984 003e7 05 01 01 00 00 add eax, 257 ; 00000101H
\r
985 003ec 89 41 10 mov DWORD PTR [ecx+16], eax
\r
987 ; 321 : state->hold = hold;
\r
989 003ef 8b 45 f0 mov eax, DWORD PTR _state$[ebp]
\r
990 003f2 89 51 04 mov DWORD PTR [ecx+4], edx
\r
992 ; 322 : state->bits = bits;
\r
994 003f5 89 78 3c mov DWORD PTR [eax+60], edi
\r
997 003fa 89 58 38 mov DWORD PTR [eax+56], ebx
\r
1003 003fe 8b e5 mov esp, ebp
\r
1006 _inflate_fast ENDP
\r