Function at 0x557040
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 [0x644040]
xor eax, ebp
mov dword [esp + 0x28], eax
mov eax, dword [0x6496b4]
mov ecx, dword [0x64784c]
mov edx, dword fs:[0x2c]
mov ecx, dword [edx + ecx*4]
cmp eax, dword [ecx + 4]
jg 0x557297
movzx ebx, byte [ebp + 8]
mov esi, dword [0x6496b0]
push esi
call dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
test al, al
je 0x5572d8
movzx edi, bl
dec edi
or edi, 1
add edi, dword [0x649664]
mov dword [0x649664], edi
mov ecx, 1
test byte [0x649660], 1
je 0x55728d
test edi, edi
cmove ecx, edi
mov eax, dword [0x649668]
cmp ecx, eax
je 0x55725a
test eax, eax
mov dword [esp + 0x14], esi
je 0x5571d5
mov dword [esp + 0xc], ecx
mov ecx, dword [0x646080]
cmp ecx, 0x5536d0
je 0x5570fd
call dword [0x63e19c]
lea esi, [esp + 0x20]
push esi
call ecx
add esp, 4
mov eax, dword [esi]
mov edx, dword [esi + 4]
jmp 0x557151
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 eax, dword [esi]
mov ebx, dword [esi + 4]
cmp eax, 0x7bd05af7
mov ecx, ebx
sbb ecx, 0x863
jge 0x5573a4
mov ecx, 0xf4240
mul ecx
imul ecx, ebx, 0xf4240
add ecx, edx
push dword [0x6496cc]
push dword [0x6496c8]
push ecx
push eax
call fcn.005866e0
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], edx
sub eax, dword [0x6496b8]
sbb edx, dword [0x6496bc]
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 esi, ecx
adc esi, 0x80000000
cmp edx, 2
sbb esi, 0
mov edx, dword [0x649674]
mov esi, dword [0x649670]
jb 0x5572e4
add esi, eax
adc edx, ecx
seto bl
mov eax, edx
sar eax, 0x1f
lea ecx, [eax - 0x80000000]
test bl, bl
cmove eax, esi
test bl, bl
cmove ecx, edx
mov dword [0x649670], eax
mov dword [0x649674], ecx
push dword [0x649668]
call dword [sym.imp.WINMM.dll_timeEndPeriod]
mov esi, dword [esp + 0x14]
mov ecx, dword [esp + 0xc]
mov dword [0x649668], ecx
test edi, edi
je 0x55725a
mov ecx, dword [0x646080]
cmp ecx, 0x5536d0
jne 0x557276
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 esi, dword [edi]
mov ebx, dword [edi + 4]
cmp esi, 0x7bd05af7
mov eax, ebx
sbb eax, 0x863
jge 0x557327
mov ecx, 0xf4240
mov eax, esi
mul ecx
imul ecx, ebx, 0xf4240
add ecx, edx
push dword [0x6496cc]
push dword [0x6496c8]
push ecx
push eax
call fcn.005866e0
mov dword [0x6496b8], eax
mov dword [0x6496bc], edx
push dword [0x649668]
call dword [sym.imp.WINMM.dll_timeBeginPeriod]
mov esi, dword [esp + 0x14]
push esi
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
mov ecx, dword [esp + 0x28]
xor ecx, ebp
call fcn.00566245
mov al, 1
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
call dword [0x63e19c]
lea esi, [esp + 0x20]
push esi
call ecx
add esp, 4
mov eax, dword [esi]
mov edx, dword [esi + 4]
jmp 0x55723f
mov ecx, 8
jmp 0x5570b6
push 0x6496b4
call fcn.00562fa8
add esp, 4
cmp dword [0x6496b4], 0xffffffff
jne 0x557078
push 4
call fcn.00562f65
add esp, 4
mov dword [eax], 0
mov dword [0x6496b0], eax
push 0x6496b4
call fcn.00562ff7
add esp, 4
jmp 0x557078
push esi
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
jmp 0x557091
mov dword [esp + 8], esi
xor ebx, ebx
inc ebx
add dword [esp + 8], ebx
mov ebx, edx
adc ebx, 0x80000000
mov dword [esp + 4], ebx
mov dword [esp], 0
xor ebx, ebx
inc ebx
cmp ebx, dword [esp + 8]
mov ebx, dword [esp]
sbb ebx, dword [esp + 4]
setb bl
xor esi, eax
xor edx, ecx
or edx, esi
sete dl
or dl, bl
jne 0x5571b6
int3
mov eax, dword [0x6496c8]
mov dword [esp + 0xc], eax
mov ecx, dword [0x6496cc]
mov dword [esp + 8], ecx
push ecx
push eax
push ebx
push esi
call fcn.005866e0
mov edi, edx
mov ecx, eax
mul dword [esp + 0xc]
mov dword [esp + 4], eax
mov eax, ecx
imul ecx, dword [esp + 8]
add edx, ecx
imul ecx, edi, 0xf4240
mov dword [esp], ecx
imul edi, dword [esp + 0xc]
add edi, edx
sub esi, dword [esp + 4]
sbb ebx, edi
mov ecx, 0xf4240
mul ecx
mov dword [esp + 4], eax
mov edi, edx
add edi, dword [esp]
mov eax, esi
mul ecx
imul ecx, ebx, 0xf4240
add edx, ecx
push dword [esp + 8]
push dword [esp + 0x10]
push edx
push eax
call fcn.005866e0
add eax, dword [esp + 4]
adc edx, edi
jmp 0x55723f
mov esi, dword [0x6496c8]
mov dword [esp + 4], esi
mov ecx, dword [0x6496cc]
mov dword [esp + 8], ecx
push ecx
push esi
push ebx
push eax
mov dword [esp + 0x20], eax
call fcn.005866e0
mov dword [esp], eax
mov ecx, edx
mov eax, dword [esp]
mul esi
mov dword [esp + 0x18], eax
mov eax, dword [esp]
mov esi, eax
imul esi, dword [esp + 8]
add edx, esi
imul esi, ecx, 0xf4240
mov dword [esp + 0x1c], esi
imul ecx, dword [esp + 4]
add ecx, edx
mov esi, dword [esp + 0x10]
sub esi, dword [esp + 0x18]
sbb ebx, ecx
mov ecx, 0xf4240
mul ecx
mov dword [esp], eax
add edx, dword [esp + 0x1c]
mov dword [esp + 0x10], edx
mov eax, esi
mul ecx
imul ecx, ebx, 0xf4240
add edx, ecx
push dword [esp + 8]
push dword [esp + 8]
push edx
push eax
call fcn.005866e0
add eax, dword [esp]
adc edx, dword [esp + 0x10]
jmp 0x557149