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

Disassembly:
sub esp, 0x10
push ebx
push ebp
push esi
push edi
mov ebp, edx
mov edi, ecx
call fcn.0051013e
test eax, eax
jne 0x510ad6
cmp ebp, 5
ja 0x510ad6
mov esi, dword [edi + 0x1c]
xor ebx, ebx
cmp dword [edi + 0xc], ebx
je 0x510acf
cmp dword [edi + 4], ebx
je 0x5102a4
cmp dword [edi], ebx
je 0x510acf
cmp dword [esi + 4], 0x29a
jne 0x5102b6
cmp ebp, 4
jne 0x510acf
cmp dword [edi + 0x10], ebx
je 0x510323
mov edx, dword [esi + 0x28]
push 9
mov dword [esi + 0x28], ebp
pop ecx
cmp dword [esi + 0x14], ebx
je 0x5102e0
mov ecx, edi
call fcn.0051021f
cmp dword [edi + 0x10], ebx
jne 0x51030e
or dword [esi + 0x28], 0xffffffff
xor eax, eax
jmp 0x510ad9
cmp dword [edi + 4], ebx
jne 0x51030e
xor eax, eax
cmp edx, 4
push 9
cmovg eax, ecx
add edx, edx
sub edx, eax
xor ecx, ecx
cmp ebp, 4
pop eax
cmovg ecx, eax
lea eax, [ebp*2]
sub eax, ecx
cmp eax, edx
jg 0x51030e
cmp ebp, 4
jne 0x510323
cmp dword [esi + 4], 0x29a
push 0x1f
pop edx
jne 0x510331
cmp dword [edi + 4], ebx
je 0x5103e3
mov dword [edi + 0x18], str.buffer_error
push 0xfffffffffffffffb
jmp 0x510ad8
cmp dword [esi + 4], 0x2a
jne 0x5103e3
mov ecx, dword [esi + 0x30]
shl ecx, 0xc
sub ecx, 0x7800
cmp dword [esi + 0x88], 2
mov ebx, ecx
jge 0x51037f
mov eax, dword [esi + 0x84]
cmp eax, 2
jl 0x51037f
cmp eax, 6
jge 0x510369
push 0x40
pop eax
push 0x60
jmp 0x510383
jne 0x510375
mov eax, 0x80
lea edx, [eax + 0x20]
jmp 0x510384
mov eax, 0xc0
lea edx, [eax + 0x20]
jmp 0x510384
xor eax, eax
push 0x20
pop edx
or ecx, eax
cmp dword [esi + 0x6c], 0
je 0x510390
mov ecx, edx
or ecx, ebx
mov eax, ecx
xor edx, edx
push 0x1f
pop ebx
div ebx
sub ecx, edx
lea edx, [ebx + ecx]
mov ecx, esi
call fcn.005101fb
xor ebx, ebx
cmp dword [esi + 0x6c], ebx
je 0x5103c2
movzx edx, word [edi + 0x32]
mov ecx, esi
call fcn.005101fb
movzx edx, word [edi + 0x30]
mov ecx, esi
call fcn.005101fb
mov dword [edi + 0x30], 1
mov ecx, edi
mov dword [esi + 4], 0x71
call fcn.0051021f
cmp dword [esi + 0x14], ebx
jne 0x5102d5
push 0x1f
pop edx
cmp dword [esi + 4], 0x39
jne 0x5105f0
mov dword [edi + 0x30], ebx
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
mov byte [ecx + eax], dl
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
inc ecx
mov dword [esi + 0x14], ecx
mov byte [ecx + eax], 0x8b
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
inc ecx
mov dword [esi + 0x14], ecx
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 0x5104bc
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 0x510477
mov cl, 2
jmp 0x510489
cmp dword [esi + 0x88], 2
jge 0x510487
mov cl, bl
cmp eax, 2
jge 0x510489
mov cl, 4
mov eax, dword [esi + 8]
mov byte [edx + eax], cl
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
inc ecx
mov dword [esi + 0x14], ecx
mov byte [ecx + eax], 0xa
mov ecx, edi
inc dword [esi + 0x14]
mov dword [esi + 4], 0x71
call fcn.0051021f
cmp dword [esi + 0x14], ebx
jne 0x5102d5
jmp 0x5105f2
cmp dword [ebx + 0x24], 0
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
mov edx, dword [esi + 0x14]
mov eax, dword [esi + 0x1c]
inc edx
mov ecx, dword [esi + 8]
mov dword [esi + 0x14], edx
mov al, 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
mov al, 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
mov al, 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
mov al, 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 0x51055f
mov cl, 2
jmp 0x510575
cmp dword [esi + 0x88], 2
jge 0x510573
cmp eax, 2
jl 0x510573
xor ebx, ebx
mov cl, bl
jmp 0x510577
mov cl, 4
xor ebx, ebx
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
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 0x5105c2
mov ecx, dword [esi + 8]
mov al, byte [eax + 0x14]
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
mov al, byte [eax + 0x15]
mov byte [edx + ecx], al
mov edx, dword [esi + 0x14]
inc edx
mov dword [esi + 0x14], edx
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], ebx
je 0x5105e4
cmp dword [esi + 8], 0
jne 0x5105d4
mov eax, ebx
jmp 0x5105e1
mov ecx, dword [edi + 0x30]
push edx
mov edx, dword [esi + 8]
call fcn.00511f5e
pop ecx
mov dword [edi + 0x30], eax
mov dword [esi + 0x20], ebx
mov dword [esi + 4], 0x45
jmp 0x5105f2
xor ebx, ebx
mov eax, dword [esi + 4]
cmp eax, 0x45
jne 0x510712
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x10], ebx
je 0x510709
movzx ecx, word [eax + 0x14]
sub ecx, dword [esi + 0x20]
mov ebx, dword [esi + 0x14]
mov edx, dword [esi + 0xc]
mov dword [esp + 0x10], ecx
mov dword [esp + 0x1c], ebx
lea eax, [ebx + ecx]
cmp eax, edx
jbe 0x5106b8
mov eax, ebx
mov dword [esp + 0x18], ebx
sub edx, eax
mov eax, dword [esi + 0x1c]
push edx
mov dword [esp + 0x18], edx
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 fcn.0051c650
mov eax, dword [esi + 0x1c]
add esp, 0xc
mov ecx, dword [esi + 0xc]
mov dword [esi + 0x14], ecx
cmp dword [eax + 0x2c], 0
je 0x51067e
cmp ecx, ebx
jbe 0x51067e
mov edx, dword [esi + 8]
sub ecx, ebx
add edx, ebx
jne 0x510671
xor eax, eax
jmp 0x51067b
push ecx
mov ecx, dword [edi + 0x30]
call fcn.00511f5e
pop ecx
mov dword [edi + 0x30], eax
mov eax, dword [esp + 0x14]
mov ecx, edi
add dword [esi + 0x20], eax
call fcn.0051021f
mov eax, dword [esi + 0x14]
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x5102d5
mov ecx, dword [esp + 0x10]
xor ebx, ebx
sub ecx, dword [esp + 0x14]
mov edx, dword [esi + 0xc]
mov dword [esp + 0x10], ecx
mov dword [esp + 0x18], eax
cmp ecx, edx
ja 0x510630
mov eax, dword [esi + 0x1c]
push ecx
mov eax, dword [eax + 0x10]
add eax, dword [esi + 0x20]
push eax
mov eax, dword [esi + 8]
add eax, dword [esp + 0x24]
push eax
call fcn.0051c650
mov ecx, dword [esi + 0x14]
add esp, 0xc
mov eax, dword [esi + 0x1c]
add ecx, dword [esp + 0x10]
mov dword [esi + 0x14], ecx
cmp dword [eax + 0x2c], 0
je 0x510704
cmp ecx, ebx
jbe 0x510704
mov edx, dword [esi + 8]
sub ecx, ebx
add edx, ebx
jne 0x5106f7
xor eax, eax
jmp 0x510701
push ecx
mov ecx, dword [edi + 0x30]
call fcn.00511f5e
pop ecx
mov dword [edi + 0x30], eax
xor ebx, ebx
mov dword [esi + 0x20], ebx
mov dword [esi + 4], 0x49
jmp 0x51071b
cmp eax, 0x49
jne 0x5107d6
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x1c], ebx
je 0x5107cd
mov ecx, dword [esi + 0x14]
mov ebx, ecx
mov dword [esp + 0x10], ecx
cmp ebx, dword [esi + 0xc]
jne 0x510774
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x51075c
cmp ebx, ecx
jbe 0x51075c
mov edx, dword [esi + 8]
sub ebx, ecx
add edx, ecx
jne 0x51074f
xor eax, eax
jmp 0x510759
mov ecx, dword [edi + 0x30]
push ebx
call fcn.00511f5e
pop ecx
mov dword [edi + 0x30], eax
mov ecx, edi
call fcn.0051021f
cmp dword [esi + 0x14], 0
jne 0x5102d5
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 0x51079d
mov ecx, dword [esp + 0x10]
jmp 0x510730
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x5107c8
mov eax, dword [esp + 0x10]
cmp ebx, eax
jbe 0x5107c8
mov edx, dword [esi + 8]
sub ebx, eax
add edx, eax
jne 0x5107bb
xor eax, eax
jmp 0x5107c5
mov ecx, dword [edi + 0x30]
push ebx
call fcn.00511f5e
pop ecx
mov dword [edi + 0x30], eax
xor ebx, ebx
mov dword [esi + 0x20], ebx
mov dword [esi + 4], 0x5b
jmp 0x5107df
cmp eax, 0x5b
jne 0x510897
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x24], ebx
je 0x51088e
mov ecx, dword [esi + 0x14]
mov ebx, ecx
mov dword [esp + 0x10], ecx
cmp ebx, dword [esi + 0xc]
jne 0x510838
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x510820
cmp ebx, ecx
jbe 0x510820
mov edx, dword [esi + 8]
sub ebx, ecx
add edx, ecx
jne 0x510813
xor eax, eax
jmp 0x51081d
mov ecx, dword [edi + 0x30]
push ebx
call fcn.00511f5e
pop ecx
mov dword [edi + 0x30], eax
mov ecx, edi
call fcn.0051021f
cmp dword [esi + 0x14], 0
jne 0x5102d5
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 0x510861
mov ecx, dword [esp + 0x10]
jmp 0x5107f4
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], 0
je 0x51088c
mov eax, dword [esp + 0x10]
cmp ebx, eax
jbe 0x51088c
mov edx, dword [esi + 8]
sub ebx, eax
add edx, eax
jne 0x51087f
xor eax, eax
jmp 0x510889
mov ecx, dword [edi + 0x30]
push ebx
call fcn.00511f5e
pop ecx
mov dword [edi + 0x30], eax
xor ebx, ebx
mov dword [esi + 4], 0x67
jmp 0x51089c
cmp eax, 0x67
jne 0x5108f7
mov eax, dword [esi + 0x1c]
cmp dword [eax + 0x2c], ebx
je 0x5108e0
mov edx, dword [esi + 0x14]
lea eax, [edx + 2]
cmp eax, dword [esi + 0xc]
jbe 0x5108c1
mov ecx, edi
call fcn.0051021f
mov edx, dword [esi + 0x14]
test edx, edx
jne 0x5102d5
mov ecx, dword [esi + 8]
mov al, byte [edi + 0x30]
mov byte [edx + ecx], al
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
inc edx
mov dword [esi + 0x14], edx
mov al, byte [edi + 0x31]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
mov dword [edi + 0x30], ebx
mov ecx, edi
mov dword [esi + 4], 0x71
call fcn.0051021f
cmp dword [esi + 0x14], ebx
jne 0x5102d5
cmp dword [edi + 4], ebx
jne 0x510916
cmp dword [esi + 0x74], ebx
jne 0x510916
test ebp, ebp
je 0x5102d9
cmp dword [esi + 4], 0x29a
je 0x5109ec
mov ecx, dword [esi + 0x84]
test ecx, ecx
jne 0x510929
push ebp
push esi
call fcn.00510f73
jmp 0x51095a
mov eax, dword [esi + 0x88]
cmp eax, 2
jne 0x51093f
mov edx, ebp
mov ecx, esi
call fcn.00511beb
jmp 0x51095c
cmp eax, 3
jne 0x51094f
mov edx, ebp
mov ecx, esi
call fcn.0051199c
jmp 0x51095c
imul eax, ecx, 0xc
push ebp
push esi
call dword [eax + 0x581288]
pop ecx
pop ecx
cmp eax, 2
je 0x510966
cmp eax, 3
jne 0x51096d
mov dword [esi + 4], 0x29a
test eax, eax
je 0x510ac1
cmp eax, 2
je 0x510ac1
cmp eax, 1
jne 0x5109ec
cmp ebp, eax
jne 0x510990
mov ecx, esi
call fcn.00513928
jmp 0x5109dc
cmp ebp, 5
je 0x5109dc
push ebx
push ebx
xor edx, edx
mov ecx, esi
call fcn.00513832
pop ecx
pop ecx
cmp ebp, 3
jne 0x5109dc
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 fcn.0051c010
add esp, 0xc
cmp dword [esi + 0x74], ebx
jne 0x5109dc
mov dword [esi + 0x6c], ebx
mov dword [esi + 0x5c], ebx
mov dword [esi + 0x16b4], ebx
mov ecx, edi
call fcn.0051021f
cmp dword [edi + 0x10], ebx
je 0x5102d5
cmp ebp, 4
jne 0x5102d9
cmp dword [esi + 0x18], 0
jg 0x510a03
xor eax, eax
inc eax
jmp 0x510ad9
cmp dword [esi + 0x18], 2
jne 0x510a8e
mov edx, dword [esi + 0x14]
mov al, byte [edi + 0x30]
mov ecx, dword [esi + 8]
mov byte [edx + ecx], al
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
inc edx
mov dword [esi + 0x14], edx
mov al, byte [edi + 0x31]
mov byte [edx + ecx], al
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
inc edx
mov dword [esi + 0x14], edx
mov al, byte [edi + 0x32]
mov byte [edx + ecx], al
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
inc edx
mov dword [esi + 0x14], edx
mov al, byte [edi + 0x33]
mov byte [edx + ecx], al
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
inc edx
mov dword [esi + 0x14], edx
mov al, byte [edi + 8]
mov byte [edx + ecx], al
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
inc edx
mov dword [esi + 0x14], edx
mov al, byte [edi + 9]
mov byte [edx + ecx], al
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
inc edx
mov dword [esi + 0x14], edx
mov al, byte [edi + 0xa]
mov byte [edx + ecx], al
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 8]
inc edx
mov dword [esi + 0x14], edx
mov al, byte [edi + 0xb]
mov byte [edx + ecx], al
inc dword [esi + 0x14]
jmp 0x510aa4
movzx edx, word [edi + 0x32]
mov ecx, esi
call fcn.005101fb
movzx edx, word [edi + 0x30]
mov ecx, esi
call fcn.005101fb
mov ecx, edi
call fcn.0051021f
mov eax, dword [esi + 0x18]
test eax, eax
jle 0x510ab7
neg eax
mov dword [esi + 0x18], eax
xor eax, eax
cmp dword [esi + 0x14], ebx
sete al
jmp 0x510ad9
cmp dword [edi + 0x10], ebx
jne 0x5102d9
jmp 0x5102d5
mov dword [edi + 0x18], str.stream_error
push 0xfffffffffffffffe
pop eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret