Function at 0x1400687b0
Capabilities:
Create thread

Disassembly:
mov qword [rsp + 0x20], rbx
push r14
sub rsp, 0x30
mov rbx, rcx
mov r14d, 0x20
movsxd rcx, dword [rcx + 8]
mov edx, r14d
call fcn.140074c18
mov qword [rbx + 0x30], rax
test rax, rax
jne 0x1400687e9
lea eax, [r14 - 0x21]
mov rbx, qword [rsp + 0x58]
add rsp, 0x30
pop r14
ret
mov qword [rsp + 0x40], rbp
lea rcx, [rbx + 0x38]
mov qword [rsp + 0x48], rsi
mov qword [rsp + 0x50], rdi
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov ecx, dword [rbx + 8]
xor edi, edi
mov ebp, edi
test ecx, ecx
jle 0x14006885d
mov esi, edi
nop
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rcx, qword [rbx + 0x30]
mov qword [rsi + rcx + 8], rax
mov rax, qword [rbx + 0x30]
cmp qword [rsi + rax + 8], rdi
je 0x140068999
mov qword [rsi + rax + 0x18], rbx
mov rax, qword [rbx + 0x30]
mov dword [rsi + rax + 0x14], ebp
inc ebp
mov rax, qword [rbx + 0x30]
mov dword [rsi + rax + 0x10], 0xffffffff
add rsi, r14
mov ecx, dword [rbx + 8]
cmp ebp, ecx
jl 0x140068810
mov eax, dword [rbx + 0x10]
mov dword [rbx + 0x80], eax
cmp ecx, 1
jle 0x1400688c5
mov rax, qword [rbx + 0x30]
mov esi, 1
nop dword [rax]
nop dword [rax + rax]
movsxd r9, esi
lea r8, [fcn.140068ef0]
shl r9, 5
xor edx, edx
add r9, rax
mov qword [rsp + 0x28], rdi
xor ecx, ecx
mov dword [rsp + 0x20], edi
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov rcx, qword [rbx + 0x30]
mov qword [r14 + rcx], rax
mov rax, qword [rbx + 0x30]
cmp qword [r14 + rax], rdi
je 0x1400689a3
inc esi
add r14, 0x20
cmp esi, dword [rbx + 8]
jl 0x140068880
mov rcx, qword [rbx + 0x30]
mov dword [rbx + 0x88], 0xffffffff
call fcn.140068ef0
inc dword [rbx + 0x84]
xor edx, edx
mov rsi, qword [rbx + 0x30]
mov rcx, qword [rsi + 0x18]
mov eax, dword [rcx + 8]
mov dword [rcx + 0x8c], eax
mov eax, 0xffffffff
mov rcx, qword [rsi + 0x18]
div dword [rcx + 0x8c]
mov dword [rcx + 0x90], eax
mov rdx, qword [rsi + 0x18]
cmp dword [rdx + 0x90], 0x40000
jle 0x140068924
mov dword [rdx + 0x90], 0x40000
mov rdx, qword [rsi + 0x18]
cmp dword [rdx + 8], edi
jle 0x14006897c
mov rbx, rdi
nop dword [rax]
mov r9d, dword [rdx + 0x8c]
test r9d, r9d
jle 0x14006897c
mov rcx, qword [rdx + 0x30]
mov r8, rdx
mov eax, dword [rsi + 0x14]
cmp dword [rcx + rbx + 0x14], eax
je 0x14006896d
lea eax, [r9 - 1]
mov dword [rdx + 0x8c], eax
mov rax, qword [rsi + 0x18]
mov rcx, qword [rax + 0x30]
mov rcx, qword [rcx + rbx + 8]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov r8, qword [rsi + 0x18]
inc edi
add rbx, 0x20
mov rdx, r8
cmp edi, dword [r8 + 8]
jl 0x140068930
xor eax, eax
mov rsi, qword [rsp + 0x48]
mov rbp, qword [rsp + 0x40]
mov rdi, qword [rsp + 0x50]
mov rbx, qword [rsp + 0x58]
add rsp, 0x30
pop r14
ret
call qword [sym.imp.KERNEL32.dll_GetLastError]
neg eax
jmp 0x14006897e
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
test eax, eax
je 0x1400688c5
mov rsi, qword [rbx + 0x30]
mov eax, 0xffffffff
mov dword [rbx + 0x84], 1
mov rdx, qword [rsi + 0x18]
mov ecx, dword [rdx + 8]
mov dword [rdx + 0x8c], ecx
xor edx, edx
mov rcx, qword [rsi + 0x18]
div dword [rcx + 0x8c]
mov dword [rcx + 0x90], eax
mov rdx, qword [rsi + 0x18]
cmp dword [rdx + 0x90], 0x40000
jle 0x140068a03
mov dword [rdx + 0x90], 0x40000
mov rdx, qword [rsi + 0x18]
cmp dword [rdx + 8], edi
jle 0x140068a5c
mov rbx, rdi
nop dword [rax + rax]
mov r9d, dword [rdx + 0x8c]
test r9d, r9d
jle 0x140068a5c
mov rcx, qword [rdx + 0x30]
mov r8, rdx
mov eax, dword [rsi + 0x14]
cmp dword [rcx + rbx + 0x14], eax
je 0x140068a4d
lea eax, [r9 - 1]
mov dword [rdx + 0x8c], eax
mov rax, qword [rsi + 0x18]
mov rcx, qword [rax + 0x30]
mov rcx, qword [rcx + rbx + 8]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov r8, qword [rsi + 0x18]
inc edi
add rbx, 0x20
mov rdx, r8
cmp edi, dword [r8 + 8]
jl 0x140068a10
neg ebp
mov eax, ebp
jmp 0x14006897e