Function at 0x140018c10
Capabilities:
Get socket status

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x688
mov qword [rsp + 0x6e0], r8
mov dword [rsp + 0x50], 0
mov dword [rsp + 0x260], 0
mov dword [rsp + 0x470], 0
test edx, edx
je 0x140018f29
lea eax, [rdx - 1]
mov byte [rsp + 0x3f], 0
mov rbx, rcx
xor r13d, r13d
mov byte [rsp + 0x3e], 0
shl rax, 4
xor r12d, r12d
xor ebp, ebp
mov byte [rsp + 0x3d], 0
lea rsi, [rcx + rax + 0x10]
mov rax, rcx
lea r11, [rsp + 0x470]
lea r10, [rsp + 0x260]
lea r9, [rsp + 0x50]
nop
mov rdx, qword [rax]
xor edi, edi
mov word [rax + 0xa], di
cmp rdx, 0xffffffffffffffff
je 0x140018cc8
movzx r8d, word [rax + 8]
test r8b, 7
je 0x140018cc8
test r8b, 1
jne 0x140018ec0
test r8b, 4
jne 0x140018e60
and r8d, 2
jne 0x140018e08
add rax, 0x10
cmp rax, rsi
jne 0x140018c90
cmp byte [rsp + 0x3d], 0
jne 0x140018f10
xor ebp, ebp
cmp byte [rsp + 0x3e], 0
jne 0x140018f73
xor r12d, r12d
cmp byte [rsp + 0x3f], 0
jne 0x140018f80
xor r13d, r13d
test ebp, ebp
je 0x140018f20
mov rdx, qword [rsp + 0x6e0]
lea rcx, [rsp + 0x48]
call sym.curlx_mstotv
mov edx, dword [rsp + 0x470]
mov ecx, dword [rsp + 0x260]
lea r9, [rsp + 0x470]
mov r10, rax
mov r11d, dword [rsp + 0x50]
xor eax, eax
lea r8, [rsp + 0x260]
test edx, edx
lea rdx, [rsp + 0x50]
mov qword [rsp + 0x20], r10
cmove r9, rax
test ecx, ecx
cmove r8, rax
test r11d, r11d
cmove rdx, rax
xor ecx, ecx
call qword [sym.imp.WS2_32.dll_select]
mov r12d, eax
test eax, eax
jle 0x140018f90
xor r12d, r12d
lea r13, [rsp + 0x50]
lea rbp, [rsp + 0x260]
lea rdi, [rsp + 0x470]
jmp 0x140018dac
test byte [rbx + 8], 2
je 0x140018dfb
or word [rbx + 0xa], 2
add r12d, 1
add rbx, 0x10
cmp rbx, rsi
je 0x140018f5c
mov rcx, qword [rbx]
xor eax, eax
mov word [rbx + 0xa], ax
cmp rcx, 0xffffffffffffffff
je 0x140018d9f
mov rdx, r13
call sym.__WSAFDIsSet
test eax, eax
je 0x140018dd2
test byte [rbx + 8], 1
je 0x140018dd2
or word [rbx + 0xa], 1
mov rcx, qword [rbx]
mov rdx, rbp
call sym.__WSAFDIsSet
test eax, eax
je 0x140018dec
test byte [rbx + 8], 4
je 0x140018dec
or word [rbx + 0xa], 4
mov rcx, qword [rbx]
mov rdx, rdi
call sym.__WSAFDIsSet
test eax, eax
jne 0x140018d90
cmp word [rbx + 0xa], 0
je 0x140018d9f
jmp 0x140018d9b
test r13d, r13d
je 0x140018fc6
lea r8d, [r13 + 1]
mov ecx, 1
mov r14, r8
nop dword [rax]
cmp rdx, qword [r11 + rcx*8]
je 0x140018cc8
mov edi, ecx
add rcx, 1
cmp rcx, r8
jne 0x140018e20
cmp r13d, 0x40
je 0x140018cc8
cmp r13d, edi
jne 0x140018cc8
mov r13d, r14d
mov qword [rsp + rdi*8 + 0x478], rdx
mov byte [rsp + 0x3f], 1
jmp 0x140018cc8
test r12d, r12d
je 0x140018fb8
lea edi, [r12 + 1]
mov ecx, 1
mov r15, rdi
nop word cs:[rax + rax]
cmp rdx, qword [r10 + rcx*8]
je 0x140018cbe
mov r14d, ecx
add rcx, 1
cmp rdi, rcx
jne 0x140018e80
cmp r12d, 0x3f
ja 0x140018cbe
cmp r14d, r12d
jne 0x140018cbe
mov r12d, r15d
mov qword [rsp + r14*8 + 0x268], rdx
mov byte [rsp + 0x3e], 1
jmp 0x140018cbe
test ebp, ebp
je 0x140018fac
lea r14d, [rbp + 1]
mov ecx, 1
mov r15, r14
nop dword [rax]
cmp rdx, qword [r9 + rcx*8]
je 0x140018cb4
mov edi, ecx
add rcx, 1
cmp rcx, r14
jne 0x140018ed8
cmp edi, ebp
jne 0x140018cb4
cmp ebp, 0x40
je 0x140018cb4
mov ebp, r15d
mov qword [rsp + rdi*8 + 0x58], rdx
mov byte [rsp + 0x3d], 1
jmp 0x140018cb4
mov dword [rsp + 0x50], ebp
jmp 0x140018cde
or r13d, r12d
jne 0x140018d02
cmp qword [rsp + 0x6e0], 0
je 0x140018f59
js 0x140018fd3
mov eax, 0xfffffffe
cmp qword [rsp + 0x6e0], rax
cmovle rax, qword [rsp + 0x6e0]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_Sleep]
xor r12d, r12d
mov eax, r12d
add rsp, 0x688
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov dword [rsp + 0x260], r12d
jmp 0x140018cec
mov dword [rsp + 0x470], r13d
jmp 0x140018cfa
cmp eax, 0xffffffff
jne 0x140018f5c
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
xor r12d, r12d
cmp eax, 0x2714
setne r12b
neg r12d
jmp 0x140018f5c
xor edi, edi
mov ebp, 1
jmp 0x140018f01
xor r14d, r14d
mov r12d, 1
jmp 0x140018eac
xor edi, edi
mov r13d, 1
jmp 0x140018e4b
mov ecx, 0x2726
call qword [sym.imp.WS2_32.dll_WSASetLastError]
jmp 0x140018f95