Function at 0x40ae31
Capabilities:
Decompress data using aplib

Disassembly:
dec eax
push esp
pop eax
dec eax
mov dword [eax + 8], ebx
dec eax
mov dword [eax + 0x10], esi
dec eax
mov dword [eax + 0x18], edi
dec esp
mov dword [eax + 0x20], esi
push ebp
dec eax
push esp
pop ebp
dec eax
sub esp, 0x40
mov al, byte [ecx]
inc ecx
or esi, 0xffffffff
and dword [ebp - 0xc], 0
inc ebp
sub ecx, ecx
mov byte [edx], al
xor edi, edi
dec eax
lea eax, [edx + 1]
dec eax
push edx
pop ebx
dec eax
mov dword [ebp - 0x18], eax
inc ebp
mov ebx, esi
dec eax
lea eax, [ecx + 1]
dec eax
mov dword [ebp - 0x20], eax
lea esi, [edi + 1]
dec eax
lea ecx, [ebp - 0x20]
call fcn.0040b075
or eax, eax
je 0x40b031
dec eax
lea ecx, [ebp - 0x20]
call fcn.0040b075
test eax, eax
je 0x40af37
dec eax
lea ecx, [ebp - 0x20]
call fcn.0040b075
or eax, eax
je 0x40aef3
inc ebp
xor ecx, ecx
inc ebp
lea edx, [ecx + 4]
dec eax
lea ecx, [ebp - 0x20]
call fcn.0040b075
inc esi
lea ecx, [eax + ecx*2]
inc esp
sub edx, esi
jne 0x40aeac
inc ebp
or ecx, ecx
je 0x40aee0
dec eax
mov edx, dword [ebp - 0x18]
dec eax
push edx
pop eax
inc ecx
push eax
pop eax
dec eax
sub eax, ecx
mov al, byte [eax]
mov byte [edx], al
dec eax
add edx, esi
dec eax
mov dword [ebp - 0x18], edx
jmp 0x40b04b
dec eax
mov eax, dword [ebp - 0x18]
mov byte [eax], 0
dec eax
add eax, esi
dec eax
mov dword [ebp - 0x18], eax
jmp 0x40b04b
dec eax
mov eax, dword [ebp - 0x20]
inc esp
movzx ebx, byte [eax]
dec eax
add eax, esi
inc ecx
mov ecx, ebx
dec eax
mov dword [ebp - 0x20], eax
and ecx, esi
add ecx, 2
inc ecx
shr ebx, 1
je 0x40af30
dec eax
mov edx, dword [ebp - 0x18]
inc ebp
push ebx
pop eax
dec ecx
neg eax
inc ecx
mov al, byte [eax + edx]
mov byte [edx], al
dec eax
add edx, esi
inc ecx
add ecx, esi
jne 0x40af19
dec eax
mov dword [ebp - 0x18], edx
jmp 0x40b02c
push esi
pop edi
jmp 0x40b02c
inc esp
push esi
pop edx
dec eax
lea ecx, [ebp - 0x20]
call fcn.0040b075
dec eax
lea ecx, [ebp - 0x20]
inc esi
lea edx, [eax + edx*2]
call fcn.0040b075
test eax, eax
jne 0x40af3a
inc ebp
or ecx, ecx
jne 0x40afa1
inc ecx
cmp edx, 2
jne 0x40afa1
inc esp
mov ecx, esi
dec eax
lea ecx, [ebp - 0x20]
call fcn.0040b075
dec eax
lea ecx, [ebp - 0x20]
inc esi
lea ecx, [eax + ecx*2]
call fcn.0040b075
or eax, eax
jne 0x40af62
inc ebp
test ecx, ecx
je 0x40b02c
dec eax
mov ecx, dword [ebp - 0x18]
inc ecx
mov edx, ebx
dec eax
neg edx
mov al, byte [edx + ecx]
mov byte [ecx], al
dec eax
add ecx, esi
inc ebp
add ecx, esi
jne 0x40af8f
jmp 0x40b028
dec eax
mov ecx, dword [ebp - 0x20]
inc esp
xor ecx, esi
inc ebp
sub edx, ecx
inc esp
mov ecx, esi
inc ecx
shl edx, 8
inc esp
movzx ebx, byte [ecx]
inc ecx
add ebx, 0xfffffe00
inc ebp
add ebx, edx
dec eax
add ecx, esi
dec eax
mov dword [ebp - 0x20], ecx
dec eax
lea ecx, [ebp - 0x20]
call fcn.0040b075
dec eax
lea ecx, [ebp - 0x20]
inc esi
lea ecx, [eax + ecx*2]
call fcn.0040b075
or eax, eax
jne 0x40afc7
inc ecx
cmp ebx, 0x7d00
inc ecx
lea eax, [ecx + 1]
inc ecx
cmovb eax, ecx
inc ecx
cmp ebx, 0x500
lea ecx, [eax + 1]
cmovb ecx, eax
inc ecx
cmp ebx, 0x80
inc esp
lea eax, [ecx + 2]
inc esp
cmovae eax, ecx
inc ebp
test eax, eax
je 0x40b02c
dec eax
mov ecx, dword [ebp - 0x18]
inc ecx
push ebx
pop edx
dec eax
neg edx
mov al, byte [edx + ecx]
mov byte [ecx], al
dec eax
add ecx, esi
inc ebp
add eax, esi
jne 0x40b01b
dec eax
mov dword [ebp - 0x18], ecx
inc esp
push esi
pop ecx
jmp 0x40b04e
dec eax
mov edx, dword [ebp - 0x20]
dec eax
mov ecx, dword [ebp - 0x18]
mov al, byte [edx]
mov byte [ecx], al
dec eax
add ecx, esi
dec eax
add edx, esi
dec eax
mov dword [ebp - 0x18], ecx
dec eax
mov dword [ebp - 0x20], edx
inc ebp
sub ecx, ecx
or edi, edi
je 0x40ae76
mov eax, dword [ebp - 0x18]
dec eax
mov esi, dword [esp + 0x58]
sub eax, ebx
dec eax
mov ebx, dword [esp + 0x50]
dec eax
mov edi, dword [esp + 0x60]
dec esp
mov esi, dword [esp + 0x68]
dec eax
add esp, 0x40
pop ebp
ret