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

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 8]
sub esp, 0xc
push ebx
push esi
push edi
test eax, eax
jne 0x4d9f59
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x4d9f60
cmp eax, 0x7fffffff
jbe 0x4d9f79
call fcn.0040ebd0
test eax, eax
jne 0x4da328
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret
call fcn.004d9850
mov esi, dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov dword [ebp - 4], eax
mov ebx, dword [sym.imp.WINMM.dll_timeBeginPeriod]
xor edi, edi
xorps xmm0, xmm0
movlpd qword [ebp - 0xc], xmm0
cmp dword [0x683558], edi
je 0x4d9fb0
nop
push 0
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [0x683558], edi
jne 0x4d9fa0
mov dword [0x683570], 1
cmp dword [0x683554], edi
jne 0x4da199
mov dword [0x683558], 1
cmp dword [0x683578], edi
jne 0x4da000
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
call fcn.004eeadb
add esp, 4
call fcn.004eeaba
cdq
mov ecx, 0x36ee80
idiv ecx
mov eax, 0x2932e00
sub eax, edx
mov dword [0x683578], eax
push 0x683568
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
test eax, eax
jne 0x4da079
xorps xmm0, xmm0
movlpd qword [0x683568], xmm0
cmp dword [0x683574], edi
jne 0x4da0d5
cmp dword [0x68357c], edi
jne 0x4da0d5
mov dword [0x68357c], 1
push str.:9:TimeGetTime___initialization:_No_performance_counter_exists_
mov dword [0x683558], edi
mov dword [0x683570], edi
mov dword [0x683574], 1
call fcn.00424fd0
add esp, 4
mov dword [0x683570], 1
mov dword [0x683574], edi
call fcn.004d9850
jmp 0x4da308
mov eax, dword [0x68356c]
test eax, eax
jl 0x4da0ca
mov ecx, dword [0x683568]
jg 0x4da09c
cmp ecx, 0x3e8
jb 0x4da0ca
test eax, eax
jl 0x4da0d5
jg 0x4da09c
test ecx, ecx
je 0x4da0d5
lea eax, [ebp - 0xc]
push eax
call esi
test eax, eax
jne 0x4da0d5
cmp dword [0x683580], edi
jne 0x4da0ca
mov dword [0x683580], 1
cmp dword [0x683574], edi
jne 0x4da0ca
push str.:8:QueryPerformanceCounter___FAILED_to_initialize_in_TimeGetTime___initialization_
jmp 0x4da041
xorps xmm0, xmm0
movlpd qword [0x683568], xmm0
mov esi, 1
push esi
call ebx
test eax, eax
je 0x4da0f6
cmp esi, 0xa
jae 0x4da0f6
cmp dword [0x683574], edi
je 0x4da126
inc esi
push esi
call ebx
test eax, eax
jne 0x4da0e1
cmp dword [0x68356c], edi
jl 0x4da169
jg 0x4da108
cmp dword [0x683568], edi
jbe 0x4da169
mov esi, dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
push 0x683560
call esi
test eax, eax
jne 0x4da16f
xorps xmm0, xmm0
movlpd qword [0x683568], xmm0
jmp 0x4da16f
push str._GetLastError_
push esi
push str.:8:QueryPerformanceCounter___FAILED_to_set_timeGetTime___granularity:_timeBeginPeriod__d__failed:_trying_one_higher:__s
mov dword [0x683574], 1
mov dword [0x683570], edi
mov dword [0x683558], edi
call fcn.00424fd0
add esp, 0xc
mov dword [0x683570], 1
mov dword [0x683574], edi
call fcn.004d9850
jmp 0x4da302
mov esi, dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
push 1
call ebx
xorps xmm0, xmm0
movlpd qword [0x683568], xmm0
call dword [sym.imp.WINMM.dll_timeGetTime]
mov dword [0x68355c], eax
mov dword [0x683554], 1
mov dword [0x683558], edi
mov eax, dword [0x68356c]
test eax, eax
jl 0x4da2c8
jg 0x4da1b6
mov ebx, dword [0x683568]
test ebx, ebx
je 0x4da2ce
lea eax, [ebp - 0xc]
push eax
call esi
test eax, eax
jne 0x4da217
cmp dword [0x683584], edi
jne 0x4da27f
mov dword [0x683584], 1
cmp dword [0x683574], edi
jne 0x4da201
push str.:9:QueryPerformanceCounter___FAILED_______________________
mov dword [0x683574], 1
mov dword [0x683570], edi
call fcn.00424a90
add esp, 4
mov dword [0x683574], edi
mov dword [0x683554], edi
mov dword [0x683570], edi
call fcn.004d9850
jmp 0x4da308
mov ecx, dword [0x68356c]
mov ebx, dword [0x683568]
test ecx, ecx
jg 0x4da296
jl 0x4da231
cmp ebx, 0x3e8
jae 0x4da296
mov eax, ebx
or eax, ecx
je 0x4da296
cmp dword [0x683588], edi
jne 0x4da27f
mov dword [0x683588], 1
cmp dword [0x683574], edi
jne 0x4da27f
push ebx
push str.:9:TimeGetTime___has_encountered_a_serious_exception:_the_performance_frequency_counter_has_a_resolution_of_only__d_milliseconds______This_is_too_low_to_be_of_any_use_
mov dword [0x683574], 1
mov dword [0x683570], edi
call fcn.00424a90
add esp, 8
mov dword [0x683570], 1
mov dword [0x683574], edi
xorps xmm0, xmm0
movlpd qword [0x683568], xmm0
mov ebx, dword [0x683568]
mov ecx, dword [0x68356c]
mov edi, dword [ebp - 0xc]
sub edi, dword [0x683560]
mov esi, dword [ebp - 8]
sbb esi, dword [0x683564]
push 0
push 0x3e8
push ecx
push ebx
call fcn.004e57b0
push edx
push eax
push esi
push edi
call fcn.004e57b0
mov edi, eax
mov eax, dword [0x68356c]
jmp 0x4da2ce
mov ebx, dword [0x683568]
or ebx, eax
jne 0x4da2f1
call dword [sym.imp.WINMM.dll_timeGetTime]
mov ecx, dword [0x68355c]
mov edi, eax
cmp ecx, edi
jae 0x4da2ed
or eax, 0xffffffff
sub eax, ecx
add edi, eax
jmp 0x4da2f1
sub ecx, edi
mov edi, ecx
mov eax, dword [0x683578]
mov dword [0x683570], 0
add eax, edi
mov esi, dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov ebx, dword [ebp - 4]
sub eax, ebx
cmp eax, dword [ebp + 8]
jae 0x4da331
call fcn.0040ebd0
test eax, eax
jne 0x4da328
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x4d9f87
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
call fcn.004d9850
pop edi
pop esi
sub eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret