Function at 0x140166a10
Capabilities:
Set socket configuration

Disassembly:
mov qword [rsp + 0x10], rbx
push rbp
push rsi
push rdi
push r14
push r15
sub rsp, 0x80
or dword [r8], 2
mov rbx, rcx
mov rcx, qword [rcx + 0x188]
xor bpl, bpl
xor esi, esi
mov rdi, r8
mov r15, rdx
test rcx, rcx
je 0x140166a8f
mov eax, dword [rbx + 0x6b8]
shr rax, 5
cmp rcx, rax
jge 0x140166cd3
cmp byte [rbx + 0x1c5], sil
jne 0x140166cd3
cmp byte [rbx + 0x1c0], sil
jne 0x140166cd3
mov rax, qword [rbx + 0x108]
sub rax, qword [rbx + 0x110]
add rax, rcx
cmp rax, qword [rbx + 0x1170]
je 0x140166cd3
mov rsi, rcx
mov rax, qword [rbx + 0xcb0]
test rax, rax
jne 0x140166ab7
mov ecx, dword [rbx + 0x6b8]
call qword [fcn.1401f9828]
mov qword [rbx + 0xcb0], rax
test rax, rax
je 0x140166bfe
test rsi, rsi
je 0x140166ad3
mov rdx, qword [rbx + 0x190]
cmp rdx, rax
je 0x140166ad3
mov r8, rsi
mov rcx, rax
call fcn.140232d80
mov rdx, qword [rbx + 0xcb0]
mov qword [rbx + 0x190], rdx
cmp byte [rbx + 0x1c0], bpl
jne 0x140166f04
cmp dword [rbx + 0x158], 2
mov rcx, qword [rbx + 0x198]
jne 0x140166b43
cmp dword [rcx + 0x38], 2
jne 0x140166b43
and dword [rbx + 0x144], 0xfffffffd
lea rcx, [rsp + 0x70]
mov dword [rbx + 0x158], 1
call fcn.140151560
xor r8d, r8d
mov rcx, rbx
movups xmm0, xmmword [rax]
movups xmmword [rbx + 0x148], xmm0
and dword [rdi], 0xfffffffd
movsxd rdx, dword [rbx + 0xa1c]
call fcn.14014b710
jmp 0x140166f1c
mov rax, qword [r15 + 0x318]
test dword [rax + 0x84], 0x40003
je 0x140166b5e
cmp dword [rcx + 0x38], 1
sete bpl
lea rax, [rdx + rsi]
mov rcx, rbx
mov qword [rbx + 0x190], rax
lea r8, [rsp + 0xb0]
mov edx, dword [rbx + 0x6b8]
sub rdx, rsi
call fcn.140165050
sub qword [rbx + 0x190], rsi
test eax, eax
jne 0x140166f1e
mov rdi, qword [rsp + 0xb0]
add rdi, rsi
je 0x140166f04
test rdi, rdi
jle 0x140166f0d
mov qword [rbx + 0x188], rdi
test bpl, bpl
jne 0x140166caa
cmp byte [rbx + 0xa7f], bpl
je 0x140166caa
mov rax, qword [rbx + 0xd68]
test rax, rax
jne 0x140166c08
mov eax, dword [rbx + 0x6b8]
lea ecx, [rax + rax]
call qword [fcn.1401f9828]
mov qword [rbx + 0xd68], rax
test rax, rax
jne 0x140166c08
lea rdx, str.Failed_to_alloc_scratch_buffer
mov rcx, rbx
call fcn.14015e140
mov eax, reloc.WLDAP32.dll_Ordinal_27
jmp 0x140166f1e
test rsi, rsi
je 0x140166c1f
mov rdx, qword [rbx + 0x190]
mov r8, rsi
mov rcx, rax
call fcn.140232d80
mov rdx, rsi
mov rcx, rsi
cmp rsi, rdi
jge 0x140166c8d
nop word [rax + rax]
mov rax, qword [rbx + 0x190]
mov r8, qword [rbx + 0xd68]
movzx r9d, byte [rdx + rax]
cmp r9b, 0xa
jne 0x140166c7e
mov byte [r8 + rcx], reloc.WS2_32.dll_listen
inc rcx
mov rax, qword [rbx + 0xd68]
mov byte [rcx + rax], r9b
cmp byte [rbx + 0xa7f], 0
jne 0x140166c82
mov rax, qword [rbx + 0x1170]
cmp rax, 0xffffffffffffffff
je 0x140166c82
inc rax
mov qword [rbx + 0x1170], rax
jmp 0x140166c82
mov byte [r8 + rcx], r9b
inc rdx
inc rcx
cmp rdx, rdi
jl 0x140166c30
cmp rcx, rdi
je 0x140166caa
mov rax, qword [rbx + 0xd68]
mov rdi, rcx
mov qword [rbx + 0x190], rax
mov qword [rbx + 0x188], rcx
mov rax, qword [r15 + 0x318]
test dword [rax + 0x84], 0x30000
je 0x140166cd3
mov r8, rsi
mov rdx, rdi
mov rcx, rbx
call fcn.14017f790
test eax, eax
jne 0x140166f1e
mov r9, qword [rbx + 0x188]
lea rax, [rsp + 0xc8]
mov r8, qword [rbx + 0x190]
mov rcx, rbx
mov rdx, qword [r15 + 0x340]
mov qword [rsp + 0x20], rax
call fcn.14015ea80
test eax, eax
jne 0x140166f1e
lea rcx, [rsp + 0x60]
call fcn.140151560
lea rdx, [rsp + 0x50]
lea rcx, [rsp + 0x60]
movups xmm0, xmmword [rax]
movups xmm1, xmmword [rax]
movups xmmword [rsp + 0x70], xmm0
movups xmm0, xmmword [rbx + 0x1a8]
movaps xmmword [rsp + 0x60], xmm1
movaps xmmword [rsp + 0x50], xmm0
call fcn.1401515f0
cmp rax, 0x3e8
jle 0x140166dc9
mov rdi, qword [r15 + 0x340]
lea rax, [rsp + 0xc0]
mov qword [rsp + 0x40], 0
xor r9d, r9d
mov qword [rsp + 0x38], 0
xor r8d, r8d
mov qword [rsp + 0x30], rax
mov edx, 0x4004747b
lea rax, [rsp + 0xb0]
mov dword [rsp + 0x28], 4
mov rcx, rdi
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
jne 0x140166dbd
lea r9, [rsp + 0xb0]
mov dword [rsp + 0x20], 4
mov edx, 0xffff
mov r8d, 0x1001
mov rcx, rdi
call qword [sym.imp.WS2_32.dll_setsockopt]
movups xmm0, xmmword [rsp + 0x70]
movups xmmword [rbx + 0x1a8], xmm0
mov rax, qword [rbx + 0x110]
test rax, rax
je 0x140166e12
mov rdi, qword [rsp + 0xc8]
mov edx, 2
mov r8, qword [rbx + 0x190]
cmp rax, rdi
mov rcx, rbx
cmovl rdi, rax
mov r9, rdi
call fcn.14015e060
mov rcx, qword [rsp + 0xc8]
sub qword [rbx + 0x110], rdi
mov rsi, rcx
sub rsi, rdi
jmp 0x140166e1d
mov rcx, qword [rsp + 0xc8]
mov rsi, rcx
test rsi, rsi
je 0x140166e60
mov r8, qword [rbx + 0x190]
mov r9, rsi
sub r8, rsi
mov edx, 4
add r8, rcx
mov rcx, rbx
call fcn.14015e060
mov rdx, qword [rbx + 0x108]
mov rcx, rbx
add rdx, rsi
mov qword [rbx + 0x108], rdx
call fcn.14016fda0
mov rcx, qword [rsp + 0xc8]
cmp byte [rbx + 0x1c5], 0
je 0x140166e72
cmp byte [rbx + 0x1c7], 0
je 0x140166ea0
mov rax, qword [rbx + 0x1170]
cmp qword [rbx + 0x108], rax
jne 0x140166ea0
lea rdx, str.We_are_completely_uploaded_and_fine
mov byte [rbx + 0x1c0], 1
mov rcx, rbx
call fcn.14015e230
mov rcx, qword [rsp + 0xc8]
mov rax, qword [rbx + 0x188]
cmp rax, rcx
je 0x140166ebf
sub rax, rcx
add qword [rbx + 0x190], rcx
mov qword [rbx + 0x188], rax
jmp 0x140166f1c
mov rax, qword [rbx + 0xcb0]
test rax, rax
jne 0x140166ee7
mov ecx, dword [rbx + 0x6b8]
call qword [fcn.1401f9828]
mov qword [rbx + 0xcb0], rax
test rax, rax
je 0x140166bfe
cmp byte [rbx + 0x1c0], 0
mov qword [rbx + 0x190], rax
mov qword [rbx + 0x188], 0
je 0x140166f1c
jmp 0x140166f0d
test byte [rbx + 0x144], 0x20
jne 0x140166f1c
and dword [rbx + 0x144], 0xfffffffd
mov rcx, rbx
call fcn.14015d6b0
xor eax, eax
mov rbx, qword [rsp + 0xb8]
add rsp, 0x80
pop r15
pop r14
pop rdi
pop rsi
pop rbp
ret