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

Disassembly:
sub esp, 0x40
mov eax, dword [esp + 0x50]
mov ecx, dword [0x976994]
mov edx, dword [0x976990]
push ebx
mov ebx, dword [0x9769c8]
push ebp
mov ebp, dword [esp + 0x50]
push esi
mov esi, dword [esp + 0x60]
push edi
mov al, byte [eax + ebp*4]
add al, 0xb
mov di, word [0x9769ac]
mov byte [esp + 0x58], al
inc di
mov eax, dword [0x976980]
mov dword [esp + 0x34], eax
mov eax, dword [0x976984]
mov dword [esp + 0x18], eax
mov word [0x9769ac], di
mov dword [esp + 0x28], 0x1597
movzx eax, word [ecx + eax*4]
or eax, dword [ebx + ebp*8 + 0x68]
mov dword [esp + 0x3c], eax
movzx eax, di
inc di
mov dword [esp + 0x10], eax
imul eax, edx, 0xc
mov word [0x9769ac], di
mov eax, dword [eax + esi]
mov dword [esp + 0x20], eax
movzx eax, word [ecx + ebp*4]
mov dword [esp + 0x48], eax
mov eax, dword [0x97699c]
movzx esi, word [ecx + eax*2]
mov eax, dword [0x9769a4]
mov dword [esp + 0x1c], eax
mov eax, ebp
imul eax, dword [0x9769c4]
movzx ecx, ax
mov eax, dword [0x9769bc]
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x6c]
movzx eax, byte [eax + 0x1918]
or eax, ebp
dec edx
mov dword [esp + 0x2c], eax
movzx eax, di
mov dword [esp + 0x4c], eax
mov eax, dword [0x9769b8]
mov dword [esp + 0x40], eax
mov eax, dword [0x9769d0]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x34]
mov dword [0x976990], edx
mov edi, dword [esp + 0x2c]
movzx eax, byte [eax - 0x1ddb]
movzx ecx, byte [eax + ecx]
mov eax, dword [esp + 0x18]
movzx edx, al
mov eax, ecx
sub eax, esi
mov dword [esp + 0x38], edx
imul eax, ecx
dec ebp
mov dword [ebx + edx*4], eax
mov ecx, dword [0x976980]
mov eax, dword [0x976988]
mov ebx, dword [esp + 0x18]
mov eax, dword [eax + ecx*4]
mov ecx, dword [esp + 0x54]
cdq
idiv dword [ecx + ebp*4 + 0x14]
mov eax, dword [esp + 0x68]
mov word [0x9769ac], dx
movzx esi, byte [edi + eax + 6]
cmp esi, 0x1bae
jae 0x408cb3
mov edx, dword [esp + 0x64]
lea eax, [ebx + 1]
movzx eax, al
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x3c]
lea ecx, [edx + esi*4]
mov dword [esp + 0x30], ecx
lea eax, [eax + ebp*8]
add eax, 8
mov dword [esp + 0x68], eax
mov eax, dword [esp + 0x5c]
sub eax, edx
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x14]
mov edi, 0x72d
add dword [esp + 0x10], 2
dec ebp
movzx eax, ax
cdq
idiv ebp
sub dword [esp + 0x68], 8
mov eax, edx
cdq
idiv edi
mov edi, dword [esp + 0x10]
xor dword [ecx], eax
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x24]
movzx eax, word [eax + ebp*2]
cdq
idiv esi
movzx ecx, byte [ecx + 0x11d7]
cdq
idiv ecx
mov ecx, dword [esp + 0x64]
mov edx, dword [esp + 0x18]
xor dword [ecx + edx*4], eax
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x54]
imul edx, dword [eax + 0x25c8], 0x15a9
mov eax, dword [0x9769b8]
mov ecx, dword [ecx + eax*4]
mov eax, dword [0x9769c4]
movzx eax, word [edi + eax*4]
push eax
mov eax, dword [esp + 0x24]
push ecx
push dword [0x9769a4]
mov ecx, dword [esp + 0x24]
push edx
push esi
push dword [eax + ecx*4]
call fcn.00409f6c
mov ecx, dword [esp + 0x7c]
xor edx, edx
mov edi, dword [esp + 0x40]
push edi
push ebp
mov dword [ecx + ebp*4], eax
mov eax, dword [esp + 0x58]
mov ecx, dword [esp + 0x44]
push esi
movzx ecx, byte [eax + ecx]
mov eax, dword [esp + 0x40]
mov eax, dword [eax + 0x4060]
div ecx
mov ecx, dword [esp + 0x78]
sub edx, dword [esp + 0x38]
movzx eax, dx
mov edx, 0x154a
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x8c]
sub edx, dword [eax]
mov eax, dword [0x976980]
imul ecx, dword [ecx + eax*4 + 0x18], 0x8c
inc edi
mov dword [esp + 0x4c], edi
push ecx
push esi
push edx
call fcn.00409f6c
mov ecx, dword [0x9769c4]
add esp, 0x30
mov edx, dword [esp + 0x60]
mov edi, dword [esp + 0x2c]
mov dword [edx + ecx*4 + 4], eax
mov eax, dword [0x9769c0]
mov ecx, dword [esp + 0x30]
inc eax
mov edx, dword [esp + 0x44]
mov dword [0x9769c0], eax
cmp dword [edx + ecx], eax
jle 0x408c6e
inc esi
add ecx, 4
mov dword [esp + 0x30], ecx
cmp esi, 0x1bae
jl 0x408b46
jmp 0x408caf
mov eax, dword [esp + 0x34]
imul edx, dword [0x976980], 0xc
mov ecx, dword [esp + 0x20]
sub esi, dword [esp + 0x48]
movzx eax, byte [eax - 0x1ddb]
mov ecx, dword [ecx + eax*4]
mov eax, dword [esp + 0x5c]
sub ecx, dword [edx + eax]
mov dword [edx + eax], ecx
mov eax, esi
movzx ecx, word [0x9769ac]
xor edx, edx
dec dword [0x976980]
div ecx
mov word [0x9769ac], dx
mov ecx, dword [esp + 0x54]
mov eax, dword [0x9769c4]
dec bl
mov ebp, dword [esp + 0x6c]
mov edx, dword [esp + 0x38]
mov esi, dword [esp + 0x4c]
movzx eax, byte [eax + ebp]
cmp word [esi + edx*2], ax
jbe 0x408cf4
mov eax, dword [esp + 0x1c]
mov ecx, dword [ecx + edi*4]
mov edx, dword [esp + 0x3c]
xor ecx, edi
mov eax, dword [eax]
sub ecx, dword [edx + eax*4]
xor edx, edx
mov eax, ecx
movzx ecx, byte [esp + 0x58]
div dword [0x9769a4]
mov byte [ecx + ebp], al
movzx ecx, bl
imul eax, ecx, 0xc
mov ecx, dword [esp + 0x20]
pop edi
pop esi
pop ebp
pop ebx
mov eax, dword [eax + ecx]
add esp, 0x40
ret