Function at 0x509380
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 [0x644040]
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 0x509ba2
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 0x5095a9
mov eax, esi
not eax
mov ecx, edx
xor ecx, 0x7fffffff
or ecx, eax
mov dword [esp + 0x20], edi
je 0x50955f
mov ecx, dword [0x646080]
cmp ecx, 0x552d10
jne 0x50958c
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 0x509c82
mov ecx, 0xf4240
mov eax, ebx
mul ecx
imul ecx, esi, 0xf4240
add ecx, edx
push dword [0x6496cc]
push dword [0x6496c8]
push ecx
push eax
call fcn.00586340
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, 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
je 0x50951a
push 0
mov esi, 0x3e8
push esi
push dword [esp + 0x14]
mov edi, dword [esp + 0x10]
push edi
call fcn.005825e0
mov ecx, eax
mov ebx, edx
mul esi
imul esi, ebx, 0x3e8
add esi, edx
cmp eax, edi
sbb esi, dword [esp + 0xc]
mov esi, dword [esp + 0x14]
adc ecx, 0
adc ebx, 0
neg ebx
mov edi, 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 edi
test eax, eax
jne 0x509873
mov bl, 1
mov eax, dword [esp + 0x20]
cmp byte [eax + 0x14], 0
je 0x509573
cmp byte [esp + 0xa0], 1
je 0x50960a
mov ecx, dword [esp + 0xc8]
xor ecx, ebp
call fcn.00565ea5
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 0x5094ad
mov dword [esp + 0xc4], 0x1aa
mov al, byte [0x6495f6]
test al, al
je 0x509537
jmp 0x509c3c
call dword [0x63e1cc]
lea esi, [esp + 0xb8]
push esi
call ecx
add esp, 4
mov eax, dword [esi]
mov ebx, dword [esi + 4]
jmp 0x50947f
lea esi, [esp + 0x60]
push 0x40
push str.waitable_event.cc
push str.TimedWait
push esi
call fcn.0050b300
add esp, 0x10
cmp byte [esp + 0xa0], 1
je 0x509bc2
lea ecx, [esp + 0x70]
push 1
push 0
call fcn.00522210
mov dword [esp + 0xb4], 0xa
mov al, byte [0x649456]
test al, al
jne 0x509bd6
mov byte [esp + 0xa0], 1
mov esi, dword [esp + 0x14]
mov edx, dword [esp + 8]
jmp 0x509405
mov dword [esp + 0xb8], 0xa
mov al, byte [0x649456]
test al, al
jne 0x509c05
call fcn.00562bf5
mov eax, dword [eax]
mov dword [esp + 0x14], eax
call fcn.00562bf5
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 0x5096b8
cmp dword [esp + 0x74], 0
jne 0x5096b8
cmp byte [esi + 0x11], 1
jne 0x5096b8
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 0x509933
xor eax, eax
mov dword [esi + 0x1c], eax
mov dword [esi + 0x18], eax
cmp byte [esi + 0x2b], 0
jne 0x5096a8
mov eax, dword [esi + 0x20]
cmp byte [esi + 0x29], 1
je 0x509942
dec dword [eax + 0xb0]
cmp byte [esi + 0x11], 0
je 0x509c2d
cmp byte [esi + 0x10], 0
je 0x50973f
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.00562bf5
mov ecx, dword [esp + 0x14]
mov dword [eax], ecx
cmp byte [esp + 0x98], 1
jne 0x5096df
mov eax, dword [esp + 0x90]
test eax, eax
jne 0x509757
mov eax, dword [esp + 0x78]
test eax, eax
je 0x5096ed
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 + 0x64c810]
bt edx, ecx
jb 0x509b75
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 + 0x64c810]
bt edx, ecx
jae 0x509545
push eax
call fcn.004ff570
add esp, 4
jmp 0x509545
mov ecx, dword [esi + 0x20]
cmp byte [esi + 0x2a], 1
je 0x509b83
dec dword [ecx + 0xb4]
jmp 0x5096a8
mov dword [esp + 0x14], eax
mov ecx, dword [fcn.0055f760]
cmp ecx, 0x552d10
mov dword [esp + 0xc], ebx
jne 0x50983c
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 0x509d31
mov ecx, 0xf4240
mov eax, edi
mul ecx
imul ecx, esi, 0xf4240
add ecx, edx
push dword [0x6496cc]
push dword [0x6496c8]
push ecx
push eax
call fcn.00586340
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 0x509977
mov esi, dword [esp + 0x90]
test esi, esi
mov ebx, dword [esp + 0xc]
je 0x5096df
lock dec dword [esi]
jne 0x5096df
jmp 0x509b8d
call dword [0x63e1cc]
lea esi, [esp + 0xb8]
push esi
call ecx
add esp, 4
mov eax, dword [esi]
mov edx, dword [esi + 4]
jmp 0x5097d3
call dword [0x63e1cc]
lea eax, [esp + 0x60]
push eax
call ecx
add esp, 4
mov eax, dword [esp + 0x60]
mov edx, dword [esp + 0x64]
jmp 0x5098e0
cmp eax, 0x102
jne 0x509d0b
mov ecx, dword [0x646080]
cmp ecx, 0x552d10
jne 0x509859
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 0x509dc2
mov eax, ebx
mov ecx, 0xf4240
mul ecx
imul ecx, edi, 0xf4240
add ecx, edx
push dword [0x6496cc]
push dword [0x6496c8]
push ecx
push eax
call fcn.00586340
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 0x5094b7
xor ebx, ebx
jmp 0x509537
push dword [esp + 8]
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
jmp 0x509673
mov ecx, dword [eax + 0x5c]
mov edx, dword [eax + 0xa0]
dec edx
mov dword [eax + 0xa0], edx
cmp ecx, dword [eax + 0x60]
je 0x50995f
cmp dword [eax + 0xa8], edx
jae 0x50996a
mov word [eax + 0x78], 0
jmp 0x509694
movzx ecx, word [ecx + 8]
mov word [eax + 0x78], cx
jmp 0x509694
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 0x509e7b
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 0x509e5b
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 [0x62dcc0]
sub esp, 8
movsd qword [esp], xmm0
call fcn.0058f820
add esp, 8
fstp qword [esp + 0x30]
movsd xmm0, qword [esp + 0x30]
xor ecx, ecx
movsd xmm1, qword [0x62e2f0]
ucomisd xmm0, xmm1
mov eax, 0x7fffffff
cmovb eax, ecx
movsd xmm2, qword [0x62e2f8]
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 0x509abc
movsd xmm0, qword [0x62e300]
jmp 0x509aca
movsd xmm0, qword [esp + 0x40]
divsd xmm0, qword [0x62dcc0]
sub esp, 8
movsd qword [esp], xmm0
call fcn.0058f91d
add esp, 8
fstp qword [esp + 0x38]
movsd xmm0, qword [esp + 0x38]
movsd xmm1, qword [0x62e2f0]
ucomisd xmm0, xmm1
mov eax, 0
cmovb edi, eax
movsd xmm2, qword [0x62e2f8]
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 0x509e4c
cmp ebx, edi
jge 0x509b47
mov eax, dword [esp + 0x14]
inc dword [eax + ebx*4 + 8]
inc ebx
cmp edi, ebx
jne 0x509b3a
push dword [esp + 8]
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
cmp esi, 0x3d
jl 0x50981b
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 0x509b0f
jmp 0x50981b
push eax
call fcn.004ff570
add esp, 4
jmp 0x50970b
call fcn.00590760
jmp 0x5096a8
mov ecx, esi
call fcn.00411f10
push esi
call fcn.00562bc0
add esp, 4
jmp 0x5096df
mov ecx, dword [esp + 0x18]
call fcn.004f2d00
mov ebx, eax
mov ecx, dword [esp + 0xc8]
xor ecx, ebp
call fcn.00565ea5
mov eax, ebx
jmp 0x509555
lea ebx, [esp + 0x70]
mov ecx, ebx
call fcn.00535ef0
mov byte [ebx + 0x30], 0
jmp 0x5095d0
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.005b6120
add esp, 8
jmp 0x5095f5
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.0058fbc0
add esp, 0x10
jmp 0x509622
push str....._third_partylibc_srcincludeoptional:795:_assertion_this__has_value___failed:_optional_operator_called_on_a_disengaged_value_n
push 0x622e92
call fcn.0058fdd0
movzx eax, al
mov ecx, dword [0x648794]
mov edx, dword [esp + 0x18]
xor edx, dword [0x648790]
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.005c03d0
add esp, 0x14
jmp 0x509537
mov eax, dword [0x6496c8]
mov dword [esp + 0xc], eax
mov ecx, dword [0x6496cc]
mov dword [esp + 4], ecx
push ecx
push eax
push esi
push ebx
call fcn.00586340
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.00586340
mov ebx, edx
add eax, dword [esp + 0x10]
adc ebx, dword [esp + 0x1c]
jmp 0x50947f
mov ecx, esi
xor edx, edx
dec edx
xor ecx, edx
mov edx, dword [esp + 8]
mov esi, 0x7fffffff
xor edx, esi
or edx, ecx
jne 0x50987e
mov ecx, eax
call fcn.005c0340
jmp 0x50987e
mov eax, dword [0x6496c8]
mov dword [esp + 8], eax
mov ecx, dword [0x6496cc]
mov dword [esp + 0x18], ecx
push ecx
push eax
push esi
push edi
call fcn.00586340
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.00586340
add eax, dword [esp + 0x20]
adc edx, dword [esp + 4]
jmp 0x5097c5
mov esi, dword [0x6496c8]
mov dword [esp + 0x28], esi
mov eax, dword [0x6496cc]
mov dword [esp + 0xc], eax
push eax
push esi
push edi
push ebx
call fcn.00586340
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.00586340
add eax, dword [esp + 4]
adc edx, dword [esp + 0x24]
jmp 0x5098e0
push dword [esp + 8]
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
jmp 0x509b36
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 + 0x62e2e0]
jmp 0x509a26
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.004f31e0
add esp, 0xc
mov ebx, dword [ebx]
test ebx, ebx
je 0x5099b5
lock dec dword [ebx]
jne 0x5099b5
mov ecx, ebx
call fcn.00411f10
push ebx
call fcn.00562bc0
add esp, 4
jmp 0x5099b5