Function at 0x140116770
Capabilities:
Create thread

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x78
mov qword [rsp + 0x48], r9
mov rdi, r8
mov rbp, rdx
mov rsi, rcx
mov rax, qword [rcx + 0x1b8]
test rax, rax
je 0x1401167e7
test byte [rax + 0x5b], 0x40
sete cl
cmp qword [rax + 0x30], 0
setne r13b
and r13b, cl
mov rcx, qword [rsi + 0x190]
mov rax, qword [rax + 0x190]
mov qword [rsi + 0x190], rax
test rax, rax
je 0x1401167cc
lock add dword [rax + 8], 1
mov r12d, r13d
xor r12b, 1
test rcx, rcx
je 0x1401167ed
lock sub dword [rcx + 8], 1
jne 0x1401167ed
mov rax, qword [rcx]
call qword [rax + 0x10]
jmp 0x1401167ed
mov r13b, 1
mov r12b, 1
mov eax, dword [rdi]
mov dword [rsp + 0x68], eax
mov eax, dword [rdi + 4]
mov dword [rsp + 0x6c], eax
lea rcx, [rsp + 0x50]
lea rdx, [rsp + 0x68]
call fcn.14012a760
mov rax, qword [0x1403b4d38]
mov rax, qword [rax]
test rax, rax
je 0x140116828
mov rcx, qword [rax]
lea rax, [rcx - 8]
test rcx, rcx
cmove rax, rcx
jmp 0x14011682a
xor eax, eax
lea rdx, [rax + 8]
test rax, rax
cmove rdx, rax
lea rcx, [rsp + 0x38]
call fcn.1402bc0d0
mov rax, qword [rsp + 0x38]
test rax, rax
je 0x140116859
mov rax, qword [rax]
lea rbx, [rax - 8]
test rax, rax
cmove rbx, rax
jmp 0x14011685b
xor ebx, ebx
lea rcx, [rsp + 0x38]
call fcn.1402bc130
lea rcx, [rsi + 0x1d0]
lea rdx, [rbx + 8]
test rbx, rbx
cmove rdx, rbx
call fcn.1402bc100
mov rcx, rsi
call fcn.14011b6e0
mov edx, 0xc8
add rdx, qword [rsi + 0x1f0]
mov qword [rsi + 0x210], 0
lea rcx, [rsi + 0x218]
call fcn.14028b880
call fcn.1401191b0
cmp eax, 2
mov qword [rsp + 0x60], rbp
jl 0x1401168bf
lea r8, [rsi + 0x208]
jmp 0x1401168c7
call fcn.140118b40
mov r8, rax
xor r14d, r14d
mov rcx, rsi
xor edx, edx
call fcn.140127d70
lea r15, [rsi + 0xb8]
mov byte [rsi + 0x168], 1
mov r9d, dword [rsp + 0x5c]
sub r9d, dword [rsp + 0x54]
lea rcx, [rsp + 0x30]
mov rdx, r15
xor r8d, r8d
call fcn.140086850
mov r8d, dword [rsp + 0x30]
mov rcx, r15
xor edx, edx
call fcn.14012a190
mov r8d, dword [rsp + 0x34]
mov rcx, rax
xor edx, edx
call fcn.14012a1f0
mov r8d, dword [rsp + 0x30]
mov ebp, dword [rsp + 0x34]
lea rcx, [rsp + 0x38]
mov rdx, rsi
mov r9d, ebp
call fcn.140128d00
mov r8, qword [rsp + 0x38]
mov qword [rsp + 0x30], r8
mov edx, dword [rdi + 4]
mov rax, r8
shr rax, 0x20
lea ebx, [rdx + rax]
mov ecx, dword [rsp + 0x5c]
cmp ebx, ecx
jle 0x140116a26
sub ecx, edx
sub edx, dword [rsp + 0x54]
cmp edx, ecx
jle 0x1401169c8
lea rcx, [rsp + 0x38]
call fcn.1401334d0
mov eax, dword [rsp + 0x3c]
mov ebx, dword [rdi + 4]
cmp eax, ebx
cmovl ebx, eax
mov dword [rdi + 4], ebx
mov rax, qword [rsi + 0x1b8]
test rax, rax
je 0x140116a6a
cmp qword [rax + 0x1c0], 0
je 0x140116a6a
mov rdx, qword [rax + 0x1c8]
test rdx, rdx
je 0x140116a6a
lea rcx, [rsp + 0x38]
call fcn.140125050
mov eax, dword [rsp + 0x44]
mov rcx, qword [rsp + 0x48]
mov ecx, dword [rcx + 4]
lea ebx, [rax + rcx]
add ebx, 2
jmp 0x140116a72
sub ebp, eax
add ebp, ecx
xor r14d, r14d
lea rcx, [rsp + 0x38]
mov rdx, r15
xor r8d, r8d
mov r9d, ebp
call fcn.140086850
mov r8, qword [rsp + 0x38]
mov qword [rsp + 0x30], r8
mov rcx, r15
xor edx, edx
call fcn.14012a190
mov r8d, dword [rsp + 0x34]
mov rcx, rax
xor edx, edx
call fcn.14012a1f0
mov r8d, dword [rsp + 0x30]
mov r9d, dword [rsp + 0x34]
lea rcx, [rsp + 0x38]
mov rdx, rsi
call fcn.140128d00
mov r8, qword [rsp + 0x38]
mov qword [rsp + 0x30], r8
mov eax, dword [rdi]
lea ecx, [rax + r8]
cmp ecx, dword [rsp + 0x58]
jle 0x140116aff
sub eax, r8d
mov rcx, qword [rsp + 0x48]
add eax, dword [rcx]
mov ecx, dword [rsp + 0x50]
cmp eax, ecx
cmovle eax, ecx
mov dword [rdi], eax
mov rcx, r15
xor edx, edx
call fcn.14012a160
mov rax, qword [rsi + 0x1b8]
test rax, rax
jne 0x140116b0e
jmp 0x140116b17
mov rax, qword [rsp + 0x48]
add ebx, dword [rax + 4]
mov eax, dword [rsp + 0x34]
mov ecx, ebx
sub ecx, eax
mov edx, dword [rsp + 0x54]
cmp ecx, edx
cmovle ecx, edx
add ebp, ebx
add ecx, eax
sub ebp, ecx
lea rcx, [rsp + 0x38]
mov rdx, r15
xor r8d, r8d
mov r9d, ebp
call fcn.140086850
mov r8, qword [rsp + 0x38]
mov qword [rsp + 0x30], r8
mov rcx, r15
xor edx, edx
call fcn.14012a190
mov r8d, dword [rsp + 0x34]
mov rcx, rax
xor edx, edx
call fcn.14012a1c0
mov r8d, dword [rsp + 0x30]
mov r9d, dword [rsp + 0x34]
lea rcx, [rsp + 0x38]
mov rdx, rsi
call fcn.140128d00
mov r8, qword [rsp + 0x38]
mov qword [rsp + 0x30], r8
mov rax, r8
shr rax, 0x20
sub ebx, eax
mov dword [rdi + 4], ebx
mov r14d, r13d
mov eax, dword [rdi]
lea ecx, [rax + r8]
cmp ecx, dword [rsp + 0x58]
jg 0x140116a36
xor r12d, r12d
mov rax, qword [rsi + 0x1b8]
test rax, rax
je 0x140116b17
cmp byte [rax + 0x1d8], 0
je 0x140116b6c
call fcn.140123100
mov bl, 1
cmp eax, 1
jne 0x140116b6e
mov r9d, dword [rsp + 0x30]
xor r8d, r8d
test r12b, r12b
mov edx, 0
cmovne edx, r9d
add edx, dword [rdi]
test r14b, r14b
je 0x140116b43
mov r8d, dword [rsp + 0x34]
add r8d, dword [rdi + 4]
cmp qword [rsi + 0x1b8], 0
mov eax, 1
cmove r9d, eax
mov dword [rsp + 0x20], 1
mov rcx, rsi
call fcn.140129e70
mov bl, 1
jmp 0x140116b89
xor ebx, ebx
mov edx, dword [rdi]
mov r8d, dword [rdi + 4]
mov r9d, dword [rsp + 0x30]
mov eax, dword [rsp + 0x34]
mov dword [rsp + 0x20], eax
mov rcx, rsi
call fcn.140129e70
mov rbp, qword [rsp + 0x60]
lea rax, [rsp + 0x74]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0
lea r8, [0x140116750]
xor ecx, ecx
xor edx, edx
xor r9d, r9d
call qword [sym.imp.KERNEL32.DLL_CreateThread]
mov rcx, rax
call qword [sym.imp.KERNEL32.DLL_CloseHandle]
mov byte [rsi + 0x1d8], 1
call fcn.140123790
test rbp, rbp
sete byte [rsp + 0x28]
test eax, eax
setne byte [rsp + 0x20]
mov rcx, rsi
mov rdx, rbp
mov r8b, 1
mov r9b, 1
call fcn.14013dc90
call fcn.14014d300
test bl, bl
je 0x140116c15
mov edx, dword [rdi]
mov r8d, dword [rdi + 4]
mov r9d, dword [rsp + 0x30]
mov eax, dword [rsp + 0x34]
mov dword [rsp + 0x20], eax
mov dword [rsp + 0x28], 0xffffffff
mov rcx, rsi
call fcn.14008d000
lea rcx, [rsp + 0x38]
mov rdx, rsi
call fcn.140128870
mov r8, qword [rsp + 0x38]
mov qword [rsp + 0x30], r8
mov rcx, r15
xor edx, edx
call fcn.14012a190
mov r8d, dword [rsp + 0x34]
mov rcx, rax
xor edx, edx
call fcn.14012a1f0
nop
add rsp, 0x78
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret