Function at 0x401970
Capabilities:
Decompress data using aplib

Disassembly:
sub esp, 0x160
push ebx
push ebp
push esi
xor esi, esi
push edi
xor eax, eax
mov dword [esp + 0x28], esi
sub dword [esp + 0x36], eax
sub edi, edi
add dword [esp + 0x36], eax
mov edx, dword [esp + 0x174]
mov cl, byte [0x404388]
mov ebx, dword [esp + 0x1c]
mov byte [edx], cl
add edx, 1
mov ebp, 0x404389
mov dword [esp + 0x18], edx
mov dword [esp + 0x14], ebp
jmp 0x4019b5
mov esi, dword [esp + 0x24]
mov ecx, eax
sub eax, 1
test ecx, ecx
jne 0x4019dc
add ecx, ebx
sub dword [esp + 0x66], eax
movzx ebx, byte [ebp]
mov edi, 7
add ebp, 1
mov dword [esp + 0x14], ebp
mov dword [esp + 0x20], edi
mov eax, edi
jmp 0x4019e1
mov edi, 7
or dword [esp + 0xed], eax
or dword [esp + 0xef], eax
mov ecx, ebx
shr ecx, 7
and ecx, 1
add ebx, ebx
test ecx, ecx
je 0x401c32
mov ecx, eax
sub eax, 1
test ecx, ecx
mov dword [esp + 0x20], eax
jne 0x401a25
add ecx, ebx
sub dword [esp + 0x66], eax
movzx ebx, byte [ebp]
add ebp, 1
mov dword [esp + 0x14], ebp
mov dword [esp + 0x20], edi
mov eax, edi
or dword [esp + 0xed], eax
or dword [esp + 0xef], eax
mov ecx, ebx
shr ecx, 7
and ecx, 1
add ebx, ebx
test ecx, ecx
mov dword [esp + 0x1c], ebx
je 0x401b6e
mov ecx, eax
sub eax, 1
test ecx, ecx
jne 0x401a69
add ecx, ebx
sub dword [esp + 0x66], eax
movzx ebx, byte [ebp]
add ebp, 1
mov dword [esp + 0x14], ebp
mov dword [esp + 0x20], edi
mov eax, edi
or dword [esp + 0xed], eax
or dword [esp + 0xef], eax
mov ecx, ebx
shr ecx, 7
and ecx, 1
add ebx, ebx
test ecx, ecx
je 0x401b0f
xor edi, ebx
xor edi, edi
lea esi, [edi + 4]
jmp 0x401a96
mov eax, dword [esp + 0x20]
mov ecx, eax
sub eax, 1
test ecx, ecx
mov dword [esp + 0x20], eax
jne 0x401ab8
add ecx, ebx
sub dword [esp + 0x66], eax
movzx ebx, byte [ebp]
add ebp, 1
mov dword [esp + 0x20], 7
or dword [esp + 0xed], eax
or dword [esp + 0xef], eax
mov eax, ebx
shr eax, 7
and eax, 1
add ebx, ebx
sub esi, 1
lea edi, [eax + edi*2]
jne 0x401a92
test edi, edi
mov dword [esp + 0x14], ebp
je 0x401af8
mov eax, edx
sub eax, edi
mov cl, byte [eax]
mov byte [edx], cl
add edx, 1
mov dword [esp + 0x18], edx
mov dword [esp + 0x24], esi
jmp 0x401c28
mov byte [edx], 0
add edx, 1
mov dword [esp + 0x18], edx
mov dword [esp + 0x24], 0
jmp 0x401c28
movzx esi, byte [ebp]
mov edi, esi
and edi, 1
add ebp, 1
add edi, 2
shr esi, 1
mov dword [esp + 0x14], ebp
je 0x401b55
test edi, edi
je 0x401b5d
lea ebx, [ebx]
mov ecx, edx
sub ecx, esi
mov cl, byte [ecx]
mov byte [edx], cl
add edx, 1
sub edi, 1
jne 0x401b30
mov dword [esp + 0x18], edx
mov dword [esp + 0x2c], esi
mov dword [esp + 0x24], 1
jmp 0x401c2c
mov dword [esp + 0x28], 1
mov dword [esp + 0x2c], esi
mov dword [esp + 0x24], 1
jmp 0x401c2c
lea edi, [esp + 0x14]
call fcn.00401df0
test esi, esi
jne 0x401bb3
cmp eax, 2
jne 0x401bae
sub dword [esp + 0x68], eax
call fcn.00401df0
test eax, eax
mov edx, dword [esp + 0x18]
je 0x401c18
mov ecx, edx
sub ecx, dword [esp + 0x2c]
add edx, 1
sub eax, 1
mov cl, byte [ecx]
mov byte [edx - 1], cl
jne 0x401b95
mov dword [esp + 0x18], edx
jmp 0x401c18
sub eax, 3
jmp 0x401bb6
sub eax, 2
mov ecx, dword [esp + 0x14]
movzx edx, byte [ecx]
shl eax, 8
add eax, edx
add ecx, 1
lea edi, [esp + 0x14]
mov ebx, eax
mov dword [esp + 0x14], ecx
call fcn.00401df0
cmp ebx, 0x7d00
mov edi, eax
jb 0x401be1
add edi, 1
cmp ebx, 0x500
jb 0x401bec
add edi, 1
cmp ebx, 0x80
jae 0x401bf7
add edi, 2
test edi, edi
mov edx, dword [esp + 0x18]
je 0x401c14
nop
mov eax, edx
sub eax, ebx
mov cl, byte [eax]
mov byte [edx], cl
add edx, 1
sub edi, 1
jne 0x401c00
mov dword [esp + 0x18], edx
mov dword [esp + 0x2c], ebx
mov ebx, dword [esp + 0x1c]
mov ebp, dword [esp + 0x14]
mov dword [esp + 0x24], 1
mov eax, dword [esp + 0x20]
add ecx, ebx
and esi, edx
jmp 0x401c4d
mov cl, byte [ebp]
mov byte [edx], cl
add edx, 1
add ebp, 1
mov dword [esp + 0x18], edx
mov dword [esp + 0x14], ebp
mov dword [esp + 0x24], 0
cmp dword [esp + 0x28], 0
je 0x4019b1
mov dword [esp + 0x28], 3
or eax, dword [esp + 0x28]
pop edi
pop esi
mov eax, edx
sub eax, dword [esp + 0x16c]
pop ebp
pop ebx
add esp, 0x160
ret