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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
mov eax, dword [0x452004]
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 0x40bb5f
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00422702
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x270]
mov eax, dword [eax + 0x64]
test eax, eax
je 0x40bb85
push eax
call fcn.0042fe0f
fdiv qword [0x44f7d0]
add esp, 4
fstp qword [ebp - 0x2c]
movsd xmm0, qword [ebp - 0x2c]
jmp 0x40bb8d
movsd xmm0, qword [0x44f7e0]
mov edx, dword [esi]
mov ecx, ebx
movsd qword [ebp - 0x2c], xmm0
call fcn.00409260
xorps xmm0, xmm0
mov ebx, eax
movups xmmword [ebp - 0x3c], xmm0
mov dword [ebp - 0x18], ebx
movsd xmm0, qword [0x454918]
ucomisd xmm0, qword [0x44f790]
lahf
test ah, 0x44
jp 0x40bbf4
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.004427e0
movsd xmm1, qword [0x44f7c8]
divsd xmm1, xmm0
ucomisd xmm1, qword [0x44f790]
movsd qword [0x454918], xmm1
lahf
test ah, 0x44
jnp 0x40bc40
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.004427e0
mulsd xmm0, qword [0x454918]
movsd qword [ebp - 0x14], xmm0
call fcn.00442730
mov ecx, eax
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], edx
call fcn.00442840
movsd xmm1, qword [ebp - 0x14]
subsd xmm1, xmm0
mulsd xmm1, qword [0x44f7d8]
cvttsd2si eax, xmm1
mov dword [ebp - 0x34], eax
mov eax, dword [edi + 0x270]
cmp dword [eax], 0
jne 0x40bdd9
nop
mov ebx, dword [esi]
cmp ebx, dword [ebp + 0xc]
jge 0x40bdd6
cmp dword [ebp - 0x18], 0
jne 0x40bdd6
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 [0x44f7a8]
movsd qword [ebp - 0x4c], xmm0
call fcn.00442840
movsd xmm1, qword [ebp - 0x4c]
movsd xmm2, qword [ebp - 0x2c]
addsd xmm1, xmm0
comisd xmm2, xmm1
jae 0x40bcbb
xorps xmm0, xmm0
comisd xmm0, xmm2
jbe 0x40bddf
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.004080f0
add esp, 0x10
mov dword [ebp - 0x20], eax
test eax, eax
jle 0x40bde8
add dword [esi], eax
mov edx, dword [esi]
cmp edx, dword [ebp + 0xc]
jg 0x40bdc0
mov ecx, dword [ebp - 0x1c]
call fcn.00409260
movsd xmm0, qword [ebp - 0x2c]
xorps xmm1, xmm1
comisd xmm0, xmm1
mov ebx, eax
mov dword [ebp - 0x18], eax
jbe 0x40bdaf
xorps xmm0, xmm0
movups xmmword [ebp - 0x3c], xmm0
movsd xmm0, qword [0x454918]
ucomisd xmm0, xmm1
lahf
test ah, 0x44
jp 0x40bd63
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.004427e0
movsd xmm1, qword [0x44f7c8]
divsd xmm1, xmm0
ucomisd xmm1, qword [0x44f790]
movsd qword [0x454918], xmm1
lahf
test ah, 0x44
jnp 0x40bdaf
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.004427e0
mulsd xmm0, qword [0x454918]
movsd qword [ebp - 0x4c], xmm0
call fcn.00442730
mov ecx, eax
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], edx
call fcn.00442840
movsd xmm1, qword [ebp - 0x4c]
subsd xmm1, xmm0
mulsd xmm1, qword [0x44f7d8]
cvttsd2si eax, xmm1
mov dword [ebp - 0x34], eax
mov eax, dword [edi + 0x270]
cmp dword [eax], 0
je 0x40bc50
jmp 0x40bdd9
mov eax, 0xfffffffe
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00422702
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 0x18]
test ebx, ebx
jg 0x40bdeb
jmp 0x40bde2
mov ebx, dword [ebp - 0x18]
cmp dword [ebp - 0x20], 0
jg 0x40bdeb
or ebx, 0xffffffff
mov ecx, dword [ebp - 8]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00422702
mov esp, ebp
pop ebp
ret