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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0xd0
mov eax, dword [0x644040]
xor eax, ebp
mov dword [esp + 0xc8], eax
mov esi, dword [ebp + 8]
mov edi, dword [ebp + 0xc]
xor eax, eax
mov edx, esi
neg edx
mov dword [esp + 0x14], edi
sbb eax, edi
jge 0x541518
pcmpeqd xmm0, xmm0
movdqa xmmword [esp + 0x70], xmm0
movdqa xmmword [esp + 0x90], xmm0
movdqa xmmword [esp + 0x80], xmm0
mov dword [esp + 0xa0], 0xffffffff
mov dword [esp + 0xa4], 0xffffffff
mov byte [esp + 0x70], 0
mov byte [esp + 0xa0], 0
cmp byte [ecx + 4], 0
mov dword [esp + 0x10], ecx
je 0x540e11
mov eax, esi
not eax
mov ecx, dword [esp + 0x14]
xor ecx, 0x7fffffff
or ecx, eax
mov dword [esp + 0x20], esi
je 0x540e6e
mov ecx, dword [0x646080]
cmp ecx, 0x522100
jne 0x540e80
mov dword [esp + 0x64], 0
mov dword [esp + 0x60], 0
lea eax, [esp + 0x60]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov edi, dword [esp + 0x60]
mov esi, dword [esp + 0x64]
cmp edi, 0x7bd05af7
mov eax, esi
sbb eax, 0x863
jge 0x54161a
mov ecx, 0xf4240
mov eax, edi
mul ecx
imul ecx, esi, 0xf4240
add ecx, edx
push dword [0x6496bc]
push dword [0x6496b8]
push ecx
push eax
call fcn.00588630
mov esi, dword [esp + 0x20]
jmp 0x540ea1
mov ebx, esi
lea esi, [esp + 0x60]
push 0x24
push str.waitable_event.cc
push str.TimedWait
push esi
call fcn.005068d0
add esp, 0x10
cmp byte [esp + 0xa0], 0
jne 0x541534
lea ecx, [esp + 0x70]
push 1
push 0
call fcn.00520200
mov dword [esp + 0xb4], 0xa
mov al, byte [0x649446]
test al, al
jne 0x541572
mov byte [esp + 0xa0], 1
mov esi, ebx
jmp 0x540d82
mov dword [esp + 8], 0xffffffff
mov dword [esp + 0xc], 0x7fffffff
jmp 0x540ec7
call dword [0x63e63c]
lea eax, [esp + 0xb8]
push eax
call ecx
add esp, 4
mov eax, dword [esp + 0xb8]
mov edx, dword [esp + 0xbc]
add eax, esi
adc edx, dword [esp + 0x14]
seto cl
mov edi, edx
sar edi, 0x1f
lea ebx, [edi - 0x80000000]
test cl, cl
cmove edi, eax
mov dword [esp + 8], edi
test cl, cl
cmove ebx, edx
mov dword [esp + 0xc], ebx
mov edi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ebx, dword [esp + 0x14]
mov eax, esi
mov ecx, 0xffffffff
xor eax, ecx
mov ecx, ebx
mov edx, 0x7fffffff
xor ecx, edx
or ecx, eax
je 0x540f61
push 0
push 0x3e8
mov dword [esp + 0x20], ebx
push ebx
push esi
call fcn.005848d0
mov ecx, eax
mov edi, edx
mov edx, 0x3e8
mul edx
imul ebx, edi, 0x3e8
add ebx, edx
cmp eax, esi
sbb ebx, dword [esp + 0x18]
adc ecx, 0
adc edi, 0
jne 0x5412a5
mov esi, dword [esp + 0x10]
mov edi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push ecx
push dword [esi]
call edi
test eax, eax
jne 0x540f85
mov bl, 1
cmp byte [esi + 4], 0
je 0x540f6c
cmp byte [esp + 0xa0], 0
jne 0x541056
mov ecx, dword [esp + 0xc8]
xor ecx, ebp
call fcn.00568175
mov eax, ebx
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret 8
mov ecx, 0xffffffff
mov esi, dword [esp + 0x10]
jmp 0x540f28
mov dword [esp + 0xc4], 0x1a8
mov al, byte [0x6495e4]
test al, al
je 0x540f39
jmp 0x5415d8
cmp eax, 0x102
jne 0x541548
mov ecx, dword [0x646080]
cmp ecx, 0x522100
je 0x540ffd
call dword [0x63e63c]
lea eax, [esp + 0x60]
push eax
call ecx
add esp, 4
mov eax, dword [esp + 0x60]
mov edx, dword [esp + 0x64]
mov dword [esp + 0x18], eax
mov ecx, dword [esp + 8]
sub ecx, eax
mov edi, dword [esp + 0xc]
sbb edi, edx
seto al
mov esi, edi
sar esi, 0x1f
test al, al
lea ebx, [esi - 0x80000000]
cmove esi, ecx
test al, al
cmove ebx, edi
mov eax, dword [esp + 0x18]
cmp eax, dword [esp + 8]
sbb edx, dword [esp + 0xc]
mov edi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jl 0x540ed1
xor ebx, ebx
jmp 0x540f39
xor eax, eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x60], eax
lea eax, [esp + 0x60]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov edi, dword [esp + 0x60]
mov ebx, dword [esp + 0x64]
cmp edi, 0x7bd05af7
mov eax, ebx
sbb eax, 0x863
jge 0x5416bd
mov eax, edi
mov ecx, 0xf4240
mul ecx
imul ecx, ebx, 0xf4240
add ecx, edx
push dword [0x6496bc]
push dword [0x6496b8]
push ecx
push eax
call fcn.00588630
jmp 0x540fb6
mov dword [esp + 0xb8], 0xa
mov al, byte [0x649446]
test al, al
jne 0x5415a1
call fcn.00564ed5
mov eax, dword [eax]
mov dword [esp + 0x14], eax
call fcn.00564ed5
xor edi, edi
mov dword [eax], edi
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov edi, dword [esp + 0x70]
test edi, edi
je 0x541104
cmp dword [esp + 0x74], 0
jne 0x541104
cmp byte [edi + 0x11], 0
je 0x541104
mov eax, dword [edi + 0x20]
add eax, 0x50
mov dword [esp + 0x10], eax
push eax
call dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
test al, al
je 0x5412ad
xor eax, eax
mov dword [edi + 0x1c], eax
mov dword [edi + 0x18], eax
cmp byte [edi + 0x2b], 0
jne 0x5410f4
cmp byte [edi + 0x29], 0
mov eax, dword [edi + 0x20]
jne 0x5412bc
dec dword [eax + 0xb4]
cmp byte [edi + 0x11], 0
je 0x5415c9
cmp byte [edi + 0x10], 0
je 0x54118b
mov word [edi + 0x29], 0
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
call fcn.00564ed5
mov ecx, dword [esp + 0x14]
mov dword [eax], ecx
cmp byte [esp + 0x98], 0
je 0x54112b
mov eax, dword [esp + 0x90]
test eax, eax
jne 0x5411a3
mov eax, dword [esp + 0x78]
test eax, eax
je 0x541139
mov ecx, dword [esp + 0x7c]
mov dword [eax], ecx
mov eax, dword [esp + 0x74]
mov ecx, eax
shr ecx, 0xe
mov edx, eax
shr edx, 0x13
mov edx, dword [edx*4 + 0x64c804]
bt edx, ecx
jb 0x5414d6
mov dword [esp + 0x74], 0
mov eax, dword [esp + 0x70]
mov ecx, eax
shr ecx, 0xe
mov edx, eax
shr edx, 0x13
mov edx, dword [edx*4 + 0x64c804]
bt edx, ecx
jae 0x540f47
push eax
call fcn.004f0f10
add esp, 4
jmp 0x540f47
cmp byte [edi + 0x2a], 0
mov eax, dword [edi + 0x20]
jne 0x5414e4
dec dword [eax + 0xb8]
jmp 0x5410f4
mov dword [esp + 0x14], eax
mov ecx, dword [fcn.005515a0]
cmp ecx, 0x522100
mov dword [esp + 0x18], ebx
jne 0x541288
xor eax, eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x60], eax
lea eax, [esp + 0x60]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov esi, dword [esp + 0x60]
mov edi, dword [esp + 0x64]
cmp esi, 0x7bd05af7
mov eax, edi
sbb eax, 0x863
jge 0x541747
mov ecx, 0xf4240
mov eax, esi
mul ecx
imul ecx, edi, 0xf4240
add ecx, edx
push dword [0x6496bc]
push dword [0x6496b8]
push ecx
push eax
call fcn.00588630
mov dword [esp + 0xb8], eax
mov dword [esp + 0xbc], edx
mov ecx, dword [esp + 0x88]
mov esi, dword [esp + 0x8c]
mov dword [esp + 8], eax
mov dword [esp + 0x10], ecx
sub eax, ecx
mov dword [esp + 0xc], edx
mov ecx, edx
sbb ecx, esi
seto bl
mov edi, ecx
sar edi, 0x1f
test bl, bl
cmovne eax, edi
add edi, 0x80000000
test bl, bl
cmove edi, ecx
cmp eax, 0xf4240
mov ecx, edi
sbb ecx, 0
jge 0x5412f1
mov esi, dword [esp + 0x90]
test esi, esi
mov ebx, dword [esp + 0x18]
je 0x54112b
lock dec dword [esi]
jne 0x54112b
jmp 0x5416a8
call dword [0x63e63c]
lea esi, [esp + 0xb8]
push esi
call ecx
add esp, 4
mov eax, dword [esi]
mov edx, dword [esi + 4]
jmp 0x54121f
xor ecx, ecx
dec ecx
jmp 0x540f1e
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
jmp 0x5410bf
mov ecx, dword [eax + 0x5c]
mov edx, dword [eax + 0xa4]
dec edx
mov dword [eax + 0xa4], edx
cmp ecx, dword [eax + 0x60]
je 0x5412d9
cmp dword [eax + 0xac], edx
jae 0x5412e4
mov word [eax + 0x78], 0
jmp 0x5410e0
movzx ecx, word [ecx + 8]
mov word [eax + 0x78], cx
jmp 0x5410e0
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], esi
xor eax, eax
dec eax
mov ebx, 0x3938700
mov ecx, dword [esp + 0x14]
add ebx, dword [ecx + 0xf8]
mov ecx, dword [ecx + 0xfc]
adc ecx, 0
mov edx, 0x7fffffff
cmovno edx, ecx
cmovo ebx, eax
cmp dword [esp + 8], ebx
mov ecx, dword [esp + 0xc]
sbb ecx, edx
jge 0x541835
mov eax, dword [esp + 0x14]
mov ecx, dword [eax + 0xf8]
mov esi, dword [eax + 0xfc]
mov edx, dword [esp + 0x10]
mov dword [esp + 8], ecx
sub edx, ecx
mov ebx, dword [esp + 0x20]
sbb ebx, esi
seto cl
mov eax, ebx
sar eax, 0x1f
test cl, cl
cmovne edx, eax
add eax, 0x80000000
test cl, cl
cmove eax, ebx
mov ecx, 0xffffffff
add ecx, edx
mov ebx, 0x7fffffff
adc ebx, eax
add ecx, 2
adc ebx, 0
cmp ecx, 2
sbb ebx, 0
jb 0x541815
movd xmm0, edx
movd xmm1, eax
punpckldq xmm0, xmm1
movq qword [esp + 0x58], xmm0
fild qword [esp + 0x58]
fstp qword [esp + 0x50]
movsd xmm0, qword [esp + 0x50]
divsd xmm0, qword [0x62eae0]
sub esp, 8
movsd qword [esp], xmm0
call fcn.00591b10
add esp, 8
fstp qword [esp + 0x48]
movsd xmm0, qword [esp + 0x48]
movsd xmm1, qword [0x62f100]
ucomisd xmm1, xmm0
jb 0x5417e7
maxsd xmm0, qword [0x62f108]
cvttsd2si ebx, xmm0
mov ecx, 0xffffffff
mov edx, dword [esp + 0x1c]
add ecx, edx
mov eax, 0x7fffffff
adc eax, edi
add ecx, 2
adc eax, 0
movd xmm0, edx
movd xmm1, edi
cmp ecx, 2
sbb eax, 0
punpckldq xmm0, xmm1
movq qword [esp + 0x40], xmm0
fild qword [esp + 0x40]
fstp qword [esp + 0x38]
jae 0x54142a
movsd xmm0, qword [0x62f110]
jmp 0x541438
movsd xmm0, qword [esp + 0x38]
divsd xmm0, qword [0x62eae0]
sub esp, 8
movsd qword [esp], xmm0
call fcn.00591c0d
add esp, 8
fstp qword [esp + 0x30]
movsd xmm0, qword [esp + 0x30]
movsd xmm1, qword [0x62f100]
ucomisd xmm1, xmm0
jb 0x5417fe
maxsd xmm0, qword [0x62f108]
cvttsd2si esi, xmm0
add esi, ebx
cmp esi, 0x3c
mov edi, 0x3c
cmovl edi, esi
mov eax, dword [esp + 0x14]
add eax, 4
mov dword [esp + 0x10], eax
push eax
call dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
test al, al
je 0x5417d8
cmp ebx, edi
jge 0x5414a8
mov eax, dword [esp + 0x14]
inc dword [eax + ebx*4 + 8]
inc ebx
cmp edi, ebx
jne 0x54149b
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
cmp esi, 0x3d
jl 0x541267
mov eax, dword [esp + 0x14]
mov eax, dword [eax + 0x100]
sub esi, edi
xor ebx, ebx
mov dword [esp + 0x14], eax
test eax, eax
jne 0x541470
jmp 0x541267
push eax
call fcn.004f0f10
add esp, 4
jmp 0x541157
dec dword [eax + 0xa8]
mov ecx, dword [eax + 0x5c]
cmp ecx, dword [eax + 0x60]
je 0x541500
mov edx, dword [eax + 0xac]
cmp edx, dword [eax + 0xa4]
jae 0x54150b
mov word [eax + 0x78], 0
jmp 0x5410f4
movzx ecx, word [ecx + 8]
mov word [eax + 0x78], cx
jmp 0x5410f4
call fcn.005636e0
mov ebx, eax
mov ecx, dword [esp + 0xc8]
xor ecx, ebp
call fcn.00568175
mov eax, ebx
jmp 0x540f57
lea edi, [esp + 0x70]
mov ecx, edi
call fcn.005345e0
mov byte [edi + 0x30], 0
jmp 0x540e3a
mov ecx, dword [esp + 0x20]
mov edx, 0xffffffff
xor ecx, edx
mov edx, dword [esp + 0x14]
mov esi, 0x7fffffff
xor edx, esi
or edx, ecx
jne 0x540f90
mov ecx, eax
call fcn.005c4f10
jmp 0x540f90
movzx ecx, al
lea eax, [esp + 0xb8]
mov dword [eax], esi
lea esi, [esp + 0xc4]
mov dword [esi], str.ScopedBlockingCallWithBaseSyncPrimitives
lea edx, [esp + 0xb4]
push eax
push esi
call fcn.005b9160
add esp, 8
jmp 0x540e5f
movzx eax, al
mov dword [esp + 0x60], 0
lea ecx, [esp + 0xb8]
push 2
lea edx, [esp + 0x64]
push edx
push ecx
push eax
call fcn.0059d990
add esp, 0x10
jmp 0x54106e
push str....._third_partylibc_srcincludeoptional:801:_assertion_this__has_value___failed:_optional_operator_called_on_a_disengaged_value_n
push 0x624173
call fcn.00591ed0
movzx eax, al
mov ecx, dword [0x648784]
xor esi, dword [0x648780]
mov dword [esp + 0x64], ecx
mov dword [esp + 0x60], esi
lea ecx, [esp + 0xb8]
mov dword [ecx], str.WaitableEvent::Wait_Complete
lea edx, [esp + 0xc4]
lea esi, [esp + 0x60]
push esi
push 3
push ecx
push edx
push eax
call fcn.005c4fa0
add esp, 0x14
jmp 0x540f39
mov ebx, dword [0x6496b8]
mov dword [esp + 0x24], ebx
mov eax, dword [0x6496bc]
mov dword [esp + 0x18], eax
push eax
push ebx
push esi
push edi
call fcn.00588630
mov dword [esp + 8], eax
mov ecx, edx
mov eax, dword [esp + 8]
mul ebx
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 8]
mov ebx, eax
imul ebx, dword [esp + 0x18]
add edx, ebx
imul ebx, ecx, 0xf4240
mov dword [esp + 0xc], ebx
mov ebx, dword [esp + 0x24]
imul ecx, ebx
add ecx, edx
sub edi, dword [esp + 0x1c]
sbb esi, ecx
mov ecx, 0xf4240
mul ecx
mov dword [esp + 8], eax
add edx, dword [esp + 0xc]
mov dword [esp + 0xc], edx
mov eax, edi
mul ecx
imul ecx, esi, 0xf4240
add edx, ecx
push dword [esp + 0x18]
push ebx
push edx
push eax
call fcn.00588630
add eax, dword [esp + 8]
adc edx, dword [esp + 0xc]
mov esi, dword [esp + 0x20]
jmp 0x540ea1
mov ecx, esi
call fcn.004ed960
push esi
call fcn.00564ea0
add esp, 4
jmp 0x54112b
mov esi, dword [0x6496b8]
mov dword [esp + 0x28], esi
mov eax, dword [0x6496bc]
mov dword [esp + 0x18], eax
push eax
push esi
push ebx
push edi
call fcn.00588630
mov dword [esp + 0x1c], eax
mov ecx, edx
mov eax, dword [esp + 0x1c]
mul esi
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x1c]
mov esi, eax
imul esi, dword [esp + 0x18]
add edx, esi
imul esi, ecx, 0xf4240
mov dword [esp + 0x24], esi
mov esi, dword [esp + 0x28]
imul ecx, esi
add ecx, edx
sub edi, dword [esp + 0x2c]
sbb ebx, ecx
mov ecx, 0xf4240
mul ecx
mov dword [esp + 0x1c], eax
add edx, dword [esp + 0x24]
mov dword [esp + 0x24], edx
mov eax, edi
mul ecx
imul ecx, ebx, 0xf4240
add edx, ecx
push dword [esp + 0x18]
push esi
push edx
push eax
call fcn.00588630
add eax, dword [esp + 0x1c]
adc edx, dword [esp + 0x24]
jmp 0x540fb6
mov eax, dword [0x6496b8]
mov dword [esp + 0x10], eax
mov ecx, dword [0x6496bc]
mov dword [esp + 8], ecx
push ecx
push eax
push edi
push esi
call fcn.00588630
mov dword [esp + 0xc], eax
mov dword [esp + 0x24], edx
mul dword [esp + 0x10]
mov dword [esp + 0x1c], eax
mov ecx, dword [esp + 0xc]
imul ecx, dword [esp + 8]
add edx, ecx
mov eax, dword [esp + 0x24]
imul ecx, eax, 0xf4240
mov dword [esp + 0x20], ecx
imul eax, dword [esp + 0x10]
add eax, edx
sub esi, dword [esp + 0x1c]
sbb edi, eax
mov ecx, 0xf4240
mov eax, dword [esp + 0xc]
mul ecx
mov dword [esp + 0xc], eax
add edx, dword [esp + 0x20]
mov dword [esp + 0x20], edx
mov eax, esi
mul ecx
imul ecx, edi, 0xf4240
add edx, ecx
push dword [esp + 8]
push dword [esp + 0x14]
push edx
push eax
call fcn.00588630
add eax, dword [esp + 0xc]
adc edx, dword [esp + 0x20]
jmp 0x541211
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
jmp 0x541497
xor eax, eax
ucomisd xmm0, qword [0x62f108]
mov ebx, 0x7fffffff
cmovb ebx, eax
jmp 0x5413e6
xor eax, eax
ucomisd xmm0, qword [0x62f108]
mov esi, 0x7fffffff
cmovb esi, eax
jmp 0x541470
mov eax, dword [esp + 8]
cmp dword [esp + 0x10], eax
sbb dword [esp + 0x20], esi
setl al
movzx eax, al
movsd xmm0, qword [eax*8 + 0x62f0f0]
jmp 0x5413a6
mov eax, dword [esp + 8]
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0xc]
mov dword [esp + 0x64], eax
sub esp, 0xc
movq xmm0, qword [esp + 0x6c]
movq qword [esp + 4], xmm0
lea ebx, [esp + 0xd0]
mov dword [esp], ebx
call fcn.004ed880
add esp, 0xc
mov esi, dword [ebx]
test esi, esi
je 0x54132f
lock dec dword [esi]
jne 0x54132f
mov ecx, esi
call fcn.004ed960
push esi
call fcn.00564ea0
add esp, 4
jmp 0x54132f