Function at 0x496330
Capabilities:
Compress data via zlib inflate or deflate

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push esi
push edi
mov edi, ecx
test edi, edi
je 0x496c09
mov esi, dword [edi + 0x1c]
test esi, esi
je 0x496c09
cmp dword [edi + 0xc], 0
je 0x496c02
cmp dword [edi], 0
jne 0x496366
cmp dword [edi + 4], 0
jne 0x496c02
cmp dword [edi + 0x10], 0
je 0x496bf0
cmp dword [esi + 4], 0x2a
push ebx
mov dword [esi], edi
mov dword [esi + 0x28], 4
jne 0x496626
cmp dword [esi + 0x18], 2
jne 0x496585
mov dword [edi + 0x30], 0
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
mov byte [ecx + eax], 0x1f
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
mov byte [ecx + eax], 0x8b
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
mov byte [ecx + eax], 8
mov edx, dword [esi + 0x14]
mov ebx, dword [esi + 0x1c]
inc edx
mov dword [esi + 0x14], edx
test ebx, ebx
jne 0x496452
mov eax, dword [esi + 8]
mov byte [edx + eax], bl
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
inc ecx
mov dword [esi + 0x14], ecx
mov byte [ecx + eax], bl
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
inc ecx
mov dword [esi + 0x14], ecx
mov byte [ecx + eax], bl
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
inc ecx
mov dword [esi + 0x14], ecx
mov byte [ecx + eax], bl
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
inc ecx
mov dword [esi + 0x14], ecx
mov byte [ecx + eax], bl
mov edx, dword [esi + 0x14]
mov eax, dword [esi + 0x84]
inc edx
mov dword [esi + 0x14], edx
cmp eax, 9
jne 0x49641b
mov cl, 2
jmp 0x49642f
cmp dword [esi + 0x88], 2
jge 0x49642d
cmp eax, 2
jl 0x49642d
xor cl, cl
jmp 0x49642f
mov cl, 4
mov eax, dword [esi + 8]
mov byte [edx + eax], cl
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
mov byte [ecx + eax], 0xb
mov eax, 0x71
inc dword [esi + 0x14]
mov dword [esi + 4], eax
jmp 0x496626
mov ecx, dword [ebx + 0x24]
mov eax, dword [ebx + 0x2c]
neg ecx
sbb cl, cl
and cl, 0x10
neg eax
sbb al, al
and al, 2
add cl, al
mov eax, dword [ebx + 0x1c]
neg eax
sbb al, al
and al, 8
add cl, al
mov eax, dword [ebx + 0x10]
neg eax
sbb al, al
and al, 4
add cl, al
cmp dword [ebx], 0
setne al
add cl, al
mov eax, dword [esi + 8]
mov byte [edx + eax], cl
mov edx, dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
inc edx
mov ecx, dword [esi + 8]
mov dword [esi + 0x14], edx
movzx eax, byte [eax + 4]
mov byte [edx + ecx], al
mov edx, dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
inc edx
mov ecx, dword [esi + 8]
mov dword [esi + 0x14], edx
movzx eax, byte [eax + 5]
mov byte [edx + ecx], al
mov edx, dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
inc edx
mov ecx, dword [esi + 8]
mov dword [esi + 0x14], edx
movzx eax, byte [eax + 6]
mov byte [edx + ecx], al
mov edx, dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
inc edx
mov ecx, dword [esi + 8]
mov dword [esi + 0x14], edx
movzx eax, byte [eax + 7]
mov byte [edx + ecx], al
mov edx, dword [esi + 0x14]
mov eax, dword [esi + 0x84]
inc edx
mov dword [esi + 0x14], edx
cmp eax, 9
jne 0x4964f1
mov cl, 2
jmp 0x496505
cmp dword [esi + 0x88], 2
jge 0x496503
cmp eax, 2
jl 0x496503
xor cl, cl
jmp 0x496505
mov cl, 4
mov eax, dword [esi + 8]
mov byte [edx + eax], cl
inc dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
mov al, byte [eax + 0xc]
mov byte [edx + ecx], al
mov edx, dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
inc edx
mov dword [esi + 0x14], edx
cmp dword [eax + 0x10], 0
je 0x496550
mov ecx, dword [esi + 8]
movzx eax, byte [eax + 0x14]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
movzx eax, byte [eax + 0x15]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x496571
mov eax, dword [esi + 8]
test eax, eax
je 0x49656e
mov ecx, dword [edi + 0x30]
push edx
mov edx, eax
call fcn.00494410
add esp, 4
mov dword [edi + 0x30], eax
mov eax, 0x45
mov dword [esi + 0x20], 0
mov dword [esi + 4], eax
jmp 0x496626
mov ecx, dword [esi + 0x30]
shl ecx, 0xc
sub ecx, 0x7800
cmp dword [esi + 0x88], 2
mov ebx, ecx
jge 0x4965cc
mov eax, dword [esi + 0x84]
cmp eax, 2
jl 0x4965cc
cmp eax, 6
jge 0x4965b6
mov eax, 0x40
lea edx, [eax + 0x20]
jmp 0x4965d1
jne 0x4965c2
mov eax, 0x80
lea edx, [eax + 0x20]
jmp 0x4965d1
mov eax, 0xc0
lea edx, [eax + 0x20]
jmp 0x4965d1
xor eax, eax
lea edx, [eax + 0x20]
or ecx, eax
cmp dword [esi + 0x6c], 0
je 0x4965dd
mov ecx, edx
or ecx, ebx
mov eax, 0x8421085
mov dword [esi + 4], 0x71
mul ecx
sub ecx, edx
shr ecx, 1
add ecx, edx
shr ecx, 4
inc ecx
mov edx, ecx
shl edx, 5
sub edx, ecx
mov ecx, esi
call fcn.00495c50
cmp dword [esi + 0x6c], 0
je 0x49661f
movzx edx, word [edi + 0x32]
mov ecx, esi
call fcn.00495c50
movzx edx, word [edi + 0x30]
mov ecx, esi
call fcn.00495c50
mov dword [edi + 0x30], 1
mov eax, dword [esi + 4]
cmp eax, 0x45
jne 0x496755
mov edx, dword [esi + 0x1c]
cmp dword [edx + 0x10], 0
je 0x4967aa
movzx eax, word [edx + 0x14]
mov ecx, dword [esi + 0x14]
mov ebx, ecx
mov dword [ebp - 0xc], ecx
cmp dword [esi + 0x20], eax
jae 0x49670e
lea eax, [esi + 8]
mov dword [ebp - 8], eax
cmp ebx, dword [esi + 0xc]
jne 0x4966da
cmp dword [edx + 0x2c], 0
je 0x496684
cmp ebx, ecx
jbe 0x496684
mov edx, dword [eax]
sub ebx, ecx
add edx, ecx
jne 0x496675
xor eax, eax
jmp 0x496681
mov ecx, dword [edi + 0x30]
push ebx
call fcn.00494410
add esp, 4
mov dword [edi + 0x30], eax
mov ebx, dword [edi + 0x1c]
mov ecx, ebx
mov dword [ebp - 0xc], ebx
call fcn.00499320
mov ebx, dword [ebx + 0x14]
mov eax, dword [edi + 0x10]
cmp ebx, eax
jbe 0x49669d
mov ebx, eax
test ebx, ebx
je 0x4966cd
mov eax, dword [ebp - 0xc]
push ebx
push dword [eax + 0x10]
push dword [edi + 0xc]
call fcn.00437600
mov ecx, dword [ebp - 0xc]
add esp, 0xc
add dword [edi + 0xc], ebx
add dword [ecx + 0x10], ebx
add dword [edi + 0x14], ebx
sub dword [edi + 0x10], ebx
sub dword [ecx + 0x14], ebx
jne 0x4966cd
mov eax, dword [ecx + 8]
mov dword [ecx + 0x10], eax
mov ecx, dword [esi + 0x14]
mov ebx, ecx
mov dword [ebp - 0xc], ecx
cmp ecx, dword [esi + 0xc]
je 0x49670e
mov eax, dword [esi + 0x1c]
mov ecx, dword [ebp - 8]
mov edx, dword [eax + 0x10]
mov eax, dword [esi + 0x20]
mov ecx, dword [ecx]
mov al, byte [edx + eax]
mov byte [ebx + ecx], al
mov ebx, dword [esi + 0x14]
inc dword [esi + 0x20]
inc ebx
mov ecx, dword [ebp - 0xc]
mov dword [esi + 0x14], ebx
mov edx, dword [esi + 0x1c]
movzx eax, word [edx + 0x14]
cmp dword [esi + 0x20], eax
mov eax, dword [ebp - 8]
jb 0x496657
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x496737
cmp ebx, ecx
jbe 0x496737
mov edx, dword [esi + 8]
sub ebx, ecx
add edx, ecx
jne 0x496728
xor eax, eax
jmp 0x496734
mov ecx, dword [edi + 0x30]
push ebx
call fcn.00494410
add esp, 4
mov dword [edi + 0x30], eax
mov ecx, dword [esi + 0x1c]
mov eax, dword [esi + 0x20]
cmp eax, dword [ecx + 0x14]
jne 0x4967a5
mov dword [esi + 0x20], 0
mov eax, 0x49
mov dword [esi + 4], 0x49
cmp eax, 0x49
jne 0x49689b
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x1c], 0
je 0x4968ea
mov ecx, dword [esi + 0x14]
lea edx, [esi + 8]
mov dword [ebp - 4], ecx
mov ebx, ecx
jmp 0x496780
mov dword [ebp - 8], edx
cmp ebx, dword [esi + 0xc]
jne 0x496818
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x4967c2
cmp ebx, ecx
jbe 0x4967c2
mov edx, dword [edx]
sub ebx, ecx
add edx, ecx
jne 0x4967b3
xor eax, eax
jmp 0x4967bf
mov eax, dword [esi + 4]
jmp 0x496755
mov dword [esi + 4], 0x49
jmp 0x49675e
mov ecx, dword [edi + 0x30]
push ebx
call fcn.00494410
add esp, 4
mov dword [edi + 0x30], eax
mov ebx, dword [edi + 0x1c]
mov ecx, ebx
mov dword [ebp - 0xc], ebx
call fcn.00499320
mov ebx, dword [ebx + 0x14]
mov eax, dword [edi + 0x10]
cmp ebx, eax
jbe 0x4967db
mov ebx, eax
test ebx, ebx
je 0x49680b
mov eax, dword [ebp - 0xc]
push ebx
push dword [eax + 0x10]
push dword [edi + 0xc]
call fcn.00437600
mov ecx, dword [ebp - 0xc]
add esp, 0xc
add dword [edi + 0xc], ebx
add dword [ecx + 0x10], ebx
add dword [edi + 0x14], ebx
sub dword [edi + 0x10], ebx
sub dword [ecx + 0x14], ebx
jne 0x49680b
mov eax, dword [ecx + 8]
mov dword [ecx + 0x10], eax
mov ecx, dword [esi + 0x14]
mov ebx, ecx
mov dword [ebp - 4], ecx
cmp ecx, dword [esi + 0xc]
je 0x496850
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 0x20]
mov eax, dword [eax + 0x1c]
mov dl, byte [ecx + eax]
movzx eax, dl
mov dword [ebp - 0xc], eax
lea eax, [ecx + 1]
mov ecx, dword [ebp - 4]
mov dword [esi + 0x20], eax
mov eax, dword [ebp - 8]
mov eax, dword [eax]
mov byte [ebx + eax], dl
mov ebx, dword [esi + 0x14]
inc ebx
cmp dword [ebp - 0xc], 0
mov dword [esi + 0x14], ebx
je 0x496857
mov edx, dword [ebp - 8]
jmp 0x496780
mov dword [ebp - 0xc], 1
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x496882
cmp ebx, ecx
jbe 0x496882
mov eax, dword [ebp - 8]
sub ebx, ecx
mov edx, dword [eax]
add edx, ecx
jne 0x496873
xor eax, eax
jmp 0x49687f
mov ecx, dword [edi + 0x30]
push ebx
call fcn.00494410
add esp, 4
mov dword [edi + 0x30], eax
cmp dword [ebp - 0xc], 0
jne 0x4968e5
mov dword [esi + 0x20], 0
mov eax, 0x5b
mov dword [esi + 4], 0x5b
cmp eax, 0x5b
jne 0x4969d8
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x24], 0
je 0x496a8d
mov ecx, dword [esi + 0x14]
lea edx, [esi + 8]
mov dword [ebp - 0xc], ecx
mov ebx, ecx
lea esp, [esp]
mov dword [ebp - 8], edx
cmp ebx, dword [esi + 0xc]
jne 0x496958
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x496902
cmp ebx, ecx
jbe 0x496902
mov edx, dword [edx]
sub ebx, ecx
add edx, ecx
jne 0x4968f3
xor eax, eax
jmp 0x4968ff
mov eax, dword [esi + 4]
jmp 0x49689b
mov dword [esi + 4], 0x5b
jmp 0x4968a4
mov ecx, dword [edi + 0x30]
push ebx
call fcn.00494410
add esp, 4
mov dword [edi + 0x30], eax
mov ebx, dword [edi + 0x1c]
mov ecx, ebx
mov dword [ebp - 0xc], ebx
call fcn.00499320
mov ebx, dword [ebx + 0x14]
mov eax, dword [edi + 0x10]
cmp ebx, eax
jbe 0x49691b
mov ebx, eax
test ebx, ebx
je 0x49694b
mov eax, dword [ebp - 0xc]
push ebx
push dword [eax + 0x10]
push dword [edi + 0xc]
call fcn.00437600
mov ecx, dword [ebp - 0xc]
add esp, 0xc
add dword [edi + 0xc], ebx
add dword [ecx + 0x10], ebx
add dword [edi + 0x14], ebx
sub dword [edi + 0x10], ebx
sub dword [ecx + 0x14], ebx
jne 0x49694b
mov eax, dword [ecx + 8]
mov dword [ecx + 0x10], eax
mov ecx, dword [esi + 0x14]
mov ebx, ecx
mov dword [ebp - 0xc], ecx
cmp ecx, dword [esi + 0xc]
je 0x496990
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 0x20]
mov eax, dword [eax + 0x24]
mov dl, byte [ecx + eax]
movzx eax, dl
mov dword [ebp - 4], eax
lea eax, [ecx + 1]
mov ecx, dword [ebp - 0xc]
mov dword [esi + 0x20], eax
mov eax, dword [ebp - 8]
mov eax, dword [eax]
mov byte [ebx + eax], dl
mov ebx, dword [esi + 0x14]
inc ebx
cmp dword [ebp - 4], 0
mov dword [esi + 0x14], ebx
je 0x496997
mov edx, dword [ebp - 8]
jmp 0x4968c0
mov dword [ebp - 4], 1
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x4969c2
cmp ebx, ecx
jbe 0x4969c2
mov eax, dword [ebp - 8]
sub ebx, ecx
mov edx, dword [eax]
add edx, ecx
jne 0x4969b3
xor eax, eax
jmp 0x4969bf
mov ecx, dword [edi + 0x30]
push ebx
call fcn.00494410
add esp, 4
mov dword [edi + 0x30], eax
cmp dword [ebp - 4], 0
jne 0x496a85
mov dword [esi + 4], 0x67
mov eax, 0x67
cmp eax, 0x67
jne 0x496a2e
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x496a27
mov eax, dword [esi + 0x14]
add eax, 2
cmp eax, dword [esi + 0xc]
jbe 0x4969f8
mov ecx, edi
call fcn.00495c00
mov edx, dword [esi + 0x14]
lea eax, [edx + 2]
cmp eax, dword [esi + 0xc]
ja 0x496a2e
mov ecx, dword [esi + 8]
movzx eax, byte [edi + 0x30]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
movzx eax, byte [edi + 0x31]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov dword [edi + 0x30], 0
mov dword [esi + 4], 0x71
cmp dword [esi + 0x14], 0
pop ebx
je 0x496a46
mov ecx, edi
call fcn.00495c00
cmp dword [edi + 0x10], 0
je 0x496be1
mov eax, dword [esi + 4]
cmp eax, 0x29a
jne 0x496a5a
cmp dword [edi + 4], 0
jne 0x496bf0
cmp dword [edi + 4], 0
jne 0x496a71
cmp dword [esi + 0x74], 0
jne 0x496a71
cmp eax, 0x29a
je 0x496b07
mov eax, dword [esi + 0x88]
cmp eax, 2
jne 0x496a99
mov ecx, esi
call fcn.004946c0
jmp 0x496abf
mov eax, dword [esi + 4]
jmp 0x4969d8
mov dword [esi + 4], 0x67
jmp 0x4969dd
cmp eax, 3
jne 0x496aa7
mov ecx, esi
call fcn.00494860
jmp 0x496abf
mov eax, dword [esi + 0x84]
push 4
push esi
lea eax, [eax + eax*2]
mov eax, dword [eax*4 + 0x4b4090]
call eax
add esp, 8
cmp eax, 2
je 0x496ac9
cmp eax, 3
jne 0x496ad0
mov dword [esi + 4], 0x29a
test eax, eax
je 0x496bdb
cmp eax, 2
je 0x496bdb
cmp eax, 1
jne 0x496b07
push 0
push 0
xor edx, edx
mov ecx, esi
call fcn.0049ad50
add esp, 8
mov ecx, edi
call fcn.00495c00
cmp dword [edi + 0x10], 0
je 0x496be1
mov eax, dword [esi + 0x18]
test eax, eax
jg 0x496b19
pop edi
mov eax, 1
pop esi
mov esp, ebp
pop ebp
ret
cmp eax, 2
jne 0x496ba4
mov edx, dword [esi + 0x14]
movzx eax, byte [edi + 0x30]
mov ecx, dword [esi + 8]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
movzx eax, byte [edi + 0x31]
mov ecx, dword [esi + 8]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
movzx eax, byte [edi + 0x32]
mov ecx, dword [esi + 8]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
movzx eax, byte [edi + 0x33]
mov ecx, dword [esi + 8]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
movzx eax, byte [edi + 8]
mov ecx, dword [esi + 8]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
movzx eax, byte [edi + 9]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
movzx eax, byte [edi + 0xa]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
movzx eax, byte [edi + 0xb]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
jmp 0x496bba
movzx edx, word [edi + 0x32]
mov ecx, esi
call fcn.00495c50
movzx edx, word [edi + 0x30]
mov ecx, esi
call fcn.00495c50
mov ecx, edi
call fcn.00495c00
mov eax, dword [esi + 0x18]
test eax, eax
jle 0x496bcd
neg eax
mov dword [esi + 0x18], eax
xor eax, eax
cmp dword [esi + 0x14], eax
pop edi
sete al
pop esi
mov esp, ebp
pop ebp
ret
cmp dword [edi + 0x10], 0
jne 0x496be8
mov dword [esi + 0x28], 0xffffffff
pop edi
xor eax, eax
pop esi
mov esp, ebp
pop ebp
ret
mov dword [edi + 0x18], str.buffer_error
mov eax, 0xfffffffb
pop edi
pop esi
mov esp, ebp
pop ebp
ret
mov dword [edi + 0x18], str.stream_error
pop edi
mov eax, 0xfffffffe
pop esi
mov esp, ebp
pop ebp
ret