Function at 0x507f10
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 edi, ecx
mov eax, dword [0x646040]
xor eax, ebp
mov dword [esp + 0xc8], eax
mov esi, dword [ebp + 8]
xor eax, eax
mov ecx, esi
neg ecx
mov edx, dword [ebp + 0xc]
sbb eax, edx
lea eax, [edi + 0x10]
mov dword [esp + 0x18], eax
jge 0x50873d
pcmpeqd xmm0, xmm0
movdqa xmmword [esp + 0x70], xmm0
xor eax, eax
dec eax
mov dword [esp + 0xa0], eax
mov dword [esp + 0xa4], eax
movdqa xmmword [esp + 0x90], xmm0
movdqa xmmword [esp + 0x80], xmm0
xor eax, eax
mov byte [esp + 0x70], al
mov byte [esp + 0xa0], al
cmp byte [edi + 0x14], al
mov dword [esp + 0x14], esi
mov dword [esp + 8], edx
je 0x50813d
mov eax, esi
not eax
mov ecx, edx
xor ecx, 0x7fffffff
or ecx, eax
mov dword [esp + 0x20], edi
je 0x5080f3
mov ecx, dword [0x648080]
cmp ecx, 0x5531a0
jne 0x508120
xor eax, eax
lea esi, [esp + 0x60]
mov dword [esi + 4], eax
mov dword [esi], eax
push esi
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov ebx, dword [esi]
mov esi, dword [esi + 4]
cmp ebx, 0x7bd05af7
mov eax, esi
sbb eax, 0x863
jge 0x50881d
mov ecx, 0xf4240
mov eax, ebx
mul ecx
imul ecx, esi, 0xf4240
add ecx, edx
push dword [0x64b6cc]
push dword [0x64b6c8]
push ecx
push eax
call fcn.005877d0
mov ebx, edx
mov esi, dword [esp + 0x14]
add eax, esi
adc ebx, dword [esp + 8]
seto cl
mov edx, ebx
sar edx, 0x1f
lea edi, [edx - 0x80000000]
test cl, cl
cmove edx, eax
mov dword [esp + 0x10], edx
test cl, cl
cmove edi, ebx
mov dword [esp + 0x1c], edi
mov edx, dword [esp + 8]
mov ebx, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edi, esi
mov ecx, edx
mov dword [esp + 4], edi
mov eax, edi
mov edi, esi
mov esi, ebx
xor ebx, ebx
dec ebx
xor eax, ebx
mov dword [esp + 0xc], ecx
mov edx, 0x7fffffff
xor ecx, edx
or ecx, eax
mov eax, ebx
mov ebx, esi
je 0x5080ae
push 0
mov esi, 0x3e8
push esi
push dword [esp + 0x14]
mov edi, dword [esp + 0x10]
push edi
call fcn.00583a70
mov ecx, eax
mov ebx, edx
mul esi
imul esi, ebx, 0x3e8
add esi, edx
cmp eax, edi
sbb esi, dword [esp + 0xc]
mov edi, dword [esp + 0x14]
adc ecx, 0
adc ebx, 0
neg ebx
mov ebx, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, 0
sbb eax, eax
or eax, ecx
push eax
mov eax, dword [esp + 0x1c]
push dword [eax]
call ebx
test eax, eax
jne 0x508407
mov bl, 1
mov eax, dword [esp + 0x20]
cmp byte [eax + 0x14], 0
je 0x508107
cmp byte [esp + 0xa0], 1
je 0x50819e
mov ecx, dword [esp + 0xc8]
xor ecx, ebp
call fcn.00567335
mov eax, ebx
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret 8
xor eax, eax
dec eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x1c], 0x7fffffff
jmp 0x50803d
mov dword [esp + 0xc4], 0x1aa
mov al, byte [0x64b5f6]
test al, al
je 0x5080cb
jmp 0x5087d7
call dword [0x6401dc]
lea esi, [esp + 0xb8]
push esi
call ecx
add esp, 4
mov eax, dword [esi]
mov ebx, dword [esi + 4]
jmp 0x50800f
lea esi, [esp + 0x60]
push 0x40
push str.waitable_event.cc
push str.TimedWait
push esi
call fcn.00509c60
add esp, 0x10
cmp byte [esp + 0xa0], 1
je 0x50875d
lea ecx, [esp + 0x70]
push 1
push 0
call fcn.00520c00
mov dword [esp + 0xb4], 0xa
mov al, byte [0x64b456]
test al, al
jne 0x508771
mov byte [esp + 0xa0], 1
mov esi, dword [esp + 0x14]
mov edx, dword [esp + 8]
jmp 0x507f95
mov dword [esp + 0xb8], 0xa
mov al, byte [0x64b456]
test al, al
jne 0x5087a0
call fcn.00564085
mov eax, dword [eax]
mov dword [esp + 0x14], eax
call fcn.00564085
xor esi, esi
mov dword [eax], esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov esi, dword [esp + 0x70]
test esi, esi
je 0x50824c
cmp dword [esp + 0x74], 0
jne 0x50824c
cmp byte [esi + 0x11], 1
jne 0x50824c
mov eax, dword [esi + 0x20]
add eax, 0x50
mov dword [esp + 8], eax
push eax
call dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
test al, al
je 0x5084fc
xor eax, eax
mov dword [esi + 0x1c], eax
mov dword [esi + 0x18], eax
cmp byte [esi + 0x2b], 0
jne 0x50823c
mov eax, dword [esi + 0x20]
cmp byte [esi + 0x29], 1
je 0x5084c7
dec dword [eax + 0xb0]
cmp byte [esi + 0x11], 0
je 0x5087c8
cmp byte [esi + 0x10], 0
je 0x5082d3
mov word [esi + 0x29], 0
push dword [esp + 8]
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
call fcn.00564085
mov ecx, dword [esp + 0x14]
mov dword [eax], ecx
cmp byte [esp + 0x98], 1
jne 0x508273
mov eax, dword [esp + 0x90]
test eax, eax
jne 0x5082eb
mov eax, dword [esp + 0x78]
test eax, eax
je 0x508281
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 + 0x64e810]
bt edx, ecx
jb 0x5086fb
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 + 0x64e810]
bt edx, ecx
jae 0x5080d9
push eax
call fcn.004f4f20
add esp, 4
jmp 0x5080d9
mov eax, dword [esi + 0x20]
cmp byte [esi + 0x2a], 1
je 0x508709
dec dword [eax + 0xb4]
jmp 0x50823c
mov dword [esp + 0x14], eax
mov ecx, dword [fcn.005608f0]
cmp ecx, 0x5531a0
mov dword [esp + 0xc], ebx
jne 0x5083d0
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 esi, dword [esp + 0x64]
cmp edi, 0x7bd05af7
mov eax, esi
sbb eax, 0x863
jge 0x5088df
mov ecx, 0xf4240
mov eax, edi
mul ecx
imul ecx, esi, 0xf4240
add ecx, edx
push dword [0x64b6cc]
push dword [0x64b6c8]
push ecx
push eax
call fcn.005877d0
mov dword [esp + 0xb8], eax
mov dword [esp + 0xbc], edx
mov ecx, dword [esp + 0x88]
mov edi, dword [esp + 0x8c]
mov dword [esp + 0x18], eax
mov dword [esp + 8], ecx
sub eax, ecx
mov dword [esp + 0x20], edx
mov ecx, edx
sbb ecx, edi
seto bl
mov esi, ecx
sar esi, 0x1f
test bl, bl
cmovne eax, esi
add esi, 0x80000000
test bl, bl
cmove esi, ecx
cmp eax, 0xf4240
mov ecx, esi
sbb ecx, 0
jge 0x50850b
mov esi, dword [esp + 0x90]
test esi, esi
mov ebx, dword [esp + 0xc]
je 0x508273
lock dec dword [esi]
jne 0x508273
jmp 0x5088a6
call dword [0x6401dc]
lea esi, [esp + 0xb8]
push esi
call ecx
add esp, 4
mov eax, dword [esi]
mov edx, dword [esi + 4]
jmp 0x508367
call dword [0x6401dc]
lea eax, [esp + 0x60]
push eax
call ecx
add esp, 4
mov eax, dword [esp + 0x60]
mov edx, dword [esp + 0x64]
jmp 0x508474
cmp eax, 0x102
jne 0x5088bb
mov ecx, dword [0x648080]
cmp ecx, 0x5531a0
jne 0x5083ed
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 ebx, dword [esp + 0x60]
mov edi, dword [esp + 0x64]
cmp ebx, 0x7bd05af7
mov eax, edi
sbb eax, 0x863
jge 0x508970
mov eax, ebx
mov ecx, 0xf4240
mul ecx
imul ecx, edi, 0xf4240
add ecx, edx
push dword [0x64b6cc]
push dword [0x64b6c8]
push ecx
push eax
call fcn.005877d0
mov dword [esp + 4], eax
mov ecx, dword [esp + 0x10]
sub ecx, eax
mov esi, dword [esp + 0x1c]
sbb esi, edx
seto bl
mov edi, esi
sar edi, 0x1f
test bl, bl
lea eax, [edi - 0x80000000]
mov dword [esp + 0xc], eax
cmove edi, ecx
mov ecx, dword [esp + 0xc]
test bl, bl
cmove ecx, esi
mov esi, dword [esp + 4]
cmp esi, dword [esp + 0x10]
sbb edx, dword [esp + 0x1c]
mov esi, dword [esp + 0x14]
mov ebx, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jl 0x508047
xor ebx, ebx
jmp 0x5080cb
mov ecx, dword [eax + 0x5c]
mov edx, dword [eax + 0xa0]
dec edx
mov dword [eax + 0xa0], edx
cmp ecx, dword [eax + 0x60]
je 0x5084e4
cmp dword [eax + 0xa8], edx
jae 0x5084ef
mov word [eax + 0x78], 0
jmp 0x508228
movzx ecx, word [ecx + 8]
mov word [eax + 0x78], cx
jmp 0x508228
push dword [esp + 8]
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
jmp 0x508207
mov dword [esp + 0x10], eax
mov dword [esp + 4], edi
xor eax, eax
dec eax
mov ebx, 0x3938700
mov edi, dword [esp + 0x14]
add ebx, dword [edi + 0xf8]
mov ecx, dword [edi + 0xfc]
adc ecx, 0
mov edx, 0x7fffffff
cmovno edx, ecx
cmovo ebx, eax
cmp dword [esp + 0x18], ebx
mov ecx, dword [esp + 0x20]
sbb ecx, edx
jge 0x508a39
mov eax, dword [edi + 0xf8]
mov edi, dword [edi + 0xfc]
mov edx, dword [esp + 8]
mov dword [esp + 0x18], eax
sub edx, eax
mov ebx, dword [esp + 4]
sbb ebx, edi
seto cl
mov eax, ebx
sar eax, 0x1f
test cl, cl
cmovne edx, eax
add eax, 0x80000000
test cl, cl
cmove eax, ebx
xor ecx, ecx
dec ecx
add ecx, edx
mov ebx, 0x7fffffff
adc ebx, eax
add ecx, 2
adc ebx, 0
cmp ecx, 2
sbb ebx, 0
jb 0x5089fa
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 [0x62fcc0]
sub esp, 8
movsd qword [esp], xmm0
call fcn.00590cb0
add esp, 8
fstp qword [esp + 0x30]
movsd xmm0, qword [esp + 0x30]
xor ecx, ecx
movsd xmm1, qword [0x6302f0]
ucomisd xmm0, xmm1
mov eax, 0x7fffffff
cmovb eax, ecx
movsd xmm2, qword [0x6302f8]
ucomisd xmm2, xmm0
maxsd xmm0, xmm1
cvttsd2si ebx, xmm0
cmovb ebx, eax
xor eax, eax
dec eax
mov ecx, dword [esp + 0x10]
add eax, ecx
movd xmm0, ecx
mov ecx, 0x7fffffff
adc ecx, esi
movd xmm1, esi
add eax, 2
adc ecx, 0
cmp eax, 2
sbb ecx, 0
mov edi, 0x7fffffff
punpckldq xmm0, xmm1
movq qword [esp + 0x48], xmm0
fild qword [esp + 0x48]
fstp qword [esp + 0x40]
jae 0x508650
movsd xmm0, qword [0x630300]
jmp 0x50865e
movsd xmm0, qword [esp + 0x40]
divsd xmm0, qword [0x62fcc0]
sub esp, 8
movsd qword [esp], xmm0
call fcn.00590dad
add esp, 8
fstp qword [esp + 0x38]
movsd xmm0, qword [esp + 0x38]
movsd xmm1, qword [0x6302f0]
ucomisd xmm0, xmm1
mov eax, 0
cmovb edi, eax
movsd xmm2, qword [0x6302f8]
ucomisd xmm2, xmm0
maxsd xmm0, xmm1
cvttsd2si esi, xmm0
cmovb esi, edi
add esi, ebx
cmp esi, 0x3c
mov edi, 0x3c
cmovl edi, esi
mov eax, dword [esp + 0x14]
add eax, 4
mov dword [esp + 8], eax
push eax
call dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
test al, al
je 0x5086ef
cmp ebx, edi
jge 0x5086d7
mov eax, dword [esp + 0x14]
inc dword [eax + ebx*4 + 8]
inc ebx
cmp edi, ebx
jne 0x5086ca
push dword [esp + 8]
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
cmp esi, 0x3d
jl 0x5083af
jmp 0x508a1a
push dword [esp + 8]
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
jmp 0x5086c6
push eax
call fcn.004f4f20
add esp, 4
jmp 0x50829f
dec dword [eax + 0xa4]
mov ecx, dword [eax + 0x5c]
cmp ecx, dword [eax + 0x60]
je 0x508725
mov edx, dword [eax + 0xa8]
cmp edx, dword [eax + 0xa0]
jae 0x508730
mov word [eax + 0x78], 0
jmp 0x50823c
movzx ecx, word [ecx + 8]
mov word [eax + 0x78], cx
jmp 0x50823c
mov ecx, dword [esp + 0x18]
call fcn.004f1cb0
mov ebx, eax
mov ecx, dword [esp + 0xc8]
xor ecx, ebp
call fcn.00567335
mov eax, ebx
jmp 0x5080e9
lea ebx, [esp + 0x70]
mov ecx, ebx
call fcn.0052e650
mov byte [ebx + 0x30], 0
jmp 0x508164
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.005b78d0
add esp, 8
jmp 0x508189
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.00591070
add esp, 0x10
jmp 0x5081b6
push str....._third_partylibc_srcincludeoptional:795:_assertion_this__has_value___failed:_optional_operator_called_on_a_disengaged_value_n
push 0x624e92
call fcn.005912b0
movzx eax, al
mov ecx, dword [0x64a794]
mov edx, dword [esp + 0x18]
xor edx, dword [0x64a790]
mov dword [esp + 0x64], ecx
mov dword [esp + 0x60], edx
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.005c1b30
add esp, 0x14
jmp 0x5080cb
mov eax, dword [0x64b6c8]
mov dword [esp + 0xc], eax
mov ecx, dword [0x64b6cc]
mov dword [esp + 4], ecx
push ecx
push eax
push esi
push ebx
call fcn.005877d0
mov dword [esp + 0x10], eax
mov ecx, edx
mov eax, dword [esp + 0x10]
mul dword [esp + 0xc]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x10]
mov edi, eax
imul edi, dword [esp + 4]
add edx, edi
imul edi, ecx, 0xf4240
imul ecx, dword [esp + 0xc]
add ecx, edx
sub ebx, dword [esp + 0x1c]
sbb esi, ecx
mov ecx, 0xf4240
mul ecx
mov dword [esp + 0x10], eax
add edx, edi
mov dword [esp + 0x1c], edx
mov eax, ebx
mul ecx
imul ecx, esi, 0xf4240
add edx, ecx
push dword [esp + 4]
push dword [esp + 0x10]
push edx
push eax
call fcn.005877d0
mov ebx, edx
add eax, dword [esp + 0x10]
adc ebx, dword [esp + 0x1c]
jmp 0x50800f
mov ecx, esi
call fcn.004f2270
push esi
call fcn.00564050
add esp, 4
jmp 0x508273
xor edx, edx
dec edx
xor edi, edx
mov edx, dword [esp + 8]
mov esi, 0x7fffffff
xor edx, esi
or edx, edi
jne 0x508412
mov ecx, eax
call fcn.005c1aa0
jmp 0x508412
mov eax, dword [0x64b6c8]
mov dword [esp + 8], eax
mov ecx, dword [0x64b6cc]
mov dword [esp + 0x18], ecx
push ecx
push eax
push esi
push edi
call fcn.005877d0
mov dword [esp + 0x20], eax
mov dword [esp + 0x1c], edx
mul dword [esp + 8]
mov dword [esp + 0x10], eax
mov ecx, dword [esp + 0x20]
imul ecx, dword [esp + 0x18]
add edx, ecx
mov eax, dword [esp + 0x1c]
imul ecx, eax, 0xf4240
mov dword [esp + 4], ecx
imul eax, dword [esp + 8]
add eax, edx
sub edi, dword [esp + 0x10]
sbb esi, eax
mov ecx, 0xf4240
mov eax, dword [esp + 0x20]
mul ecx
mov dword [esp + 0x20], 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 + 0x18]
push dword [esp + 0xc]
push edx
push eax
call fcn.005877d0
add eax, dword [esp + 0x20]
adc edx, dword [esp + 4]
jmp 0x508359
mov esi, dword [0x64b6c8]
mov dword [esp + 0x28], esi
mov eax, dword [0x64b6cc]
mov dword [esp + 0xc], eax
push eax
push esi
push edi
push ebx
call fcn.005877d0
mov dword [esp + 4], eax
mov ecx, edx
mov eax, dword [esp + 4]
mul esi
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 4]
mov esi, eax
imul esi, dword [esp + 0xc]
add edx, esi
imul esi, ecx, 0xf4240
mov dword [esp + 0x24], esi
mov esi, dword [esp + 0x28]
imul ecx, esi
add ecx, edx
sub ebx, dword [esp + 0x2c]
sbb edi, ecx
mov ecx, 0xf4240
mul ecx
mov dword [esp + 4], eax
add edx, dword [esp + 0x24]
mov dword [esp + 0x24], edx
mov eax, ebx
mul ecx
imul ecx, edi, 0xf4240
add edx, ecx
push dword [esp + 0xc]
push esi
push edx
push eax
call fcn.005877d0
add eax, dword [esp + 4]
adc edx, dword [esp + 0x24]
jmp 0x508474
mov eax, dword [esp + 0x18]
cmp dword [esp + 8], eax
sbb dword [esp + 4], edi
setl al
movzx eax, al
movsd xmm0, qword [eax*8 + 0x6302e0]
jmp 0x5085ba
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 0x5086a3
jmp 0x5083af
mov eax, dword [esp + 0x18]
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x20]
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.004f2190
add esp, 0xc
mov ebx, dword [ebx]
test ebx, ebx
je 0x508549
lock dec dword [ebx]
jne 0x508549
mov ecx, ebx
call fcn.004f2270
push ebx
call fcn.00564050
add esp, 4
jmp 0x508549