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\gzwrite.c
\r
11 PUBLIC ??_C@_0CH@DEEGAHIB@internal?5error?3?5deflate?5stream?5c@ ; `string'
\r
12 EXTRN __imp__vsnprintf:PROC
\r
14 ; COMDAT ??_C@_0CH@DEEGAHIB@internal?5error?3?5deflate?5stream?5c@
\r
16 ??_C@_0CH@DEEGAHIB@internal?5error?3?5deflate?5stream?5c@ DB 'internal er'
\r
17 DB 'ror: deflate stream corrupt', 00H ; `string'
\r
19 ; Function compile flags: /Ogtp
\r
20 ; File c:\workspaces\sysdyn\org.simantics.fmu\fmusolution\zlib-1.2.6\gzwrite.c
\r
23 _gzflags@0 PROC ; COMDAT
\r
25 ; 567 : unsigned long flags = 0;
\r
26 ; 568 : #if defined(STDC) || defined(Z_HAVE_STDARG_H)
\r
27 ; 569 : # ifdef NO_vsnprintf
\r
28 ; 570 : flags += 1L << 25;
\r
29 ; 571 : # ifdef HAS_vsprintf_void
\r
30 ; 572 : flags += 1L << 26;
\r
33 ; 575 : # ifdef HAS_vsnprintf_void
\r
34 ; 576 : flags += 1L << 26;
\r
38 ; 580 : flags += 1L << 24;
\r
39 ; 581 : # ifdef NO_snprintf
\r
40 ; 582 : flags += 1L << 25;
\r
41 ; 583 : # ifdef HAS_sprintf_void
\r
42 ; 584 : flags += 1L << 26;
\r
45 ; 587 : # ifdef HAS_snprintf_void
\r
46 ; 588 : flags += 1L << 26;
\r
50 ; 592 : return flags;
\r
52 00000 33 c0 xor eax, eax
\r
58 ; Function compile flags: /Ogtp
\r
61 _gz_init PROC ; COMDAT
\r
65 ; 19 : z_streamp strm = &(state->strm);
\r
67 ; 21 : /* allocate input buffer */
\r
68 ; 22 : state->in = malloc(state->want);
\r
70 00000 8b 46 20 mov eax, DWORD PTR [esi+32]
\r
74 00006 8d 7e 64 lea edi, DWORD PTR [esi+100]
\r
75 00009 ff 15 00 00 00
\r
76 00 call DWORD PTR __imp__malloc
\r
77 0000f 8b d8 mov ebx, eax
\r
78 00011 83 c4 04 add esp, 4
\r
79 00014 89 5e 24 mov DWORD PTR [esi+36], ebx
\r
81 ; 23 : if (state->in == NULL) {
\r
83 00017 85 db test ebx, ebx
\r
84 00019 75 18 jne SHORT $LN5@gz_init
\r
86 ; 24 : gz_error(state, Z_MEM_ERROR, "out of memory");
\r
88 0001b 68 00 00 00 00 push OFFSET ??_C@_0O@BNNCBLEN@out?5of?5memory?$AA@
\r
89 00020 8d 43 fc lea eax, DWORD PTR [ebx-4]
\r
90 00023 8b ce mov ecx, esi
\r
91 00025 e8 00 00 00 00 call _gz_error
\r
92 0002a 83 c4 04 add esp, 4
\r
97 0002e 83 c8 ff or eax, -1
\r
107 ; 28 : /* only need output buffer and deflate state if compressing */
\r
108 ; 29 : if (!state->direct) {
\r
110 00033 83 7e 2c 00 cmp DWORD PTR [esi+44], 0
\r
111 00037 0f 85 8b 00 00
\r
112 00 jne $LN8@gz_init
\r
114 ; 30 : /* allocate output buffer */
\r
115 ; 31 : state->out = malloc(state->want);
\r
117 0003d 8b 46 20 mov eax, DWORD PTR [esi+32]
\r
119 00041 ff 15 00 00 00
\r
120 00 call DWORD PTR __imp__malloc
\r
122 ; 32 : if (state->out == NULL) {
\r
124 00047 33 c9 xor ecx, ecx
\r
125 00049 83 c4 04 add esp, 4
\r
126 0004c 89 46 28 mov DWORD PTR [esi+40], eax
\r
127 0004f 3b c1 cmp eax, ecx
\r
128 00051 75 21 jne SHORT $LN3@gz_init
\r
130 ; 33 : free(state->in);
\r
133 00054 ff 15 00 00 00
\r
134 00 call DWORD PTR __imp__free
\r
136 ; 34 : gz_error(state, Z_MEM_ERROR, "out of memory");
\r
138 0005a 68 00 00 00 00 push OFFSET ??_C@_0O@BNNCBLEN@out?5of?5memory?$AA@
\r
139 0005f b8 fc ff ff ff mov eax, -4 ; fffffffcH
\r
140 00064 8b ce mov ecx, esi
\r
141 00066 e8 00 00 00 00 call _gz_error
\r
142 0006b 83 c4 08 add esp, 8
\r
147 0006f 83 c8 ff or eax, -1
\r
157 ; 38 : /* allocate deflate memory, set up for gzip compression */
\r
158 ; 39 : strm->zalloc = Z_NULL;
\r
159 ; 40 : strm->zfree = Z_NULL;
\r
160 ; 41 : strm->opaque = Z_NULL;
\r
161 ; 42 : ret = deflateInit2(strm, state->level, Z_DEFLATED,
\r
162 ; 43 : MAX_WBITS + 16, DEF_MEM_LEVEL, state->strategy);
\r
164 00074 6a 38 push 56 ; 00000038H
\r
165 00076 68 00 00 00 00 push OFFSET ??_C@_05BOAHNBIE@1?42?46?$AA@
\r
166 0007b 89 4f 20 mov DWORD PTR [edi+32], ecx
\r
167 0007e 89 4f 24 mov DWORD PTR [edi+36], ecx
\r
168 00081 89 4f 28 mov DWORD PTR [edi+40], ecx
\r
169 00084 8b 46 4c mov eax, DWORD PTR [esi+76]
\r
170 00087 8b 4e 48 mov ecx, DWORD PTR [esi+72]
\r
173 0008d 6a 1f push 31 ; 0000001fH
\r
177 00093 e8 00 00 00 00 call _deflateInit2_@32
\r
179 ; 44 : if (ret != Z_OK) {
\r
181 00098 85 c0 test eax, eax
\r
182 0009a 74 2c je SHORT $LN8@gz_init
\r
184 ; 45 : free(state->out);
\r
186 0009c 8b 56 28 mov edx, DWORD PTR [esi+40]
\r
187 0009f 8b 3d 00 00 00
\r
188 00 mov edi, DWORD PTR __imp__free
\r
190 000a6 ff d7 call edi
\r
192 ; 46 : free(state->in);
\r
194 000a8 8b 46 24 mov eax, DWORD PTR [esi+36]
\r
196 000ac ff d7 call edi
\r
198 ; 47 : gz_error(state, Z_MEM_ERROR, "out of memory");
\r
200 000ae 68 00 00 00 00 push OFFSET ??_C@_0O@BNNCBLEN@out?5of?5memory?$AA@
\r
201 000b3 b8 fc ff ff ff mov eax, -4 ; fffffffcH
\r
202 000b8 8b ce mov ecx, esi
\r
203 000ba e8 00 00 00 00 call _gz_error
\r
204 000bf 83 c4 0c add esp, 12 ; 0000000cH
\r
209 000c3 83 c8 ff or eax, -1
\r
220 ; 52 : /* mark state as initialized */
\r
221 ; 53 : state->size = state->want;
\r
223 ; 55 : /* initialize write buffer if compressing */
\r
224 ; 56 : if (!state->direct) {
\r
226 000c8 83 7e 2c 00 cmp DWORD PTR [esi+44], 0
\r
227 000cc 8b 46 20 mov eax, DWORD PTR [esi+32]
\r
228 000cf 89 46 1c mov DWORD PTR [esi+28], eax
\r
229 000d2 75 0c jne SHORT $LN1@gz_init
\r
231 ; 57 : strm->avail_out = state->size;
\r
233 000d4 89 47 10 mov DWORD PTR [edi+16], eax
\r
235 ; 58 : strm->next_out = state->out;
\r
237 000d7 8b 46 28 mov eax, DWORD PTR [esi+40]
\r
238 000da 89 47 0c mov DWORD PTR [edi+12], eax
\r
240 ; 59 : state->x.next = strm->next_out;
\r
242 000dd 89 46 04 mov DWORD PTR [esi+4], eax
\r
249 000e1 33 c0 xor eax, eax
\r
256 ; Function compile flags: /Ogtp
\r
259 _flush$ = 8 ; size = 4
\r
260 _gz_comp PROC ; COMDAT
\r
266 00001 8b ec mov ebp, esp
\r
268 ; 74 : int ret, got;
\r
269 ; 75 : unsigned have;
\r
270 ; 76 : z_streamp strm = &(state->strm);
\r
272 ; 78 : /* allocate memory if this is the first time through */
\r
273 ; 79 : if (state->size == 0 && gz_init(state) == -1)
\r
275 00003 83 7b 1c 00 cmp DWORD PTR [ebx+28], 0
\r
278 00009 8d 7b 64 lea edi, DWORD PTR [ebx+100]
\r
279 0000c 75 0c jne SHORT $LN21@gz_comp
\r
280 0000e 8b f3 mov esi, ebx
\r
281 00010 e8 00 00 00 00 call _gz_init
\r
282 00015 83 f8 ff cmp eax, -1
\r
286 00018 74 4c je SHORT $LN24@gz_comp
\r
290 ; 82 : /* write directly if requested */
\r
291 ; 83 : if (state->direct) {
\r
293 0001a 83 7b 2c 00 cmp DWORD PTR [ebx+44], 0
\r
294 0001e 74 4d je SHORT $LN14@gz_comp
\r
296 ; 84 : got = write(state->fd, strm->next_in, strm->avail_in);
\r
298 00020 8b 47 04 mov eax, DWORD PTR [edi+4]
\r
299 00023 8b 0f mov ecx, DWORD PTR [edi]
\r
300 00025 8b 53 14 mov edx, DWORD PTR [ebx+20]
\r
304 0002b e8 00 00 00 00 call _write
\r
305 00030 83 c4 0c add esp, 12 ; 0000000cH
\r
307 ; 85 : if (got < 0 || (unsigned)got != strm->avail_in) {
\r
309 00033 85 c0 test eax, eax
\r
310 00035 78 12 js SHORT $LN12@gz_comp
\r
311 00037 3b 47 04 cmp eax, DWORD PTR [edi+4]
\r
312 0003a 75 0d jne SHORT $LN12@gz_comp
\r
315 ; 89 : strm->avail_in = 0;
\r
317 0003c c7 47 04 00 00
\r
318 00 00 mov DWORD PTR [edi+4], 0
\r
322 ; 128 : /* all done, no errors */
\r
325 00044 33 c0 xor eax, eax
\r
334 ; 86 : gz_error(state, Z_ERRNO, zstrerror());
\r
336 00049 ff 15 00 00 00
\r
337 00 call DWORD PTR __imp___errno
\r
338 0004f 8b 00 mov eax, DWORD PTR [eax]
\r
340 00052 ff 15 00 00 00
\r
341 00 call DWORD PTR __imp__strerror
\r
343 00059 83 c8 ff or eax, -1
\r
344 0005c 8b cb mov ecx, ebx
\r
345 0005e e8 00 00 00 00 call _gz_error
\r
346 00063 83 c4 08 add esp, 8
\r
352 00067 83 c8 ff or eax, -1
\r
364 ; 93 : /* run deflate() on provided input until it produces no more output */
\r
367 0006d 33 c0 xor eax, eax
\r
372 ; 96 : /* write out current buffer contents if full, or if flushing, but if
\r
373 ; 97 : doing Z_FINISH then don't write until we get to Z_STREAM_END */
\r
374 ; 98 : if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
\r
375 ; 99 : (flush != Z_FINISH || ret == Z_STREAM_END))) {
\r
377 00070 83 7f 10 00 cmp DWORD PTR [edi+16], 0
\r
378 00074 74 11 je SHORT $LN6@gz_comp
\r
379 00076 8b 4d 08 mov ecx, DWORD PTR _flush$[ebp]
\r
380 00079 85 c9 test ecx, ecx
\r
381 0007b 74 45 je SHORT $LN8@gz_comp
\r
382 0007d 83 f9 04 cmp ecx, 4
\r
383 00080 75 05 jne SHORT $LN6@gz_comp
\r
384 00082 83 f8 01 cmp eax, 1
\r
385 00085 75 3b jne SHORT $LN8@gz_comp
\r
388 ; 100 : have = (unsigned)(strm->next_out - state->x.next);
\r
390 00087 8b 43 04 mov eax, DWORD PTR [ebx+4]
\r
391 0008a 8b 77 0c mov esi, DWORD PTR [edi+12]
\r
392 0008d 2b f0 sub esi, eax
\r
394 ; 101 : if (have && ((got = write(state->fd, state->x.next, have)) < 0 ||
\r
395 ; 102 : (unsigned)got != have)) {
\r
397 0008f 74 16 je SHORT $LN23@gz_comp
\r
398 00091 8b 4b 14 mov ecx, DWORD PTR [ebx+20]
\r
402 00097 e8 00 00 00 00 call _write
\r
403 0009c 83 c4 0c add esp, 12 ; 0000000cH
\r
404 0009f 85 c0 test eax, eax
\r
405 000a1 78 45 js SHORT $LN4@gz_comp
\r
406 000a3 3b c6 cmp eax, esi
\r
407 000a5 75 41 jne SHORT $LN4@gz_comp
\r
411 ; 106 : if (strm->avail_out == 0) {
\r
413 000a7 83 7f 10 00 cmp DWORD PTR [edi+16], 0
\r
414 000ab 75 0c jne SHORT $LN3@gz_comp
\r
416 ; 107 : strm->avail_out = state->size;
\r
418 000ad 8b 53 1c mov edx, DWORD PTR [ebx+28]
\r
419 000b0 89 57 10 mov DWORD PTR [edi+16], edx
\r
421 ; 108 : strm->next_out = state->out;
\r
423 000b3 8b 43 28 mov eax, DWORD PTR [ebx+40]
\r
424 000b6 89 47 0c mov DWORD PTR [edi+12], eax
\r
428 ; 110 : state->x.next = strm->next_out;
\r
430 000b9 8b 4f 0c mov ecx, DWORD PTR [edi+12]
\r
431 000bc 89 4b 04 mov DWORD PTR [ebx+4], ecx
\r
432 000bf 8b 4d 08 mov ecx, DWORD PTR _flush$[ebp]
\r
437 ; 113 : /* compress */
\r
438 ; 114 : have = strm->avail_out;
\r
440 000c2 8b 77 10 mov esi, DWORD PTR [edi+16]
\r
442 ; 115 : ret = deflate(strm, flush);
\r
446 000c7 e8 00 00 00 00 call _deflate@8
\r
448 ; 116 : if (ret == Z_STREAM_ERROR) {
\r
450 000cc 83 f8 fe cmp eax, -2 ; fffffffeH
\r
451 000cf 74 3b je SHORT $LN20@gz_comp
\r
454 ; 121 : have -= strm->avail_out;
\r
456 000d1 2b 77 10 sub esi, DWORD PTR [edi+16]
\r
458 ; 122 : } while (have);
\r
460 000d4 75 9a jne SHORT $LL11@gz_comp
\r
463 ; 124 : /* if that completed a deflate stream, allow another to start */
\r
464 ; 125 : if (flush == Z_FINISH)
\r
466 000d6 83 7d 08 04 cmp DWORD PTR _flush$[ebp], 4
\r
467 000da 75 06 jne SHORT $LN1@gz_comp
\r
469 ; 126 : deflateReset(strm);
\r
472 000dd e8 00 00 00 00 call _deflateReset@4
\r
476 ; 128 : /* all done, no errors */
\r
480 000e3 33 c0 xor eax, eax
\r
489 ; 103 : gz_error(state, Z_ERRNO, zstrerror());
\r
491 000e8 ff 15 00 00 00
\r
492 00 call DWORD PTR __imp___errno
\r
493 000ee 8b 10 mov edx, DWORD PTR [eax]
\r
495 000f1 ff 15 00 00 00
\r
496 00 call DWORD PTR __imp__strerror
\r
498 000f8 83 c8 ff or eax, -1
\r
499 000fb 8b cb mov ecx, ebx
\r
500 000fd e8 00 00 00 00 call _gz_error
\r
501 00102 83 c4 08 add esp, 8
\r
506 00106 83 c8 ff or eax, -1
\r
515 ; 117 : gz_error(state, Z_STREAM_ERROR,
\r
516 ; 118 : "internal error: deflate stream corrupt");
\r
518 0010c 68 00 00 00 00 push OFFSET ??_C@_0CH@DEEGAHIB@internal?5error?3?5deflate?5stream?5c@
\r
519 00111 b8 fe ff ff ff mov eax, -2 ; fffffffeH
\r
520 00116 8b cb mov ecx, ebx
\r
521 00118 e8 00 00 00 00 call _gz_error
\r
522 0011d 83 c4 04 add esp, 4
\r
527 00121 83 c8 ff or eax, -1
\r
535 ; Function compile flags: /Ogtp
\r
538 _first$ = -4 ; size = 4
\r
539 _len$ = 8 ; size = 8
\r
540 _gz_zero PROC ; COMDAT
\r
546 00001 8b ec mov ebp, esp
\r
549 00005 8b d8 mov ebx, eax
\r
552 ; 138 : unsigned n;
\r
553 ; 139 : z_streamp strm = &(state->strm);
\r
555 ; 141 : /* consume whatever's left in the input buffer */
\r
556 ; 142 : if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
\r
558 00007 83 7b 68 00 cmp DWORD PTR [ebx+104], 0
\r
559 0000b 74 16 je SHORT $LN5@gz_zero
\r
561 0000f e8 00 00 00 00 call _gz_comp
\r
562 00014 83 c4 04 add esp, 4
\r
563 00017 83 f8 ff cmp eax, -1
\r
564 0001a 75 07 jne SHORT $LN5@gz_zero
\r
568 0001c 0b c0 or eax, eax
\r
575 0001f 8b e5 mov esp, ebp
\r
582 ; 145 : /* compress len zeros (len guaranteed > 0) */
\r
584 ; 147 : while (len) {
\r
586 00024 8b 75 08 mov esi, DWORD PTR _len$[ebp]
\r
587 00027 8b c6 mov eax, esi
\r
588 00029 0b 45 0c or eax, DWORD PTR _len$[ebp+4]
\r
590 0002d c7 45 fc 01 00
\r
591 00 00 mov DWORD PTR _first$[ebp], 1
\r
592 00034 75 0d jne SHORT $LN4@gz_zero
\r
601 00039 8b e5 mov esp, ebp
\r
604 0003d 8d 49 00 npad 3
\r
608 ; 145 : /* compress len zeros (len guaranteed > 0) */
\r
610 ; 147 : while (len) {
\r
612 00040 8b 75 08 mov esi, DWORD PTR _len$[ebp]
\r
615 ; 148 : n = GT_OFF(state->size) || (z_off64_t)state->size > len ?
\r
616 ; 149 : (unsigned)len : state->size;
\r
618 00043 8b 4b 1c mov ecx, DWORD PTR [ebx+28]
\r
619 00046 33 c0 xor eax, eax
\r
620 00048 33 ff xor edi, edi
\r
621 0004a 3b 45 0c cmp eax, DWORD PTR _len$[ebp+4]
\r
622 0004d 7f 08 jg SHORT $LN8@gz_zero
\r
623 0004f 7c 04 jl SHORT $LN13@gz_zero
\r
624 00051 3b ce cmp ecx, esi
\r
625 00053 77 02 ja SHORT $LN8@gz_zero
\r
627 00055 8b f1 mov esi, ecx
\r
630 ; 150 : if (first) {
\r
632 00057 39 7d fc cmp DWORD PTR _first$[ebp], edi
\r
633 0005a 74 11 je SHORT $LN2@gz_zero
\r
635 ; 151 : memset(state->in, 0, n);
\r
637 0005c 8b 4b 24 mov ecx, DWORD PTR [ebx+36]
\r
641 00062 e8 00 00 00 00 call _memset
\r
642 00067 83 c4 0c add esp, 12 ; 0000000cH
\r
646 0006a 89 7d fc mov DWORD PTR _first$[ebp], edi
\r
650 ; 154 : strm->avail_in = n;
\r
652 0006d 89 73 68 mov DWORD PTR [ebx+104], esi
\r
654 ; 155 : strm->next_in = state->in;
\r
656 00070 8b 53 24 mov edx, DWORD PTR [ebx+36]
\r
657 00073 89 53 64 mov DWORD PTR [ebx+100], edx
\r
659 ; 156 : state->x.pos += n;
\r
661 00076 01 73 08 add DWORD PTR [ebx+8], esi
\r
663 ; 157 : if (gz_comp(state, Z_NO_FLUSH) == -1)
\r
666 0007a 11 7b 0c adc DWORD PTR [ebx+12], edi
\r
667 0007d e8 00 00 00 00 call _gz_comp
\r
668 00082 83 c4 04 add esp, 4
\r
669 00085 83 f8 ff cmp eax, -1
\r
670 00088 74 1b je SHORT $LN11@gz_zero
\r
674 0008a 8b 45 08 mov eax, DWORD PTR _len$[ebp]
\r
675 0008d 8b 4d 0c mov ecx, DWORD PTR _len$[ebp+4]
\r
676 00090 2b c6 sub eax, esi
\r
677 00092 1b cf sbb ecx, edi
\r
678 00094 89 45 08 mov DWORD PTR _len$[ebp], eax
\r
679 00097 0b c1 or eax, ecx
\r
680 00099 89 4d 0c mov DWORD PTR _len$[ebp+4], ecx
\r
681 0009c 75 a2 jne SHORT $LL14@gz_zero
\r
690 000a1 8b e5 mov esp, ebp
\r
699 000a7 83 c8 ff or eax, -1
\r
706 000ab 8b e5 mov esp, ebp
\r
710 PUBLIC _gzclose_w@4
\r
711 ; Function compile flags: /Ogtp
\r
712 ; COMDAT _gzclose_w@4
\r
714 _file$ = 8 ; size = 4
\r
715 _gzclose_w@4 PROC ; COMDAT
\r
720 00001 8b ec mov ebp, esp
\r
723 ; 529 : int ret = Z_OK;
\r
724 ; 530 : gz_statep state;
\r
726 ; 532 : /* get internal structure */
\r
727 ; 533 : if (file == NULL)
\r
729 00004 8b 5d 08 mov ebx, DWORD PTR _file$[ebp]
\r
731 00008 33 ff xor edi, edi
\r
732 0000a 85 db test ebx, ebx
\r
733 0000c 75 0b jne SHORT $LN7@gzclose_w
\r
737 ; 534 : return Z_STREAM_ERROR;
\r
739 0000f b8 fe ff ff ff mov eax, -2 ; fffffffeH
\r
745 00016 c2 04 00 ret 4
\r
748 ; 535 : state = (gz_statep)file;
\r
750 ; 537 : /* check that we're writing */
\r
751 ; 538 : if (state->mode != GZ_WRITE)
\r
753 00019 81 7b 10 b1 79
\r
754 00 00 cmp DWORD PTR [ebx+16], 31153 ; 000079b1H
\r
756 ; 539 : return Z_STREAM_ERROR;
\r
758 00020 75 ec jne SHORT $LN11@gzclose_w
\r
761 ; 541 : /* check for seek request */
\r
762 ; 542 : if (state->seek) {
\r
764 00022 39 7b 58 cmp DWORD PTR [ebx+88], edi
\r
765 00025 74 1d je SHORT $LN10@gzclose_w
\r
767 ; 543 : state->seek = 0;
\r
768 ; 544 : if (gz_zero(state, state->skip) == -1)
\r
770 00027 8b 43 54 mov eax, DWORD PTR [ebx+84]
\r
771 0002a 8b 4b 50 mov ecx, DWORD PTR [ebx+80]
\r
774 0002f 8b c3 mov eax, ebx
\r
775 00031 89 7b 58 mov DWORD PTR [ebx+88], edi
\r
776 00034 e8 00 00 00 00 call _gz_zero
\r
777 00039 83 c4 08 add esp, 8
\r
778 0003c 83 f8 ff cmp eax, -1
\r
779 0003f 75 03 jne SHORT $LN10@gzclose_w
\r
781 ; 545 : ret = state->err;
\r
783 00041 8b 7b 5c mov edi, DWORD PTR [ebx+92]
\r
788 ; 548 : /* flush, free memory, and close file */
\r
789 ; 549 : if (gz_comp(state, Z_FINISH) == -1)
\r
792 00046 e8 00 00 00 00 call _gz_comp
\r
793 0004b 83 c4 04 add esp, 4
\r
794 0004e 83 f8 ff cmp eax, -1
\r
795 00051 75 03 jne SHORT $LN3@gzclose_w
\r
797 ; 550 : ret = state->err;
\r
799 00053 8b 7b 5c mov edi, DWORD PTR [ebx+92]
\r
802 ; 551 : if (!state->direct) {
\r
804 00056 83 7b 2c 00 cmp DWORD PTR [ebx+44], 0
\r
806 0005b 8b 35 00 00 00
\r
807 00 mov esi, DWORD PTR __imp__free
\r
808 00061 75 12 jne SHORT $LN2@gzclose_w
\r
810 ; 552 : (void)deflateEnd(&(state->strm));
\r
812 00063 8d 53 64 lea edx, DWORD PTR [ebx+100]
\r
814 00067 e8 00 00 00 00 call _deflateEnd@4
\r
816 ; 553 : free(state->out);
\r
818 0006c 8b 43 28 mov eax, DWORD PTR [ebx+40]
\r
820 00070 ff d6 call esi
\r
821 00072 83 c4 04 add esp, 4
\r
825 ; 555 : free(state->in);
\r
827 00075 8b 4b 24 mov ecx, DWORD PTR [ebx+36]
\r
829 00079 ff d6 call esi
\r
831 ; 556 : gz_error(state, Z_OK, NULL);
\r
834 0007d 33 c0 xor eax, eax
\r
835 0007f 8b cb mov ecx, ebx
\r
836 00081 e8 00 00 00 00 call _gz_error
\r
838 ; 557 : free(state->path);
\r
840 00086 8b 53 18 mov edx, DWORD PTR [ebx+24]
\r
842 0008a ff d6 call esi
\r
844 ; 558 : if (close(state->fd) == -1)
\r
846 0008c 8b 43 14 mov eax, DWORD PTR [ebx+20]
\r
848 00090 e8 00 00 00 00 call _close
\r
849 00095 83 c4 10 add esp, 16 ; 00000010H
\r
850 00098 83 f8 ff cmp eax, -1
\r
851 0009b 75 02 jne SHORT $LN1@gzclose_w
\r
853 ; 559 : ret = Z_ERRNO;
\r
855 0009d 0b f8 or edi, eax
\r
858 ; 560 : free(state);
\r
861 000a0 ff d6 call esi
\r
862 000a2 83 c4 04 add esp, 4
\r
865 ; 561 : return ret;
\r
867 000a6 8b c7 mov eax, edi
\r
874 000ab c2 04 00 ret 4
\r
877 PUBLIC _gzsetparams@12
\r
878 ; Function compile flags: /Ogtp
\r
879 ; COMDAT _gzsetparams@12
\r
881 _file$ = 8 ; size = 4
\r
882 _level$ = 12 ; size = 4
\r
883 _strategy$ = 16 ; size = 4
\r
884 _gzsetparams@12 PROC ; COMDAT
\r
889 00001 8b ec mov ebp, esp
\r
892 ; 489 : gz_statep state;
\r
893 ; 490 : z_streamp strm;
\r
895 ; 492 : /* get internal structure */
\r
896 ; 493 : if (file == NULL)
\r
898 00004 8b 5d 08 mov ebx, DWORD PTR _file$[ebp]
\r
899 00007 85 db test ebx, ebx
\r
900 00009 75 0a jne SHORT $LN8@gzsetparam
\r
903 ; 494 : return Z_STREAM_ERROR;
\r
905 0000b b8 fe ff ff ff mov eax, -2 ; fffffffeH
\r
911 00012 c2 0c 00 ret 12 ; 0000000cH
\r
914 ; 495 : state = (gz_statep)file;
\r
915 ; 496 : strm = &(state->strm);
\r
917 ; 498 : /* check that we're writing and that there's no error */
\r
918 ; 499 : if (state->mode != GZ_WRITE || state->err != Z_OK)
\r
920 00015 81 7b 10 b1 79
\r
921 00 00 cmp DWORD PTR [ebx+16], 31153 ; 000079b1H
\r
922 0001c 75 ed jne SHORT $LN6@gzsetparam
\r
923 0001e 83 7b 5c 00 cmp DWORD PTR [ebx+92], 0
\r
924 00022 75 e7 jne SHORT $LN6@gzsetparam
\r
926 ; 500 : return Z_STREAM_ERROR;
\r
928 ; 502 : /* if no change is requested, then do nothing */
\r
929 ; 503 : if (level == state->level && strategy == state->strategy)
\r
932 00025 8b 75 0c mov esi, DWORD PTR _level$[ebp]
\r
934 00029 8b 7d 10 mov edi, DWORD PTR _strategy$[ebp]
\r
935 0002c 3b 73 48 cmp esi, DWORD PTR [ebx+72]
\r
936 0002f 75 05 jne SHORT $LN5@gzsetparam
\r
937 00031 3b 7b 4c cmp edi, DWORD PTR [ebx+76]
\r
939 ; 504 : return Z_OK;
\r
941 00034 74 63 je SHORT $LN14@gzsetparam
\r
945 ; 506 : /* check for seek request */
\r
946 ; 507 : if (state->seek) {
\r
948 00036 83 7b 58 00 cmp DWORD PTR [ebx+88], 0
\r
949 0003a 74 27 je SHORT $LN11@gzsetparam
\r
951 ; 508 : state->seek = 0;
\r
952 ; 509 : if (gz_zero(state, state->skip) == -1)
\r
954 0003c 8b 43 54 mov eax, DWORD PTR [ebx+84]
\r
955 0003f 8b 4b 50 mov ecx, DWORD PTR [ebx+80]
\r
958 00044 8b c3 mov eax, ebx
\r
959 00046 c7 43 58 00 00
\r
960 00 00 mov DWORD PTR [ebx+88], 0
\r
961 0004d e8 00 00 00 00 call _gz_zero
\r
962 00052 83 c4 08 add esp, 8
\r
963 00055 83 f8 ff cmp eax, -1
\r
964 00058 75 09 jne SHORT $LN11@gzsetparam
\r
970 0005c 0b c0 or eax, eax
\r
976 00060 c2 0c 00 ret 12 ; 0000000cH
\r
981 ; 513 : /* change compression parameters for subsequent input */
\r
982 ; 514 : if (state->size) {
\r
984 00063 83 7b 1c 00 cmp DWORD PTR [ebx+28], 0
\r
985 00067 74 2a je SHORT $LN2@gzsetparam
\r
987 ; 515 : /* flush previous input with previous parameters before changing */
\r
988 ; 516 : if (strm->avail_in && gz_comp(state, Z_PARTIAL_FLUSH) == -1)
\r
990 00069 83 7b 68 00 cmp DWORD PTR [ebx+104], 0
\r
991 0006d 74 19 je SHORT $LN1@gzsetparam
\r
993 00071 e8 00 00 00 00 call _gz_comp
\r
994 00076 83 c4 04 add esp, 4
\r
995 00079 83 f8 ff cmp eax, -1
\r
996 0007c 75 0a jne SHORT $LN1@gzsetparam
\r
998 ; 517 : return state->err;
\r
1000 0007e 8b 43 5c mov eax, DWORD PTR [ebx+92]
\r
1008 00085 c2 0c 00 ret 12 ; 0000000cH
\r
1011 ; 518 : deflateParams(strm, level, strategy);
\r
1015 0008a 8d 43 64 lea eax, DWORD PTR [ebx+100]
\r
1017 0008e e8 00 00 00 00 call _deflateParams@12
\r
1021 ; 520 : state->level = level;
\r
1023 00093 89 73 48 mov DWORD PTR [ebx+72], esi
\r
1025 ; 521 : state->strategy = strategy;
\r
1027 00096 89 7b 4c mov DWORD PTR [ebx+76], edi
\r
1030 ; 522 : return Z_OK;
\r
1034 0009b 33 c0 xor eax, eax
\r
1040 0009f c2 0c 00 ret 12 ; 0000000cH
\r
1041 _gzsetparams@12 ENDP
\r
1044 ; Function compile flags: /Ogtp
\r
1045 ; COMDAT _gzflush@8
\r
1047 _file$ = 8 ; size = 4
\r
1048 _flush$ = 12 ; size = 4
\r
1049 _gzflush@8 PROC ; COMDAT
\r
1054 00001 8b ec mov ebp, esp
\r
1057 ; 456 : gz_statep state;
\r
1059 ; 458 : /* get internal structure */
\r
1060 ; 459 : if (file == NULL)
\r
1062 00004 8b 5d 08 mov ebx, DWORD PTR _file$[ebp]
\r
1063 00007 85 db test ebx, ebx
\r
1064 00009 75 08 jne SHORT $LN7@gzflush
\r
1066 ; 460 : return -1;
\r
1068 0000b 83 c8 ff or eax, -1
\r
1074 00010 c2 08 00 ret 8
\r
1077 ; 461 : state = (gz_statep)file;
\r
1079 ; 463 : /* check that we're writing and that there's no error */
\r
1080 ; 464 : if (state->mode != GZ_WRITE || state->err != Z_OK)
\r
1082 00013 81 7b 10 b1 79
\r
1083 00 00 cmp DWORD PTR [ebx+16], 31153 ; 000079b1H
\r
1084 0001a 75 58 jne SHORT $LN5@gzflush
\r
1085 0001c 83 7b 5c 00 cmp DWORD PTR [ebx+92], 0
\r
1086 00020 75 52 jne SHORT $LN5@gzflush
\r
1089 ; 467 : /* check flush parameter */
\r
1090 ; 468 : if (flush < 0 || flush > Z_FINISH)
\r
1093 00023 8b 75 0c mov esi, DWORD PTR _flush$[ebp]
\r
1094 00026 83 fe 04 cmp esi, 4
\r
1095 00029 77 3e ja SHORT $LN3@gzflush
\r
1098 ; 471 : /* check for seek request */
\r
1099 ; 472 : if (state->seek) {
\r
1101 0002b 83 7b 58 00 cmp DWORD PTR [ebx+88], 0
\r
1102 0002f 74 26 je SHORT $LN1@gzflush
\r
1104 ; 473 : state->seek = 0;
\r
1105 ; 474 : if (gz_zero(state, state->skip) == -1)
\r
1107 00031 8b 43 54 mov eax, DWORD PTR [ebx+84]
\r
1108 00034 8b 4b 50 mov ecx, DWORD PTR [ebx+80]
\r
1111 00039 8b c3 mov eax, ebx
\r
1112 0003b c7 43 58 00 00
\r
1113 00 00 mov DWORD PTR [ebx+88], 0
\r
1114 00042 e8 00 00 00 00 call _gz_zero
\r
1115 00047 83 c4 08 add esp, 8
\r
1116 0004a 83 f8 ff cmp eax, -1
\r
1117 0004d 75 08 jne SHORT $LN1@gzflush
\r
1119 ; 475 : return -1;
\r
1122 00050 0b c0 or eax, eax
\r
1128 00054 c2 08 00 ret 8
\r
1133 ; 478 : /* compress remaining data with requested flush */
\r
1134 ; 479 : gz_comp(state, flush);
\r
1137 00058 e8 00 00 00 00 call _gz_comp
\r
1139 ; 480 : return state->err;
\r
1141 0005d 8b 43 5c mov eax, DWORD PTR [ebx+92]
\r
1142 00060 83 c4 04 add esp, 4
\r
1149 00066 c2 08 00 ret 8
\r
1153 ; 469 : return Z_STREAM_ERROR;
\r
1155 0006a b8 fe ff ff ff mov eax, -2 ; fffffffeH
\r
1161 00071 c2 08 00 ret 8
\r
1164 ; 465 : return Z_STREAM_ERROR;
\r
1166 00074 b8 fe ff ff ff mov eax, -2 ; fffffffeH
\r
1172 0007b c2 08 00 ret 8
\r
1176 ; Function compile flags: /Ogtp
\r
1177 ; COMDAT _gzprintf
\r
1179 _file$ = 8 ; size = 4
\r
1180 _format$ = 12 ; size = 4
\r
1181 _gzprintf PROC ; COMDAT
\r
1186 00001 8b ec mov ebp, esp
\r
1189 ; 305 : int size, len;
\r
1190 ; 306 : gz_statep state;
\r
1191 ; 307 : z_streamp strm;
\r
1192 ; 308 : va_list va;
\r
1194 ; 310 : /* get internal structure */
\r
1195 ; 311 : if (file == NULL)
\r
1197 00004 8b 75 08 mov esi, DWORD PTR _file$[ebp]
\r
1198 00007 85 f6 test esi, esi
\r
1199 00009 75 06 jne SHORT $LN9@gzprintf
\r
1201 ; 312 : return -1;
\r
1203 0000b 83 c8 ff or eax, -1
\r
1212 ; 313 : state = (gz_statep)file;
\r
1213 ; 314 : strm = &(state->strm);
\r
1215 ; 316 : /* check that we're writing and that there's no error */
\r
1216 ; 317 : if (state->mode != GZ_WRITE || state->err != Z_OK)
\r
1218 00011 81 7e 10 b1 79
\r
1219 00 00 cmp DWORD PTR [esi+16], 31153 ; 000079b1H
\r
1220 00018 75 16 jne SHORT $LN14@gzprintf
\r
1221 0001a 83 7e 5c 00 cmp DWORD PTR [esi+92], 0
\r
1222 0001e 75 10 jne SHORT $LN14@gzprintf
\r
1226 ; 320 : /* make sure we have some buffer space */
\r
1227 ; 321 : if (state->size == 0 && gz_init(state) == -1)
\r
1229 00020 83 7e 1c 00 cmp DWORD PTR [esi+28], 0
\r
1230 00024 75 0f jne SHORT $LN6@gzprintf
\r
1231 00026 e8 00 00 00 00 call _gz_init
\r
1232 0002b 83 f8 ff cmp eax, -1
\r
1233 0002e 75 05 jne SHORT $LN6@gzprintf
\r
1238 00030 33 c0 xor eax, eax
\r
1248 ; 324 : /* check for seek request */
\r
1249 ; 325 : if (state->seek) {
\r
1251 00035 83 7e 58 00 cmp DWORD PTR [esi+88], 0
\r
1252 00039 74 1e je SHORT $LN4@gzprintf
\r
1254 ; 326 : state->seek = 0;
\r
1255 ; 327 : if (gz_zero(state, state->skip) == -1)
\r
1257 0003b 8b 46 54 mov eax, DWORD PTR [esi+84]
\r
1258 0003e 8b 4e 50 mov ecx, DWORD PTR [esi+80]
\r
1261 00043 8b c6 mov eax, esi
\r
1262 00045 c7 46 58 00 00
\r
1263 00 00 mov DWORD PTR [esi+88], 0
\r
1264 0004c e8 00 00 00 00 call _gz_zero
\r
1265 00051 83 c4 08 add esp, 8
\r
1266 00054 83 f8 ff cmp eax, -1
\r
1270 00057 74 d7 je SHORT $LN14@gzprintf
\r
1275 ; 331 : /* consume whatever's left in the input buffer */
\r
1276 ; 332 : if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
\r
1278 00059 83 7e 68 00 cmp DWORD PTR [esi+104], 0
\r
1279 0005d 74 13 je SHORT $LN12@gzprintf
\r
1281 00060 6a 00 push 0
\r
1282 00062 8b de mov ebx, esi
\r
1283 00064 e8 00 00 00 00 call _gz_comp
\r
1284 00069 83 c4 04 add esp, 4
\r
1286 0006d 83 f8 ff cmp eax, -1
\r
1290 00070 74 be je SHORT $LN14@gzprintf
\r
1294 ; 335 : /* do the printf() into the input buffer, put length in len */
\r
1295 ; 336 : size = (int)(state->size);
\r
1296 ; 337 : state->in[size - 1] = 0;
\r
1298 00072 8b 56 24 mov edx, DWORD PTR [esi+36]
\r
1300 00076 8b 7e 1c mov edi, DWORD PTR [esi+28]
\r
1301 00079 c6 44 17 ff 00 mov BYTE PTR [edi+edx-1], 0
\r
1303 ; 338 : va_start(va, format);
\r
1304 ; 339 : #ifdef NO_vsnprintf
\r
1305 ; 340 : # ifdef HAS_vsprintf_void
\r
1306 ; 341 : (void)vsprintf(state->in, format, va);
\r
1307 ; 342 : va_end(va);
\r
1308 ; 343 : for (len = 0; len < size; len++)
\r
1309 ; 344 : if (state->in[len] == 0) break;
\r
1311 ; 346 : len = vsprintf(state->in, format, va);
\r
1312 ; 347 : va_end(va);
\r
1315 ; 350 : # ifdef HAS_vsnprintf_void
\r
1316 ; 351 : (void)vsnprintf(state->in, size, format, va);
\r
1317 ; 352 : va_end(va);
\r
1318 ; 353 : len = strlen(state->in);
\r
1320 ; 355 : len = vsnprintf((char *)(state->in), size, format, va);
\r
1322 0007e 8b 4d 0c mov ecx, DWORD PTR _format$[ebp]
\r
1323 00081 8b 56 24 mov edx, DWORD PTR [esi+36]
\r
1324 00084 8d 45 10 lea eax, DWORD PTR _format$[ebp+4]
\r
1329 0008b ff 15 00 00 00
\r
1330 00 call DWORD PTR __imp__vsnprintf
\r
1331 00091 8b c8 mov ecx, eax
\r
1332 00093 83 c4 10 add esp, 16 ; 00000010H
\r
1334 ; 356 : va_end(va);
\r
1338 ; 360 : /* check that printf() results fit in buffer */
\r
1339 ; 361 : if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)
\r
1341 00096 85 c9 test ecx, ecx
\r
1342 00098 7e 26 jle SHORT $LN1@gzprintf
\r
1343 0009a 3b cf cmp ecx, edi
\r
1344 0009c 7d 22 jge SHORT $LN1@gzprintf
\r
1345 0009e 8b 46 24 mov eax, DWORD PTR [esi+36]
\r
1346 000a1 80 7c 07 ff 00 cmp BYTE PTR [edi+eax-1], 0
\r
1347 000a6 75 18 jne SHORT $LN1@gzprintf
\r
1350 ; 364 : /* update buffer and position, defer compression until needed */
\r
1351 ; 365 : strm->avail_in = (unsigned)len;
\r
1353 000a8 89 4e 68 mov DWORD PTR [esi+104], ecx
\r
1355 ; 366 : strm->next_in = state->in;
\r
1357 000ab 8b 56 24 mov edx, DWORD PTR [esi+36]
\r
1358 000ae 89 56 64 mov DWORD PTR [esi+100], edx
\r
1360 ; 367 : state->x.pos += len;
\r
1362 000b1 8b c1 mov eax, ecx
\r
1364 000b4 01 46 08 add DWORD PTR [esi+8], eax
\r
1367 ; 368 : return len;
\r
1369 000b8 8b c1 mov eax, ecx
\r
1370 000ba 11 56 0c adc DWORD PTR [esi+12], edx
\r
1382 000c1 33 c0 xor eax, eax
\r
1391 PUBLIC _gzwrite@12
\r
1392 ; Function compile flags: /Ogtp
\r
1393 ; COMDAT _gzwrite@12
\r
1395 _file$ = 8 ; size = 4
\r
1396 _buf$ = 12 ; size = 4
\r
1397 _put$ = 16 ; size = 4
\r
1398 _len$ = 16 ; size = 4
\r
1399 _gzwrite@12 PROC ; COMDAT
\r
1404 00001 8b ec mov ebp, esp
\r
1407 ; 170 : unsigned put = len;
\r
1408 ; 171 : unsigned n;
\r
1409 ; 172 : gz_statep state;
\r
1410 ; 173 : z_streamp strm;
\r
1412 ; 175 : /* get internal structure */
\r
1413 ; 176 : if (file == NULL)
\r
1415 00004 8b 5d 08 mov ebx, DWORD PTR _file$[ebp]
\r
1417 00008 8b 7d 10 mov edi, DWORD PTR _len$[ebp]
\r
1418 0000b 89 7d 10 mov DWORD PTR _put$[ebp], edi
\r
1419 0000e 85 db test ebx, ebx
\r
1423 00010 74 27 je SHORT $LN32@gzwrite
\r
1425 ; 178 : state = (gz_statep)file;
\r
1426 ; 179 : strm = &(state->strm);
\r
1428 ; 181 : /* check that we're writing and that there's no error */
\r
1429 ; 182 : if (state->mode != GZ_WRITE || state->err != Z_OK)
\r
1431 00012 81 7b 10 b1 79
\r
1432 00 00 cmp DWORD PTR [ebx+16], 31153 ; 000079b1H
\r
1433 00019 75 1e jne SHORT $LN32@gzwrite
\r
1434 0001b 83 7b 5c 00 cmp DWORD PTR [ebx+92], 0
\r
1435 0001f 75 18 jne SHORT $LN32@gzwrite
\r
1439 ; 185 : /* since an int is returned, make sure len fits in one, otherwise return
\r
1440 ; 186 : with an error (this avoids the flaw in the interface) */
\r
1441 ; 187 : if ((int)len < 0) {
\r
1443 00021 85 ff test edi, edi
\r
1444 00023 79 1c jns SHORT $LN30@gzwrite
\r
1446 ; 188 : gz_error(state, Z_DATA_ERROR, "requested length does not fit in int");
\r
1448 00025 68 00 00 00 00 push OFFSET ??_C@_0CF@MLPJFDMM@requested?5length?5does?5not?5fit?5in@
\r
1449 0002a b8 fd ff ff ff mov eax, -3 ; fffffffdH
\r
1450 0002f 8b cb mov ecx, ebx
\r
1451 00031 e8 00 00 00 00 call _gz_error
\r
1452 00036 83 c4 04 add esp, 4
\r
1458 0003a 33 c0 xor eax, eax
\r
1464 0003e c2 0c 00 ret 12 ; 0000000cH
\r
1469 ; 192 : /* if len is zero, avoid unnecessary operations */
\r
1470 ; 193 : if (len == 0)
\r
1473 00041 74 f6 je SHORT $LN32@gzwrite
\r
1476 ; 196 : /* allocate memory if this is the first time through */
\r
1477 ; 197 : if (state->size == 0 && gz_init(state) == -1)
\r
1479 00043 83 7b 1c 00 cmp DWORD PTR [ebx+28], 0
\r
1481 00048 75 0c jne SHORT $LN24@gzwrite
\r
1482 0004a 8b f3 mov esi, ebx
\r
1483 0004c e8 00 00 00 00 call _gz_init
\r
1484 00051 83 f8 ff cmp eax, -1
\r
1488 00054 74 75 je SHORT $LN31@gzwrite
\r
1492 ; 200 : /* check for seek request */
\r
1493 ; 201 : if (state->seek) {
\r
1495 00056 33 f6 xor esi, esi
\r
1496 00058 39 73 58 cmp DWORD PTR [ebx+88], esi
\r
1497 0005b 74 1a je SHORT $LN28@gzwrite
\r
1499 ; 202 : state->seek = 0;
\r
1500 ; 203 : if (gz_zero(state, state->skip) == -1)
\r
1502 0005d 8b 43 54 mov eax, DWORD PTR [ebx+84]
\r
1503 00060 8b 4b 50 mov ecx, DWORD PTR [ebx+80]
\r
1506 00065 8b c3 mov eax, ebx
\r
1507 00067 89 73 58 mov DWORD PTR [ebx+88], esi
\r
1508 0006a e8 00 00 00 00 call _gz_zero
\r
1509 0006f 83 c4 08 add esp, 8
\r
1510 00072 83 f8 ff cmp eax, -1
\r
1514 00075 74 54 je SHORT $LN31@gzwrite
\r
1519 ; 207 : /* for small len, copy to input buffer, otherwise compress directly */
\r
1520 ; 208 : if (len < state->size) {
\r
1522 00077 3b 7b 1c cmp edi, DWORD PTR [ebx+28]
\r
1523 0007a 73 58 jae SHORT $LN10@gzwrite
\r
1524 0007c 8d 64 24 00 npad 4
\r
1527 ; 209 : /* copy to input buffer, compress when full */
\r
1529 ; 211 : if (strm->avail_in == 0)
\r
1531 00080 8b 43 68 mov eax, DWORD PTR [ebx+104]
\r
1532 00083 85 c0 test eax, eax
\r
1533 00085 75 06 jne SHORT $LN6@gzwrite
\r
1535 ; 212 : strm->next_in = state->in;
\r
1537 00087 8b 53 24 mov edx, DWORD PTR [ebx+36]
\r
1538 0008a 89 53 64 mov DWORD PTR [ebx+100], edx
\r
1541 ; 213 : n = state->size - strm->avail_in;
\r
1543 0008d 8b 73 1c mov esi, DWORD PTR [ebx+28]
\r
1544 00090 2b f0 sub esi, eax
\r
1546 ; 214 : if (n > len)
\r
1548 00092 3b f7 cmp esi, edi
\r
1549 00094 76 02 jbe SHORT $LN5@gzwrite
\r
1553 00096 8b f7 mov esi, edi
\r
1556 ; 216 : memcpy(strm->next_in + strm->avail_in, buf, n);
\r
1558 00098 8b 4d 0c mov ecx, DWORD PTR _buf$[ebp]
\r
1559 0009b 8b 53 64 mov edx, DWORD PTR [ebx+100]
\r
1562 000a0 03 d0 add edx, eax
\r
1564 000a3 e8 00 00 00 00 call _memcpy
\r
1566 ; 217 : strm->avail_in += n;
\r
1568 000a8 01 73 68 add DWORD PTR [ebx+104], esi
\r
1569 000ab 83 c4 0c add esp, 12 ; 0000000cH
\r
1571 ; 218 : state->x.pos += n;
\r
1573 000ae 01 73 08 add DWORD PTR [ebx+8], esi
\r
1574 000b1 83 53 0c 00 adc DWORD PTR [ebx+12], 0
\r
1576 ; 219 : buf = (char *)buf + n;
\r
1578 000b5 01 75 0c add DWORD PTR _buf$[ebp], esi
\r
1582 000b8 2b fe sub edi, esi
\r
1584 ; 221 : if (len && gz_comp(state, Z_NO_FLUSH) == -1)
\r
1586 000ba 74 48 je SHORT $LN27@gzwrite
\r
1587 000bc 6a 00 push 0
\r
1588 000be e8 00 00 00 00 call _gz_comp
\r
1589 000c3 83 c4 04 add esp, 4
\r
1590 000c6 83 f8 ff cmp eax, -1
\r
1591 000c9 75 b5 jne SHORT $LL9@gzwrite
\r
1598 000cd 33 c0 xor eax, eax
\r
1604 000d1 c2 0c 00 ret 12 ; 0000000cH
\r
1607 ; 223 : } while (len);
\r
1610 ; 226 : /* consume whatever's left in the input buffer */
\r
1611 ; 227 : if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
\r
1613 000d4 39 73 68 cmp DWORD PTR [ebx+104], esi
\r
1614 000d7 74 0e je SHORT $LN2@gzwrite
\r
1616 000da e8 00 00 00 00 call _gz_comp
\r
1617 000df 83 c4 04 add esp, 4
\r
1618 000e2 83 f8 ff cmp eax, -1
\r
1622 000e5 74 e4 je SHORT $LN31@gzwrite
\r
1626 ; 230 : /* directly compress user buffer to file */
\r
1627 ; 231 : strm->avail_in = len;
\r
1628 ; 232 : strm->next_in = (voidp)buf;
\r
1630 000e7 8b 45 0c mov eax, DWORD PTR _buf$[ebp]
\r
1631 000ea 89 7b 68 mov DWORD PTR [ebx+104], edi
\r
1632 000ed 89 43 64 mov DWORD PTR [ebx+100], eax
\r
1634 ; 233 : state->x.pos += len;
\r
1636 000f0 01 7b 08 add DWORD PTR [ebx+8], edi
\r
1638 ; 234 : if (gz_comp(state, Z_NO_FLUSH) == -1)
\r
1641 000f4 11 73 0c adc DWORD PTR [ebx+12], esi
\r
1642 000f7 e8 00 00 00 00 call _gz_comp
\r
1643 000fc 83 c4 04 add esp, 4
\r
1644 000ff 83 f8 ff cmp eax, -1
\r
1648 00102 74 c7 je SHORT $LN31@gzwrite
\r
1653 ; 238 : /* input was all buffered or compressed (put will fit in int) */
\r
1654 ; 239 : return (int)put;
\r
1656 00104 8b 45 10 mov eax, DWORD PTR _put$[ebp]
\r
1664 0010b c2 0c 00 ret 12 ; 0000000cH
\r
1667 ; Function compile flags: /Ogtp
\r
1668 ; COMDAT _gzputs@8
\r
1670 _file$ = 8 ; size = 4
\r
1671 _str$ = 12 ; size = 4
\r
1672 _gzputs@8 PROC ; COMDAT
\r
1677 00001 8b ec mov ebp, esp
\r
1680 ; 291 : unsigned len;
\r
1682 ; 293 : /* write string */
\r
1683 ; 294 : len = (unsigned)strlen(str);
\r
1685 00003 8b 55 0c mov edx, DWORD PTR _str$[ebp]
\r
1686 00006 8b c2 mov eax, edx
\r
1688 00009 8d 70 01 lea esi, DWORD PTR [eax+1]
\r
1689 0000c 8d 64 24 00 npad 4
\r
1691 00010 8a 08 mov cl, BYTE PTR [eax]
\r
1693 00013 84 c9 test cl, cl
\r
1694 00015 75 f9 jne SHORT $LL5@gzputs
\r
1695 00017 2b c6 sub eax, esi
\r
1696 00019 8b f0 mov esi, eax
\r
1698 ; 295 : ret = gzwrite(file, str, len);
\r
1700 0001b 8b 45 08 mov eax, DWORD PTR _file$[ebp]
\r
1704 00021 e8 00 00 00 00 call _gzwrite@12
\r
1706 ; 296 : return ret == 0 && len != 0 ? -1 : ret;
\r
1708 00026 85 c0 test eax, eax
\r
1709 00028 75 07 jne SHORT $LN4@gzputs
\r
1710 0002a 85 f6 test esi, esi
\r
1711 0002c 74 03 je SHORT $LN4@gzputs
\r
1712 0002e 83 c8 ff or eax, -1
\r
1719 00033 c2 08 00 ret 8
\r
1723 ; Function compile flags: /Ogtp
\r
1724 ; COMDAT _gzputc@8
\r
1726 _file$ = 8 ; size = 4
\r
1727 _buf$ = 11 ; size = 1
\r
1728 _c$ = 12 ; size = 4
\r
1729 _gzputc@8 PROC ; COMDAT
\r
1734 00001 8b ec mov ebp, esp
\r
1737 ; 247 : unsigned char buf[1];
\r
1738 ; 248 : gz_statep state;
\r
1739 ; 249 : z_streamp strm;
\r
1741 ; 251 : /* get internal structure */
\r
1742 ; 252 : if (file == NULL)
\r
1744 00004 8b 75 08 mov esi, DWORD PTR _file$[ebp]
\r
1745 00007 85 f6 test esi, esi
\r
1746 00009 75 08 jne SHORT $LN8@gzputc
\r
1749 ; 253 : return -1;
\r
1751 0000b 83 c8 ff or eax, -1
\r
1757 00010 c2 08 00 ret 8
\r
1760 ; 254 : state = (gz_statep)file;
\r
1761 ; 255 : strm = &(state->strm);
\r
1763 ; 257 : /* check that we're writing and that there's no error */
\r
1764 ; 258 : if (state->mode != GZ_WRITE || state->err != Z_OK)
\r
1766 00013 81 7e 10 b1 79
\r
1767 00 00 cmp DWORD PTR [esi+16], 31153 ; 000079b1H
\r
1768 0001a 75 ef jne SHORT $LN12@gzputc
\r
1769 0001c 83 7e 5c 00 cmp DWORD PTR [esi+92], 0
\r
1770 00020 75 e9 jne SHORT $LN12@gzputc
\r
1772 ; 259 : return -1;
\r
1774 ; 261 : /* check for seek request */
\r
1775 ; 262 : if (state->seek) {
\r
1777 00022 83 7e 58 00 cmp DWORD PTR [esi+88], 0
\r
1778 00026 74 1e je SHORT $LN4@gzputc
\r
1780 ; 263 : state->seek = 0;
\r
1781 ; 264 : if (gz_zero(state, state->skip) == -1)
\r
1783 00028 8b 46 54 mov eax, DWORD PTR [esi+84]
\r
1784 0002b 8b 4e 50 mov ecx, DWORD PTR [esi+80]
\r
1787 00030 8b c6 mov eax, esi
\r
1788 00032 c7 46 58 00 00
\r
1789 00 00 mov DWORD PTR [esi+88], 0
\r
1790 00039 e8 00 00 00 00 call _gz_zero
\r
1791 0003e 83 c4 08 add esp, 8
\r
1792 00041 83 f8 ff cmp eax, -1
\r
1794 ; 265 : return -1;
\r
1796 00044 74 c5 je SHORT $LN12@gzputc
\r
1801 ; 268 : /* try writing to input buffer for speed (state->size == 0 if buffer not
\r
1802 ; 269 : initialized) */
\r
1803 ; 270 : if (strm->avail_in < state->size) {
\r
1805 00046 8b 4e 68 mov ecx, DWORD PTR [esi+104]
\r
1806 00049 3b 4e 1c cmp ecx, DWORD PTR [esi+28]
\r
1807 0004c 73 2c jae SHORT $LN3@gzputc
\r
1809 ; 271 : if (strm->avail_in == 0)
\r
1811 0004e 85 c9 test ecx, ecx
\r
1812 00050 75 06 jne SHORT $LN2@gzputc
\r
1814 ; 272 : strm->next_in = state->in;
\r
1816 00052 8b 56 24 mov edx, DWORD PTR [esi+36]
\r
1817 00055 89 56 64 mov DWORD PTR [esi+100], edx
\r
1820 ; 273 : strm->next_in[strm->avail_in++] = c;
\r
1822 00058 8b 56 64 mov edx, DWORD PTR [esi+100]
\r
1823 0005b 8b 45 0c mov eax, DWORD PTR _c$[ebp]
\r
1824 0005e 88 04 11 mov BYTE PTR [ecx+edx], al
\r
1825 00061 b9 01 00 00 00 mov ecx, 1
\r
1826 00066 01 4e 68 add DWORD PTR [esi+104], ecx
\r
1828 ; 274 : state->x.pos++;
\r
1830 00069 01 4e 08 add DWORD PTR [esi+8], ecx
\r
1831 0006c 83 56 0c 00 adc DWORD PTR [esi+12], 0
\r
1833 ; 275 : return c & 0xff;
\r
1835 00070 25 ff 00 00 00 and eax, 255 ; 000000ffH
\r
1841 00077 c2 08 00 ret 8
\r
1847 ; 278 : /* no room in buffer or not initialized, use gz_write() */
\r
1848 ; 279 : buf[0] = c;
\r
1850 0007b 8b 5d 0c mov ebx, DWORD PTR _c$[ebp]
\r
1852 ; 280 : if (gzwrite(file, buf, 1) != 1)
\r
1854 0007e 6a 01 push 1
\r
1855 00080 8d 45 0b lea eax, DWORD PTR _buf$[ebp]
\r
1858 00085 88 5d 0b mov BYTE PTR _buf$[ebp], bl
\r
1859 00088 e8 00 00 00 00 call _gzwrite@12
\r
1860 0008d 83 f8 01 cmp eax, 1
\r
1861 00090 74 09 je SHORT $LN1@gzputc
\r
1863 ; 281 : return -1;
\r
1866 00093 83 c8 ff or eax, -1
\r
1872 00098 c2 08 00 ret 8
\r
1875 ; 282 : return c & 0xff;
\r
1877 0009b 8b c3 mov eax, ebx
\r
1879 0009e 25 ff 00 00 00 and eax, 255 ; 000000ffH
\r
1885 000a5 c2 08 00 ret 8
\r