LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/chgzm[P]minic/util.c
// Function: strintmap_get
int strintmap_get(StrIntMap* map, const char* key) {
    const int hash  = calc_hash(key);
    const int index = hash % map->capacity;
    if (map->entries[index] == NULL) {
        fprintf(stderr, "no key=\"%s\"\n", key);
        exit(-1);
    }
    else {
        StrIntMapEntry* current = map->entries[index];
        while (current != NULL) {
            if (strcmp(current->key, key) == 0) {
                return current->val;
            }

            current = current->next;
        }

        fprintf(stderr, "no key=\"%s\"\n", key);
        exit(-1);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x83b4
cltd
idivl 0xc(%r14)
movq (%r14), %rax
movslq %edx, %rcx
movq (%rax,%rcx,8), %r14
testq %r14, %r14
je 0x85c1
testq %r14, %r14
je 0x85c1
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x10d0
testl %eax, %eax
je 0x85b5
movq 0x10(%r14), %r14
jmp 0x859b
movl 0x8(%r14), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x5a28(%rip), %rax      # 0xdff0
movq (%rax), %rdi
leaq 0x2726(%rip), %rsi      # 0xacf8
movq %rbx, %rdx
xorl %eax, %eax
callq 0x10e0
pushq $-0x1
popq %rdi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/list_ports_linux.cc
// Function: format[abi:cxx11](char const*, ...)
string
format(const char* format, ...)
{
    va_list ap;

    size_t buffer_size_bytes = 256;

    string result;

    char* buffer = (char*)malloc(buffer_size_bytes);

    if( buffer == NULL )
        return result;

    bool done = false;

    unsigned int loop_count = 0;

    while(!done)
    {
        va_start(ap, format);

        int return_value = vsnprintf(buffer, buffer_size_bytes, format, ap);

        if( return_value < 0 )
        {
            done = true;
        }
        else if( return_value >= buffer_size_bytes )
        {
            // Realloc and try again.

            buffer_size_bytes = return_value + 1;

            char* new_buffer_ptr = (char*)realloc(buffer, buffer_size_bytes);

            if( new_buffer_ptr == NULL )
            {
                done = true;
            }
            else
            {
                buffer = new_buffer_ptr;
            }
        }
        else
        {
            result = buffer;
            done = true;
        }

        va_end(ap);

        if( ++loop_count > 5 )
            done = true;
    }

    free(buffer);

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, -0x38(%rbp)
movq %rdx, -0xf0(%rbp)
movq %rcx, -0xe8(%rbp)
movq %r8, -0xe0(%rbp)
movq %r9, -0xd8(%rbp)
testb %al, %al
je 0x9003
movaps %xmm0, -0xd0(%rbp)
movaps %xmm1, -0xc0(%rbp)
movaps %xmm2, -0xb0(%rbp)
movaps %xmm3, -0xa0(%rbp)
movaps %xmm4, -0x90(%rbp)
movaps %xmm5, -0x80(%rbp)
movaps %xmm6, -0x70(%rbp)
movaps %xmm7, -0x60(%rbp)
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movq %rdi, -0x30(%rbp)
movb $0x0, 0x10(%rdi)
movl $0x100, %ebx            # imm = 0x100
movl $0x100, %edi            # imm = 0x100
callq 0x8420
testq %rax, %rax
je 0x90c9
movq %rax, %r15
pushq $0x1
popq %r12
xorl %eax, %eax
testb $0x1, %al
jne 0x90c1
leaq -0x100(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, -0x50(%rbp)
movq %r15, %rdi
movq %rbx, %rsi
movq -0x38(%rbp), %rdx
leaq -0x50(%rbp), %rcx
callq 0x81f0
movb $0x1, %r14b
testl %eax, %eax
js 0x90af
movl %eax, %r13d
movl %eax, %eax
cmpq %rax, %rbx
jbe 0x9093
movq -0x30(%rbp), %rdi
movq %r15, %rsi
callq 0x8640
jmp 0x90af
incl %r13d
movq %r15, %rdi
movq %r13, %rsi
callq 0x8560
testq %rax, %rax
sete %r14b
cmovneq %rax, %r15
movq %r13, %rbx
cmpl $0x6, %r12d
setae %al
orb %r14b, %al
incl %r12d
jmp 0x9038
movq %r15, %rdi
callq 0x83d0
movq -0x30(%rbp), %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x30(%rbp), %rdi
callq 0x8170
movq %rbx, %rdi
callq 0x85c0
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/list_ports_linux.cc
// Function: dirname(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string
dirname(const string& path)
{
    size_t pos = path.rfind("/");

    if(pos == std::string::npos)
        return path;
    else if(pos == 0)
        return "/";

    return string(path, 0, pos);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xef7e(%rip), %rsi      # 0x18089
pushq $-0x1
popq %rdx
movq %r14, %rdi
callq 0x8580
testq %rax, %rax
je 0x912e
movq %rbx, %rdi
movq %r14, %rsi
cmpq $-0x1, %rax
jne 0x9143
callq 0x8450
jmp 0x914d
leaq 0xef54(%rip), %rsi      # 0x18089
leaq -0x11(%rbp), %rdx
movq %rbx, %rdi
callq 0x95bc
jmp 0x914d
xorl %edx, %edx
movq %rax, %rcx
callq 0x80a0
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/list_ports_linux.cc
// Function: realpath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string
realpath(const string& path)
{
    char* real_path = realpath(path.c_str(), NULL);

    string result;

    if(real_path != NULL)
    {
        result = real_path;

        free(real_path);
    }

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rsi), %rdi
xorl %esi, %esi
callq 0x8100
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
testq %rax, %rax
je 0x9198
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8640
movq %r14, %rdi
callq 0x83d0
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x8170
movq %r14, %rdi
callq 0x85c0
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/list_ports_linux.cc
// Function: usb_sysfs_friendly_name(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string
usb_sysfs_friendly_name(const string& sys_usb_path)
{
    unsigned int device_number = 0;

    istringstream( read_line(sys_usb_path + "/devnum") ) >> device_number;

    string manufacturer = read_line( sys_usb_path + "/manufacturer" );

    string product = read_line( sys_usb_path + "/product" );

    string serial = read_line( sys_usb_path + "/serial" );

    if( manufacturer.empty() && product.empty() && serial.empty() )
        return "";

    return format("%s %s %s", manufacturer.c_str(), product.c_str(), serial.c_str() );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rsi, %r14
movq %rdi, %rbx
andl $0x0, -0x1c(%rbp)
leaq 0xeeb9(%rip), %rdx      # 0x180b5
leaq -0x40(%rbp), %r15
movq %r15, %rdi
callq 0x96c3
leaq -0x60(%rbp), %rdi
movq %r15, %rsi
callq 0x952c
leaq -0x200(%rbp), %rdi
leaq -0x60(%rbp), %rsi
pushq $0x8
popq %rdx
callq 0x8570
leaq -0x200(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x85b0
leaq -0x200(%rbp), %rdi
callq 0x8180
leaq -0x60(%rbp), %rdi
callq 0x8170
leaq -0x40(%rbp), %rdi
callq 0x8170
leaq 0xee61(%rip), %rdx      # 0x180bd
leaq -0x60(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x96c3
leaq -0x200(%rbp), %rdi
movq %r15, %rsi
callq 0x952c
leaq -0x60(%rbp), %rdi
callq 0x8170
leaq 0xee41(%rip), %rdx      # 0x180cb
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0x96c3
leaq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x952c
leaq -0x40(%rbp), %rdi
callq 0x8170
leaq 0xee21(%rip), %rdx      # 0x180d4
leaq -0x80(%rbp), %rdi
movq %r14, %rsi
callq 0x96c3
leaq -0x40(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x952c
leaq -0x80(%rbp), %rdi
callq 0x8170
cmpq $0x0, -0x1f8(%rbp)
jne 0x9302
cmpq $0x0, -0x58(%rbp)
jne 0x9302
cmpq $0x0, -0x38(%rbp)
jne 0x9302
leaq 0x103b8(%rip), %rsi     # 0x196ac
leaq -0x80(%rbp), %rdx
movq %rbx, %rdi
callq 0x95bc
jmp 0x9322
movq -0x200(%rbp), %rdx
movq -0x60(%rbp), %rcx
movq -0x40(%rbp), %r8
leaq 0xedc4(%rip), %rsi      # 0x180dc
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f9c
leaq -0x40(%rbp), %rdi
callq 0x8170
leaq -0x60(%rbp), %rdi
callq 0x8170
leaq -0x200(%rbp), %rdi
callq 0x8170
movq %rbx, %rax
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9353
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
jmp 0x9363
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x8170
jmp 0x936d
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
jmp 0x937a
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x8170
jmp 0x9384
movq %rax, %rbx
leaq -0x200(%rbp), %rdi
jmp 0x93bc
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
jmp 0x93bc
movq %rax, %rbx
leaq -0x200(%rbp), %rdi
callq 0x8180
jmp 0x93aa
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x8170
jmp 0x93b8
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x8170
movq %rbx, %rdi
callq 0x85c0
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/list_ports_linux.cc
// Function: usb_sysfs_hw_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string
usb_sysfs_hw_string(const string& sysfs_path)
{
    string serial_number = read_line( sysfs_path + "/serial" );

    if( serial_number.length() > 0 )
    {
        serial_number = format( "SNR=%s", serial_number.c_str() );
    }

    string vid = read_line( sysfs_path + "/idVendor" );

    string pid = read_line( sysfs_path + "/idProduct" );

    return format("USB VID:PID=%s:%s %s", vid.c_str(), pid.c_str(), serial_number.c_str() );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xecee(%rip), %rdx      # 0x180d4
leaq -0x38(%rbp), %r15
movq %r15, %rdi
callq 0x96c3
leaq -0x78(%rbp), %rdi
movq %r15, %rsi
callq 0x952c
leaq -0x38(%rbp), %rdi
callq 0x8170
cmpq $0x0, -0x70(%rbp)
je 0x9438
movq -0x78(%rbp), %rdx
leaq 0xeccc(%rip), %rsi      # 0x180e5
leaq -0x38(%rbp), %rdi
xorl %eax, %eax
callq 0x8f9c
leaq -0x78(%rbp), %rdi
movq %r15, %rsi
callq 0x83e0
movq %r15, %rdi
callq 0x8170
leaq 0xecad(%rip), %rdx      # 0x180ec
leaq -0x58(%rbp), %rdi
movq %r14, %rsi
callq 0x96c3
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x952c
leaq -0x58(%rbp), %rdi
callq 0x8170
leaq 0xec8e(%rip), %rdx      # 0x180f6
leaq -0x98(%rbp), %rdi
movq %r14, %rsi
callq 0x96c3
leaq -0x58(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x952c
leaq -0x98(%rbp), %rdi
callq 0x8170
movq -0x38(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq -0x78(%rbp), %r8
leaq 0xec5b(%rip), %rsi      # 0x18101
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f9c
leaq -0x58(%rbp), %rdi
callq 0x8170
leaq -0x38(%rbp), %rdi
callq 0x8170
leaq -0x78(%rbp), %rdi
callq 0x8170
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x950f
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
jmp 0x94f1
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x8170
jmp 0x94fb
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
jmp 0x9508
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x8170
jmp 0x9512
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x8170
movq %rbx, %rdi
callq 0x85c0
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
jmp 0x9516
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/list_ports_linux.cc
// Function: read_line(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string
read_line(const string& file)
{
    ifstream ifs(file.c_str(), ifstream::in);

    string line;

    if(ifs)
    {
        getline(ifs, line);
    }

    return line;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdi, %rbx
movq (%rsi), %rsi
leaq -0x218(%rbp), %r14
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x8600
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x1f8(%rbp,%rax)
jne 0x9582
leaq -0x218(%rbp), %rdi
movq %rbx, %rsi
callq 0x8070
leaq -0x218(%rbp), %rdi
callq 0x80c0
movq %rbx, %rax
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x8170
leaq -0x218(%rbp), %rdi
callq 0x80c0
movq %r14, %rdi
callq 0x85c0
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/serial.cc
// Function: serial::Serial::read(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned long)
size_t
Serial::read (std::vector<uint8_t> &buffer, size_t size)
{
  ScopedReadLock lock(this->pimpl_);
  uint8_t *buffer_ = new uint8_t[size];
  size_t bytes_read = this->pimpl_->read (buffer_, size);
  buffer.insert (buffer.end (), buffer_, buffer_+bytes_read);
  delete[] buffer_;
  return bytes_read;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
movq 0x8(%rdi), %rdi
movq %rdi, -0x28(%rbp)
callq 0xcc6c
movq %r15, %rdi
callq 0x8040
movq %rax, %r14
movq 0x8(%r12), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0xb93c
movq %rax, %r15
movq 0x8(%rbx), %rsi
movq %r14, %rcx
addq %rax, %rcx
movq %rbx, %rdi
movq %r14, %rdx
callq 0xa8ba
movq %r14, %rdi
callq 0x8400
leaq -0x28(%rbp), %rdi
callq 0xa8a4
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa081
jmp 0xa081
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0xa8a4
movq %rbx, %rdi
callq 0x85c0
nop
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/serial.cc
// Function: serial::Serial::read(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, unsigned long)
size_t
Serial::read (std::string &buffer, size_t size)
{
  ScopedReadLock lock(this->pimpl_);
  uint8_t *buffer_ = new uint8_t[size];
  size_t bytes_read = this->pimpl_->read (buffer_, size);
  buffer.append (reinterpret_cast<const char*>(buffer_), bytes_read);
  delete[] buffer_;
  return bytes_read;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
movq 0x8(%rdi), %rdi
movq %rdi, -0x28(%rbp)
callq 0xcc6c
movq %r15, %rdi
callq 0x8040
movq %rax, %r14
movq 0x8(%r12), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0xb93c
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x8060
movq %r14, %rdi
callq 0x8400
leaq -0x28(%rbp), %rdi
callq 0xa8a4
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa10a
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0xa8a4
movq %rbx, %rdi
callq 0x85c0
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/serial.cc
// Function: serial::Serial::readline(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
size_t
Serial::readline (string &buffer, size_t size, string eol)
{
  ScopedReadLock lock(this->pimpl_);
  size_t eol_len = eol.length ();
  uint8_t *buffer_ = static_cast<uint8_t*>
                              (alloca (size * sizeof (uint8_t)));
  size_t read_so_far = 0;
  while (true)
  {
    size_t bytes_read = this->read_ (buffer_ + read_so_far, 1);
    read_so_far += bytes_read;
    if (bytes_read == 0) {
      break; // Timeout occured on reading 1 byte
    }
    if (string (reinterpret_cast<const char*>
         (buffer_ + read_so_far - eol_len), eol_len) == eol) {
      break; // EOL found
    }
    if (read_so_far == size) {
      break; // Reached the maximum read length
    }
  }
  buffer.append(reinterpret_cast<const char*> (buffer_), read_so_far);
  return read_so_far;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, -0x38(%rbp)
movq %rdi, -0x50(%rbp)
movq 0x8(%rdi), %rdi
movq %rdi, -0x30(%rbp)
callq 0xcc6c
xorl %ebx, %ebx
xorl %r13d, %r13d
movq %r14, -0x48(%rbp)
subq 0x8(%r14), %r13
movq %rsp, %r14
movq %r15, -0x40(%rbp)
leaq 0xf(%r15), %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
leaq -0x70(%rbp), %r15
leaq (%r14,%rbx), %rsi
movq -0x50(%rbp), %rdi
pushq $0x1
popq %rdx
callq 0x9f98
addq %rax, %rbx
testq %rax, %rax
je 0xa202
leaq (%r14,%rbx), %rdx
leaq (%rdx,%r13), %rsi
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq %r15, %rdi
callq 0x9738
movq %r15, %rdi
movq -0x48(%rbp), %rsi
callq 0xa8da
movl %eax, %r12d
movq %r15, %rdi
callq 0x8170
cmpq -0x40(%rbp), %rbx
je 0xa202
testb %r12b, %r12b
je 0xa1b0
movq -0x38(%rbp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x8060
leaq -0x30(%rbp), %rdi
callq 0xa8a4
movq %rbx, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa230
jmp 0xa230
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0xa8a4
movq %rbx, %rdi
callq 0x85c0
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/serial.cc
// Function: serial::Serial::setPort(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void
Serial::setPort (const string &port)
{
  ScopedReadLock rlock(this->pimpl_);
  ScopedWriteLock wlock(this->pimpl_);
  bool was_open = pimpl_->isOpen ();
  if (was_open) close();
  pimpl_->setPort (port);
  if (was_open) open ();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movq %rdi, -0x28(%rbp)
callq 0xcc6c
movq 0x8(%rbx), %rdi
movq %rdi, -0x20(%rbp)
callq 0xcda8
movq 0x8(%rbx), %rdi
callq 0xb6b8
movl %eax, %r15d
testb %al, %al
je 0xa607
movq %rbx, %rdi
callq 0x9f2c
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0xbd56
testb %r15b, %r15b
je 0xa620
movq %rbx, %rdi
callq 0x9f1e
leaq -0x20(%rbp), %rdi
callq 0xa906
leaq -0x28(%rbp), %rdi
callq 0xa8a4
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xa64e
movq %rax, %rbx
leaq -0x20(%rbp), %rdi
callq 0xa906
leaq -0x28(%rbp), %rdi
callq 0xa8a4
movq %rbx, %rdi
callq 0x85c0
nop
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/unix.cc
// Function: serial::MillisecondTimer::MillisecondTimer(unsigned int)
MillisecondTimer::MillisecondTimer (const uint32_t millis)
  : expiry(timespec_now())
{
  int64_t tv_nsec = expiry.tv_nsec + (millis * 1e6);
  if (tv_nsec >= 1e9) {
    int64_t sec_diff = tv_nsec / static_cast<int> (1e9);
    expiry.tv_nsec = tv_nsec - static_cast<int> (1e9 * sec_diff);
    expiry.tv_sec += sec_diff;
  } else {
    expiry.tv_nsec = tv_nsec;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
callq 0xabd6
movq %rax, %rcx
cvtsi2sd %rdx, %xmm0
movl %r14d, %eax
cvtsi2sd %rax, %xmm1
mulsd 0xd5ce(%rip), %xmm1     # 0x18160
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rsi
cmpq $0x3b9aca00, %rsi       # imm = 0x3B9ACA00
jl 0xabc9
movl $0x3b9aca00, %edi       # imm = 0x3B9ACA00
movq %rsi, %rax
xorl %edx, %edx
divq %rdi
movabsq $0x3b9aca0000000000, %rdx # imm = 0x3B9ACA0000000000
imulq %rax, %rdx
sarq $0x20, %rdx
subq %rdx, %rsi
addq %rax, %rcx
movq %rcx, (%rbx)
movq %rsi, 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/unix.cc
// Function: serial::MillisecondTimer::remaining()
int64_t
MillisecondTimer::remaining ()
{
  timespec now(timespec_now());
  int64_t millis = (expiry.tv_sec - now.tv_sec) * 1e3;
  millis += (expiry.tv_nsec - now.tv_nsec) / 1e6;
  return millis;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xabd6
movq (%rbx), %rcx
subq %rax, %rcx
cvtsi2sd %rcx, %xmm0
mulsd 0xd54b(%rip), %xmm0     # 0x18168
cvttsd2si %xmm0, %rax
movq 0x8(%rbx), %rcx
subq %rdx, %rcx
cvtsi2sd %rcx, %xmm0
divsd 0xd52a(%rip), %xmm0     # 0x18160
cvtsi2sd %rax, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/unix.cc
// Function: serial::Serial::SerialImpl::SerialImpl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long, serial::bytesize_t, serial::parity_t, serial::stopbits_t, serial::flowcontrol_t)
Serial::SerialImpl::SerialImpl (const string &port, unsigned long baudrate,
                                bytesize_t bytesize,
                                parity_t parity, stopbits_t stopbits,
                                flowcontrol_t flowcontrol)
  : port_ (port), fd_ (-1), is_open_ (false), xonxoff_ (false), rtscts_ (false),
    baudrate_ (baudrate), parity_ (parity),
    bytesize_ (bytesize), stopbits_ (stopbits), flowcontrol_ (flowcontrol)
{
  pthread_mutex_init(&this->read_mutex, NULL);
  pthread_mutex_init(&this->write_mutex, NULL);
  if (port_.empty () == false)
    open ();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %r15d
movl %r8d, %r12d
movl %ecx, %r13d
movq %rdx, %rbx
movq %rdi, %r14
leaq 0x14fe4(%rip), %rax     # 0x1fc90
movq %rax, (%rdi)
addq $0x8, %rdi
movq %rdi, -0x30(%rbp)
callq 0x8450
orl $-0x1, 0x28(%r14)
andw $0x0, 0x2c(%r14)
movb $0x0, 0x2e(%r14)
andl $0x0, 0x40(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r14)
movq %rbx, 0x48(%r14)
movl %r12d, 0x54(%r14)
movl %r13d, 0x58(%r14)
movl %r15d, 0x5c(%r14)
movl 0x10(%rbp), %eax
movl %eax, 0x60(%r14)
leaq 0x68(%r14), %rdi
xorl %esi, %esi
callq 0x84c0
leaq 0x90(%r14), %rdi
xorl %esi, %esi
callq 0x84c0
cmpq $0x0, 0x10(%r14)
je 0xad18
movq %r14, %rdi
callq 0xad3c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x30(%rbp), %rdi
callq 0x8170
movq %rbx, %rdi
callq 0x85c0
nop
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/unix.cc
// Function: serial::Serial::SerialImpl::open()
void
Serial::SerialImpl::open ()
{
  if (port_.empty ()) {
    throw invalid_argument ("Empty port is invalid.");
  }
  if (is_open_ == true) {
    throw SerialException ("Serial port already open.");
  }

  fd_ = ::open (port_.c_str(), O_RDWR | O_NOCTTY | O_NONBLOCK);

  if (fd_ == -1) {
    switch (errno) {
    case EINTR:
      // Recurse because this is a recoverable error.
      open ();
      return;
    case ENFILE:
    case EMFILE:
      THROW (IOException, "Too many file handles open.");
    default:
      THROW (IOException, errno);
    }
  }

  reconfigurePort();
  is_open_ = true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
cmpq $0x0, 0x10(%rbx)
je 0xae03
cmpb $0x1, 0x2c(%rbx)
je 0xae2d
movq 0x8(%rbx), %rdi
movl $0x902, %esi            # imm = 0x902
xorl %eax, %eax
callq 0x8250
movl %eax, 0x28(%rbx)
cmpl $-0x1, %eax
jne 0xadec
callq 0x8050
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0xad4c
addl $-0x17, %eax
pushq $0x58
popq %rdi
cmpl $0x1, %eax
ja 0xae5d
callq 0x81a0
movq %rax, %rbx
leaq 0xd46c(%rip), %rsi      # 0x18212
leaq -0x60(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x95bc
movb $0x1, %r15b
leaq 0xd46c(%rip), %rcx      # 0x18229
leaq -0x60(%rbp), %rsi
movq %rbx, %rdi
movl $0x96, %edx
callq 0xcff0
xorl %r15d, %r15d
leaq 0x14ef0(%rip), %rsi     # 0x1fcc8
leaq 0x2351(%rip), %rdx      # 0xd130
movq %rbx, %rdi
callq 0x8590
jmp 0xaea9
movq %rbx, %rdi
callq 0xaffc
movb $0x1, 0x2c(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x81a0
movq %rax, %rbx
leaq 0xd3cc(%rip), %rsi      # 0x181e1
movq %rax, %rdi
callq 0x8620
movq 0x151b4(%rip), %rsi     # 0x1ffd8
movq 0x1519d(%rip), %rdx     # 0x1ffc8
jmp 0xae55
pushq $0x28
popq %rdi
callq 0x81a0
movq %rax, %rbx
leaq 0xd3b9(%rip), %rsi      # 0x181f8
movq %rax, %rdi
callq 0xcee8
leaq 0x14e62(%rip), %rsi     # 0x1fcb0
leaq 0x2171(%rip), %rdx      # 0xcfc6
movq %rbx, %rdi
callq 0x8590
callq 0x81a0
movq %rax, %rbx
leaq 0xd3a6(%rip), %rsi      # 0x18212
leaq -0x40(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x95bc
movl (%r14), %ecx
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
movl $0x98, %edx
callq 0xd164
xorl %r15d, %r15d
leaq 0x14e2e(%rip), %rsi     # 0x1fcc8
leaq 0x228f(%rip), %rdx      # 0xd130
movq %rbx, %rdi
callq 0x8590
movq %rax, %r14
leaq -0x40(%rbp), %rdi
jmp 0xaebf
jmp 0xaecb
jmp 0xaecb
jmp 0xaecb
movq %rax, %r14
leaq -0x60(%rbp), %rdi
callq 0x8170
testb %r15b, %r15b
jne 0xaece
jmp 0xaed6
movq %rax, %r14
movq %rbx, %rdi
callq 0x8240
movq %r14, %rdi
callq 0x85c0
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/unix.cc
// Function: serial::Serial::SerialImpl::close()
void
Serial::SerialImpl::close ()
{
  if (is_open_ == true) {
    if (fd_ != -1) {
      int ret;
      ret = ::close (fd_);
      if (ret == 0) {
        fd_ = -1;
      } else {
        THROW (IOException, errno);
      }
    }
    is_open_ = false;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
cmpb $0x1, 0x2c(%rdi)
jne 0xaf55
movq %rdi, %rbx
movl 0x28(%rdi), %edi
cmpl $-0x1, %edi
je 0xaf51
callq 0x8660
testl %eax, %eax
jne 0xaf60
orl $-0x1, 0x28(%rbx)
movb $0x0, 0x2c(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x58
popq %rdi
callq 0x81a0
movq %rax, %rbx
leaq 0xd2a0(%rip), %rsi      # 0x18212
leaq -0x40(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x95bc
callq 0x8050
movl (%rax), %ecx
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
movl $0x1d1, %edx            # imm = 0x1D1
callq 0xd164
xorl %r15d, %r15d
leaq 0x14d24(%rip), %rsi     # 0x1fcc8
leaq 0x2185(%rip), %rdx      # 0xd130
movq %rbx, %rdi
callq 0x8590
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x8170
testb %r15b, %r15b
jne 0xafc9
jmp 0xafd1
movq %rax, %r14
movq %rbx, %rdi
callq 0x8240
movq %r14, %rdi
callq 0x85c0
nop
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/unix.cc
// Function: serial::Serial::SerialImpl::available()
size_t
Serial::SerialImpl::available ()
{
  if (!is_open_) {
    return 0;
  }
  int count = 0;
  if (-1 == ioctl (fd_, TIOCINQ, &count)) {
      THROW (IOException, errno);
  } else {
      return static_cast<size_t> (count);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
cmpb $0x1, 0x2c(%rdi)
jne 0xb6f6
leaq -0x20(%rbp), %rdx
andl $0x0, (%rdx)
movl 0x28(%rdi), %edi
movl $0x541b, %esi           # imm = 0x541B
xorl %eax, %eax
callq 0x8470
cmpl $-0x1, %eax
je 0xb703
movslq -0x20(%rbp), %rax
jmp 0xb6f8
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x58
popq %rdi
callq 0x81a0
movq %rax, %rbx
leaq 0xcafd(%rip), %rsi      # 0x18212
leaq -0x40(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x95bc
callq 0x8050
movl (%rax), %ecx
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
movl $0x1e6, %edx            # imm = 0x1E6
callq 0xd164
xorl %r15d, %r15d
leaq 0x14581(%rip), %rsi     # 0x1fcc8
leaq 0x19e2(%rip), %rdx      # 0xd130
movq %rbx, %rdi
callq 0x8590
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x8170
testb %r15b, %r15b
jne 0xb76c
jmp 0xb774
movq %rax, %r14
movq %rbx, %rdi
callq 0x8240
movq %r14, %rdi
callq 0x85c0
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/unix.cc
// Function: serial::Serial::SerialImpl::waitReadable(unsigned int)
bool
Serial::SerialImpl::waitReadable (uint32_t timeout)
{
  // Setup a select call to block for serial data or a timeout
  fd_set readfds;
  FD_ZERO (&readfds);
  FD_SET (fd_, &readfds);
  timespec timeout_ts (timespec_from_ms (timeout));
  int r = pselect (fd_ + 1, &readfds, NULL, NULL, &timeout_ts, NULL);

  if (r < 0) {
    // Select was interrupted
    if (errno == EINTR) {
      return false;
    }
    // Otherwise there was some error
    THROW (IOException, errno);
  }
  // Timeout occurred
  if (r == 0) {
    return false;
  }
  // This shouldn't happen, if r > 0 our fd has to be in the list!
  if (!FD_ISSET (fd_, &readfds)) {
    THROW (IOException, "select reports ready to read, but our fd isn't"
           " in the list, this shouldn't happen!");
  }
  // Data available to read.
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
xorl %eax, %eax
cmpq $0x10, %rax
je 0xb7a5
andq $0x0, -0xf0(%rbp,%rax,8)
incq %rax
jmp 0xb791
movl 0x28(%rbx), %r14d
pushq $0x40
popq %r15
movl %r14d, %eax
cltd
idivl %r15d
movslq %eax, %rdx
shll $0x6, %eax
movl %r14d, %ecx
subl %eax, %ecx
pushq $0x1
popq %rax
shlq %cl, %rax
orq %rax, -0xf0(%rbp,%rdx,8)
movl %esi, %edi
callq 0xac4b
leaq -0x70(%rbp), %r8
movq %rax, (%r8)
movq %rdx, 0x8(%r8)
incl %r14d
leaq -0xf0(%rbp), %rsi
movl %r14d, %edi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r9d, %r9d
callq 0x8360
testl %eax, %eax
js 0xb86c
je 0xb876
movl 0x28(%rbx), %eax
cltd
idivl %r15d
cltq
movq -0xf0(%rbp,%rax,8), %rcx
movb $0x1, %al
btq %rdx, %rcx
jb 0xb878
pushq $0x58
popq %rdi
callq 0x81a0
movq %rax, %rbx
leaq 0xc9e9(%rip), %rsi      # 0x18212
leaq -0x40(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x95bc
movb $0x1, %r15b
leaq 0xca74(%rip), %rcx      # 0x182b4
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
movl $0x205, %edx            # imm = 0x205
callq 0xcff0
xorl %r15d, %r15d
leaq 0x1446d(%rip), %rsi     # 0x1fcc8
leaq 0x18ce(%rip), %rdx      # 0xd130
movq %rbx, %rdi
callq 0x8590
jmp 0xb8d8
callq 0x8050
cmpl $0x4, (%rax)
jne 0xb886
xorl %eax, %eax
addq $0xd8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
pushq $0x58
popq %rdi
callq 0x81a0
movq %rax, %rbx
leaq 0xc977(%rip), %rsi      # 0x18212
leaq -0x60(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x95bc
movl (%r14), %ecx
movb $0x1, %r15b
leaq -0x60(%rbp), %rsi
movq %rbx, %rdi
movl $0x1fc, %edx            # imm = 0x1FC
callq 0xd164
xorl %r15d, %r15d
leaq 0x143ff(%rip), %rsi     # 0x1fcc8
leaq 0x1860(%rip), %rdx      # 0xd130
movq %rbx, %rdi
callq 0x8590
movq %rax, %r14
leaq -0x60(%rbp), %rdi
jmp 0xb8ea
jmp 0xb8f6
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x8170
testb %r15b, %r15b
jne 0xb8f9
jmp 0xb901
movq %rax, %r14
movq %rbx, %rdi
callq 0x8240
movq %r14, %rdi
callq 0x85c0
nop
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/unix.cc
// Function: serial::Serial::SerialImpl::setBreak(bool)
void
Serial::SerialImpl::setBreak (bool level)
{
  if (is_open_ == false) {
    throw PortNotOpenedException ("Serial::setBreak");
  }

  if (level) {
    if (-1 == ioctl (fd_, TIOCSBRK))
    {
        stringstream ss;
        ss << "setBreak failed on a call to ioctl(TIOCSBRK): " << errno << " " << strerror(errno);
        throw(SerialException(ss.str().c_str()));
    }
  } else {
    if (-1 == ioctl (fd_, TIOCCBRK))
    {
        stringstream ss;
        ss << "setBreak failed on a call to ioctl(TIOCCBRK): " << errno << " " << strerror(errno);
        throw(SerialException(ss.str().c_str()));
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
cmpb $0x0, 0x2c(%rdi)
je 0xc0c4
movl 0x28(%rdi), %edi
testb %sil, %sil
je 0xc0a5
movl $0x5427, %esi           # imm = 0x5427
xorl %eax, %eax
callq 0x8470
cmpl $-0x1, %eax
jne 0xc0b6
leaq -0x1c0(%rbp), %rdi
callq 0x8220
leaq -0x1b0(%rbp), %rdi
leaq 0xc507(%rip), %rsi      # 0x18526
callq 0x82e0
movq %rax, %r14
callq 0x8050
movq %rax, %rbx
movl (%rax), %esi
movq %r14, %rdi
callq 0x85a0
leaq 0xc614(%rip), %rsi      # 0x18654
movq %rax, %rdi
callq 0x82e0
movq %rax, %r14
movl (%rbx), %edi
callq 0x80f0
movq %r14, %rdi
movq %rax, %rsi
callq 0x82e0
pushq $0x28
popq %rdi
callq 0x81a0
movq %rax, %r14
leaq -0x1a8(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x8530
movb $0x1, %r15b
movq -0x38(%rbp), %rsi
movq %r14, %rdi
callq 0xcee8
xorl %r15d, %r15d
leaq 0x13c1f(%rip), %rsi     # 0x1fcb0
leaq 0xf2e(%rip), %rdx       # 0xcfc6
movq %r14, %rdi
callq 0x8590
jmp 0xc18f
movl $0x5428, %esi           # imm = 0x5428
xorl %eax, %eax
callq 0x8470
cmpl $-0x1, %eax
je 0xc0f4
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x28
popq %rdi
callq 0x81a0
movq %rax, %r14
leaq 0xc43f(%rip), %rsi      # 0x18515
movq %rax, %rdi
callq 0xd2ca
leaq 0x13bfb(%rip), %rsi     # 0x1fce0
leaq 0x12bc(%rip), %rdx      # 0xd3a8
movq %r14, %rdi
callq 0x8590
leaq -0x1c0(%rbp), %rdi
callq 0x8220
leaq -0x1b0(%rbp), %rdi
leaq 0xc447(%rip), %rsi      # 0x18555
callq 0x82e0
movq %rax, %r14
callq 0x8050
movq %rax, %rbx
movl (%rax), %esi
movq %r14, %rdi
callq 0x85a0
leaq 0xc525(%rip), %rsi      # 0x18654
movq %rax, %rdi
callq 0x82e0
movq %rax, %r14
movl (%rbx), %edi
callq 0x80f0
movq %r14, %rdi
movq %rax, %rsi
callq 0x82e0
pushq $0x28
popq %rdi
callq 0x81a0
movq %rax, %r14
leaq -0x1a8(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x8530
movb $0x1, %r15b
movq -0x38(%rbp), %rsi
movq %r14, %rdi
callq 0xcee8
xorl %r15d, %r15d
leaq 0x13b30(%rip), %rsi     # 0x1fcb0
leaq 0xe3f(%rip), %rdx       # 0xcfc6
movq %r14, %rdi
callq 0x8590
jmp 0xc191
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x8170
testb %r15b, %r15b
jne 0xc1a9
jmp 0xc1b8
jmp 0xc1a6
movq %rax, %rbx
movq %r14, %rdi
callq 0x8240
jmp 0xc1b8
jmp 0xc1b5
movq %rax, %rbx
leaq -0x1c0(%rbp), %rdi
callq 0x8260
jmp 0xc1d1
movq %rax, %rbx
movq %r14, %rdi
callq 0x8240
movq %rbx, %rdi
callq 0x85c0
nop
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/unix.cc
// Function: serial::Serial::SerialImpl::waitForChange()
bool
Serial::SerialImpl::waitForChange ()
{
#ifndef TIOCMIWAIT

while (is_open_ == true) {

    int status;

    if (-1 == ioctl (fd_, TIOCMGET, &status))
    {
        stringstream ss;
        ss << "waitForChange failed on a call to ioctl(TIOCMGET): " << errno << " " << strerror(errno);
        throw(SerialException(ss.str().c_str()));
    }
    else
    {
        if (0 != (status & TIOCM_CTS)
         || 0 != (status & TIOCM_DSR)
         || 0 != (status & TIOCM_RI)
         || 0 != (status & TIOCM_CD))
        {
          return true;
        }
    }

    usleep(1000);
  }

  return false;
#else
  int command = (TIOCM_CD|TIOCM_DSR|TIOCM_RI|TIOCM_CTS);

  if (-1 == ioctl (fd_, TIOCMIWAIT, &command)) {
    stringstream ss;
    ss << "waitForDSR failed on a call to ioctl(TIOCMIWAIT): "
       << errno << " " << strerror(errno);
    throw(SerialException(ss.str().c_str()));
  }
  return true;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
leaq -0x1c(%rbp), %rdx
movl $0x1e0, (%rdx)          # imm = 0x1E0
movl 0x28(%rdi), %edi
movl $0x545c, %esi           # imm = 0x545C
xorl %eax, %eax
callq 0x8470
cmpl $-0x1, %eax
je 0xc64c
movb $0x1, %al
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq -0x1c8(%rbp), %rdi
callq 0x8220
leaq -0x1b8(%rbp), %rdi
leaq 0xbff0(%rip), %rsi      # 0x18656
callq 0x82e0
movq %rax, %r14
callq 0x8050
movq %rax, %rbx
movl (%rax), %esi
movq %r14, %rdi
callq 0x85a0
leaq 0xbfcd(%rip), %rsi      # 0x18654
movq %rax, %rdi
callq 0x82e0
movq %rax, %r14
movl (%rbx), %edi
callq 0x80f0
movq %r14, %rdi
movq %rax, %rsi
callq 0x82e0
pushq $0x28
popq %rdi
callq 0x81a0
movq %rax, %rbx
leaq -0x1b0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x8530
movb $0x1, %r15b
movq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0xcee8
xorl %r15d, %r15d
leaq 0x135d8(%rip), %rsi     # 0x1fcb0
leaq 0x8e7(%rip), %rdx       # 0xcfc6
movq %rbx, %rdi
callq 0x8590
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x8170
testb %r15b, %r15b
jne 0xc6fd
jmp 0xc70a
movq %rax, %r14
movq %rbx, %rdi
callq 0x8240
jmp 0xc70a
movq %rax, %r14
leaq -0x1c8(%rbp), %rdi
callq 0x8260
movq %r14, %rdi
callq 0x85c0
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/unix.cc
// Function: serial::Serial::SerialImpl::getCTS()
bool
Serial::SerialImpl::getCTS ()
{
  if (is_open_ == false) {
    throw PortNotOpenedException ("Serial::getCTS");
  }

  int status;

  if (-1 == ioctl (fd_, TIOCMGET, &status))
  {
    stringstream ss;
    ss << "getCTS failed on a call to ioctl(TIOCMGET): " << errno << " " << strerror(errno);
    throw(SerialException(ss.str().c_str()));
  }
  else
  {
    return 0 != (status & TIOCM_CTS);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
cmpb $0x0, 0x2c(%rdi)
je 0xc763
movl 0x28(%rdi), %edi
leaq -0x1c(%rbp), %rdx
movl $0x5415, %esi           # imm = 0x5415
xorl %eax, %eax
callq 0x8470
cmpl $-0x1, %eax
je 0xc793
movl -0x1c(%rbp), %eax
andl $0x20, %eax
shrl $0x5, %eax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x28
popq %rdi
callq 0x81a0
movq %rax, %rbx
leaq 0xbf14(%rip), %rsi      # 0x18689
movq %rax, %rdi
callq 0xd2ca
leaq 0x1355c(%rip), %rsi     # 0x1fce0
leaq 0xc1d(%rip), %rdx       # 0xd3a8
movq %rbx, %rdi
callq 0x8590
leaq -0x1c8(%rbp), %rdi
callq 0x8220
leaq -0x1b8(%rbp), %rdi
leaq 0xbeeb(%rip), %rsi      # 0x18698
callq 0x82e0
movq %rax, %r14
callq 0x8050
movq %rax, %rbx
movl (%rax), %esi
movq %r14, %rdi
callq 0x85a0
leaq 0xbe86(%rip), %rsi      # 0x18654
movq %rax, %rdi
callq 0x82e0
movq %rax, %r14
movl (%rbx), %edi
callq 0x80f0
movq %r14, %rdi
movq %rax, %rsi
callq 0x82e0
pushq $0x28
popq %rdi
callq 0x81a0
movq %rax, %rbx
leaq -0x1b0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x8530
movb $0x1, %r15b
movq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0xcee8
xorl %r15d, %r15d
leaq 0x13491(%rip), %rsi     # 0x1fcb0
leaq 0x7a0(%rip), %rdx       # 0xcfc6
movq %rbx, %rdi
callq 0x8590
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x8170
testb %r15b, %r15b
jne 0xc844
jmp 0xc85e
movq %rax, %r14
movq %rbx, %rdi
callq 0x8240
jmp 0xc85e
movq %rax, %r14
movq %rbx, %rdi
callq 0x8240
jmp 0xc86a
movq %rax, %r14
leaq -0x1c8(%rbp), %rdi
callq 0x8260
movq %r14, %rdi
callq 0x85c0
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/unix.cc
// Function: serial::Serial::SerialImpl::getDSR()
bool
Serial::SerialImpl::getDSR ()
{
  if (is_open_ == false) {
    throw PortNotOpenedException ("Serial::getDSR");
  }

  int status;

  if (-1 == ioctl (fd_, TIOCMGET, &status))
  {
      stringstream ss;
      ss << "getDSR failed on a call to ioctl(TIOCMGET): " << errno << " " << strerror(errno);
      throw(SerialException(ss.str().c_str()));
  }
  else
  {
      return 0 != (status & TIOCM_DSR);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
cmpb $0x0, 0x2c(%rdi)
je 0xc8b7
movl 0x28(%rdi), %edi
leaq -0x1c(%rbp), %rdx
movl $0x5415, %esi           # imm = 0x5415
xorl %eax, %eax
callq 0x8470
cmpl $-0x1, %eax
je 0xc8e7
movl -0x1c(%rbp), %eax
shrl $0x8, %eax
andl $0x1, %eax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x28
popq %rdi
callq 0x81a0
movq %rax, %rbx
leaq 0xbdfc(%rip), %rsi      # 0x186c5
movq %rax, %rdi
callq 0xd2ca
leaq 0x13408(%rip), %rsi     # 0x1fce0
leaq 0xac9(%rip), %rdx       # 0xd3a8
movq %rbx, %rdi
callq 0x8590
leaq -0x1c8(%rbp), %rdi
callq 0x8220
leaq -0x1b8(%rbp), %rdi
leaq 0xbdd3(%rip), %rsi      # 0x186d4
callq 0x82e0
movq %rax, %r14
callq 0x8050
movq %rax, %rbx
movl (%rax), %esi
movq %r14, %rdi
callq 0x85a0
leaq 0xbd32(%rip), %rsi      # 0x18654
movq %rax, %rdi
callq 0x82e0
movq %rax, %r14
movl (%rbx), %edi
callq 0x80f0
movq %r14, %rdi
movq %rax, %rsi
callq 0x82e0
pushq $0x28
popq %rdi
callq 0x81a0
movq %rax, %rbx
leaq -0x1b0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x8530
movb $0x1, %r15b
movq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0xcee8
xorl %r15d, %r15d
leaq 0x1333d(%rip), %rsi     # 0x1fcb0
leaq 0x64c(%rip), %rdx       # 0xcfc6
movq %rbx, %rdi
callq 0x8590
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x8170
testb %r15b, %r15b
jne 0xc998
jmp 0xc9b2
movq %rax, %r14
movq %rbx, %rdi
callq 0x8240
jmp 0xc9b2
movq %rax, %r14
movq %rbx, %rdi
callq 0x8240
jmp 0xc9be
movq %rax, %r14
leaq -0x1c8(%rbp), %rdi
callq 0x8260
movq %r14, %rdi
callq 0x85c0
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/unix.cc
// Function: serial::Serial::SerialImpl::getRI()
bool
Serial::SerialImpl::getRI ()
{
  if (is_open_ == false) {
    throw PortNotOpenedException ("Serial::getRI");
  }

  int status;

  if (-1 == ioctl (fd_, TIOCMGET, &status))
  {
    stringstream ss;
    ss << "getRI failed on a call to ioctl(TIOCMGET): " << errno << " " << strerror(errno);
    throw(SerialException(ss.str().c_str()));
  }
  else
  {
    return 0 != (status & TIOCM_RI);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
cmpb $0x0, 0x2c(%rdi)
je 0xca08
movl 0x28(%rdi), %edi
leaq -0x1c(%rbp), %rdx
movl $0x5415, %esi           # imm = 0x5415
xorl %eax, %eax
callq 0x8470
cmpl $-0x1, %eax
je 0xca38
movb -0x1c(%rbp), %al
shrb $0x7, %al
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x28
popq %rdi
callq 0x81a0
movq %rax, %rbx
leaq 0xbce7(%rip), %rsi      # 0x18701
movq %rax, %rdi
callq 0xd2ca
leaq 0x132b7(%rip), %rsi     # 0x1fce0
leaq 0x978(%rip), %rdx       # 0xd3a8
movq %rbx, %rdi
callq 0x8590
leaq -0x1c8(%rbp), %rdi
callq 0x8220
leaq -0x1b8(%rbp), %rdi
leaq 0xbcbd(%rip), %rsi      # 0x1870f
callq 0x82e0
movq %rax, %r14
callq 0x8050
movq %rax, %rbx
movl (%rax), %esi
movq %r14, %rdi
callq 0x85a0
leaq 0xbbe1(%rip), %rsi      # 0x18654
movq %rax, %rdi
callq 0x82e0
movq %rax, %r14
movl (%rbx), %edi
callq 0x80f0
movq %r14, %rdi
movq %rax, %rsi
callq 0x82e0
pushq $0x28
popq %rdi
callq 0x81a0
movq %rax, %rbx
leaq -0x1b0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x8530
movb $0x1, %r15b
movq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0xcee8
xorl %r15d, %r15d
leaq 0x131ec(%rip), %rsi     # 0x1fcb0
leaq 0x4fb(%rip), %rdx       # 0xcfc6
movq %rbx, %rdi
callq 0x8590
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x8170
testb %r15b, %r15b
jne 0xcae9
jmp 0xcb03
movq %rax, %r14
movq %rbx, %rdi
callq 0x8240
jmp 0xcb03
movq %rax, %r14
movq %rbx, %rdi
callq 0x8240
jmp 0xcb0f
movq %rax, %r14
leaq -0x1c8(%rbp), %rdi
callq 0x8260
movq %r14, %rdi
callq 0x85c0
nop
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/unix.cc
// Function: serial::Serial::SerialImpl::getCD()
bool
Serial::SerialImpl::getCD ()
{
  if (is_open_ == false) {
    throw PortNotOpenedException ("Serial::getCD");
  }

  int status;

  if (-1 == ioctl (fd_, TIOCMGET, &status))
  {
    stringstream ss;
    ss << "getCD failed on a call to ioctl(TIOCMGET): " << errno << " " << strerror(errno);
    throw(SerialException(ss.str().c_str()));
  }
  else
  {
    return 0 != (status & TIOCM_CD);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
cmpb $0x0, 0x2c(%rdi)
je 0xcb5d
movl 0x28(%rdi), %edi
leaq -0x1c(%rbp), %rdx
movl $0x5415, %esi           # imm = 0x5415
xorl %eax, %eax
callq 0x8470
cmpl $-0x1, %eax
je 0xcb8d
movl -0x1c(%rbp), %eax
andl $0x40, %eax
shrl $0x6, %eax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x28
popq %rdi
callq 0x81a0
movq %rax, %rbx
leaq 0xbbcc(%rip), %rsi      # 0x1873b
movq %rax, %rdi
callq 0xd2ca
leaq 0x13162(%rip), %rsi     # 0x1fce0
leaq 0x823(%rip), %rdx       # 0xd3a8
movq %rbx, %rdi
callq 0x8590
leaq -0x1c8(%rbp), %rdi
callq 0x8220
leaq -0x1b8(%rbp), %rdi
leaq 0xbba2(%rip), %rsi      # 0x18749
callq 0x82e0
movq %rax, %r14
callq 0x8050
movq %rax, %rbx
movl (%rax), %esi
movq %r14, %rdi
callq 0x85a0
leaq 0xba8c(%rip), %rsi      # 0x18654
movq %rax, %rdi
callq 0x82e0
movq %rax, %r14
movl (%rbx), %edi
callq 0x80f0
movq %r14, %rdi
movq %rax, %rsi
callq 0x82e0
pushq $0x28
popq %rdi
callq 0x81a0
movq %rax, %rbx
leaq -0x1b0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x8530
movb $0x1, %r15b
movq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0xcee8
xorl %r15d, %r15d
leaq 0x13097(%rip), %rsi     # 0x1fcb0
leaq 0x3a6(%rip), %rdx       # 0xcfc6
movq %rbx, %rdi
callq 0x8590
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x8170
testb %r15b, %r15b
jne 0xcc3e
jmp 0xcc58
movq %rax, %r14
movq %rbx, %rdi
callq 0x8240
jmp 0xcc58
movq %rax, %r14
movq %rbx, %rdi
callq 0x8240
jmp 0xcc64
movq %rax, %r14
leaq -0x1c8(%rbp), %rdi
callq 0x8260
movq %r14, %rdi
callq 0x85c0
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/serial.h
// Function: serial::IOException::IOException(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, char const*)
explicit IOException (std::string file, int line, const char * description)
    : file_(file), line_(line), errno_(0) {
      std::stringstream ss;
      ss << "IO Exception: " << description;
      ss << ", file " << file_ << ", line " << line_ << ".";
      e_what_ = ss.str();
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rcx, %r12
movl %edx, %r15d
movq %rdi, %rbx
leaq 0x12d1c(%rip), %rax     # 0x1fd30
movq %rax, (%rdi)
leaq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x8450
movl %r15d, 0x28(%rbx)
leaq 0x30(%rbx), %r15
leaq 0x40(%rbx), %rax
movq %rax, 0x30(%rbx)
andq $0x0, 0x38(%rbx)
movb $0x0, 0x40(%rbx)
andl $0x0, 0x50(%rbx)
leaq -0x1d0(%rbp), %rdi
callq 0x8220
leaq -0x1c0(%rbp), %r13
leaq 0xb735(%rip), %rsi      # 0x1878f
movq %r13, %rdi
callq 0x82e0
movq %rax, %rdi
movq %r12, %rsi
callq 0x82e0
leaq 0xb72a(%rip), %rsi      # 0x1879e
movq %r13, %rdi
callq 0x82e0
movq %rax, %rdi
movq %r14, %rsi
callq 0x82b0
leaq 0xb718(%rip), %rsi      # 0x187a6
movq %rax, %rdi
callq 0x82e0
movl 0x28(%rbx), %esi
movq %rax, %rdi
callq 0x85a0
leaq 0xb6e5(%rip), %rsi      # 0x1878d
movq %rax, %rdi
callq 0x82e0
leaq -0x1b8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x8530
leaq -0x48(%rbp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x83e0
movq %rbx, %rdi
callq 0x8170
leaq -0x1d0(%rbp), %rdi
callq 0x8260
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd101
movq %rax, %r12
jmp 0xd110
movq %rax, %r12
jmp 0xd120
movq %rax, %r12
leaq -0x1d0(%rbp), %rdi
callq 0x8260
movq %r15, %rdi
callq 0x8170
movq %r14, %rdi
callq 0x8170
movq %rbx, %rdi
callq 0x8610
movq %r12, %rdi
callq 0x85c0
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/serial/serial.h
// Function: serial::IOException::IOException(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int)
explicit IOException (std::string file, int line, int errnum)
    : file_(file), line_(line), errno_(errnum) {
      std::stringstream ss;
#if defined(_WIN32) && !defined(__MINGW32__)
      char error_str [1024];
      strerror_s(error_str, 1024, errnum);
#else
      char * error_str = strerror(errnum);
#endif
      ss << "IO Exception (" << errno_ << "): " << error_str;
      ss << ", file " << file_ << ", line " << line_ << ".";
      e_what_ = ss.str();
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movl %ecx, %r12d
movl %edx, %r15d
movq %rdi, %rbx
leaq 0x12ba8(%rip), %rax     # 0x1fd30
movq %rax, (%rdi)
leaq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x8450
movl %r15d, 0x28(%rbx)
leaq 0x40(%rbx), %rax
movq %rax, 0x30(%rbx)
andq $0x0, 0x38(%rbx)
leaq 0x30(%rbx), %r15
movb $0x0, 0x40(%rbx)
movl %r12d, 0x50(%rbx)
leaq -0x1d0(%rbp), %rdi
callq 0x8220
movl %r12d, %edi
callq 0x80f0
movq %rax, %r13
leaq -0x1c0(%rbp), %r12
leaq 0xb5d5(%rip), %rsi      # 0x187ae
movq %r12, %rdi
callq 0x82e0
movl 0x50(%rbx), %esi
movq %rax, %rdi
callq 0x85a0
leaq 0xb45f(%rip), %rsi      # 0x18652
movq %rax, %rdi
callq 0x82e0
movq %rax, %rdi
movq %r13, %rsi
callq 0x82e0
leaq 0xb591(%rip), %rsi      # 0x1879e
movq %r12, %rdi
callq 0x82e0
movq %rax, %rdi
movq %r14, %rsi
callq 0x82b0
leaq 0xb57f(%rip), %rsi      # 0x187a6
movq %rax, %rdi
callq 0x82e0
movl 0x28(%rbx), %esi
movq %rax, %rdi
callq 0x85a0
leaq 0xb54c(%rip), %rsi      # 0x1878d
movq %rax, %rdi
callq 0x82e0
leaq -0x1b8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x8530
leaq -0x48(%rbp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x83e0
movq %rbx, %rdi
callq 0x8170
leaq -0x1d0(%rbp), %rdi
callq 0x8260
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd29a
movq %rax, %r12
jmp 0xd2a9
movq %rax, %r12
jmp 0xd2b9
movq %rax, %r12
leaq -0x1d0(%rbp), %rdi
callq 0x8260
movq %r15, %rdi
callq 0x8170
movq %r14, %rdi
callq 0x8170
movq %rbx, %rdi
callq 0x8610
movq %r12, %rdi
callq 0x85c0
nop