Function at 0x40bc90
Capabilities:
Check for time delay via queryperformancecounter

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
mov eax, dword [0x454004]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
mov esi, dword [ebp + 0x10]
push edi
mov edi, edx
mov dword [ebp - 0x40], ecx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x20], 0
test edi, edi
jne 0x40bccf
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00423c62
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x270]
mov eax, dword [eax + 0x64]
test eax, eax
je 0x40bcf5
push eax
call fcn.004314bf
fdiv qword [0x451a28]
add esp, 4
fstp qword [ebp - 0x2c]
movsd xmm0, qword [ebp - 0x2c]
jmp 0x40bcfd
movsd xmm0, qword [0x451a38]
mov edx, dword [esi]
mov ecx, ebx
movsd qword [ebp - 0x2c], xmm0
call fcn.004093e0
xorps xmm0, xmm0
mov ebx, eax
movups xmmword [ebp - 0x3c], xmm0
mov dword [ebp - 0x18], ebx
movsd xmm0, qword [0x456938]
ucomisd xmm0, qword [0x4519e8]
lahf
test ah, 0x44
jp 0x40bd64
lea eax, [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
mov edx, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x14]
call fcn.00443fa0
movsd xmm1, qword [0x451a20]
divsd xmm1, xmm0
ucomisd xmm1, qword [0x4519e8]
movsd qword [0x456938], xmm1
lahf
test ah, 0x44
jnp 0x40bdb0
lea eax, [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov edx, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x14]
call fcn.00443fa0
mulsd xmm0, qword [0x456938]
movsd qword [ebp - 0x14], xmm0
call fcn.00443ef0
mov ecx, eax
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], edx
call fcn.00444000
movsd xmm1, qword [ebp - 0x14]
subsd xmm1, xmm0
mulsd xmm1, qword [0x451a30]
cvttsd2si eax, xmm1
mov dword [ebp - 0x34], eax
mov eax, dword [edi + 0x270]
cmp dword [eax], 0
jne 0x40bf49
nop
mov ebx, dword [esi]
cmp ebx, dword [ebp + 0xc]
jge 0x40bf46
cmp dword [ebp - 0x18], 0
jne 0x40bf46
mov eax, dword [ebp - 0x34]
sub eax, dword [edi + 0x2b8]
mov ecx, dword [ebp - 0x3c]
sub ecx, dword [edi + 0x2b0]
mov edx, dword [ebp - 0x38]
sbb edx, dword [edi + 0x2b4]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
mulsd xmm0, qword [0x451a00]
movsd qword [ebp - 0x4c], xmm0
call fcn.00444000
movsd xmm1, qword [ebp - 0x4c]
movsd xmm2, qword [ebp - 0x2c]
addsd xmm1, xmm0
comisd xmm2, xmm1
jae 0x40be2b
xorps xmm0, xmm0
comisd xmm0, xmm2
jbe 0x40bf4f
mov eax, dword [ebp + 0xc]
sub esp, 8
mov ecx, dword [ebp - 0x40]
sub eax, ebx
mov edx, edi
movsd qword [esp], xmm2
push eax
mov eax, dword [ebp - 0x1c]
add eax, ebx
push eax
call fcn.00408270
add esp, 0x10
mov dword [ebp - 0x20], eax
test eax, eax
jle 0x40bf58
add dword [esi], eax
mov edx, dword [esi]
cmp edx, dword [ebp + 0xc]
jg 0x40bf30
mov ecx, dword [ebp - 0x1c]
call fcn.004093e0
movsd xmm0, qword [ebp - 0x2c]
xorps xmm1, xmm1
comisd xmm0, xmm1
mov ebx, eax
mov dword [ebp - 0x18], eax
jbe 0x40bf1f
xorps xmm0, xmm0
movups xmmword [ebp - 0x3c], xmm0
movsd xmm0, qword [0x456938]
ucomisd xmm0, xmm1
lahf
test ah, 0x44
jp 0x40bed3
lea eax, [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
mov edx, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x14]
call fcn.00443fa0
movsd xmm1, qword [0x451a20]
divsd xmm1, xmm0
ucomisd xmm1, qword [0x4519e8]
movsd qword [0x456938], xmm1
lahf
test ah, 0x44
jnp 0x40bf1f
lea eax, [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov edx, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x14]
call fcn.00443fa0
mulsd xmm0, qword [0x456938]
movsd qword [ebp - 0x4c], xmm0
call fcn.00443ef0
mov ecx, eax
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], edx
call fcn.00444000
movsd xmm1, qword [ebp - 0x4c]
subsd xmm1, xmm0
mulsd xmm1, qword [0x451a30]
cvttsd2si eax, xmm1
mov dword [ebp - 0x34], eax
mov eax, dword [edi + 0x270]
cmp dword [eax], 0
je 0x40bdc0
jmp 0x40bf49
mov eax, 0xfffffffe
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00423c62
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 0x18]
test ebx, ebx
jg 0x40bf5b
jmp 0x40bf52
mov ebx, dword [ebp - 0x18]
cmp dword [ebp - 0x20], 0
jg 0x40bf5b
or ebx, 0xffffffff
mov ecx, dword [ebp - 8]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00423c62
mov esp, ebp
pop ebp
ret