Function at 0x14001a680
Capabilities:
Connect socket
Get socket status
Set socket configuration

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x5b8]
sub rsp, 0x6b8
mov rax, qword [0x140116008]
xor rax, rsp
mov qword [rbp + 0x5a0], rax
mov rdi, qword [rbp + 0x620]
mov esi, edx
mov edx, 1
mov qword [rcx], 0xffffffffffffffff
movzx r15d, r8w
mov byte [rsp + 0x40], 1
mov r12, rcx
mov r13d, 2
mov ecx, r13d
mov r14, r9
lea r8d, [rdx + 5]
call qword [sym.imp.WS2_32.dll_socket]
mov rbx, rax
cmp rax, 0xffffffffffffffff
jne 0x14001a718
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
test rdi, rdi
je 0x14001a9bd
mov r9, rdi
lea rcx, str.ytcp
mov r8d, eax
mov edx, 0x1cc
call fcn.140019fe0
jmp 0x14001a9c2
xor eax, eax
movzx ecx, r15w
mov qword [rsp + 0x58], rax
mov word [rsp + 0x58], r13w
mov dword [rsp + 0x5c], esi
mov qword [rsp + 0x60], rax
call qword [sym.imp.WS2_32.dll_htons]
lea r8, [rsp + 0x50]
mov dword [rsp + 0x50], 1
mov edx, 0x8004667e
mov word [rsp + 0x5a], ax
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_ioctlsocket]
mov r8d, reloc.WS2_32.dll_recv
lea rdx, [rsp + 0x58]
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_connect]
mov qword [rsp + 0x48], 0
test r14, r14
je 0x14001a7b1
movabs rax, 0x624dd2f1a9fbe77
mul r14
mov rax, r14
sub rax, rdx
shr rax, 1
add rax, rdx
shr rax, 9
mov dword [rsp + 0x48], eax
imul eax, eax, 0x3e8
sub r14d, eax
imul eax, r14d, 0x3e8
mov dword [rsp + 0x4c], eax
jmp 0x14001a7b9
mov dword [rsp + 0x48], reloc.WS2_32.dll_sendto
lea rax, [rsp + 0x48]
mov qword [rbp + 0x398], rbx
lea ecx, [rbx + 1]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x70]
mov dword [rbp + 0x390], 1
lea r8, [rbp + 0x180]
mov qword [rbp + 0x188], rbx
lea rdx, [rbp + 0x390]
mov dword [rbp + 0x180], 1
mov qword [rsp + 0x78], rbx
mov dword [rsp + 0x70], 1
call qword [sym.imp.WS2_32.dll_select]
mov rcx, rbx
test eax, eax
jns 0x14001a846
call qword [sym.imp.WS2_32.dll_closesocket]
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
test rdi, rdi
je 0x14001a9bd
mov r9, rdi
lea rcx, str.ytcp
mov r8d, eax
mov edx, 0x1fb
call fcn.140019fe0
jmp 0x14001a9c2
lea rdx, [rsp + 0x70]
call qword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
jne 0x14001a96a
lea rdx, [rbp + 0x180]
mov rcx, rbx
call qword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x14001a96a
mov edx, 6
mov dword [rsp + 0x20], 1
lea r9, [rsp + 0x40]
mov rcx, rbx
lea r8d, [rdx - 5]
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x14001a8b4
call fcn.140059eec
lea r8, str.SetSockOpt_TCP_NODELAY_failed__d_n
mov edx, 0x225
lea rcx, str.ytcp
mov r9d, dword [rax]
call fcn.14000a9a0
lea rax, [rsp + 0x54]
mov dword [rsp + 0x54], 4
lea r9, [rsp + 0x44]
mov qword [rsp + 0x20], rax
mov edx, 0xffff
mov r8d, 0x1001
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
js 0x14001a94a
cmp dword [rsp + 0x44], 0x40000
jge 0x14001a962
lea r9, [rsp + 0x44]
mov dword [rsp + 0x44], 0x40000
mov edx, 0xffff
mov dword [rsp + 0x20], 4
mov r8d, 0x1001
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x14001a962
call fcn.140059eec
mov r9d, dword [rsp + 0x44]
lea r8, str.SetSockOpt_SO_SNDBUF__d_failed__d_n
mov edx, 0x248
mov ecx, dword [rax]
mov dword [rsp + 0x20], ecx
lea rcx, str.ytcp
call fcn.14000a9a0
xor eax, eax
mov qword [r12], rbx
jmp 0x14001a9c2
lea r8, str.getsockopt:_unable_to_get_tcp_buffer_size_n
mov edx, 0x24c
lea rcx, str.ytcp
call fcn.14000a9a0
mov qword [r12], rbx
xor eax, eax
jmp 0x14001a9c2
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_closesocket]
test rdi, rdi
je 0x14001a9bd
mov eax, esi
movzx r8d, r15w
mov dword [rsp + 0x38], r8d
mov r10d, esi
shr eax, 0x10
lea r8, str.Unable_to_connect_to__d._d._d._d:_d
movzx edx, al
mov eax, esi
shr eax, 8
movzx ecx, al
shr r10d, 0x18
mov dword [rsp + 0x30], r10d
mov dword [rsp + 0x28], edx
mov edx, 0x100
mov dword [rsp + 0x20], ecx
mov rcx, rdi
movzx r9d, sil
call fcn.1400217a0
mov eax, 0xfffffff8
mov rcx, qword [rbp + 0x5a0]
xor rcx, rsp
call fcn.14004ee60
add rsp, 0x6b8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret