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

Disassembly:
sub esp, 0x124
mov eax, dword [esp + 0x128]
mov edx, dword [esp + 0x130]
push ebx
push ebp
push esi
mov esi, ecx
mov ecx, dword [esp + 0x138]
push edi
mov word [esi + 0x61], 9
mov dword [esi + 0x71], eax
mov dword [esi + 0x75], ecx
mov dword [esi + 0x65], edx
mov byte [esi + 0x97], 0
call dword [0x4f0124]
push eax
lea eax, [esp + 0x38]
push eax
call dword [0x4f0138]
mov ecx, dword [esi + 0x71]
xor edi, edi
mov eax, dword [ecx + 0x5f33]
cmp eax, edi
je 0x40aa16
mov cl, byte [eax + 0x6c]
test cl, cl
je 0x40aa16
lea edx, [esp + 0x34]
push str._demo
push edx
call dword [0x4f01d0]
add esp, 4
push eax
call dword [0x4f021c]
add esp, 8
test eax, eax
je 0x40aa16
mov byte [esi + 0x63], 1
jmp 0x40aa1a
mov byte [esi + 0x63], 0
mov dword [esi + 0x6d], edi
mov byte [esi + 0x95], 0
mov eax, dword [0x50c8ac]
add eax, 0xffffff88
cmp eax, 0x50
ja case.0x40aa39.124
xor ecx, ecx
mov cl, byte [eax + 0x40acf4]
jmp dword [ecx*4 + 0x40acdc]
mov dword [esi + 0x69], 0x3f5c28f6
jmp 0x40aa6b
mov dword [esi + 0x69], 0x3f4ccccd
jmp 0x40aa6b
mov dword [esi + 0x69], 0x3f333333
jmp 0x40aa6b
mov dword [esi + 0x69], 0x3f000000
jmp 0x40aa6b
mov dword [esi + 0x69], 0x3f800000
mov edx, dword [esi + 0x71]
mov byte [esi + 0x54], 0
mov dword [esi + 0x50], edi
mov dword [esi + 0x91], edi
mov ebp, dword [edx + 0x5e30]
xor eax, eax
mov dword [esp + 0x18], ebp
mov ecx, dword [ebp + 0x1d72]
mov ebx, dword [ebp + 0x68]
cmp ecx, edi
mov dword [esp + 0x1c], ebx
jle 0x40aaac
lea edx, [ebp + 0x1d76]
cmp word [edx], 0x39
je 0x40aafc
inc eax
add edx, 0x1a
cmp eax, ecx
jl 0x40aa9e
xor eax, eax
lea edi, [esi + 0x2b8]
push eax
mov ecx, edi
call fcn.0040a210
xor eax, eax
cmp ebx, eax
mov dword [esi + 0x122c], eax
mov dword [esp + 0x14], eax
jle 0x40abd0
lea ecx, [ebp + 0xa0]
mov dword [esp + 0x10], ecx
mov cl, byte [eax + ebp + 0x8a0]
test cl, cl
jne 0x40abb4
test eax, eax
jl 0x40ab0b
cmp eax, 0x200
jge 0x40ab0b
mov edx, dword [esp + 0x10]
mov ebx, dword [edx]
jmp 0x40ab0d
lea ecx, [eax + eax*2]
lea edx, [eax + ecx*4]
mov eax, dword [ebp + edx*2 + 0x1d8c]
jmp 0x40aaae
xor ebx, ebx
mov cl, byte [ebx + 0x188e]
test cl, cl
jne 0x40abb4
cmp word [ebx + 0x36b], 0x39
jne 0x40abb4
mov ecx, dword [edi + 0x4c]
mov edx, dword [edi + 0x50]
dec ecx
cmp edx, ecx
jle 0x40ab98
push str.AIComputer:_VUnitArray::AddUnit___Error_occurs.
push edi
mov dword [0x8210d4], 1
call fcn.004331c0
mov edx, dword [edi + 0x50]
lea eax, [edx*4 + 4]
push eax
call fcn.004eccce
mov ecx, dword [edi + 0x4c]
mov ebp, eax
add esp, 0xc
xor eax, eax
test ecx, ecx
jle 0x40ab7a
mov ecx, dword [edi + 0x48]
inc eax
mov edx, dword [ecx + eax*4 - 4]
mov dword [ebp + eax*4 - 4], edx
mov ecx, dword [edi + 0x4c]
cmp eax, ecx
jl 0x40ab67
mov eax, dword [edi + 0x48]
push eax
call fcn.004eccc8
mov eax, dword [edi + 0x4c]
add esp, 4
inc eax
mov dword [edi + 0x48], ebp
mov ebp, dword [esp + 0x18]
mov dword [edi + 0x4c], eax
mov eax, dword [esp + 0x14]
mov ecx, dword [edi + 0x50]
mov edx, dword [edi + 0x48]
mov dword [edx + ecx*4], ebx
mov ecx, dword [edi + 0x50]
inc ecx
mov dword [edi + 0x50], ecx
mov ecx, dword [ebx + 0x18ac]
add dword [esi + 0x122c], ecx
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x1c]
inc eax
add edx, 4
cmp eax, ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], edx
jl 0x40aada
mov ecx, dword [esi + 0x75]
push 1
call fcn.00498bd0
mov edx, dword [esi + 0x71]
mov dword [esi + 0x1230], eax
mov eax, 0x66666667
mov dword [esp + 0x18], 5
mov ecx, dword [edx + 0x5f47]
mov edx, dword [ecx + 0x74]
mov ecx, dword [ecx + 0x78]
imul edx
sar edx, 1
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, 0x66666667
mov edi, edx
imul ecx
sar edx, 1
mov ecx, edx
mov dword [esp + 0x20], edi
shr ecx, 0x1f
add edx, ecx
mov eax, edx
mov dword [esp + 0x24], eax
cdq
sub eax, edx
mov ebp, eax
mov eax, edi
cdq
sub eax, edx
lea edx, [esi + 0x98]
sar ebp, 1
mov edi, eax
mov dword [esp + 0x1c], ebp
sar edi, 1
mov dword [esp + 0x10], edx
jmp 0x40ac47
mov ebp, dword [esp + 0x1c]
mov ebx, dword [esp + 0x10]
mov dword [esp + 0x14], 5
mov eax, dword [esi + 0x71]
push ebp
lea edx, [esp + 0x2c]
push edi
mov ecx, dword [eax + 0x5f47]
push edx
call fcn.004afa90
mov edx, dword [eax]
mov ecx, ebx
add ebx, 0x3c
mov dword [ecx], edx
mov edx, dword [eax + 4]
mov dword [ecx + 4], edx
mov eax, dword [eax + 8]
mov edx, dword [esp + 0x24]
mov dword [ecx + 8], eax
mov eax, dword [esp + 0x14]
add ebp, edx
dec eax
mov dword [esp + 0x14], eax
jne 0x40ac53
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x18]
add edi, edx
add ecx, 0xc
dec eax
mov dword [esp + 0x10], ecx
mov dword [esp + 0x18], eax
jne 0x40ac43
lea ecx, [esi + 0x264]
call fcn.00409f50
lea ecx, [esi + 0x214]
call fcn.00409f50
lea ecx, [esi + 0x1c4]
call fcn.00409f50
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x124
ret 0xc