LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/index/BamStandardIndex_p.cpp
// Function: BamTools::Internal::BamStandardIndex::SummarizeBins(BamTools::Internal::BaiReferenceSummary&)
void BamStandardIndex::SummarizeBins(BaiReferenceSummary& refSummary) {

    // load number of bins
    int numBins;
    ReadNumBins(numBins);

    // store bins summary for this reference
    refSummary.NumBins = numBins;
    refSummary.FirstBinFilePosition = Tell();

    // skip this reference's bins
    SkipBins(numBins);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xc(%rsp), %r15
movq %r15, %rsi
callq 0x27730
movl (%r15), %eax
movl %eax, (%r14)
movq 0x58(%rbx), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movq %rax, 0x8(%r14)
cmpl $0x0, (%r15)
jle 0x40ddf
xorl %ebp, %ebp
leaq 0x14(%rsp), %r14
leaq 0x10(%rsp), %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x27860
incl %ebp
cmpl 0xc(%rsp), %ebp
jl 0x40dc9
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/index/BamStandardIndex_p.cpp
// Function: BamTools::Internal::BamStandardIndex::WriteAlignmentChunk(BamTools::Internal::BaiAlignmentChunk const&)
void BamStandardIndex::WriteAlignmentChunk(const BaiAlignmentChunk& chunk) {

    // localize alignment chunk offsets
    uint64_t start = chunk.Start;
    uint64_t stop  = chunk.Stop;

    // swap endian-ness if necessary
    if ( m_isBigEndian ) {
        SwapEndian_64(start);
        SwapEndian_64(stop);
    }

    // write to index file
    int64_t numBytesWritten = 0;
    numBytesWritten += m_resources.Device->Write((const char*)&start, sizeof(start));
    numBytesWritten += m_resources.Device->Write((const char*)&stop, sizeof(stop));
    if ( numBytesWritten != (sizeof(start)+sizeof(stop)) )
        throw BamException("BamStandardIndex::WriteAlignmentChunk", "could not write BAI alignment chunk");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
movq (%rsi), %rcx
movq %rcx, 0x8(%rsp)
movq 0x8(%rsi), %rax
movq %rax, (%rsp)
cmpb $0x1, 0x30(%rdi)
jne 0x40e90
bswapq %rcx
movq %rcx, 0x8(%rsp)
bswapq %rax
movq %rax, (%rsp)
movq 0x58(%rbx), %rdi
movq (%rdi), %rax
leaq 0x8(%rsp), %rsi
movl $0x8, %edx
callq *0x40(%rax)
movq %rax, %r14
movq 0x58(%rbx), %rdi
movq (%rdi), %rax
movq %rsp, %rsi
movl $0x8, %edx
callq *0x40(%rax)
addq %r14, %rax
cmpq $0x10, %rax
jne 0x40ecf
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x269d0
movq %rax, %rbx
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x153d0(%rip), %rsi     # 0x562bc
leaq 0x153ee(%rip), %rdx     # 0x562e1
leaq 0x10(%rsp), %rdi
callq 0x26750
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x153d4(%rip), %rsi     # 0x562e2
leaq 0x153f0(%rip), %rdx     # 0x56305
leaq 0x30(%rsp), %rdi
callq 0x26750
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x28480
xorl %ebp, %ebp
movq 0x29ffb(%rip), %rsi     # 0x6af38
movq 0x2a034(%rip), %rdx     # 0x6af78
movq %rbx, %rdi
callq 0x28a20
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x40f5e
callq 0x27560
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x40f6d
callq 0x27560
testb %bpl, %bpl
jne 0x40f8b
jmp 0x40f93
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x40f8b
callq 0x27560
jmp 0x40f8b
movq %rax, %r14
movq %rbx, %rdi
callq 0x27070
movq %r14, %rdi
callq 0x28c10
nop
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/index/BamStandardIndex_p.cpp
// Function: BamTools::Internal::BamStandardIndex::WriteAlignmentChunks(std::vector<BamTools::Internal::BaiAlignmentChunk, std::allocator<BamTools::Internal::BaiAlignmentChunk>>&)
void BamStandardIndex::WriteAlignmentChunks(BaiAlignmentChunkVector& chunks) {

    // make sure chunks are merged (simplified) before writing & saving summary
    MergeAlignmentChunks(chunks);

    // write chunks
    int32_t chunkCount = chunks.size();
    if ( m_isBigEndian ) SwapEndian_32(chunkCount);
    const int64_t numBytesWritten = m_resources.Device->Write((const char*)&chunkCount, sizeof(chunkCount));
    if ( numBytesWritten != sizeof(chunkCount) )
        throw BamException("BamStandardIndex::WriteAlignmentChunks", "could not write BAI chunk count");

    // iterate over chunks
    BaiAlignmentChunkVector::const_iterator chunkIter = chunks.begin();
    BaiAlignmentChunkVector::const_iterator chunkEnd  = chunks.end();
    for ( ; chunkIter != chunkEnd; ++chunkIter )
        WriteAlignmentChunk( (*chunkIter) );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x29020
movq 0x8(%r14), %rax
subq (%r14), %rax
shrq $0x4, %rax
movl %eax, 0xc(%rsp)
cmpb $0x1, 0x30(%rbx)
jne 0x40ff0
movl %eax, %ecx
sarl $0x18, %ecx
movl %eax, %edx
shll $0x8, %edx
andl $0xff0000, %edx         # imm = 0xFF0000
movl %eax, %esi
shrl $0x8, %esi
andl $0xff00, %esi           # imm = 0xFF00
shll $0x18, %eax
orl %ecx, %eax
orl %edx, %eax
orl %esi, %eax
movl %eax, 0xc(%rsp)
movq 0x58(%rbx), %rdi
movq (%rdi), %rax
leaq 0xc(%rsp), %rsi
movl $0x4, %edx
callq *0x40(%rax)
cmpq $0x4, %rax
jne 0x41034
movq (%r14), %r15
movq 0x8(%r14), %r14
cmpq %r14, %r15
je 0x41027
movq %rbx, %rdi
movq %r15, %rsi
callq 0x290b0
addq $0x10, %r15
jmp 0x41011
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x269d0
movq %rax, %rbx
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x152b5(%rip), %rsi     # 0x56306
leaq 0x152d4(%rip), %rdx     # 0x5632c
leaq 0x10(%rsp), %rdi
callq 0x26750
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x152ba(%rip), %rsi     # 0x5632d
leaq 0x152d2(%rip), %rdx     # 0x5634c
leaq 0x30(%rsp), %rdi
callq 0x26750
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x28480
xorl %ebp, %ebp
movq 0x29e96(%rip), %rsi     # 0x6af38
movq 0x29ecf(%rip), %rdx     # 0x6af78
movq %rbx, %rdi
callq 0x28a20
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x410c3
callq 0x27560
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x410d2
callq 0x27560
testb %bpl, %bpl
jne 0x410f0
jmp 0x410f8
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x410f0
callq 0x27560
jmp 0x410f0
movq %rax, %r14
movq %rbx, %rdi
callq 0x27070
movq %r14, %rdi
callq 0x28c10
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/index/BamStandardIndex_p.cpp
// Function: BamTools::Internal::BamStandardIndex::WriteBin(unsigned int const&, std::vector<BamTools::Internal::BaiAlignmentChunk, std::allocator<BamTools::Internal::BaiAlignmentChunk>>&)
void BamStandardIndex::WriteBin(const uint32_t& binId, BaiAlignmentChunkVector& chunks) {

    // write BAM bin ID
    uint32_t binKey = binId;
    if ( m_isBigEndian ) SwapEndian_32(binKey);
    const int64_t numBytesWritten = m_resources.Device->Write((const char*)&binKey, sizeof(binKey));
    if ( numBytesWritten != sizeof(binKey) )
        throw BamException("BamStandardIndex::WriteBin", "could not write bin ID");

    // write bin's alignment chunks
    WriteAlignmentChunks(chunks);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movl (%rsi), %eax
movl %eax, 0xc(%rsp)
cmpb $0x1, 0x30(%rdi)
jne 0x41124
bswapl %eax
movl %eax, 0xc(%rsp)
movq 0x58(%r14), %rdi
movq (%rdi), %rax
leaq 0xc(%rsp), %rsi
movl $0x4, %edx
callq *0x40(%rax)
cmpq $0x4, %rax
jne 0x41156
movq %r14, %rdi
movq %rbx, %rsi
callq 0x28910
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x269d0
movq %rax, %rbx
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x151da(%rip), %rsi     # 0x5634d
leaq 0x151ed(%rip), %rdx     # 0x56367
leaq 0x10(%rsp), %rdi
callq 0x26750
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x151d3(%rip), %rsi     # 0x56368
leaq 0x151e2(%rip), %rdx     # 0x5637e
leaq 0x30(%rsp), %rdi
callq 0x26750
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x28480
xorl %ebp, %ebp
movq 0x29d74(%rip), %rsi     # 0x6af38
movq 0x29dad(%rip), %rdx     # 0x6af78
movq %rbx, %rdi
callq 0x28a20
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x411e5
callq 0x27560
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x411f4
callq 0x27560
testb %bpl, %bpl
jne 0x41212
jmp 0x4121a
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x41212
callq 0x27560
jmp 0x41212
movq %rax, %r14
movq %rbx, %rdi
callq 0x27070
movq %r14, %rdi
callq 0x28c10
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/index/BamStandardIndex_p.cpp
// Function: BamTools::Internal::BamStandardIndex::WriteBins(int const&, std::map<unsigned int, std::vector<BamTools::Internal::BaiAlignmentChunk, std::allocator<BamTools::Internal::BaiAlignmentChunk>>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::vector<BamTools::Internal::BaiAlignmentChunk, std::allocator<BamTools::Internal::BaiAlignmentChunk>>>>>&)
void BamStandardIndex::WriteBins(const int& refId, BaiBinMap& bins) {

    // write number of bins
    int32_t binCount = bins.size();
    if ( m_isBigEndian ) SwapEndian_32(binCount);
    const int64_t numBytesWritten = m_resources.Device->Write((const char*)&binCount, sizeof(binCount));
    if ( numBytesWritten != sizeof(binCount) )
        throw BamException("BamStandardIndex::WriteBins", "could not write bin count");

    // save summary for reference's bins
    SaveBinsSummary(refId, bins.size());

    // iterate over bins
    BaiBinMap::iterator binIter = bins.begin();
    BaiBinMap::iterator binEnd  = bins.end();
    for ( ; binIter != binEnd; ++binIter )
        WriteBin( (*binIter).first, (*binIter).second );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl 0x28(%rdx), %eax
movl %eax, 0xc(%rsp)
cmpb $0x1, 0x30(%rdi)
jne 0x4126c
movl %eax, %ecx
sarl $0x18, %ecx
movl %eax, %edx
shll $0x8, %edx
andl $0xff0000, %edx         # imm = 0xFF0000
movl %eax, %esi
shrl $0x8, %esi
andl $0xff00, %esi           # imm = 0xFF00
shll $0x18, %eax
orl %ecx, %eax
orl %edx, %eax
orl %esi, %eax
movl %eax, 0xc(%rsp)
movq 0x58(%r14), %rdi
movq (%rdi), %rax
leaq 0xc(%rsp), %rsi
movl $0x4, %edx
callq *0x40(%rax)
cmpq $0x4, %rax
jne 0x412d5
movl 0x28(%rbx), %eax
leaq 0x10(%rsp), %rdx
movl %eax, (%rdx)
movq %r14, %rdi
movq %r15, %rsi
callq 0x262e0
movq 0x18(%rbx), %r15
addq $0x8, %rbx
cmpq %rbx, %r15
je 0x412c8
leaq 0x20(%r15), %rsi
leaq 0x28(%r15), %rdx
movq %r14, %rdi
callq 0x28410
movq %r15, %rdi
callq 0x27030
movq %rax, %r15
cmpq %rbx, %rax
jne 0x412a8
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x269d0
movq %rax, %rbx
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1508d(%rip), %rsi     # 0x5637f
leaq 0x150a1(%rip), %rdx     # 0x5639a
leaq 0x10(%rsp), %rdi
callq 0x26750
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x15087(%rip), %rsi     # 0x5639b
leaq 0x15099(%rip), %rdx     # 0x563b4
leaq 0x30(%rsp), %rdi
callq 0x26750
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x28480
xorl %ebp, %ebp
movq 0x29bf5(%rip), %rsi     # 0x6af38
movq 0x29c2e(%rip), %rdx     # 0x6af78
movq %rbx, %rdi
callq 0x28a20
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x41364
callq 0x27560
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x41373
callq 0x27560
testb %bpl, %bpl
jne 0x41391
jmp 0x41399
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x41391
callq 0x27560
jmp 0x41391
movq %rax, %r14
movq %rbx, %rdi
callq 0x27070
movq %r14, %rdi
callq 0x28c10
nop
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::RaiiWrapper::~RaiiWrapper()
BamToolsIndex::RaiiWrapper::~RaiiWrapper(void) {
    if ( Device ) {
        Device->Close();
        delete Device;
        Device = 0;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x42abb
movq (%rdi), %rax
callq *0x10(%rax)
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x42ab4
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, (%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::CloseFile()
void BamToolsIndex::CloseFile(void) {
    if ( IsDeviceOpen() ) {
        m_resources.Device->Close();
        delete m_resources.Device;
        m_resources.Device = 0;
    }
    m_indexFileSummary.clear();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
testq %rdi, %rdi
je 0x42c3e
movq (%rdi), %rax
callq *0x50(%rax)
testb %al, %al
je 0x42c3e
movq 0x60(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x42c36
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x60(%rbx)
movq 0x38(%rbx), %rax
cmpq %rax, 0x40(%rbx)
je 0x42c4c
movq %rax, 0x40(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::CheckMagicNumber()
void BamToolsIndex::CheckMagicNumber(void) {

    // read magic number
    char magic[4];
    const int64_t numBytesRead = m_resources.Device->Read(magic, 4);
    if ( numBytesRead != 4 )
        throw BamException("BamToolsIndex::CheckMagicNumber", "could not read BTI magic number");

    // validate expected magic number
    if ( strncmp(magic, BamToolsIndex::BTI_MAGIC, 4) != 0 )
        throw BamException("BamToolsIndex::CheckMagicNumber", "invalid BTI magic number");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq 0x60(%rdi), %rdi
movq (%rdi), %rax
leaq 0xc(%rsp), %rsi
movl $0x4, %edx
callq *0x28(%rax)
cmpq $0x4, %rax
jne 0x42cbd
cmpl $0x1495442, 0xc(%rsp)   # imm = 0x1495442
jne 0x42d3c
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x269d0
movq %rax, %rbx
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x137bb(%rip), %rsi     # 0x56495
leaq 0x137d3(%rip), %rdx     # 0x564b4
leaq 0x10(%rsp), %rdi
callq 0x26750
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x137b9(%rip), %rsi     # 0x564b5
leaq 0x137d1(%rip), %rdx     # 0x564d4
leaq 0x30(%rsp), %rdi
callq 0x26750
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x28480
xorl %ebp, %ebp
movq 0x2820d(%rip), %rsi     # 0x6af38
movq 0x28246(%rip), %rdx     # 0x6af78
movq %rbx, %rdi
callq 0x28a20
jmp 0x42db9
movl $0x28, %edi
callq 0x269d0
movq %rax, %rbx
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1373c(%rip), %rsi     # 0x56495
leaq 0x13754(%rip), %rdx     # 0x564b4
leaq 0x10(%rsp), %rdi
callq 0x26750
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1375a(%rip), %rsi     # 0x564d5
leaq 0x1376b(%rip), %rdx     # 0x564ed
leaq 0x30(%rsp), %rdi
callq 0x26750
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x28480
xorl %ebp, %ebp
movq 0x2818e(%rip), %rsi     # 0x6af38
movq 0x281c7(%rip), %rdx     # 0x6af78
movq %rbx, %rdi
callq 0x28a20
jmp 0x42dbd
jmp 0x42de5
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x42dcf
callq 0x27560
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x42dde
callq 0x27560
testb %bpl, %bpl
jne 0x42dfe
jmp 0x42e06
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x42dfe
callq 0x27560
jmp 0x42dfe
jmp 0x42dfb
movq %rax, %r14
movq %rbx, %rdi
callq 0x27070
movq %r14, %rdi
callq 0x28c10
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::WriteReferenceEntry(BamTools::Internal::BtiReferenceEntry const&)
void BamToolsIndex::WriteReferenceEntry(const BtiReferenceEntry& refEntry) {

    // write number of blocks this reference
    uint32_t numBlocks = refEntry.Blocks.size();
    if ( m_isBigEndian ) SwapEndian_32(numBlocks);
    const int64_t numBytesWritten = m_resources.Device->Write((const char*)&numBlocks, sizeof(numBlocks));
    if ( numBytesWritten != sizeof(numBlocks) )
        throw BamException("BamToolsIndex::WriteReferenceEntry", "could not write number of blocks");

    // write actual block entries
    WriteBlocks(refEntry.Blocks);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rsi), %rax
subq 0x8(%rsi), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
movl %eax, 0xc(%rsp)
cmpb $0x1, 0x30(%rdi)
jne 0x43d28
bswapl %eax
movl %eax, 0xc(%rsp)
movq 0x60(%rbx), %rdi
movq (%rdi), %rax
leaq 0xc(%rsp), %rsi
movl $0x4, %edx
callq *0x40(%rax)
cmpq $0x4, %rax
jne 0x43d6d
movq 0x8(%r14), %r15
movq 0x10(%r14), %r14
cmpq %r14, %r15
je 0x43d60
movq %rbx, %rdi
movq %r15, %rsi
callq 0x26910
addq $0x18, %r15
jmp 0x43d4a
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x269d0
movq %rax, %rbx
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x12b11(%rip), %rsi     # 0x5689b
leaq 0x12b2c(%rip), %rdx     # 0x568bd
leaq 0x10(%rsp), %rdi
callq 0x26750
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x12b12(%rip), %rsi     # 0x568be
leaq 0x12b2b(%rip), %rdx     # 0x568de
leaq 0x30(%rsp), %rdi
callq 0x26750
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x28480
xorl %ebp, %ebp
movq 0x2715d(%rip), %rsi     # 0x6af38
movq 0x27196(%rip), %rdx     # 0x6af78
movq %rbx, %rdi
callq 0x28a20
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x43dfc
callq 0x27560
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x43e0b
callq 0x27560
testb %bpl, %bpl
jne 0x43e29
jmp 0x43e31
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x43e29
callq 0x27560
jmp 0x43e29
movq %rax, %r14
movq %rbx, %rdi
callq 0x27070
movq %r14, %rdi
callq 0x28c10
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rcx
movslq (%rsi), %rsi
testq %rsi, %rsi
js 0x44077
movq 0x38(%rdi), %rax
movq 0x40(%rdi), %rdx
subq %rax, %rdx
sarq $0x4, %rdx
cmpl %edx, %esi
jge 0x44077
cmpq %rsi, %rdx
jbe 0x440f0
shlq $0x4, %rsi
addq %rsi, %rax
addq $0x8, %rcx
movq %rax, %rsi
movq %rcx, %rdx
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x280d0
movl $0x28, %edi
callq 0x269d0
movq %rax, %rbx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1274b(%rip), %rsi     # 0x567df
leaq 0x12765(%rip), %rdx     # 0x56800
movq %rsp, %rdi
callq 0x26750
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1274d(%rip), %rsi     # 0x56801
leaq 0x12761(%rip), %rdx     # 0x5681c
leaq 0x20(%rsp), %rdi
callq 0x26750
movb $0x1, %bpl
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x28480
xorl %ebp, %ebp
movq 0x26e57(%rip), %rsi     # 0x6af38
movq 0x26e90(%rip), %rdx     # 0x6af78
movq %rbx, %rdi
callq 0x28a20
leaq 0x111ab(%rip), %rdi     # 0x552a2
xorl %eax, %eax
callq 0x284e0
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x44110
callq 0x27560
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x4411e
callq 0x27560
testb %bpl, %bpl
jne 0x4413b
jmp 0x44143
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x4413b
callq 0x27560
jmp 0x4413b
movq %rax, %r14
movq %rbx, %rdi
callq 0x27070
movq %r14, %rdi
callq 0x28c10
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x44178
movq 0x38(%rdi), %rax
movq 0x40(%rdi), %rdx
subq %rax, %rdx
sarq $0x4, %rdx
cmpl %edx, %esi
jge 0x44178
cmpq %rsi, %rdx
jbe 0x4417b
shlq $0x4, %rsi
cmpl $0x0, (%rax,%rsi)
setg %al
retq
xorl %eax, %eax
retq
pushq %rax
leaq 0x1111f(%rip), %rdi     # 0x552a2
xorl %eax, %eax
callq 0x284e0
// File: /workspace/github_cpp_makefile_star2_O3/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
movl $0x1, %edx
callq 0x26d80
movq %rbx, %rdi
callq 0x27b60
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x27f20
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
cmpl $0x1, %edx
jne 0x443e6
movq %r14, %rdi
callq 0x267d0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
addq $0x10, %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x27ff0
callq 0x287d0
xorl %ebp, %ebp
jmp 0x443a6
movq %rax, %r14
callq 0x287d0
movq %r14, %rdi
callq 0x28c10
movq %rax, %rdi
callq 0x2f047
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdi, %r14
callq 0x28a70
movq %r14, %rdi
callq 0x28b60
movq 0x60(%r14), %rdi
leaq 0x50(%r14), %rbx
movq (%rdi), %rax
movq %rbx, %rsi
movl $0x4, %edx
callq *0x28(%rax)
cmpb $0x1, 0x30(%r14)
jne 0x44435
movl (%rbx), %ecx
bswapl %ecx
movl %ecx, (%rbx)
cmpq $0x4, %rax
jne 0x44448
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x269d0
movq %rax, %rbx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x12276(%rip), %rsi     # 0x566db
leaq 0x12288(%rip), %rdx     # 0x566f4
movq %rsp, %rdi
callq 0x26750
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x12270(%rip), %rsi     # 0x566f5
leaq 0x12286(%rip), %rdx     # 0x56712
leaq 0x20(%rsp), %rdi
callq 0x26750
movb $0x1, %bpl
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x28480
xorl %ebp, %ebp
movq 0x26a86(%rip), %rsi     # 0x6af38
movq 0x26abf(%rip), %rdx     # 0x6af78
movq %rbx, %rdi
callq 0x28a20
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x444d3
callq 0x27560
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x444e1
callq 0x27560
testb %bpl, %bpl
jne 0x444fe
jmp 0x44506
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x444fe
callq 0x27560
jmp 0x444fe
movq %rax, %r14
movq %rbx, %rdi
callq 0x27070
movq %r14, %rdi
callq 0x28c10
// File: /workspace/github_cpp_makefile_star2_O3/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 0x28ca0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x28cc0
movq 0x38(%rbx), %r14
movq 0x40(%rbx), %r15
cmpq %r15, %r14
je 0x44550
movq %rbx, %rdi
movq %r14, %rsi
callq 0x27220
addq $0x10, %r14
jmp 0x4453a
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x60(%rdi), %rdi
movq (%rdi), %rax
movl $0x4, %edx
callq *0x28(%rax)
cmpb $0x1, 0x30(%r14)
jne 0x445aa
movl (%rbx), %ecx
movl %ecx, %edx
sarl $0x18, %edx
movl %ecx, %esi
shll $0x8, %esi
andl $0xff0000, %esi         # imm = 0xFF0000
movl %ecx, %edi
shrl $0x8, %edi
andl $0xff00, %edi           # imm = 0xFF00
shll $0x18, %ecx
orl %edx, %ecx
orl %esi, %ecx
orl %edi, %ecx
movl %ecx, (%rbx)
cmpq $0x4, %rax
jne 0x445bd
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x269d0
movq %rax, %rbx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1217a(%rip), %rsi     # 0x56754
leaq 0x12193(%rip), %rdx     # 0x56774
movq %rsp, %rdi
callq 0x26750
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1217b(%rip), %rsi     # 0x56775
leaq 0x12197(%rip), %rdx     # 0x56798
leaq 0x20(%rsp), %rdi
callq 0x26750
movb $0x1, %bpl
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x28480
xorl %ebp, %ebp
movq 0x26911(%rip), %rsi     # 0x6af38
movq 0x2694a(%rip), %rdx     # 0x6af78
movq %rbx, %rdi
callq 0x28a20
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x44648
callq 0x27560
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x44656
callq 0x27560
testb %bpl, %bpl
jne 0x44673
jmp 0x4467b
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x44673
callq 0x27560
jmp 0x44673
movq %rax, %r14
movq %rbx, %rdi
callq 0x27070
movq %r14, %rdi
callq 0x28c10
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x60(%rdi), %rdi
movq (%rdi), %rax
movl $0x4, %edx
callq *0x28(%rax)
cmpb $0x1, 0x30(%r14)
jne 0x4472a
movl (%rbx), %ecx
movl %ecx, %edx
sarl $0x18, %edx
movl %ecx, %esi
shll $0x8, %esi
andl $0xff0000, %esi         # imm = 0xFF0000
movl %ecx, %edi
shrl $0x8, %edi
andl $0xff00, %edi           # imm = 0xFF00
shll $0x18, %ecx
orl %edx, %ecx
orl %esi, %ecx
orl %edi, %ecx
movl %ecx, (%rbx)
cmpq $0x4, %rax
jne 0x4473d
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x269d0
movq %rax, %rbx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x11fb9(%rip), %rsi     # 0x56713
leaq 0x11fce(%rip), %rdx     # 0x5672f
movq %rsp, %rdi
callq 0x26750
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x11fb6(%rip), %rsi     # 0x56730
leaq 0x11fd2(%rip), %rdx     # 0x56753
leaq 0x20(%rsp), %rdi
callq 0x26750
movb $0x1, %bpl
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x28480
xorl %ebp, %ebp
movq 0x26791(%rip), %rsi     # 0x6af38
movq 0x267ca(%rip), %rdx     # 0x6af78
movq %rbx, %rdi
callq 0x28a20
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x447c8
callq 0x27560
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x447d6
callq 0x27560
testb %bpl, %bpl
jne 0x447f3
jmp 0x447fb
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x447f3
callq 0x27560
jmp 0x447f3
movq %rax, %r14
movq %rbx, %rdi
callq 0x27070
movq %r14, %rdi
callq 0x28c10
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x44a56
movq %rax, 0x8(%rbx)
movslq (%r14), %rsi
movq %rbx, %rdi
callq 0x28d80
movq 0x8(%r14), %rax
leaq 0x8(%rsp), %r12
movq %rax, (%r12)
xorl %ebp, %ebp
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x279c0
movl %ebp, (%r12)
movq $0x0, 0x8(%r12)
movl %ebp, 0x10(%r12)
cmpl %ebp, (%r14)
jle 0x44ad8
leaq 0x8(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x280b0
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x44ac6
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsi)
movups 0x8(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, 0x8(%rbx)
jmp 0x44ad1
movq %rbx, %rdi
movq %r12, %rdx
callq 0x26100
incl %ebp
cmpl (%r14), %ebp
jl 0x44a99
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/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 0x11729(%rip), %rsi     # 0x568df
callq 0x264c0
testl %eax, %eax
je 0x45235
leaq 0x1171b(%rip), %rsi     # 0x568e1
movq %rbx, %rdi
callq 0x264c0
testl %eax, %eax
je 0x45235
leaq 0x1170e(%rip), %rsi     # 0x568e7
movq %rbx, %rdi
callq 0x264c0
testl %eax, %eax
je 0x45235
leaq 0x11702(%rip), %rsi     # 0x568ee
movl $0x7, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x28af0
testq %rax, %rax
je 0x45255
leaq 0x116ef(%rip), %rsi     # 0x568f6
movl $0x6, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x28af0
testq %rax, %rax
je 0x4526f
movl $0x58, %edi
callq 0x276b0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x27990
jmp 0x4524a
movl $0x38, %edi
callq 0x276b0
movq %rax, %r14
movq %rax, %rdi
callq 0x26e10
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0xc8, %edi
callq 0x276b0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x278e0
jmp 0x4524a
movl $0x120, %edi            # imm = 0x120
callq 0x276b0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x280c0
jmp 0x4524a
jmp 0x4528f
jmp 0x4528f
jmp 0x4528f
movq %rax, %rbx
movq %r14, %rdi
callq 0x27560
movq %rbx, %rdi
callq 0x28c10
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x254b3(%rip), %rax     # 0x6afd0
addq $0x10, %rax
movq %rax, (%rdi)
callq 0x26670
movq 0x30(%rbx), %r15
testq %r15, %r15
je 0x45b42
movq %r15, %rdi
callq 0x26880
movq %r15, %rdi
callq 0x27560
movq 0x38(%rbx), %r15
testq %r15, %r15
je 0x45b5b
movq %r15, %rdi
callq 0x26880
movq %r15, %rdi
callq 0x27560
movq 0xf0(%rbx), %rdi
leaq 0x100(%rbx), %rax
cmpq %rax, %rdi
je 0x45b73
callq 0x27560
movq 0xd0(%rbx), %rdi
leaq 0xe0(%rbx), %rax
cmpq %rax, %rdi
je 0x45b8b
callq 0x27560
movq 0xb0(%rbx), %rdi
leaq 0xc0(%rbx), %rax
cmpq %rax, %rdi
je 0x45ba3
callq 0x27560
movq 0x90(%rbx), %rdi
leaq 0xa0(%rbx), %rax
cmpq %rax, %rdi
je 0x45bbb
callq 0x27560
movq 0x68(%rbx), %rdi
leaq 0x78(%rbx), %rax
cmpq %rax, %rdi
je 0x45bcd
callq 0x27560
movq 0x40(%rbx), %rdi
leaq 0x50(%rbx), %rax
cmpq %rax, %rdi
je 0x45bdf
callq 0x27560
movq 0x25332(%rip), %rax     # 0x6af18
addq $0x10, %rax
movq %rax, (%rbx)
movq 0x10(%rbx), %rdi
addq $0x20, %rbx
cmpq %rbx, %rdi
je 0x45c04
popq %rbx
popq %r14
popq %r15
jmp 0x27560
popq %rbx
popq %r14
popq %r15
retq
jmp 0x45c0c
movq %rax, %r14
movq %r15, %rdi
callq 0x27560
jmp 0x45c1c
movq %rax, %r14
movq 0xf0(%rbx), %rdi
leaq 0x100(%rbx), %rax
cmpq %rax, %rdi
je 0x45c34
callq 0x27560
movq 0xd0(%rbx), %rdi
leaq 0xe0(%rbx), %rax
cmpq %rax, %rdi
je 0x45c4c
callq 0x27560
movq 0xb0(%rbx), %rdi
leaq 0xc0(%rbx), %rax
cmpq %rax, %rdi
je 0x45c64
callq 0x27560
movq 0x90(%rbx), %rdi
leaq 0xa0(%rbx), %rax
cmpq %rax, %rdi
je 0x45c7c
callq 0x27560
movq 0x68(%rbx), %rdi
leaq 0x78(%rbx), %rax
cmpq %rax, %rdi
je 0x45c8e
callq 0x27560
movq 0x40(%rbx), %rdi
leaq 0x50(%rbx), %rax
cmpq %rax, %rdi
je 0x45ca0
callq 0x27560
movq 0x25271(%rip), %rax     # 0x6af18
addq $0x10, %rax
movq %rax, (%rbx)
movq 0x10(%rbx), %rdi
addq $0x20, %rbx
cmpq %rbx, %rdi
je 0x45cc0
callq 0x27560
movq %r14, %rdi
callq 0x28c10
// File: /workspace/github_cpp_makefile_star2_O3/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 0x28c40
movq 0x38(%rbx), %rdi
callq 0x28c40
xorl %ebp, %ebp
movb %bpl, 0x110(%rbx)
movq $-0x1, 0x118(%rbx)
leaq 0xb0(%rbx), %rdi
leaq 0x27980(%rip), %rsi     # 0x6d6b0
callq 0x26b80
leaq 0xd0(%rbx), %rdi
leaq 0x2798d(%rip), %rsi     # 0x6d6d0
callq 0x26b80
movq $0x0, 0x70(%rbx)
movq 0x68(%rbx), %rax
movb %bpl, (%rax)
movw $0x0, 0x88(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x27370
testb %al, %al
je 0x463e7
movq (%r14), %rsi
movl 0x8(%r14), %edx
movq %rbx, %rdi
callq 0x26ef0
cmpq $-0x1, %rax
je 0x4643d
movb $0x1, %al
testb %bpl, %bpl
je 0x464b1
movq %rbx, %rdi
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x27af0
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x10681(%rip), %rsi     # 0x56a78
leaq 0x1068d(%rip), %rdx     # 0x56a8b
leaq 0x28(%rsp), %rdi
callq 0x26750
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x10613(%rip), %rsi     # 0x56a2b
leaq 0x10628(%rip), %rdx     # 0x56a47
leaq 0x8(%rsp), %rdi
callq 0x26750
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x288b0
jmp 0x46491
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1062b(%rip), %rsi     # 0x56a78
leaq 0x10637(%rip), %rdx     # 0x56a8b
leaq 0x28(%rsp), %rdi
callq 0x26750
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1061e(%rip), %rsi     # 0x56a8c
leaq 0x1062e(%rip), %rdx     # 0x56aa3
leaq 0x8(%rsp), %rdi
callq 0x26750
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x288b0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x464a0
callq 0x27560
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x464af
callq 0x27560
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x464c2
jmp 0x464d6
jmp 0x464ea
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x464d9
callq 0x27560
jmp 0x464d9
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x464ed
callq 0x27560
jmp 0x464ed
movq %rax, %rbx
movq %rbx, %rdi
callq 0x28c10
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
cmpl $0x1, %esi
jne 0x46d8e
movl $0x1, 0x8(%rbx)
movq $0x0, 0x118(%rbx)
movq %rbx, %rdi
callq 0x26380
testb %al, %al
je 0x46dfb
movq %rbx, %rdi
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x28da0
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xfc41(%rip), %rsi      # 0x569df
leaq 0xfc46(%rip), %rdx      # 0x569eb
leaq 0x20(%rsp), %rdi
callq 0x26750
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xfc2d(%rip), %rsi      # 0x569ec
leaq 0xfc4d(%rip), %rdx      # 0x56a13
movq %rsp, %rdi
callq 0x26750
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x288b0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x46dec
callq 0x27560
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x46dfb
callq 0x27560
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x46e1d
callq 0x27560
jmp 0x46e1d
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x46e2c
callq 0x27560
movq %rbx, %rdi
callq 0x28c10
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rax
callq *0x50(%rax)
testb %al, %al
je 0x46e9c
testl %ebx, %ebx
je 0x46ea5
movl %ebx, %r13d
xorl %r12d, %r12d
movq 0x38(%r15), %rdi
callq 0x27370
testb %al, %al
jne 0x46e72
movq %r15, %rdi
callq 0x28da0
testb %al, %al
je 0x46e9c
leaq (%r14,%r12), %rsi
movl %ebx, %edx
subl %r12d, %edx
movq 0x38(%r15), %rdi
callq 0x26bd0
testq %rax, %rax
js 0x46e9c
je 0x46ea8
addq %rax, %r12
addq %rax, 0x118(%r15)
cmpq %r13, %r12
jl 0x46e59
jmp 0x46ea8
movq $-0x1, %r12
jmp 0x46ea8
xorl %r12d, %r12d
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/io/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 0x46f07
movq 0x38(%rbx), %rdi
callq 0x28c40
movq 0x30(%rbx), %rdi
callq 0x28c40
testl %ebp, %ebp
je 0x46f0b
cmpl $0x1, %ebp
jne 0x46f07
movq (%r14), %rax
addq %rax, 0x118(%rbx)
jmp 0x46f15
xorl %eax, %eax
jmp 0x46f17
movq (%r14), %rax
movq %rax, 0x118(%rbx)
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x27370
testb %al, %al
je 0x46f52
movq 0x30(%r15), %rdi
callq 0x28c50
movq 0x30(%r15), %rdi
movq %r14, %rsi
movl %ebx, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x26af0
movq $-0x1, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xfb08(%rip), %rsi      # 0x56aa4
leaq 0xfb0e(%rip), %rdx      # 0x56ab1
leaq 0x20(%rsp), %rdi
callq 0x26750
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xfaf5(%rip), %rsi      # 0x56ab2
leaq 0xfb15(%rip), %rdx      # 0x56ad9
movq %rsp, %rdi
callq 0x26750
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x288b0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x46fea
callq 0x27560
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x46ff9
callq 0x27560
movq $-0x1, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x47020
callq 0x27560
jmp 0x47020
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x4702f
callq 0x27560
movq %rbx, %rdi
callq 0x28c10
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xfa50(%rip), %rsi      # 0x56aa4
leaq 0xfa56(%rip), %rdx      # 0x56ab1
leaq 0x20(%rsp), %rdi
callq 0x26750
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xfa3d(%rip), %rsi      # 0x56ab2
leaq 0xfa5d(%rip), %rdx      # 0x56ad9
movq %rsp, %rdi
callq 0x26750
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x288b0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x470a2
callq 0x27560
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x470b1
callq 0x27560
movq $-0x1, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x470d8
callq 0x27560
jmp 0x470d8
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x470e7
callq 0x27560
movq %rbx, %rdi
callq 0x28c10
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x23aa1(%rip), %rax     # 0x6af98
addq $0x10, %rax
movq %rax, (%rdi)
callq 0x26b30
movb $0x0, 0xa8(%rbx)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0xb0(%rbx)
movq $-0x1, 0xc0(%rbx)
movl $0x0, 0x8(%rbx)
movq 0x30(%rbx), %r14
testq %r14, %r14
je 0x47541
movq %r14, %rdi
callq 0x26880
movq %r14, %rdi
callq 0x27560
movq 0x78(%rbx), %rdi
leaq 0x88(%rbx), %rax
cmpq %rax, %rdi
je 0x47556
callq 0x27560
movq 0x58(%rbx), %rdi
leaq 0x68(%rbx), %rax
cmpq %rax, %rdi
je 0x47568
callq 0x27560
movq 0x38(%rbx), %rdi
leaq 0x48(%rbx), %rax
cmpq %rax, %rdi
je 0x4757a
callq 0x27560
movq 0x23997(%rip), %rax     # 0x6af18
addq $0x10, %rax
movq %rax, (%rbx)
movq 0x10(%rbx), %rdi
addq $0x20, %rbx
cmpq %rbx, %rdi
je 0x4759f
popq %rbx
popq %r14
popq %r15
jmp 0x27560
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r15
movq %r14, %rdi
callq 0x27560
jmp 0x475b5
movq %rax, %r15
movq %rbx, %rdi
callq 0x29639
movq %r15, %rdi
callq 0x28c10
nop