1 ; Listing generated by Microsoft (R) Optimizing Compiler Version 16.00.30319.01
\r
3 TITLE D:\FMU\FMUSolution\zlib-1.2.6\gzwrite.c
\r
11 PUBLIC ??_C@_0CH@DEEGAHIB@internal?5error?3?5deflate?5stream?5c@ ; `string'
\r
12 EXTRN _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 d:\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 e8 00 00 00 00 call _malloc
\r
76 0000e 8b d8 mov ebx, eax
\r
77 00010 83 c4 04 add esp, 4
\r
78 00013 89 5e 24 mov DWORD PTR [esi+36], ebx
\r
80 ; 23 : if (state->in == NULL) {
\r
82 00016 85 db test ebx, ebx
\r
83 00018 75 18 jne SHORT $LN5@gz_init
\r
85 ; 24 : gz_error(state, Z_MEM_ERROR, "out of memory");
\r
87 0001a 68 00 00 00 00 push OFFSET ??_C@_0O@BNNCBLEN@out?5of?5memory?$AA@
\r
88 0001f 8d 43 fc lea eax, DWORD PTR [ebx-4]
\r
89 00022 8b ce mov ecx, esi
\r
90 00024 e8 00 00 00 00 call _gz_error
\r
91 00029 83 c4 04 add esp, 4
\r
96 0002d 83 c8 ff or eax, -1
\r
106 ; 28 : /* only need output buffer and deflate state if compressing */
\r
107 ; 29 : if (!state->direct) {
\r
109 00032 83 7e 2c 00 cmp DWORD PTR [esi+44], 0
\r
110 00036 0f 85 89 00 00
\r
111 00 jne $LN8@gz_init
\r
113 ; 30 : /* allocate output buffer */
\r
114 ; 31 : state->out = malloc(state->want);
\r
116 0003c 8b 46 20 mov eax, DWORD PTR [esi+32]
\r
118 00040 e8 00 00 00 00 call _malloc
\r
120 ; 32 : if (state->out == NULL) {
\r
122 00045 33 c9 xor ecx, ecx
\r
123 00047 83 c4 04 add esp, 4
\r
124 0004a 89 46 28 mov DWORD PTR [esi+40], eax
\r
125 0004d 3b c1 cmp eax, ecx
\r
126 0004f 75 20 jne SHORT $LN3@gz_init
\r
128 ; 33 : free(state->in);
\r
131 00052 e8 00 00 00 00 call _free
\r
133 ; 34 : gz_error(state, Z_MEM_ERROR, "out of memory");
\r
135 00057 68 00 00 00 00 push OFFSET ??_C@_0O@BNNCBLEN@out?5of?5memory?$AA@
\r
136 0005c b8 fc ff ff ff mov eax, -4 ; fffffffcH
\r
137 00061 8b ce mov ecx, esi
\r
138 00063 e8 00 00 00 00 call _gz_error
\r
139 00068 83 c4 08 add esp, 8
\r
144 0006c 83 c8 ff or eax, -1
\r
154 ; 38 : /* allocate deflate memory, set up for gzip compression */
\r
155 ; 39 : strm->zalloc = Z_NULL;
\r
156 ; 40 : strm->zfree = Z_NULL;
\r
157 ; 41 : strm->opaque = Z_NULL;
\r
158 ; 42 : ret = deflateInit2(strm, state->level, Z_DEFLATED,
\r
159 ; 43 : MAX_WBITS + 16, DEF_MEM_LEVEL, state->strategy);
\r
161 00071 6a 38 push 56 ; 00000038H
\r
162 00073 68 00 00 00 00 push OFFSET ??_C@_05BOAHNBIE@1?42?46?$AA@
\r
163 00078 89 4f 20 mov DWORD PTR [edi+32], ecx
\r
164 0007b 89 4f 24 mov DWORD PTR [edi+36], ecx
\r
165 0007e 89 4f 28 mov DWORD PTR [edi+40], ecx
\r
166 00081 8b 46 4c mov eax, DWORD PTR [esi+76]
\r
167 00084 8b 4e 48 mov ecx, DWORD PTR [esi+72]
\r
170 0008a 6a 1f push 31 ; 0000001fH
\r
174 00090 e8 00 00 00 00 call _deflateInit2_@32
\r
176 ; 44 : if (ret != Z_OK) {
\r
178 00095 85 c0 test eax, eax
\r
179 00097 74 2c je SHORT $LN8@gz_init
\r
181 ; 45 : free(state->out);
\r
183 00099 8b 56 28 mov edx, DWORD PTR [esi+40]
\r
185 0009d e8 00 00 00 00 call _free
\r
187 ; 46 : free(state->in);
\r
189 000a2 8b 46 24 mov eax, DWORD PTR [esi+36]
\r
191 000a6 e8 00 00 00 00 call _free
\r
193 ; 47 : gz_error(state, Z_MEM_ERROR, "out of memory");
\r
195 000ab 68 00 00 00 00 push OFFSET ??_C@_0O@BNNCBLEN@out?5of?5memory?$AA@
\r
196 000b0 b8 fc ff ff ff mov eax, -4 ; fffffffcH
\r
197 000b5 8b ce mov ecx, esi
\r
198 000b7 e8 00 00 00 00 call _gz_error
\r
199 000bc 83 c4 0c add esp, 12 ; 0000000cH
\r
204 000c0 83 c8 ff or eax, -1
\r
215 ; 52 : /* mark state as initialized */
\r
216 ; 53 : state->size = state->want;
\r
218 ; 55 : /* initialize write buffer if compressing */
\r
219 ; 56 : if (!state->direct) {
\r
221 000c5 83 7e 2c 00 cmp DWORD PTR [esi+44], 0
\r
222 000c9 8b 46 20 mov eax, DWORD PTR [esi+32]
\r
223 000cc 89 46 1c mov DWORD PTR [esi+28], eax
\r
224 000cf 75 0c jne SHORT $LN1@gz_init
\r
226 ; 57 : strm->avail_out = state->size;
\r
228 000d1 89 47 10 mov DWORD PTR [edi+16], eax
\r
230 ; 58 : strm->next_out = state->out;
\r
232 000d4 8b 46 28 mov eax, DWORD PTR [esi+40]
\r
233 000d7 89 47 0c mov DWORD PTR [edi+12], eax
\r
235 ; 59 : state->x.next = strm->next_out;
\r
237 000da 89 46 04 mov DWORD PTR [esi+4], eax
\r
244 000de 33 c0 xor eax, eax
\r
251 ; Function compile flags: /Ogtp
\r
254 _flush$ = 8 ; size = 4
\r
255 _gz_comp PROC ; COMDAT
\r
261 00001 8b ec mov ebp, esp
\r
263 ; 74 : int ret, got;
\r
264 ; 75 : unsigned have;
\r
265 ; 76 : z_streamp strm = &(state->strm);
\r
267 ; 78 : /* allocate memory if this is the first time through */
\r
268 ; 79 : if (state->size == 0 && gz_init(state) == -1)
\r
270 00003 83 7b 1c 00 cmp DWORD PTR [ebx+28], 0
\r
273 00009 8d 7b 64 lea edi, DWORD PTR [ebx+100]
\r
274 0000c 75 0c jne SHORT $LN21@gz_comp
\r
275 0000e 8b f3 mov esi, ebx
\r
276 00010 e8 00 00 00 00 call _gz_init
\r
277 00015 83 f8 ff cmp eax, -1
\r
281 00018 74 4a je SHORT $LN24@gz_comp
\r
285 ; 82 : /* write directly if requested */
\r
286 ; 83 : if (state->direct) {
\r
288 0001a 83 7b 2c 00 cmp DWORD PTR [ebx+44], 0
\r
289 0001e 74 4b je SHORT $LN14@gz_comp
\r
291 ; 84 : got = write(state->fd, strm->next_in, strm->avail_in);
\r
293 00020 8b 47 04 mov eax, DWORD PTR [edi+4]
\r
294 00023 8b 0f mov ecx, DWORD PTR [edi]
\r
295 00025 8b 53 14 mov edx, DWORD PTR [ebx+20]
\r
299 0002b e8 00 00 00 00 call _write
\r
300 00030 83 c4 0c add esp, 12 ; 0000000cH
\r
302 ; 85 : if (got < 0 || (unsigned)got != strm->avail_in) {
\r
304 00033 85 c0 test eax, eax
\r
305 00035 78 12 js SHORT $LN12@gz_comp
\r
306 00037 3b 47 04 cmp eax, DWORD PTR [edi+4]
\r
307 0003a 75 0d jne SHORT $LN12@gz_comp
\r
310 ; 89 : strm->avail_in = 0;
\r
312 0003c c7 47 04 00 00
\r
313 00 00 mov DWORD PTR [edi+4], 0
\r
317 ; 128 : /* all done, no errors */
\r
320 00044 33 c0 xor eax, eax
\r
329 ; 86 : gz_error(state, Z_ERRNO, zstrerror());
\r
331 00049 e8 00 00 00 00 call __errno
\r
332 0004e 8b 00 mov eax, DWORD PTR [eax]
\r
335 00051 e8 00 00 00 00 call _strerror
\r
337 00057 83 c8 ff or eax, -1
\r
338 0005a 8b cb mov ecx, ebx
\r
339 0005c e8 00 00 00 00 call _gz_error
\r
340 00061 83 c4 08 add esp, 8
\r
346 00065 83 c8 ff or eax, -1
\r
358 ; 93 : /* run deflate() on provided input until it produces no more output */
\r
361 0006b 33 c0 xor eax, eax
\r
362 0006d 8d 49 00 npad 3
\r
366 ; 96 : /* write out current buffer contents if full, or if flushing, but if
\r
367 ; 97 : doing Z_FINISH then don't write until we get to Z_STREAM_END */
\r
368 ; 98 : if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
\r
369 ; 99 : (flush != Z_FINISH || ret == Z_STREAM_END))) {
\r
371 00070 83 7f 10 00 cmp DWORD PTR [edi+16], 0
\r
372 00074 74 11 je SHORT $LN6@gz_comp
\r
373 00076 8b 4d 08 mov ecx, DWORD PTR _flush$[ebp]
\r
374 00079 85 c9 test ecx, ecx
\r
375 0007b 74 45 je SHORT $LN8@gz_comp
\r
376 0007d 83 f9 04 cmp ecx, 4
\r
377 00080 75 05 jne SHORT $LN6@gz_comp
\r
378 00082 83 f8 01 cmp eax, 1
\r
379 00085 75 3b jne SHORT $LN8@gz_comp
\r
382 ; 100 : have = (unsigned)(strm->next_out - state->x.next);
\r
384 00087 8b 43 04 mov eax, DWORD PTR [ebx+4]
\r
385 0008a 8b 77 0c mov esi, DWORD PTR [edi+12]
\r
386 0008d 2b f0 sub esi, eax
\r
388 ; 101 : if (have && ((got = write(state->fd, state->x.next, have)) < 0 ||
\r
389 ; 102 : (unsigned)got != have)) {
\r
391 0008f 74 16 je SHORT $LN23@gz_comp
\r
392 00091 8b 4b 14 mov ecx, DWORD PTR [ebx+20]
\r
396 00097 e8 00 00 00 00 call _write
\r
397 0009c 83 c4 0c add esp, 12 ; 0000000cH
\r
398 0009f 85 c0 test eax, eax
\r
399 000a1 78 45 js SHORT $LN4@gz_comp
\r
400 000a3 3b c6 cmp eax, esi
\r
401 000a5 75 41 jne SHORT $LN4@gz_comp
\r
405 ; 106 : if (strm->avail_out == 0) {
\r
407 000a7 83 7f 10 00 cmp DWORD PTR [edi+16], 0
\r
408 000ab 75 0c jne SHORT $LN3@gz_comp
\r
410 ; 107 : strm->avail_out = state->size;
\r
412 000ad 8b 53 1c mov edx, DWORD PTR [ebx+28]
\r
413 000b0 89 57 10 mov DWORD PTR [edi+16], edx
\r
415 ; 108 : strm->next_out = state->out;
\r
417 000b3 8b 43 28 mov eax, DWORD PTR [ebx+40]
\r
418 000b6 89 47 0c mov DWORD PTR [edi+12], eax
\r
422 ; 110 : state->x.next = strm->next_out;
\r
424 000b9 8b 4f 0c mov ecx, DWORD PTR [edi+12]
\r
425 000bc 89 4b 04 mov DWORD PTR [ebx+4], ecx
\r
426 000bf 8b 4d 08 mov ecx, DWORD PTR _flush$[ebp]
\r
431 ; 113 : /* compress */
\r
432 ; 114 : have = strm->avail_out;
\r
434 000c2 8b 77 10 mov esi, DWORD PTR [edi+16]
\r
436 ; 115 : ret = deflate(strm, flush);
\r
440 000c7 e8 00 00 00 00 call _deflate@8
\r
442 ; 116 : if (ret == Z_STREAM_ERROR) {
\r
444 000cc 83 f8 fe cmp eax, -2 ; fffffffeH
\r
445 000cf 74 24 je SHORT $LN20@gz_comp
\r
449 ; 121 : have -= strm->avail_out;
\r
451 000d1 2b 77 10 sub esi, DWORD PTR [edi+16]
\r
453 ; 122 : } while (have);
\r
455 000d4 75 9a jne SHORT $LL11@gz_comp
\r
458 ; 124 : /* if that completed a deflate stream, allow another to start */
\r
459 ; 125 : if (flush == Z_FINISH)
\r
461 000d6 83 7d 08 04 cmp DWORD PTR _flush$[ebp], 4
\r
462 000da 75 06 jne SHORT $LN1@gz_comp
\r
464 ; 126 : deflateReset(strm);
\r
467 000dd e8 00 00 00 00 call _deflateReset@4
\r
471 ; 128 : /* all done, no errors */
\r
475 000e3 33 c0 xor eax, eax
\r
484 ; 103 : gz_error(state, Z_ERRNO, zstrerror());
\r
486 000e8 e8 00 00 00 00 call __errno
\r
487 000ed 8b 10 mov edx, DWORD PTR [eax]
\r
492 000f0 e9 5c ff ff ff jmp $LN25@gz_comp
\r
495 ; 117 : gz_error(state, Z_STREAM_ERROR,
\r
496 ; 118 : "internal error: deflate stream corrupt");
\r
498 000f5 68 00 00 00 00 push OFFSET ??_C@_0CH@DEEGAHIB@internal?5error?3?5deflate?5stream?5c@
\r
499 000fa b8 fe ff ff ff mov eax, -2 ; fffffffeH
\r
500 000ff 8b cb mov ecx, ebx
\r
501 00101 e8 00 00 00 00 call _gz_error
\r
502 00106 83 c4 04 add esp, 4
\r
504 0010a 83 c8 ff or eax, -1
\r
512 ; Function compile flags: /Ogtp
\r
515 _first$ = -4 ; size = 4
\r
516 _len$ = 8 ; size = 8
\r
517 _gz_zero PROC ; COMDAT
\r
523 00001 8b ec mov ebp, esp
\r
526 00005 8b d8 mov ebx, eax
\r
529 ; 138 : unsigned n;
\r
530 ; 139 : z_streamp strm = &(state->strm);
\r
532 ; 141 : /* consume whatever's left in the input buffer */
\r
533 ; 142 : if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
\r
535 00007 83 7b 68 00 cmp DWORD PTR [ebx+104], 0
\r
536 0000b 74 16 je SHORT $LN5@gz_zero
\r
538 0000f e8 00 00 00 00 call _gz_comp
\r
539 00014 83 c4 04 add esp, 4
\r
540 00017 83 f8 ff cmp eax, -1
\r
541 0001a 75 07 jne SHORT $LN5@gz_zero
\r
545 0001c 0b c0 or eax, eax
\r
552 0001f 8b e5 mov esp, ebp
\r
559 ; 145 : /* compress len zeros (len guaranteed > 0) */
\r
561 ; 147 : while (len) {
\r
563 00024 8b 75 08 mov esi, DWORD PTR _len$[ebp]
\r
564 00027 8b c6 mov eax, esi
\r
565 00029 0b 45 0c or eax, DWORD PTR _len$[ebp+4]
\r
567 0002d c7 45 fc 01 00
\r
568 00 00 mov DWORD PTR _first$[ebp], 1
\r
569 00034 75 0d jne SHORT $LN4@gz_zero
\r
578 00039 8b e5 mov esp, ebp
\r
581 0003d 8d 49 00 npad 3
\r
585 ; 145 : /* compress len zeros (len guaranteed > 0) */
\r
587 ; 147 : while (len) {
\r
589 00040 8b 75 08 mov esi, DWORD PTR _len$[ebp]
\r
592 ; 148 : n = GT_OFF(state->size) || (z_off64_t)state->size > len ?
\r
593 ; 149 : (unsigned)len : state->size;
\r
595 00043 8b 4b 1c mov ecx, DWORD PTR [ebx+28]
\r
596 00046 33 c0 xor eax, eax
\r
597 00048 33 ff xor edi, edi
\r
598 0004a 3b 45 0c cmp eax, DWORD PTR _len$[ebp+4]
\r
599 0004d 7f 08 jg SHORT $LN8@gz_zero
\r
600 0004f 7c 04 jl SHORT $LN13@gz_zero
\r
601 00051 3b ce cmp ecx, esi
\r
602 00053 77 02 ja SHORT $LN8@gz_zero
\r
604 00055 8b f1 mov esi, ecx
\r
607 ; 150 : if (first) {
\r
609 00057 39 7d fc cmp DWORD PTR _first$[ebp], edi
\r
610 0005a 74 11 je SHORT $LN2@gz_zero
\r
612 ; 151 : memset(state->in, 0, n);
\r
614 0005c 8b 4b 24 mov ecx, DWORD PTR [ebx+36]
\r
618 00062 e8 00 00 00 00 call _memset
\r
619 00067 83 c4 0c add esp, 12 ; 0000000cH
\r
623 0006a 89 7d fc mov DWORD PTR _first$[ebp], edi
\r
627 ; 154 : strm->avail_in = n;
\r
629 0006d 89 73 68 mov DWORD PTR [ebx+104], esi
\r
631 ; 155 : strm->next_in = state->in;
\r
633 00070 8b 53 24 mov edx, DWORD PTR [ebx+36]
\r
634 00073 89 53 64 mov DWORD PTR [ebx+100], edx
\r
636 ; 156 : state->x.pos += n;
\r
638 00076 01 73 08 add DWORD PTR [ebx+8], esi
\r
640 ; 157 : if (gz_comp(state, Z_NO_FLUSH) == -1)
\r
643 0007a 11 7b 0c adc DWORD PTR [ebx+12], edi
\r
644 0007d e8 00 00 00 00 call _gz_comp
\r
645 00082 83 c4 04 add esp, 4
\r
646 00085 83 f8 ff cmp eax, -1
\r
647 00088 74 1b je SHORT $LN11@gz_zero
\r
651 0008a 8b 45 08 mov eax, DWORD PTR _len$[ebp]
\r
652 0008d 8b 4d 0c mov ecx, DWORD PTR _len$[ebp+4]
\r
653 00090 2b c6 sub eax, esi
\r
654 00092 1b cf sbb ecx, edi
\r
655 00094 89 45 08 mov DWORD PTR _len$[ebp], eax
\r
656 00097 0b c1 or eax, ecx
\r
657 00099 89 4d 0c mov DWORD PTR _len$[ebp+4], ecx
\r
658 0009c 75 a2 jne SHORT $LL14@gz_zero
\r
667 000a1 8b e5 mov esp, ebp
\r
676 000a7 83 c8 ff or eax, -1
\r
683 000ab 8b e5 mov esp, ebp
\r
687 PUBLIC _gzclose_w@4
\r
688 ; Function compile flags: /Ogtp
\r
689 ; COMDAT _gzclose_w@4
\r
691 _file$ = 8 ; size = 4
\r
692 _gzclose_w@4 PROC ; COMDAT
\r
697 00001 8b ec mov ebp, esp
\r
700 ; 529 : int ret = Z_OK;
\r
701 ; 530 : gz_statep state;
\r
703 ; 532 : /* get internal structure */
\r
704 ; 533 : if (file == NULL)
\r
706 00004 8b 5d 08 mov ebx, DWORD PTR _file$[ebp]
\r
708 00008 33 f6 xor esi, esi
\r
709 0000a 85 db test ebx, ebx
\r
710 0000c 75 0b jne SHORT $LN7@gzclose_w
\r
714 ; 534 : return Z_STREAM_ERROR;
\r
716 0000f b8 fe ff ff ff mov eax, -2 ; fffffffeH
\r
722 00016 c2 04 00 ret 4
\r
725 ; 535 : state = (gz_statep)file;
\r
727 ; 537 : /* check that we're writing */
\r
728 ; 538 : if (state->mode != GZ_WRITE)
\r
730 00019 81 7b 10 b1 79
\r
731 00 00 cmp DWORD PTR [ebx+16], 31153 ; 000079b1H
\r
733 ; 539 : return Z_STREAM_ERROR;
\r
735 00020 75 ec jne SHORT $LN10@gzclose_w
\r
738 ; 541 : /* check for seek request */
\r
739 ; 542 : if (state->seek) {
\r
741 00022 39 73 58 cmp DWORD PTR [ebx+88], esi
\r
742 00025 74 1d je SHORT $LN4@gzclose_w
\r
744 ; 543 : state->seek = 0;
\r
745 ; 544 : if (gz_zero(state, state->skip) == -1)
\r
747 00027 8b 43 54 mov eax, DWORD PTR [ebx+84]
\r
748 0002a 8b 4b 50 mov ecx, DWORD PTR [ebx+80]
\r
751 0002f 8b c3 mov eax, ebx
\r
752 00031 89 73 58 mov DWORD PTR [ebx+88], esi
\r
753 00034 e8 00 00 00 00 call _gz_zero
\r
754 00039 83 c4 08 add esp, 8
\r
755 0003c 83 f8 ff cmp eax, -1
\r
756 0003f 75 03 jne SHORT $LN4@gzclose_w
\r
758 ; 545 : ret = state->err;
\r
760 00041 8b 73 5c mov esi, DWORD PTR [ebx+92]
\r
765 ; 548 : /* flush, free memory, and close file */
\r
766 ; 549 : if (gz_comp(state, Z_FINISH) == -1)
\r
769 00046 e8 00 00 00 00 call _gz_comp
\r
770 0004b 83 c4 04 add esp, 4
\r
771 0004e 83 f8 ff cmp eax, -1
\r
772 00051 75 03 jne SHORT $LN3@gzclose_w
\r
774 ; 550 : ret = state->err;
\r
776 00053 8b 73 5c mov esi, DWORD PTR [ebx+92]
\r
779 ; 551 : if (!state->direct) {
\r
781 00056 83 7b 2c 00 cmp DWORD PTR [ebx+44], 0
\r
782 0005a 75 15 jne SHORT $LN2@gzclose_w
\r
784 ; 552 : (void)deflateEnd(&(state->strm));
\r
786 0005c 8d 53 64 lea edx, DWORD PTR [ebx+100]
\r
788 00060 e8 00 00 00 00 call _deflateEnd@4
\r
790 ; 553 : free(state->out);
\r
792 00065 8b 43 28 mov eax, DWORD PTR [ebx+40]
\r
794 00069 e8 00 00 00 00 call _free
\r
795 0006e 83 c4 04 add esp, 4
\r
799 ; 555 : free(state->in);
\r
801 00071 8b 4b 24 mov ecx, DWORD PTR [ebx+36]
\r
803 00075 e8 00 00 00 00 call _free
\r
805 ; 556 : gz_error(state, Z_OK, NULL);
\r
808 0007c 33 c0 xor eax, eax
\r
809 0007e 8b cb mov ecx, ebx
\r
810 00080 e8 00 00 00 00 call _gz_error
\r
812 ; 557 : free(state->path);
\r
814 00085 8b 53 18 mov edx, DWORD PTR [ebx+24]
\r
816 00089 e8 00 00 00 00 call _free
\r
818 ; 558 : if (close(state->fd) == -1)
\r
820 0008e 8b 43 14 mov eax, DWORD PTR [ebx+20]
\r
822 00092 e8 00 00 00 00 call _close
\r
823 00097 83 c4 10 add esp, 16 ; 00000010H
\r
824 0009a 83 f8 ff cmp eax, -1
\r
825 0009d 75 02 jne SHORT $LN1@gzclose_w
\r
827 ; 559 : ret = Z_ERRNO;
\r
829 0009f 0b f0 or esi, eax
\r
832 ; 560 : free(state);
\r
835 000a2 e8 00 00 00 00 call _free
\r
836 000a7 83 c4 04 add esp, 4
\r
838 ; 561 : return ret;
\r
840 000aa 8b c6 mov eax, esi
\r
847 000af c2 04 00 ret 4
\r
850 PUBLIC _gzsetparams@12
\r
851 ; Function compile flags: /Ogtp
\r
852 ; COMDAT _gzsetparams@12
\r
854 _file$ = 8 ; size = 4
\r
855 _level$ = 12 ; size = 4
\r
856 _strategy$ = 16 ; size = 4
\r
857 _gzsetparams@12 PROC ; COMDAT
\r
862 00001 8b ec mov ebp, esp
\r
865 ; 489 : gz_statep state;
\r
866 ; 490 : z_streamp strm;
\r
868 ; 492 : /* get internal structure */
\r
869 ; 493 : if (file == NULL)
\r
871 00004 8b 5d 08 mov ebx, DWORD PTR _file$[ebp]
\r
872 00007 85 db test ebx, ebx
\r
873 00009 75 0a jne SHORT $LN8@gzsetparam
\r
876 ; 494 : return Z_STREAM_ERROR;
\r
878 0000b b8 fe ff ff ff mov eax, -2 ; fffffffeH
\r
884 00012 c2 0c 00 ret 12 ; 0000000cH
\r
887 ; 495 : state = (gz_statep)file;
\r
888 ; 496 : strm = &(state->strm);
\r
890 ; 498 : /* check that we're writing and that there's no error */
\r
891 ; 499 : if (state->mode != GZ_WRITE || state->err != Z_OK)
\r
893 00015 81 7b 10 b1 79
\r
894 00 00 cmp DWORD PTR [ebx+16], 31153 ; 000079b1H
\r
895 0001c 75 ed jne SHORT $LN6@gzsetparam
\r
896 0001e 83 7b 5c 00 cmp DWORD PTR [ebx+92], 0
\r
897 00022 75 e7 jne SHORT $LN6@gzsetparam
\r
899 ; 500 : return Z_STREAM_ERROR;
\r
901 ; 502 : /* if no change is requested, then do nothing */
\r
902 ; 503 : if (level == state->level && strategy == state->strategy)
\r
905 00025 8b 75 0c mov esi, DWORD PTR _level$[ebp]
\r
907 00029 8b 7d 10 mov edi, DWORD PTR _strategy$[ebp]
\r
908 0002c 3b 73 48 cmp esi, DWORD PTR [ebx+72]
\r
909 0002f 75 05 jne SHORT $LN5@gzsetparam
\r
910 00031 3b 7b 4c cmp edi, DWORD PTR [ebx+76]
\r
912 ; 504 : return Z_OK;
\r
914 00034 74 63 je SHORT $LN14@gzsetparam
\r
918 ; 506 : /* check for seek request */
\r
919 ; 507 : if (state->seek) {
\r
921 00036 83 7b 58 00 cmp DWORD PTR [ebx+88], 0
\r
922 0003a 74 27 je SHORT $LN11@gzsetparam
\r
924 ; 508 : state->seek = 0;
\r
925 ; 509 : if (gz_zero(state, state->skip) == -1)
\r
927 0003c 8b 43 54 mov eax, DWORD PTR [ebx+84]
\r
928 0003f 8b 4b 50 mov ecx, DWORD PTR [ebx+80]
\r
931 00044 8b c3 mov eax, ebx
\r
932 00046 c7 43 58 00 00
\r
933 00 00 mov DWORD PTR [ebx+88], 0
\r
934 0004d e8 00 00 00 00 call _gz_zero
\r
935 00052 83 c4 08 add esp, 8
\r
936 00055 83 f8 ff cmp eax, -1
\r
937 00058 75 09 jne SHORT $LN11@gzsetparam
\r
943 0005c 0b c0 or eax, eax
\r
949 00060 c2 0c 00 ret 12 ; 0000000cH
\r
954 ; 513 : /* change compression parameters for subsequent input */
\r
955 ; 514 : if (state->size) {
\r
957 00063 83 7b 1c 00 cmp DWORD PTR [ebx+28], 0
\r
958 00067 74 2a je SHORT $LN2@gzsetparam
\r
960 ; 515 : /* flush previous input with previous parameters before changing */
\r
961 ; 516 : if (strm->avail_in && gz_comp(state, Z_PARTIAL_FLUSH) == -1)
\r
963 00069 83 7b 68 00 cmp DWORD PTR [ebx+104], 0
\r
964 0006d 74 19 je SHORT $LN1@gzsetparam
\r
966 00071 e8 00 00 00 00 call _gz_comp
\r
967 00076 83 c4 04 add esp, 4
\r
968 00079 83 f8 ff cmp eax, -1
\r
969 0007c 75 0a jne SHORT $LN1@gzsetparam
\r
971 ; 517 : return state->err;
\r
973 0007e 8b 43 5c mov eax, DWORD PTR [ebx+92]
\r
981 00085 c2 0c 00 ret 12 ; 0000000cH
\r
984 ; 518 : deflateParams(strm, level, strategy);
\r
988 0008a 8d 43 64 lea eax, DWORD PTR [ebx+100]
\r
990 0008e e8 00 00 00 00 call _deflateParams@12
\r
994 ; 520 : state->level = level;
\r
996 00093 89 73 48 mov DWORD PTR [ebx+72], esi
\r
998 ; 521 : state->strategy = strategy;
\r
1000 00096 89 7b 4c mov DWORD PTR [ebx+76], edi
\r
1003 ; 522 : return Z_OK;
\r
1007 0009b 33 c0 xor eax, eax
\r
1013 0009f c2 0c 00 ret 12 ; 0000000cH
\r
1014 _gzsetparams@12 ENDP
\r
1017 ; Function compile flags: /Ogtp
\r
1018 ; COMDAT _gzflush@8
\r
1020 _file$ = 8 ; size = 4
\r
1021 _flush$ = 12 ; size = 4
\r
1022 _gzflush@8 PROC ; COMDAT
\r
1027 00001 8b ec mov ebp, esp
\r
1030 ; 456 : gz_statep state;
\r
1032 ; 458 : /* get internal structure */
\r
1033 ; 459 : if (file == NULL)
\r
1035 00004 8b 5d 08 mov ebx, DWORD PTR _file$[ebp]
\r
1036 00007 85 db test ebx, ebx
\r
1037 00009 75 08 jne SHORT $LN7@gzflush
\r
1039 ; 460 : return -1;
\r
1041 0000b 83 c8 ff or eax, -1
\r
1047 00010 c2 08 00 ret 8
\r
1050 ; 461 : state = (gz_statep)file;
\r
1052 ; 463 : /* check that we're writing and that there's no error */
\r
1053 ; 464 : if (state->mode != GZ_WRITE || state->err != Z_OK)
\r
1055 00013 81 7b 10 b1 79
\r
1056 00 00 cmp DWORD PTR [ebx+16], 31153 ; 000079b1H
\r
1057 0001a 75 58 jne SHORT $LN5@gzflush
\r
1058 0001c 83 7b 5c 00 cmp DWORD PTR [ebx+92], 0
\r
1059 00020 75 52 jne SHORT $LN5@gzflush
\r
1062 ; 467 : /* check flush parameter */
\r
1063 ; 468 : if (flush < 0 || flush > Z_FINISH)
\r
1066 00023 8b 75 0c mov esi, DWORD PTR _flush$[ebp]
\r
1067 00026 83 fe 04 cmp esi, 4
\r
1068 00029 77 3e ja SHORT $LN3@gzflush
\r
1071 ; 471 : /* check for seek request */
\r
1072 ; 472 : if (state->seek) {
\r
1074 0002b 83 7b 58 00 cmp DWORD PTR [ebx+88], 0
\r
1075 0002f 74 26 je SHORT $LN1@gzflush
\r
1077 ; 473 : state->seek = 0;
\r
1078 ; 474 : if (gz_zero(state, state->skip) == -1)
\r
1080 00031 8b 43 54 mov eax, DWORD PTR [ebx+84]
\r
1081 00034 8b 4b 50 mov ecx, DWORD PTR [ebx+80]
\r
1084 00039 8b c3 mov eax, ebx
\r
1085 0003b c7 43 58 00 00
\r
1086 00 00 mov DWORD PTR [ebx+88], 0
\r
1087 00042 e8 00 00 00 00 call _gz_zero
\r
1088 00047 83 c4 08 add esp, 8
\r
1089 0004a 83 f8 ff cmp eax, -1
\r
1090 0004d 75 08 jne SHORT $LN1@gzflush
\r
1092 ; 475 : return -1;
\r
1095 00050 0b c0 or eax, eax
\r
1101 00054 c2 08 00 ret 8
\r
1106 ; 478 : /* compress remaining data with requested flush */
\r
1107 ; 479 : gz_comp(state, flush);
\r
1110 00058 e8 00 00 00 00 call _gz_comp
\r
1112 ; 480 : return state->err;
\r
1114 0005d 8b 43 5c mov eax, DWORD PTR [ebx+92]
\r
1115 00060 83 c4 04 add esp, 4
\r
1122 00066 c2 08 00 ret 8
\r
1126 ; 469 : return Z_STREAM_ERROR;
\r
1128 0006a b8 fe ff ff ff mov eax, -2 ; fffffffeH
\r
1134 00071 c2 08 00 ret 8
\r
1137 ; 465 : return Z_STREAM_ERROR;
\r
1139 00074 b8 fe ff ff ff mov eax, -2 ; fffffffeH
\r
1145 0007b c2 08 00 ret 8
\r
1149 ; Function compile flags: /Ogtp
\r
1150 ; COMDAT _gzprintf
\r
1152 _file$ = 8 ; size = 4
\r
1153 _format$ = 12 ; size = 4
\r
1154 _gzprintf PROC ; COMDAT
\r
1159 00001 8b ec mov ebp, esp
\r
1162 ; 305 : int size, len;
\r
1163 ; 306 : gz_statep state;
\r
1164 ; 307 : z_streamp strm;
\r
1165 ; 308 : va_list va;
\r
1167 ; 310 : /* get internal structure */
\r
1168 ; 311 : if (file == NULL)
\r
1170 00004 8b 75 08 mov esi, DWORD PTR _file$[ebp]
\r
1171 00007 85 f6 test esi, esi
\r
1172 00009 75 06 jne SHORT $LN9@gzprintf
\r
1174 ; 312 : return -1;
\r
1176 0000b 83 c8 ff or eax, -1
\r
1185 ; 313 : state = (gz_statep)file;
\r
1186 ; 314 : strm = &(state->strm);
\r
1188 ; 316 : /* check that we're writing and that there's no error */
\r
1189 ; 317 : if (state->mode != GZ_WRITE || state->err != Z_OK)
\r
1191 00011 81 7e 10 b1 79
\r
1192 00 00 cmp DWORD PTR [esi+16], 31153 ; 000079b1H
\r
1193 00018 75 16 jne SHORT $LN14@gzprintf
\r
1194 0001a 83 7e 5c 00 cmp DWORD PTR [esi+92], 0
\r
1195 0001e 75 10 jne SHORT $LN14@gzprintf
\r
1199 ; 320 : /* make sure we have some buffer space */
\r
1200 ; 321 : if (state->size == 0 && gz_init(state) == -1)
\r
1202 00020 83 7e 1c 00 cmp DWORD PTR [esi+28], 0
\r
1203 00024 75 0f jne SHORT $LN6@gzprintf
\r
1204 00026 e8 00 00 00 00 call _gz_init
\r
1205 0002b 83 f8 ff cmp eax, -1
\r
1206 0002e 75 05 jne SHORT $LN6@gzprintf
\r
1211 00030 33 c0 xor eax, eax
\r
1221 ; 324 : /* check for seek request */
\r
1222 ; 325 : if (state->seek) {
\r
1224 00035 83 7e 58 00 cmp DWORD PTR [esi+88], 0
\r
1225 00039 74 1e je SHORT $LN4@gzprintf
\r
1227 ; 326 : state->seek = 0;
\r
1228 ; 327 : if (gz_zero(state, state->skip) == -1)
\r
1230 0003b 8b 46 54 mov eax, DWORD PTR [esi+84]
\r
1231 0003e 8b 4e 50 mov ecx, DWORD PTR [esi+80]
\r
1234 00043 8b c6 mov eax, esi
\r
1235 00045 c7 46 58 00 00
\r
1236 00 00 mov DWORD PTR [esi+88], 0
\r
1237 0004c e8 00 00 00 00 call _gz_zero
\r
1238 00051 83 c4 08 add esp, 8
\r
1239 00054 83 f8 ff cmp eax, -1
\r
1243 00057 74 d7 je SHORT $LN14@gzprintf
\r
1248 ; 331 : /* consume whatever's left in the input buffer */
\r
1249 ; 332 : if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
\r
1251 00059 83 7e 68 00 cmp DWORD PTR [esi+104], 0
\r
1252 0005d 74 13 je SHORT $LN12@gzprintf
\r
1254 00060 6a 00 push 0
\r
1255 00062 8b de mov ebx, esi
\r
1256 00064 e8 00 00 00 00 call _gz_comp
\r
1257 00069 83 c4 04 add esp, 4
\r
1259 0006d 83 f8 ff cmp eax, -1
\r
1263 00070 74 be je SHORT $LN14@gzprintf
\r
1267 ; 335 : /* do the printf() into the input buffer, put length in len */
\r
1268 ; 336 : size = (int)(state->size);
\r
1269 ; 337 : state->in[size - 1] = 0;
\r
1271 00072 8b 56 24 mov edx, DWORD PTR [esi+36]
\r
1273 00076 8b 7e 1c mov edi, DWORD PTR [esi+28]
\r
1274 00079 c6 44 17 ff 00 mov BYTE PTR [edi+edx-1], 0
\r
1276 ; 338 : va_start(va, format);
\r
1277 ; 339 : #ifdef NO_vsnprintf
\r
1278 ; 340 : # ifdef HAS_vsprintf_void
\r
1279 ; 341 : (void)vsprintf(state->in, format, va);
\r
1280 ; 342 : va_end(va);
\r
1281 ; 343 : for (len = 0; len < size; len++)
\r
1282 ; 344 : if (state->in[len] == 0) break;
\r
1284 ; 346 : len = vsprintf(state->in, format, va);
\r
1285 ; 347 : va_end(va);
\r
1288 ; 350 : # ifdef HAS_vsnprintf_void
\r
1289 ; 351 : (void)vsnprintf(state->in, size, format, va);
\r
1290 ; 352 : va_end(va);
\r
1291 ; 353 : len = strlen(state->in);
\r
1293 ; 355 : len = vsnprintf((char *)(state->in), size, format, va);
\r
1295 0007e 8b 4d 0c mov ecx, DWORD PTR _format$[ebp]
\r
1296 00081 8b 56 24 mov edx, DWORD PTR [esi+36]
\r
1297 00084 8d 45 10 lea eax, DWORD PTR _format$[ebp+4]
\r
1302 0008b e8 00 00 00 00 call _vsnprintf
\r
1303 00090 8b c8 mov ecx, eax
\r
1304 00092 83 c4 10 add esp, 16 ; 00000010H
\r
1306 ; 356 : va_end(va);
\r
1310 ; 360 : /* check that printf() results fit in buffer */
\r
1311 ; 361 : if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)
\r
1313 00095 85 c9 test ecx, ecx
\r
1314 00097 7e 26 jle SHORT $LN1@gzprintf
\r
1315 00099 3b cf cmp ecx, edi
\r
1316 0009b 7d 22 jge SHORT $LN1@gzprintf
\r
1317 0009d 8b 46 24 mov eax, DWORD PTR [esi+36]
\r
1318 000a0 80 7c 07 ff 00 cmp BYTE PTR [edi+eax-1], 0
\r
1319 000a5 75 18 jne SHORT $LN1@gzprintf
\r
1322 ; 364 : /* update buffer and position, defer compression until needed */
\r
1323 ; 365 : strm->avail_in = (unsigned)len;
\r
1325 000a7 89 4e 68 mov DWORD PTR [esi+104], ecx
\r
1327 ; 366 : strm->next_in = state->in;
\r
1329 000aa 8b 56 24 mov edx, DWORD PTR [esi+36]
\r
1330 000ad 89 56 64 mov DWORD PTR [esi+100], edx
\r
1332 ; 367 : state->x.pos += len;
\r
1334 000b0 8b c1 mov eax, ecx
\r
1336 000b3 01 46 08 add DWORD PTR [esi+8], eax
\r
1339 ; 368 : return len;
\r
1341 000b7 8b c1 mov eax, ecx
\r
1342 000b9 11 56 0c adc DWORD PTR [esi+12], edx
\r
1354 000c0 33 c0 xor eax, eax
\r
1363 PUBLIC _gzwrite@12
\r
1364 ; Function compile flags: /Ogtp
\r
1365 ; COMDAT _gzwrite@12
\r
1367 _file$ = 8 ; size = 4
\r
1368 _buf$ = 12 ; size = 4
\r
1369 _put$ = 16 ; size = 4
\r
1370 _len$ = 16 ; size = 4
\r
1371 _gzwrite@12 PROC ; COMDAT
\r
1376 00001 8b ec mov ebp, esp
\r
1379 ; 170 : unsigned put = len;
\r
1380 ; 171 : unsigned n;
\r
1381 ; 172 : gz_statep state;
\r
1382 ; 173 : z_streamp strm;
\r
1384 ; 175 : /* get internal structure */
\r
1385 ; 176 : if (file == NULL)
\r
1387 00004 8b 5d 08 mov ebx, DWORD PTR _file$[ebp]
\r
1389 00008 8b 7d 10 mov edi, DWORD PTR _len$[ebp]
\r
1390 0000b 89 7d 10 mov DWORD PTR _put$[ebp], edi
\r
1391 0000e 85 db test ebx, ebx
\r
1395 00010 74 27 je SHORT $LN32@gzwrite
\r
1397 ; 178 : state = (gz_statep)file;
\r
1398 ; 179 : strm = &(state->strm);
\r
1400 ; 181 : /* check that we're writing and that there's no error */
\r
1401 ; 182 : if (state->mode != GZ_WRITE || state->err != Z_OK)
\r
1403 00012 81 7b 10 b1 79
\r
1404 00 00 cmp DWORD PTR [ebx+16], 31153 ; 000079b1H
\r
1405 00019 75 1e jne SHORT $LN32@gzwrite
\r
1406 0001b 83 7b 5c 00 cmp DWORD PTR [ebx+92], 0
\r
1407 0001f 75 18 jne SHORT $LN32@gzwrite
\r
1411 ; 185 : /* since an int is returned, make sure len fits in one, otherwise return
\r
1412 ; 186 : with an error (this avoids the flaw in the interface) */
\r
1413 ; 187 : if ((int)len < 0) {
\r
1415 00021 85 ff test edi, edi
\r
1416 00023 79 1c jns SHORT $LN30@gzwrite
\r
1418 ; 188 : gz_error(state, Z_DATA_ERROR, "requested length does not fit in int");
\r
1420 00025 68 00 00 00 00 push OFFSET ??_C@_0CF@MLPJFDMM@requested?5length?5does?5not?5fit?5in@
\r
1421 0002a b8 fd ff ff ff mov eax, -3 ; fffffffdH
\r
1422 0002f 8b cb mov ecx, ebx
\r
1423 00031 e8 00 00 00 00 call _gz_error
\r
1424 00036 83 c4 04 add esp, 4
\r
1430 0003a 33 c0 xor eax, eax
\r
1436 0003e c2 0c 00 ret 12 ; 0000000cH
\r
1441 ; 192 : /* if len is zero, avoid unnecessary operations */
\r
1442 ; 193 : if (len == 0)
\r
1445 00041 74 f6 je SHORT $LN32@gzwrite
\r
1448 ; 196 : /* allocate memory if this is the first time through */
\r
1449 ; 197 : if (state->size == 0 && gz_init(state) == -1)
\r
1451 00043 83 7b 1c 00 cmp DWORD PTR [ebx+28], 0
\r
1453 00048 75 0c jne SHORT $LN24@gzwrite
\r
1454 0004a 8b f3 mov esi, ebx
\r
1455 0004c e8 00 00 00 00 call _gz_init
\r
1456 00051 83 f8 ff cmp eax, -1
\r
1460 00054 74 75 je SHORT $LN31@gzwrite
\r
1464 ; 200 : /* check for seek request */
\r
1465 ; 201 : if (state->seek) {
\r
1467 00056 33 f6 xor esi, esi
\r
1468 00058 39 73 58 cmp DWORD PTR [ebx+88], esi
\r
1469 0005b 74 1a je SHORT $LN28@gzwrite
\r
1471 ; 202 : state->seek = 0;
\r
1472 ; 203 : if (gz_zero(state, state->skip) == -1)
\r
1474 0005d 8b 43 54 mov eax, DWORD PTR [ebx+84]
\r
1475 00060 8b 4b 50 mov ecx, DWORD PTR [ebx+80]
\r
1478 00065 8b c3 mov eax, ebx
\r
1479 00067 89 73 58 mov DWORD PTR [ebx+88], esi
\r
1480 0006a e8 00 00 00 00 call _gz_zero
\r
1481 0006f 83 c4 08 add esp, 8
\r
1482 00072 83 f8 ff cmp eax, -1
\r
1486 00075 74 54 je SHORT $LN31@gzwrite
\r
1491 ; 207 : /* for small len, copy to input buffer, otherwise compress directly */
\r
1492 ; 208 : if (len < state->size) {
\r
1494 00077 3b 7b 1c cmp edi, DWORD PTR [ebx+28]
\r
1495 0007a 73 58 jae SHORT $LN10@gzwrite
\r
1496 0007c 8d 64 24 00 npad 4
\r
1499 ; 209 : /* copy to input buffer, compress when full */
\r
1501 ; 211 : if (strm->avail_in == 0)
\r
1503 00080 8b 43 68 mov eax, DWORD PTR [ebx+104]
\r
1504 00083 85 c0 test eax, eax
\r
1505 00085 75 06 jne SHORT $LN6@gzwrite
\r
1507 ; 212 : strm->next_in = state->in;
\r
1509 00087 8b 53 24 mov edx, DWORD PTR [ebx+36]
\r
1510 0008a 89 53 64 mov DWORD PTR [ebx+100], edx
\r
1513 ; 213 : n = state->size - strm->avail_in;
\r
1515 0008d 8b 73 1c mov esi, DWORD PTR [ebx+28]
\r
1516 00090 2b f0 sub esi, eax
\r
1518 ; 214 : if (n > len)
\r
1520 00092 3b f7 cmp esi, edi
\r
1521 00094 76 02 jbe SHORT $LN5@gzwrite
\r
1525 00096 8b f7 mov esi, edi
\r
1528 ; 216 : memcpy(strm->next_in + strm->avail_in, buf, n);
\r
1530 00098 8b 4d 0c mov ecx, DWORD PTR _buf$[ebp]
\r
1531 0009b 8b 53 64 mov edx, DWORD PTR [ebx+100]
\r
1534 000a0 03 d0 add edx, eax
\r
1536 000a3 e8 00 00 00 00 call _memcpy
\r
1538 ; 217 : strm->avail_in += n;
\r
1540 000a8 01 73 68 add DWORD PTR [ebx+104], esi
\r
1541 000ab 83 c4 0c add esp, 12 ; 0000000cH
\r
1543 ; 218 : state->x.pos += n;
\r
1545 000ae 01 73 08 add DWORD PTR [ebx+8], esi
\r
1546 000b1 83 53 0c 00 adc DWORD PTR [ebx+12], 0
\r
1548 ; 219 : buf = (char *)buf + n;
\r
1550 000b5 01 75 0c add DWORD PTR _buf$[ebp], esi
\r
1554 000b8 2b fe sub edi, esi
\r
1556 ; 221 : if (len && gz_comp(state, Z_NO_FLUSH) == -1)
\r
1558 000ba 74 48 je SHORT $LN27@gzwrite
\r
1559 000bc 6a 00 push 0
\r
1560 000be e8 00 00 00 00 call _gz_comp
\r
1561 000c3 83 c4 04 add esp, 4
\r
1562 000c6 83 f8 ff cmp eax, -1
\r
1563 000c9 75 b5 jne SHORT $LL9@gzwrite
\r
1570 000cd 33 c0 xor eax, eax
\r
1576 000d1 c2 0c 00 ret 12 ; 0000000cH
\r
1579 ; 223 : } while (len);
\r
1582 ; 226 : /* consume whatever's left in the input buffer */
\r
1583 ; 227 : if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
\r
1585 000d4 39 73 68 cmp DWORD PTR [ebx+104], esi
\r
1586 000d7 74 0e je SHORT $LN2@gzwrite
\r
1588 000da e8 00 00 00 00 call _gz_comp
\r
1589 000df 83 c4 04 add esp, 4
\r
1590 000e2 83 f8 ff cmp eax, -1
\r
1594 000e5 74 e4 je SHORT $LN31@gzwrite
\r
1598 ; 230 : /* directly compress user buffer to file */
\r
1599 ; 231 : strm->avail_in = len;
\r
1600 ; 232 : strm->next_in = (voidp)buf;
\r
1602 000e7 8b 45 0c mov eax, DWORD PTR _buf$[ebp]
\r
1603 000ea 89 7b 68 mov DWORD PTR [ebx+104], edi
\r
1604 000ed 89 43 64 mov DWORD PTR [ebx+100], eax
\r
1606 ; 233 : state->x.pos += len;
\r
1608 000f0 01 7b 08 add DWORD PTR [ebx+8], edi
\r
1610 ; 234 : if (gz_comp(state, Z_NO_FLUSH) == -1)
\r
1613 000f4 11 73 0c adc DWORD PTR [ebx+12], esi
\r
1614 000f7 e8 00 00 00 00 call _gz_comp
\r
1615 000fc 83 c4 04 add esp, 4
\r
1616 000ff 83 f8 ff cmp eax, -1
\r
1620 00102 74 c7 je SHORT $LN31@gzwrite
\r
1625 ; 238 : /* input was all buffered or compressed (put will fit in int) */
\r
1626 ; 239 : return (int)put;
\r
1628 00104 8b 45 10 mov eax, DWORD PTR _put$[ebp]
\r
1636 0010b c2 0c 00 ret 12 ; 0000000cH
\r
1639 ; Function compile flags: /Ogtp
\r
1640 ; COMDAT _gzputs@8
\r
1642 _file$ = 8 ; size = 4
\r
1643 _str$ = 12 ; size = 4
\r
1644 _gzputs@8 PROC ; COMDAT
\r
1649 00001 8b ec mov ebp, esp
\r
1652 ; 291 : unsigned len;
\r
1654 ; 293 : /* write string */
\r
1655 ; 294 : len = (unsigned)strlen(str);
\r
1657 00003 8b 55 0c mov edx, DWORD PTR _str$[ebp]
\r
1658 00006 8b c2 mov eax, edx
\r
1660 00009 8d 70 01 lea esi, DWORD PTR [eax+1]
\r
1661 0000c 8d 64 24 00 npad 4
\r
1663 00010 8a 08 mov cl, BYTE PTR [eax]
\r
1665 00013 84 c9 test cl, cl
\r
1666 00015 75 f9 jne SHORT $LL5@gzputs
\r
1667 00017 2b c6 sub eax, esi
\r
1668 00019 8b f0 mov esi, eax
\r
1670 ; 295 : ret = gzwrite(file, str, len);
\r
1672 0001b 8b 45 08 mov eax, DWORD PTR _file$[ebp]
\r
1676 00021 e8 00 00 00 00 call _gzwrite@12
\r
1678 ; 296 : return ret == 0 && len != 0 ? -1 : ret;
\r
1680 00026 85 c0 test eax, eax
\r
1681 00028 75 07 jne SHORT $LN4@gzputs
\r
1682 0002a 85 f6 test esi, esi
\r
1683 0002c 74 03 je SHORT $LN4@gzputs
\r
1684 0002e 83 c8 ff or eax, -1
\r
1691 00033 c2 08 00 ret 8
\r
1695 ; Function compile flags: /Ogtp
\r
1696 ; COMDAT _gzputc@8
\r
1698 _file$ = 8 ; size = 4
\r
1699 _buf$ = 11 ; size = 1
\r
1700 _c$ = 12 ; size = 4
\r
1701 _gzputc@8 PROC ; COMDAT
\r
1706 00001 8b ec mov ebp, esp
\r
1709 ; 247 : unsigned char buf[1];
\r
1710 ; 248 : gz_statep state;
\r
1711 ; 249 : z_streamp strm;
\r
1713 ; 251 : /* get internal structure */
\r
1714 ; 252 : if (file == NULL)
\r
1716 00004 8b 75 08 mov esi, DWORD PTR _file$[ebp]
\r
1717 00007 85 f6 test esi, esi
\r
1718 00009 75 08 jne SHORT $LN8@gzputc
\r
1721 ; 253 : return -1;
\r
1723 0000b 83 c8 ff or eax, -1
\r
1729 00010 c2 08 00 ret 8
\r
1732 ; 254 : state = (gz_statep)file;
\r
1733 ; 255 : strm = &(state->strm);
\r
1735 ; 257 : /* check that we're writing and that there's no error */
\r
1736 ; 258 : if (state->mode != GZ_WRITE || state->err != Z_OK)
\r
1738 00013 81 7e 10 b1 79
\r
1739 00 00 cmp DWORD PTR [esi+16], 31153 ; 000079b1H
\r
1740 0001a 75 ef jne SHORT $LN12@gzputc
\r
1741 0001c 83 7e 5c 00 cmp DWORD PTR [esi+92], 0
\r
1742 00020 75 e9 jne SHORT $LN12@gzputc
\r
1744 ; 259 : return -1;
\r
1746 ; 261 : /* check for seek request */
\r
1747 ; 262 : if (state->seek) {
\r
1749 00022 83 7e 58 00 cmp DWORD PTR [esi+88], 0
\r
1750 00026 74 1e je SHORT $LN4@gzputc
\r
1752 ; 263 : state->seek = 0;
\r
1753 ; 264 : if (gz_zero(state, state->skip) == -1)
\r
1755 00028 8b 46 54 mov eax, DWORD PTR [esi+84]
\r
1756 0002b 8b 4e 50 mov ecx, DWORD PTR [esi+80]
\r
1759 00030 8b c6 mov eax, esi
\r
1760 00032 c7 46 58 00 00
\r
1761 00 00 mov DWORD PTR [esi+88], 0
\r
1762 00039 e8 00 00 00 00 call _gz_zero
\r
1763 0003e 83 c4 08 add esp, 8
\r
1764 00041 83 f8 ff cmp eax, -1
\r
1766 ; 265 : return -1;
\r
1768 00044 74 c5 je SHORT $LN12@gzputc
\r
1773 ; 268 : /* try writing to input buffer for speed (state->size == 0 if buffer not
\r
1774 ; 269 : initialized) */
\r
1775 ; 270 : if (strm->avail_in < state->size) {
\r
1777 00046 8b 4e 68 mov ecx, DWORD PTR [esi+104]
\r
1778 00049 3b 4e 1c cmp ecx, DWORD PTR [esi+28]
\r
1779 0004c 73 2c jae SHORT $LN3@gzputc
\r
1781 ; 271 : if (strm->avail_in == 0)
\r
1783 0004e 85 c9 test ecx, ecx
\r
1784 00050 75 06 jne SHORT $LN2@gzputc
\r
1786 ; 272 : strm->next_in = state->in;
\r
1788 00052 8b 56 24 mov edx, DWORD PTR [esi+36]
\r
1789 00055 89 56 64 mov DWORD PTR [esi+100], edx
\r
1792 ; 273 : strm->next_in[strm->avail_in++] = c;
\r
1794 00058 8b 56 64 mov edx, DWORD PTR [esi+100]
\r
1795 0005b 8b 45 0c mov eax, DWORD PTR _c$[ebp]
\r
1796 0005e 88 04 11 mov BYTE PTR [ecx+edx], al
\r
1797 00061 b9 01 00 00 00 mov ecx, 1
\r
1798 00066 01 4e 68 add DWORD PTR [esi+104], ecx
\r
1800 ; 274 : state->x.pos++;
\r
1802 00069 01 4e 08 add DWORD PTR [esi+8], ecx
\r
1803 0006c 83 56 0c 00 adc DWORD PTR [esi+12], 0
\r
1805 ; 275 : return c & 0xff;
\r
1807 00070 25 ff 00 00 00 and eax, 255 ; 000000ffH
\r
1813 00077 c2 08 00 ret 8
\r
1819 ; 278 : /* no room in buffer or not initialized, use gz_write() */
\r
1820 ; 279 : buf[0] = c;
\r
1822 0007b 8b 5d 0c mov ebx, DWORD PTR _c$[ebp]
\r
1824 ; 280 : if (gzwrite(file, buf, 1) != 1)
\r
1826 0007e 6a 01 push 1
\r
1827 00080 8d 45 0b lea eax, DWORD PTR _buf$[ebp]
\r
1830 00085 88 5d 0b mov BYTE PTR _buf$[ebp], bl
\r
1831 00088 e8 00 00 00 00 call _gzwrite@12
\r
1832 0008d 83 f8 01 cmp eax, 1
\r
1833 00090 74 09 je SHORT $LN1@gzputc
\r
1835 ; 281 : return -1;
\r
1838 00093 83 c8 ff or eax, -1
\r
1844 00098 c2 08 00 ret 8
\r
1847 ; 282 : return c & 0xff;
\r
1849 0009b 8b c3 mov eax, ebx
\r
1851 0009e 25 ff 00 00 00 and eax, 255 ; 000000ffH
\r
1857 000a5 c2 08 00 ret 8
\r