Function at 0x180166600
Capabilities:
Connect socket
Set socket configuration

Disassembly:
mov rax, rsp
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x60
mov qword [rax - 0x40], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rbp
mov qword [rax + 0x20], rsi
mov rbx, r9
mov rdi, r8
mov rsi, rdx
mov r14, rcx
add rcx, 0xd0
call fcn.180167540
mov r15, rax
mov r10d, dword [r14 + 0x1c]
mov dword [rax + 0x30], r10d
mov r8, rbx
mov rdx, rsi
mov rcx, r14
call fcn.180164830
mov rbp, rax
lea rbx, [rax + 0x70]
mov qword [rsp + 0x50], rbx
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
mov rcx, qword [rsp + 0xb8]
mov qword [rsp + 0x28], rcx
mov qword [rsp + 0x20], rdi
mov r12, qword [rsp + 0xb0]
mov r9, r12
mov r8, rbp
mov rdx, rsi
mov rcx, r14
call fcn.180164aa0
mov esi, 1
xor r13d, r13d
mov rcx, qword [rbp + 0xc8]
cmp dword [r14 + 0x60], r13d
je 0x180166768
mov dword [rsp + 0x90], esi
lea r8, [rsp + 0x90]
mov edx, 0x8004667e
call qword [sym.imp.WS2_32.dll_ioctlsocket]
mov ecx, r13d
test eax, eax
sete cl
test ecx, ecx
jne 0x1801666e0
mov ecx, 0x80004005
call fcn.180127e80
int3
xor r9d, r9d
mov r8, rbp
mov rdx, qword [r14 + 0x68]
mov rcx, qword [rbp + 0xc8]
call qword [sym.imp.KERNEL32.dll_CreateIoCompletionPort]
test rax, rax
je 0x18016675d
mov rcx, qword [rbp + 0xc8]
mov rax, qword [r14 + 0x48]
mov edi, r13d
mov qword [r15 + 0x58], rcx
mov dword [r15 + 0x28], 2
mov edx, reloc.WS2_32.dll_recv
mov r8d, 0x1c
cmp word [r12], 2
cmove r8d, edx
mov qword [rsp + 0x30], r15
mov qword [rsp + 0x28], r13
mov dword [rsp + 0x20], r13d
xor r9d, r9d
mov rdx, r12
call rax
test eax, eax
jne 0x18016674e
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, eax
cmp edi, 0x3e5
cmove edi, r13d
jmp 0x18016681f
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x18016681d
mov edx, reloc.WS2_32.dll_recv
mov r8d, 0x1c
cmp word [r12], 2
cmove r8d, edx
mov rdx, r12
call qword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x180166817
mov dword [rsp + 0x40], esi
lea r8, [rsp + 0x40]
mov edx, 0x8004667e
mov rcx, qword [rbp + 0xc8]
call qword [sym.imp.WS2_32.dll_ioctlsocket]
mov ecx, r13d
test eax, eax
sete cl
test ecx, ecx
jne 0x1801667c1
mov ecx, 0x80004005
call fcn.180127e80
int3
xor r9d, r9d
mov r8, rbp
mov rdx, qword [r14 + 0x68]
mov rcx, qword [rbp + 0xc8]
call qword [sym.imp.KERNEL32.dll_CreateIoCompletionPort]
test rax, rax
je 0x18016675d
mov dword [rbp + 0x60], esi
mov rdx, rbp
mov rcx, r14
call fcn.180163be0
cmp eax, 2
je 0x180166803
mov r8, r15
mov rdx, rbp
mov rcx, r14
call fcn.180165e70
mov esi, r13d
jmp 0x18016681d
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov eax, 0x4c7
test edi, edi
cmove edi, eax
jmp 0x18016681f
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, eax
test edi, edi
je 0x180166863
test esi, esi
je 0x180166863
mov dword [rsp + 0x20], r13d
xor r9d, r9d
xor r8d, r8d
mov rdx, rbp
mov rcx, r14
call fcn.1801649e0
lea rcx, [r14 + 0x100]
mov rdx, r15
call fcn.180126a20
test eax, eax
jne 0x180166863
mov rcx, qword [r15 + 0x20]
mov r8, r15
xor edx, edx
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_HeapFree]
nop
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, edi
lea r11, [rsp + 0x60]
mov rbx, qword [r11 + 0x38]
mov rbp, qword [r11 + 0x40]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret