LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/BamHttp_p.cpp
// Function: BamTools::Internal::BamHttp::Open(BamTools::IBamIODevice::OpenMode)
bool BamHttp::Open(const IBamIODevice::OpenMode mode) {

    // BamHttp only supports read-only access
    if ( mode != IBamIODevice::ReadOnly ) {
        SetErrorString("BamHttp::Open", "writing on this device is not supported");
        return false;
    }
    m_mode = mode;

    // attempt connection to socket
    if ( !ConnectSocket() ) {
        SetErrorString("BamHttp::Open", m_socket->GetErrorString());
        return false;
    }

    // initialize our file positions
    m_filePosition     = 0;
    m_fileEndPosition  = 0;
    m_rangeEndPosition = 0;

    // attempt to send initial request (just 'HEAD' to check connection)
    if ( !SendHeadRequest() ) {
        SetErrorString("BamHttp::Open", m_socket->GetErrorString());
        return false;
    }

    // clear response from HEAD request, not needed
    ClearResponse();

    // return success
    return true;
}

// Assembly:
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
cmpl $0x1, %esi
jne 0x4ef87
movl $0x1, 0x8(%rbx)
movq %rbx, %rdi
callq 0x34a00
testb %al, %al
je 0x4efde
xorps %xmm0, %xmm0
movups %xmm0, 0xb0(%rbx)
andq $0x0, 0xc0(%rbx)
movq %rbx, %rdi
callq 0x32e30
testb %al, %al
je 0x4f02a
movq %rbx, %rdi
callq 0x321a0
movb $0x1, %al
jmp 0x4f076
leaq 0xdbe8(%rip), %rsi      # 0x5cb76
leaq 0x30(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x31b30
leaq 0xda67(%rip), %rsi      # 0x5ca0b
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x34ab0
leaq 0x10(%rsp), %rdi
callq 0x33a00
leaq 0x30(%rsp), %rdi
callq 0x33a00
jmp 0x4f074
leaq 0xdb91(%rip), %rsi      # 0x5cb76
leaq 0x30(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x31b30
movq 0x30(%rbx), %rsi
leaq 0x10(%rsp), %rdi
callq 0x337f0
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x34ab0
leaq 0x10(%rsp), %rdi
callq 0x33a00
leaq 0x30(%rsp), %rdi
callq 0x33a00
jmp 0x4f074
leaq 0xdb45(%rip), %rsi      # 0x5cb76
leaq 0x30(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x31b30
movq 0x30(%rbx), %rsi
leaq 0x10(%rsp), %rdi
callq 0x337f0
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x34ab0
leaq 0x10(%rsp), %rdi
callq 0x33a00
leaq 0x30(%rsp), %rdi
callq 0x33a00
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4f090
jmp 0x4f0cb
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x33a00
jmp 0x4f0dd
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4f0b0
jmp 0x4f0cb
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x33a00
jmp 0x4f0dd
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4f0d3
movq %rax, %rbx
jmp 0x4f0dd
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x33a00
movq %rbx, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/BamHttp_p.cpp
// Function: BamTools::Internal::BamHttp::Seek(long const&, int)
bool BamHttp::Seek(const int64_t& position, const int origin) {

    // if HTTP device not in a valid state
    if ( !IsOpen() ) {
        SetErrorString("BamHttp::Seek", "cannot seek on unopen connection");
        return false;
    }

    // reset the connection
    DisconnectSocket();
    if ( !ConnectSocket() ) {
        SetErrorString("BamHttp::Seek", m_socket->GetErrorString());
        return false;
    }

    // udpate file position
    switch ( origin ) {
        case SEEK_CUR : m_filePosition += position; break;
        case SEEK_SET : m_filePosition  = position; break;
        default :
            SetErrorString("BamHttp::Seek", "unsupported seek origin");
            return false;
    }

    // return success
    return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x50(%rax)
testb %al, %al
je 0x4fd7a
movq %rbx, %rdi
callq 0x32000
movq %rbx, %rdi
callq 0x34a00
testb %al, %al
je 0x4fdd1
testl %ebp, %ebp
je 0x4fe1d
cmpl $0x1, %ebp
jne 0x4fe2b
movq (%r14), %rax
addq %rax, 0xb0(%rbx)
jmp 0x4fe27
leaq 0xce80(%rip), %rsi      # 0x5cc01
leaq 0x30(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x31b30
leaq 0xce78(%rip), %rsi      # 0x5cc0f
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x34ab0
leaq 0x10(%rsp), %rdi
callq 0x33a00
leaq 0x30(%rsp), %rdi
callq 0x33a00
jmp 0x4fe7d
leaq 0xce29(%rip), %rsi      # 0x5cc01
leaq 0x30(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x31b30
movq 0x30(%rbx), %rsi
leaq 0x10(%rsp), %rdi
callq 0x337f0
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x34ab0
leaq 0x10(%rsp), %rdi
callq 0x33a00
leaq 0x30(%rsp), %rdi
callq 0x33a00
jmp 0x4fe7d
movq (%r14), %rax
movq %rax, 0xb0(%rbx)
movb $0x1, %al
jmp 0x4fe7f
leaq 0xcdcf(%rip), %rsi      # 0x5cc01
leaq 0x30(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x31b30
leaq 0xcde8(%rip), %rsi      # 0x5cc30
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x34ab0
leaq 0x10(%rsp), %rdi
callq 0x33a00
leaq 0x30(%rsp), %rdi
callq 0x33a00
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4fe9c
jmp 0x4fed7
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x33a00
jmp 0x4fee9
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4febc
jmp 0x4fed7
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x33a00
jmp 0x4fee9
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4fedf
movq %rax, %rbx
jmp 0x4fee9
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x33a00
movq %rbx, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/BamHttp_p.cpp
// Function: BamTools::Internal::BamHttp::Write(char const*, unsigned int)
int64_t BamHttp::Write(const char* data, const unsigned int numBytes) {
    (void)data;
    (void)numBytes;
    BT_ASSERT_X(false, "BamHttp::Write : write-mode not supported on this device");
    SetErrorString("BamHttp::Write", "write-mode not supported on this device");
    return -1;
}

// Assembly:
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
leaq 0xcd14(%rip), %rsi      # 0x5cc79
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
leaq 0xcb56(%rip), %rsi      # 0x5cad1
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x31b30
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x34ab0
leaq 0x10(%rsp), %rdi
callq 0x33a00
leaq 0x30(%rsp), %rdi
callq 0x33a00
pushq $-0x1
popq %rax
addq $0x50, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4ffcb
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x33a00
movq %rbx, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/BamPipe_p.cpp
// Function: BamTools::Internal::BamPipe::Open(BamTools::IBamIODevice::OpenMode)
bool BamPipe::Open(const IBamIODevice::OpenMode mode) {

    // make sure we're starting with a fresh pipe
    Close();

    // open stdin/stdout depending on requested openmode
#if defined( SYSTEM_NODEJS ) && SYSTEM_NODEJS == 1
    if ( mode == IBamIODevice::ReadOnly )
        m_stream = stdin;
    else if ( mode == IBamIODevice::WriteOnly )
        m_stream = stdout;
#else
    if ( mode == IBamIODevice::ReadOnly )
        m_stream = freopen(0, "rb", stdin);
    else if ( mode == IBamIODevice::WriteOnly )
        m_stream = freopen(0, "wb", stdout);
#endif // SYSTEM_NODEJS

    else {
        const string errorType = string( (mode == IBamIODevice::ReadWrite) ? "unsupported"
                                                                           : "unknown" );
        const string message = errorType + " open mode requested";
        SetErrorString("BamPipe::Open", message);
        return false;
    }

// Assembly:
pushq %rbp
pushq %rbx
subq $0x68, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x10(%rax)
cmpl $0x1, %ebp
jne 0x50060
leaq 0xc897(%rip), %rsi      # 0x5c8ee
movq 0x24f0a(%rip), %rax     # 0x74f68
jmp 0x50077
cmpl $0x2, %ebp
jne 0x5010c
leaq 0xc881(%rip), %rsi      # 0x5c8f1
movq 0x24e71(%rip), %rax     # 0x74ee8
movq (%rax), %rdx
xorl %edi, %edi
callq 0x32f80
movq %rax, 0x30(%rbx)
testq %rax, %rax
je 0x50094
movl %ebp, 0x8(%rbx)
movb $0x1, %al
jmp 0x5018e
leaq 0xcc24(%rip), %rsi      # 0x5ccbf
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x31b30
cmpl $0x1, %ebp
leaq 0xc81e(%rip), %rax      # 0x5c8d2
leaq 0xc81d(%rip), %rdx      # 0x5c8d8
cmoveq %rax, %rdx
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x33c40
leaq 0xcbdc(%rip), %rsi      # 0x5ccb1
leaq 0x28(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x31b30
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x34ab0
leaq 0x28(%rsp), %rdi
callq 0x33a00
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x50182
cmpl $0x3, %ebp
leaq 0xcb8f(%rip), %rax      # 0x5cca5
leaq 0xb0b0(%rip), %rsi      # 0x5b1cd
cmoveq %rax, %rsi
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x31b30
leaq 0xc7d6(%rip), %rdx      # 0x5c90d
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x33c40
leaq 0xcb64(%rip), %rsi      # 0x5ccb1
leaq 0x28(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x31b30
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x34ab0
leaq 0x28(%rsp), %rdi
callq 0x33a00
leaq 0x8(%rsp), %rdi
callq 0x33a00
leaq 0x48(%rsp), %rdi
callq 0x33a00
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x33a00
jmp 0x501c2
jmp 0x501b5
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x33a00
jmp 0x501e0
movq %rax, %rbx
jmp 0x501f4
movq %rax, %rbx
jmp 0x501cc
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
leaq 0x48(%rsp), %rdi
callq 0x33a00
jmp 0x501f4
movq %rax, %rbx
jmp 0x501ea
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
leaq 0x48(%rsp), %rdi
callq 0x33a00
movq %rbx, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/BgzfStream_p.cpp
// Function: BamTools::Internal::BgzfStream::Close()
void BgzfStream::Close(void) {

    // skip if no device open
    if ( m_device == 0 ) return;

    // if writing to file, flush the current BGZF block,
    // then write an empty block (as EOF marker)
    if ( m_device->IsOpen() && (m_device->Mode() == IBamIODevice::WriteOnly) ) {
        FlushBlock();
        const size_t blockLength = DeflateBlock(0);
        m_device->Write(m_compressedBlock.Buffer, blockLength);
    }

    // close device
    m_device->Close();
    delete m_device;
    m_device = 0;

    // ensure our buffers are cleared out
    m_uncompressedBlock.Clear();
    m_compressedBlock.Clear();

    // reset state
    m_blockLength = 0;
    m_blockOffset = 0;
    m_blockAddress = 0;
    m_isWriteCompressed = true;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x503c2
movq (%rdi), %rax
callq *0x50(%rax)
testb %al, %al
je 0x5037c
movq 0x18(%rbx), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
cmpl $0x2, %eax
jne 0x5037c
movq %rbx, %rdi
callq 0x338b0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x31890
movq 0x18(%rbx), %rdi
movq 0x30(%rbx), %rsi
movq (%rdi), %rcx
movl %eax, %edx
callq *0x40(%rcx)
movq 0x18(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x50395
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, 0x18(%rbx)
movq 0x20(%rbx), %rdi
movq 0x28(%rbx), %rdx
xorl %esi, %esi
callq 0x320d0
movq 0x30(%rbx), %rdi
movq 0x38(%rbx), %rdx
xorl %esi, %esi
callq 0x320d0
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movb $0x1, 0x10(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/BgzfStream_p.cpp
// Function: BamTools::Internal::BgzfStream::CheckBlockHeader(char*)
bool BgzfStream::CheckBlockHeader(char* header) {
    return (header[0] == Constants::GZIP_ID1 &&
            header[1] == Constants::GZIP_ID2 &&
            header[2] == Z_DEFLATED &&
            (header[3] & Constants::FLG_FEXTRA) != 0 &&
            BamTools::UnpackUnsignedShort(&header[10]) == Constants::BGZF_XLEN &&
            header[12] == Constants::BGZF_ID1 &&
            header[13] == Constants::BGZF_ID2 &&
            BamTools::UnpackUnsignedShort(&header[14]) == Constants::BGZF_LEN );
}

// Assembly:
cmpb $0x1f, (%rdi)
jne 0x503f7
cmpb $-0x75, 0x1(%rdi)
jne 0x503f7
cmpb $0x8, 0x2(%rdi)
jne 0x503f7
testb $0x4, 0x3(%rdi)
je 0x503f7
cmpw $0x6, 0xa(%rdi)
jne 0x503f7
cmpb $0x42, 0xc(%rdi)
jne 0x503f7
cmpb $0x43, 0xd(%rdi)
jne 0x503f7
cmpw $0x2, 0xe(%rdi)
sete %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/BgzfStream_p.cpp
// Function: BamTools::Internal::BgzfStream::Open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, BamTools::IBamIODevice::OpenMode)
void BgzfStream::Open(const string& filename, const IBamIODevice::OpenMode mode) {

    // close current device if necessary
    Close();
    BT_ASSERT_X( (m_device == 0), "BgzfStream::Open() - unable to properly close previous IO device" );

    // retrieve new IO device depending on filename
    m_device = BamDeviceFactory::CreateDevice(filename);
    BT_ASSERT_X( m_device, "BgzfStream::Open() - unable to create IO device from filename" );

    // if device fails to open
    if ( !m_device->Open(mode) ) {
        const string deviceError = m_device->GetErrorString();
        const string message = string("could not open BGZF stream: \n\t") + deviceError;
        throw BamException("BgzfStream::Open", message);
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x70, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x329a0
movq %r14, %rdi
callq 0x32bd0
movq %rax, 0x18(%rbx)
movq (%rax), %rcx
movq %rax, %rdi
movl %ebp, %esi
callq *0x20(%rcx)
testb %al, %al
je 0x50e59
addq $0x70, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x18(%rbx), %rsi
movq (%rsi), %rax
leaq 0x50(%rsp), %rdi
callq *0x48(%rax)
leaq 0xc023(%rip), %rsi      # 0x5ce92
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x355e0
leaq 0x10(%rsp), %rdi
callq 0x33a00
pushq $0x28
popq %rdi
callq 0x31e70
movq %rax, %rbx
leaq 0xc003(%rip), %rsi      # 0x5ceb1
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x344c0
xorl %ebp, %ebp
movq 0x2405d(%rip), %rsi     # 0x74f38
movq 0x24096(%rip), %rdx     # 0x74f78
movq %rbx, %rdi
callq 0x34c90
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x33a00
testb %bpl, %bpl
jne 0x50f01
jmp 0x50f09
movq %rax, %r14
movq %rbx, %rdi
callq 0x327c0
leaq 0x30(%rsp), %rdi
callq 0x33a00
jmp 0x50f27
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x50f27
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x33a00
movq %r14, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/BgzfStream_p.cpp
// Function: BamTools::Internal::BgzfStream::Read(char*, unsigned long)
size_t BgzfStream::Read(char* data, const size_t dataLength) {

    if ( dataLength == 0 )
        return 0;

    // if stream not open for reading
    BT_ASSERT_X( m_device, "BgzfStream::Read() - trying to read from null device");
    if ( !m_device->IsOpen() || (m_device->Mode() != IBamIODevice::ReadOnly) )
        return 0;

    // read blocks as needed until desired data length is retrieved
    char* output = data;
    size_t numBytesRead = 0;
    while ( numBytesRead < dataLength ) {

        // determine bytes available in current block
        int bytesAvailable = m_blockLength - m_blockOffset;

        // read (and decompress) next block if needed
        if ( bytesAvailable <= 0 ) {
            ReadBlock();
            bytesAvailable = m_blockLength - m_blockOffset;
            if ( bytesAvailable <= 0 )
                break;
        }

        // copy data from uncompressed source buffer into data destination buffer
        const size_t copyLength = min( (dataLength-numBytesRead), (size_t)bytesAvailable );
        memcpy(output, m_uncompressedBlock.Buffer + m_blockOffset, copyLength);

        // update counters
        m_blockOffset += copyLength;
        output        += copyLength;
        numBytesRead  += copyLength;
    }

    // update block data
    if ( m_blockOffset == m_blockLength ) {
        m_blockAddress = m_device->Tell();
        m_blockOffset  = 0;
        m_blockLength  = 0;
    }

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0x50fcc
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
testb %al, %al
je 0x50fcc
movq 0x18(%rbx), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
cmpl $0x1, %eax
jne 0x50fcc
movl 0x4(%rbx), %eax
xorl %r14d, %r14d
movq %r15, %rbp
movl (%rbx), %ecx
subq %r14, %rbp
jbe 0x50fe1
subl %eax, %ecx
jg 0x50f9f
movq %rbx, %rdi
callq 0x31c30
movl (%rbx), %edx
movl 0x4(%rbx), %eax
movl %edx, %ecx
subl %eax, %ecx
jle 0x50fe3
movl %ecx, %r13d
cmpq %r13, %rbp
cmovbq %rbp, %r13
movslq %eax, %rsi
addq 0x20(%rbx), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x32b40
movl 0x4(%rbx), %eax
addl %r13d, %eax
movl %eax, 0x4(%rbx)
addq %r13, %r12
addq %r13, %r14
jmp 0x50f7e
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ecx, %edx
cmpl %edx, %eax
jne 0x50fcf
movq 0x18(%rbx), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movq %rax, 0x8(%rbx)
andq $0x0, (%rbx)
jmp 0x50fcf
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/BgzfStream_p.cpp
// Function: BamTools::Internal::BgzfStream::Seek(long const&)
void BgzfStream::Seek(const int64_t& position) {

    BT_ASSERT_X( m_device, "BgzfStream::Seek() - trying to seek on null IO device");

    // skip if device is not open
    if ( !IsOpen() ) return;

    // determine adjusted offset & address
    int     blockOffset  = (position & 0xFFFF);
    int64_t blockAddress = (position >> 16) & 0xFFFFFFFFFFFFLL;

    // attempt seek in file
    if ( m_device->IsRandomAccess() && m_device->Seek(blockAddress) ) {

        // update block data & return success
        m_blockLength  = 0;
        m_blockAddress = blockAddress;
        m_blockOffset  = blockOffset;
    }
    else {
        stringstream s("");
        s << "unable to seek to position: " << position;
        throw BamException("BgzfStream::Seek", s.str());
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdi, %r14
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x514e3
movq %rsi, %rbx
movq (%rdi), %rax
callq *0x50(%rax)
testb %al, %al
je 0x514e3
movq (%rbx), %r15
movq %r15, %rax
shrq $0x10, %rax
movq %rax, 0x8(%rsp)
movq 0x18(%r14), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
je 0x514f1
movq 0x18(%r14), %rdi
movq (%rdi), %rax
leaq 0x8(%rsp), %rsi
xorl %edx, %edx
callq *0x30(%rax)
testb %al, %al
je 0x514f1
andl $0x0, (%r14)
movzwl %r15w, %eax
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%r14)
movl %eax, 0x4(%r14)
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa96c(%rip), %rsi      # 0x5be64
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x31b30
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
pushq $0x18
popq %rdx
callq 0x34880
leaq 0x10(%rsp), %rdi
callq 0x33a00
leaq 0x60(%rsp), %rdi
leaq 0xba00(%rip), %rsi      # 0x5cf2f
callq 0x330f0
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x32fb0
pushq $0x28
popq %rdi
callq 0x31e70
movq %rax, %rbx
leaq 0xb9fb(%rip), %rsi      # 0x5cf4c
leaq 0x10(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x31b30
leaq 0x68(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x34870
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x344c0
xorl %ebp, %ebp
movq 0x239ab(%rip), %rsi     # 0x74f38
movq 0x239e4(%rip), %rdx     # 0x74f78
movq %rbx, %rdi
callq 0x34c90
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x33a00
jmp 0x515b1
movq %rax, %r14
movb $0x1, %bpl
leaq 0x10(%rsp), %rdi
callq 0x33a00
testb %bpl, %bpl
jne 0x515c5
jmp 0x515d2
movq %rax, %r14
movq %rbx, %rdi
callq 0x327c0
jmp 0x515d2
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x32870
jmp 0x515f8
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x515f8
movq %rax, %rdi
callq 0x39b2f
movq %rax, %r14
movq %r14, %rdi
callq 0x34ed0
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/BgzfStream_p.cpp
// Function: BamTools::Internal::BgzfStream::Write(char const*, unsigned long)
size_t BgzfStream::Write(const char* data, const size_t dataLength) {

    BT_ASSERT_X( m_device, "BgzfStream::Write() - trying to write to null IO device");
    BT_ASSERT_X( (m_device->Mode() == IBamIODevice::WriteOnly),
                 "BgzfStream::Write() - trying to write to non-writable IO device");

    // skip if file not open for writing
    if ( !IsOpen() )
        return 0;

    // write blocks as needed til all data is written
    size_t numBytesWritten = 0;
    const char* input = data;
    const size_t blockLength = Constants::BGZF_DEFAULT_BLOCK_SIZE;
    while ( numBytesWritten < dataLength ) {

        // copy data contents to uncompressed output buffer
        unsigned int copyLength = min(blockLength - m_blockOffset, dataLength - numBytesWritten);
        char* buffer = m_uncompressedBlock.Buffer;
        memcpy(buffer + m_blockOffset, input, copyLength);

        // update counter
        m_blockOffset   += copyLength;
        input           += copyLength;
        numBytesWritten += copyLength;

        // flush (& compress) output buffer when full
        if ( m_blockOffset == static_cast<int32_t>(blockLength) )
            FlushBlock();
    }

    // return actual number of bytes written
    return numBytesWritten;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x516a9
movq %rdx, %rbx
movq %rsi, %r14
movq (%rdi), %rax
callq *0x50(%rax)
testb %al, %al
je 0x516a9
xorl %r12d, %r12d
movq %rbx, %rax
subq %r12, %rax
jbe 0x516ac
movslq 0x4(%r15), %rdi
movl $0x10000, %ebp          # imm = 0x10000
subq %rdi, %rbp
cmpq %rbp, %rax
cmovbq %rax, %rbp
addq 0x20(%r15), %rdi
movl %ebp, %r13d
movq %r14, %rsi
movq %r13, %rdx
callq 0x32b40
addl 0x4(%r15), %ebp
movl %ebp, 0x4(%r15)
addq %r13, %r14
addq %r13, %r12
cmpl $0x10000, %ebp          # imm = 0x10000
jne 0x5165c
movq %r15, %rdi
callq 0x338b0
jmp 0x5165c
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_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/ByteArray_p.cpp
// Function: BamTools::Internal::ByteArray::IndexOf(char, unsigned long, unsigned long) const
size_t ByteArray::IndexOf(const char c, const size_t from, const size_t to) const {
    const size_t size = ( (to == 0 ) ? m_data.size() : to );
    for ( size_t i = from; i < size; ++i ) {
        if ( m_data.at(i) == c ) 
            return i;
    }
    return m_data.size();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %r15
subq (%rdi), %r15
movl %esi, %ebp
testq %rcx, %rcx
cmovneq %rcx, %r15
cmpq %r15, %rbx
jae 0x51811
movq %r14, %rdi
movq %rbx, %rsi
callq 0x34950
cmpb %bpl, (%rax)
je 0x51818
incq %rbx
jmp 0x517f7
movq 0x8(%r14), %rbx
subq (%r14), %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/ByteArray_p.cpp
// Function: BamTools::Internal::ByteArray::Remove(unsigned long, unsigned long)
ByteArray& ByteArray::Remove(size_t from, size_t n) {

    // if 'from' outside range, just return
    const size_t originalSize = m_data.size();
    if ( from >= originalSize )
        return *this;

    // if asked to clip from 'from' to end (or beyond), simply resize
    if ( from + n >= originalSize )
        Resize(from);

    // otherwise, shift data & resize
    else {
        memmove( &m_data[from], &m_data[from+n], (originalSize-from-n) );
        Resize(originalSize - n);
    }

    // return reference to modified byte array
    return *this;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rcx
movq 0x8(%rdi), %r15
subq %rcx, %r15
cmpq %rsi, %r15
jbe 0x5186b
movq %rdx, %r14
leaq (%rdx,%rsi), %rax
movq %r15, %rdx
subq %rax, %rdx
jbe 0x51863
addq %rcx, %rsi
addq %rcx, %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0x34940
subq %r14, %r15
movq %r15, %rsi
movq %rbx, %rdi
callq 0x323d0
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/HostAddress_p.cpp
// Function: BamTools::Internal::HostAddress::SetAddress(unsigned char const*)
void HostAddress::SetAddress(const uint8_t* ip6Address) {
    for ( uint8_t i = 0; i < 16; ++i )
        m_ip6Address[i] = ip6Address[i];
    m_protocol = HostAddress::IPv6Protocol;
    m_hasIpAddress = true;
}

// Assembly:
pushq $0x8
popq %rax
cmpq $0x18, %rax
je 0x51ed1
movb -0x8(%rsi,%rax), %cl
movb %cl, (%rdi,%rax)
incq %rax
jmp 0x51ebf
movl $0x1, (%rdi)
movb $0x1, 0x38(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/HostAddress_p.cpp
// Function: BamTools::Internal::HostAddress::operator==(BamTools::Internal::HostAddress const&) const
bool HostAddress::operator==(const HostAddress& other) const {

    // if self is IPv4
    if ( m_protocol == HostAddress::IPv4Protocol ) {
        return ( other.m_protocol == HostAddress::IPv4Protocol &&
                 m_ip4Address == other.m_ip4Address
               );
    }

    // if self is IPv6
    else if ( m_protocol == HostAddress::IPv6Protocol ) {
        return ( other.m_protocol == HostAddress::IPv6Protocol &&
                 memcmp(&m_ip6Address, &other.m_ip6Address, sizeof(IPv6Address)) == 0
               );
    }

    // otherwise compare protocols
    else return m_protocol == other.m_protocol;
}

// Assembly:
movl (%rdi), %ecx
movl (%rsi), %eax
cmpl $0x1, %ecx
je 0x51fe5
testl %ecx, %ecx
jne 0x52003
movl 0x4(%rsi), %ecx
xorl 0x4(%rdi), %ecx
orl %ecx, %eax
jmp 0x52005
cmpl $0x1, %eax
jne 0x52009
movdqu 0x8(%rsi), %xmm0
movdqu 0x8(%rdi), %xmm1
pcmpeqb %xmm0, %xmm1
pmovmskb %xmm1, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jmp 0x52005
cmpl %eax, %ecx
sete %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/HostAddress_p.cpp
// Function: BamTools::Internal::HostAddress::operator<(BamTools::Internal::HostAddress const&) const
bool HostAddress::operator<(const HostAddress& other) const {

    // if self is IPv4
    if ( m_protocol == HostAddress::IPv4Protocol ) {
        if ( other.m_protocol == HostAddress::IPv4Protocol )
            return m_ip4Address < other.m_ip4Address;
    }

    // if self is IPv6
    else if ( m_protocol == HostAddress::IPv6Protocol ) {
        if ( other.m_protocol == HostAddress::IPv6Protocol )
            return (memcmp(&m_ip6Address, &other.m_ip6Address, sizeof(IPv6Address)) < 0);
    }

    // otherwise compare protocol types
    return m_protocol < other.m_protocol;
}

// Assembly:
movl (%rdi), %eax
movl (%rsi), %ecx
cmpl $0x1, %eax
je 0x52027
testl %eax, %eax
jne 0x52045
testl %ecx, %ecx
jne 0x52045
movl 0x4(%rdi), %eax
cmpl 0x4(%rsi), %eax
setb %al
retq
cmpl $0x1, %ecx
jne 0x52045
pushq %rax
addq $0x8, %rdi
addq $0x8, %rsi
pushq $0x10
popq %rdx
callq 0x31d20
shrl $0x1f, %eax
addq $0x8, %rsp
retq
cmpl %ecx, %eax
setl %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/HostAddress_p.cpp
// Function: BamTools::Internal::HostAddress::GetIPString[abi:cxx11]() const
std::string HostAddress::GetIPString(void) const {

    stringstream ss("");

    // IPv4 format
    if ( m_protocol == HostAddress::IPv4Protocol ) {
        ss << ( (m_ip4Address>>24) & 0xff ) << '.'
           << ( (m_ip4Address>>16) & 0xff ) << '.'
           << ( (m_ip4Address>> 8) & 0xff ) << '.'
           << (  m_ip4Address      & 0xff );

    }

    // IPv6 format
    else if ( m_protocol == HostAddress::IPv6Protocol ) {
        for ( uint8_t i = 0; i < 8; ++i ) {
            if ( i != 0 )
                ss << ':';
                ss << hex << ( (uint16_t(m_ip6Address[2*i]) << 8) |
                               (uint16_t(m_ip6Address[2*i+1]))
                             );
        }
    }

    // return result (empty string if unknown protocol)
    return ss.str();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x9dc2(%rip), %rsi      # 0x5be64
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x31b30
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $0x18
popq %rdx
callq 0x34880
leaq 0x8(%rsp), %rdi
callq 0x33a00
movl (%r14), %eax
testl %eax, %eax
je 0x52132
cmpl $0x1, %eax
jne 0x52189
leaq 0x38(%rsp), %r15
xorl %r12d, %r12d
pushq $0x3a
popq %rbp
testq %r12, %r12
je 0x52101
cmpq $0x8, %r12
je 0x52189
movq %r15, %rdi
movl %ebp, %esi
callq 0x337b0
movq 0x38(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x50(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x50(%rsp,%rax)
movzwl 0x8(%r14,%r12,2), %eax
rolw $0x8, %ax
movzwl %ax, %esi
movq %r15, %rdi
callq 0x34d10
incq %r12
jmp 0x520e8
leaq 0x38(%rsp), %rdi
movzbl 0x7(%r14), %esi
callq 0x326a0
pushq $0x2e
popq %rsi
movq %rax, %rdi
callq 0x337b0
movzbl 0x6(%r14), %esi
movq %rax, %rdi
callq 0x326a0
pushq $0x2e
popq %rsi
movq %rax, %rdi
callq 0x337b0
movzbl 0x5(%r14), %esi
movq %rax, %rdi
callq 0x326a0
pushq $0x2e
popq %rsi
movq %rax, %rdi
callq 0x337b0
movzbl 0x4(%r14), %esi
movq %rax, %rdi
callq 0x326a0
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x34870
leaq 0x28(%rsp), %rdi
callq 0x32870
movq %rbx, %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x521d6
movq %rax, %rbx
jmp 0x521d6
jmp 0x521c9
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x32870
movq %rbx, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/HostAddress_p.cpp
// Function: BamTools::Internal::ParseIp4(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int&)
static
bool ParseIp4(const string& address, uint32_t& maybeIp4 ) {

    // split IP address into string fields
    vector<string> addressFields = Split(address, '.');
    if ( addressFields.size() != 4 )
        return false;

    // convert each field to integer value
    uint32_t ipv4(0);
    for ( uint8_t i = 0; i < 4; ++i ) {

        const string& field = addressFields.at(i);
        const size_t fieldSize = field.size();
        for ( size_t j = 0; j < fieldSize; ++j ) {
            if ( !isdigit(field[j]) )
                return false;
        }

        int value = atoi( addressFields.at(i).c_str() );
        if ( value < 0 || value > 255 )
            return false;

        // append byte value
        ipv4 <<= 8;
        ipv4 += value;
    }

    // store 32-bit IP address & return success
    maybeIp4 = ipv4;
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rsi
movq %rsp, %rbx
pushq $0x2e
popq %rdx
movq %rbx, %rdi
callq 0x5261f
movq 0x8(%rbx), %rax
subq (%rbx), %rax
xorl %ebx, %ebx
cmpq $0x80, %rax
jne 0x525e5
movq %rsp, %r15
xorl %r12d, %r12d
cmpq $0x4, %r12
je 0x525fb
movq %r15, %rdi
movq %r12, %rsi
callq 0x31850
movq (%rax), %rcx
movq 0x8(%rax), %rax
xorl %edx, %edx
cmpq %rdx, %rax
je 0x525bf
movsbl (%rcx,%rdx), %esi
addl $-0x30, %esi
incq %rdx
cmpl $0xa, %esi
jb 0x525a9
jmp 0x525e3
movq %r15, %rdi
movq %r12, %rsi
callq 0x31850
movq (%rax), %rdi
callq 0x34710
cmpl $0xff, %eax
ja 0x525e3
shll $0x8, %ebx
orl %eax, %ebx
incq %r12
jmp 0x5258f
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0x32810
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl %ebx, (%r14)
movb $0x1, %bl
jmp 0x525e5
jmp 0x52604
movq %rax, %rbx
movq %rsp, %rdi
callq 0x32810
movq %rbx, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/HostAddress_p.cpp
// Function: BamTools::Internal::Split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char)
static inline
vector<string> Split(const string& source, char delim) {
    stringstream ss(source);
    string field;
    vector<string> fields;
    while ( getline(ss, field, delim) )
        fields.push_back(field);
    return fields;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movl %edx, %ebp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
pushq $0x18
popq %rdx
movq %r14, %rdi
callq 0x34880
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
andq $0x0, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movsbl %bpl, %ebp
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x35260
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x5268c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x31f80
jmp 0x52664
movq %rsp, %rdi
callq 0x33a00
leaq 0x20(%rsp), %rdi
callq 0x32870
movq %rbx, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x526c7
movq %rax, %r14
movq %rbx, %rdi
callq 0x32810
movq %rsp, %rdi
callq 0x33a00
leaq 0x20(%rsp), %rdi
callq 0x32870
movq %r14, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/HttpHeader_p.cpp
// Function: BamTools::Internal::Trim(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
static string Trim(const string& source) {

    // skip if empty string
    if ( source.empty() )
        return source;

    // fetch string data
    const char*  s    = source.data(); // ignoring null-term on purpose
    const size_t size = source.size();
    size_t start = 0;
    size_t end   = size-1;

    // skip if no spaces at start or end
    if ( !IsSpace(s[start]) && !IsSpace( s[end] ) )
        return source;

    // remove leading whitespace
    while ( (start != end) && IsSpace(s[start]) )
        ++start;

    // remove trailing whitespace
    if ( start <= end ) {
        while ( end && IsSpace(s[end]) )
            --end;
    }

    // return result
    return string(s + start, (end-start) + 1);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x53823
movq (%rsi), %rcx
decq %rax
movzbl (%rcx), %edx
cmpw $0xe, %dx
jae 0x537f0
movl $0x3e01, %edi           # imm = 0x3E01
btl %edx, %edi
jb 0x53804
movzbl (%rcx,%rax), %edx
cmpw $0xe, %dx
jae 0x53823
movl $0x3e01, %edi           # imm = 0x3E01
btl %edx, %edi
jae 0x53823
xorl %esi, %esi
movl $0x3e01, %edx           # imm = 0x3E01
cmpq %rsi, %rax
je 0x5382d
movzbl (%rcx,%rsi), %edi
cmpl $0xd, %edi
ja 0x53830
btl %edi, %edx
jae 0x53830
incq %rsi
jmp 0x5380b
movq %rbx, %rdi
callq 0x33ff0
jmp 0x53868
movq %rax, %rsi
testq %rax, %rax
je 0x5384d
movl $0x3e01, %edx           # imm = 0x3E01
movzbl (%rcx,%rax), %edi
cmpl $0xd, %edi
ja 0x5384f
btl %edi, %edx
jae 0x5384f
decq %rax
jne 0x5383a
xorl %eax, %eax
addq %rcx, %rsi
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
leaq (%rcx,%rax), %rdx
incq %rdx
movq %rbx, %rdi
callq 0x31b10
movq %rbx, %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/HttpHeader_p.cpp
// Function: BamTools::Internal::HttpHeader::ParseLine(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
bool HttpHeader::ParseLine(const string& line, int) {

    // find colon position, return failure if not found
    const size_t colonFound = line.find(Constants::COLON_CHAR);
    if ( colonFound == string::npos )
        return false;

    // store key/value (without leading/trailing whitespace) & return success
    const string key   = Trim(line.substr(0, colonFound));
    const string value = Trim(line.substr(colonFound+1));
    m_fields[key] = value;
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r15
movq %rdi, %r14
pushq $0x3a
popq %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x33d30
movq %rax, %rbx
cmpq $-0x1, %rax
je 0x53924
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x332a0
leaq 0x48(%rsp), %rdi
movq %r12, %rsi
callq 0x537ca
leaq 0x8(%rsp), %rdi
callq 0x33a00
leaq 0x1(%rbx), %rdx
leaq 0x28(%rsp), %rdi
pushq $-0x1
popq %rcx
movq %r15, %rsi
callq 0x332a0
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x537ca
leaq 0x28(%rsp), %rdi
callq 0x33a00
addq $0x8, %r14
leaq 0x48(%rsp), %rsi
movq %r14, %rdi
callq 0x31180
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x32060
leaq 0x8(%rsp), %rdi
callq 0x33a00
leaq 0x48(%rsp), %rdi
callq 0x33a00
cmpq $-0x1, %rbx
setne %al
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x53966
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x33a00
jmp 0x53969
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x53973
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x53969
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x33a00
movq %rbx, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/HttpHeader_p.cpp
// Function: BamTools::Internal::HttpHeader::ToString[abi:cxx11]() const
string HttpHeader::ToString(void) const {
    string result("");
    if ( m_isValid ) {
        map<string, string>::const_iterator fieldIter = m_fields.begin();
        map<string, string>::const_iterator fieldEnd  = m_fields.end();
        for ( ; fieldIter != fieldEnd; ++fieldIter ) {
            const string& key   = (*fieldIter).first;
            const string& value = (*fieldIter).second;
            const string& line  = key   + Constants::FIELD_SEPARATOR +
                                  value + Constants::FIELD_NEWLINE;
            result += line;
        }
    }
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8493(%rip), %rsi      # 0x5be64
leaq 0x8(%rsp), %rdx
callq 0x31b30
cmpb $0x1, 0x38(%r14)
jne 0x53a68
movq 0x20(%r14), %r12
addq $0x10, %r14
leaq 0x28(%rsp), %r13
leaq 0x48(%rsp), %rbp
leaq 0x8(%rsp), %r15
cmpq %r14, %r12
je 0x53a68
leaq 0x20(%r12), %rsi
movq %r13, %rdi
leaq 0x249d7(%rip), %rdx     # 0x783e8
callq 0x355e0
leaq 0x40(%r12), %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x355e0
movq %r15, %rdi
movq %rbp, %rsi
leaq 0x24995(%rip), %rdx     # 0x783c8
callq 0x355e0
movq %rbp, %rdi
callq 0x33a00
movq %r13, %rdi
callq 0x33a00
movq %rbx, %rdi
movq %r15, %rsi
callq 0x35680
movq %r15, %rdi
callq 0x33a00
movq %r12, %rdi
callq 0x33750
movq %rax, %r12
jmp 0x539fd
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x53aac
jmp 0x53aa9
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x33a00
jmp 0x53a9d
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x33a00
jmp 0x53aac
movq %rax, %r14
movq %rbx, %rdi
callq 0x33a00
movq %r14, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/HttpHeader_p.cpp
// Function: BamTools::Internal::HttpRequestHeader::ToString[abi:cxx11]() const
string HttpRequestHeader::ToString(void) const {
    stringstream request("");
    request << m_method   << Constants::SPACE_CHAR
            << m_resource << Constants::SPACE_CHAR
            << Constants::HTTP_STRING << GetMajorVersion() << Constants::DOT_CHAR << GetMinorVersion()
            << Constants::FIELD_NEWLINE
            << HttpHeader::ToString()
            << Constants::FIELD_NEWLINE;
    return request.str();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8077(%rip), %rsi      # 0x5be64
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x31b30
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $0x18
popq %rdx
callq 0x34880
leaq 0x8(%rsp), %rdi
callq 0x33a00
leaq 0x38(%rsp), %rdi
leaq 0x48(%r14), %rsi
callq 0x32d80
pushq $0x20
popq %rsi
movq %rax, %rdi
callq 0x337b0
leaq 0x68(%r14), %rsi
movq %rax, %rdi
callq 0x32d80
pushq $0x20
popq %rsi
movq %rax, %rdi
callq 0x337b0
leaq 0x245b9(%rip), %rsi     # 0x78408
movq %rax, %rdi
callq 0x32d80
movl 0x3c(%r14), %esi
movq %rax, %rdi
callq 0x34d10
pushq $0x2e
popq %rsi
movq %rax, %rdi
callq 0x337b0
movl 0x40(%r14), %esi
movq %rax, %rdi
callq 0x34d10
leaq 0x24547(%rip), %rsi     # 0x783c8
movq %rax, %rdi
callq 0x32d80
movq %rax, %r15
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x34c80
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x32d80
leaq 0x2451b(%rip), %rsi     # 0x783c8
movq %rax, %rdi
callq 0x32d80
leaq 0x8(%rsp), %rdi
callq 0x33a00
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x34870
leaq 0x28(%rsp), %rdi
callq 0x32870
movq %rbx, %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x53f18
jmp 0x53f0b
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x53f0e
movq %rax, %rbx
jmp 0x53f18
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x32870
movq %rbx, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/HttpHeader_p.cpp
// Function: BamTools::Internal::HttpResponseHeader::ToString[abi:cxx11]() const
string HttpResponseHeader::ToString(void) const {
    stringstream response("");
    response << Constants::HTTP_STRING << GetMajorVersion() << Constants::DOT_CHAR << GetMinorVersion()
             << Constants::SPACE_CHAR  << m_statusCode
             << Constants::SPACE_CHAR  << m_reason
             << Constants::FIELD_NEWLINE
             << HttpHeader::ToString()
             << Constants::FIELD_NEWLINE;
    return response.str();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x7bbf(%rip), %rsi      # 0x5be64
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x31b30
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $0x18
popq %rdx
callq 0x34880
leaq 0x8(%rsp), %rdi
callq 0x33a00
leaq 0x38(%rsp), %rdi
leaq 0x2412c(%rip), %rsi     # 0x78408
callq 0x32d80
movl 0x3c(%r14), %esi
movq %rax, %rdi
callq 0x34d10
pushq $0x2e
popq %rsi
movq %rax, %rdi
callq 0x337b0
movl 0x40(%r14), %esi
movq %rax, %rdi
callq 0x34d10
pushq $0x20
popq %rsi
movq %rax, %rdi
callq 0x337b0
movl 0x44(%r14), %esi
movq %rax, %rdi
callq 0x34d10
pushq $0x20
popq %rsi
movq %rax, %rdi
callq 0x337b0
leaq 0x48(%r14), %rsi
movq %rax, %rdi
callq 0x32d80
leaq 0x2408f(%rip), %rsi     # 0x783c8
movq %rax, %rdi
callq 0x32d80
movq %rax, %r15
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x34c80
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x32d80
leaq 0x24063(%rip), %rsi     # 0x783c8
movq %rax, %rdi
callq 0x32d80
leaq 0x8(%rsp), %rdi
callq 0x33a00
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x34870
leaq 0x28(%rsp), %rdi
callq 0x32870
movq %rbx, %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x543d0
jmp 0x543c3
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x543c6
movq %rax, %rbx
jmp 0x543d0
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x32870
movq %rbx, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/ILocalIODevice_p.cpp
// Function: BamTools::Internal::ILocalIODevice::Close()
void ILocalIODevice::Close(void) {

    // skip if not open
    if ( !IsOpen() )
        return;

    // flush & close FILE*
    fflush(m_stream);
    fclose(m_stream);
    m_stream = 0;

    // reset other device state
    m_mode = IBamIODevice::NotOpen;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x50(%rax)
testb %al, %al
je 0x54bad
movq 0x30(%rbx), %rdi
callq 0x33830
movq 0x30(%rbx), %rdi
callq 0x33120
andq $0x0, 0x30(%rbx)
andl $0x0, 0x8(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/RollingBuffer_p.cpp
// Function: BamTools::Internal::RollingBuffer::RollingBuffer(unsigned long)
RollingBuffer::RollingBuffer(size_t growth)
    : m_bufferGrowth(growth)
{
    // buffer always contains at least 1 (maybe empty) byte array
    m_data.push_back( ByteArray() );

    // set cleared state
    Clear();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq %rsi, 0x20(%rdi)
leaq 0x28(%rdi), %rbx
movq %rbx, %rdi
callq 0x32370
movq %rsp, %rdi
callq 0x33ba0
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x32f10
movq %rsp, %rdi
callq 0x32e40
movq %r14, %rdi
callq 0x338f0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
jmp 0x54c38
movq %rax, %r14
movq %rsp, %rdi
callq 0x32e40
jmp 0x54c3b
movq %rax, %r14
movq %rbx, %rdi
callq 0x33c90
movq %r14, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
leaq 0x28(%rdi), %r15
leaq 0x38(%rdi), %r14
movups 0x38(%rdi), %xmm0
leaq 0x20(%rsp), %rsi
movaps %xmm0, (%rsi)
movups 0x48(%rdi), %xmm0
movaps %xmm0, 0x10(%rsi)
leaq 0x68(%rsp), %r12
pushq $0x1
popq %rdx
movq %r12, %rdi
callq 0x327e0
movups 0x58(%rbx), %xmm0
movq %rsp, %rcx
movaps %xmm0, (%rcx)
movups 0x68(%rbx), %xmm0
movaps %xmm0, 0x10(%rcx)
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x34fd0
movq %r14, %rdi
xorl %esi, %esi
callq 0x32b20
movq %rax, %rdi
xorl %esi, %esi
callq 0x323d0
movq %r14, %rdi
xorl %esi, %esi
callq 0x32b20
movq %rax, %rdi
callq 0x34cc0
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x54d12
movq 0x38(%rbx), %rdi
callq 0x32b70
jmp 0x54d16
movq 0x8(%rbx), %rax
subq (%rbx), %rax
popq %rbx
retq
nop