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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x598080
mov eax, dword fs:[0]
push eax
sub esp, 0x5c
push ebx
push edi
mov eax, dword [0x601018]
xor eax, esp
push eax
lea eax, [esp + 0x68]
mov dword fs:[0], eax
lea eax, [esi + 0xc64]
push eax
mov dword [esp + 0x14], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [esp + 0x70], 0
jmp 0x4203c0
mov eax, dword [esi + 0xcd0]
cmp eax, 1
jae 0x4204ad
mov eax, dword [esi + 0xcb4]
cmp eax, dword [esi + 0xc44]
jle 0x420465
mov ebx, dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
lea ecx, [esp + 0x2c]
push ecx
call ebx
test eax, eax
jne 0x4203fa
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
lea edx, [esp + 0x1c]
push edx
call ebx
test eax, eax
jne 0x420411
xor ecx, ecx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x20], eax
jmp 0x420419
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x1c]
sub ecx, dword [esi + 0xc98]
push 0
sbb eax, dword [esi + 0xc9c]
push 0x3e8
push eax
push ecx
call fcn.00596e30
mov ecx, dword [0x61023c]
push ecx
mov ecx, dword [0x610238]
push ecx
push edx
push eax
call fcn.00596bf0
mov edi, eax
mov eax, dword [esi + 0xc54]
mov ecx, edx
cdq
cmp ecx, edx
jg 0x42061d
jl 0x420465
cmp edi, eax
ja 0x42061d
mov edx, dword [esi + 0xc80]
mov edi, dword [esi + 0xc58]
push edx
imul edi, edi, 0x3e8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test edi, edi
jle 0x42048c
mov eax, dword [esi + 0xc7c]
push edi
push eax
jmp 0x420495
mov ecx, dword [esi + 0xc7c]
push 0xffffffffffffffff
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edx, dword [esi + 0xc80]
push edx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
jmp 0x4203c0
cmp dword [esi + 0xcac], eax
jge 0x4204bb
mov dword [esi + 0xcac], eax
lea eax, [esp + 0x40]
lea ecx, [esi + 0xcc0]
call fcn.00420990
mov ecx, dword [eax]
test ecx, ecx
je 0x4204d2
mov ecx, dword [ecx]
mov eax, dword [eax + 8]
mov edx, dword [ecx + 8]
cmp edx, eax
ja 0x4204de
sub eax, edx
mov ecx, dword [ecx + 4]
mov eax, dword [ecx + eax*4]
mov edx, dword [eax]
mov ecx, dword [eax + 4]
mov ebx, dword [eax + 8]
mov dword [esp + 0x4c], edx
mov edx, dword [eax + 0xc]
mov dword [esp + 0x58], edx
mov edx, dword [eax + 0x14]
mov dword [esp + 0x50], ecx
mov ecx, dword [eax + 0x10]
mov eax, dword [esi + 0xcd0]
mov dword [esp + 0x60], edx
xor edx, edx
mov dword [esp + 0x5c], ecx
cmp eax, edx
je 0x420540
inc dword [esi + 0xccc]
mov ecx, dword [esi + 0xccc]
cmp dword [esi + 0xcc8], ecx
ja 0x42052f
mov dword [esi + 0xccc], edx
dec eax
mov dword [esi + 0xcd0], eax
cmp eax, edx
jne 0x420540
mov dword [esi + 0xccc], edx
mov edi, dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
lea eax, [esp + 0x34]
push eax
call edi
test eax, eax
jne 0x420559
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
lea ecx, [esp + 0x24]
push ecx
call edi
test eax, eax
jne 0x420570
xor ecx, ecx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], eax
jmp 0x420578
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x24]
sub ecx, dword [esp + 0x4c]
push 0
sbb eax, dword [esp + 0x54]
push 0x3e8
push eax
push ecx
call fcn.00596e30
mov ecx, dword [0x61023c]
push ecx
mov ecx, dword [0x610238]
push ecx
push edx
push eax
call fcn.00596bf0
mov dword [esp + 0x18], edx
cmp dword [esi + 0xcb0], eax
jge 0x4205b5
mov dword [esi + 0xcb0], eax
test ebx, ebx
je 0x420665
inc dword [esi + 0xcb8]
mov eax, dword [esi + 0xcb8]
cmp dword [esi + 0xca8], eax
jge 0x4205d7
mov dword [esi + 0xca8], eax
lea edi, [esi + 0xc64]
push edi
mov dword [esp + 0x18], edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov byte [esp + 0x70], 1
mov eax, dword [esp + 0x5c]
mov ecx, dword [esp + 0x58]
mov edx, dword [ebx]
mov edx, dword [edx + 4]
push eax
push ecx
mov ecx, ebx
call edx
push edi
mov byte [esp + 0x74], 0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
dec dword [esi + 0xcb8]
inc dword [esi + 0xca4]
jmp 0x4203c0
lea eax, [esp + 0x34]
push eax
call ebx
test eax, eax
jne 0x42062c
xor ecx, ecx
jmp 0x420634
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x34]
mov dword [esi + 0xc98], ecx
mov ecx, dword [esi + 0xcb4]
dec ecx
push ecx
push str.decreased_running_threads_to___d_
lea ebx, [esi + 0x43c]
lea edx, [esi + 0x10]
mov ecx, 1
mov dword [esi + 0xc9c], eax
call fcn.0042b270
add esp, 8
jmp 0x42066b
inc dword [esi + 0xca4]
mov edx, dword [esi + 0xc84]
dec dword [esi + 0xcb4]
push edx
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [esp + 0x68]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebx
mov esp, ebp
pop ebp
ret