Function at 0x502330
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 edi, dword [ebp + 8]
xor eax, eax
mov edx, edi
neg edx
mov esi, dword [ebp + 0xc]
sbb eax, esi
lea eax, [ecx + 0x10]
mov dword [esp + 8], eax
jge 0x502b1d
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 [ecx + 0x14], al
je 0x502430
mov eax, edi
not eax
mov edx, esi
xor edx, 0x7fffffff
or edx, eax
mov dword [esp + 0x28], ecx
mov dword [esp + 0x14], edi
mov dword [esp + 0x1c], esi
je 0x502491
mov ecx, dword [0x646080]
cmp ecx, 0x522100
jne 0x5024a2
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 0x502c39
mov ecx, 0xf4240
mov eax, ebx
mul ecx
imul ecx, esi, 0xf4240
add ecx, edx
push dword [0x6496bc]
push dword [0x6496b8]
push ecx
push eax
call fcn.00588630
jmp 0x5024ba
mov ebx, edi
mov edi, ecx
lea eax, [esp + 0x60]
push 0x24
push str.waitable_event.cc
push str.TimedWait
push eax
call fcn.005068d0
add esp, 0x10
cmp byte [esp + 0xa0], 0
jne 0x502b3d
lea ecx, [esp + 0x70]
push 1
push 0
call fcn.00520200
mov dword [esp + 0xb4], 0xa
mov al, byte [0x649446]
test al, al
jne 0x502bb2
mov byte [esp + 0xa0], 1
mov ecx, edi
mov edi, ebx
jmp 0x5023ab
xor eax, eax
dec eax
mov dword [esp + 0xc], eax
mov dword [esp + 0x10], 0x7fffffff
jmp 0x5024e6
call dword [0x63e63c]
lea esi, [esp + 0xb8]
push esi
call ecx
add esp, 4
mov eax, dword [esi]
mov edx, dword [esi + 4]
add eax, edi
mov esi, dword [esp + 0x1c]
adc edx, esi
seto cl
mov ebx, edx
sar ebx, 0x1f
lea edi, [ebx - 0x80000000]
test cl, cl
cmove ebx, eax
mov dword [esp + 0xc], ebx
test cl, cl
cmove edi, edx
mov dword [esp + 0x10], edi
mov edi, dword [esp + 0x14]
mov ebx, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ecx, esi
mov eax, edi
xor edx, edx
dec edx
xor eax, edx
mov dword [esp + 4], ecx
mov esi, 0x7fffffff
xor ecx, esi
or ecx, eax
mov eax, edx
je 0x502543
push 0
mov esi, 0x3e8
push esi
push dword [esp + 0xc]
push edi
call fcn.005848d0
mov ecx, eax
mov ebx, edx
mul esi
imul esi, ebx, 0x3e8
add esi, edx
cmp eax, edi
sbb esi, dword [esp + 4]
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 + 0xc]
push dword [eax]
call ebx
test eax, eax
jne 0x50259d
mov bl, 1
mov eax, dword [esp + 0x28]
cmp byte [eax + 0x14], 0
je 0x502584
cmp byte [esp + 0xa0], 0
jne 0x50266e
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 dword [esp + 0xc4], 0x1a8
mov al, byte [0x6495e4]
test al, al
je 0x50255c
jmp 0x502bf3
cmp eax, 0x102
jne 0x502b53
mov ecx, dword [0x646080]
cmp ecx, 0x522100
je 0x502615
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 + 4], eax
mov ebx, dword [esp + 0xc]
sub ebx, eax
mov esi, dword [esp + 0x10]
sbb esi, edx
seto al
mov edi, esi
sar edi, 0x1f
test al, al
lea ecx, [edi - 0x80000000]
cmove edi, ebx
test al, al
cmove ecx, esi
mov eax, dword [esp + 4]
cmp eax, dword [esp + 0xc]
sbb edx, dword [esp + 0x10]
mov ebx, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jl 0x5024ee
xor ebx, ebx
jmp 0x50255c
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 0x502ce1
mov eax, ebx
mov ecx, 0xf4240
mul ecx
imul ecx, edi, 0xf4240
add ecx, edx
push dword [0x6496bc]
push dword [0x6496b8]
push ecx
push eax
call fcn.00588630
jmp 0x5025ce
mov dword [esp + 0xb8], 0xa
mov al, byte [0x649446]
test al, al
jne 0x502b7b
call fcn.00564ed5
mov eax, dword [eax]
mov dword [esp + 4], eax
call fcn.00564ed5
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 0x50271c
cmp dword [esp + 0x74], 0
jne 0x50271c
cmp byte [esi + 0x11], 0
je 0x50271c
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 0x5028b6
xor eax, eax
mov dword [esi + 0x1c], eax
mov dword [esi + 0x18], eax
cmp byte [esi + 0x2b], 0
jne 0x50270c
cmp byte [esi + 0x29], 0
mov eax, dword [esi + 0x20]
jne 0x5028c5
dec dword [eax + 0xb4]
cmp byte [esi + 0x11], 0
je 0x502ba3
cmp byte [esi + 0x10], 0
je 0x5027a3
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.00564ed5
mov ecx, dword [esp + 4]
mov dword [eax], ecx
cmp byte [esp + 0x98], 0
je 0x502743
mov eax, dword [esp + 0x90]
test eax, eax
jne 0x5027bb
mov eax, dword [esp + 0x78]
test eax, eax
je 0x502751
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 0x502adb
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 0x50256a
push eax
call fcn.004f0f10
add esp, 4
jmp 0x50256a
cmp byte [esi + 0x2a], 0
mov eax, dword [esi + 0x20]
jne 0x502ae9
dec dword [eax + 0xb8]
jmp 0x50270c
mov dword [esp + 4], eax
mov ecx, dword [fcn.005515a0]
cmp ecx, 0x522100
mov dword [esp + 0x28], ebx
jne 0x50289c
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 0x502d6b
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 dword [esp + 0xb8], eax
mov dword [esp + 0xbc], edx
mov ecx, dword [esp + 0x88]
mov edi, dword [esp + 0x8c]
mov dword [esp + 0x14], eax
mov dword [esp + 8], ecx
sub eax, ecx
mov dword [esp + 0x1c], 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 0x5028fa
mov esi, dword [esp + 0x90]
test esi, esi
mov ebx, dword [esp + 0x28]
je 0x502743
lock dec dword [esi]
jne 0x502743
jmp 0x502ccc
call dword [0x63e63c]
lea esi, [esp + 0xb8]
push esi
call ecx
add esp, 4
mov eax, dword [esi]
mov edx, dword [esi + 4]
jmp 0x502837
push dword [esp + 8]
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
jmp 0x5026d7
mov ecx, dword [eax + 0x5c]
mov edx, dword [eax + 0xa4]
dec edx
mov dword [eax + 0xa4], edx
cmp ecx, dword [eax + 0x60]
je 0x5028e2
cmp dword [eax + 0xac], edx
jae 0x5028ed
mov word [eax + 0x78], 0
jmp 0x5026f8
movzx ecx, word [ecx + 8]
mov word [eax + 0x78], cx
jmp 0x5026f8
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], edi
xor eax, eax
dec eax
mov ebx, 0x3938700
mov ecx, dword [esp + 4]
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 + 0x14], ebx
mov ecx, dword [esp + 0x1c]
sbb ecx, edx
jge 0x502e59
mov eax, dword [esp + 4]
mov ecx, dword [eax + 0xf8]
mov edi, dword [eax + 0xfc]
mov edx, dword [esp + 8]
mov dword [esp + 0x14], ecx
sub edx, ecx
mov ebx, dword [esp + 0xc]
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 0x502e39
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 0x502e0b
maxsd xmm0, qword [0x62f108]
cvttsd2si ebx, xmm0
xor eax, eax
dec eax
mov edx, dword [esp + 0x10]
add eax, edx
mov ecx, 0x7fffffff
adc ecx, esi
add eax, 2
adc ecx, 0
movd xmm0, edx
movd xmm1, esi
cmp eax, 2
sbb ecx, 0
punpckldq xmm0, xmm1
movq qword [esp + 0x40], xmm0
fild qword [esp + 0x40]
fstp qword [esp + 0x38]
jae 0x502a2f
movsd xmm0, qword [0x62f110]
jmp 0x502a3d
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 0x502e22
maxsd xmm0, qword [0x62f108]
cvttsd2si esi, xmm0
add esi, ebx
cmp esi, 0x3c
mov edi, 0x3c
cmovl edi, esi
mov eax, dword [esp + 4]
add eax, 4
mov dword [esp + 8], eax
push eax
call dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
test al, al
je 0x502dfc
cmp ebx, edi
jge 0x502aad
mov eax, dword [esp + 4]
inc dword [eax + ebx*4 + 8]
inc ebx
cmp edi, ebx
jne 0x502aa0
push dword [esp + 8]
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
cmp esi, 0x3d
jl 0x50287b
mov eax, dword [esp + 4]
mov eax, dword [eax + 0x100]
sub esi, edi
xor ebx, ebx
mov dword [esp + 4], eax
test eax, eax
jne 0x502a75
jmp 0x50287b
push eax
call fcn.004f0f10
add esp, 4
jmp 0x50276f
dec dword [eax + 0xa8]
mov ecx, dword [eax + 0x5c]
cmp ecx, dword [eax + 0x60]
je 0x502b05
mov edx, dword [eax + 0xac]
cmp edx, dword [eax + 0xa4]
jae 0x502b10
mov word [eax + 0x78], 0
jmp 0x50270c
movzx ecx, word [ecx + 8]
mov word [eax + 0x78], cx
jmp 0x50270c
mov ecx, dword [esp + 8]
call fcn.005636e0
mov ebx, eax
mov ecx, dword [esp + 0xc8]
xor ecx, ebp
call fcn.00568175
mov eax, ebx
jmp 0x50257a
lea ecx, [esp + 0x70]
call fcn.005345e0
lea eax, [esp + 0x70]
mov byte [eax + 0x30], 0
jmp 0x50245b
mov ecx, dword [esp + 0x14]
xor edx, edx
dec edx
xor ecx, edx
mov edx, dword [esp + 0x1c]
mov esi, 0x7fffffff
xor edx, esi
or edx, ecx
jne 0x5025a8
mov ecx, eax
call fcn.005c4f10
jmp 0x5025a8
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 0x502686
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 ecx, al
lea edx, [esp + 0xb8]
lea eax, [esp + 0x60]
mov dword [edx], eax
lea eax, [esp + 0xc4]
mov dword [eax], str.ScopedBlockingCallWithBaseSyncPrimitives
lea edx, [esp + 0xb4]
lea eax, [esp + 0xb8]
push eax
lea eax, [esp + 0xc8]
push eax
call fcn.005b9160
add esp, 8
jmp 0x502480
movzx eax, al
mov ecx, dword [0x648784]
mov edx, dword [esp + 8]
xor edx, dword [0x648780]
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.005c4fa0
add esp, 0x14
jmp 0x50255c
mov eax, dword [0x6496b8]
mov dword [esp + 4], eax
mov ecx, dword [0x6496bc]
mov dword [esp + 0xc], ecx
push ecx
push eax
push esi
push ebx
call fcn.00588630
mov dword [esp + 0x24], edx
mov ecx, eax
mul dword [esp + 4]
mov dword [esp + 0x10], eax
mov dword [esp + 0x20], ecx
imul ecx, dword [esp + 0xc]
add edx, ecx
mov edi, dword [esp + 0x14]
mov eax, dword [esp + 0x24]
imul ecx, eax, 0xf4240
mov dword [esp + 0x18], ecx
imul eax, dword [esp + 4]
add eax, edx
sub ebx, dword [esp + 0x10]
sbb esi, eax
mov ecx, 0xf4240
mov eax, dword [esp + 0x20]
mul ecx
mov dword [esp + 0x10], eax
add edx, dword [esp + 0x18]
mov dword [esp + 0x18], edx
mov eax, ebx
mul ecx
imul ecx, esi, 0xf4240
add edx, ecx
push dword [esp + 0xc]
push dword [esp + 8]
push edx
push eax
call fcn.00588630
add eax, dword [esp + 0x10]
adc edx, dword [esp + 0x18]
jmp 0x5024ba
mov ecx, esi
call fcn.004ed960
push esi
call fcn.00564ea0
add esp, 4
jmp 0x502743
mov esi, dword [0x6496b8]
mov dword [esp + 0x2c], esi
mov eax, dword [0x6496bc]
mov dword [esp + 4], eax
push eax
push esi
push edi
push ebx
call fcn.00588630
mov dword [esp + 0x18], eax
mov ecx, edx
mov eax, dword [esp + 0x18]
mul esi
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x18]
mov esi, eax
imul esi, dword [esp + 4]
add edx, esi
imul esi, ecx, 0xf4240
mov dword [esp + 0x20], esi
mov esi, dword [esp + 0x2c]
imul ecx, esi
add ecx, edx
sub ebx, dword [esp + 0x24]
sbb edi, ecx
mov ecx, 0xf4240
mul ecx
mov dword [esp + 0x18], eax
add edx, dword [esp + 0x20]
mov dword [esp + 0x20], edx
mov eax, ebx
mul ecx
imul ecx, edi, 0xf4240
add edx, ecx
push dword [esp + 4]
push esi
push edx
push eax
call fcn.00588630
add eax, dword [esp + 0x18]
adc edx, dword [esp + 0x20]
jmp 0x5025ce
mov eax, dword [0x6496b8]
mov dword [esp + 8], eax
mov ecx, dword [0x6496bc]
mov dword [esp + 0x14], ecx
push ecx
push eax
push esi
push edi
call fcn.00588630
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], edx
mul dword [esp + 8]
mov dword [esp + 0x10], eax
mov ecx, dword [esp + 0x1c]
imul ecx, dword [esp + 0x14]
add edx, ecx
mov eax, dword [esp + 0x18]
imul ecx, eax, 0xf4240
mov dword [esp + 0xc], ecx
imul eax, dword [esp + 8]
add eax, edx
sub edi, dword [esp + 0x10]
sbb esi, eax
mov ecx, 0xf4240
mov eax, dword [esp + 0x1c]
mul ecx
mov dword [esp + 0x1c], 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 + 0x14]
push dword [esp + 0xc]
push edx
push eax
call fcn.00588630
add eax, dword [esp + 0x1c]
adc edx, dword [esp + 0xc]
jmp 0x502829
push dword [esp + 8]
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
jmp 0x502a9c
xor eax, eax
ucomisd xmm0, qword [0x62f108]
mov ebx, 0x7fffffff
cmovb ebx, eax
jmp 0x5029ed
xor eax, eax
ucomisd xmm0, qword [0x62f108]
mov esi, 0x7fffffff
cmovb esi, eax
jmp 0x502a75
mov eax, dword [esp + 0x14]
cmp dword [esp + 8], eax
sbb dword [esp + 0xc], edi
setl al
movzx eax, al
movsd xmm0, qword [eax*8 + 0x62f0f0]
jmp 0x5029ad
mov eax, dword [esp + 0x14]
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x1c]
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 edi, dword [ebx]
test edi, edi
je 0x502938
lock dec dword [edi]
jne 0x502938
mov ecx, edi
call fcn.004ed960
push edi
call fcn.00564ea0
add esp, 4
jmp 0x502938