Function at 0x1001f870
Capabilities:
Decompress data using aplib

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x2c
mov al, byte [ecx]
push ebx
push esi
push edi
xor edi, edi
mov dword [esp + 0x24], edx
xor ebx, ebx
mov byte [edx], al
lea esi, [edx + 1]
mov dword [esp + 0x14], edi
mov edx, dword [esp + 0x30]
inc ecx
mov dword [esp + 0x1c], edi
mov dword [esp + 0x18], ebx
mov dword [esp + 0x10], esi
mov dword [esp + 0x2c], esi
mov dword [esp + 0x28], ecx
mov eax, edi
dec edi
test eax, eax
jne 0x1001f8ba
movzx edx, byte [ecx]
lea edi, [eax + 7]
inc ecx
mov dword [esp + 0x28], ecx
mov eax, edx
add edx, edx
shr eax, 7
and eax, 1
je 0x1001fa87
mov eax, edi
dec edi
mov dword [esp + 0x34], edi
test eax, eax
jne 0x1001f8e6
movzx edx, byte [ecx]
mov edi, 7
inc ecx
mov dword [esp + 0x34], edi
mov dword [esp + 0x28], ecx
mov eax, edx
add edx, edx
shr eax, 7
mov dword [esp + 0x30], edx
and eax, 1
je 0x1001f9c3
mov eax, edi
dec edi
test eax, eax
jne 0x1001f90c
movzx edx, byte [ecx]
lea edi, [eax + 7]
inc ecx
mov dword [esp + 0x28], ecx
mov eax, edx
add edx, edx
shr eax, 7
mov dword [esp + 0x20], edx
and eax, 1
je 0x1001f964
xor ebx, ebx
lea esi, [ebx + 4]
mov eax, edi
dec edi
test eax, eax
jne 0x1001f92f
movzx edx, byte [ecx]
lea edi, [eax + 7]
inc ecx
mov eax, edx
add edx, edx
shr eax, 7
and eax, 1
lea ebx, [eax + ebx*2]
sub esi, 1
jne 0x1001f921
mov esi, dword [esp + 0x10]
mov dword [esp + 0x28], ecx
test ebx, ebx
je 0x1001f95b
mov eax, esi
sub eax, ebx
mov al, byte [eax]
mov byte [esi], al
inc esi
jmp 0x1001fa91
mov byte [esi], 0
inc esi
jmp 0x1001fa91
movzx ebx, byte [ecx]
inc ecx
mov eax, ebx
mov dword [esp + 0x28], ecx
and eax, 1
add eax, 2
shr ebx, 1
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], ebx
je 0x1001f9ae
mov ebx, esi
mov edx, eax
sub ebx, dword [esp + 0x18]
mov al, byte [ebx]
lea ebx, [ebx + 1]
mov byte [esi], al
inc esi
mov dword [esp + 0x2c], esi
sub edx, 1
jne 0x1001f988
mov edx, dword [esp + 0x20]
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], 1
jmp 0x1001faa1
mov dword [esp + 0x1c], 1
mov dword [esp + 0x14], 1
jmp 0x1001faa1
lea ecx, [esp + 0x28]
call fcn.1001f810
cmp dword [esp + 0x14], 0
jne 0x1001fa0b
cmp eax, 2
jne 0x1001fa06
lea ecx, [esp + 0x28]
call fcn.1001f810
mov esi, dword [esp + 0x2c]
mov edx, eax
test edx, edx
je 0x1001fa71
mov ecx, esi
sub ecx, ebx
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [esi], al
inc esi
mov dword [esp + 0x2c], esi
sub edx, 1
jne 0x1001f9f3
jmp 0x1001fa71
sub eax, 3
jmp 0x1001fa0e
sub eax, 2
mov ecx, dword [esp + 0x28]
mov ebx, eax
shl ebx, 8
movzx eax, byte [ecx]
inc ecx
add ebx, eax
mov dword [esp + 0x28], ecx
lea ecx, [esp + 0x28]
mov dword [esp + 0x18], ebx
call fcn.1001f810
mov ecx, eax
cmp ebx, 0x7d00
jb 0x1001fa39
inc ecx
mov esi, dword [esp + 0x2c]
lea eax, [ecx + 1]
cmp ebx, 0x500
cmovb eax, ecx
cmp ebx, 0x80
lea edx, [eax + 2]
cmovae edx, eax
test edx, edx
je 0x1001fa71
mov eax, esi
sub eax, ebx
nop dword [eax]
mov cl, byte [eax]
lea eax, [eax + 1]
mov byte [esi], cl
inc esi
mov dword [esp + 0x2c], esi
sub edx, 1
jne 0x1001fa60
mov edi, dword [esp + 0x34]
mov edx, dword [esp + 0x30]
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x14], 1
jmp 0x1001fa9d
mov al, byte [ecx]
mov byte [esi], al
inc esi
inc ecx
mov dword [esp + 0x28], ecx
mov dword [esp + 0x14], 0
mov dword [esp + 0x2c], esi
mov dword [esp + 0x10], esi
cmp dword [esp + 0x1c], 0
mov ebx, dword [esp + 0x18]
je 0x1001f8a8
sub esi, dword [esp + 0x24]
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret