Function at 0x180037700
Capabilities:
Terminate thread

Disassembly:
mov qword [rsp + 8], rcx
sub rsp, 0xd8
mov qword [rsp + 0x48], 0
mov byte [rsp + 0x44], 0
movzx eax, byte [0x1800a51a0]
test eax, eax
je 0x180037ba9
lea rcx, [0x1800a51c8]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
mov qword [rsp + 0x48], 0
mov eax, dword [0x1800a51b8]
mov dword [rsp + 0x70], eax
mov dword [rsp + 0x40], 0
jmp 0x18003775e
mov eax, dword [rsp + 0x40]
inc eax
mov dword [rsp + 0x40], eax
mov eax, dword [rsp + 0x70]
cmp dword [rsp + 0x40], eax
jge 0x1800377c8
movsxd rax, dword [rsp + 0x40]
mov rcx, qword [0x1800a51b0]
lea rax, [rcx + rax*8]
mov qword [rsp + 0xa0], rax
mov rax, qword [rsp + 0xa0]
mov rax, qword [rax]
mov rdx, qword [rsp + 0xe0]
mov rcx, qword [rax]
call fcn.180057434
test eax, eax
jne 0x1800377c6
movsxd rax, dword [rsp + 0x40]
mov rcx, qword [0x1800a51b0]
mov rax, qword [rcx + rax*8]
mov qword [rsp + 0x48], rax
mov edx, dword [rsp + 0x40]
lea rcx, [0x1800a51b0]
call fcn.180039be0
jmp 0x1800377c8
jmp 0x180037754
lea rcx, [0x1800a51c8]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp qword [rsp + 0x48], 0
je 0x180037ba9
mov rax, qword [rsp + 0x48]
mov dword [rax + 0x68], 1
xor r8d, r8d
mov edx, 1
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax + 0x60]
call qword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
lea rdx, [rsp + 0xa8]
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax]
call fcn.180038770
mov r8d, 0xc
xor edx, edx
lea rcx, [rsp + 0xb8]
call fcn.180056c20
mov ecx, 0x10000001
call fcn.1800419a0
test rax, rax
je 0x1800378a5
mov qword [rsp + 0x80], 0
mov dword [rsp + 0x68], 0
lea rax, [rsp + 0x68]
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
xor r9d, r9d
lea r8, [rsp + 0xb8]
lea rdx, [rsp + 0xa8]
lea rcx, [rsp + 0x80]
call qword [0x1800a5178]
mov edx, eax
lea rcx, [0x18007aec0]
call fcn.180036cb0
mov rcx, qword [rsp + 0xb0]
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov edx, 0x3e8
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax + 0x70]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x1800378df
xor edx, edx
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax + 0x70]
call qword [sym.imp.KERNEL32.dll_TerminateThread]
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax + 0x70]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, 0x3e8
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax + 0x78]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x18003791a
xor edx, edx
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax + 0x78]
call qword [sym.imp.KERNEL32.dll_TerminateThread]
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax + 0x78]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rsp + 0x48]
cmp qword [rax + 0x80], 0
je 0x180037ba9
mov dword [rsp + 0x40], 0
jmp 0x180037950
mov eax, dword [rsp + 0x40]
inc eax
mov dword [rsp + 0x40], eax
mov rax, qword [rsp + 0x48]
mov rax, qword [rax + 0x80]
mov eax, dword [rax + 8]
mov dword [rsp + 0x6c], eax
mov eax, dword [rsp + 0x6c]
cmp dword [rsp + 0x40], eax
jge 0x180037af7
mov rax, qword [rsp + 0x48]
mov rax, qword [rax + 0x80]
movsxd rcx, dword [rsp + 0x40]
mov rax, qword [rax]
cmp qword [rax + rcx*8], 0
je 0x180037af2
mov rax, qword [rsp + 0x48]
mov rax, qword [rax + 0x80]
movsxd rcx, dword [rsp + 0x40]
mov rax, qword [rax]
mov rax, qword [rax + rcx*8]
mov qword [rsp + 0x50], rax
mov dword [rsp + 0x58], 0
mov rax, qword [rsp + 0x50]
lea rcx, [rsp + 0x58]
mov qword [rax + 0x28], rcx
mov rax, qword [rsp + 0x50]
mov dword [rax + 0x24], 1
mov qword [rsp + 0x78], 0
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov qword [rsp + 0x98], rax
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov dword [rsp + 0x30], 2
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
lea r9, [rsp + 0x78]
mov rcx, qword [rsp + 0x98]
mov r8, rcx
mov rcx, qword [rsp + 0x50]
mov rdx, qword [rcx]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x180037a55
mov rax, qword [rsp + 0x50]
mov rcx, qword [rax + 0x10]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, 0x3e8
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x180037a77
mov rax, qword [rsp + 0x50]
mov rcx, qword [rax + 0x10]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, 0x3e8
mov rax, qword [rsp + 0x50]
mov rcx, qword [rax]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp dword [rsp + 0x58], 0
jne 0x180037af2
lea rcx, [0x1800a51c8]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [rsp + 0x58], 0
jne 0x180037ae5
xor edx, edx
mov rax, qword [rsp + 0x50]
mov rcx, qword [rax]
call qword [sym.imp.KERNEL32.dll_TerminateThread]
mov rax, qword [rsp + 0x50]
mov rcx, qword [rax + 0x10]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rsp + 0x50]
mov rcx, qword [rax]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rsp + 0x50]
cmp qword [rax + 0x18], 0
je 0x180037ada
mov rax, qword [rsp + 0x50]
mov rcx, qword [rax + 0x18]
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_LocalFree]
lea rcx, [0x1800a51c8]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x180037946
mov rax, qword [rsp + 0x48]
mov rax, qword [rax + 0x80]
mov qword [rsp + 0x88], rax
mov rax, qword [rsp + 0x88]
mov qword [rsp + 0x60], rax
cmp qword [rsp + 0x60], 0
je 0x180037b4f
mov rcx, qword [rsp + 0x60]
call fcn.180039b70
mov eax, 1
and eax, 1
test eax, eax
je 0x180037b40
mov rcx, qword [rsp + 0x60]
call fcn.180053844
mov rax, qword [rsp + 0x60]
mov qword [rsp + 0x90], rax
jmp 0x180037b5b
mov qword [rsp + 0x90], 0
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax + 0x20]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax + 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rsp + 0x48]
add rax, 0x38
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax]
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov byte [rsp + 0x44], 1
movzx eax, byte [rsp + 0x44]
add rsp, 0xd8
ret