Function at 0x140018fe4
Capabilities:
Create thread

Disassembly:
push rbp
mov rbp, rsp
add rsp, 0xffffffffffffff80
mov qword [rbp + 0x10], rcx
mov qword [rbp + 0x18], rdx
mov qword [rbp + 0x20], r8
mov qword [rbp + 0x28], r9
cmp qword [rbp + 0x10], 0
jne 0x140019017
mov edx, 0
mov ecx, 0x57
call fcn.14001ab28
jmp 0x140019272
mov rax, qword [rbp + 0x18]
sub rax, 1
and rax, qword [rbp + 0x18]
test rax, rax
je 0x14001903c
mov edx, 0
mov ecx, 0x32
call fcn.14001ab28
jmp 0x140019272
cmp qword [rbp + 0x18], 0xfffffff
jbe 0x14001905a
mov edx, 0
mov ecx, 0x32
call fcn.14001ab28
jmp 0x140019272
cmp qword [rbp + 0x28], 0x7fefffff
jbe 0x140019078
mov edx, 0
mov ecx, 0x216
call fcn.14001ab28
jmp 0x140019272
mov qword [rbp - 0x28], 0x10
mov rax, qword [rbp + 0x18]
mov qword [rbp - 0x30], rax
mov rdx, qword [rbp - 0x28]
mov rax, qword [rbp - 0x30]
cmp rdx, rax
cmovae rax, rdx
mov qword [rbp - 8], rax
mov rax, qword [rbp + 0x28]
add rax, 0x640
mov qword [rbp - 0x10], rax
mov rdx, qword [rbp - 0x10]
mov rax, qword [rbp - 8]
add rax, rdx
sub rax, 0x10
mov qword [rbp - 0x18], rax
mov rax, qword [rbp - 0x10]
cmp qword [rbp - 0x18], rax
jae 0x1400190d5
lea rax, str._MCF_thread_new_aligned
mov rcx, rax
call fcn.14001b220
mov rax, qword [rbp - 0x18]
mov rcx, rax
call fcn.14001a75c
mov qword [rbp - 0x20], rax
cmp qword [rbp - 0x20], 0
jne 0x140019100
mov edx, 0
mov ecx, 8
call fcn.14001ab28
jmp 0x140019272
mov rax, qword [rbp - 0x20]
mov qword [rbp - 0x38], rax
mov dword [rbp - 0x3c], 2
mov edx, dword [rbp - 0x3c]
mov rax, qword [rbp - 0x38]
mov dword [rax], edx
mov rax, qword [rbp - 0x20]
mov rdx, qword [rbp + 0x10]
mov qword [rax + 0x10], rdx
cmp qword [rbp + 0x28], 0
je 0x1400191f7
mov rax, qword [rbp - 0x20]
lea rdx, [rax + 0x640]
mov rax, qword [rbp - 0x20]
mov qword [rax + 0x18], rdx
mov rax, qword [rbp - 0x10]
cmp rax, qword [rbp - 0x18]
je 0x1400191d5
mov rax, qword [rbp - 0x20]
mov rax, qword [rax + 0x18]
lea rdx, [rax - 1]
mov rax, qword [rbp - 8]
sub rax, 1
or rax, rdx
add rax, 1
mov rdx, rax
mov rax, qword [rbp - 0x20]
mov qword [rax + 0x18], rdx
mov rax, qword [rbp - 0x20]
mov rax, qword [rax + 0x18]
mov rdx, rax
mov rax, qword [rbp + 0x28]
add rdx, rax
mov rax, qword [rbp - 0x20]
sub rdx, rax
mov qword [rbp - 0x18], rdx
mov rax, qword [rbp - 0x10]
cmp qword [rbp - 0x18], rax
jae 0x1400191ac
lea rax, str._MCF_thread_new_aligned
mov rcx, rax
call fcn.14001b220
mov rax, qword [0x1400c2130]
mov rax, qword [rax]
mov rcx, qword [rbp - 0x18]
mov rdx, qword [rbp - 0x20]
mov r9, rcx
mov r8, rdx
mov edx, 0x10
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_HeapReAlloc]
call rax
cmp qword [rbp + 0x20], 0
je 0x1400191f7
mov rax, qword [rbp - 0x20]
mov rax, qword [rax + 0x18]
mov rcx, qword [rbp + 0x28]
mov rdx, qword [rbp + 0x20]
mov r8, rcx
mov rcx, rax
call fcn.14001a5a0
mov rdx, qword [rbp - 0x20]
lea rax, [rbp - 0x50]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0
mov r9, rdx
lea r8, [0x140018f64]
mov edx, 0
mov ecx, 0
mov rax, qword [sym.imp.KERNEL32.dll_CreateThread]
call rax
mov rdx, qword [rbp - 0x20]
mov qword [rdx + 8], rax
mov rax, qword [rbp - 0x20]
mov rax, qword [rax + 8]
test rax, rax
jne 0x140019251
mov rax, qword [rbp - 0x20]
mov rcx, rax
call fcn.14001a894
mov eax, 0
jmp 0x140019272
mov eax, dword [rbp - 0x50]
mov edx, eax
mov rax, qword [rbp - 0x20]
add rax, 4
mov qword [rbp - 0x48], rax
mov dword [rbp - 0x4c], edx
mov edx, dword [rbp - 0x4c]
mov rax, qword [rbp - 0x48]
mov dword [rax], edx
mov rax, qword [rbp - 0x20]
sub rsp, 0xffffffffffffff80
pop rbp
ret