// File: /workspace/github_cpp_makefile_star2_O3/maydali28[P]cpp-socket/matrix_hal/socketUDP.cpp
// Function: matrix_hal::socketUDP::send(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::valarray<short>, int)
int socketUDP::send(std::string ip, int port,std::valarray<int16_t> buf, int length){
      std::ostringstream oss;
      if (buf.size())
      {
        // Convert all but the last element to avoid a trailing ","
        std::copy(std::begin(buf), std::end(buf)-1,
            std::ostream_iterator<int16_t>(oss, ","));

        // Now add the last element with no delimiter
        oss << buf[buf.size()-1 ];
      }
      std::cout << oss.str() <<"\n";
      std::string packet = oss.str();
      int result = send(ip,port, packet);
      return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rcx, %r12
movl %edx, -0x2c(%rbp)
movq %rsi, %r15
movq %rdi, -0x58(%rbp)
leaq -0x210(%rbp), %rbx
movq %rbx, %rdi
callq 0x2220
movq (%r12), %rax
testq %rax, %rax
je 0x2c11
movq 0x8(%r12), %r13
movq %rbx, -0x50(%rbp)
leaq 0x147a(%rip), %rcx      # 0x403d
movq %rcx, -0x48(%rbp)
leaq -0x2(,%rax,2), %r14
sarq %r14
testq %r14, %r14
jle 0x2bff
incq %r14
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2da0
addq $0x2, %r13
decq %r14
cmpq $0x1, %r14
ja 0x2bde
movq (%r12), %rax
movq 0x8(%r12), %r13
movswl -0x2(%r13,%rax,2), %esi
leaq -0x210(%rbp), %rdi
callq 0x2190
leaq -0x208(%rbp), %r12
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x2250
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x33a5(%rip), %rdi      # 0x5fd8
callq 0x21e0
leaq 0x13d2(%rip), %rsi      # 0x4011
movl $0x1, %edx
movq %rax, %rdi
callq 0x21e0
leaq -0x40(%rbp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x2c5e
callq 0x21a0
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x2250
leaq -0x88(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq -0x98(%rbp), %rdi
callq 0x26ea
leaq -0x68(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0x78(%rbp), %rdi
callq 0x26ea
leaq -0x98(%rbp), %rsi
leaq -0x78(%rbp), %rcx
movq -0x58(%rbp), %rdi
movl -0x2c(%rbp), %edx
callq 0x2b1a
movl %eax, %ebx
movq -0x78(%rbp), %rdi
cmpq %r15, %rdi
je 0x2ccf
callq 0x21a0
movq -0x98(%rbp), %rdi
cmpq %r12, %rdi
je 0x2ce0
callq 0x21a0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x2cee
callq 0x21a0
movq 0x32db(%rip), %rsi      # 0x5fd0
leaq -0x210(%rbp), %rdi
callq 0x2100
leaq -0x1a0(%rbp), %rdi
callq 0x20a0
movl %ebx, %eax
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2d75
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %r15, %rdi
je 0x2d39
callq 0x21a0
jmp 0x2d39
movq %rax, %rbx
movq -0x98(%rbp), %rdi
cmpq %r12, %rdi
je 0x2d4f
callq 0x21a0
jmp 0x2d4f
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
jne 0x2d6e
jmp 0x2d78
jmp 0x2d75
jmp 0x2d75
movq %rax, %rbx
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d78
callq 0x21a0
jmp 0x2d78
movq %rax, %rbx
movq 0x3251(%rip), %rsi      # 0x5fd0
leaq -0x210(%rbp), %rdi
callq 0x2100
leaq -0x1a0(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2260
nop