Function at 0x140001680
Capabilities:
Create thread
Terminate thread

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], r8
push rsi
push rdi
push r12
push r14
push r15
sub rsp, 0x80
mov ebp, r9d
mov rsi, r8
mov r14, rdx
mov r15d, ecx
test r9b, 4
je 0x1400016c1
mov ecx, 0x57
call qword [sym.imp.KERNEL32.dll_SetLastError]
nop
jmp 0x14000188d
xor r9d, r9d
xor r8d, r8d
lea edx, [r9 + 1]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov rdi, rax
test rax, rax
jne 0x1400016e0
jmp 0x14000188d
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x40], rdi
lea rax, [rsp + 0x30]
mov qword [rsp + 0x48], rax
mov byte [rsp + 0x50], 1
mov ecx, 0x20
call fcn.140015184
mov rbx, rax
mov qword [rsp + 0x38], rax
xor r12d, r12d
test rax, rax
je 0x140001747
mov rax, qword [rsp + 0x30]
xorps xmm0, xmm0
movups xmmword [rbx], xmm0
mov dword [rbx + 8], 1
mov dword [rbx + 0xc], 1
lea rcx, vtable.std::_Ref_count_resource_void____ptr64__int____cdecl___void____ptr64__.0
mov qword [rbx], rcx
mov qword [rbx + 0x10], rax
mov qword [rbx + 0x18], rdi
jmp 0x14000174a
mov rbx, r12
mov rcx, qword [rsi + 8]
mov qword [rsi + 8], r12
mov rax, qword [rsi]
mov qword [rsp + 0x58], rax
mov qword [rsp + 0x60], rcx
mov qword [rsp + 0x68], r14
mov qword [rsp + 0x70], rdi
mov rax, qword [rsp + 0xd0]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], ebp
lea r9, [rsp + 0x58]
lea r8, [0x140002a70]
mov edx, r15d
xor ecx, ecx
call fcn.14001e8b8
mov rbp, rax
test rax, rax
jne 0x1400017de
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x1400017a7
call qword [rsp + 0x58]
nop
test rbx, rbx
je 0x1400017d9
mov edi, 0xffffffff
mov eax, edi
lock xadd dword [rbx + 8], eax
cmp eax, 1
jne 0x1400017d9
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax]
lock xadd dword [rbx + 0xc], edi
cmp edi, 1
jne 0x1400017d9
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + 8]
nop
jmp 0x14000188d
mov edx, 0x1388
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x14000189d
mov edx, 1
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_TerminateThread]
test eax, eax
jne 0x14000181f
xor edx, edx
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x14000181f
mov dword [0], r12d
jmp 0x140001815
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
setne cl
test eax, eax
jne 0x140001840
test cl, cl
je 0x140001831
xor eax, eax
movabs dword [0], eax
mov ecx, 0x5b4
call qword [sym.imp.KERNEL32.dll_SetLastError]
nop
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x14000185b
call qword [rsp + 0x58]
nop
test rbx, rbx
je 0x14000188d
mov edi, 0xffffffff
mov eax, edi
lock xadd dword [rbx + 8], eax
cmp eax, 1
jne 0x14000188d
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax]
lock xadd dword [rbx + 0xc], edi
cmp edi, 1
jne 0x14000188d
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + 8]
nop
mov rcx, qword [rsi + 8]
test rcx, rcx
je 0x140001899
call qword [rsi]
nop
xor eax, eax
jmp 0x1400018ed
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x1400018ac
call qword [rsp + 0x58]
nop
test rbx, rbx
je 0x1400018de
mov edi, 0xffffffff
mov eax, edi
lock xadd dword [rbx + 8], eax
cmp eax, 1
jne 0x1400018de
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax]
lock xadd dword [rbx + 0xc], edi
cmp edi, 1
jne 0x1400018de
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + 8]
nop
mov rcx, qword [rsi + 8]
test rcx, rcx
je 0x1400018ea
call qword [rsi]
nop
mov rax, rbp
lea r11, [rsp + 0x80]
mov rbx, qword [r11 + 0x30]
mov rbp, qword [r11 + 0x38]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rsi
ret