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

Disassembly:
sub esp, 0x694
push ebx
xor ebx, ebx
push ebp
push esi
mov esi, dword [esp + 0x6a4]
push edi
mov edi, ecx
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x44], ebx
mov dword [esp + 0x48], ebx
mov dword [esp + 0x3c], ebx
test esi, esi
je 0x40c57e
jle 0x40c5bf
cmp esi, 2
jle 0x40c550
cmp esi, 3
jne 0x40c5bf
mov eax, dword [esp + 0x6ac]
push ecx
push eax
lea ecx, [esp + 0x24]
call fcn.0040b959
jmp 0x40c5bf
mov eax, dword [edi + 4]
cmp esi, 2
mov edx, dword [eax + 0x19c]
lea eax, [esp + 0x1c]
mov dword [esp + 0x64], eax
lea eax, [esp + 0x60]
push eax
push ecx
mov dword [esp + 0x68], edx
sete byte [esp + 0x70]
mov dword [esp + 0x74], ebx
call fcn.00421252
jmp 0x40c5bf
lea ecx, [esp + 0x88]
call fcn.004166c6
push 0x14
lea edi, [esp + 0x268]
pop ebp
push edi
lea ecx, [esp + 0x20]
call fcn.0040baa5
add edi, 0x2d
dec ebp
jne 0x40c594
push 0x614
lea eax, [esp + 0x8c]
push ebx
push eax
call dword [0x9d14f0]
mov edi, dword [esp + 0x30]
add esp, 0xc
mov ecx, dword [edi + 4]
push 1
lea eax, [esp + 0x20]
push eax
call fcn.0042c30f
cmp dword [esp + 0x20], ebx
jne 0x40c5dd
mov byte [esp + 0x16], bl
jmp 0x40c904
mov ebp, ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x18], ebp
call fcn.0040beb2
mov dword [esp + 0x4c], eax
cmp esi, 3
jne 0x40c605
push ecx
push ebx
push 0x14
pop edx
lea ecx, [esp + 0x7c]
call fcn.0040dd27
jmp 0x40c616
push 0x14
push eax
lea eax, [esp + 0x7c]
push eax
call dword [0x9d14ec]
add esp, 0xc
mov esi, dword [esp + 0x2c]
push 4
cmp esi, 1
pop ecx
cmovl ecx, dword [esp + 0x20]
cmp dword [esp + 0x20], 0
mov byte [esp + 0x16], bl
mov dword [esp + 0x34], ecx
mov dword [esp + 0x50], ebx
jle 0x40c890
mov eax, ebp
imul eax, eax, 0x14
mov dword [esp + 0x58], eax
mov esi, ebx
mov dword [esp + 0x54], ebx
test ecx, ecx
jle 0x40c88c
mov ecx, dword [edi + 4]
call fcn.0042c466
test al, al
je 0x40c88c
mov edi, dword [esp + 0x1c]
add edi, esi
mov dword [esp + 0x38], edi
mov esi, ebx
test ebp, ebp
je 0x40c6a7
mov ebp, dword [esp + 0x30]
mov ebx, dword [esp + 0x18]
lea eax, [edi + 8]
mov dword [esp + 0x40], eax
mov edi, eax
push 0x14
push ebp
push edi
call dword [0x9d14f4]
add esp, 0xc
test eax, eax
je 0x40c69d
inc esi
add ebp, 0x14
cmp esi, ebx
jb 0x40c684
mov edi, dword [esp + 0x38]
mov ebp, dword [esp + 0x18]
xor ebx, ebx
cmp esi, ebp
jne 0x40c861
cmp ebp, 0x96
jae 0x40c888
mov esi, dword [esp + 0x58]
lea ecx, [esp + 0x30]
lea edx, [esi + 0x14]
call fcn.0041012c
test al, al
je 0x40c6f1
push 0x14
lea eax, [edi + 8]
push eax
mov eax, dword [esp + 0x38]
add eax, esi
push eax
call dword [0x9d14ec]
add esp, 0xc
inc ebp
add esi, 0x14
mov dword [esp + 0x18], ebp
mov dword [esp + 0x58], esi
lea esi, [edi + 8]
push esi
lea ecx, [esp + 0x2c]
mov dword [esp + 0x60], esi
call fcn.0040bd3e
test eax, eax
jns 0x40c861
mov ecx, esi
call fcn.0040bef6
test al, al
jne 0x40c861
push edi
lea ecx, [esp + 0x2c]
call fcn.0040b8d0
test al, al
jne 0x40c861
or ebp, 0xffffffff
cmp dword [esp + 0x2c], 0x32
jl 0x40c74d
push dword [esp + 0x4c]
lea ecx, [esp + 0x2c]
push esi
call fcn.0040bc9d
mov ebp, eax
test ebp, ebp
js 0x40c85d
mov eax, dword [esp + 0x24]
mov eax, dword [eax + 4]
mov esi, dword [eax + 0x180]
call fcn.0040dca3
xor edx, edx
mov ecx, 0xfa0
div ecx
lea eax, [esp + 0x44]
add edx, 0x1388
push edx
push eax
push ecx
push edi
mov ecx, esi
call fcn.004292f6
cmp eax, 1
jl 0x40c85d
dec dword [esp + 0x34]
call fcn.004247f4
xor ecx, ecx
test al, al
mov eax, dword [esp + 0x24]
setne cl
mov eax, dword [eax + 4]
mov eax, dword [eax + 0x190]
mov dword [esp + 0x38], eax
lea esi, [eax + 0x28]
push esi
mov dword [esp + 0x44], ecx
call dword [0x9d1258]
mov eax, dword [esp + 0x38]
cmp dword [eax + 8], ebx
jbe 0x40c7c8
mov byte [esp + 0x17], 1
cmp dword [eax + 0x18], ebx
ja 0x40c7cc
mov byte [esp + 0x17], bl
push esi
call dword [0x9d1254]
cmp byte [esp + 0x17], 0
mov ecx, dword [esp + 0x40]
sete al
mov byte [esp + 0x70], al
test ecx, ecx
jne 0x40c7eb
test al, al
je 0x40c808
mov eax, dword [esp + 0x24]
push 0x1388
push ecx
push dword [esp + 0x78]
mov ecx, dword [eax + 4]
push edi
mov ecx, dword [ecx + 0x180]
call fcn.00429247
test ebp, ebp
jns 0x40c81a
push 1
push edi
lea ecx, [esp + 0x30]
call fcn.0040ba4a
jmp 0x40c826
push ecx
push edi
push ebp
lea ecx, [esp + 0x34]
call fcn.0040bb45
test al, al
je 0x40c85d
mov esi, dword [esp + 0x6ac]
mov byte [esp + 0x16], 1
test esi, esi
je 0x40c849
push dword [esp + 0x5c]
mov ecx, esi
call fcn.0040bd3e
test eax, eax
jns 0x40c85d
lea ecx, [esp + 0x28]
call fcn.0040b7ee
inc dword [esp + 0x3c]
mov dword [esp + 0x6ac], ebx
mov ebp, dword [esp + 0x18]
mov edx, dword [esp + 0x50]
mov esi, dword [esp + 0x54]
mov edi, dword [esp + 0x24]
inc edx
add esi, 0x38
mov dword [esp + 0x50], edx
mov dword [esp + 0x54], esi
cmp edx, dword [esp + 0x20]
jge 0x40c88c
mov ecx, dword [esp + 0x34]
jmp 0x40c64b
mov edi, dword [esp + 0x24]
mov esi, dword [esp + 0x2c]
mov ecx, dword [esp + 0x1c]
call fcn.004101e7
mov eax, dword [esp + 0x44]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x48]
xor ecx, ecx
mov dword [esp + 0x20], eax
call fcn.004101e7
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x60], eax
lea eax, [esp + 0x60]
push eax
push 0x9db935
push 0x38
push dword [esp + 0x2c]
mov dword [esp + 0x54], ebx
push dword [esp + 0x2c]
mov dword [esp + 0x5c], ebx
mov byte [esp + 0x78], 1
call fcn.0043bd40
add esp, 0x14
cmp byte [esp + 0x16], 1
je 0x40c61a
mov ecx, dword [esp + 0x30]
call fcn.004101e7
mov eax, dword [esp + 0x3c]
mov ebx, dword [esp + 0x28]
test eax, eax
setg byte [esp + 0x16]
xor ecx, ecx
call fcn.004101e7
mov ecx, dword [esp + 0x1c]
call fcn.004101e7
mov ecx, ebx
call fcn.004101e7
mov al, byte [esp + 0x16]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x694
ret 8