Function at 0x140021ce0
Capabilities:
Connect socket
Set socket configuration

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 7]
sub rsp, 0xc0
mov rax, qword [0x1401121f0]
xor rax, rsp
mov qword [rbp - 9], rax
mov r12d, r8d
mov r14, rdx
mov rdi, rcx
mov rbx, qword [rbp + 0x67]
mov qword [rbp - 0x69], rbx
mov r15, qword [rbp + 0x77]
mov r13, qword [rbp + 0x7f]
xor ecx, ecx
cmp r8d, 2
je 0x140021d35
cmp r8d, 0x17
jne 0x140021f04
lea eax, [r9 - 1]
test eax, 0xfffffffb
jne 0x140021f04
xor eax, eax
lea edx, [rax + 0x10]
lock cmpxchg qword [rdi + 0x18], rcx
mov rsi, rax
mov qword [rbp - 0x49], rax
jne 0x140021dcb
mov dword [rbp - 0x41], 0x25a207b9
mov dword [rbp - 0x3d], 0x4660ddf3
mov dword [rbp - 0x39], 0xe576e98e
mov dword [rbp - 0x35], 0x3e06748c
mov dword [rbp - 0x31], ecx
mov qword [rsp + 0x40], rcx
mov qword [rsp + 0x38], rcx
lea rax, [rbp - 0x31]
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x28], 8
lea rax, [rbp - 0x49]
mov qword [rsp + 0x20], rax
mov r9d, edx
lea r8, [rbp - 0x41]
mov edx, 0xc8000006
mov rcx, qword [r14]
call qword [sym.imp.WS2_32.dll_WSAIoctl]
mov rcx, qword [rbp - 0x49]
test eax, eax
cmovne rcx, rdi
mov qword [rbp - 0x49], rcx
xchg qword [rdi + 0x18], rcx
mov rsi, qword [rbp - 0x49]
xor ecx, ecx
lea edx, [rcx + 0x10]
cmp rsi, rdi
cmove rsi, rcx
test rsi, rsi
je 0x140021f04
xorps xmm0, xmm0
xor eax, eax
movups xmmword [rbp - 0x29], xmm0
mov qword [rbp - 0x19], rax
mov dword [rbp - 0x11], eax
mov word [rbp - 0x29], r12w
mov rcx, qword [r14]
cmp rcx, 0xffffffffffffffff
jne 0x140021e09
mov edx, 0x2719
lea rcx, [r15 + 0x38]
call fcn.140032a70
jmp 0x140021e2f
mov r8d, 0x1c
cmp r12d, 2
cmove r8d, edx
lea rdx, [rbp - 0x29]
call qword [sym.imp.WS2_32.dll_bind]
test eax, eax
setne dl
lea rcx, [r15 + 0x38]
call fcn.14001fa70
cmp dword [r15 + 0x38], 0
je 0x140021ea3
mov edx, 4
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
mov eax, dword [rdx + rcx]
cmp dword [0x140119e8c], eax
jle 0x140021e7f
lea rcx, [0x140119e8c]
call fcn.1400a0e50
cmp dword [0x140119e8c], 0xffffffff
jne 0x140021e7f
lea rcx, [0x1400db070]
call fcn.1400a12a4
lea rcx, [0x140119e8c]
call fcn.1400a0df0
mov rcx, qword [r15 + 0x40]
mov rax, qword [0x140112e28]
cmp qword [rcx + 8], rax
jne 0x140021e9a
cmp dword [r15 + 0x38], 0x2726
je 0x140021ea3
mov rcx, qword [rdi + 8]
jmp 0x140021f49
mov byte [r15 + 0x68], 1
mov rax, qword [rdi + 8]
lock inc dword [rax + 0x30]
mov qword [rsp + 0x30], r13
xor eax, eax
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], eax
xor r9d, r9d
mov r8d, dword [rbp + 0x6f]
mov rdx, rbx
mov rcx, qword [r14]
call rsi
mov ebx, eax
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
test ebx, ebx
jne 0x140021ef6
cmp eax, 0x3e5
je 0x140021ef6
xor r9d, r9d
mov r8d, eax
mov rdx, r13
mov rcx, qword [rdi + 8]
call fcn.14001efe0
jmp 0x140021f55
mov rdx, r13
mov rcx, qword [rdi + 8]
call fcn.14001ef50
jmp 0x140021f55
xor eax, eax
lock cmpxchg qword [rdi + 0x10], rcx
mov rsi, rax
jne 0x140021f23
mov rcx, qword [rdi]
mov rcx, qword [rcx]
call fcn.14003f320
mov rsi, rax
xchg qword [rdi + 0x10], rax
test byte [r14 + 8], 3
jne 0x140021fb4
mov rcx, qword [r14]
cmp rcx, 0xffffffffffffffff
jne 0x140021f81
mov edx, 0x2719
lea rcx, [r15 + 0x38]
call fcn.140032a70
mov rcx, qword [rsi + 0x28]
lock inc dword [rcx + 0x30]
mov rdx, r15
call fcn.14001eed0
mov eax, 0xffffffff
mov rcx, qword [rbp - 9]
xor rcx, rsp
call fcn.1400a0cd0
mov rbx, qword [rsp + 0x118]
add rsp, 0xc0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
mov dword [rbp - 0x2d], 1
lea r8, [rbp - 0x2d]
mov edx, 0x8004667e
call qword [sym.imp.WS2_32.dll_ioctlsocket]
mov ebx, eax
test eax, eax
sets dl
lea rcx, [r15 + 0x38]
call fcn.14001fa70
test ebx, ebx
js 0x140021f45
or byte [r14 + 8], 2
mov rbx, qword [rbp - 0x69]
mov rcx, qword [r14]
cmp rcx, 0xffffffffffffffff
jne 0x140021fcd
mov edx, 0x2719
lea rcx, [r15 + 0x38]
call fcn.140032a70
jmp 0x140021ff2
mov r8d, dword [rbp + 0x6f]
mov rdx, rbx
call qword [sym.imp.WS2_32.dll_connect]
mov ebx, eax
test eax, eax
setne dl
lea rcx, [r15 + 0x38]
call fcn.14001fa70
test ebx, ebx
je 0x140021f45
mov ebx, 4
mov rax, qword gs:[0x58]
add rbx, qword [rax]
mov edx, dword [0x140119e8c]
cmp edx, dword [rbx]
jle 0x140022042
lea rcx, [0x140119e8c]
call fcn.1400a0e50
mov edx, dword [0x140119e8c]
cmp edx, 0xffffffff
jne 0x140022042
lea rcx, [0x1400db070]
call fcn.1400a12a4
lea rcx, [0x140119e8c]
call fcn.1400a0df0
mov edx, dword [0x140119e8c]
mov rcx, qword [r15 + 0x40]
mov rax, qword [0x140112e28]
cmp qword [rcx + 8], rax
jne 0x14002205d
cmp dword [r15 + 0x38], 0x2734
je 0x1400220b1
cmp edx, dword [rbx]
jle 0x14002208e
lea rcx, [0x140119e8c]
call fcn.1400a0e50
cmp dword [0x140119e8c], 0xffffffff
jne 0x14002208e
lea rcx, [0x1400db070]
call fcn.1400a12a4
lea rcx, [0x140119e8c]
call fcn.1400a0df0
mov rcx, qword [r15 + 0x40]
mov rax, qword [0x140112e28]
cmp qword [rcx + 8], rax
jne 0x140021f45
cmp dword [r15 + 0x38], 0x2733
jne 0x140021f45
xor eax, eax
mov dword [rbp - 0x59], eax
lea rax, [0x140112e30]
mov qword [rbp - 0x51], rax
movups xmm0, xmmword [rbp - 0x59]
movups xmmword [r15 + 0x38], xmm0
mov rbx, qword [r14]
lea rcx, [rsi + 0x30]
mov qword [rbp - 0x69], rcx
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov byte [rbp - 0x61], 1
cmp byte [rsi + 0x1e8], 0
je 0x1400220fa
mov rcx, qword [rsi + 0x28]
lock inc dword [rcx + 0x30]
mov rdx, r15
call fcn.14001eed0
jmp 0x140022122
lea rcx, [rsi + 0x110]
mov r8, r15
mov rdx, rbx
call fcn.1400275b0
mov rcx, qword [rsi + 0x28]
lock inc dword [rcx + 0x30]
test al, al
je 0x140022122
lea rcx, [rsi + 0x58]
call fcn.140020840
nop
mov rcx, qword [rbp - 0x69]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, 3
jmp 0x140021f5a