// File: /workspace/github_cpp_makefile_star2_O1/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, %r14d
movq %rsi, %r15
movq %rdi, -0x58(%rbp)
leaq -0x210(%rbp), %rbx
movq %rbx, %rdi
callq 0x2220
movq (%r12), %rax
testq %rax, %rax
je 0x2c0c
movl %r14d, -0x2c(%rbp)
movq 0x8(%r12), %r13
movq %rbx, -0x50(%rbp)
leaq 0x1482(%rip), %rcx      # 0x403d
movq %rcx, -0x48(%rbp)
leaq -0x2(,%rax,2), %r14
sarq %r14
testq %r14, %r14
jle 0x2bee
incq %r14
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2d9a
addq $0x2, %r13
decq %r14
cmpq $0x1, %r14
jg 0x2bd6
movq (%r12), %rax
movq 0x8(%r12), %rcx
movswl -0x2(%rcx,%rax,2), %esi
leaq -0x210(%rbp), %rdi
callq 0x2190
movl -0x2c(%rbp), %r14d
leaq -0x208(%rbp), %r12
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x2250
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x33aa(%rip), %rdi      # 0x5fd8
callq 0x21e0
leaq 0x13d7(%rip), %rsi      # 0x4011
movl $0x1, %edx
movq %rax, %rdi
callq 0x21e0
leaq -0x40(%rbp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x2c59
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 %r14d, %edx
callq 0x2b0e
movl %eax, %ebx
movq -0x78(%rbp), %rdi
cmpq %r15, %rdi
je 0x2cca
callq 0x21a0
movq -0x98(%rbp), %rdi
cmpq %r12, %rdi
je 0x2cdb
callq 0x21a0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x2ce9
callq 0x21a0
movq 0x32e0(%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 0x2d70
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %r15, %rdi
je 0x2d34
callq 0x21a0
jmp 0x2d34
movq %rax, %rbx
movq -0x98(%rbp), %rdi
cmpq %r12, %rdi
je 0x2d4a
callq 0x21a0
jmp 0x2d4a
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
jne 0x2d69
jmp 0x2d73
jmp 0x2d70
jmp 0x2d70
movq %rax, %rbx
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d73
callq 0x21a0
jmp 0x2d73
movq %rax, %rbx
movq 0x3256(%rip), %rsi      # 0x5fd0
leaq -0x210(%rbp), %rdi
callq 0x2100
leaq -0x1a0(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2260