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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x6c
movaps xmm0, xmmword [0x4ba420]
mov eax, dword [ebp + 8]
movups xmmword [esp + 0x34], xmm0
push ebx
movaps xmm0, xmmword [0x4ba420]
mov eax, dword [eax]
mov dword [esp + 0x14], ecx
mov ecx, dword [ebp + 0xc]
movups xmmword [esp + 0x4c], xmm0
push esi
movaps xmm0, xmmword [0x4ba420]
push edi
shr ecx, 1
mov dword [esp + 0x18], edx
mov dword [esp + 0x3c], eax
mov dword [esp + 0x50], eax
mov dword [esp + 0x28], eax
movups xmmword [esp + 0x2c], xmm0
call fcn.00403d5e
mov ebx, eax
xor edx, edx
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x10], ebx
lea ecx, [ebx + ebx]
div ecx
inc eax
mov dword [esp + 0xc], eax
lea edi, [eax + 8]
mov eax, dword [ebp + 8]
lea edi, [edi + ebx*2]
add edi, dword [ebp + 0xc]
cmp dword [eax + 8], 0xffffffff
jg 0x407f8f
mov edx, eax
lea ecx, [esp + 0x3c]
call fcn.00401e56
xor esi, esi
mov ebx, esi
jmp 0x408075
xor esi, esi
mov ecx, esi
mov dword [esp + 0x14], esi
lea ebx, [ecx + edi]
add ebx, dword [eax + 8]
lea ecx, [esp + 0x50]
push 6
mov edx, ebx
mov dword [esp + 0x28], ebx
call fcn.00406e95
pop ecx
push 1
push 0x3fffffff
or edx, 0xffffffff
lea ecx, [esp + 0x58]
call fcn.004037e0
mov eax, dword [esp + 0x44]
lea edx, [esp + 0x44]
push esi
push esi
mov dword [esp + 0x74], eax
lea ecx, [esp + 0x74]
push ebx
lea eax, [esp + 0x64]
mov dword [esp + 0x7c], esi
push eax
mov eax, dword [ebp + 8]
push eax
mov dword [esp + 0x88], 0x80000000
mov dword [esp + 0x8c], esi
mov dword [esp + 0x90], esi
call fcn.00403aa4
add esp, 0x1c
lea edx, [esp + 0x64]
lea ecx, [esp + 0x20]
push 1
call fcn.00404aa7
mov eax, dword [esp + 0x68]
pop ecx
test eax, eax
je 0x40802e
cmp dword [esp + 0x74], esi
je 0x40802e
push esi
push dword [esp + 0x78]
push dword [eax]
call dword [eax + 4]
add esp, 0xc
mov ebx, dword [esp + 0x20]
test ebx, ebx
je 0x408072
mov eax, dword [esp + 0x44]
cmp eax, 0x80000000
je 0x40804e
mov ecx, dword [esp + 0x24]
add ecx, eax
lea eax, [edi - 1]
cmp ecx, eax
jge 0x408072
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x44]
inc eax
imul eax, eax, 3
neg ecx
cdq
sub eax, edx
sar eax, 1
cmp ecx, eax
cmovle ecx, eax
mov eax, dword [ebp + 8]
mov dword [esp + 0x14], ecx
jmp 0x407f97
and ebx, 3
mov eax, dword [esp + 0x40]
push esi
mov dword [esp + 0x24], eax
lea eax, [esp + 0x40]
push edi
push eax
mov edx, eax
mov dword [esp + 0x20], ebx
mov ecx, eax
call fcn.00403633
mov edx, dword [esp + 0x1c]
lea ecx, [esp + 0x48]
add esp, 0xc
neg edx
add edx, edx
push 1
push 0x3fffffff
call fcn.004037e0
push esi
push 1
lea ecx, [esp + 0x38]
call fcn.00401cfa
add esp, 0x10
cmp dword [esp + 0xc], 1
jl 0x408155
mov ebx, dword [esp + 0xc]
lea eax, [ebx + ebx]
mov dword [esp + 0xc], eax
dec eax
lea ecx, [esp + 0x50]
cdq
push edx
push eax
call fcn.00401cfa
mov eax, dword [esp + 0x14]
push 1
cdq
push 0x3fffffff
push edx
lea edx, [esp + 0x64]
push eax
mov ecx, edx
call fcn.004043d3
push 0x4038e7
push esi
lea eax, [esp + 0x70]
push edi
push eax
lea edx, [esp + 0x64]
mov ecx, eax
call fcn.0040431d
push esi
lea eax, [esp + 0x7c]
lea edx, [esp + 0x54]
push edi
push eax
mov ecx, edx
call fcn.00403633
xor dword [esp + 0x60], 1
add esp, 0x34
cmp ebx, 1
je 0x408140
push esi
push edi
lea edx, [esp + 0x30]
push esi
push 1
mov ecx, edx
call fcn.004044ad
add esp, 0x10
mov eax, dword [esp + 0xc]
dec ebx
sub eax, 2
mov dword [esp + 0xc], eax
cmp ebx, 1
jge 0x4080d1
mov ebx, dword [esp + 0x14]
lea ecx, [esp + 0x50]
call fcn.00401c6c
cmp dword [esp + 0x10], 0
jle 0x4081c7
mov ebx, dword [esp + 0x10]
push esi
lea eax, [esp + 0x2c]
push edi
push eax
mov edx, eax
lea ecx, [esp + 0x48]
call fcn.00403633
add esp, 0xc
lea ecx, [esp + 0x28]
xor edx, edx
inc edx
push 1
push 0x3fffffff
call fcn.004037e0
push 0x402b46
push esi
lea eax, [esp + 0x4c]
lea edx, [esp + 0x38]
push edi
push eax
mov ecx, edx
call fcn.0040431d
xor edx, edx
lea ecx, [esp + 0x40]
push 1
push 0x3fffffff
inc edx
call fcn.004037e0
add esp, 0x20
sub ebx, 1
jne 0x408169
mov ebx, dword [esp + 0x14]
lea ecx, [esp + 0x3c]
call fcn.00401c6c
mov eax, dword [esp + 0x18]
test eax, eax
je 0x408212
lea edx, [esp + 0x28]
mov ecx, eax
test bl, 1
jne 0x4081f6
push esi
push edi
push esi
push 1
call fcn.004044ad
mov edx, dword [esp + 0x28]
add esp, 0x10
jmp 0x40820b
push edi
call fcn.00407e65
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x24]
xor eax, 1
pop ecx
mov dword [edx + 4], eax
mov eax, ebx
shr eax, 1
xor dword [edx + 4], eax
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x40824f
lea edx, [esp + 0x28]
mov ecx, eax
test bl, 1
jne 0x408239
push edi
call fcn.00407e65
mov eax, dword [esp + 0x24]
pop ecx
mov ecx, dword [esp + 0x1c]
mov dword [ecx + 4], eax
jmp 0x40824a
push esi
push edi
push esi
push 1
call fcn.004044ad
mov ecx, dword [esp + 0x2c]
add esp, 0x10
shr ebx, 1
xor dword [ecx + 4], ebx
lea ecx, [esp + 0x28]
call fcn.00401c6c
push 0x10
pop eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret