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

Disassembly:
push ebp
mov ebp, esp
push ecx
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
xor edx, edx
cmp edi, edx
je 0x40f4ba
mov esi, dword [edi + 0x1c]
cmp esi, edx
je 0x40f4ba
mov ecx, dword [ebp + 0xc]
cmp ecx, 4
jg 0x40f4ba
cmp ecx, edx
jl 0x40f4ba
cmp dword [edi + 0xc], edx
je 0x40f4b2
cmp dword [edi], edx
jne 0x40ed9f
cmp dword [edi + 4], edx
jne 0x40f4b2
mov eax, dword [esi + 4]
cmp eax, 0x29a
jne 0x40edb2
cmp ecx, 4
jne 0x40f4b2
cmp dword [edi + 0x10], edx
je 0x40f308
mov edx, dword [esi + 0x28]
cmp eax, 0x2a
mov dword [esi], edi
mov dword [ebp - 4], edx
mov dword [esi + 0x28], ecx
jne 0x40f058
push 2
pop edx
cmp dword [esi + 0x18], edx
jne 0x40efc9
xor ebx, ebx
push ebx
push ebx
push ebx
call fcn.0040c130
mov dword [edi + 0x30], eax
mov eax, dword [esi + 8]
mov ecx, dword [esi + 0x14]
mov byte [eax + ecx], 0x1f
inc dword [esi + 0x14]
mov eax, dword [esi + 0x14]
mov ecx, dword [esi + 8]
mov byte [ecx + eax], 0x8b
inc dword [esi + 0x14]
mov eax, dword [esi + 0x14]
mov ecx, dword [esi + 8]
mov byte [ecx + eax], 8
mov eax, dword [esi + 0x1c]
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x14]
cmp eax, ebx
jne 0x40ee9f
mov eax, dword [esi + 8]
and byte [eax + ecx], bl
inc dword [esi + 0x14]
mov eax, dword [esi + 0x14]
mov ecx, dword [esi + 8]
and byte [ecx + eax], bl
inc dword [esi + 0x14]
mov eax, dword [esi + 0x14]
mov ecx, dword [esi + 8]
and byte [ecx + eax], bl
inc dword [esi + 0x14]
mov eax, dword [esi + 0x14]
mov ecx, dword [esi + 8]
and byte [ecx + eax], bl
inc dword [esi + 0x14]
mov eax, dword [esi + 0x14]
mov ecx, dword [esi + 8]
and byte [ecx + eax], bl
mov eax, dword [esi + 0x84]
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x14]
cmp eax, 9
jne 0x40ee68
push 2
jmp 0x40ee7c
cmp dword [esi + 0x88], 2
jge 0x40ee7a
cmp eax, 2
jl 0x40ee7a
xor eax, eax
jmp 0x40ee7d
push 4
pop eax
mov edx, dword [esi + 8]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov eax, dword [esi + 0x14]
mov ecx, dword [esi + 8]
mov byte [ecx + eax], 0xb
inc dword [esi + 0x14]
mov dword [esi + 4], 0x71
jmp 0x40f058
mov edx, dword [eax + 0x24]
neg edx
sbb dl, dl
and edx, 0x10
cmp dword [eax + 0x2c], 0
sete bl
dec ebx
and ebx, 2
add dl, bl
mov ebx, dword [eax + 0x1c]
neg ebx
sbb bl, bl
and ebx, 8
add dl, bl
mov ebx, dword [eax + 0x10]
neg ebx
sbb bl, bl
and ebx, 4
add dl, bl
cmp dword [eax], 0
setne al
add dl, al
mov eax, dword [esi + 8]
mov byte [eax + ecx], dl
mov ecx, dword [esi + 0x1c]
inc dword [esi + 0x14]
mov eax, dword [esi + 0x14]
mov edx, dword [esi + 8]
mov cl, byte [ecx + 4]
mov byte [edx + eax], cl
mov ecx, dword [esi + 0x1c]
inc dword [esi + 0x14]
mov eax, dword [esi + 0x14]
mov ecx, dword [ecx + 4]
mov edx, dword [esi + 8]
shr ecx, 8
mov byte [edx + eax], cl
mov ecx, dword [esi + 0x1c]
inc dword [esi + 0x14]
mov eax, dword [esi + 0x14]
mov ecx, dword [ecx + 4]
mov edx, dword [esi + 8]
shr ecx, 0x10
mov byte [edx + eax], cl
mov ecx, dword [esi + 0x1c]
inc dword [esi + 0x14]
mov eax, dword [esi + 0x14]
mov ecx, dword [ecx + 4]
mov edx, dword [esi + 8]
shr ecx, 0x18
mov byte [edx + eax], cl
mov eax, dword [esi + 0x84]
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x14]
cmp eax, 9
jne 0x40ef42
push 2
jmp 0x40ef56
cmp dword [esi + 0x88], 2
jge 0x40ef54
cmp eax, 2
jl 0x40ef54
xor eax, eax
jmp 0x40ef57
push 4
pop eax
mov edx, dword [esi + 8]
xor ebx, ebx
mov byte [edx + ecx], al
mov ecx, dword [esi + 0x1c]
inc dword [esi + 0x14]
mov eax, dword [esi + 0x14]
mov edx, dword [esi + 8]
mov cl, byte [ecx + 0xc]
mov byte [edx + eax], cl
mov eax, dword [esi + 0x1c]
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x14]
cmp dword [eax + 0x10], ebx
je 0x40efa3
mov edx, dword [esi + 8]
mov al, byte [eax + 0x14]
mov byte [edx + ecx], al
mov ecx, dword [esi + 0x1c]
inc dword [esi + 0x14]
mov eax, dword [esi + 0x14]
mov ecx, dword [ecx + 0x14]
mov edx, dword [esi + 8]
shr ecx, 8
mov byte [edx + eax], cl
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], ebx
je 0x40efba
push ecx
push dword [esi + 8]
push dword [edi + 0x30]
call fcn.0040c130
mov dword [edi + 0x30], eax
mov dword [esi + 0x20], ebx
mov dword [esi + 4], 0x45
jmp 0x40f058
mov ecx, dword [esi + 0x30]
shl ecx, 0xc
sub ecx, 0x7800
cmp dword [esi + 0x88], edx
jge 0x40efff
mov eax, dword [esi + 0x84]
cmp eax, edx
jl 0x40efff
cmp eax, 6
jge 0x40eff1
push 1
pop eax
jmp 0x40f001
xor ebx, ebx
cmp eax, 6
setne bl
add ebx, edx
mov eax, ebx
jmp 0x40f001
xor eax, eax
shl eax, 6
or ecx, eax
cmp dword [esi + 0x6c], 0
je 0x40f00f
or ecx, 0x20
push 0x1f
mov eax, ecx
xor edx, edx
pop ebx
div ebx
mov dword [esi + 4], 0x71
sub ecx, edx
add ecx, ebx
push ecx
push esi
call fcn.0040f4c4
xor ebx, ebx
cmp dword [esi + 0x6c], ebx
je 0x40f04d
mov eax, dword [edi + 0x30]
shr eax, 0x10
push eax
push esi
call fcn.0040f4c4
mov eax, dword [edi + 0x30]
and eax, 0xffff
push eax
push esi
call fcn.0040f4c4
push ebx
push ebx
push ebx
call fcn.004101c6
mov dword [edi + 0x30], eax
cmp dword [esi + 4], 0x45
jne 0x40f124
mov ecx, dword [esi + 0x1c]
cmp dword [ecx + 0x10], 0
je 0x40f11d
mov eax, dword [esi + 0x14]
mov dword [ebp + 8], eax
mov eax, dword [ecx + 0x14]
and eax, 0xffff
cmp dword [esi + 0x20], eax
jae 0x40f0e7
mov eax, dword [esi + 0x14]
cmp eax, dword [esi + 0xc]
jne 0x40f0bc
cmp dword [ecx + 0x2c], 0
je 0x40f0ab
cmp eax, dword [ebp + 8]
jbe 0x40f0ab
sub eax, dword [ebp + 8]
push eax
mov eax, dword [esi + 8]
add eax, dword [ebp + 8]
push eax
push dword [edi + 0x30]
call fcn.0040c130
mov dword [edi + 0x30], eax
push edi
call fcn.0040f4f0
mov eax, dword [esi + 0x14]
cmp eax, dword [esi + 0xc]
mov dword [ebp + 8], eax
je 0x40f0e7
mov ecx, dword [esi + 0x1c]
mov edx, dword [esi + 0x20]
mov ebx, dword [esi + 8]
mov ecx, dword [ecx + 0x10]
mov cl, byte [ecx + edx]
mov byte [ebx + eax], cl
mov ecx, dword [esi + 0x1c]
inc dword [esi + 0x14]
inc dword [esi + 0x20]
mov edx, dword [ecx + 0x14]
mov eax, dword [esi + 0x20]
and edx, 0xffff
cmp eax, edx
jb 0x40f082
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x40f10e
mov eax, dword [esi + 0x14]
cmp eax, dword [ebp + 8]
jbe 0x40f10e
sub eax, dword [ebp + 8]
push eax
mov eax, dword [esi + 8]
add eax, dword [ebp + 8]
push eax
push dword [edi + 0x30]
call fcn.0040c130
mov dword [edi + 0x30], eax
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 0x20]
cmp ecx, dword [eax + 0x14]
jne 0x40f124
and dword [esi + 0x20], 0
mov dword [esi + 4], 0x49
cmp dword [esi + 4], 0x49
jne 0x40f1cc
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x1c], 0
je 0x40f1c5
mov edx, dword [esi + 0x14]
mov eax, dword [esi + 0x14]
cmp eax, dword [esi + 0xc]
jne 0x40f177
mov ecx, dword [esi + 0x1c]
cmp dword [ecx + 0x2c], 0
je 0x40f167
cmp eax, edx
jbe 0x40f167
sub eax, edx
push eax
mov eax, dword [esi + 8]
add eax, edx
push eax
push dword [edi + 0x30]
call fcn.0040c130
mov dword [edi + 0x30], eax
push edi
call fcn.0040f4f0
mov eax, dword [esi + 0x14]
cmp eax, dword [esi + 0xc]
mov edx, eax
je 0x40f197
mov ebx, dword [esi + 0x1c]
mov ecx, dword [esi + 0x20]
mov ebx, dword [ebx + 0x1c]
movzx ebx, byte [ebx + ecx]
inc ecx
mov dword [esi + 0x20], ecx
mov ecx, dword [esi + 8]
mov byte [ecx + eax], bl
inc dword [esi + 0x14]
test ebx, ebx
je 0x40f19a
jmp 0x40f13e
push 1
pop ebx
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x40f1be
mov eax, dword [esi + 0x14]
cmp eax, edx
jbe 0x40f1be
sub eax, edx
push eax
mov eax, dword [esi + 8]
add eax, edx
push eax
push dword [edi + 0x30]
call fcn.0040c130
mov dword [edi + 0x30], eax
test ebx, ebx
jne 0x40f1cc
and dword [esi + 0x20], ebx
mov dword [esi + 4], 0x5b
cmp dword [esi + 4], 0x5b
jne 0x40f271
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x24], 0
je 0x40f26a
mov edx, dword [esi + 0x14]
mov eax, dword [esi + 0x14]
cmp eax, dword [esi + 0xc]
jne 0x40f21f
mov ecx, dword [esi + 0x1c]
cmp dword [ecx + 0x2c], 0
je 0x40f20f
cmp eax, edx
jbe 0x40f20f
sub eax, edx
push eax
mov eax, dword [esi + 8]
add eax, edx
push eax
push dword [edi + 0x30]
call fcn.0040c130
mov dword [edi + 0x30], eax
push edi
call fcn.0040f4f0
mov eax, dword [esi + 0x14]
cmp eax, dword [esi + 0xc]
mov edx, eax
je 0x40f23f
mov ebx, dword [esi + 0x1c]
mov ecx, dword [esi + 0x20]
mov ebx, dword [ebx + 0x24]
movzx ebx, byte [ebx + ecx]
inc ecx
mov dword [esi + 0x20], ecx
mov ecx, dword [esi + 8]
mov byte [ecx + eax], bl
inc dword [esi + 0x14]
test ebx, ebx
je 0x40f242
jmp 0x40f1e6
push 1
pop ebx
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x40f266
mov eax, dword [esi + 0x14]
cmp eax, edx
jbe 0x40f266
sub eax, edx
push eax
mov eax, dword [esi + 8]
add eax, edx
push eax
push dword [edi + 0x30]
call fcn.0040c130
mov dword [edi + 0x30], eax
test ebx, ebx
jne 0x40f271
mov dword [esi + 4], 0x67
cmp dword [esi + 4], 0x67
jne 0x40f2cd
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x40f2c6
mov eax, dword [esi + 0x14]
inc eax
inc eax
cmp eax, dword [esi + 0xc]
jbe 0x40f290
push edi
call fcn.0040f4f0
mov eax, dword [esi + 0x14]
lea ecx, [eax + 2]
cmp ecx, dword [esi + 0xc]
ja 0x40f2cd
mov ecx, dword [esi + 8]
mov dl, byte [edi + 0x30]
mov byte [ecx + eax], dl
inc dword [esi + 0x14]
mov ecx, dword [edi + 0x30]
mov eax, dword [esi + 0x14]
mov edx, dword [esi + 8]
shr ecx, 8
mov byte [edx + eax], cl
inc dword [esi + 0x14]
xor eax, eax
push eax
push eax
push eax
call fcn.0040c130
mov dword [edi + 0x30], eax
mov dword [esi + 4], 0x71
xor ebx, ebx
cmp dword [esi + 0x14], ebx
je 0x40f2e4
push edi
call fcn.0040f4f0
cmp dword [edi + 0x10], ebx
jne 0x40f2f6
jmp 0x40f3b5
cmp dword [edi + 4], ebx
jne 0x40f2f6
mov eax, dword [ebp + 0xc]
cmp eax, dword [ebp - 4]
jg 0x40f2f6
cmp eax, 4
jne 0x40f308
mov eax, dword [esi + 4]
mov ebx, 0x29a
cmp eax, ebx
jne 0x40f317
cmp dword [edi + 4], 0
je 0x40f317
mov eax, dword [str.buffer_error]
push 0xfffffffffffffffb
mov dword [edi + 0x18], eax
jmp 0x40f4bc
xor ecx, ecx
cmp dword [edi + 4], ecx
jne 0x40f334
cmp dword [esi + 0x74], ecx
jne 0x40f334
cmp dword [ebp + 0xc], ecx
je 0x40f3bb
cmp eax, ebx
je 0x40f3bb
mov eax, dword [esi + 0x84]
push dword [ebp + 0xc]
lea eax, [eax + eax*2]
push esi
call dword [eax*4 + 0x414330]
cmp eax, 2
je 0x40f352
cmp eax, 3
jne 0x40f355
mov dword [esi + 4], ebx
test eax, eax
je 0x40f4a3
cmp eax, 2
je 0x40f4a3
cmp eax, 1
jne 0x40f3bb
cmp dword [ebp + 0xc], eax
jne 0x40f37a
push esi
call fcn.0041055b
xor ebx, ebx
jmp 0x40f3aa
xor ebx, ebx
push ebx
push ebx
push ebx
push esi
call fcn.004104c7
cmp dword [ebp + 0xc], 3
jne 0x40f3aa
mov eax, dword [esi + 0x4c]
mov ecx, dword [esi + 0x44]
mov word [ecx + eax*2 - 2], bx
mov eax, dword [esi + 0x4c]
lea eax, [eax + eax - 2]
push eax
push ebx
push dword [esi + 0x44]
call sub.MSVCRT.dll_memset
add esp, 0xc
push edi
call fcn.0040f4f0
cmp dword [edi + 0x10], ebx
jne 0x40f3bb
or dword [esi + 0x28], 0xffffffff
jmp 0x40f3c1
cmp dword [ebp + 0xc], 4
je 0x40f3c8
xor eax, eax
jmp 0x40f4bd
mov eax, dword [esi + 0x18]
test eax, eax
jg 0x40f3d6
push 1
jmp 0x40f4bc
cmp eax, 2
jne 0x40f46b
mov eax, dword [esi + 8]
mov ecx, dword [esi + 0x14]
mov dl, byte [edi + 0x30]
mov byte [eax + ecx], dl
inc dword [esi + 0x14]
mov ecx, dword [edi + 0x30]
mov eax, dword [esi + 0x14]
mov edx, dword [esi + 8]
shr ecx, 8
mov byte [edx + eax], cl
inc dword [esi + 0x14]
mov ecx, dword [edi + 0x30]
mov eax, dword [esi + 0x14]
mov edx, dword [esi + 8]
shr ecx, 0x10
mov byte [edx + eax], cl
inc dword [esi + 0x14]
mov ecx, dword [edi + 0x30]
mov eax, dword [esi + 0x14]
mov edx, dword [esi + 8]
shr ecx, 0x18
mov byte [edx + eax], cl
inc dword [esi + 0x14]
mov eax, dword [esi + 0x14]
mov ecx, dword [esi + 8]
mov dl, byte [edi + 8]
mov byte [ecx + eax], dl
inc dword [esi + 0x14]
mov ecx, dword [edi + 8]
mov eax, dword [esi + 0x14]
mov edx, dword [esi + 8]
shr ecx, 8
mov byte [edx + eax], cl
inc dword [esi + 0x14]
mov ecx, dword [edi + 8]
mov eax, dword [esi + 0x14]
mov edx, dword [esi + 8]
shr ecx, 0x10
mov byte [edx + eax], cl
inc dword [esi + 0x14]
mov ecx, dword [edi + 8]
mov eax, dword [esi + 0x14]
mov edx, dword [esi + 8]
shr ecx, 0x18
mov byte [edx + eax], cl
inc dword [esi + 0x14]
jmp 0x40f487
mov eax, dword [edi + 0x30]
shr eax, 0x10
push eax
push esi
call fcn.0040f4c4
mov eax, dword [edi + 0x30]
and eax, 0xffff
push eax
push esi
call fcn.0040f4c4
push edi
call fcn.0040f4f0
mov eax, dword [esi + 0x18]
test eax, eax
jle 0x40f499
neg eax
mov dword [esi + 0x18], eax
xor eax, eax
cmp dword [esi + 0x14], eax
sete al
jmp 0x40f4bd
cmp dword [edi + 0x10], 0
jne 0x40f3c1
jmp 0x40f3b5
mov eax, dword [str.stream_error]
mov dword [edi + 0x18], eax
push 0xfffffffffffffffe
pop eax
pop edi
pop esi
pop ebx
leave
ret 8