LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::ReadReferenceEntry(BamTools::Internal::BtiReferenceEntry&)
void BamToolsIndex::ReadReferenceEntry(BtiReferenceEntry& refEntry) {

    // return false if refId not valid index in file summary structure
    if ( refEntry.ID < 0 || refEntry.ID >= (int)m_indexFileSummary.size() )
        throw BamException("BamToolsIndex::ReadReferenceEntry", "invalid reference requested");

    // use index summary to assist reading the reference's BTI blocks
    const BtiReferenceSummary& refSummary = m_indexFileSummary.at(refEntry.ID);
    ReadBlocks(refSummary, refEntry.Blocks);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movslq (%rsi), %rsi
testq %rsi, %rsi
js 0x4c185
movq %rdi, %r14
movq 0x40(%rdi), %rax
subq 0x38(%rdi), %rax
shrq $0x4, %rax
cmpl %eax, %esi
jge 0x4c185
leaq 0x38(%r14), %rdi
callq 0x31350
addq $0x8, %rbx
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x33fe0
pushq $0x28
popq %rdi
callq 0x31e70
movq %rax, %rbx
leaq 0x10639(%rip), %rsi     # 0x5c7d0
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
leaq 0x10645(%rip), %rsi     # 0x5c7f2
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x31b30
movb $0x1, %bpl
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x344c0
xorl %ebp, %ebp
movq 0x28d5e(%rip), %rsi     # 0x74f38
movq 0x28d97(%rip), %rdx     # 0x74f78
movq %rbx, %rdi
callq 0x34c90
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4c1fe
movq %rax, %r14
movb $0x1, %bpl
leaq 0x30(%rsp), %rdi
callq 0x33a00
testb %bpl, %bpl
jne 0x4c21a
jmp 0x4c222
movq %rax, %rdi
callq 0x39b2f
movq %rax, %r14
movq %rbx, %rdi
callq 0x327c0
movq %r14, %rdi
callq 0x34ed0
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::HasAlignments(int const&) const
bool BamToolsIndex::HasAlignments(const int& referenceID) const {
    if ( referenceID < 0 || referenceID >= (int)m_indexFileSummary.size() )
        return false;
    const BtiReferenceSummary& refSummary = m_indexFileSummary.at(referenceID);
    return ( refSummary.NumBlocks > 0 );
}

// Assembly:
movslq (%rsi), %rsi
testq %rsi, %rsi
js 0x4c257
movq 0x40(%rdi), %rax
subq 0x38(%rdi), %rax
shrq $0x4, %rax
cmpl %eax, %esi
jge 0x4c257
pushq %rax
addq $0x38, %rdi
callq 0x35300
cmpl $0x0, (%rax)
setg %al
addq $0x8, %rsp
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::Jump(BamTools::BamRegion const&, bool*)
bool BamToolsIndex::Jump(const BamTools::BamRegion& region, bool* hasAlignmentsInRegion) {

    // clear flag
    *hasAlignmentsInRegion = false;

    // skip if invalid reader or not open
    if ( m_reader == 0 || !m_reader->IsOpen() ) {
        SetErrorString("BamToolsIndex::Jump", "could not jump: reader is not open");
        return false;
    }

    // make sure left-bound position is valid
    const RefVector& references = m_reader->GetReferenceData();
    if ( region.LeftPosition > references.at(region.LeftRefID).RefLength ) {
        SetErrorString("BamToolsIndex::Jump", "could not create index: invalid region requested");
        return false;
    }

    // calculate nearest offset to jump to
    int64_t offset;
    try {
        GetOffset(region, offset, hasAlignmentsInRegion);
    } catch ( BamException& e ) {
        m_errorString = e.what();
        return false;
    }

    // return success/failure of seek
    return m_reader->Seek(offset);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movb $0x0, (%rdx)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x4c2fb
movq %rdx, %r14
movq %rsi, %r15
callq 0x33780
testb %al, %al
je 0x4c2fb
movq 0x8(%rbx), %rdi
callq 0x33960
movl 0x4(%r15), %ebp
movslq (%r15), %rsi
movq %rax, %rdi
callq 0x34a10
cmpl 0x20(%rax), %ebp
jle 0x4c35a
leaq 0x103d9(%rip), %rsi     # 0x5c687
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x31b30
leaq 0x103d7(%rip), %rsi     # 0x5c69b
leaq 0x28(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x31b30
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x31500
leaq 0x28(%rsp), %rdi
callq 0x33a00
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x4c34d
leaq 0x10385(%rip), %rsi     # 0x5c687
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x31b30
leaq 0xfd52(%rip), %rsi      # 0x5c06a
leaq 0x28(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x31b30
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x31500
leaq 0x28(%rsp), %rdi
callq 0x33a00
leaq 0x8(%rsp), %rdi
callq 0x33a00
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x33d70
movq 0x8(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x33190
jmp 0x4c34f
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x33a00
jmp 0x4c3ca
movq %rax, %r14
cmpl $0x1, %edx
jne 0x4c3f7
movq %r14, %rdi
callq 0x31bb0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
addq $0x10, %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x35550
callq 0x34970
jmp 0x4c34d
movq %rax, %r14
callq 0x34970
jmp 0x4c3f7
jmp 0x4c3e5
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x4c3f7
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x33a00
jmp 0x4c3ed
movq %rax, %r14
jmp 0x4c3f7
movq %rax, %r14
leaq 0x8(%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/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::Load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool BamToolsIndex::Load(const std::string& filename) {

    try {

        // attempt to open file (read-only)
        OpenFile(filename, IBamIODevice::ReadOnly);

        // load metadata & generate in-memory summary
        LoadHeader();
        LoadFileSummary();

        // return success
        return true;

    } catch ( BamException& e ) {
        m_errorString = e.what();
        return false;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rdx
callq 0x323c0
movq %rbx, %rdi
callq 0x33820
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x33d80
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
cmpl $0x1, %edx
jne 0x4c46a
movq %r14, %rdi
callq 0x31bb0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
addq $0x10, %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x35550
callq 0x34970
xorl %ebp, %ebp
jmp 0x4c42a
movq %rax, %r14
callq 0x34970
movq %r14, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::LoadHeader()
void BamToolsIndex::LoadHeader(void) {

    // check BTI file metadata
    CheckMagicNumber();
    CheckVersion();

    // use file's BTI block size to set member variable
    const int64_t numBytesRead = m_resources.Device->Read((char*)&m_blockSize, sizeof(m_blockSize));
    if ( m_isBigEndian ) SwapEndian_32(m_blockSize);
    if ( numBytesRead != sizeof(m_blockSize) )
        throw BamException("BamToolsIndex::LoadHeader", "could not read BTI block size");
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %r14
callq 0x34ce0
movq %r14, %rdi
callq 0x34e10
movq 0x60(%r14), %rdi
leaq 0x50(%r14), %rbx
movq (%rdi), %rax
pushq $0x4
popq %rdx
movq %rbx, %rsi
callq *0x28(%rax)
cmpb $0x1, 0x30(%r14)
jne 0x4c4b3
movl (%rbx), %ecx
bswapl %ecx
movl %ecx, (%rbx)
cmpq $0x4, %rax
jne 0x4c4c2
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x28
popq %rdi
callq 0x31e70
movq %rax, %rbx
leaq 0x101f8(%rip), %rsi     # 0x5c6cc
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
leaq 0x101fc(%rip), %rsi     # 0x5c6e6
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x31b30
movb $0x1, %bpl
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x344c0
xorl %ebp, %ebp
movq 0x28a21(%rip), %rsi     # 0x74f38
movq 0x28a5a(%rip), %rdx     # 0x74f78
movq %rbx, %rdi
callq 0x34c90
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4c53b
movq %rax, %r14
movb $0x1, %bpl
leaq 0x30(%rsp), %rdi
callq 0x33a00
testb %bpl, %bpl
jne 0x4c557
jmp 0x4c55f
movq %rax, %rdi
callq 0x39b2f
movq %rax, %r14
movq %rbx, %rdi
callq 0x327c0
movq %r14, %rdi
callq 0x34ed0
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::LoadFileSummary()
void BamToolsIndex::LoadFileSummary(void) {

    // load number of reference sequences
    int numReferences;
    LoadNumReferences(numReferences);

    // initialize file summary data
    InitializeFileSummary(numReferences);

    // load summary for each reference
    BtiFileSummary::iterator summaryIter = m_indexFileSummary.begin();
    BtiFileSummary::iterator summaryEnd  = m_indexFileSummary.end();
    for ( ; summaryIter != summaryEnd; ++summaryIter )
        LoadReferenceSummary(*summaryIter);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xc(%rsp), %r14
movq %r14, %rsi
callq 0x34f80
movq %rbx, %rdi
movq %r14, %rsi
callq 0x34fa0
movq 0x38(%rbx), %r14
movq 0x40(%rbx), %r15
cmpq %r15, %r14
je 0x4c5aa
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32af0
addq $0x10, %r14
jmp 0x4c594
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::LoadNumReferences(int&)
void BamToolsIndex::LoadNumReferences(int& numReferences) {
    const int64_t numBytesRead = m_resources.Device->Read((char*)&numReferences, sizeof(numReferences));
    if ( m_isBigEndian ) SwapEndian_32(numReferences);
    if ( numBytesRead != sizeof(numReferences) )
        throw BamException("BamToolsIndex::LoadNumReferences", "could not read number of references");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r15
movq 0x60(%rdi), %rdi
movq (%rdi), %rax
pushq $0x4
popq %rdx
callq *0x28(%rax)
movq %rax, %r14
cmpb $0x1, 0x30(%r15)
jne 0x4c5e3
movq %rbx, %rdi
callq 0x32c90
cmpq $0x4, %r14
jne 0x4c5f4
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x28
popq %rdi
callq 0x31e70
movq %rax, %rbx
leaq 0x1013f(%rip), %rsi     # 0x5c745
leaq 0x28(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x31b30
leaq 0x1014a(%rip), %rsi     # 0x5c766
leaq 0x8(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x31b30
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x344c0
xorl %ebp, %ebp
movq 0x288ef(%rip), %rsi     # 0x74f38
movq 0x28928(%rip), %rdx     # 0x74f78
movq %rbx, %rdi
callq 0x34c90
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x4c66d
movq %rax, %r14
movb $0x1, %bpl
leaq 0x28(%rsp), %rdi
callq 0x33a00
testb %bpl, %bpl
jne 0x4c689
jmp 0x4c691
movq %rax, %rdi
callq 0x39b2f
movq %rax, %r14
movq %rbx, %rdi
callq 0x327c0
movq %r14, %rdi
callq 0x34ed0
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::LoadReferenceSummary(BamTools::Internal::BtiReferenceSummary&)
void BamToolsIndex::LoadReferenceSummary(BtiReferenceSummary& refSummary) {

    // load number of blocks
    int numBlocks;
    LoadNumBlocks(numBlocks);

    // store block summary data for this reference
    refSummary.NumBlocks = numBlocks;
    refSummary.FirstBlockFilePosition = Tell();

    // skip reference's blocks
    SkipBlocks(numBlocks);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xc(%rsp), %r15
movq %r15, %rsi
callq 0x31b50
movl (%r15), %eax
movl %eax, (%rbx)
movq 0x60(%r14), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movq %rax, 0x8(%rbx)
movq %r14, %rdi
movq %r15, %rsi
callq 0x32ea0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::LoadNumBlocks(int&)
void BamToolsIndex::LoadNumBlocks(int& numBlocks) {
    const int64_t numBytesRead = m_resources.Device->Read((char*)&numBlocks, sizeof(numBlocks));
    if ( m_isBigEndian ) SwapEndian_32(numBlocks);
    if ( numBytesRead != sizeof(numBlocks) )
        throw BamException("BamToolsIndex::LoadNumBlocks", "could not read number of BTI blocks");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r15
movq 0x60(%rdi), %rdi
movq (%rdi), %rax
pushq $0x4
popq %rdx
callq *0x28(%rax)
movq %rax, %r14
cmpb $0x1, 0x30(%r15)
jne 0x4c70d
movq %rbx, %rdi
callq 0x32c90
cmpq $0x4, %r14
jne 0x4c71e
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x28
popq %rdi
callq 0x31e70
movq %rax, %rbx
leaq 0xffd4(%rip), %rsi      # 0x5c704
leaq 0x28(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x31b30
leaq 0xffdb(%rip), %rsi      # 0x5c721
leaq 0x8(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x31b30
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x344c0
xorl %ebp, %ebp
movq 0x287c5(%rip), %rsi     # 0x74f38
movq 0x287fe(%rip), %rdx     # 0x74f78
movq %rbx, %rdi
callq 0x34c90
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x4c797
movq %rax, %r14
movb $0x1, %bpl
leaq 0x28(%rsp), %rdi
callq 0x33a00
testb %bpl, %bpl
jne 0x4c7b3
jmp 0x4c7bb
movq %rax, %rdi
callq 0x39b2f
movq %rax, %r14
movq %rbx, %rdi
callq 0x327c0
movq %r14, %rdi
callq 0x34ed0
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::ReadBlock(BamTools::Internal::BtiBlock&)
void BamToolsIndex::ReadBlock(BtiBlock& block) {

    // read in block data members
    int64_t numBytesRead = 0;
    numBytesRead += m_resources.Device->Read((char*)&block.MaxEndPosition, sizeof(block.MaxEndPosition));
    numBytesRead += m_resources.Device->Read((char*)&block.StartOffset,    sizeof(block.StartOffset));
    numBytesRead += m_resources.Device->Read((char*)&block.StartPosition,  sizeof(block.StartPosition));

    // swap endian-ness if necessary
    if ( m_isBigEndian ) {
        SwapEndian_32(block.MaxEndPosition);
        SwapEndian_64(block.StartOffset);
        SwapEndian_32(block.StartPosition);
    }

    // check block read ok
    const int expectedBytes = sizeof(block.MaxEndPosition) +
                              sizeof(block.StartOffset) +
                              sizeof(block.StartPosition);
    if ( numBytesRead != expectedBytes )
        throw BamException("BamToolsIndex::ReadBlock", "could not read block");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x60(%rdi), %rdi
movq (%rdi), %rax
pushq $0x4
popq %r13
movl %r13d, %edx
callq *0x28(%rax)
movq %rax, %r12
movq 0x60(%r14), %rdi
leaq 0x8(%rbx), %r15
movq (%rdi), %rax
pushq $0x8
popq %rdx
movq %r15, %rsi
callq *0x28(%rax)
movq %rax, %rbp
addq %r12, %rbp
movq 0x60(%r14), %rdi
leaq 0x10(%rbx), %r12
movq (%rdi), %rax
movq %r12, %rsi
movl %r13d, %edx
callq *0x28(%rax)
movq %rax, %r13
addq %rbp, %r13
cmpb $0x1, 0x30(%r14)
jne 0x4c861
movq %rbx, %rdi
callq 0x32c90
movq %r15, %rdi
callq 0x34860
movq %r12, %rdi
callq 0x32c90
cmpq $0x10, %r13
jne 0x4c876
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x28
popq %rdi
callq 0x31e70
movq %rax, %rbx
leaq 0xff1a(%rip), %rsi      # 0x5c7a2
leaq 0x28(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x31b30
leaq 0xff1d(%rip), %rsi      # 0x5c7bb
leaq 0x8(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x31b30
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x344c0
xorl %ebp, %ebp
movq 0x2866d(%rip), %rsi     # 0x74f38
movq 0x286a6(%rip), %rdx     # 0x74f78
movq %rbx, %rdi
callq 0x34c90
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x4c8ef
movq %rax, %r14
movb $0x1, %bpl
leaq 0x28(%rsp), %rdi
callq 0x33a00
testb %bpl, %bpl
jne 0x4c90b
jmp 0x4c913
movq %rax, %rdi
callq 0x39b2f
movq %rax, %r14
movq %rbx, %rdi
callq 0x327c0
movq %r14, %rdi
callq 0x34ed0
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::ReadBlocks(BamTools::Internal::BtiReferenceSummary const&, std::vector<BamTools::Internal::BtiBlock, std::allocator<BamTools::Internal::BtiBlock>>&)
void BamToolsIndex::ReadBlocks(const BtiReferenceSummary& refSummary, BtiBlockVector& blocks) {

    // prep blocks container
    blocks.clear();
    blocks.reserve(refSummary.NumBlocks);

    // skip to first block entry
    Seek( refSummary.FirstBlockFilePosition, SEEK_SET );

    // read & store block entries
    BtiBlock block;
    for ( int i = 0; i < refSummary.NumBlocks; ++i ) {
        ReadBlock(block);
        blocks.push_back(block);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdx), %rax
cmpq %rax, 0x8(%rdx)
je 0x4c93e
movq %rax, 0x8(%rbx)
movslq (%r14), %rsi
movq %rbx, %rdi
callq 0x350b0
movq 0x8(%r14), %rax
leaq 0x8(%rsp), %r12
movq %rax, (%r12)
xorl %ebp, %ebp
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x33550
andl $0x0, (%r12)
andq $0x0, 0x8(%r12)
andl $0x0, 0x10(%r12)
cmpl (%r14), %ebp
jge 0x4c995
movq %r15, %rdi
movq %r12, %rsi
callq 0x33fa0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x330e0
incl %ebp
jmp 0x4c976
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::WriteBlock(BamTools::Internal::BtiBlock const&)
void BamToolsIndex::WriteBlock(const BtiBlock& block) {

    // copy entry data
    int32_t maxEndPosition = block.MaxEndPosition;
    int64_t startOffset    = block.StartOffset;
    int32_t startPosition  = block.StartPosition;

    // swap endian-ness if necessary
    if ( m_isBigEndian ) {
        SwapEndian_32(maxEndPosition);
        SwapEndian_64(startOffset);
        SwapEndian_32(startPosition);
    }

    // write the reference index entry
    int64_t numBytesWritten = 0;
    numBytesWritten += m_resources.Device->Write((const char*)&maxEndPosition, sizeof(maxEndPosition));
    numBytesWritten += m_resources.Device->Write((const char*)&startOffset,    sizeof(startOffset));
    numBytesWritten += m_resources.Device->Write((const char*)&startPosition,  sizeof(startPosition));

    // check block written ok
    const int expectedBytes = sizeof(maxEndPosition) +
                              sizeof(startOffset) +
                              sizeof(startPosition);
    if ( numBytesWritten != expectedBytes )
        throw BamException("BamToolsIndex::WriteBlock", "could not write BTI block");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movl (%rsi), %eax
movl %eax, 0xc(%rsp)
movq 0x8(%rsi), %rax
movq %rax, 0x10(%rsp)
movl 0x10(%rsi), %eax
movl %eax, 0x8(%rsp)
cmpb $0x1, 0x30(%rdi)
jne 0x4caad
leaq 0xc(%rsp), %rdi
callq 0x32c90
leaq 0x10(%rsp), %rdi
callq 0x34860
leaq 0x8(%rsp), %rdi
callq 0x32c90
movq 0x60(%rbx), %rdi
movq (%rdi), %rax
leaq 0xc(%rsp), %rsi
pushq $0x4
popq %rbp
movl %ebp, %edx
callq *0x40(%rax)
movq %rax, %r14
movq 0x60(%rbx), %rdi
movq (%rdi), %rax
leaq 0x10(%rsp), %rsi
pushq $0x8
popq %rdx
callq *0x40(%rax)
movq %rax, %r15
addq %r14, %r15
movq 0x60(%rbx), %rdi
movq (%rdi), %rax
leaq 0x8(%rsp), %rsi
movl %ebp, %edx
callq *0x40(%rax)
addq %r15, %rax
cmpq $0x10, %rax
jne 0x4cb01
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x28
popq %rdi
callq 0x31e70
movq %rax, %rbx
leaq 0xfd0f(%rip), %rsi      # 0x5c822
leaq 0x38(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x31b30
leaq 0xfd13(%rip), %rsi      # 0x5c83c
leaq 0x18(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x31b30
movb $0x1, %bpl
leaq 0x38(%rsp), %rsi
leaq 0x18(%rsp), %rdx
movq %rbx, %rdi
callq 0x344c0
xorl %ebp, %ebp
movq 0x283e2(%rip), %rsi     # 0x74f38
movq 0x2841b(%rip), %rdx     # 0x74f78
movq %rbx, %rdi
callq 0x34c90
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x33a00
jmp 0x4cb7a
movq %rax, %r14
movb $0x1, %bpl
leaq 0x38(%rsp), %rdi
callq 0x33a00
testb %bpl, %bpl
jne 0x4cb96
jmp 0x4cb9e
movq %rax, %rdi
callq 0x39b2f
movq %rax, %r14
movq %rbx, %rdi
callq 0x327c0
movq %r14, %rdi
callq 0x34ed0
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::WriteBlocks(std::vector<BamTools::Internal::BtiBlock, std::allocator<BamTools::Internal::BtiBlock>> const&)
void BamToolsIndex::WriteBlocks(const BtiBlockVector& blocks) {
    BtiBlockVector::const_iterator blockIter = blocks.begin();
    BtiBlockVector::const_iterator blockEnd  = blocks.end();
    for ( ; blockIter != blockEnd; ++blockIter )
        WriteBlock(*blockIter);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rsi), %r14
movq 0x8(%rsi), %r15
cmpq %r15, %r14
je 0x4cbcb
movq %rbx, %rdi
movq %r14, %rsi
callq 0x31db0
addq $0x18, %r14
jmp 0x4cbb5
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/BamAux.h
// Function: BamTools::SwapEndian_64(long&)
API_EXPORT inline void SwapEndian_64(int64_t& x) {
    x = ( (x >> 56) | 
         ((x << 40) & 0x00FF000000000000ll) |
         ((x << 24) & 0x0000FF0000000000ll) |
         ((x << 8)  & 0x000000FF00000000ll) |
         ((x >> 8)  & 0x00000000FF000000ll) |
         ((x >> 24) & 0x0000000000FF0000ll) |
         ((x >> 40) & 0x000000000000FF00ll) |
          (x << 56)
        );
}

// Assembly:
movq (%rdi), %rax
movq %rax, %rcx
sarq $0x38, %rcx
movl $0xff00, %esi           # imm = 0xFF00
movq %rax, %rdx
andq %rsi, %rdx
shlq $0x28, %rdx
movl $0xff0000, %r9d         # imm = 0xFF0000
movq %rax, %r10
andq %r9, %r10
shlq $0x18, %r10
movl %eax, %r8d
andl $0xff000000, %r8d       # imm = 0xFF000000
shlq $0x8, %r8
orq %r10, %r8
movq %rax, %r10
shrq $0x8, %r10
andl $0xff000000, %r10d      # imm = 0xFF000000
movq %rax, %r11
shrq $0x18, %r11
andq %r9, %r11
orq %r10, %r11
movq %rax, %r9
shrq $0x28, %r9
andq %rsi, %r9
orq %r11, %r9
shlq $0x38, %rax
orq %rcx, %rax
orq %rdx, %rax
orq %r8, %rax
orq %r9, %rax
movq %rax, (%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/BamDeviceFactory_p.cpp
// Function: BamTools::Internal::BamDeviceFactory::CreateDevice(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
IBamIODevice* BamDeviceFactory::CreateDevice(const string& source) {

    // check for requested pipe
    if ( source == "-" || source == "stdin" || source == "stdout" )
        return new BamPipe;

    // check for HTTP prefix
    if ( source.find("http://") == 0 )
        return new BamHttp(source);

    // check for FTP prefix
    if ( source.find("ftp://") == 0 )
        return new BamFtp(source);

    // otherwise assume a "normal" file
    return new BamFile(source);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xf852(%rip), %rsi      # 0x5c8d0
callq 0x35790
testb %al, %al
jne 0x4d0ad
leaq 0xf844(%rip), %rsi      # 0x5c8d2
movq %rbx, %rdi
callq 0x35790
testb %al, %al
jne 0x4d0ad
leaq 0xf837(%rip), %rsi      # 0x5c8d8
movq %rbx, %rdi
callq 0x35790
testb %al, %al
je 0x4d0cb
pushq $0x38
popq %rdi
callq 0x33130
movq %rax, %r14
movq %rax, %rdi
callq 0x324a0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xf80d(%rip), %rsi      # 0x5c8df
movq %rbx, %rdi
xorl %edx, %edx
callq 0x35730
testq %rax, %rax
je 0x4d10f
leaq 0xf7ff(%rip), %rsi      # 0x5c8e7
movq %rbx, %rdi
xorl %edx, %edx
callq 0x35730
testq %rax, %rax
je 0x4d129
pushq $0x58
popq %rdi
callq 0x33130
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x33500
jmp 0x4d0c0
movl $0xc8, %edi
callq 0x33130
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x333d0
jmp 0x4d0c0
movl $0x120, %edi            # imm = 0x120
callq 0x33130
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x33fc0
jmp 0x4d0c0
jmp 0x4d14c
jmp 0x4d14c
jmp 0x4d14c
movq %rax, %rbx
movq %r14, %rdi
callq 0x32fa0
movq %rbx, %rdi
callq 0x34ed0
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::ParseUrl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void BamFtp::ParseUrl(const string& url) {

    // clear flag to start
    m_isUrlParsed = false;

    // make sure url starts with "ftp://", case-insensitive
    string tempUrl(url);
    toLower(tempUrl);
    const size_t prefixFound = tempUrl.find(FTP_PREFIX);
    if ( prefixFound == string::npos )
        return;

    // find end of host name portion (first '/' hit after the prefix)
    const size_t firstSlashFound = tempUrl.find(HOST_SEPARATOR, FTP_PREFIX_LENGTH);
    if ( firstSlashFound == string::npos ) {
        ;  // no slash found... no filename given along with host?
    }

    // fetch hostname
    string hostname = tempUrl.substr(FTP_PREFIX_LENGTH, (firstSlashFound - FTP_PREFIX_LENGTH));
    m_hostname = hostname;
    m_port = FTP_PORT;

    // store remainder of URL as filename (must be non-empty)
    string filename = tempUrl.substr(firstSlashFound);
    if ( filename.empty() )
        return;
    m_filename = filename;

    // set parsed OK flag
    m_isUrlParsed = true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
xorl %ebp, %ebp
movb %bpl, 0x110(%rdi)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x33ff0
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %bpl, (%rax)
movq 0x8(%r14), %r14
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
callq 0x34000
xorl %r15d, %r15d
cmpq %r15, %r14
je 0x4d75d
movq 0x8(%rsp), %rax
movsbl (%rax,%r15), %edi
callq 0x34350
movq 0x48(%rsp), %rcx
movb %al, (%rcx,%r15)
incq %r15
jmp 0x4d73b
leaq 0x48(%rsp), %rdi
callq 0x33a00
leaq 0x2a9aa(%rip), %rsi     # 0x78118
leaq 0x8(%rsp), %rdi
xorl %edx, %edx
callq 0x35770
cmpq $-0x1, %rax
je 0x4d80a
leaq 0x8(%rsp), %rdi
pushq $0x2f
popq %rsi
pushq $0x6
popq %rdx
callq 0x33d30
movq %rax, %r14
leaq -0x6(%rax), %rcx
leaq 0x68(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $0x6
popq %rdx
callq 0x332a0
leaq 0x40(%rbx), %rdi
leaq 0x68(%rsp), %rsi
callq 0x32060
movw $0x15, 0x60(%rbx)
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $-0x1
popq %rcx
movq %r14, %rdx
callq 0x332a0
cmpq $0x0, 0x30(%rsp)
je 0x4d7f6
leaq 0x90(%rbx), %rdi
leaq 0x28(%rsp), %rsi
callq 0x32060
movb $0x1, 0x110(%rbx)
leaq 0x28(%rsp), %rdi
callq 0x33a00
leaq 0x68(%rsp), %rdi
callq 0x33a00
leaq 0x8(%rsp), %rdi
callq 0x33a00
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x33a00
jmp 0x4d84d
jmp 0x4d84a
jmp 0x4d859
jmp 0x4d859
jmp 0x4d859
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x33a00
jmp 0x4d85c
jmp 0x4d86e
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x33a00
jmp 0x4d85c
movq %rax, %rbx
leaq 0x8(%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/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::~BamFtp()
BamFtp::~BamFtp(void) {

    // close connection & clean up
    Close();
    if ( m_commandSocket )
        delete m_commandSocket;
    if ( m_dataSocket )
        delete m_dataSocket;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x2774b(%rip), %rax     # 0x74fd0
addq $0x10, %rax
movq %rax, (%rdi)
callq 0x31990
movq 0x30(%rbx), %r15
testq %r15, %r15
je 0x4d8aa
movq %r15, %rdi
callq 0x31cb0
movq %r15, %rdi
callq 0x32fa0
movq 0x38(%rbx), %r15
testq %r15, %r15
je 0x4d8c3
movq %r15, %rdi
callq 0x31cb0
movq %r15, %rdi
callq 0x32fa0
leaq 0xf0(%rbx), %rdi
callq 0x33a00
leaq 0xd0(%rbx), %rdi
callq 0x33a00
leaq 0xb0(%rbx), %rdi
callq 0x33a00
leaq 0x90(%rbx), %rdi
callq 0x33a00
leaq 0x68(%rbx), %rdi
callq 0x33a00
leaq 0x40(%rbx), %rdi
callq 0x33a00
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x319e0
jmp 0x4d914
movq %rax, %r14
movq %r15, %rdi
callq 0x32fa0
jmp 0x4d942
movq %rax, %r14
jmp 0x4d984
movq %rax, %r14
jmp 0x4d97b
movq %rax, %r14
jmp 0x4d972
movq %rax, %r14
jmp 0x4d966
movq %rax, %r14
jmp 0x4d95a
movq %rax, %r14
jmp 0x4d94e
movq %rax, %r14
leaq 0xf0(%rbx), %rdi
callq 0x33a00
leaq 0xd0(%rbx), %rdi
callq 0x33a00
leaq 0xb0(%rbx), %rdi
callq 0x33a00
leaq 0x90(%rbx), %rdi
callq 0x33a00
leaq 0x68(%rbx), %rdi
callq 0x33a00
leaq 0x40(%rbx), %rdi
callq 0x33a00
movq %rbx, %rdi
callq 0x319e0
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/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::Close()
void BamFtp::Close(void) {

    // disconnect socket
    m_commandSocket->DisconnectFromHost();
    m_dataSocket->DisconnectFromHost();

    // reset state - necessary??
    m_isUrlParsed = false;
    m_filePosition = -1;
    m_username = DEFAULT_USER;
    m_password = DEFAULT_PASS;
    m_dataHostname.clear();
    m_dataPort = 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x34f10
movq 0x38(%rbx), %rdi
callq 0x34f10
xorl %ebp, %ebp
movb %bpl, 0x110(%rbx)
orq $-0x1, 0x118(%rbx)
leaq 0xb0(%rbx), %rdi
leaq 0x2a757(%rip), %rsi     # 0x78158
callq 0x32060
leaq 0xd0(%rbx), %rdi
leaq 0x2a764(%rip), %rsi     # 0x78178
callq 0x32060
andq $0x0, 0x70(%rbx)
movq 0x68(%rbx), %rax
movb %bpl, (%rax)
andw $0x0, 0x88(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::ReceiveReply()
bool BamFtp::ReceiveReply(void) {

    // failure if not connected
    if ( !m_commandSocket->IsConnected() ) {
        SetErrorString("BamFtp::ReceiveReply()", "command socket not connected");
        return false;
    }

    m_response.clear();

    // read header data (& discard for now)
    bool headerEnd = false;
    while ( !headerEnd ) {

        const string headerLine = m_commandSocket->ReadLine();
        m_response += headerLine;

        // if line is of form 'xyz ', quit reading lines
        if ( (headerLine.length() >= 4 ) &&
             isdigit(headerLine[0]) &&
             isdigit(headerLine[1]) &&
             isdigit(headerLine[2]) &&
             ( headerLine[3] != MULTILINE_CONTINUE )
           )
        {
            headerEnd = true;
        }
    }

    // return success, depending on response
    if ( m_response.empty() ) {
        SetErrorString("BamFtp::ReceiveReply", "error reading server reply");
        return false;
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x32cf0
testb %al, %al
je 0x4ddb5
andq $0x0, 0xf8(%rbx)
leaq 0xf0(%rbx), %r14
movq 0xf0(%rbx), %rax
movb $0x0, (%rax)
leaq 0x8(%rsp), %r15
movq 0x30(%rbx), %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x32730
movq %r14, %rdi
movq %r15, %rsi
callq 0x35680
cmpq $0x4, 0x10(%rsp)
jb 0x4ddab
movq 0x8(%rsp), %rax
movsbl (%rax), %ecx
addl $-0x30, %ecx
cmpl $0x9, %ecx
ja 0x4ddab
movsbl 0x1(%rax), %ecx
addl $-0x30, %ecx
cmpl $0x9, %ecx
ja 0x4ddab
movsbl 0x2(%rax), %ecx
addl $-0x30, %ecx
cmpl $0x9, %ecx
ja 0x4ddab
movb 0x3(%rax), %bpl
movq %r15, %rdi
callq 0x33a00
cmpb $0x2d, %bpl
je 0x4dd4e
jmp 0x4de09
movq %r15, %rdi
callq 0x33a00
jmp 0x4dd4e
leaq 0xec77(%rip), %rsi      # 0x5ca33
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x31b30
leaq 0xec78(%rip), %rsi      # 0x5ca4a
leaq 0x28(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x31b30
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x34ab0
leaq 0x28(%rsp), %rdi
callq 0x33a00
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x4de67
movb $0x1, %al
cmpq $0x0, 0xf8(%rbx)
jne 0x4de69
leaq 0xec4b(%rip), %rsi      # 0x5ca67
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x31b30
leaq 0xec4a(%rip), %rsi      # 0x5ca7c
leaq 0x28(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x31b30
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x34ab0
leaq 0x28(%rsp), %rdi
callq 0x33a00
leaq 0x8(%rsp), %rdi
callq 0x33a00
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x33a00
jmp 0x4de88
jmp 0x4dea3
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x4dec4
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x33a00
jmp 0x4deab
movq %rax, %rbx
jmp 0x4dec4
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x4dec4
movq %rax, %rbx
leaq 0x8(%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/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::SendCommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
bool BamFtp::SendCommand(const string& command, bool waitForReply) {

    // failure if not connected
    if ( !m_commandSocket->IsConnected() ) {
        SetErrorString("BamFtp::SendCommand", "command socket not connected");
        return false;
    }

    // write command to 'command socket'
    if ( WriteCommandSocket(command.c_str(), command.length()) == -1 ) {
        SetErrorString("BamFtp::SendCommand", "error writing to socket");
        // get actual error from command socket??
        return false;
    }

    // if we sent a command that receives a response
    if ( waitForReply )
        return ReceiveReply();

    // return success
    return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x32cf0
testb %al, %al
je 0x4df21
movq (%r14), %rsi
movl 0x8(%r14), %edx
movq %rbx, %rdi
callq 0x325d0
cmpq $-0x1, %rax
je 0x4df75
movb $0x1, %al
testb %bpl, %bpl
je 0x4dfc9
movq %rbx, %rdi
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x33760
leaq 0xeb6f(%rip), %rsi      # 0x5ca97
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
leaq 0xeb0c(%rip), %rsi      # 0x5ca4a
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
jmp 0x4dfc7
leaq 0xeb1b(%rip), %rsi      # 0x5ca97
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
leaq 0xeb19(%rip), %rsi      # 0x5caab
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
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4dfe6
jmp 0x4e001
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x33a00
jmp 0x4e013
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4e009
movq %rax, %rbx
jmp 0x4e013
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/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::Open(BamTools::IBamIODevice::OpenMode)
bool BamFtp::Open(const IBamIODevice::OpenMode mode) {

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

    // initialize basic valid state
    m_mode = mode;
    m_filePosition = 0;

    // attempt connection to command & data sockets
    return ( ConnectCommandSocket() && ConnectDataSocket() );
}

// Assembly:
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
cmpl $0x1, %esi
jne 0x4e6d1
movl $0x1, 0x8(%rbx)
andq $0x0, 0x118(%rbx)
movq %rbx, %rdi
callq 0x31520
testb %al, %al
je 0x4e723
movq %rbx, %rdi
addq $0x50, %rsp
popq %rbx
jmp 0x350e0
leaq 0xe326(%rip), %rsi      # 0x5c9fe
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
leaq 0xe31d(%rip), %rsi      # 0x5ca0b
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
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4e73d
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/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::Read(char*, unsigned int)
int64_t BamFtp::Read(char* data, const unsigned int numBytes) {

    // if BamHttp not in a valid state
    if ( !IsOpen() )
        return -1;

    // read until hit desired @numBytes
    int64_t bytesReadSoFar = 0;
    while ( bytesReadSoFar < numBytes ) {

        // calculate number of bytes we're going to try to read this iteration
        const size_t remainingBytes = ( numBytes - bytesReadSoFar );

        // if either disconnected somehow, or (more likely) we have seeked since last read
        if ( !m_dataSocket->IsConnected() ) {
            if ( !ConnectDataSocket() ) {
                // TODO: set error string
                return -1;
            }
        }

        // read bytes from data socket
        const int64_t socketBytesRead = ReadDataSocket(data+bytesReadSoFar, remainingBytes);
        if ( socketBytesRead < 0 ) // error
            return -1;
        else if ( socketBytesRead == 0 ) // EOF
            return bytesReadSoFar;
        bytesReadSoFar += socketBytesRead;
        m_filePosition += socketBytesRead;
    }

    // return actual number bytes successfully read
    return bytesReadSoFar;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rax
callq *0x50(%rax)
pushq $-0x1
popq %rbx
testb %al, %al
je 0x4e7c3
movl %ebp, %r13d
xorl %r12d, %r12d
cmpq %r13, %r12
jge 0x4e7c0
movq 0x38(%r15), %rdi
callq 0x32cf0
testb %al, %al
jne 0x4e79c
movq %r15, %rdi
callq 0x350e0
testb %al, %al
je 0x4e7c3
leaq (%r14,%r12), %rsi
movl %ebp, %edx
subl %r12d, %edx
movq %r15, %rdi
callq 0x33950
testq %rax, %rax
js 0x4e7c3
je 0x4e7c0
addq %rax, %r12
addq %rax, 0x118(%r15)
jmp 0x4e77e
movq %r12, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::Seek(long const&, int)
bool BamFtp::Seek(const int64_t& position, const int origin) {

    // if FTP device not in a valid state
    if ( !IsOpen() ) {
        // TODO: set error string
        return false;
    }

    // ----------------------
    // UGLY !! but works??
    // ----------------------
    // disconnect from server
    m_dataSocket->DisconnectFromHost();
    m_commandSocket->DisconnectFromHost();

    // update file position & return success
    if ( origin == SEEK_CUR )
        m_filePosition += position;
    else if ( origin == SEEK_SET)
        m_filePosition = position;
    else {
        // TODO: set error string
        return false;
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x50(%rax)
testb %al, %al
je 0x4e827
movq 0x38(%rbx), %rdi
callq 0x34f10
movq 0x30(%rbx), %rdi
callq 0x34f10
testl %ebp, %ebp
je 0x4e82b
cmpl $0x1, %ebp
jne 0x4e827
movq (%r14), %rax
addq %rax, 0x118(%rbx)
jmp 0x4e835
xorl %eax, %eax
jmp 0x4e837
movq (%r14), %rax
movq %rax, 0x118(%rbx)
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::WriteCommandSocket(char const*, unsigned int)
int64_t BamFtp::WriteCommandSocket(const char* data, const unsigned int numBytes) {
    if ( !m_commandSocket->IsConnected() )
        return -1;
    m_commandSocket->ClearBuffer();
    return m_commandSocket->Write(data, numBytes);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq 0x30(%rdi), %rdi
callq 0x32cf0
testb %al, %al
je 0x4e872
movq 0x30(%r15), %rdi
callq 0x34f30
movq 0x30(%r15), %rdi
movq %r14, %rsi
movl %ebx, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x31fc0
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::Write(char const*, unsigned int)
int64_t BamFtp::Write(const char* data, const unsigned int numBytes) {
    (void)data;
    (void)numBytes;
    BT_ASSERT_X(false, "BamFtp::Write : write-mode not supported on this device");
    SetErrorString("BamFtp::Write", "write-mode not supported on this device");
    return -1;
}

// Assembly:
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
leaq 0xe21c(%rip), %rsi      # 0x5cac3
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
leaq 0xe214(%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 0x4e90d
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/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::WriteDataSocket(char const*, unsigned int)
int64_t BamFtp::WriteDataSocket(const char* data, const unsigned int numBytes) {
    (void)data;
    (void)numBytes;
    BT_ASSERT_X(false, "BamFtp::WriteDataSocket: write-mode not supported on this device");
    SetErrorString("BamFtp::Write", "write-mode not supported on this device");
    return -1;
}

// Assembly:
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
leaq 0xe18c(%rip), %rsi      # 0x5cac3
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
leaq 0xe184(%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 0x4e99d
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::~BamHttp()
BamHttp::~BamHttp(void) {

    // close connection & clean up
    Close();
    if ( m_socket )
        delete m_socket;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x26285(%rip), %rax     # 0x74f98
addq $0x10, %rax
movq %rax, (%rdi)
callq 0x316e0
movq 0x30(%rbx), %r15
testq %r15, %r15
je 0x4ed38
movq %r15, %rdi
callq 0x31cb0
movq %r15, %rdi
callq 0x32fa0
leaq 0x78(%rbx), %rdi
callq 0x33a00
leaq 0x58(%rbx), %rdi
callq 0x33a00
leaq 0x38(%rbx), %rdi
callq 0x33a00
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x319e0
movq %rax, %r14
movq %r15, %rdi
callq 0x32fa0
jmp 0x4ed7f
movq %rax, %r14
jmp 0x4ed9a
movq %rax, %r14
jmp 0x4ed91
movq %rax, %r14
jmp 0x4ed88
movq %rax, %r14
leaq 0x78(%rbx), %rdi
callq 0x33a00
leaq 0x58(%rbx), %rdi
callq 0x33a00
leaq 0x38(%rbx), %rdi
callq 0x33a00
movq %rbx, %rdi
callq 0x319e0
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/BamHttp_p.cpp
// Function: BamTools::Internal::BamHttp::DisconnectSocket()
void BamHttp::DisconnectSocket(void) {

    // disconnect socket & clean up
    m_socket->DisconnectFromHost();
    ClearResponse();
    if ( m_request )  {
        delete m_request;
        m_request = 0;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x34f10
movq %rbx, %rdi
callq 0x321a0
movq 0x98(%rbx), %rdi
testq %rdi, %rdi
je 0x4ee59
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, 0x98(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/BamHttp_p.cpp
// Function: BamTools::Internal::BamHttp::ConnectSocket()
bool BamHttp::ConnectSocket(void) {

    BT_ASSERT_X(m_socket, "null socket?");

    // any state checks, etc?
    if ( !m_socket->ConnectToHost(m_hostname, m_port, m_mode) ) {
        SetErrorString("BamHttp::ConnectSocket", m_socket->GetErrorString());
        return false;
    }

    // return success
    return true;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r14
movq 0x30(%rdi), %rdi
leaq 0x38(%r14), %rsi
leaq 0x58(%r14), %rdx
movl 0x8(%r14), %ecx
callq 0x32040
movl %eax, %ebx
testb %al, %al
jne 0x4eecb
leaq 0xdcd7(%rip), %rsi      # 0x5cb5f
leaq 0x28(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x31b30
movq 0x30(%r14), %rsi
leaq 0x8(%rsp), %rdi
callq 0x337f0
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x34ab0
leaq 0x8(%rsp), %rdi
callq 0x33a00
leaq 0x28(%rsp), %rdi
callq 0x33a00
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x4eee7
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x33a00
movq %rbx, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
nop