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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0x30
mov eax, dword [0x587040]
xor eax, ebp
mov dword [esp + 0x28], eax
mov eax, dword [0x58de04]
mov ecx, dword [0x58a36c]
mov edx, dword fs:[0x2c]
mov ecx, dword [edx + ecx*4]
cmp eax, dword [ecx + 4]
jg 0x4a52cc
mov bl, byte [ebp + 8]
mov edi, dword [0x58de00]
push edi
call dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
test al, al
je 0x4a5311
movzx esi, bl
dec esi
or esi, 1
xor ecx, ecx
inc ecx
test byte [0x58ddb0], 1
mov eax, 8
cmovne eax, ecx
xor ecx, ecx
add esi, dword [0x58ddb4]
mov dword [0x58ddb4], esi
cmovne ecx, eax
mov eax, dword [0x58ddb8]
cmp ecx, eax
je 0x4a5299
test eax, eax
je 0x4a5214
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], edi
mov ecx, dword [0x5891dc]
cmp ecx, 0x4a54b0
je 0x4a513c
call dword [0x580f64]
lea edi, [esp + 0x20]
push edi
call ecx
add esp, 4
mov eax, dword [edi]
mov edx, dword [edi + 4]
jmp 0x4a5190
xor eax, eax
lea edi, [esp + 0x20]
mov dword [edi + 4], eax
mov dword [edi], eax
push edi
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov eax, dword [edi]
mov ebx, dword [edi + 4]
cmp eax, 0x7bd05af7
mov ecx, ebx
sbb ecx, 0x863
jge 0x4a53eb
mov ecx, 0xf4240
mul ecx
imul ecx, ebx, 0xf4240
add ecx, edx
push dword [0x58de1c]
push dword [0x58de18]
push ecx
push eax
call fcn.00510ee0
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], edx
sub eax, dword [0x58de08]
sbb edx, dword [0x58de0c]
seto bl
mov ecx, edx
sar ecx, 0x1f
test bl, bl
cmovne eax, ecx
add ecx, 0x80000000
test bl, bl
cmove ecx, edx
mov edx, eax
add edx, 1
mov edi, ecx
adc edi, 0x80000000
cmp edx, 2
sbb edi, 0
mov edx, dword [0x58ddc4]
mov edi, dword [0x58ddc0]
jb 0x4a531d
add edi, eax
adc edx, ecx
seto bl
mov eax, edx
sar eax, 0x1f
lea ecx, [eax - 0x80000000]
test bl, bl
cmove eax, edi
test bl, bl
cmove ecx, edx
mov dword [0x58ddc0], eax
mov dword [0x58ddc4], ecx
push dword [0x58ddb8]
call dword [sym.imp.WINMM.dll_timeEndPeriod]
mov edi, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
mov dword [0x58ddb8], ecx
test esi, esi
je 0x4a5299
mov ecx, dword [0x5891dc]
cmp ecx, 0x4a54b0
jne 0x4a52b5
mov ebx, edi
xor eax, eax
lea esi, [esp + 0x20]
mov dword [esi + 4], eax
mov dword [esi], eax
push esi
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov edi, dword [esi]
mov esi, dword [esi + 4]
cmp edi, 0x7bd05af7
mov eax, esi
sbb eax, 0x863
jge 0x4a535f
mov ecx, 0xf4240
mov eax, edi
mul ecx
imul ecx, esi, 0xf4240
add ecx, edx
push dword [0x58de1c]
push dword [0x58de18]
push ecx
push eax
call fcn.00510ee0
mov edi, ebx
mov dword [0x58de08], eax
mov dword [0x58de0c], edx
push dword [0x58ddb8]
call dword [sym.imp.WINMM.dll_timeBeginPeriod]
push edi
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
mov ecx, dword [esp + 0x28]
xor ecx, ebp
call fcn.004ecef0
mov al, 1
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
call dword [0x580f64]
lea esi, [esp + 0x20]
push esi
call ecx
add esp, 4
mov eax, dword [esi]
mov edx, dword [esi + 4]
jmp 0x4a5282
push 0x58de04
call fcn.004ec9c1
add esp, 4
cmp dword [0x58de04], 0xffffffff
jne 0x4a50b8
push 4
call fcn.004ec94e
add esp, 4
mov esi, eax
mov ecx, eax
call fcn.004a5a70
mov dword [0x58de00], esi
push 0x58de04
call fcn.004eca3b
add esp, 4
jmp 0x4a50b8
mov ecx, edi
call fcn.004a5a80
jmp 0x4a50d0
mov dword [esp + 4], edi
xor ebx, ebx
inc ebx
add dword [esp + 4], ebx
mov dword [esp], edx
adc dword [esp], 0x80000000
mov dword [esp + 8], 0
xor ebx, ebx
inc ebx
cmp ebx, dword [esp + 4]
mov ebx, dword [esp + 8]
sbb ebx, dword [esp]
setb bl
xor edi, eax
xor edx, ecx
or edx, edi
sete dl
or dl, bl
jne 0x4a51f5
int3
mov eax, dword [0x58de18]
mov dword [esp + 0x10], eax
mov ecx, dword [0x58de1c]
mov dword [esp + 0x14], ecx
push ecx
push eax
push esi
push edi
call fcn.00510ee0
mov dword [esp], eax
mov dword [esp + 0xc], edx
mul dword [esp + 0x10]
mov dword [esp + 8], eax
mov ecx, dword [esp]
imul ecx, dword [esp + 0x14]
add edx, ecx
mov eax, dword [esp + 0xc]
imul ecx, eax, 0xf4240
mov dword [esp + 4], ecx
imul eax, dword [esp + 0x10]
add eax, edx
sub edi, dword [esp + 8]
sbb esi, eax
mov ecx, 0xf4240
mov eax, dword [esp]
mul ecx
mov dword [esp], eax
add edx, dword [esp + 4]
mov dword [esp + 4], edx
mov eax, edi
mul ecx
imul ecx, esi, 0xf4240
add edx, ecx
push dword [esp + 0x14]
push dword [esp + 0x14]
push edx
push eax
call fcn.00510ee0
add eax, dword [esp]
adc edx, dword [esp + 4]
jmp 0x4a5280
mov edi, dword [0x58de18]
mov dword [esp + 4], edi
mov ecx, dword [0x58de1c]
mov dword [esp], ecx
push ecx
push edi
push ebx
push eax
mov dword [esp + 0x1c], eax
call fcn.00510ee0
mov dword [esp + 8], eax
mov ecx, edx
mov eax, dword [esp + 8]
mul edi
mov dword [esp + 0x18], eax
mov eax, dword [esp + 8]
mov edi, eax
imul edi, dword [esp]
add edx, edi
imul edi, ecx, 0xf4240
mov dword [esp + 0x1c], edi
imul ecx, dword [esp + 4]
add ecx, edx
mov edi, dword [esp + 0xc]
sub edi, dword [esp + 0x18]
sbb ebx, ecx
mov ecx, 0xf4240
mul ecx
mov dword [esp + 8], eax
add edx, dword [esp + 0x1c]
mov dword [esp + 0xc], edx
mov eax, edi
mul ecx
imul ecx, ebx, 0xf4240
add edx, ecx
push dword [esp]
push dword [esp + 8]
push edx
push eax
call fcn.00510ee0
add eax, dword [esp + 8]
adc edx, dword [esp + 0xc]
jmp 0x4a5188