Function at 0x1401589f0
Capabilities:
Get socket status

Disassembly:
mov qword [rsp + 0x10], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x580]
sub rsp, 0x680
mov rax, qword [0x1401a95d8]
xor rax, rsp
mov qword [rbp + 0x570], rax
xor r13d, r13d
mov esi, edx
mov r12, r8
mov r14, rcx
test rcx, rcx
je 0x140158a4d
mov eax, r13d
test edx, edx
je 0x140158a4d
mov rdx, rcx
lea ecx, [r13 + 0x10]
cmp qword [rdx], 0xffffffffffffffff
jne 0x140158a7f
inc eax
add rdx, rcx
cmp eax, esi
jb 0x140158a3e
mov rcx, r12
call fcn.140158ea4
mov rcx, qword [rbp + 0x570]
xor rcx, rsp
call fcn.140171490
mov rbx, qword [rsp + 0x6c8]
add rsp, 0x680
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
mov edx, r13d
mov dword [rsp + 0x40], r13d
mov dword [rbp + 0x360], edx
mov r9d, r13d
mov r10d, r13d
mov dword [rbp + 0x150], r13d
or rdi, 0xffffffffffffffff
mov r15d, r13d
mov rbx, r14
mov r8, qword [rbx]
mov word [rbx + 0xa], r13w
cmp r8, 0xffffffffffffffff
je 0x140158bb4
jae 0x140158bdb
movzx r11d, word [rbx + 8]
mov eax, 0x710
test ax, r11w
je 0x140158baf
cmp r8, rdi
mov rax, r8
cmovbe rax, rdi
mov rdi, rax
mov eax, 0x300
test ax, r11w
je 0x140158b24
mov ecx, r13d
test r9d, r9d
je 0x140158b00
mov eax, ecx
cmp qword [rsp + rax*8 + 0x48], r8
je 0x140158b00
inc ecx
cmp ecx, r9d
jb 0x140158af0
cmp ecx, r9d
jne 0x140158b1f
cmp r9d, 0x40
jae 0x140158b1f
mov eax, ecx
mov qword [rsp + rax*8 + 0x48], r8
mov r9d, dword [rsp + 0x40]
inc r9d
mov dword [rsp + 0x40], r9d
mov ecx, reloc.WS2_32.dll_recv
test cl, r11b
je 0x140158b6a
mov ecx, r13d
test r10d, r10d
je 0x140158b44
mov eax, ecx
cmp qword [rbp + rax*8 + 0x158], r8
je 0x140158b44
inc ecx
cmp ecx, r10d
jb 0x140158b31
cmp ecx, r10d
jne 0x140158b6a
cmp r10d, 0x40
jae 0x140158b6a
mov eax, ecx
mov qword [rbp + rax*8 + 0x158], r8
mov r10d, dword [rbp + 0x150]
inc r10d
mov dword [rbp + 0x150], r10d
mov eax, 0x600
test ax, r11w
je 0x140158baf
mov ecx, r13d
test edx, edx
je 0x140158b8e
mov eax, ecx
cmp qword [rbp + rax*8 + 0x368], r8
je 0x140158b8e
inc ecx
cmp ecx, edx
jb 0x140158b7c
cmp ecx, edx
jne 0x140158baf
cmp edx, 0x40
jae 0x140158baf
mov eax, ecx
mov qword [rbp + rax*8 + 0x368], r8
mov edx, dword [rbp + 0x360]
inc edx
mov dword [rbp + 0x360], edx
mov ecx, reloc.WS2_32.dll_recv
inc r15d
add rbx, rcx
cmp r15d, esi
jb 0x140158aa4
test r9d, r9d
jne 0x140158bee
test r10d, r10d
jne 0x140158bee
test edx, edx
jne 0x140158bee
mov rcx, r12
call fcn.140158ea4
jmp 0x140158c44
mov ecx, 0x2726
call qword [sym.imp.WS2_32.dll_WSASetLastError]
or eax, 0xffffffff
jmp 0x140158a55
mov rdx, r12
lea rcx, [rsp + 0x30]
call fcn.14016d418
mov ecx, dword [rbp + 0x360]
neg ecx
mov qword [rsp + 0x20], rax
lea rcx, [rbp + 0x360]
sbb r9, r9
and r9, rcx
mov ecx, dword [rbp + 0x150]
neg ecx
lea rcx, [rbp + 0x150]
sbb r8, r8
and r8, rcx
mov ecx, dword [rsp + 0x40]
neg ecx
lea rcx, [rsp + 0x40]
sbb rdx, rdx
and rdx, rcx
lea ecx, [rdi + 1]
call qword [sym.imp.WS2_32.dll_select]
mov ebx, eax
test eax, eax
jg 0x140158c65
cmp eax, 0xffffffff
jne 0x140158c5e
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2714
cmove ebx, r13d
mov eax, ebx
jmp 0x140158a55
lea rbx, [r14 + 0xa]
mov edi, r13d
mov r14d, 0x200
mov eax, reloc.WS2_32.dll_recv
mov r12d, 0x100
mov r15d, 0x400
mov rcx, qword [rbx - 0xa]
mov word [rbx], r13w
cmp rcx, 0xffffffffffffffff
je 0x140158d20
lea rdx, [rsp + 0x40]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x140158cc2
test word [rbx - 2], r12w
je 0x140158cae
or word [rbx], r12w
movzx eax, word [rbx]
mov ecx, 0x300
test word [rbx - 2], cx
je 0x140158cc2
or ax, cx
mov word [rbx], ax
mov rcx, qword [rbx - 0xa]
lea rdx, [rbp + 0x150]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x140158ce3
mov eax, reloc.WS2_32.dll_recv
test byte [rbx - 2], al
je 0x140158ce3
or word [rbx], ax
mov rcx, qword [rbx - 0xa]
lea rdx, [rbp + 0x360]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x140158d13
test word [rbx - 2], r14w
je 0x140158d02
or word [rbx], r14w
movzx eax, word [rbx]
test word [rbx - 2], r15w
je 0x140158d13
or ax, r15w
mov word [rbx], ax
mov eax, reloc.WS2_32.dll_recv
cmp word [rbx], r13w
je 0x140158d20
inc edi
add rbx, rax
sub rsi, 1
jne 0x140158c83
mov eax, edi
jmp 0x140158a55