LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/RollingBuffer_p.cpp
// Function: BamTools::Internal::RollingBuffer::Clear()
void RollingBuffer::Clear(void) {

    // remove all byte arrays (except first)
    m_data.erase( m_data.begin()+1, m_data.end() );

    // clear out first byte array
    m_data[0].Resize(0);
    m_data[0].Squeeze();

    // reset index & size markers
    m_head = 0;
    m_tail = 0;
    m_tailBufferIndex = 0;
    m_totalBufferSize = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
leaq 0x28(%rdi), %rsi
movq 0x38(%rdi), %rax
movq %rax, %rdi
subq 0x40(%rbx), %rdi
movq 0x50(%rbx), %r8
movq %rdi, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %r15 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r15, %rdx
leaq 0x1(%rdx), %rcx
movabsq $-0x79e79e79e79e79e7, %r14 # imm = 0x8618618618618619
cmpq $-0x2f, %rdi
jl 0x4de07
cmpq $0x14, %rcx
ja 0x4de29
addq $0x18, %rax
movq (%r8), %r9
jmp 0x4de58
movq $-0x2, %rdi
subq %rdx, %rdi
movq %rdi, %rax
mulq %r14
subq %rdx, %rdi
shrq %rdi
addq %rdx, %rdi
shrq $0x4, %rdi
notq %rdi
jmp 0x4de3f
movq %rcx, %rax
mulq %r14
movq %rcx, %rdi
subq %rdx, %rdi
shrq %rdi
addq %rdx, %rdi
shrq $0x4, %rdi
leaq (%r8,%rdi,8), %r8
movq (%r8), %r9
imulq $-0x1f8, %rdi, %rax     # imm = 0xFE08
addq %r9, %rax
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rax
movq 0x58(%rbx), %rdi
movq 0x70(%rbx), %r10
leaq 0x40(%rsp), %rdx
movq %rax, (%rdx)
movq %r9, 0x8(%rdx)
movl $0x1f8, %eax            # imm = 0x1F8
addq %rax, %r9
movq %r9, 0x10(%rdx)
movq %r8, 0x18(%rdx)
leaq 0x20(%rsp), %rcx
movq %rdi, (%rcx)
movq (%r10), %rdi
movq %rdi, 0x8(%rcx)
addq %rax, %rdi
movq %rdi, 0x10(%rcx)
movq %r10, 0x18(%rcx)
movq %rsp, %rdi
callq 0x29150
movq 0x38(%rbx), %rdi
movq 0x50(%rbx), %r8
movq %rdi, %rsi
subq 0x40(%rbx), %rsi
movq %rsi, %rcx
sarq $0x3, %rcx
imulq %r15, %rcx
cmpq $-0x17, %rsi
jl 0x4ded9
cmpq $0x15, %rcx
jb 0x4df00
movq %rcx, %rax
mulq %r14
subq %rdx, %rcx
shrq %rcx
addq %rdx, %rcx
shrq $0x4, %rcx
jmp 0x4def2
notq %rcx
movq %rcx, %rax
mulq %r14
subq %rdx, %rcx
shrq %rcx
addq %rdx, %rcx
shrq $0x4, %rcx
notq %rcx
imulq $-0x1f8, %rcx, %rdi     # imm = 0xFE08
addq (%r8,%rcx,8), %rdi
addq %rsi, %rdi
xorl %esi, %esi
callq 0x26d90
movq 0x38(%rbx), %rdi
movq 0x50(%rbx), %r8
movq %rdi, %rsi
subq 0x40(%rbx), %rsi
movq %rsi, %rcx
sarq $0x3, %rcx
imulq %r15, %rcx
cmpq $-0x17, %rsi
jl 0x4df42
cmpq $0x15, %rcx
jb 0x4df69
movq %rcx, %rax
mulq %r14
subq %rdx, %rcx
shrq %rcx
addq %rdx, %rcx
shrq $0x4, %rcx
jmp 0x4df5b
notq %rcx
movq %rcx, %rax
mulq %r14
subq %rdx, %rcx
shrq %rcx
addq %rdx, %rcx
shrq $0x4, %rcx
notq %rcx
imulq $-0x1f8, %rcx, %rdi     # imm = 0xFE08
addq (%r8,%rcx,8), %rdi
addq %rsi, %rdi
callq 0x28a50
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/RollingBuffer_p.cpp
// Function: BamTools::Internal::RollingBuffer::BlockSize() const
size_t RollingBuffer::BlockSize(void) const {

    // if only one byte array in buffer <- needed?
    if ( m_tailBufferIndex == 0 )
        return m_tail - m_head;

    // otherwise return remaining num bytes in first array
    const ByteArray& first = m_data.front();
    return first.Size() - m_head;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x10(%rdi)
je 0x4dfa2
movq 0x38(%rbx), %rdi
callq 0x27270
jmp 0x4dfa6
movq 0x8(%rbx), %rax
subq (%rbx), %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/RollingBuffer_p.cpp
// Function: BamTools::Internal::RollingBuffer::Chop(unsigned long)
void RollingBuffer::Chop(size_t n) {

    // update buffer size
    if ( n > m_totalBufferSize )
        m_totalBufferSize = 0;
    else
        m_totalBufferSize -= n;

    // loop until target case hit
    for ( ; ; ) {

        // if only one array, decrement tail
        if ( m_tailBufferIndex == 0 ) {
            m_tail -= n;

            // if all data chopped
            if ( m_tail <= m_head ) {
                m_head = 0;
                m_tail = 0;
            }
            return;
        }

        // if there's room in last byte array to 'chop', just decrement tail
        if ( n <= m_tail ) {
            m_tail -= n;
            return;
        }

        // otherwise we're going to overlap our internal byte arrays
        // reduce our chop amount by the amount of data in the last byte array
        n -= m_tail;

        // remove last byte array & set tail to it's end
        m_data.pop_back();
        --m_tailBufferIndex;
        m_tail = m_data.at(m_tailBufferIndex).Size();
    }

    // if buffer is now empty, reset state & clear up memory
    if ( IsEmpty() )
        Clear();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rax
xorl %ecx, %ecx
subq %rsi, %rax
cmovaeq %rax, %rcx
movq %rcx, 0x18(%rdi)
cmpq $0x0, 0x10(%rdi)
je 0x4e176
leaq 0x28(%rbx), %r15
leaq 0x38(%rbx), %r12
movq 0x8(%rbx), %rax
movq %r14, %rcx
subq %rax, %r14
jbe 0x4e18e
movq %r15, %rdi
callq 0x26950
movq 0x10(%rbx), %r13
decq %r13
movq %r13, 0x10(%rbx)
movq %r15, %rdi
movq %r13, %rsi
callq 0x262b0
movq %r12, %rdi
movq %r13, %rsi
callq 0x27250
movq %rax, %rdi
callq 0x27270
movq %rax, 0x8(%rbx)
cmpq $0x0, 0x10(%rbx)
movq %r14, %rcx
jne 0x4e130
jmp 0x4e17a
movq 0x8(%rbx), %rax
subq %r14, %rax
movq %rax, 0x8(%rbx)
cmpq (%rbx), %rax
ja 0x4e195
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
jmp 0x4e195
subq %rcx, %rax
movq %rax, 0x8(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/RollingBuffer_p.cpp
// Function: BamTools::Internal::RollingBuffer::Read(char*, unsigned long)
size_t RollingBuffer::Read(char* dest, size_t max) {

    size_t bytesToRead    = std::min(Size(), max);
    size_t bytesReadSoFar = 0;

    while ( bytesReadSoFar < bytesToRead ) {
        const char* readPtr = ReadPointer();
        size_t blockBytes = std::min( (bytesToRead - bytesReadSoFar), BlockSize() );
        if ( dest )
            memcpy(dest+bytesReadSoFar, readPtr, blockBytes);
        bytesReadSoFar += blockBytes;
        Free(blockBytes);
    }

    return bytesReadSoFar;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq 0x18(%rdi), %rax
cmpq %rdx, %rax
cmovbq %rax, %rbx
testq %rbx, %rbx
je 0x4e461
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
movq 0x38(%r15), %rdi
cmpq %rdi, 0x58(%r15)
je 0x4e40c
callq 0x263c0
movq %rax, %r13
addq (%r15), %r13
jmp 0x4e40f
xorl %r13d, %r13d
cmpq $0x0, 0x10(%r15)
je 0x4e424
movq 0x38(%r15), %rdi
callq 0x27270
movq %rax, %rbp
jmp 0x4e428
movq 0x8(%r15), %rbp
movq %rbx, %rax
subq %r12, %rax
subq (%r15), %rbp
cmpq %rax, %rbp
cmovaeq %rax, %rbp
testq %r14, %r14
je 0x4e44c
leaq (%r14,%r12), %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x27260
addq %rbp, %r12
movq %r15, %rdi
movq %rbp, %rsi
callq 0x27960
cmpq %rbx, %r12
jb 0x4e3f5
jmp 0x4e464
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/RollingBuffer_p.cpp
// Function: BamTools::Internal::RollingBuffer::ReadPointer() const
const char* RollingBuffer::ReadPointer(void) const {

    // return null if empty buffer
    if ( m_data.empty() )
        return 0;

    // otherwise return pointer to current position
    const ByteArray& first = m_data.front();
    return first.ConstData() + m_head;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
cmpq %rdi, 0x58(%rbx)
je 0x4e494
callq 0x263c0
addq (%rbx), %rax
jmp 0x4e496
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/RollingBuffer_p.cpp
// Function: BamTools::Internal::RollingBuffer::ReadLine(char*, unsigned long)
size_t RollingBuffer::ReadLine(char* dest, size_t max) {

    // if we can't read line or if max is 0
    if ( !CanReadLine() || max == 0 )
        return 0;

    // otherwise, read until we hit newline
    size_t bytesReadSoFar = 0;
    bool finished = false;
    while ( !finished ) {

        const size_t index = IndexOf('\n');
        const char* readPtr = ReadPointer();
        size_t bytesToRead = std::min( (index+1)-bytesReadSoFar, BlockSize() );
        bytesToRead = std::min( bytesToRead, (max-1)-bytesReadSoFar );
        memcpy(dest+bytesReadSoFar, readPtr, bytesToRead);
        bytesReadSoFar += bytesToRead;
        Free(bytesToRead);

        if ( !((bytesReadSoFar < index+1) && (bytesReadSoFar < max-1)) )
            finished = true;
    }

    // null terminate 'dest' & return numBytesRead
    dest[bytesReadSoFar] = '\0';
    return bytesReadSoFar;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, (%rsp)
movq %rdi, %r15
movl $0xa, %esi
callq 0x286d0
xorl %r12d, %r12d
testq %rbx, %rbx
je 0x4e56a
cmpq $-0x1, %rax
je 0x4e56a
decq %rbx
xorl %r12d, %r12d
movq %r15, %rdi
movl $0xa, %esi
callq 0x286d0
movq %rax, %r13
movq 0x38(%r15), %rdi
cmpq %rdi, 0x58(%r15)
je 0x4e4fa
callq 0x263c0
movq %rax, %rbp
addq (%r15), %rbp
jmp 0x4e4fc
xorl %ebp, %ebp
cmpq $0x0, 0x10(%r15)
je 0x4e50e
movq 0x38(%r15), %rdi
callq 0x27270
jmp 0x4e512
movq 0x8(%r15), %rax
incq %r13
movq %r13, %rcx
subq %r12, %rcx
subq (%r15), %rax
cmpq %rcx, %rax
cmovaeq %rcx, %rax
movq %rbx, %r14
subq %r12, %r14
cmpq %rax, %r14
cmovaeq %rax, %r14
movq (%rsp), %rax
leaq (%rax,%r12), %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x27260
addq %r14, %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0x27960
cmpq %r13, %r12
jae 0x4e561
cmpq %rbx, %r12
jb 0x4e4d3
movq (%rsp), %rax
movb $0x0, (%rax,%r12)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/TcpSocket_p.cpp
// Function: BamTools::Internal::TcpSocket::DisconnectFromHost()
void TcpSocket::DisconnectFromHost(void) {

    // close socket engine & delete
    if ( m_state == TcpSocket::ConnectedState )
        ResetSocketEngine();

    // reset connection state
//    m_localPort = 0;
    m_remotePort = 0;
//    m_localAddress.Clear();
    m_remoteAddress.Clear();
    m_hostName.clear();
    m_cachedSocketDescriptor = -1;

    // for future, make sure there's outgoing data that needs to be flushed
    m_readBuffer.Clear();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x1, 0xfc(%rdi)
jne 0x4fb7d
movq %rbx, %rdi
callq 0x27ee0
movw $0x0, 0x28(%rbx)
leaq 0x30(%rbx), %rdi
callq 0x28fc0
movq $0x0, 0x10(%rbx)
movq 0x8(%rbx), %rax
movb $0x0, (%rax)
movl $0xffffffff, 0x78(%rbx) # imm = 0xFFFFFFFF
subq $-0x80, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0x27be0
nop
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/TcpSocket_p.cpp
// Function: BamTools::Internal::TcpSocket::ConnectToHost(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, BamTools::IBamIODevice::OpenMode)
bool TcpSocket::ConnectToHost(const string& hostName,
                              const string& port,
                              IBamIODevice::OpenMode mode)
{
    // create new address object with requested host name
    HostAddress hostAddress;
    hostAddress.SetAddress(hostName);

    HostInfo info;
    // if host name was IP address ("x.x.x.x" or IPv6 format)
    // otherwise host name was 'plain-text' ("www.foo.bar")
    // we need to look up IP address(es)
    if ( hostAddress.HasIPAddress() )
        info.SetAddresses( vector<HostAddress>(1, hostAddress) );
    else
        info = HostInfo::Lookup(hostName, port);

    // attempt connection on requested port
    return ConnectImpl(info, port, mode);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
leaq 0xd0(%rsp), %r13
movq %r13, %rdi
callq 0x28880
movq %r13, %rdi
movq %r12, %rsi
callq 0x289f0
leaq 0x70(%rsp), %rdi
callq 0x26970
leaq 0xd0(%rsp), %rdi
callq 0x267b0
testb %al, %al
je 0x50030
leaq 0x10(%rsp), %rdi
leaq 0xd0(%rsp), %rdx
leaq 0xf(%rsp), %rcx
movl $0x1, %esi
callq 0x27d90
leaq 0x70(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x29200
leaq 0x10(%rsp), %rdi
callq 0x282f0
jmp 0x50083
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x26eb0
leaq 0x70(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x26b80
leaq 0x90(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x261c0
leaq 0x50(%rsp), %rsi
movl -0x8(%rsi), %eax
leaq 0xb0(%rsp), %rdi
movl %eax, -0x8(%rdi)
callq 0x26b80
leaq 0x10(%rsp), %rdi
callq 0x28b00
leaq 0x70(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rdx
movl %ebx, %ecx
callq 0x27660
movl %eax, %ebx
leaq 0x70(%rsp), %rdi
callq 0x28b00
leaq 0xd0(%rsp), %rdi
callq 0x26640
movl %ebx, %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x282f0
jmp 0x500ed
jmp 0x500ea
jmp 0x500ea
jmp 0x500e5
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x28b00
jmp 0x500ed
movq %rax, %rbx
jmp 0x500f7
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x28b00
leaq 0xd0(%rsp), %rdi
callq 0x26640
movq %rbx, %rdi
callq 0x28c10
movq %rax, %rdi
callq 0x2f047
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/TcpSocket_p.cpp
// Function: BamTools::Internal::TcpSocket::ResetSocketEngine()
void TcpSocket::ResetSocketEngine(void) {

    // shut down socket engine
    if ( m_engine ) {
        m_engine->Close();
        delete m_engine;
        m_engine = 0;
    }

    // reset our state & cached socket handle
    m_state = TcpSocket::UnconnectedState;
    m_cachedSocketDescriptor = -1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x70(%rdi), %rdi
testq %rdi, %rdi
je 0x5014a
callq 0x27800
movq 0x70(%rbx), %r14
testq %r14, %r14
je 0x5013a
movq %r14, %rdi
callq 0x291f0
movq %r14, %rdi
callq 0x27560
movq $0x0, 0x70(%rbx)
movl $0x0, 0xfc(%rbx)
movl $0xffffffff, 0x78(%rbx) # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x27560
movq %rbx, %rdi
callq 0x28c10
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/TcpSocket_p.cpp
// Function: BamTools::Internal::TcpSocket::Read(char*, unsigned int)
int64_t TcpSocket::Read(char* data, const unsigned int numBytes) {

    // if we have data in buffer, just return it
    if ( !m_readBuffer.IsEmpty() ) {
        const size_t bytesRead = m_readBuffer.Read(data, numBytes);
        return static_cast<int64_t>(bytesRead);
    }

    // otherwise, we'll need to fetch data from socket
    // first make sure we have a valid socket engine
    if ( m_engine == 0 ) {
        // TODO: set error string/state?
        return -1;
    }

    // fetch data from socket, return 0 for success, -1 for failure
    // since this should be called in a loop,
    // we'll pull the actual bytes from the buffer on next iteration
    const int64_t socketBytesRead = ReadFromSocket();
    if ( socketBytesRead < 0 ) {
        // TODO: set error string/state ?
        return -1;
    }

    // we should have data now in buffer, try to fetch requested amount
    // if nothing in buffer, we will return 0 bytes read (signals EOF reached)
    const size_t numBytesRead = m_readBuffer.Read(data, numBytes);
    return static_cast<int64_t>(numBytesRead);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x80(%rdi), %r14
movq %r14, %rdi
callq 0x27040
testb %al, %al
je 0x50248
cmpq $0x0, 0x70(%r15)
je 0x5025f
movq %r15, %rdi
callq 0x28060
testq %rax, %rax
js 0x5025f
movl %ebp, %edx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x26700
movq $-0x1, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/TcpSocket_p.cpp
// Function: BamTools::Internal::TcpSocket::ReadFromSocket()
int64_t TcpSocket::ReadFromSocket(void) {

    // check for any socket engine errors
    if ( !m_engine->IsValid() ) {
        m_errorString = "TcpSocket::ReadFromSocket - socket disconnected";
        ResetSocketEngine();
        return -1;
    }

    // wait for ready read
    bool timedOut;
    const bool isReadyRead = m_engine->WaitForRead(5000, &timedOut);

    // if not ready
    if ( !isReadyRead ) {

        // if we simply timed out
        if ( timedOut ) {
            // TODO: get add'l error info from engine ?
            m_errorString = "TcpSocket::ReadFromSocket - timed out waiting for ready read";
        }

        // otherwise, there was some other error
        else {
            // TODO: get add'l error info from engine ?
            m_errorString = "TcpSocket::ReadFromSocket - encountered error while waiting for ready read";
        }

        // return failure
        return -1;
    }

    // get number of bytes available from socket
    const int64_t bytesToRead = m_engine->NumBytesAvailable();
    if ( bytesToRead < 0 ) {
        // TODO: get add'l error info from engine ?
        m_errorString = "TcpSocket::ReadFromSocket - encountered error while determining numBytesAvailable";
        return -1;
    }

    // make space in buffer & read from socket
    char* buffer = m_readBuffer.Reserve(bytesToRead);
    const int64_t numBytesRead = m_engine->Read(buffer, bytesToRead);
    if ( numBytesRead == -1 ) {
        // TODO: get add'l error info from engine ?
        m_errorString = "TcpSocket::ReadFromSocket - encountered error while reading bytes";
    }

    // return number of bytes actually read
    return numBytesRead;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x70(%rdi), %rdi
callq 0x26490
testb %al, %al
je 0x502fb
movq 0x70(%rbx), %rdi
leaq 0x7(%rsp), %rdx
movl $0x1388, %esi           # imm = 0x1388
callq 0x28e80
testb %al, %al
je 0x50327
movq 0x70(%rbx), %rdi
callq 0x28ac0
testq %rax, %rax
js 0x5035a
movq %rax, %r14
leaq 0x80(%rbx), %rdi
movq %rax, %rsi
callq 0x269a0
movq 0x70(%rbx), %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x26de0
cmpq $-0x1, %rax
jne 0x50386
movq 0x108(%rbx), %rdx
addq $0x100, %rbx            # imm = 0x100
leaq 0x6eed(%rip), %rcx      # 0x571e0
movl $0x41, %r8d
jmp 0x50375
leaq 0x100(%rbx), %rdi
movq 0x108(%rbx), %rdx
leaq 0x6dc6(%rip), %rcx      # 0x570d6
movl $0x2f, %r8d
xorl %esi, %esi
callq 0x285a0
movq %rbx, %rdi
callq 0x27ee0
jmp 0x5037f
movq 0x108(%rbx), %rdx
addq $0x100, %rbx            # imm = 0x100
cmpb $0x1, 0x7(%rsp)
jne 0x5034b
leaq 0x6dc3(%rip), %rcx      # 0x57106
movl $0x3c, %r8d
jmp 0x50375
leaq 0x6df1(%rip), %rcx      # 0x57143
movl $0x4a, %r8d
jmp 0x50375
movq 0x108(%rbx), %rdx
addq $0x100, %rbx            # imm = 0x100
leaq 0x6e1f(%rip), %rcx      # 0x5718e
movl $0x51, %r8d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x285a0
movq $-0x1, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/TcpSocket_p.cpp
// Function: BamTools::Internal::TcpSocket::ReadLine(char*, unsigned long)
int64_t TcpSocket::ReadLine(char* dest, size_t max) {

    // wait for buffer to contain line contents
    if ( !WaitForReadLine() ) {
        m_errorString = "TcpSocket::ReadLine - error waiting for read line";
        return -1;
    }

    // leave room for null term
    if ( max < 2 )
        return -1;
    --max;

    // read from buffer, handle newlines
    int64_t readSoFar = m_readBuffer.ReadLine(dest, max);
    if ( readSoFar && dest[readSoFar-1] == '\n' ) {

        // adjust for windows-style '\r\n'
        if ( readSoFar > 1 && dest[readSoFar-2] == '\r') {
            --readSoFar;
            dest[readSoFar-1] = '\n';
        }
    }

    // null terminate & return number of bytes read
    dest[readSoFar] = '\0';
    return readSoFar;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
callq 0x264d0
testb %al, %al
je 0x50572
movq $-0x1, %rax
cmpq $0x2, %r15
jb 0x505a6
decq %r15
subq $-0x80, %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x28660
testq %rax, %rax
je 0x505a0
cmpq $0x2, %rax
jl 0x505a2
cmpb $0xa, -0x1(%rbx,%rax)
jne 0x505a2
cmpb $0xd, -0x2(%rbx,%rax)
jne 0x505a2
movb $0xa, -0x2(%rbx,%rax)
decq %rax
jmp 0x505a2
movq 0x108(%r14), %rdx
addq $0x100, %r14            # imm = 0x100
leaq 0x6c9b(%rip), %rcx      # 0x57222
movl $0x31, %r8d
movq %r14, %rdi
xorl %esi, %esi
callq 0x285a0
movq $-0x1, %rax
jmp 0x505a6
xorl %eax, %eax
movb $0x0, (%rbx,%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/TcpSocket_p.cpp
// Function: BamTools::Internal::TcpSocket::WaitForReadLine()
bool TcpSocket::WaitForReadLine(void) {

    // wait until we can read a line (will return immediately if already capable)
    while ( !CanReadLine() ) {
        if ( !ReadFromSocket() )
            return false;
    }

    // if we get here, success
    return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
movq %r14, %rdi
callq 0x28a30
movl %eax, %ebp
testb %al, %al
jne 0x505d5
movq %rbx, %rdi
callq 0x28060
testq %rax, %rax
jne 0x505ba
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/TcpSocket_p.cpp
// Function: BamTools::Internal::TcpSocket::Write(char const*, unsigned int)
int64_t TcpSocket::Write(const char* data, const unsigned int numBytes) {

    // single-shot attempt at write (not buffered, just try to shove the data through socket)
    // this method purely exists to send 'small' HTTP requests/FTP commands from client to server

    // wait for our socket to be write-able
    bool timedOut;
    const bool isReadyWrite = m_engine->WaitForWrite(3000, &timedOut);

    // if ready, return number of bytes written
    if ( isReadyWrite )
        return m_engine->Write(data, numBytes);

    // otherwise, socket not ready for writing
    // set error string depending on reason & return failure
    if ( !timedOut ) {
        // TODO: get add'l error info from engine ??
        m_errorString = "TcpSocket::Write - timed out waiting for ready-write";
    }
    else {
        // TODO: get add'l error info from engine ??
        m_errorString = "TcpSocket::Write - error encountered while waiting for ready-write";
    }
    return -1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x70(%rdi), %rdi
leaq 0xf(%rsp), %rdx
movl $0xbb8, %esi            # imm = 0xBB8
callq 0x26a00
testb %al, %al
je 0x50613
movq 0x70(%rbx), %rdi
movl %ebp, %edx
movq %r14, %rsi
callq 0x288c0
jmp 0x50655
movq 0x108(%rbx), %rdx
addq $0x100, %rbx            # imm = 0x100
cmpb $0x0, 0xf(%rsp)
je 0x50637
leaq 0x6c5a(%rip), %rcx      # 0x57289
movl $0x42, %r8d
jmp 0x50644
leaq 0x6c16(%rip), %rcx      # 0x57254
movl $0x34, %r8d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x285a0
movq $-0x1, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/TcpSocketEngine_p.cpp
// Function: BamTools::Internal::TcpSocketEngine::Close()
void TcpSocketEngine::Close(void) {

    // close socket if we have valid FD
    if ( m_socketDescriptor != -1 ) {
        nativeClose();
        m_socketDescriptor = -1;
    }

    // reset state
    m_socketState = TcpSocket::UnconnectedState;
//    m_localAddress.Clear();
    m_remoteAddress.Clear();
//    m_localPort = 0;
    m_remotePort = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $-0x1, (%rdi)
je 0x50887
movq %rbx, %rdi
callq 0x286c0
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
movl $0x0, 0x50(%rbx)
leaq 0x8(%rbx), %rdi
callq 0x28fc0
movw $0x0, 0x48(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/TcpSocketEngine_p.cpp
// Function: BamTools::Internal::TcpSocketEngine::Connect(BamTools::Internal::HostAddress const&, unsigned short)
bool TcpSocketEngine::Connect(const HostAddress& address, const uint16_t port) {

    // return failure if invalid FD or already connected
    if ( !IsValid() || (m_socketState == TcpSocket::ConnectedState) ) {
        // TODO: set error string
        return false;
    }

    // attempt to connect to host address on requested port
    if ( !nativeConnect(address, port) ) {
        // TODO: set error string
        return false;
    }

    // if successful, store remote host address port & return success
    // TODO: (later) fetch proxied remote & local host/port  here
    m_remoteAddress = address;
    m_remotePort    = port;
    return true;
}

// Assembly:
xorl %eax, %eax
cmpl $-0x1, (%rdi)
je 0x508ff
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
cmpl $0x1, 0x50(%rdi)
je 0x508fa
movl %edx, %ebx
movq %rsi, %r15
movzwl %bx, %edx
movq %r14, %rdi
callq 0x29000
testb %al, %al
je 0x508f8
movq 0x10(%r15), %rax
movq %rax, 0x18(%r14)
movups (%r15), %xmm0
movups %xmm0, 0x8(%r14)
leaq 0x20(%r14), %rdi
leaq 0x18(%r15), %rsi
callq 0x26b80
movb 0x38(%r15), %al
movb %al, 0x40(%r14)
movw %bx, 0x48(%r14)
movb $0x1, %al
jmp 0x508fa
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/TcpSocketEngine_p.cpp
// Function: BamTools::Internal::TcpSocketEngine::Initialize(BamTools::Internal::HostAddress::NetworkProtocol)
bool TcpSocketEngine::Initialize(HostAddress::NetworkProtocol protocol) {

    // close current socket if we have one open
    if ( IsValid() )
        Close();

    // attempt to create new socket
    return nativeCreateSocket(protocol);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
cmpl $-0x1, (%rdi)
je 0x50966
movq %r14, %rdi
callq 0x27800
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x28130
nop
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/TcpSocketEngine_p.cpp
// Function: BamTools::Internal::TcpSocketEngine::WaitForRead(int, bool*)
bool TcpSocketEngine::WaitForRead(int msec, bool* timedOut) {

    // reset timedOut flag
    *timedOut = false;

    // need to wait for our socket to be ready to read
    const int ret = nativeSelect(msec, true);

    // if timed out
    if ( ret == 0 ) {
        *timedOut = true;
        m_socketError = TcpSocket::SocketTimeoutError;
        m_errorString = "socket timed out";
    }

    // return if any sockets available for reading
    return ( ret > 0 );
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movb $0x0, (%rdx)
movl $0x1, %edx
callq 0x28990
movl %eax, %ebp
testl %eax, %eax
jne 0x509e9
movb $0x1, (%r14)
movl $0x5, 0x4c(%rbx)
movq 0x60(%rbx), %rdx
addq $0x58, %rbx
leaq 0x68f3(%rip), %rcx      # 0x572cc
movl $0x10, %r8d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x285a0
testl %ebp, %ebp
setg %al
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/TcpSocketEngine_p.cpp
// Function: BamTools::Internal::TcpSocketEngine::WaitForWrite(int, bool*)
bool TcpSocketEngine::WaitForWrite(int msec, bool* timedOut) {

    // reset timedOut flag
    *timedOut = false;

    // need to wait for our socket to be ready to write
    const int ret = nativeSelect(msec, false);

    // if timed out
    if ( ret == 0 ) {
        *timedOut = true;
        m_socketError = TcpSocket::SocketTimeoutError;
        m_errorString = "socket timed out";
    }

    // return if any sockets available for reading
    return ( ret > 0 );
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movb $0x0, (%rdx)
xorl %edx, %edx
callq 0x28990
movl %eax, %ebp
testl %eax, %eax
jne 0x50a38
movb $0x1, (%r14)
movl $0x5, 0x4c(%rbx)
movq 0x60(%rbx), %rdx
addq $0x58, %rbx
leaq 0x68a4(%rip), %rcx      # 0x572cc
movl $0x10, %r8d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x285a0
testl %ebp, %ebp
setg %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/TcpSocketEngine_unix_p.cpp
// Function: BamTools::Internal::TcpSocketEngine::nativeCreateSocket(BamTools::Internal::HostAddress::NetworkProtocol)
bool TcpSocketEngine::nativeCreateSocket(HostAddress::NetworkProtocol protocol) {

    // get protocol value for requested protocol type
    const int protocolNum = ( (protocol == HostAddress::IPv6Protocol) ? AF_INET6
                                                                      : AF_INET );

    // attempt to create socket
    int socketFd = socket(protocolNum, SOCK_STREAM, IPPROTO_TCP);

    // if we fetched an invalid socket descriptor
    if ( socketFd <= 0 ) {

        // see what error we got
        switch ( errno ) {
            case EPROTONOSUPPORT:
            case EAFNOSUPPORT:
            case EINVAL:
                m_socketError = TcpSocket::UnsupportedSocketOperationError;
                m_errorString = "protocol not supported";
                break;
            case ENFILE:
            case EMFILE:
            case ENOBUFS:
            case ENOMEM:
                m_socketError = TcpSocket::SocketResourceError;
                m_errorString = "out of resources";
                break;
            case EACCES:
                m_socketError = TcpSocket::SocketAccessError;
                m_errorString = "permission denied";
                break;
            default:
                break;
        }

        // return failure
        return false;
    }

    // otherwise, store our socket FD & return success
    m_socketDescriptor = socketFd;
    return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
xorl %eax, %eax
cmpl $0x1, %esi
sete %al
leal 0x2(,%rax,8), %edi
movl $0x1, %esi
movl $0x6, %edx
callq 0x26450
movl %eax, %ebx
testl %eax, %eax
jle 0x50c73
movl %ebx, (%r14)
jmp 0x50cf4
callq 0x26110
movl (%rax), %eax
cmpl $0x16, %eax
jle 0x50c93
cmpl $0x60, %eax
jg 0x50ca4
leal -0x17(%rax), %ecx
cmpl $0x2, %ecx
jb 0x50ccd
cmpl $0x5d, %eax
je 0x50cae
jmp 0x50cf4
cmpl $0xc, %eax
je 0x50ccd
cmpl $0xd, %eax
je 0x50d01
cmpl $0x16, %eax
je 0x50cae
jmp 0x50cf4
cmpl $0x69, %eax
je 0x50ccd
cmpl $0x61, %eax
jne 0x50cf4
movl $0x7, 0x4c(%r14)
movq 0x60(%r14), %rdx
addq $0x58, %r14
leaq 0x66b1(%rip), %rcx      # 0x57376
movl $0x16, %r8d
jmp 0x50cea
movl $0x4, 0x4c(%r14)
movq 0x60(%r14), %rdx
addq $0x58, %r14
leaq 0x66a9(%rip), %rcx      # 0x5738d
movl $0x10, %r8d
movq %r14, %rdi
xorl %esi, %esi
callq 0x285a0
testl %ebx, %ebx
setg %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x3, 0x4c(%r14)
movq 0x60(%r14), %rdx
addq $0x58, %r14
leaq 0x664c(%rip), %rcx      # 0x57364
movl $0x11, %r8d
jmp 0x50cea
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/TcpSocketEngine_unix_p.cpp
// Function: BamTools::Internal::TcpSocketEngine::nativeNumBytesAvailable() const
int64_t TcpSocketEngine::nativeNumBytesAvailable(void) const {

    // fetch number of bytes, return 0 on error
    int numBytes(0);
    if ( ioctl(m_socketDescriptor, FIONREAD, (char*)&numBytes) < 0 )
        return -1;
    return static_cast<int64_t>(numBytes);
}

// Assembly:
pushq %rax
leaq 0x4(%rsp), %rdx
movl $0x0, (%rdx)
movl (%rdi), %edi
movl $0x541b, %esi           # imm = 0x541B
xorl %eax, %eax
callq 0x281b0
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x50d47
movl 0x4(%rsp), %ecx
movslq %ecx, %rax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/sam/SamFormatParser_p.cpp
// Function: BamTools::Internal::SamFormatParser::Parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void SamFormatParser::Parse(const string& headerText) {

    // clear header's prior contents
    m_header.Clear();

    // empty header is OK, but skip processing
    if ( headerText.empty() )
        return;

    // other wise parse SAM lines
    istringstream headerStream(headerText);
    string headerLine("");
    while ( getline(headerStream, headerLine) )
         ParseSamLine(headerLine);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x29170
cmpq $0x0, 0x8(%r15)
je 0x50edd
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x28940
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x501c(%rip), %rdx      # 0x55e8f
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x26750
leaq 0x8(%rsp), %r15
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x275a0
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x28ea0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x50ec4
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27ad0
jmp 0x50e85
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x50ed3
callq 0x27560
leaq 0x28(%rsp), %rdi
callq 0x268f0
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
jmp 0x50f03
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x50f03
callq 0x27560
leaq 0x28(%rsp), %rdi
callq 0x268f0
movq %rbx, %rdi
callq 0x28c10
movq %rax, %rdi
callq 0x2f047
nop
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/sam/SamFormatParser_p.cpp
// Function: BamTools::Internal::SamFormatParser::ParseSamLine(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void SamFormatParser::ParseSamLine(const string& line) {

    // skip if line is not long enough to contain true values
    if ( line.length() < 5 ) return;

    // determine token at beginning of line
    const string firstToken = line.substr(0,3);
    const string restOfLine = line.substr(4);
    if      ( firstToken == Constants::SAM_HD_BEGIN_TOKEN) ParseHDLine(restOfLine);
    else if ( firstToken == Constants::SAM_SQ_BEGIN_TOKEN) ParseSQLine(restOfLine);
    else if ( firstToken == Constants::SAM_RG_BEGIN_TOKEN) ParseRGLine(restOfLine);
    else if ( firstToken == Constants::SAM_PG_BEGIN_TOKEN) ParsePGLine(restOfLine);
    else if ( firstToken == Constants::SAM_CO_BEGIN_TOKEN) ParseCOLine(restOfLine);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
cmpq $0x5, 0x8(%rsi)
jb 0x510ab
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
movl $0x3, %ecx
xorl %edx, %edx
callq 0x277f0
leaq 0x28(%rsp), %rdi
movl $0x4, %edx
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x277f0
movq 0x10(%rsp), %r14
cmpq 0x1ca64(%rip), %r14     # 0x6d9d0
jne 0x50f93
testq %r14, %r14
je 0x5104b
movq 0x1ca4a(%rip), %rsi     # 0x6d9c8
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x277e0
testl %eax, %eax
je 0x5104b
cmpq 0x1cab6(%rip), %r14     # 0x6da50
jne 0x50fc1
testq %r14, %r14
je 0x5105a
movq 0x1ca9c(%rip), %rsi     # 0x6da48
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x277e0
testl %eax, %eax
je 0x5105a
cmpq 0x1cb68(%rip), %r14     # 0x6db30
jne 0x50feb
testq %r14, %r14
je 0x51069
movq 0x1cb4e(%rip), %rsi     # 0x6db28
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x277e0
testl %eax, %eax
je 0x51069
cmpq 0x1ccde(%rip), %r14     # 0x6dcd0
jne 0x51011
testq %r14, %r14
je 0x51078
movq 0x1ccc8(%rip), %rsi     # 0x6dcc8
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x277e0
testl %eax, %eax
je 0x51078
cmpq 0x1cd78(%rip), %r14     # 0x6dd90
jne 0x51085
testq %r14, %r14
je 0x51037
movq 0x1cd62(%rip), %rsi     # 0x6dd88
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x277e0
testl %eax, %eax
jne 0x51085
movl $0x120, %edi            # imm = 0x120
addq (%rbx), %rdi
leaq 0x28(%rsp), %rsi
callq 0x26ab0
jmp 0x51085
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x26ce0
jmp 0x51085
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x28d90
jmp 0x51085
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x264a0
jmp 0x51085
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x26cf0
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x51098
callq 0x27560
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x510ab
callq 0x27560
addq $0x48, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x510ce
callq 0x27560
jmp 0x510ce
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x510e1
callq 0x27560
movq %rbx, %rdi
callq 0x28c10
nop
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/sam/SamFormatParser_p.cpp
// Function: BamTools::Internal::SamFormatParser::Split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char)
const vector<string> SamFormatParser::Split(const string& line, const char delim) {
    vector<string> tokens;
    stringstream lineStream(line);
    string token;
    while ( getline(lineStream, token, delim) )
        tokens.push_back(token);
    return tokens;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movl %ecx, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x28(%rsp), %rdi
movq %rdx, %rsi
movl $0x18, %edx
callq 0x28740
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movsbl %bpl, %ebp
leaq 0x28(%rsp), %r14
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x28ea0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x522d0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x26ab0
jmp 0x522a8
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x522df
callq 0x27560
leaq 0x28(%rsp), %rdi
callq 0x270d0
movq %rbx, %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x5231d
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x52313
callq 0x27560
leaq 0x28(%rsp), %rdi
callq 0x270d0
movq %rbx, %rdi
callq 0x270a0
movq %r14, %rdi
callq 0x28c10
movq %rax, %rdi
callq 0x2f047
nop
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/sam/SamFormatPrinter_p.cpp
// Function: BamTools::Internal::SamFormatPrinter::ToString[abi:cxx11]() const
const string SamFormatPrinter::ToString(void) const {

    // clear out stream
    stringstream out("");

    // generate formatted header text
    PrintHD(out);
    PrintSQ(out);
    PrintRG(out);
    PrintPG(out);
    PrintCO(out);

    // return result
    return out.str();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x38c7(%rip), %rdx      # 0x55e8f
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x26750
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movl $0x18, %edx
callq 0x28740
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x525f8
callq 0x27560
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x28d10
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x291e0
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x28c60
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x29130
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x26b70
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x28730
leaq 0x28(%rsp), %rdi
callq 0x270d0
movq %rbx, %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x52686
callq 0x27560
jmp 0x52686
movq %rax, %rbx
jmp 0x52686
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x270d0
movq %rbx, %rdi
callq 0x28c10
movq %rax, %rdi
callq 0x2f047
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/sam/SamFormatPrinter_p.cpp
// Function: BamTools::Internal::SamFormatPrinter::PrintCO(std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char>>&) const
void SamFormatPrinter::PrintCO(std::stringstream& out) const {

    // iterate over comments
    vector<string>::const_iterator commentIter = m_header.Comments.begin();
    vector<string>::const_iterator commentEnd  = m_header.Comments.end();
    for ( ; commentIter != commentEnd; ++commentIter ) {

        // @CO <Comment>
        out << Constants::SAM_CO_BEGIN_TOKEN
            << Constants::SAM_TAB
            << (*commentIter)
            << endl;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq (%rdi), %rax
movq 0x120(%rax), %r12
movq 0x128(%rax), %r13
cmpq %r13, %r12
je 0x5326a
movq %rsi, %rbx
addq $0x10, %rbx
leaq 0xf(%rsp), %r14
movq 0x1b16e(%rip), %rsi     # 0x6e370
movq 0x1b16f(%rip), %rdx     # 0x6e378
movq %rbx, %rdi
callq 0x27a70
movb $0x9, 0xf(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x27a70
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %rax, %rdi
callq 0x27a70
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x275a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x260a0
movq %rax, %rdi
callq 0x26fc0
addq $0x20, %r12
cmpq %r13, %r12
jne 0x531fb
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/sam/SamHeaderValidator_p.cpp
// Function: BamTools::Internal::SamHeaderValidator::Validate()
bool SamHeaderValidator::Validate(void) {
    bool isValid = true;
    isValid &= ValidateMetadata();
    isValid &= ValidateSequenceDictionary();
    isValid &= ValidateReadGroupDictionary();
    isValid &= ValidateProgramChain();
    return isValid;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x27c10
movl %eax, %ebp
movq %rbx, %rdi
callq 0x26e30
movl %eax, %r14d
andb %bpl, %r14b
movq %rbx, %rdi
callq 0x26090
movl %eax, %ebp
andb %r14b, %bpl
movq %rbx, %rdi
callq 0x28b70
movl %eax, %r14d
movq %rbx, %rdi
callq 0x26720
andb %r14b, %al
andb %bpl, %al
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/sam/SamHeaderValidator_p.cpp
// Function: BamTools::Internal::SamHeaderValidator::ValidateMetadata()
bool SamHeaderValidator::ValidateMetadata(void) {
    bool isValid = true;
    isValid &= ValidateVersion();
    isValid &= ValidateSortOrder();
    isValid &= ValidateGroupOrder();
    return isValid;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x289d0
movl %eax, %ebp
movq %rbx, %rdi
callq 0x28e50
movl %eax, %r14d
andb %bpl, %r14b
movq %rbx, %rdi
callq 0x27cb0
andb %r14b, %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/sam/SamHeaderValidator_p.cpp
// Function: BamTools::Internal::SamHeaderValidator::ValidateSequenceDictionary()
bool SamHeaderValidator::ValidateSequenceDictionary(void) {

    bool isValid = true;

    // check for unique sequence names
    isValid &= ContainsUniqueSequenceNames();

    // iterate over sequences
    const SamSequenceDictionary& sequences = m_header.Sequences;
    SamSequenceConstIterator seqIter = sequences.ConstBegin();
    SamSequenceConstIterator seqEnd  = sequences.ConstEnd();
    for ( ; seqIter != seqEnd; ++seqIter ) {
        const SamSequence& seq = (*seqIter);
        isValid &= ValidateSequence(seq);
    }

    // return validation state
    return isValid;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
callq 0x272c0
movl %eax, %ebx
movq (%r14), %r12
addq $0x78, %r12
movq %r12, %rdi
callq 0x28490
movq %rax, %r15
movq %r12, %rdi
callq 0x28f40
cmpq %rax, %r15
je 0x537b3
movq %rax, %r12
leaq 0x60(%r15), %rsi
movq %r14, %rdi
callq 0x27590
movl %eax, %ebp
leaq 0x40(%r15), %rsi
movq %r14, %rdi
callq 0x274b0
andb %bpl, %al
andb %al, %bl
addq $0xd8, %r15
cmpq %r12, %r15
jne 0x53788
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/sam/SamHeaderValidator_p.cpp
// Function: BamTools::Internal::SamHeaderValidator::ValidateReadGroupDictionary()
bool SamHeaderValidator::ValidateReadGroupDictionary(void) {

    bool isValid = true;

    // check for unique read group IDs & platform units
    isValid &= ContainsUniqueIDsAndPlatformUnits();

    // iterate over read groups
    const SamReadGroupDictionary& readGroups = m_header.ReadGroups;
    SamReadGroupConstIterator rgIter = readGroups.ConstBegin();
    SamReadGroupConstIterator rgEnd  = readGroups.ConstEnd();
    for ( ; rgIter != rgEnd; ++rgIter ) {
        const SamReadGroup& rg = (*rgIter);
        isValid &= ValidateReadGroup(rg);
    }

    // return validation state
    return isValid;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
callq 0x26600
movl %eax, %ebx
movl $0xc0, %r12d
addq (%r14), %r12
movq %r12, %rdi
callq 0x28890
movq %rax, %r15
movq %r12, %rdi
callq 0x28d30
cmpq %rax, %r15
je 0x53822
movq %rax, %r12
leaq 0x40(%r15), %rsi
movq %r14, %rdi
callq 0x26030
movl %eax, %ebp
leaq 0x160(%r15), %rsi
movq %r14, %rdi
callq 0x265f0
andb %bpl, %al
andb %al, %bl
addq $0x198, %r15            # imm = 0x198
cmpq %r12, %r15
jne 0x537f4
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/sam/SamHeaderValidator_p.cpp
// Function: BamTools::Internal::SamHeaderValidator::ValidateProgramChain()
bool SamHeaderValidator::ValidateProgramChain(void) {
    bool isValid = true;
    isValid &= ContainsUniqueProgramIds();
    isValid &= ValidatePreviousProgramIds();
    return isValid;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x28b70
movl %eax, %ebp
movq %rbx, %rdi
callq 0x26720
andb %bpl, %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/sam/SamHeaderValidator_p.cpp
// Function: BamTools::Internal::SamHeaderValidator::ValidateSortOrder()
bool SamHeaderValidator::ValidateSortOrder(void) {

    const string& sortOrder = m_header.SortOrder;

    // warn if sort order not present
    if ( sortOrder.empty() ) {
        AddWarning("Sort order (SO) missing. Not required, but strongly recommended");
        return true;
    }

    // if sort order is valid keyword
    if ( sortOrder == Constants::SAM_HD_SORTORDER_COORDINATE ||
         sortOrder == Constants::SAM_HD_SORTORDER_QUERYNAME  ||
         sortOrder == Constants::SAM_HD_SORTORDER_UNSORTED
       )
    {
        return true;
    }

    // otherwise
    AddError("Invalid sort order (SO): " + sortOrder);
    return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq (%rdi), %r14
movq 0x28(%r14), %r15
testq %r15, %r15
je 0x53b58
addq $0x20, %r14
cmpq 0x1aebd(%rip), %r15     # 0x6e980
jne 0x53adf
movq 0x1aeac(%rip), %rsi     # 0x6e978
movq (%r14), %rdi
movq %r15, %rdx
callq 0x277e0
testl %eax, %eax
je 0x53b90
cmpq 0x1aeba(%rip), %r15     # 0x6e9a0
jne 0x53b02
movq 0x1aea9(%rip), %rsi     # 0x6e998
movq (%r14), %rdi
movq %r15, %rdx
callq 0x277e0
testl %eax, %eax
je 0x53b90
cmpq 0x1aed7(%rip), %r15     # 0x6e9e0
jne 0x53b21
movq 0x1aec6(%rip), %rsi     # 0x6e9d8
movq (%r14), %rdi
movq %r15, %rdx
callq 0x277e0
testl %eax, %eax
je 0x53b90
leaq 0x3a44(%rip), %rsi      # 0x5756c
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0x273f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27500
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x53b54
callq 0x27560
xorl %eax, %eax
jmp 0x53b92
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x39c4(%rip), %rsi      # 0x5752c
leaq 0x39fc(%rip), %rdx      # 0x5756b
movq %rsp, %rdi
callq 0x26750
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x26920
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x53b90
callq 0x27560
movb $0x1, %al
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x53bbb
jmp 0x53bc5
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x53bc5
callq 0x27560
jmp 0x53bc5
movq %rax, %rbx
movq %rbx, %rdi
callq 0x28c10
nop