Function at 0x140017830
Capabilities:
Create thread

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0xa8
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x20], 0xfffffffffffffffe
mov rsi, r8
mov rdi, rdx
lea rcx, [rbp + 8]
call fcn.140019160
mov rcx, qword [rbp + 8]
mov rax, qword [rcx]
test rax, rax
je 0x140017b03
cmp byte [rcx + 8], 0
je 0x140017885
cmp byte [rax + 0xd8], 0
jne 0x140017b03
cmp byte [rcx + 0x10], 0
jne 0x140017b0d
mov byte [rcx + 0x10], 1
mov qword [rdi], rax
mov qword [rbp - 0x38], rdi
mov byte [rdi + 8], 1
lock inc dword [rax + 8]
xorps xmm0, xmm0
movaps xmmword [rbp - 0x20], xmm0
movaps xmmword [rbp - 0x30], xmm0
mov rdi, qword [rsi + 0x10]
cmp qword [rsi + 0x18], 0x10
jb 0x1400178bb
mov rsi, qword [rsi]
test rdi, rdi
js 0x140017b17
cmp rdi, 0xf
ja 0x1400178df
mov qword [rbp - 0x20], rdi
mov qword [rbp - 0x18], reloc.WS2_32.dll_ntohs
movups xmm0, xmmword [rsi]
movaps xmmword [rbp - 0x30], xmm0
jmp 0x14001793c
mov rax, rdi
or rax, 0xf
cmp rax, 0x17
mov ebx, reloc.WS2_32.dll_shutdown
cmovae rbx, rax
cmp rbx, 0xfff
jb 0x140017916
lea rcx, [rbx + 0x28]
call fcn.1402b4764
mov rcx, rax
add rcx, 0x27
and rcx, 0xffffffffffffffe0
mov qword [rcx - 8], rax
jmp 0x140017922
lea rcx, [rbx + 1]
call fcn.1402b4764
mov rcx, rax
mov qword [rbp - 0x30], rcx
mov qword [rbp - 0x20], rdi
mov qword [rbp - 0x18], rbx
inc rdi
mov rdx, rsi
mov r8, rdi
call fcn.1402ba9f0
xorps xmm0, xmm0
movaps xmmword [rbp - 0x10], xmm0
mov rax, qword [rbp + 0x10]
test rax, rax
je 0x140017956
lock inc dword [rax + 8]
mov r15, qword [rbp + 0x10]
jmp 0x140017959
xor r15d, r15d
mov r12, qword [rbp + 8]
mov qword [rbp - 0x10], r12
mov qword [rbp - 8], r15
mov ecx, gethostbyname
call fcn.1402b4764
mov rsi, rax
xorps xmm0, xmm0
movups xmmword [rax + 0x10], xmm0
movups xmmword [rax], xmm0
mov r14, qword [rbp - 0x30]
mov rdi, qword [rbp - 0x20]
mov r13, qword [rbp - 0x18]
cmp r13, 0x10
lea rbx, [rbp - 0x30]
cmovae rbx, r14
test rdi, rdi
mov qword [rbp + 0x18], rax
js 0x140017b1c
cmp rdi, 0xf
ja 0x1400179bb
mov qword [rsi + 0x10], rdi
mov qword [rsi + 0x18], reloc.WS2_32.dll_ntohs
movups xmm0, xmmword [rbx]
movups xmmword [rsi], xmm0
jmp 0x140017a26
mov qword [rsi + 0x18], reloc.WS2_32.dll_ntohs
mov rax, rdi
or rax, 0xf
cmp rax, 0x17
mov esi, reloc.WS2_32.dll_shutdown
cmovae rsi, rax
cmp rsi, 0xfff
jb 0x1400179fa
lea rcx, [rsi + 0x28]
call fcn.1402b4764
mov rcx, rax
add rcx, 0x27
and rcx, 0xffffffffffffffe0
mov qword [rcx - 8], rax
jmp 0x140017a06
lea rcx, [rsi + 1]
call fcn.1402b4764
mov rcx, rax
mov rax, qword [rbp + 0x18]
mov qword [rax], rcx
mov qword [rax + 0x10], rdi
mov qword [rax + 0x18], rsi
mov rsi, rax
inc rdi
mov rdx, rbx
mov r8, rdi
call fcn.1402ba9f0
lea rax, [rbp - 0x10]
mov qword [rsi + 0x20], r12
mov qword [rsi + 0x28], r15
xorps xmm0, xmm0
movups xmmword [rax], xmm0
lea rax, [rbp - 0x40]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0
lea r8, [0x140018720]
xor ecx, ecx
xor edx, edx
mov r9, rsi
call fcn.1402c5ec0
mov qword [rbp - 0x48], rax
test rax, rax
je 0x140017b21
cmp r13, 0x10
jb 0x140017aa3
lea rdx, [r13 + 1]
cmp rdx, 0x1000
jb 0x140017a9b
mov rax, qword [r14 - 8]
add r14, 0xfffffffffffffff8
sub r14, rax
cmp r14, 0x20
jae 0x140017b43
add r13, 0x28
mov rdx, r13
mov r14, rax
mov rcx, r14
call fcn.1402b4754
cmp dword [rbp - 0x40], 0
je 0x140017b32
movups xmm0, xmmword [rbp - 0x48]
movaps xmmword [rbp - 0x30], xmm0
lea rcx, [rbp - 0x30]
call fcn.1402b7d68
test eax, eax
jne 0x140017b3c
mov rsi, qword [rbp + 0x10]
test rsi, rsi
mov rdi, qword [rbp - 0x38]
je 0x140017aec
lock dec dword [rsi + 8]
jne 0x140017aec
mov rax, qword [rsi]
mov rcx, rsi
call qword [rax]
lock dec dword [rsi + 0xc]
jne 0x140017aec
mov rax, qword [rsi]
mov rcx, rsi
call qword [rax + reloc.WS2_32.dll_htonl]
mov rax, rdi
add rsp, 0xa8
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
mov ecx, 4
call fcn.1400212c0
mov ecx, 2
call fcn.1400212c0
call fcn.140002090
call fcn.140002090
mov dword [rbp - 0x40], 0
mov ecx, 6
call fcn.1402b7f14
mov ecx, 1
call fcn.1402b7f14
mov ecx, eax
call fcn.1402b7ed8
call fcn.1402bfaa4
int3