Function at 0x408cc9
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x38
mov ecx, dword [esp + 0x4c]
xor edx, edx
push ebx
mov ebx, dword [esp + 0x48]
push ebp
movzx eax, byte [ecx + 0xb5d]
xor ax, word [esp + 0x48]
movzx ebp, ax
push esi
mov esi, dword [0x5afd10]
dec esi
mov dword [0x5afd10], esi
push edi
mov edi, dword [esp + 0x4c]
mov dword [esp + 0x1c], esi
mov eax, dword [ebx + edi*4]
mov dword [esp + 0x30], eax
movzx eax, byte [edi + ecx + 0xf]
add eax, dword [ebx + 0x10f4]
mov ecx, dword [0x5afd64]
mov dword [esp + 0x44], eax
mov eax, dword [0x5afd44]
mov eax, dword [eax + edi*8]
div dword [ecx + 0xc0c]
mov eax, dword [ebx]
inc edi
mov dword [esp + 0x10], edx
mov bl, 0x62
mov edx, dword [esp + 0x5c]
mov dword [esp + 0x4c], edi
mov bh, byte [ecx + edi*4 + 0x54]
movzx eax, byte [eax + edx]
mov edx, dword [esp + 0x64]
add eax, edx
mov dword [esp + 0x14], eax
dec edx
mov eax, dword [0x5afd34]
mov dword [esp + 0x20], eax
mov eax, dword [0x5afd18]
sub bh, al
inc eax
mov dword [esp + 0x64], edx
mov edx, dword [esp + 0x54]
mov dword [0x5afd18], eax
mov eax, dword [0x5afd54]
dec eax
mov dword [0x5afd54], eax
mov dword [esp + 0x24], eax
imul eax, edi, 0xc
mov edi, dword [esp + 0x58]
sub bl, byte [eax + edx + 0x80]
mov al, byte [0x5afd6c]
sub al, 0x77
mov byte [esp + 0x50], al
mov eax, dword [ecx + 0x1e04]
xor eax, dword [0x5afd38]
mov dword [esp + 0x2c], eax
mov eax, dword [0x5afd40]
inc eax
mov ecx, dword [0x5afd0c]
mov dword [0x5afd40], eax
mov eax, dword [edi + eax*4]
cdq
idiv dword [edi + 0x40d4]
mov eax, dword [esp + 0x54]
mov dword [esp + 0x28], edx
mov edx, dword [esp + 0x1c]
lea esi, [eax + esi*4]
movzx eax, byte [esp + 0x50]
add eax, 0x15a7
imul eax, dword [ecx + edx*4]
cdq
idiv dword [esi + 0x58]
dec byte [esp + 0x50]
mov dword [esi + 0x58], edx
mov esi, dword [esp + 0x10]
mov ecx, dword [0x5afd64]
movzx eax, bl
mov dword [esp + 0x18], eax
mov edx, dword [esi]
imul eax, edx, 3
movzx eax, byte [eax + 1]
or eax, dword [esp + 0x14]
add eax, dword [esi + edx*4]
mov edx, dword [esp + 0x18]
or dword [ecx + edx*4 + 4], eax
mov eax, dword [esp + 0x14]
movzx ecx, byte [esp + 0x50]
mov edx, dword [esp + 0x54]
movzx eax, byte [eax + eax + 1]
add dword [0x5afd38], eax
mov eax, dword [0x5afd64]
mov esi, dword [eax + ecx*4 + 0x68]
mov eax, dword [esp + 0x10]
inc dword [eax]
mov eax, dword [eax]
movzx ecx, word [0x5afd20]
mov edx, dword [edx + eax*4]
mov eax, dword [0x5afd64]
xor edx, 0x1107
mov ecx, dword [eax + ecx*4]
mov eax, dword [0x5afd0c]
xor ecx, dword [0x5afd28]
mov al, byte [eax + 0x76b8]
mov byte [esp + 0x34], al
lea eax, [ebp + 1]
movzx ebp, ax
movzx eax, bh
xor eax, ebp
mov dword [esp + 0x40], ebp
push eax
push 0x85c
push dword [esp + 0x3c]
push ecx
push edx
push esi
call fcn.00406ffe
mov edx, dword [esp + 0x6c]
mov ecx, dword [esp + 0x2c]
mov esi, dword [esp + 0x28]
mov dword [edx + ecx*4 + 0x2c], eax
mov eax, dword [edx]
mov ecx, dword [esi]
mov esi, dword [esp + 0x38]
mov eax, dword [edx + eax*4]
cdq
idiv dword [edi + ecx*4]
mov eax, dword [edi + 0x26f8]
imul eax, dword [esp + 0x3c]
movzx ebp, word [esi + ecx*2 + 8]
imul ecx, dword [esp + 0x30], 0xc
mov dword [esp + 0x54], edx
mov edx, dword [esp + 0x28]
mov dword [esp + 0x50], eax
sub edx, 4
mov eax, dword [0x5afd10]
mov dword [esp + 0x28], edx
mov dword [esp + 0x4c], ebp
mov ebx, dword [edi + eax*4]
mov eax, dword [0x5afd08]
mov ax, word [ecx + eax]
xor ax, word [edx + 0x16c]
mov ecx, dword [esp + 0x70]
dec byte [esp + 0x68]
movzx edi, ax
movzx eax, word [0x5afd20]
movzx ebp, byte [esp + 0x68]
mov dword [esp + 0x70], ebp
movzx esi, word [esi + eax*2]
mov eax, dword [edx]
add eax, eax
add esi, dword [ecx + eax*8]
mov eax, dword [0x5afd40]
mov ecx, dword [esp + 0x34]
add eax, eax
mov edx, dword [ecx + eax*8]
mov ecx, dword [0x5afd5c]
mov eax, dword [0x5afd04]
add ecx, ecx
push dword [eax + ecx*8 + 8]
push edx
push esi
push ebp
mov ebp, dword [esp + 0x5c]
push edi
push dword [0x5afd18]
mov edi, dword [esp + 0x84]
push ebx
mov ebx, dword [esp + 0x80]
push ebp
push dword [esp + 0x70]
push dword [esp + 0x78]
movzx eax, word [edi + ebx*4 + 0x48]
push eax
call fcn.004094c7
mov esi, dword [esp + 0x54]
add esp, 0x44
mov ecx, dword [0x5afd48]
mov edx, dword [esi]
add edx, edx
mov dword [ecx + edx*8], eax
mov eax, dword [0x5afd08]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x2c]
lea ecx, [eax + ecx*4]
mov eax, dword [esi]
mov eax, dword [edx + eax*4]
xor edx, edx
xor eax, dword [esp + 0x40]
div dword [0x5afd30]
mov eax, edx
xor edx, edx
div dword [ecx]
mov dword [ecx], eax
mov eax, dword [0x5afd00]
movzx esi, word [0x5afd6c]
dec eax
mov dword [0x5afd00], eax
cmp dword [edi + eax*4 + 0x80], esi
je 0x409002
mov ecx, dword [esp + 0x5c]
imul eax, ebx, 3
movzx edx, byte [eax + ecx]
imul ecx, dword [esp + 0x14], 0xc
mov eax, dword [0x5afd48]
cmp dword [ecx + eax], edx
je 0x409002
mov eax, dword [esp + 0x20]
mov ecx, 0x1cb2
cmp word [eax + ebx*2], cx
jb 0x409002
mov eax, dword [0x5afd3c]
mov eax, dword [eax + 0x73e4]
xor eax, dword [0x5afd1c]
mov dword [edi + esi*4], eax
mov eax, dword [0x5afd2c]
lea ecx, [edi + eax*8]
mov eax, ebx
cdq
idiv dword [ecx]
mov dword [ecx], edx
movzx ebp, word [0x5afd20]
mov ecx, dword [esp + 0x28]
imul eax, ebp, 6
movzx edx, word [eax + ecx]
mov ecx, dword [0x5afd40]
mov eax, dword [0x5afd0c]
cmp dword [eax + ecx*4], edx
je 0x4090c3
mov eax, dword [0x5afd54]
mov ecx, dword [esp + 0x30]
mov esi, dword [0x5afd10]
movzx edx, word [ecx + eax*2]
mov eax, dword [esp + 0x60]
mov ecx, dword [eax + esi*4 + 0x10]
mov eax, edx
inc esi
mov dword [0x5afd10], esi
cmp eax, ecx
jb 0x4090c3
dec dword [0x5afd34]
xor edx, edx
mov eax, dword [0x5afd54]
mov ecx, dword [esp + 0x5c]
mov esi, dword [esp + 0x10]
movzx eax, byte [eax + ecx]
div dword [esp + 0x18]
mov eax, dword [esp + 0x24]
and edx, 0xe04
add edx, dword [esp + 0x44]
or dword [edi + ebp*4], edx
mov ecx, dword [0x5afd5c]
mov word [0x5afd20], ax
mov eax, dword [esp + 0x28]
mov edi, dword [esi]
mov esi, dword [0x5afd64]
movzx ecx, word [eax + ecx*2]
mov eax, dword [esp + 0x64]
cdq
idiv ecx
xor edx, edx
xor dword [esi + edi*4], eax
mov eax, dword [esp + 0x2c]
dec dword [0x5afd5c]
lea ecx, [eax + ebx*4]
mov eax, dword [esp + 0x58]
div dword [ecx + 0x9c]
mov dword [ecx + 0x9c], eax
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x58]
pop edi
pop esi
pop ebp
movzx eax, word [eax + ecx*2]
xor eax, 0x181c
pop ebx
add esp, 0x38
ret