Function at 0x140016dd0
Capabilities:
Get socket status

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x678
mov dword [rsp + 0x40], 0
mov dword [rsp + 0x250], 0
mov dword [rsp + 0x460], 0
test edx, edx
je 0x1400170e4
mov edx, edx
mov rbx, rcx
mov rax, rcx
xor r10d, r10d
shl rdx, 4
lea rsi, [rcx + rdx]
nop dword [rax + rax]
mov rdx, qword [rax]
xor edi, edi
mov word [rax + 0xa], di
cmp rdx, 0xffffffffffffffff
je 0x140016e5e
movzx r11d, word [rax + 8]
test r11w, 0x710
je 0x140016e5e
test r11w, 0x300
jne 0x140017070
test r11b, 0x10
jne 0x140017010
test r11w, 0x600
jne 0x140016fb0
add rax, 0x10
cmp rax, rsi
jne 0x140016e20
test r10d, r10d
je 0x1400170d0
lea rcx, [rsp + 0x38]
mov rdx, r8
call sym.curlx_mstotv
mov r11d, dword [rsp + 0x460]
xor r9d, r9d
test r11d, r11d
je 0x140016e95
lea r9, [rsp + 0x460]
mov r10d, dword [rsp + 0x250]
xor r8d, r8d
test r10d, r10d
je 0x140016ead
lea r8, [rsp + 0x250]
mov ecx, dword [rsp + 0x40]
xor edx, edx
test ecx, ecx
jne 0x1400170c0
mov qword [rsp + 0x20], rax
xor ecx, ecx
call qword [sym.imp.WS2_32.dll_select]
mov edi, eax
test eax, eax
jle 0x140017110
xor edi, edi
lea r13, [rsp + 0x40]
lea r12, [rsp + 0x250]
lea rbp, [rsp + 0x460]
nop dword [rax]
mov rcx, qword [rbx]
xor eax, eax
mov word [rbx + 0xa], ax
cmp rcx, 0xffffffffffffffff
je 0x140016f71
mov rdx, r13
call sym.__WSAFDIsSet
test eax, eax
je 0x140016f25
movzx eax, word [rbx + 8]
test ah, 1
je 0x140016f1a
or word [rbx + 0xa], 0x100
test ah, 3
je 0x140016f25
or word [rbx + 0xa], 0x300
mov rcx, qword [rbx]
mov rdx, r12
call sym.__WSAFDIsSet
test eax, eax
je 0x140016f3f
test byte [rbx + 8], 0x10
je 0x140016f3f
or word [rbx + 0xa], 0x10
mov rcx, qword [rbx]
mov rdx, rbp
call sym.__WSAFDIsSet
test eax, eax
je 0x140016fa0
movzx edx, word [rbx + 8]
movzx eax, word [rbx + 0xa]
mov ecx, edx
and cx, 0x400
and dh, 2
je 0x140016f90
or ah, 2
mov word [rbx + 0xa], ax
test cx, cx
jne 0x140016f95
add edi, 1
add rbx, 0x10
cmp rbx, rsi
jne 0x140016ef0
mov eax, edi
add rsp, 0x678
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
test cx, cx
je 0x140016fa0
or ah, 4
mov word [rbx + 0xa], ax
jmp 0x140016f6e
cmp word [rbx + 0xa], 0
je 0x140016f71
jmp 0x140016f6e
mov r11d, dword [rsp + 0x460]
test r11d, r11d
je 0x14001713d
lea r9, [rsp + 0x468]
xor ecx, ecx
jmp 0x140016fdc
add ecx, 1
add r9, 8
cmp ecx, r11d
je 0x140016fe1
cmp rdx, qword [r9]
jne 0x140016fd0
cmp r11d, 0x40
je 0x140016e5e
cmp r11d, ecx
jne 0x140016e5e
add r11d, 1
mov qword [rsp + rcx*8 + 0x468], rdx
mov dword [rsp + 0x460], r11d
jmp 0x140016e5e
mov edi, dword [rsp + 0x250]
test edi, edi
je 0x140017131
lea r9, [rsp + 0x258]
xor ecx, ecx
jmp 0x14001703b
add ecx, 1
add r9, 8
cmp ecx, edi
je 0x140017040
cmp rdx, qword [r9]
jne 0x140017030
cmp edi, 0x40
je 0x140016e52
cmp edi, ecx
jne 0x140016e52
add edi, 1
mov qword [rsp + rcx*8 + 0x258], rdx
mov dword [rsp + 0x250], edi
jmp 0x140016e52
test r10d, r10d
je 0x14001714a
lea r9, [rsp + 0x48]
xor ecx, ecx
jmp 0x140017094
add ecx, 1
add r9, 8
cmp ecx, r10d
je 0x140017099
cmp rdx, qword [r9]
jne 0x140017088
cmp r10d, ecx
jne 0x140016e48
cmp r10d, 0x40
je 0x140016e48
add r10d, 1
mov qword [rsp + rcx*8 + 0x48], rdx
mov dword [rsp + 0x40], r10d
jmp 0x140016e48
lea rdx, [rsp + 0x40]
jmp 0x140016ebb
mov eax, dword [rsp + 0x250]
or eax, dword [rsp + 0x460]
jne 0x140016e70
test r8, r8
je 0x140017100
js 0x140017157
mov eax, 0xfffffffe
cmp r8, rax
cmovle rax, r8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_Sleep]
xor edi, edi
jmp 0x140016f7e
cmp eax, 0xffffffff
jne 0x140016f7e
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
xor edi, edi
cmp eax, 0x2714
setne dil
neg edi
jmp 0x140016f7e
xor ecx, ecx
mov edi, 1
jmp 0x140017054
xor ecx, ecx
mov r11d, 1
jmp 0x140016ff8
xor ecx, ecx
mov r10d, 1
jmp 0x1400170b0
mov ecx, 0x2726
call qword [sym.imp.WS2_32.dll_WSASetLastError]
jmp 0x140017119