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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0x40
mov edi, dword [ebp + 8]
mov eax, dword [0x4b5040]
xor eax, ebp
mov dword [esp + 0x38], eax
xor ecx, ecx
inc ecx
xor eax, eax
lock cmpxchg dword [edi], ecx
sete bl
jne 0x4135ba
mov ecx, dword [esp + 0x38]
xor ecx, ebp
call fcn.00461246
mov eax, ebx
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
xor eax, eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x30], eax
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov ecx, 0x863
mov eax, 0x7bd05af7
mov esi, dword [esp + 0x30]
mov edx, dword [esp + 0x34]
mov edi, esi
cmp esi, eax
mov esi, edx
mov eax, edx
sbb eax, ecx
mov eax, dword [0x4b9b84]
mov dword [esp + 4], eax
mov eax, dword [0x4b9b80]
mov dword [esp + 8], eax
jge 0x413679
mov eax, edi
mov ecx, 0xf4240
mul ecx
imul ecx, esi, 0xf4240
add ecx, edx
push dword [esp + 4]
push dword [esp + 0xc]
push ecx
push eax
call fcn.0047e5a0
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], edx
mov edi, dword [ebp + 8]
mov eax, dword [esp + 0x30]
sub eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x34]
sbb ecx, dword [esp + 0x2c]
seto dl
mov esi, ecx
sar esi, 0x1f
test dl, dl
cmovne eax, esi
add esi, 0x80000000
test dl, dl
cmove esi, ecx
mov ecx, 0x3e7
cmp ecx, eax
mov eax, 0
sbb eax, esi
jl 0x41364e
push 0
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [edi]
cmp eax, 1
jne 0x4134ac
mov ecx, dword [fcn.00457fc0]
cmp ecx, 0x45ce90
je 0x4134c1
call dword [0x4b1788]
lea eax, [esp + 0x30]
push eax
call ecx
add esp, 4
jmp 0x413535
call dword [0x4b1788]
lea eax, [esp + 0x28]
push eax
call ecx
add esp, 4
jmp 0x413584
mov eax, dword [edi]
cmp eax, 1
jne 0x4134ac
xor eax, eax
dec eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x28], eax
mov ecx, dword [fcn.00457fc0]
cmp ecx, 0x45ce90
jne 0x4135a8
xor eax, eax
lea esi, [esp + 0x30]
mov dword [esi + 4], eax
mov dword [esi], eax
push esi
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov ecx, dword [esi]
mov edx, dword [esi + 4]
mov eax, 0x7bd05af7
mov esi, ecx
cmp ecx, eax
mov ecx, edx
mov eax, edx
mov edx, 0x863
sbb eax, edx
mov eax, dword [0x4b9b84]
mov dword [esp + 4], eax
mov eax, dword [0x4b9b80]
mov dword [esp + 8], eax
jge 0x413701
mov edx, 0xf4240
mov eax, esi
mul edx
imul ecx, ecx, 0xf4240
add ecx, edx
push dword [esp + 4]
push dword [esp + 0xc]
push ecx
push eax
call fcn.0047e5a0
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], edx
jmp 0x413584
mov dword [esp + 0x24], 0
mov dword [esp + 0x20], 0x3e8
sub esp, 8
movsd xmm0, qword [esp + 0x28]
movsd qword [esp], xmm0
call fcn.00496a70
add esp, 8
jmp 0x413579
push dword [esp + 4]
push dword [esp + 0xc]
mov dword [esp + 0x18], esi
push esi
mov dword [esp + 0x18], edi
push edi
call fcn.0047e5a0
mov edi, edx
mov ecx, eax
mov dword [esp + 0x18], eax
mov esi, dword [esp + 8]
mul esi
imul ecx, dword [esp + 4]
add edx, ecx
mov ecx, edi
imul edi, edi, 0xf4240
mov dword [esp + 0x14], edi
imul ecx, esi
add ecx, edx
mov edi, dword [esp + 0xc]
sub edi, eax
mov esi, dword [esp + 0x10]
sbb esi, ecx
mov ecx, 0xf4240
mov eax, dword [esp + 0x18]
mul ecx
mov dword [esp + 0x10], eax
add edx, dword [esp + 0x14]
mov dword [esp + 0xc], edx
mov eax, edi
mul ecx
imul ecx, esi, 0xf4240
add edx, ecx
push dword [esp + 4]
push dword [esp + 0xc]
push edx
push eax
call fcn.0047e5a0
add eax, dword [esp + 0x10]
adc edx, dword [esp + 0xc]
jmp 0x41352a
push dword [esp + 4]
push dword [esp + 0xc]
mov dword [esp + 0x1c], ecx
push ecx
mov dword [esp + 0x1c], esi
push esi
call fcn.0047e5a0
mov dword [esp + 0xc], eax
mov ecx, edx
mov esi, dword [esp + 8]
mul esi
mov dword [esp + 0x1c], eax
mov eax, esi
mov esi, dword [esp + 0xc]
imul esi, dword [esp + 4]
add edx, esi
imul esi, ecx, 0xf4240
mov dword [esp + 0x18], esi
imul ecx, eax
add ecx, edx
mov eax, dword [esp + 0x1c]
sub dword [esp + 0x10], eax
mov esi, dword [esp + 0x14]
sbb esi, ecx
mov ecx, 0xf4240
mov eax, dword [esp + 0xc]
mul ecx
mov dword [esp + 0xc], eax
add edx, dword [esp + 0x18]
mov dword [esp + 0x14], edx
mov eax, dword [esp + 0x10]
mul ecx
imul ecx, esi, 0xf4240
add edx, ecx
push dword [esp + 4]
push dword [esp + 0xc]
push edx
push eax
call fcn.0047e5a0
add eax, dword [esp + 0xc]
adc edx, dword [esp + 0x14]
jmp 0x413641