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

Disassembly:
sub esp, 0x24
mov eax, dword [0x4eac74]
xor eax, esp
mov dword [esp + 0x1c], eax
push ebx
push ebp
mov ebp, ecx
push esi
push edi
mov eax, dword [ebp + 0x2a3d8]
push eax
mov ecx, dword [eax]
call dword [ecx + 0xc]
test eax, eax
jns 0x4380cc
cmp eax, 0x88760868
je 0x43854c
cmp eax, 0x88760869
jne 0x43854e
cmp dword [ebp + 0x2a384], 0
je 0x4380b2
mov edi, dword [ebp + 0x2a380]
lea eax, [ebp + 0x430]
mov edx, dword [ebp + 0x2a3d4]
imul ebx, edi, 0x438c
mov esi, dword [edx]
add eax, ebx
push eax
push edi
push edx
call dword [esi + 0x20]
mov eax, dword [ebx + ebp + 0x43c]
mov dword [ebp + 0x2a3a0], eax
mov ecx, ebp
call fcn.004370f0
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x1c]
xor ecx, esp
call fcn.00495a90
add esp, 0x24
ret
cmp dword [0x501350], 0
jne 0x438110
lea eax, [esp + 0x10]
mov dword [0x501350], 1
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
mov esi, eax
mov dword [0x501360], esi
test esi, esi
je 0x43818f
mov ecx, dword [esp + 0x10]
mov dword [0x501328], ecx
mov ecx, dword [esp + 0x14]
mov dword [0x50132c], ecx
jmp 0x438116
mov esi, dword [0x501360]
test esi, esi
je 0x43818f
mov edi, dword [0x501340]
mov eax, edi
mov ebx, dword [0x501344]
or eax, ebx
je 0x438132
mov ecx, edi
mov edx, ebx
jmp 0x438157
lea eax, [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
mov esi, dword [0x501360]
mov ebx, dword [0x501344]
mov edi, dword [0x501340]
sub ecx, dword [0x501338]
sbb edx, dword [0x50133c]
call fcn.004b98a0
mov edx, dword [0x50132c]
mov ecx, dword [0x501328]
movsd qword [esp + 0x18], xmm0
call fcn.004b98a0
movsd xmm1, qword [esp + 0x18]
divsd xmm1, xmm0
cvtpd2ps xmm0, xmm1
jmp 0x4381e4
movsd xmm0, qword [0x501368]
xorps xmm1, xmm1
ucomisd xmm0, xmm1
lahf
test ah, 0x44
jp 0x4381cc
call dword [sym.imp.WINMM.dll_timeGetTime]
mov esi, dword [0x501360]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x4e02c0]
mulsd xmm0, qword [0x4dfed8]
subsd xmm0, qword [0x501348]
mov ebx, dword [0x501344]
mov edi, dword [0x501340]
cvtpd2ps xmm0, xmm0
cmp dword [0x501350], 0
movss dword [esp + 0x10], xmm0
jne 0x438236
lea eax, [esp + 0x18]
mov dword [0x501350], 1
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
mov esi, eax
mov dword [0x501360], esi
test esi, esi
je 0x43829d
mov eax, dword [esp + 0x18]
mov ebx, dword [0x501344]
mov edi, dword [0x501340]
mov dword [0x501328], eax
mov eax, dword [esp + 0x1c]
mov dword [0x50132c], eax
test esi, esi
je 0x43829d
mov eax, edi
or eax, ebx
jne 0x438253
lea eax, [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov ebx, dword [esp + 0x1c]
mov edi, dword [esp + 0x18]
mov ecx, edi
mov edx, ebx
sub ecx, dword [0x501358]
mov dword [0x501358], edi
sbb edx, dword [0x50135c]
mov dword [0x50135c], ebx
call fcn.004b98a0
mov edx, dword [0x50132c]
mov ecx, dword [0x501328]
movsd qword [esp + 0x18], xmm0
call fcn.004b98a0
movsd xmm1, qword [esp + 0x18]
mov esi, dword [sym.imp.WINMM.dll_timeGetTime]
divsd xmm1, xmm0
jmp 0x4382e9
movsd xmm0, qword [0x501368]
xorps xmm1, xmm1
mov esi, dword [sym.imp.WINMM.dll_timeGetTime]
ucomisd xmm0, xmm1
lahf
test ah, 0x44
jp 0x4382d6
call esi
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x4e02c0]
mulsd xmm0, qword [0x4dfed8]
movaps xmm1, xmm0
subsd xmm1, qword [0x501330]
movsd qword [0x501330], xmm0
cvtpd2ps xmm1, xmm1
xorps xmm0, xmm0
ucomiss xmm0, xmm1
lahf
test ah, 0x44
jp 0x438317
cmp dword [ebp + 0x2a390], 0
je 0x438320
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x1c]
xor ecx, esp
call fcn.00495a90
add esp, 0x24
ret
cmp dword [ebp + 0x2a390], 0
jne 0x438329
cmp dword [ebp + 0x2a394], 0
je 0x438359
mov eax, dword [ebp]
mov ecx, ebp
movss xmm0, dword [esp + 0x10]
movss dword [ebp + 0x2a4f8], xmm0
movss dword [ebp + 0x2a4fc], xmm1
call dword [eax + 0x14]
test eax, eax
js 0x43854e
mov dword [ebp + 0x2a394], 0
mov eax, dword [ebp]
mov ecx, ebp
call dword [eax + 0x18]
test eax, eax
js 0x43854e
cmp dword [0x501350], 0
jne 0x4383a6
lea eax, [esp + 0x18]
mov dword [0x501350], 1
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
mov dword [0x501360], eax
test eax, eax
je 0x4383ee
mov ecx, dword [esp + 0x18]
mov dword [0x501328], ecx
mov ecx, dword [esp + 0x1c]
mov dword [0x50132c], ecx
jmp 0x4383ab
mov eax, dword [0x501360]
test eax, eax
je 0x4383ee
lea eax, [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov edx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
call fcn.004b98a0
mov edx, dword [0x50132c]
mov ecx, dword [0x501328]
movsd qword [esp + 0x18], xmm0
call fcn.004b98a0
movsd xmm1, qword [esp + 0x18]
divsd xmm1, xmm0
cvtpd2ps xmm2, xmm1
jmp 0x438410
call esi
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x4e02c0]
mulsd xmm0, qword [0x4dfed8]
cvtpd2ps xmm2, xmm0
mov eax, dword [0x50131c]
movaps xmm1, xmm2
subss xmm1, dword [0x501318]
inc eax
mov dword [0x50131c], eax
comiss xmm1, dword [0x4dfef0]
jbe case.0x438502.72
movd xmm0, eax
lea edx, [esp + 0x18]
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
mov ecx, dword [ebp + 0x2a3d4]
push edx
mov dword [0x50131c], 0
push dword [ebp + 0x2a380]
addsd xmm0, qword [eax*8 + 0x4e02c0]
push ecx
movss dword [0x501318], xmm2
cvtpd2ps xmm0, xmm0
divss xmm0, xmm1
movss dword [ebp + 0x2a500], xmm0
mov eax, dword [ecx]
call dword [eax + 0x20]
cmp dword [esp + 0x24], 0x16
lea esi, [ebp + 0x2a55e]
movss xmm0, dword [ebp + 0x2a500]
mov ecx, 0x20
mov eax, 0x10
cmove eax, ecx
push eax
push dword [ebp + 0x2a4cc]
cvtps2pd xmm0, xmm0
push dword [ebp + 0x2a4c8]
sub esp, 8
movsd qword [esp], xmm0
push str._.02f_fps___dx_dx_d_
push esi
call fcn.00434190
add esp, 0x1c
cmp dword [ebp + 0x2a58c], 0
je case.0x438502.72
imul eax, dword [ebp + 0x2a380], 0x438c
lea ecx, [ebp + 4]
add ecx, eax
imul eax, dword [ecx + 0x4388], 0xca8
add ecx, eax
mov eax, dword [ecx + 0x10dc]
lea eax, [eax + eax*4]
mov eax, dword [ecx + eax*4 + 0x534]
add eax, 0xffffffb9
cmp eax, 9
ja case.0x438502.72
jmp dword [eax*4 + 0x438564]
push str.__D16_
jmp 0x438531
push str.__D15S1_
jmp 0x438531
push str.__D24X8_
jmp 0x438531
push str.__D24S8_
jmp 0x438531
push str.__D24X4S4_
jmp 0x438531
push str.__D32_
push esi
call dword [sym.imp.KERNEL32.dll_lstrcatA]
mov eax, dword [ebp + 0x2a3d8]
push 0
push 0
push 0
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x3c]
xor eax, eax
mov ecx, dword [esp + 0x2c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00495a90
add esp, 0x24
ret