// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/serial.cc
// Function: serial::Serial::readlines(unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<string>
Serial::readlines (size_t size, string eol)
{
  ScopedReadLock lock(this->pimpl_);
  std::vector<std::string> lines;
  size_t eol_len = eol.length ();
  uint8_t *buffer_ = static_cast<uint8_t*>
    (alloca (size * sizeof (uint8_t)));
  size_t read_so_far = 0;
  size_t start_of_line = 0;
  while (read_so_far < size) {
    size_t bytes_read = this->read_ (buffer_+read_so_far, 1);
    read_so_far += bytes_read;
    if (bytes_read == 0) {
      if (start_of_line != read_so_far) {
        lines.push_back (
          string (reinterpret_cast<const char*> (buffer_ + start_of_line),
            read_so_far - start_of_line));
      }
      break; // Timeout occured on reading 1 byte
    }
    if (string (reinterpret_cast<const char*>
         (buffer_ + read_so_far - eol_len), eol_len) == eol) {
      // EOL found
      lines.push_back(
        string(reinterpret_cast<const char*> (buffer_ + start_of_line),
          read_so_far - start_of_line));
      start_of_line = read_so_far;
    }
    if (read_so_far == size) {
      if (start_of_line != read_so_far) {
        lines.push_back(
          string(reinterpret_cast<const char*> (buffer_ + start_of_line),
            read_so_far - start_of_line));
      }
      break; // Reached the maximum read length
    }
  }
  return lines;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %r12
movq %rdx, %r14
movq %rdi, %rbx
movq %rsi, -0x80(%rbp)
movq 0x8(%rsi), %rdi
movq %rdi, -0x68(%rbp)
callq 0xcc6c
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq %rbx, -0x38(%rbp)
andq $0x0, 0x10(%rbx)
xorl %r15d, %r15d
xorl %eax, %eax
movq %r12, -0x70(%rbp)
subq 0x8(%r12), %rax
movq %rax, -0x78(%rbp)
movq %rsp, %rcx
leaq 0xf(%r14), %rax
andq $-0x10, %rax
subq %rax, %rcx
movq %rcx, -0x40(%rbp)
movq %rcx, %rsp
movq $0x0, -0x30(%rbp)
cmpq %r14, %r15
jae 0xa44f
movq -0x40(%rbp), %rax
leaq (%rax,%r15), %rsi
movq -0x80(%rbp), %rdi
pushq $0x1
popq %rdx
callq 0x9f98
addq %rax, %r15
testq %rax, %rax
je 0xa412
movq %r14, %r12
movq -0x40(%rbp), %rax
leaq (%rax,%r15), %r13
movq -0x78(%rbp), %rax
leaq (%rax,%r13), %rsi
leaq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq -0x60(%rbp), %rbx
movq %rbx, %rdi
movq %r13, %rdx
callq 0x9738
movq %rbx, %rdi
movq -0x70(%rbp), %rsi
callq 0xa8da
movl %eax, %r14d
movq %rbx, %rdi
callq 0x8170
testb %r14b, %r14b
je 0xa3d0
movq -0x30(%rbp), %rsi
addq -0x40(%rbp), %rsi
leaq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq %rbx, %rdi
movq %r13, %rdx
callq 0x9738
movq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x9a32
movq %r12, %r14
movq %rbx, %rdi
callq 0x8170
movq %r15, -0x30(%rbp)
jmp 0xa3d3
movq %r12, %r14
cmpq %r14, %r15
jne 0xa329
cmpq %r14, -0x30(%rbp)
je 0xa44f
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rcx
addq %rcx, %rsi
leaq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
movq %rax, (%rdi)
addq %rcx, %r14
movq %r14, %rdx
callq 0x9738
leaq -0x60(%rbp), %rsi
movq -0x38(%rbp), %rdi
callq 0x9a32
jmp 0xa446
cmpq %r15, -0x30(%rbp)
je 0xa44f
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rcx
addq %rcx, %rsi
leaq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
movq %rax, (%rdi)
addq %rcx, %r15
movq %r15, %rdx
callq 0x9738
leaq -0x60(%rbp), %rsi
movq -0x38(%rbp), %rdi
callq 0x9a32
leaq -0x60(%rbp), %rdi
callq 0x8170
leaq -0x68(%rbp), %rdi
callq 0xa8a4
movq -0x38(%rbp), %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa473
jmp 0xa485
jmp 0xa473
jmp 0xa485
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x8170
jmp 0xa488
jmp 0xa485
jmp 0xa485
movq %rax, %rbx
movq -0x38(%rbp), %rdi
callq 0x965e
leaq -0x68(%rbp), %rdi
callq 0xa8a4
movq %rbx, %rdi
callq 0x85c0