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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
mov dword [ebp - 4], edx
mov ebx, ecx
call fcn.005d4160
test eax, eax
jne 0x5d4bed
cmp edx, 5
ja 0x5d4bed
push esi
mov esi, dword [ebx + 0x1c]
cmp dword [ebx + 0xc], eax
je 0x5d4bda
cmp dword [ebx + 4], eax
je 0x5d427c
cmp dword [ebx], eax
je 0x5d4bda
mov eax, dword [esi + 4]
cmp eax, 0x29a
jne 0x5d428f
cmp edx, 4
jne 0x5d4bda
cmp dword [ebx + 0x10], 0
push edi
je 0x5d4304
cmp dword [esi + 0x14], 0
mov ecx, dword [esi + 0x28]
mov dword [esi + 0x28], edx
je 0x5d42b8
mov ecx, ebx
call fcn.005d41f0
cmp dword [ebx + 0x10], 0
je 0x5d4bca
mov edi, dword [esi + 4]
jmp 0x5d42f2
cmp dword [ebx + 4], 0
mov edi, eax
jne 0x5d42f2
xor eax, eax
mov edx, 9
cmp ecx, 4
mov dword [ebp - 0x10], edx
cmovg eax, edx
lea edx, [ecx + ecx]
sub edx, eax
xor ecx, ecx
mov eax, dword [ebp - 4]
cmp eax, 4
cmovg ecx, dword [ebp - 0x10]
add eax, eax
sub eax, ecx
cmp eax, edx
jg 0x5d42f2
cmp dword [ebp - 4], 4
mov edi, dword [esi + 4]
jne 0x5d4304
cmp edi, 0x29a
jne 0x5d4318
cmp dword [ebx + 4], 0
je 0x5d43cd
mov eax, dword [str.buffer_error]
pop edi
mov dword [ebx + 0x18], eax
mov eax, 0xfffffffb
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp edi, 0x2a
jne 0x5d43cd
mov eax, dword [esi + 0x30]
shl eax, 0xc
sub eax, 0x7800
cmp dword [esi + 0x88], 2
jge 0x5d4363
mov ecx, dword [esi + 0x84]
cmp ecx, 2
jl 0x5d4363
cmp ecx, 6
jge 0x5d434d
lea edx, [edi + 0x16]
lea ecx, [edi + 0x36]
jmp 0x5d436a
jne 0x5d4359
mov edx, 0x80
lea ecx, [edx + 0x20]
jmp 0x5d436a
mov edx, 0xc0
lea ecx, [edx + 0x20]
jmp 0x5d436a
xor edx, edx
mov ecx, 0x20
cmp dword [esi + 0x6c], 0
cmove ecx, edx
or ecx, eax
mov eax, 0x8421085
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.005d41c0
cmp dword [esi + 0x6c], 0
je 0x5d43ae
movzx edx, word [ebx + 0x32]
mov ecx, esi
call fcn.005d41c0
movzx edx, word [ebx + 0x30]
mov ecx, esi
call fcn.005d41c0
mov dword [ebx + 0x30], 1
mov ecx, ebx
mov dword [esi + 4], 0x71
call fcn.005d41f0
cmp dword [esi + 0x14], 0
jne 0x5d4bca
mov eax, dword [esi + 4]
cmp eax, 0x39
jne 0x5d45df
mov dword [ebx + 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 edi, dword [esi + 0x1c]
inc edx
mov dword [esi + 0x14], edx
test edi, edi
jne 0x5d44b1
mov eax, dword [esi + 8]
mov byte [edx + eax], 0
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
mov byte [ecx + eax], 0
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
mov byte [ecx + eax], 0
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
mov byte [ecx + eax], 0
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
mov byte [ecx + eax], 0
mov edx, dword [esi + 0x14]
mov eax, dword [esi + 0x84]
inc edx
mov dword [esi + 0x14], edx
cmp eax, 9
jne 0x5d4467
mov cl, 2
jmp 0x5d447b
cmp dword [esi + 0x88], 2
jge 0x5d4479
cmp eax, 2
jl 0x5d4479
xor cl, cl
jmp 0x5d447b
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], 0xa
mov ecx, ebx
inc dword [esi + 0x14]
mov dword [esi + 4], 0x71
call fcn.005d41f0
cmp dword [esi + 0x14], 0
jne 0x5d4bca
mov eax, dword [esi + 4]
jmp 0x5d45df
mov ecx, dword [edi + 0x24]
mov eax, dword [edi + 0x2c]
neg ecx
sbb cl, cl
and cl, 0x10
neg eax
sbb al, al
and al, 2
add cl, al
mov eax, dword [edi + 0x1c]
neg eax
sbb al, al
and al, 8
add cl, al
mov eax, dword [edi + 0x10]
neg eax
sbb al, al
and al, 4
add cl, al
cmp dword [edi], 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]
movzx eax, 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]
movzx eax, byte [eax + 5]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 8]
movzx eax, 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]
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 0x5d454c
mov cl, 2
jmp 0x5d4560
cmp dword [esi + 0x88], 2
jge 0x5d455e
cmp eax, 2
jl 0x5d455e
xor cl, cl
jmp 0x5d4560
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 0x5d45ae
movzx eax, 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]
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 0x5d45cc
mov eax, dword [esi + 8]
test eax, eax
je 0x5d45c9
mov ecx, dword [ebx + 0x30]
push edx
mov edx, eax
call fcn.005d6e60
add esp, 4
mov dword [ebx + 0x30], eax
mov dword [esi + 0x20], 0
mov eax, 0x45
mov dword [esi + 4], 0x45
cmp eax, 0x45
jne 0x5d46f6
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x10], 0
je 0x5d46ea
movzx edx, word [eax + 0x14]
sub edx, dword [esi + 0x20]
mov ecx, dword [esi + 0x14]
mov edi, dword [esi + 0xc]
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
lea eax, [ecx + edx]
cmp eax, edi
jbe 0x5d4693
mov eax, ecx
mov dword [ebp - 0x10], ecx
sub edi, eax
mov eax, dword [esi + 0x1c]
push edi
mov eax, dword [eax + 0x10]
add eax, dword [esi + 0x20]
push eax
mov eax, dword [esi + 8]
add eax, dword [ebp - 0x10]
push eax
call fcn.006d2cf0
mov eax, dword [esi + 0x1c]
add esp, 0xc
mov ecx, dword [esi + 0xc]
mov dword [esi + 0x14], ecx
cmp dword [eax + 0x2c], 0
je 0x5d4666
mov eax, dword [ebp - 0xc]
cmp ecx, eax
jbe 0x5d4666
mov edx, dword [esi + 8]
sub ecx, eax
add edx, eax
jne 0x5d4657
xor eax, eax
jmp 0x5d4663
push ecx
mov ecx, dword [ebx + 0x30]
call fcn.005d6e60
add esp, 4
mov dword [ebx + 0x30], eax
add dword [esi + 0x20], edi
mov ecx, ebx
call fcn.005d41f0
cmp dword [esi + 0x14], 0
jne 0x5d4bca
mov edx, dword [ebp - 8]
xor ecx, ecx
sub edx, edi
mov dword [ebp - 0xc], ecx
mov edi, dword [esi + 0xc]
xor eax, eax
mov dword [ebp - 8], edx
mov dword [ebp - 0x10], eax
cmp edx, edi
ja 0x5d4618
mov eax, dword [esi + 0x1c]
mov edi, dword [esi + 0x20]
push edx
mov eax, dword [eax + 0x10]
add eax, edi
push eax
mov eax, dword [esi + 8]
add eax, ecx
push eax
call fcn.006d2cf0
mov ecx, dword [ebp - 8]
add esp, 0xc
mov eax, dword [esi + 0x1c]
add ecx, dword [esi + 0x14]
mov dword [esi + 0x14], ecx
cmp dword [eax + 0x2c], 0
je 0x5d46e3
mov eax, dword [ebp - 0xc]
cmp ecx, eax
jbe 0x5d46e3
mov edx, dword [esi + 8]
sub ecx, eax
add edx, eax
jne 0x5d46d4
xor eax, eax
jmp 0x5d46e0
push ecx
mov ecx, dword [ebx + 0x30]
call fcn.005d6e60
add esp, 4
mov dword [ebx + 0x30], eax
mov dword [esi + 0x20], 0
mov dword [esi + 4], 0x49
mov eax, 0x49
cmp eax, 0x49
jne 0x5d47c3
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x1c], 0
je 0x5d47b7
mov ecx, dword [esi + 0x14]
mov edi, ecx
mov dword [ebp - 0xc], ecx
cmp edi, dword [esi + 0xc]
jne 0x5d475c
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x5d4742
cmp edi, ecx
jbe 0x5d4742
mov edx, dword [esi + 8]
sub edi, ecx
add edx, ecx
jne 0x5d4733
xor eax, eax
jmp 0x5d473f
mov ecx, dword [ebx + 0x30]
push edi
call fcn.005d6e60
add esp, 4
mov dword [ebx + 0x30], eax
mov ecx, ebx
call fcn.005d41f0
cmp dword [esi + 0x14], 0
jne 0x5d4bca
mov dword [ebp - 0xc], 0
xor edi, edi
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 [edi + eax], dl
mov edi, dword [esi + 0x14]
inc edi
mov dword [esi + 0x14], edi
test dl, dl
je 0x5d4784
mov ecx, dword [ebp - 0xc]
jmp 0x5d4714
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x5d47b0
mov eax, dword [ebp - 0xc]
cmp edi, eax
jbe 0x5d47b0
mov edx, dword [esi + 8]
sub edi, eax
add edx, eax
jne 0x5d47a1
xor eax, eax
jmp 0x5d47ad
mov ecx, dword [ebx + 0x30]
push edi
call fcn.005d6e60
add esp, 4
mov dword [ebx + 0x30], eax
mov dword [esi + 0x20], 0
mov dword [esi + 4], 0x5b
mov eax, 0x5b
cmp eax, 0x5b
jne 0x5d4890
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x24], 0
je 0x5d4887
mov ecx, dword [esi + 0x14]
mov edi, ecx
mov dword [ebp - 0xc], ecx
cmp edi, dword [esi + 0xc]
jne 0x5d4829
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x5d480f
cmp edi, ecx
jbe 0x5d480f
mov edx, dword [esi + 8]
sub edi, ecx
add edx, ecx
jne 0x5d4800
xor eax, eax
jmp 0x5d480c
mov ecx, dword [ebx + 0x30]
push edi
call fcn.005d6e60
add esp, 4
mov dword [ebx + 0x30], eax
mov ecx, ebx
call fcn.005d41f0
cmp dword [esi + 0x14], 0
jne 0x5d4bca
mov dword [ebp - 0xc], 0
xor edi, edi
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 [edi + eax], dl
mov edi, dword [esi + 0x14]
inc edi
mov dword [esi + 0x14], edi
test dl, dl
je 0x5d4851
mov ecx, dword [ebp - 0xc]
jmp 0x5d47e1
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x5d4887
mov eax, dword [ebp - 0xc]
cmp edi, eax
jbe 0x5d4887
mov edx, dword [esi + 8]
sub edi, eax
add edx, eax
jne 0x5d4878
xor eax, eax
mov dword [ebx + 0x30], eax
mov dword [esi + 4], 0x67
jmp 0x5d4895
mov ecx, dword [ebx + 0x30]
push edi
call fcn.005d6e60
add esp, 4
mov dword [ebx + 0x30], eax
mov dword [esi + 4], 0x67
jmp 0x5d4895
cmp eax, 0x67
jne 0x5d48f7
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x5d48df
mov edx, dword [esi + 0x14]
lea eax, [edx + 2]
cmp eax, dword [esi + 0xc]
jbe 0x5d48bb
mov ecx, ebx
call fcn.005d41f0
mov edx, dword [esi + 0x14]
test edx, edx
jne 0x5d4bca
mov ecx, dword [esi + 8]
movzx eax, byte [ebx + 0x30]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
movzx eax, byte [ebx + 0x31]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov dword [ebx + 0x30], 0
mov ecx, ebx
mov dword [esi + 4], 0x71
call fcn.005d41f0
cmp dword [esi + 0x14], 0
jne 0x5d4bca
cmp dword [ebx + 4], 0
mov edi, dword [ebp - 4]
jne 0x5d491b
cmp dword [esi + 0x74], 0
jne 0x5d491b
test edi, edi
je 0x5d4ae7
cmp dword [esi + 4], 0x29a
je 0x5d4ae7
mov eax, dword [esi + 0x84]
test eax, eax
jne 0x5d492e
push edi
push esi
call fcn.005d5090
jmp 0x5d496d
mov ecx, dword [esi + 0x88]
cmp ecx, 2
jne 0x5d4944
mov edx, edi
mov ecx, esi
call fcn.005d60e0
jmp 0x5d4970
cmp ecx, 3
jne 0x5d4954
mov edx, edi
mov ecx, esi
call fcn.005d5d90
jmp 0x5d4970
lea eax, [eax + eax*2]
push edi
mov edi, dword [eax*4 + 0x785250]
mov ecx, edi
push esi
call dword [0x70d440]
call edi
mov edi, dword [ebp - 4]
add esp, 8
cmp eax, 2
je 0x5d497a
cmp eax, 3
jne 0x5d4981
mov dword [esi + 4], 0x29a
test eax, eax
je 0x5d4bc4
cmp eax, 2
je 0x5d4bc4
cmp eax, 1
jne 0x5d4ae7
cmp edi, eax
jne 0x5d4a7a
mov ecx, dword [esi + 0x16bc]
mov eax, 2
shl ax, cl
or ax, word [esi + 0x16b8]
movzx edx, ax
cmp ecx, 0xd
jle 0x5d4a04
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
mov word [esi + 0x16b8], dx
mov byte [ecx + eax], dl
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
mov al, byte [esi + 0x16b9]
mov byte [edx + ecx], al
mov cl, 0x10
movzx eax, word [esi + 0x16bc]
inc dword [esi + 0x14]
sub cl, al
add dword [esi + 0x16bc], 0xfffffff3
mov eax, 2
shr ax, cl
movzx eax, ax
jmp 0x5d4a0f
lea eax, [ecx + 3]
mov dword [esi + 0x16bc], eax
mov eax, edx
mov word [esi + 0x16b8], ax
mov eax, dword [esi + 0x16bc]
movzx edx, word [esi + 0x16b8]
cmp eax, 9
jle 0x5d4a5f
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
mov byte [ecx + eax], dl
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
mov al, byte [esi + 0x16b9]
mov byte [edx + ecx], al
xor eax, eax
inc dword [esi + 0x14]
mov ecx, esi
add dword [esi + 0x16bc], 0xfffffff7
mov word [esi + 0x16b8], ax
call fcn.005d87d0
jmp 0x5d4ad6
add eax, 7
mov ecx, esi
mov dword [esi + 0x16bc], eax
mov eax, edx
mov word [esi + 0x16b8], ax
call fcn.005d87d0
jmp 0x5d4ad6
cmp edi, 5
je 0x5d4ad6
push 0
push 0
xor edx, edx
mov ecx, esi
call fcn.005d7f80
add esp, 8
cmp edi, 3
jne 0x5d4ad6
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 edx
push dword [esi + 0x44]
call fcn.006d4310
add esp, 0xc
cmp dword [esi + 0x74], 0
jne 0x5d4ad6
mov dword [esi + 0x6c], 0
mov dword [esi + 0x5c], 0
mov dword [esi + 0x16b4], 0
mov ecx, ebx
call fcn.005d41f0
cmp dword [ebx + 0x10], 0
je 0x5d4bca
cmp edi, 4
jne 0x5d4bd1
mov eax, dword [esi + 0x18]
test eax, eax
jg 0x5d4b01
lea eax, [edi - 3]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp eax, 2
jne 0x5d4b8c
mov edx, dword [esi + 0x14]
movzx eax, byte [ebx + 0x30]
mov ecx, dword [esi + 8]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
movzx eax, byte [ebx + 0x31]
mov ecx, dword [esi + 8]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
movzx eax, byte [ebx + 0x32]
mov ecx, dword [esi + 8]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
movzx eax, byte [ebx + 0x33]
mov ecx, dword [esi + 8]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
movzx eax, byte [ebx + 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 [ebx + 9]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
movzx eax, byte [ebx + 0xa]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
movzx eax, byte [ebx + 0xb]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
jmp 0x5d4ba2
movzx edx, word [ebx + 0x32]
mov ecx, esi
call fcn.005d41c0
movzx edx, word [ebx + 0x30]
mov ecx, esi
call fcn.005d41c0
mov ecx, ebx
call fcn.005d41f0
mov eax, dword [esi + 0x18]
test eax, eax
jle 0x5d4bb5
neg eax
mov dword [esi + 0x18], eax
xor eax, eax
cmp dword [esi + 0x14], eax
pop edi
pop esi
sete al
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebx + 0x10], 0
jne 0x5d4bd1
mov dword [esi + 0x28], 0xffffffff
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [str.stream_error]
mov dword [ebx + 0x18], eax
mov eax, 0xfffffffe
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, 0xfffffffe
pop ebx
mov esp, ebp
pop ebp
ret