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

Disassembly:
jmp 0x40377f
sub esp, 0xc
push ebx
push ebp
mov ebp, dword [esp + 0x1c]
push esi
push edi
mov edi, dword [esp + 0x20]
push edi
call fcn.00404dc4
pop ecx
test eax, eax
jne 0x403fd5
cmp ebp, 5
ja 0x403fd5
mov esi, dword [edi + 0x1c]
xor ecx, ecx
cmp dword [edi + 0xc], ecx
je 0x403fcd
cmp dword [edi + 4], ecx
je 0x4037c1
cmp dword [edi], ecx
je 0x403fcd
cmp dword [esi + 4], 0x29a
jne 0x4037d3
cmp ebp, 4
jne 0x403fcd
cmp dword [edi + 0x10], ecx
je 0x403841
mov edx, dword [esi + 0x28]
mov dword [esi + 0x28], ebp
cmp dword [esi + 0x14], ecx
je 0x4037fa
push edi
call fcn.0040550b
pop ecx
xor ecx, ecx
cmp dword [edi + 0x10], ecx
je 0x403fc5
mov ebx, dword [esi + 4]
jmp 0x403830
mov ebx, dword [esi + 4]
cmp dword [edi + 4], ecx
jne 0x403830
xor eax, eax
cmp edx, 4
push 9
pop ecx
cmovg eax, ecx
add edx, edx
sub edx, eax
xor ecx, ecx
cmp ebp, 4
push 9
pop eax
cmovg ecx, eax
lea eax, [ebp*2]
sub eax, ecx
cmp eax, edx
jg 0x40382e
cmp ebp, 4
jne 0x403841
xor ecx, ecx
cmp ebx, 0x29a
jne 0x403850
cmp dword [edi + 4], ecx
je 0x403908
mov eax, dword [str.buffer_error]
mov dword [edi + 0x18], eax
push 0xfffffffffffffffb
jmp 0x403fd7
cmp ebx, 0x2a
jne 0x403908
mov eax, dword [esi + 0x30]
shl eax, 0xc
sub eax, 0x7800
cmp dword [esi + 0x88], 2
jge 0x40389a
mov ecx, dword [esi + 0x84]
cmp ecx, 2
jl 0x40389a
cmp ecx, 6
jge 0x403884
push 0x40
pop edx
push 0x60
jmp 0x40389e
jne 0x403890
mov edx, 0x80
lea ecx, [edx + 0x20]
jmp 0x40389f
mov edx, 0xc0
lea ecx, [edx + 0x20]
jmp 0x40389f
xor edx, edx
push 0x20
pop ecx
cmp dword [esi + 0x6c], 0
push 0x1f
cmove ecx, edx
xor edx, edx
or ecx, eax
mov eax, ecx
pop ebx
div ebx
sub ecx, edx
add ecx, ebx
push ecx
push esi
call fcn.004057da
cmp dword [esi + 0x6c], 0
pop ecx
pop ecx
je 0x4038dd
movzx eax, word [edi + 0x32]
push eax
push esi
call fcn.004057da
movzx eax, word [edi + 0x30]
push eax
push esi
call fcn.004057da
add esp, 0x10
push 0
push 0
push 0
call fcn.004017a3
mov dword [edi + 0x30], eax
push edi
mov dword [esi + 4], 0x71
call fcn.0040550b
xor ecx, ecx
add esp, 0x10
cmp dword [esi + 0x14], ecx
jne 0x403fc5
jmp 0x40390b
push 0x1f
pop ebx
mov eax, dword [esi + 4]
cmp eax, 0x39
jne 0x403b15
push ecx
push ecx
push ecx
call fcn.00401636
mov dword [edi + 0x30], eax
add esp, 0xc
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
mov byte [ecx + eax], bl
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 0x4039ef
mov eax, dword [esi + 8]
push 9
mov byte [edx + eax], bl
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
mov byte [ecx + eax], bl
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
mov byte [ecx + eax], bl
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
mov byte [ecx + eax], bl
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
mov byte [ecx + eax], bl
mov edx, dword [esi + 0x14]
mov eax, dword [esi + 0x84]
inc edx
pop ecx
mov dword [esi + 0x14], edx
cmp eax, ecx
jne 0x4039a8
mov cl, 2
jmp 0x4039ba
cmp dword [esi + 0x88], 2
jge 0x4039b8
mov cl, bl
cmp eax, 2
jge 0x4039ba
mov cl, 4
mov eax, dword [esi + 8]
push edi
mov byte [edx + eax], cl
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
mov byte [ecx + eax], 0xa
inc dword [esi + 0x14]
mov dword [esi + 4], 0x71
call fcn.0040550b
pop ecx
cmp dword [esi + 0x14], ebx
jne 0x403fc5
mov eax, dword [esi + 4]
jmp 0x403b17
cmp dword [ebx + 0x24], 0
push 9
sete cl
dec cl
and cl, 0x10
cmp dword [ebx + 0x2c], 0
sete al
dec al
and al, 2
add cl, al
cmp dword [ebx + 0x1c], 0
sete al
dec al
and al, 8
add cl, al
cmp dword [ebx + 0x10], 0
sete al
dec 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
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 8]
mov al, byte [eax + 4]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 8]
mov al, byte [eax + 5]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
mov al, byte [eax + 6]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
mov al, byte [eax + 7]
mov byte [edx + ecx], al
mov edx, dword [esi + 0x14]
mov eax, dword [esi + 0x84]
inc edx
pop ecx
mov dword [esi + 0x14], edx
cmp eax, ecx
jne 0x403a90
mov cl, 2
jmp 0x403aa6
cmp dword [esi + 0x88], 2
jge 0x403aa4
cmp eax, 2
jl 0x403aa4
xor ebx, ebx
mov cl, bl
jmp 0x403aa8
mov cl, 4
xor ebx, ebx
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], ebx
je 0x403af3
mov al, byte [eax + 0x14]
mov ecx, dword [esi + 8]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
mov al, 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], ebx
je 0x403b0a
push edx
push dword [esi + 8]
push dword [edi + 0x30]
call fcn.00401636
add esp, 0xc
mov dword [edi + 0x30], eax
push 0x45
pop eax
mov dword [esi + 0x20], ebx
mov dword [esi + 4], eax
jmp 0x403b17
xor ebx, ebx
cmp eax, 0x45
jne 0x403c24
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x10], ebx
je 0x403c1a
movzx edx, word [eax + 0x14]
sub edx, dword [esi + 0x20]
mov ebx, dword [esi + 0x14]
mov ecx, dword [esi + 0xc]
mov dword [esp + 0x10], edx
lea eax, [ebx + edx]
cmp eax, ecx
jbe 0x403bcc
mov eax, ebx
mov dword [esp + 0x18], ebx
sub ecx, eax
mov eax, dword [esi + 0x1c]
push ecx
mov dword [esp + 0x18], ecx
mov eax, dword [eax + 0x10]
add eax, dword [esi + 0x20]
push eax
mov eax, dword [esi + 8]
add eax, dword [esp + 0x20]
push eax
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [esi + 0x1c]
add esp, 0xc
mov ecx, dword [esi + 0xc]
mov dword [esi + 0x14], ecx
cmp dword [eax + 0x2c], 0
je 0x403b99
cmp ecx, ebx
jbe 0x403b99
mov eax, dword [esi + 8]
sub ecx, ebx
push ecx
add eax, ebx
push eax
push dword [edi + 0x30]
call fcn.00401636
add esp, 0xc
mov dword [edi + 0x30], eax
mov eax, dword [esp + 0x14]
add dword [esi + 0x20], eax
push edi
call fcn.0040550b
cmp dword [esi + 0x14], 0
pop ecx
jne 0x403fc5
mov edx, dword [esp + 0x10]
xor eax, eax
sub edx, dword [esp + 0x14]
xor ebx, ebx
mov ecx, dword [esi + 0xc]
mov dword [esp + 0x10], edx
mov dword [esp + 0x18], eax
cmp edx, ecx
ja 0x403b4e
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 0x20]
push edx
mov eax, dword [eax + 0x10]
add eax, ecx
push eax
mov eax, dword [esi + 8]
add eax, ebx
push eax
call sub.VCRUNTIME140.dll_memcpy
mov ecx, dword [esp + 0x1c]
add esp, 0xc
mov eax, dword [esi + 0x1c]
add ecx, dword [esi + 0x14]
mov dword [esi + 0x14], ecx
cmp dword [eax + 0x2c], 0
je 0x403c15
cmp ecx, ebx
jbe 0x403c15
mov eax, dword [esi + 8]
sub ecx, ebx
push ecx
add eax, ebx
push eax
push dword [edi + 0x30]
call fcn.00401636
add esp, 0xc
mov dword [edi + 0x30], eax
xor ebx, ebx
mov dword [esi + 0x20], ebx
push 0x49
mov dword [esi + 4], 0x49
pop eax
cmp eax, 0x49
jne 0x403ce3
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x1c], ebx
je 0x403cd9
mov ecx, dword [esi + 0x14]
mov ebx, ecx
mov dword [esp + 0x10], ecx
cmp ebx, dword [esi + 0xc]
jne 0x403c83
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x403c6b
cmp ebx, ecx
jbe 0x403c6b
mov eax, dword [esi + 8]
sub ebx, ecx
push ebx
add eax, ecx
push eax
push dword [edi + 0x30]
call fcn.00401636
add esp, 0xc
mov dword [edi + 0x30], eax
push edi
call fcn.0040550b
cmp dword [esi + 0x14], 0
pop ecx
jne 0x403fc5
and dword [esp + 0x10], 0
xor ebx, ebx
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 0x20]
mov eax, dword [eax + 0x1c]
mov dl, byte [ecx + eax]
lea eax, [ecx + 1]
mov dword [esi + 0x20], eax
mov eax, dword [esi + 8]
mov byte [ebx + eax], dl
mov ebx, dword [esi + 0x14]
inc ebx
mov dword [esi + 0x14], ebx
test dl, dl
je 0x403cac
mov ecx, dword [esp + 0x10]
jmp 0x403c42
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x403cd4
mov ecx, dword [esp + 0x10]
cmp ebx, ecx
jbe 0x403cd4
mov eax, dword [esi + 8]
sub ebx, ecx
push ebx
add eax, ecx
push eax
push dword [edi + 0x30]
call fcn.00401636
add esp, 0xc
mov dword [edi + 0x30], eax
xor ebx, ebx
mov dword [esi + 0x20], ebx
push 0x5b
mov dword [esi + 4], 0x5b
pop eax
cmp eax, 0x5b
jne 0x403d9f
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x24], ebx
je 0x403d95
mov ecx, dword [esi + 0x14]
mov ebx, ecx
mov dword [esp + 0x10], ecx
cmp ebx, dword [esi + 0xc]
jne 0x403d42
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x403d2a
cmp ebx, ecx
jbe 0x403d2a
mov eax, dword [esi + 8]
sub ebx, ecx
push ebx
add eax, ecx
push eax
push dword [edi + 0x30]
call fcn.00401636
add esp, 0xc
mov dword [edi + 0x30], eax
push edi
call fcn.0040550b
cmp dword [esi + 0x14], 0
pop ecx
jne 0x403fc5
and dword [esp + 0x10], 0
xor ebx, ebx
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 0x20]
mov eax, dword [eax + 0x24]
mov dl, byte [ecx + eax]
lea eax, [ecx + 1]
mov dword [esi + 0x20], eax
mov eax, dword [esi + 8]
mov byte [ebx + eax], dl
mov ebx, dword [esi + 0x14]
inc ebx
mov dword [esi + 0x14], ebx
test dl, dl
je 0x403d6b
mov ecx, dword [esp + 0x10]
jmp 0x403d01
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x403d93
mov ecx, dword [esp + 0x10]
cmp ebx, ecx
jbe 0x403d93
mov eax, dword [esi + 8]
sub ebx, ecx
push ebx
add eax, ecx
push eax
push dword [edi + 0x30]
call fcn.00401636
add esp, 0xc
mov dword [edi + 0x30], eax
xor ebx, ebx
push 0x67
mov dword [esi + 4], 0x67
pop eax
cmp eax, 0x67
jne 0x403e09
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], ebx
je 0x403df2
mov edx, dword [esi + 0x14]
lea eax, [edx + 2]
cmp eax, dword [esi + 0xc]
jbe 0x403dc9
push edi
call fcn.0040550b
mov edx, dword [esi + 0x14]
pop ecx
test edx, edx
jne 0x403fc5
mov ecx, dword [esi + 8]
mov al, byte [edi + 0x30]
push ebx
push ebx
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
mov al, byte [edi + 0x31]
push ebx
mov byte [edx + ecx], al
inc dword [esi + 0x14]
call fcn.00401636
add esp, 0xc
mov dword [edi + 0x30], eax
push edi
mov dword [esi + 4], 0x71
call fcn.0040550b
pop ecx
cmp dword [esi + 0x14], ebx
jne 0x403fc5
cmp dword [edi + 4], ebx
jne 0x403e28
cmp dword [esi + 0x74], ebx
jne 0x403e28
test ebp, ebp
je 0x403ef3
cmp dword [esi + 4], 0x29a
je 0x403ef3
mov ecx, dword [esi + 0x84]
push ebp
push esi
test ecx, ecx
jne 0x403e3b
call fcn.00402a81
jmp 0x403e62
mov eax, dword [esi + 0x88]
cmp eax, 2
jne 0x403e4d
call fcn.00404e78
jmp 0x403e62
cmp eax, 3
jne 0x403e59
call fcn.00405015
jmp 0x403e62
imul eax, ecx, 0xc
call dword [eax + 0x4201e8]
pop ecx
pop ecx
cmp eax, 2
je 0x403e6e
cmp eax, 3
jne 0x403e75
mov dword [esi + 4], 0x29a
test eax, eax
je 0x403fc0
cmp eax, 2
je 0x403fc0
cmp eax, 1
jne 0x403ef3
cmp ebp, eax
jne 0x403e98
push esi
call fcn.00401307
pop ecx
jmp 0x403ee3
cmp ebp, 5
je 0x403ee3
push ebx
push ebx
push ebx
push esi
call fcn.00401393
add esp, 0x10
cmp ebp, 3
jne 0x403ee3
mov eax, dword [esi + 0x44]
xor edx, edx
mov ecx, dword [esi + 0x4c]
mov word [eax + ecx*2 - 2], dx
mov eax, dword [esi + 0x4c]
lea eax, [eax*2 - 2]
push eax
push ebx
push dword [esi + 0x44]
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
cmp dword [esi + 0x74], ebx
jne 0x403ee3
mov dword [esi + 0x6c], ebx
mov dword [esi + 0x5c], ebx
mov dword [esi + 0x16b4], ebx
push edi
call fcn.0040550b
pop ecx
cmp dword [edi + 0x10], ebx
je 0x403fc5
cmp ebp, 4
jne 0x403fc9
cmp dword [esi + 0x18], 0
jg 0x403f0a
xor eax, eax
inc eax
jmp 0x403fd8
cmp dword [esi + 0x18], 2
jne 0x403f8a
mov edx, dword [esi + 0x14]
mov al, byte [edi + 0x30]
mov ecx, dword [esi + 8]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov al, byte [edi + 0x31]
mov ecx, dword [esi + 8]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov al, byte [edi + 0x32]
mov ecx, dword [esi + 8]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov al, byte [edi + 0x33]
mov ecx, dword [esi + 8]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov al, 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]
mov al, byte [edi + 9]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
mov al, byte [edi + 0xa]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
mov al, byte [edi + 0xb]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
jmp 0x403fa3
movzx eax, word [edi + 0x32]
push eax
push esi
call fcn.004057da
movzx eax, word [edi + 0x30]
push eax
push esi
call fcn.004057da
add esp, 0x10
push edi
call fcn.0040550b
mov eax, dword [esi + 0x18]
pop ecx
test eax, eax
jle 0x403fb6
neg eax
mov dword [esi + 0x18], eax
xor eax, eax
cmp dword [esi + 0x14], ebx
sete al
jmp 0x403fd8
cmp dword [edi + 0x10], ebx
jne 0x403fc9
or dword [esi + 0x28], 0xffffffff
xor eax, eax
jmp 0x403fd8
mov eax, dword [str.stream_error]
mov dword [edi + 0x18], eax
push 0xfffffffffffffffe
pop eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret