Function at 0x140002d5c
Capabilities:
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x370]
sub rsp, 0x470
mov rax, qword [0x140121980]
xor rax, rsp
mov qword [rbp + 0x360], rax
mov r9d, 1
mov r8d, edx
mov rdi, rcx
cmp dword [rcx + 0x58], r9d
jne 0x140002de8
test edx, edx
jle 0x14000313d
mov eax, 0x10624dd3
xor r9d, r9d
mul r8d
xor ecx, ecx
shr edx, 6
imul eax, edx, 0x3e8
mov dword [rsp + 0x38], edx
xor edx, edx
sub r8d, eax
imul eax, r8d, 0x3e8
xor r8d, r8d
mov dword [rsp + 0x3c], eax
lea rax, [rsp + 0x38]
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_select]
jmp 0x14000313d
xor esi, esi
lea r12, [rcx + 0x50]
test r8d, r8d
je 0x140002e79
mov eax, 0x10624dd3
mov dword [rsp + 0x40], esi
imul r8d
mov ecx, r8d
mov dword [rbp + 0x150], r9d
sar edx, 6
mov eax, edx
shr eax, 0x1f
add edx, eax
imul eax, edx, 0x3e8
mov dword [rsp + 0x38], edx
sub ecx, eax
imul eax, ecx, 0x3e8
mov rcx, qword [r12]
mov qword [rbp + 0x158], rcx
mov dword [rsp + 0x3c], eax
mov rax, qword [rdi + 0x28]
cmp rax, qword [rdi + 0x20]
je 0x140002e4c
mov qword [rsp + 0x48], rcx
mov dword [rsp + 0x40], r9d
mov ecx, dword [r12]
lea rax, [rsp + 0x38]
test r8d, r8d
lea rdx, [rbp + 0x150]
lea r8, [rsp + 0x40]
cmovle rax, rsi
add ecx, r9d
xor r9d, r9d
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_select]
lea r15, [rdi + 8]
mov r13d, dword [r15 + 8]
sub r13d, dword [r15]
mov r9, qword [r15 + 8]
mov r8, qword [r15]
mov rdx, r9
sub rdx, r8
lea eax, [r13 + 0x5dc]
movsxd rcx, eax
cmp rcx, rdx
jae 0x140002eaa
lea rax, [r8 + rcx]
mov qword [r15 + 8], rax
jmp 0x140002ee0
jbe 0x140002ee0
mov rax, qword [r15 + 0x10]
sub rax, r8
cmp rcx, rax
jbe 0x140002eca
mov rdx, rcx
lea r8, [rsp + 0x30]
mov rcx, r15
call fcn.1400015e4
jmp 0x140002ee0
sub rcx, rdx
lea rbx, [rcx + r9]
mov rcx, r9
mov rdx, rbx
call fcn.1400016e8
mov qword [r15 + 8], rbx
mov rdx, qword [r15]
xor r9d, r9d
mov rcx, qword [r12]
mov r8d, 0x5dc
movsxd rbx, r13d
add rdx, rbx
call qword [sym.imp.WS2_32.dll_recv]
mov dword [rsp + 0x38], eax
test eax, eax
jns 0x140002f26
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x140002f99
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2734
je 0x140002f99
mov eax, dword [rsp + 0x38]
lea r14, [rdi + 8]
test eax, eax
jle 0x140002fff
mov r9, qword [r14 + 8]
add eax, r13d
mov r8, qword [r14]
mov rdx, r9
sub rdx, r8
movsxd rcx, eax
cmp rcx, rdx
jae 0x140002f57
lea rax, [rcx + r8]
mov qword [r14 + 8], rax
jmp 0x140002e7d
jbe 0x140002e7d
mov rax, qword [r14 + 0x10]
sub rax, r8
cmp rcx, rax
jbe 0x140002f7e
mov rdx, rcx
lea r8, [rsp + 0x30]
mov rcx, r14
call fcn.1400015e4
jmp 0x140002e7d
sub rcx, rdx
lea rbx, [rcx + r9]
mov rcx, r9
mov rdx, rbx
call fcn.1400016e8
mov qword [r14 + 8], rbx
jmp 0x140002e7d
mov r8, qword [rdi + 0x10]
mov rdx, qword [rdi + 8]
mov rcx, r8
sub rcx, rdx
cmp rbx, rcx
jae 0x140002fc7
lea rax, [rbx + rdx]
mov qword [rdi + 0x10], rax
lea r15, str.Connection_error__n
lea r14, str.Connection_closed__n
jmp 0x1400030e5
jbe 0x140002fb4
mov rax, qword [rdi + 0x18]
sub rax, rdx
cmp rbx, rax
jbe 0x140002fe8
lea r8, [rsp + 0x30]
mov rdx, rbx
lea rcx, [rdi + 8]
call fcn.1400015e4
jmp 0x140002fb4
sub rbx, rcx
mov rcx, r8
add rbx, r8
mov rdx, rbx
call fcn.1400016e8
mov qword [rdi + 0x10], rbx
jmp 0x140002fb4
mov r8, qword [r14 + 8]
mov rdx, qword [r14]
mov rcx, r8
sub rcx, rdx
cmp rbx, rcx
jae 0x14000301b
lea rax, [rbx + rdx]
mov qword [r14 + 8], rax
jmp 0x140003050
jbe 0x140003050
mov rax, qword [r14 + 0x10]
sub rax, rdx
cmp rbx, rax
jbe 0x14000303b
lea r8, [rsp + 0x30]
mov rdx, rbx
mov rcx, r14
call fcn.1400015e4
jmp 0x140003050
sub rbx, rcx
mov rcx, r8
add rbx, r8
mov rdx, rbx
call fcn.1400016e8
mov qword [r14 + 8], rbx
mov rcx, qword [rdi + 0x50]
call qword [sym.imp.WS2_32.dll_closesocket]
mov ecx, 2
mov dword [rdi + 0x58], 1
call fcn.1400a1564
cmp dword [rsp + 0x38], esi
lea r14, str.Connection_closed__n
mov rcx, r14
lea r15, str.Connection_error__n
cmovl rcx, r15
mov rdx, rax
call fcn.1400a16f8
jmp 0x1400030e5
mov r8d, dword [rdi + 0x28]
mov rdx, rcx
sub r8d, dword [rdi + 0x20]
xor r9d, r9d
mov rcx, qword [rdi + 0x50]
call qword [sym.imp.WS2_32.dll_send]
movsxd rbx, eax
test eax, eax
jns 0x1400030c7
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x14000311d
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2734
je 0x14000311d
test ebx, ebx
jle 0x1400030f1
mov r8, qword [rdi + 0x20]
lea rcx, [r8 + rbx]
cmp r8, rcx
je 0x1400030e5
mov rdx, qword [rdi + 0x28]
call fcn.1400013ac
mov qword [rdi + 0x28], rax
mov rcx, qword [rdi + 0x20]
cmp qword [rdi + 0x28], rcx
jne 0x14000308e
jmp 0x14000311d
mov rcx, qword [rdi + 0x50]
call qword [sym.imp.WS2_32.dll_closesocket]
mov ecx, 2
mov dword [rdi + 0x58], 1
call fcn.1400a1564
test ebx, ebx
mov rdx, rax
cmovs r14, r15
mov rcx, r14
call fcn.1400a16f8
mov rax, qword [rdi + 0x28]
cmp rax, qword [rdi + 0x20]
jne 0x14000313d
cmp dword [rdi + 0x58], esi
jne 0x14000313d
mov rcx, qword [rdi + 0x50]
call qword [sym.imp.WS2_32.dll_closesocket]
mov dword [rdi + 0x58], 1
mov rcx, qword [rbp + 0x360]
xor rcx, rsp
call fcn.14009a6f0
mov rbx, qword [rsp + 0x4c0]
add rsp, 0x470
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret