LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamMultiReader_p.cpp
// Function: BamTools::Internal::BamMultiReaderPrivate::GetHeaderText[abi:cxx11]() const
string BamMultiReaderPrivate::GetHeaderText(void) const {

    // N.B. - right now, simply copies all header data from first BAM,
    //        and then appends RG's from other BAM files
    // TODO: make this more intelligent wrt other header lines/fields

    // if no readers open
    const size_t numReaders = m_readers.size();
    if ( numReaders == 0 ) return string();

    // retrieve first reader's header
    const MergeItem& firstItem = m_readers.front();
    const BamReader* reader = firstItem.Reader;
    if ( reader == 0 ) return string();
    SamHeader mergedHeader = reader->GetHeader();

    // iterate over any remaining readers (skipping the first)
    for ( size_t i = 1; i < numReaders; ++i ) {
        const MergeItem& item = m_readers.at(i);
        const BamReader* reader = item.Reader;
        if ( reader == 0 ) continue;

        // retrieve current reader's header
        const SamHeader currentHeader = reader->GetHeader();

        // append current reader's RG entries to merged header
        // N.B. - SamReadGroupDictionary handles duplicate-checking
        mergedHeader.ReadGroups.Add(currentHeader.ReadGroups);

        // TODO: merge anything else??
    }

    // return stringified header
    return mergedHeader.ToString();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
movq %rdi, %r15
movq (%rsi), %rax
movq 0x8(%rsi), %rbx
subq %rax, %rbx
je 0x35eb1
movq %rsi, %r14
movq (%rax), %rsi
testq %rsi, %rsi
je 0x35eb1
movq %r15, (%rsp)
sarq $0x4, %rbx
leaq 0x160(%rsp), %r15
movq %r15, %rdi
callq 0x27f80
cmpq $0x2, %rbx
jb 0x35e8e
movl $0xc0, %r13d
addq %r13, %r15
leaq 0x8(%rsp), %rax
addq %rax, %r13
movl $0x1, %r12d
movl $0x10, %ebp
movq (%r14), %rax
movq 0x8(%r14), %rdx
subq %rax, %rdx
sarq $0x4, %rdx
cmpq %r12, %rdx
jbe 0x35eda
movq (%rax,%rbp), %rsi
testq %rsi, %rsi
je 0x35e82
leaq 0x8(%rsp), %rdi
callq 0x27f80
movq %r15, %rdi
movq %r13, %rsi
callq 0x28fb0
leaq 0x8(%rsp), %rdi
callq 0x275d0
incq %r12
addq $0x10, %rbp
cmpq %r12, %rbx
jne 0x35e43
leaq 0x160(%rsp), %rsi
movq (%rsp), %r15
movq %r15, %rdi
callq 0x285e0
leaq 0x160(%rsp), %rdi
callq 0x275d0
jmp 0x35ec5
leaq 0x10(%r15), %rax
movq %rax, (%r15)
movq $0x0, 0x8(%r15)
movb $0x0, 0x10(%r15)
movq %r15, %rax
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f3c1(%rip), %rdi     # 0x552a2
movq %r12, %rsi
xorl %eax, %eax
callq 0x284f0
jmp 0x35efe
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x275d0
jmp 0x35f01
jmp 0x35efe
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
callq 0x275d0
movq %rbx, %rdi
callq 0x28c20
movq %rax, %rdi
callq 0x2f0bd
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamMultiReader_p.cpp
// Function: BamTools::Internal::BamMultiReaderPrivate::PopNextCachedAlignment(BamTools::BamAlignment&, bool)
bool BamMultiReaderPrivate::PopNextCachedAlignment(BamAlignment& al, const bool needCharData) {

    // skip if no alignments available
    if ( m_alignmentCache == 0 || m_alignmentCache->IsEmpty() )
        return false;

    // pop next merge item entry from cache
    MergeItem item = m_alignmentCache->TakeFirst();
    BamReader* reader = item.Reader;
    BamAlignment* alignment = item.Alignment;
    if ( reader == 0 || alignment == 0 )
        return false;

    // set char data if requested
    if ( needCharData ) {
        alignment->BuildCharData();
        alignment->Filename = reader->GetFilename();
    }

    // store cached alignment into destination parameter (by copy)
    al = *alignment;

    // load next alignment from reader & store in cache
    SaveNextAlignment(reader, alignment);
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x35f56
movl %edx, %r13d
movq %rsi, %r14
movq (%rdi), %rax
callq *0x28(%rax)
testb %al, %al
je 0x35f69
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rbx), %rsi
movq (%rsi), %rax
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq *0x40(%rax)
movq (%r12), %r15
movq 0x8(%r12), %r12
testq %r15, %r15
setne %al
testq %r12, %r12
setne %bpl
andb %al, %bpl
cmpb $0x1, %bpl
jne 0x35f58
testb %r13b, %r13b
je 0x35fda
movq %r12, %rdi
callq 0x276c0
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x26c90
leaq 0xe0(%r12), %rdi
movq %r13, %rsi
callq 0x26b80
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35fda
callq 0x27560
movq %r14, %rdi
movq %r12, %rsi
callq 0x26b80
movl 0x20(%r12), %eax
movl %eax, 0x20(%r14)
leaq 0x28(%r14), %rdi
leaq 0x28(%r12), %rsi
callq 0x26b80
leaq 0x48(%r14), %rdi
leaq 0x48(%r12), %rsi
callq 0x26b80
leaq 0x68(%r14), %rdi
leaq 0x68(%r12), %rsi
callq 0x26b80
movl $0x88, %esi
leaq (%r14,%rsi), %rdi
addq %r12, %rsi
callq 0x26b80
movups 0xa8(%r12), %xmm0
movups %xmm0, 0xa8(%r14)
movl $0xb8, %esi
leaq (%r14,%rsi), %rdi
addq %r12, %rsi
callq 0x28450
movq 0xd0(%r12), %rax
movq %rax, 0xd0(%r14)
movl 0xd8(%r12), %eax
movl %eax, 0xd8(%r14)
movl $0xe0, %esi
leaq (%r14,%rsi), %rdi
addq %r12, %rsi
callq 0x26b80
movl $0x100, %esi            # imm = 0x100
leaq (%r14,%rsi), %rdi
addq %r12, %rsi
callq 0x26b80
movb 0x130(%r12), %al
movb %al, 0x130(%r14)
movups 0x120(%r12), %xmm0
movups %xmm0, 0x120(%r14)
movl $0x138, %eax            # imm = 0x138
addq %rax, %r14
movq %r12, %rsi
addq %rax, %rsi
movq %r14, %rdi
callq 0x26b80
movq %r15, %rdi
movq %r12, %rsi
callq 0x28850
testb %al, %al
je 0x35f58
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
movq %r15, (%rsi)
movq %r12, 0x8(%rsi)
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x35f58
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36105
callq 0x27560
movq %rbx, %rdi
callq 0x28c20
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamMultiReader_p.cpp
// Function: BamTools::Internal::BamMultiReaderPrivate::GetReferenceData() const
const RefVector BamMultiReaderPrivate::GetReferenceData(void) const {

    // handle empty multireader
    if ( m_readers.empty() ) return RefVector();

    // return reference data from first BamReader
    const MergeItem& item = m_readers.front();
    const BamReader* reader = item.Reader;
    if ( reader == 0 ) return RefVector();
    else
        return reader->GetReferenceData();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rsi), %rax
cmpq 0x8(%rsi), %rax
je 0x36155
movq (%rax), %rdi
testq %rdi, %rdi
je 0x36155
callq 0x26160
movq %rbx, %rdi
movq %rax, %rsi
callq 0x28970
jmp 0x36163
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamMultiReader_p.cpp
// Function: BamTools::Internal::BamMultiReaderPrivate::Jump(int, int)
bool BamMultiReaderPrivate::Jump(int refID, int position) {

    // NB: While it may make sense to track readers in which we can
    // successfully Jump, in practice a failure of Jump means "no
    // alignments here."  It makes sense to simply accept the failure,
    // UpdateAlignments(), and continue.

    // iterate over readers
    vector<MergeItem>::iterator readerIter = m_readers.begin();
    vector<MergeItem>::iterator readerEnd  = m_readers.end();
    for ( ; readerIter != readerEnd; ++readerIter ) {
        MergeItem& item = (*readerIter);
        BamReader* reader = item.Reader;
        if ( reader == 0 ) continue;

        // jump in each BamReader to position of interest
        reader->Jump(refID, position);
    }

    // returns status of cache update
    return UpdateAlignmentCache();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movq (%rdi), %r15
movq 0x8(%rdi), %r12
cmpq %r12, %r15
je 0x36233
movl %edx, %ebx
movl %esi, %ebp
movq (%r15), %rdi
testq %rdi, %rdi
je 0x3622a
movl %ebp, %esi
movl %ebx, %edx
callq 0x26540
addq $0x10, %r15
cmpq %r12, %r15
jne 0x36219
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x26060
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamMultiReader_p.cpp
// Function: BamTools::Internal::BamMultiReaderPrivate::UpdateAlignmentCache()
bool BamMultiReaderPrivate::UpdateAlignmentCache(void) {

    // create alignment cache if not created yet
    if ( m_alignmentCache == 0 ) {
        m_alignmentCache = CreateAlignmentCache();
        if ( m_alignmentCache == 0 ) {
            SetErrorString("BamMultiReader::UpdateAlignmentCache", "unable to create new alignment cache");
            return false;
        }
    }

    // clear any prior cache data
    m_alignmentCache->Clear();

    // iterate over readers
    vector<MergeItem>::iterator readerIter = m_readers.begin();
    vector<MergeItem>::iterator readerEnd  = m_readers.end();
    for ( ; readerIter != readerEnd; ++readerIter ) {
        MergeItem& item = (*readerIter);
        BamReader* reader = item.Reader;
        BamAlignment* alignment = item.Alignment;
        if ( reader == 0 || alignment == 0 ) continue;

        // save next alignment from each reader in cache
        SaveNextAlignment(reader, alignment);
    }

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
cmpq $0x0, 0x18(%rdi)
jne 0x3626d
movq %rbx, %rdi
callq 0x26ff0
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x362d9
movq 0x18(%rbx), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq (%rbx), %r13
movq 0x8(%rbx), %rbp
movb $0x1, %al
cmpq %rbp, %r13
je 0x3634d
leaq 0x8(%rsp), %r14
movq (%r13), %r15
movq 0x8(%r13), %r12
testq %r15, %r15
sete %al
testq %r12, %r12
sete %cl
orb %al, %cl
jne 0x362cc
movq %r15, %rdi
movq %r12, %rsi
callq 0x28850
testb %al, %al
je 0x362cc
movq 0x18(%rbx), %rdi
movq %r15, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movq (%rdi), %rax
movq %r14, %rsi
callq *0x10(%rax)
addq $0x10, %r13
cmpq %rbp, %r13
jne 0x3628e
movb $0x1, %al
jmp 0x3634d
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1f38e(%rip), %rsi     # 0x55677
leaq 0x1f3ab(%rip), %rdx     # 0x5569b
leaq 0x8(%rsp), %rdi
callq 0x26750
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1f392(%rip), %rsi     # 0x5569c
leaq 0x1f3af(%rip), %rdx     # 0x556c0
leaq 0x28(%rsp), %rdi
callq 0x26750
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x27be0
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x3633c
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3634b
callq 0x27560
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x36373
callq 0x27560
jmp 0x36373
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x36382
callq 0x27560
movq %rbx, %rdi
callq 0x28c20
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamMultiReader_p.cpp
// Function: BamTools::Internal::BamMultiReaderPrivate::OpenFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool BamMultiReaderPrivate::OpenFile(const std::string& filename) {
    vector<string> filenames(1, filename);
    if ( Open(filenames) )
        return true;
    else {
        const string currentError = m_errorString;
        const string message = string("could not open file: ") + filename + "\n\t" + currentError;
        SetErrorString("BamMultiReader::OpenFile", message);
        return false;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc0, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq 0xa8(%rsp), %rbx
leaq 0x28(%rsp), %rcx
movl $0x1, %esi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x28f00
movq %r14, %rdi
movq %rbx, %rsi
callq 0x27fa0
movl %eax, %ebx
testb %al, %al
jne 0x378d3
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x28(%r14), %rsi
movq 0x30(%r14), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x267c0
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x1dd7e(%rip), %rsi     # 0x55551
leaq 0x1dd8c(%rip), %rdx     # 0x55566
leaq 0x48(%rsp), %rdi
callq 0x26750
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movq %r15, %rdx
callq 0x29130
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x267c0
leaq 0x1e2d2(%rip), %rsi     # 0x55aef
leaq 0x8(%rsp), %rdi
callq 0x290a0
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x29130
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3784d
callq 0x27560
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x37860
callq 0x27560
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x3786f
callq 0x27560
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x1dce9(%rip), %rsi     # 0x55567
leaq 0x1dcfa(%rip), %rdx     # 0x5557f
callq 0x26750
leaq 0x8(%rsp), %rsi
leaq 0x88(%rsp), %rdx
movq %r14, %rdi
callq 0x27be0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x378ae
callq 0x27560
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x378c4
callq 0x27560
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x378d3
callq 0x27560
leaq 0xa8(%rsp), %rdi
callq 0x270a0
movl %ebx, %eax
addq $0xc0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3790a
callq 0x27560
jmp 0x3790a
movq %rax, %rbx
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x37958
jmp 0x37962
jmp 0x3791f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x37936
callq 0x27560
jmp 0x37936
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3794e
callq 0x27560
jmp 0x3794e
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x37962
callq 0x27560
jmp 0x37962
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x37978
callq 0x27560
jmp 0x37978
jmp 0x37975
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x270a0
movq %rbx, %rdi
callq 0x28c20
movq %rax, %rdi
callq 0x2f0bd
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamMultiReader_p.cpp
// Function: BamTools::Internal::BamMultiReaderPrivate::SaveNextAlignment(BamTools::BamReader*, BamTools::BamAlignment*)
void BamMultiReaderPrivate::SaveNextAlignment(BamReader* reader, BamAlignment* alignment) {

    // if can read alignment from reader, store in cache
    //
    // N.B. - lazy building of alignment's char data - populated only:
    //        automatically by alignment cache to maintain its sorting OR
    //        on demand from client call to future call to GetNextAlignment()

    if ( reader->GetNextAlignmentCore(*alignment) )
        m_alignmentCache->Add( MergeItem(reader, alignment) );
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x28850
testb %al, %al
je 0x37ce1
movq 0x18(%r15), %rdi
movq %rsp, %rsi
movq %r14, (%rsi)
movq %rbx, 0x8(%rsi)
movq (%rdi), %rax
callq *0x10(%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamMultiReader_p.cpp
// Function: BamTools::Internal::BamMultiReaderPrivate::SetRegion(BamTools::BamRegion const&)
bool BamMultiReaderPrivate::SetRegion(const BamRegion& region) {

    // NB: While it may make sense to track readers in which we can
    // successfully SetRegion, In practice a failure of SetRegion means "no
    // alignments here."  It makes sense to simply accept the failure,
    // UpdateAlignments(), and continue.

    // iterate over alignments
    vector<MergeItem>::iterator readerIter = m_readers.begin();
    vector<MergeItem>::iterator readerEnd  = m_readers.end();
    for ( ; readerIter != readerEnd; ++readerIter ) {
        MergeItem& item = (*readerIter);
        BamReader* reader = item.Reader;
        if ( reader == 0 ) continue;

        // set region of interest
        reader->SetRegion(region);
    }

    // return status of cache update
    return UpdateAlignmentCache();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r15
movq 0x8(%rdi), %r12
cmpq %r12, %r15
je 0x37fc1
movq %rsi, %r14
movq (%r15), %rdi
testq %rdi, %rdi
je 0x37fb8
movq %r14, %rsi
callq 0x26810
addq $0x10, %r15
cmpq %r12, %r15
jne 0x37fa8
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x26060
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamMultiMerger_p.h
// Function: BamTools::Internal::MultiMerger<BamTools::Algorithms::Sort::Unsorted>::Remove(BamTools::BamReader*)
inline
void MultiMerger<Algorithms::Sort::Unsorted>::Remove(BamReader* reader) {

    if ( reader == 0 ) return;
    const std::string filenameToRemove = reader->GetFilename();

    // iterate over readers in cache
    DataIterator dataIter = m_data.begin();
    DataIterator dataEnd  = m_data.end();
    for ( ; dataIter != dataEnd; ++dataIter ) {
        const MergeItem& item = (*dataIter);
        const BamReader* itemReader = item.Reader;
        if ( itemReader == 0 ) continue;

        // remove iterator on match
        if ( itemReader->GetFilename() == filenameToRemove ) {
            m_data.erase(dataIter);
            return;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
testq %rsi, %rsi
je 0x383b8
movq %rdi, %r14
leaq 0x28(%rsp), %rdi
callq 0x26c90
movq 0x18(%r14), %r13
movq 0x38(%r14), %r12
cmpq %r12, %r13
je 0x383a5
leaq 0x8(%r14), %rax
movq %rax, 0x20(%rsp)
movq 0x28(%r14), %r15
movq 0x30(%r14), %rbp
movq %rsp, %r14
movq (%r13), %rsi
testq %rsi, %rsi
je 0x38326
movq %r14, %rdi
callq 0x26c90
movq 0x8(%rsp), %rdx
cmpq 0x30(%rsp), %rdx
jne 0x3832d
testq %rdx, %rdx
je 0x38331
movq 0x28(%rsp), %rsi
movq (%rsp), %rdi
callq 0x277e0
testl %eax, %eax
sete %bl
jmp 0x38333
movl $0x4, %eax
jmp 0x38380
xorl %ebx, %ebx
jmp 0x38333
movb $0x1, %bl
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x38346
callq 0x27560
xorl %eax, %eax
testb %bl, %bl
je 0x38380
movq %r13, (%rsp)
movq (%rbp), %rax
movq %rax, 0x8(%rsp)
addq $0x200, %rax            # imm = 0x200
movq %rax, 0x10(%rsp)
movq %rbp, 0x18(%rsp)
leaq 0x48(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %r14, %rdx
callq 0x27330
movl $0x1, %eax
testb $0x3, %al
jne 0x383a5
addq $0x10, %r13
cmpq %r15, %r13
jne 0x3839c
movq 0x8(%rbp), %r13
addq $0x8, %rbp
leaq 0x200(%r13), %r15
cmpq %r12, %r13
jne 0x382ef
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x383b8
callq 0x27560
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x383c9
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x383df
callq 0x27560
movq %rbx, %rdi
callq 0x28c20
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamMultiMerger_p.h
// Function: BamTools::Internal::MultiMerger<BamTools::Algorithms::Sort::ByName>::Add(BamTools::Internal::MergeItem)
inline void MultiMerger<Compare>::Add(MergeItem item) {

    // N.B. - any future custom Compare types must define this method
    //        see algorithms/Sort.h

    if ( CompareType::UsesCharData() )
        item.Alignment->BuildCharData();
    m_data.insert(item);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %rdi
callq 0x276c0
addq $0x8, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x28800
movq %rsp, %r8
movq %r14, (%r8)
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rcx
callq 0x27320
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamMultiMerger_p.h
// Function: BamTools::Internal::MultiMerger<BamTools::Algorithms::Sort::ByPosition>::Remove(BamTools::BamReader*)
inline void MultiMerger<Compare>::Remove(BamReader* reader) {

    if ( reader == 0 ) return;
    const std::string& filenameToRemove = reader->GetFilename();

    // iterate over readers in cache
    DataIterator dataIter = m_data.begin();
    DataIterator dataEnd  = m_data.end();
    for ( ; dataIter != dataEnd; ++dataIter ) {
        const MergeItem& item = (*dataIter);
        const BamReader* itemReader = item.Reader;
        if ( itemReader == 0 ) continue;

        // remove iterator on match
        if ( itemReader->GetFilename() == filenameToRemove ) {
            m_data.erase(dataIter);
            return;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
testq %rsi, %rsi
je 0x3929d
movq %rdi, %rbx
leaq 0x28(%rsp), %rdi
callq 0x26c90
movq 0x20(%rbx), %r15
leaq 0x10(%rbx), %r14
cmpq %r14, %r15
je 0x3928a
leaq 0x18(%rsp), %r13
leaq 0x8(%rsp), %r12
movq 0x20(%r15), %rsi
testq %rsi, %rsi
je 0x39232
movq %r12, %rdi
callq 0x26c90
movq 0x10(%rsp), %rdx
cmpq 0x30(%rsp), %rdx
jne 0x39239
testq %rdx, %rdx
je 0x3923d
movq 0x28(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x277e0
testl %eax, %eax
sete %bpl
jmp 0x39240
movl $0x4, %eax
jmp 0x39272
xorl %ebp, %ebp
jmp 0x39240
movb $0x1, %bpl
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x3924f
callq 0x27560
xorl %eax, %eax
testb %bpl, %bpl
je 0x39272
movq %r15, %rdi
movq %r14, %rsi
callq 0x26d70
movq %rax, %rdi
callq 0x27560
decq 0x30(%rbx)
movl $0x1, %eax
testb $0x3, %al
jne 0x3928a
movq %r15, %rdi
callq 0x27ae0
movq %rax, %r15
cmpq %r14, %rax
jne 0x391f9
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3929d
callq 0x27560
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x392c2
callq 0x27560
movq %rbx, %rdi
callq 0x28c20
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamMultiMerger_p.h
// Function: BamTools::Internal::MultiMerger<BamTools::Algorithms::Sort::ByPosition>::TakeFirst()
inline MergeItem MultiMerger<Compare>::TakeFirst(void) {
    DataIterator firstIter = m_data.begin();
    MergeItem    firstItem = (*firstIter);
    m_data.erase(firstIter);
    return firstItem;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x20(%rsi), %rdi
movups 0x20(%rdi), %xmm0
movups %xmm0, (%r14)
addq $0x10, %rsi
callq 0x26d70
movq %rax, %rdi
callq 0x27560
decq 0x30(%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/algorithms/Sort.h
// Function: BamTools::Algorithms::Sort::ByPosition::operator()(BamTools::BamAlignment const&, BamTools::BamAlignment const&)
bool operator()(const BamTools::BamAlignment& lhs, const BamTools::BamAlignment& rhs) {

            // force unmapped aligmnents to end
            if ( lhs.RefID == -1 ) return false;
            if ( rhs.RefID == -1 ) return true;

            // if on same reference, sort on position
            if ( lhs.RefID == rhs.RefID )
                return sort_helper(m_order, lhs.Position, rhs.Position);

            // otherwise sort on reference ID
            return sort_helper(m_order, lhs.RefID, rhs.RefID);
        }

// Assembly:
movl 0xa8(%rsi), %eax
cmpl $-0x1, %eax
je 0x39447
movl 0xa8(%rdx), %ecx
cmpl $-0x1, %ecx
je 0x39433
cmpl %ecx, %eax
jne 0x39436
movl (%rdi), %eax
cmpl $0x1, %eax
je 0x3944a
testl %eax, %eax
jne 0x39447
movl 0xac(%rsi), %eax
cmpl 0xac(%rdx), %eax
jmp 0x39443
movb $0x1, %al
retq
movl (%rdi), %edx
cmpl $0x1, %edx
je 0x39458
testl %edx, %edx
jne 0x39447
cmpl %ecx, %eax
setl %al
retq
xorl %eax, %eax
retq
movl 0xac(%rsi), %eax
cmpl 0xac(%rdx), %eax
jmp 0x3945a
cmpl %ecx, %eax
setg %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamRandomAccessController_p.cpp
// Function: BamTools::Internal::BamRandomAccessController::AdjustRegion(int const&)
void BamRandomAccessController::AdjustRegion(const int& referenceCount) {

    // skip if no index available
    if ( m_index == 0 )
        return;

    // see if any references in region have alignments
    m_hasAlignmentsInRegion = false;
    int currentId = m_region.LeftRefID;
    const int rightBoundRefId = ( m_region.isRightBoundSpecified() ? m_region.RightRefID : referenceCount - 1 );
    while ( currentId <= rightBoundRefId ) {
        m_hasAlignmentsInRegion = m_index->HasAlignments(currentId);
        if ( m_hasAlignmentsInRegion ) break;
        ++currentId;
    }

    // if no data found on any reference in region
    if ( !m_hasAlignmentsInRegion )
        return;

    // if left bound of desired region had no data, use first reference that had data
    // otherwise, leave requested region as-is
    if ( currentId != m_region.LeftRefID ) {
        m_region.LeftRefID = currentId;
        m_region.LeftPosition = 0;
    }
}

// Assembly:
cmpq $0x0, (%rdi)
je 0x39b35
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movb $0x0, 0x18(%rdi)
movl 0x8(%rdi), %eax
movl %eax, 0xc(%rsp)
movl (%rsi), %ecx
decl %ecx
cmpl $0x0, 0x14(%rdi)
movl 0x10(%rdi), %edx
movl %ecx, %ebp
cmovgl %edx, %ebp
testl %edx, %edx
cmovsl %ecx, %ebp
cmpl %ebp, %eax
jg 0x39b14
leaq 0xc(%rsp), %r14
movq (%rbx), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x18(%rax)
movb %al, 0x18(%rbx)
testb %al, %al
jne 0x39b14
movl 0xc(%rsp), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xc(%rsp)
cmpl %ebp, %eax
jl 0x39af2
cmpb $0x1, 0x18(%rbx)
jne 0x39b2d
movl 0xc(%rsp), %eax
cmpl 0x8(%rbx), %eax
je 0x39b2d
movl %eax, 0x8(%rbx)
movl $0x0, 0xc(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamRandomAccessController_p.cpp
// Function: BamTools::Internal::BamRandomAccessController::LocateIndex(BamTools::Internal::BamReaderPrivate*, BamTools::BamIndex::IndexType const&)
bool BamRandomAccessController::LocateIndex(BamReaderPrivate* reader,
                                            const BamIndex::IndexType& preferredType)
{
    // look up index filename, deferring to preferredType if possible
    assert(reader);
    const string& indexFilename = BamIndexFactory::FindIndexFilename(reader->Filename(), preferredType);

    // if no index file found (of any type)
    if ( indexFilename.empty() ) {
        const string message = string("could not find index file for:") + reader->Filename();
        SetErrorString("BamRandomAccessController::LocateIndex", message);
        return false;
    }

    // otherwise open & use index file that was found
    return OpenIndex(indexFilename, reader);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x27dc0
leaq 0x48(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x270b0
leaq 0x38(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x3a0b1
callq 0x27560
cmpq $0x0, 0x50(%rsp)
je 0x3a0d0
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x272d0
movl %eax, %ebx
jmp 0x3a182
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1b86e(%rip), %rsi     # 0x5594f
leaq 0x1b885(%rip), %rdx     # 0x5596d
leaq 0x8(%rsp), %rdi
callq 0x26750
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
callq 0x27dc0
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x29130
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3a126
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x3a135
callq 0x27560
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1b82a(%rip), %rsi     # 0x5596e
leaq 0x1b849(%rip), %rdx     # 0x55994
callq 0x26750
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x263b0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x3a171
callq 0x27560
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x3a180
callq 0x27560
xorl %ebx, %ebx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3a195
callq 0x27560
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x3a1bd
callq 0x27560
jmp 0x3a1bd
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
jne 0x3a1ee
jmp 0x3a1fa
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3a1e4
callq 0x27560
jmp 0x3a1e4
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x3a1fa
callq 0x27560
jmp 0x3a1fa
jmp 0x3a1f7
movq %rax, %rbx
leaq 0x58(%rsp), %rax
jmp 0x3a209
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3a217
callq 0x27560
movq %rbx, %rdi
callq 0x28c20
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamReader_p.cpp
// Function: BamTools::Internal::BamReaderPrivate::Close()
bool BamReaderPrivate::Close(void) {

    // clear BAM metadata
    m_references.clear();
    m_header.Clear();

    // clear filename
    m_filename.clear();

    // close random access controller
    m_randomAccessController.Close();

    // if stream is open, attempt close
    if ( IsOpen() ) {
        try {
            m_stream.Close();
        } catch ( BamException& e ) {
            const string streamError = e.what();
            const string message = string("encountered error closing BAM file: \n\t") + streamError;
            SetErrorString("BamReader::Close", message);
            return false;
        }
    }

    // return success
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
addq $0x28, %rdi
callq 0x26ac0
leaq 0x50(%rbx), %rdi
callq 0x28b50
movq $0x0, 0x10(%rbx)
movq 0x8(%rbx), %rax
movb $0x0, (%rax)
leaq 0x1a8(%rbx), %rdi
callq 0x27940
leaq 0x1e8(%rbx), %r14
movq %r14, %rdi
callq 0x28820
movb $0x1, %bpl
testb %al, %al
je 0x3a988
movq %r14, %rdi
callq 0x27180
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
cmpl $0x1, %edx
jne 0x3aad1
movq %r14, %rdi
callq 0x267d0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rdx
movq %rax, %rsi
callq 0x26770
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1b080(%rip), %rsi     # 0x55a54
leaq 0x1b09f(%rip), %rdx     # 0x55a7a
leaq 0x8(%rsp), %rdi
callq 0x26750
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x29130
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3aa08
callq 0x27560
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x1b064(%rip), %rsi     # 0x55a7b
leaq 0x1b06d(%rip), %rdx     # 0x55a8b
callq 0x26750
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a10
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3aa44
callq 0x27560
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3aa57
callq 0x27560
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3aa6a
callq 0x27560
callq 0x287e0
xorl %ebp, %ebp
jmp 0x3a988
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3aa8d
callq 0x27560
jmp 0x3aa8d
movq %rax, %r14
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x3aaaa
jmp 0x3aab4
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3aab4
callq 0x27560
jmp 0x3aab4
movq %rax, %r14
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3aacc
callq 0x27560
jmp 0x3aacc
movq %rax, %r14
callq 0x287e0
movq %r14, %rdi
callq 0x28c20
movq %rax, %rdi
callq 0x2f0bd
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamReader_p.cpp
// Function: BamTools::Internal::BamReaderPrivate::CreateIndex(BamTools::BamIndex::IndexType const&)
bool BamReaderPrivate::CreateIndex(const BamIndex::IndexType& type) {

    // skip if BAM file not open
    if ( !IsOpen() ) {
        SetErrorString("BamReader::CreateIndex", "cannot create index on unopened BAM file");
        return false;
    }

    // attempt to create index
    if ( m_randomAccessController.CreateIndex(this, type) )
        return true;
    else {
        const string bracError = m_randomAccessController.GetErrorString();
        const string message = string("could not create index: \n\t") + bracError;
        SetErrorString("BamReader::CreateIndex", message);
        return false;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rsi, %r15
movq %rdi, %rbx
addq $0x1e8, %rdi            # imm = 0x1E8
callq 0x28820
testb %al, %al
je 0x3ad0e
leaq 0x1a8(%rbx), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x27980
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
jne 0x3ad82
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x285c0
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1acaf(%rip), %rsi     # 0x55934
leaq 0x1acc2(%rip), %rdx     # 0x5594e
movq %rsp, %rdi
callq 0x26750
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
leaq 0x40(%rsp), %rdx
callq 0x29130
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x3acb4
callq 0x27560
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x1adcb(%rip), %rsi     # 0x55a8c
leaq 0x1adda(%rip), %rdx     # 0x55aa2
callq 0x26750
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a10
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x3aceb
callq 0x27560
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3acfe
callq 0x27560
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x3ad7b
jmp 0x3ad80
leaq 0x50(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1ad6e(%rip), %rsi     # 0x55a8c
leaq 0x1ad7d(%rip), %rdx     # 0x55aa2
leaq 0x40(%rsp), %rdi
callq 0x26750
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1ad64(%rip), %rsi     # 0x55aa3
leaq 0x1ad85(%rip), %rdx     # 0x55acb
leaq 0x20(%rsp), %rdi
callq 0x26750
leaq 0x40(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a10
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x3ad71
callq 0x27560
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x3ad80
callq 0x27560
xorl %eax, %eax
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x3ada2
callq 0x27560
jmp 0x3ada2
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x3adbe
jmp 0x3adc8
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x3adc8
callq 0x27560
jmp 0x3adc8
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x3adf9
jmp 0x3ae03
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x3adef
callq 0x27560
jmp 0x3adef
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x3ae03
callq 0x27560
jmp 0x3ae03
movq %rax, %rbx
movq %rbx, %rdi
callq 0x28c20
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamReader_p.cpp
// Function: BamTools::Internal::BamReaderPrivate::GetNextAlignment(BamTools::BamAlignment&)
bool BamReaderPrivate::GetNextAlignment(BamAlignment& alignment) {

    // if valid alignment found
    if ( GetNextAlignmentCore(alignment) ) {

        // store alignment's "source" filename
        alignment.Filename = m_filename;

        // return success/failure of parsing char data
        if ( alignment.BuildCharData() )
            return true;
        else {
            const string alError = alignment.GetErrorString();
            const string message = string("could not populate alignment data: \n\t") + alError;
            SetErrorString("BamReader::GetNextAlignment", message);
            return false;
        }
    }

    // no valid alignment found
    return false;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x26260
testb %al, %al
je 0x3af79
leaq 0x8(%rbx), %rsi
leaq 0xe0(%r14), %rdi
callq 0x26b80
movq %r14, %rdi
callq 0x276c0
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
jne 0x3af7b
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
callq 0x28480
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1abe9(%rip), %rsi     # 0x55acc
leaq 0x1ac07(%rip), %rdx     # 0x55af1
leaq 0x8(%rsp), %rdi
callq 0x26750
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x29130
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3af17
callq 0x27560
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x1abcc(%rip), %rsi     # 0x55af2
leaq 0x1abe0(%rip), %rdx     # 0x55b0d
callq 0x26750
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a10
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3af53
callq 0x27560
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3af66
callq 0x27560
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3af79
callq 0x27560
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3af9a
callq 0x27560
jmp 0x3af9a
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x3afb7
jmp 0x3afc1
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3afc1
callq 0x27560
jmp 0x3afc1
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3afd4
callq 0x27560
movq %rbx, %rdi
callq 0x28c20
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamReader_p.cpp
// Function: BamTools::Internal::BamReaderPrivate::GetReferenceID(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
int BamReaderPrivate::GetReferenceID(const string& refName) const {

    // retrieve names from reference data
    vector<string> refNames;
    RefVector::const_iterator refIter = m_references.begin();
    RefVector::const_iterator refEnd  = m_references.end();
    for ( ; refIter != refEnd; ++refIter)
        refNames.push_back( (*refIter).RefName );

    // return 'index-of' refName (or -1 if not found)
    int index = distance(refNames.begin(), find(refNames.begin(), refNames.end(), refName));
    if ( index == (int)m_references.size() ) return -1;
    else return index;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0x28(%rdi), %r15
movq 0x30(%rdi), %r13
cmpq %r13, %r15
je 0x3b4c5
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x26ab0
addq $0x28, %r15
cmpq %r13, %r15
jne 0x3b4b1
movq (%rsp), %r15
movq 0x8(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x27080
subq %r15, %rax
shrq $0x5, %rax
movq 0x30(%rbx), %rcx
subq 0x28(%rbx), %rcx
shrq $0x3, %rcx
imull $0xcccccccd, %ecx, %ecx # imm = 0xCCCCCCCD
cmpl %ecx, %eax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmovnel %eax, %ebx
movq %rsp, %rdi
callq 0x270a0
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x3b516
movq %rax, %rbx
movq %rsp, %rdi
callq 0x270a0
movq %rbx, %rdi
callq 0x28c20
movq %rax, %rdi
callq 0x2f0bd
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamReader_p.cpp
// Function: BamTools::Internal::BamReaderPrivate::LocateIndex(BamTools::BamIndex::IndexType const&)
bool BamReaderPrivate::LocateIndex(const BamIndex::IndexType& preferredType) {

    if ( m_randomAccessController.LocateIndex(this, preferredType) )
        return true;
    else {
        const string bracError = m_randomAccessController.GetErrorString();
        const string message = string("could not locate index: \n\t") + bracError;
        SetErrorString("BamReader::LocateIndex", message);
        return false;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rsi, %rdx
movq %rdi, %r14
leaq 0x1a8(%rdi), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x28340
movl %eax, %ebx
testb %al, %al
jne 0x3b864
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
callq 0x285c0
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1a38c(%rip), %rsi     # 0x55b64
leaq 0x1a39f(%rip), %rdx     # 0x55b7e
movq %rsp, %rdi
callq 0x26750
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
leaq 0x40(%rsp), %rdx
callq 0x29130
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x3b807
callq 0x27560
movq %rsp, %rdi
movq %r15, (%rdi)
leaq 0x1a36b(%rip), %rsi     # 0x55b7f
leaq 0x1a37a(%rip), %rdx     # 0x55b95
callq 0x26750
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
callq 0x27a10
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x3b83e
callq 0x27560
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b851
callq 0x27560
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b864
callq 0x27560
movl %ebx, %eax
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x3b886
callq 0x27560
jmp 0x3b886
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x3b8a2
jmp 0x3b8ac
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x3b8ac
callq 0x27560
jmp 0x3b8ac
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b8bf
callq 0x27560
movq %rbx, %rdi
callq 0x28c20
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamReader_p.cpp
// Function: BamTools::Internal::BamReaderPrivate::OpenIndex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool BamReaderPrivate::OpenIndex(const std::string& indexFilename) {

    if ( m_randomAccessController.OpenIndex(indexFilename, this) )
        return true;
    else {
        const string bracError = m_randomAccessController.GetErrorString();
        const string message = string("could not open index: \n\t") + bracError;
        SetErrorString("BamReader::OpenIndex", message);
        return false;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rdi, %r14
leaq 0x1a8(%rdi), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0x272d0
movl %eax, %ebx
testb %al, %al
jne 0x3bbdd
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
callq 0x285c0
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1a055(%rip), %rsi     # 0x55ba6
leaq 0x1a066(%rip), %rdx     # 0x55bbe
movq %rsp, %rdi
callq 0x26750
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
leaq 0x40(%rsp), %rdx
callq 0x29130
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x3bb80
callq 0x27560
movq %rsp, %rdi
movq %r15, (%rdi)
leaq 0x1a032(%rip), %rsi     # 0x55bbf
leaq 0x1a03f(%rip), %rdx     # 0x55bd3
callq 0x26750
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
callq 0x27a10
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x3bbb7
callq 0x27560
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3bbca
callq 0x27560
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3bbdd
callq 0x27560
movl %ebx, %eax
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x3bbff
callq 0x27560
jmp 0x3bbff
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x3bc1b
jmp 0x3bc25
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x3bc25
callq 0x27560
jmp 0x3bc25
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3bc38
callq 0x27560
movq %rbx, %rdi
callq 0x28c20
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamReader_p.cpp
// Function: BamTools::Internal::BamReaderPrivate::Rewind()
bool BamReaderPrivate::Rewind(void) {

    // reset region
    m_randomAccessController.ClearRegion();

    // return status of seeking back to first alignment
    if ( Seek(m_alignmentsBeginOffset) )
        return true;
    else {
        const string currentError = m_errorString;
        const string message = string("could not rewind: \n\t") + currentError;
        SetErrorString("BamReader::Rewind", message);
        return false;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r14
addq $0x1a8, %rdi            # imm = 0x1A8
callq 0x275b0
movq %r14, %rdi
movq %r14, %rsi
callq 0x27710
movl %eax, %ebx
testb %al, %al
jne 0x3bd36
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x228(%r14), %rsi
movq 0x230(%r14), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x267c0
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x19f30(%rip), %rsi     # 0x55bd4
leaq 0x19f3d(%rip), %rdx     # 0x55be8
leaq 0x8(%rsp), %rdi
callq 0x26750
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x29130
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x3bcd8
callq 0x27560
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x19f02(%rip), %rsi     # 0x55be9
leaq 0x19f0c(%rip), %rdx     # 0x55bfa
callq 0x26750
leaq 0x8(%rsp), %rsi
leaq 0x48(%rsp), %rdx
movq %r14, %rdi
callq 0x27a10
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x3bd14
callq 0x27560
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3bd27
callq 0x27560
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x3bd36
callq 0x27560
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x3bd5b
callq 0x27560
jmp 0x3bd5b
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x3bd78
jmp 0x3bd82
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x3bd82
callq 0x27560
jmp 0x3bd82
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x3bd91
callq 0x27560
movq %rbx, %rdi
callq 0x28c20
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamReader_p.cpp
// Function: BamTools::Internal::BamReaderPrivate::SetRegion(BamTools::BamRegion const&)
bool BamReaderPrivate::SetRegion(const BamRegion& region) {

    if ( m_randomAccessController.SetRegion(region, m_references.size()) )
        return true;
    else {
        const string bracError = m_randomAccessController.GetErrorString();
        const string message = string("could not set region: \n\t") + bracError;
        SetErrorString("BamReader::SetRegion", message);
        return false;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rdi, %r14
leaq 0x1a8(%rdi), %r15
movq 0x30(%rdi), %rax
subq 0x28(%rdi), %rax
shrq $0x3, %rax
imull $0xcccccccd, %eax, %eax # imm = 0xCCCCCCCD
leaq 0x20(%rsp), %rdx
movl %eax, (%rdx)
movq %r15, %rdi
callq 0x26f30
movl %eax, %ebx
testb %al, %al
jne 0x3c0b1
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
callq 0x285c0
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x19c26(%rip), %rsi     # 0x55c4b
leaq 0x19c37(%rip), %rdx     # 0x55c63
movq %rsp, %rdi
callq 0x26750
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
callq 0x29130
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x3c054
callq 0x27560
movq %rsp, %rdi
movq %r15, (%rdi)
leaq 0x19c03(%rip), %rsi     # 0x55c64
leaq 0x19c10(%rip), %rdx     # 0x55c78
callq 0x26750
movq %rsp, %rsi
leaq 0x40(%rsp), %rdx
movq %r14, %rdi
callq 0x27a10
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x3c08b
callq 0x27560
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3c09e
callq 0x27560
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3c0b1
callq 0x27560
movl %ebx, %eax
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x3c0d3
callq 0x27560
jmp 0x3c0d3
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x3c0ef
jmp 0x3c0f9
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x3c0f9
callq 0x27560
jmp 0x3c0f9
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3c10c
callq 0x27560
movq %rbx, %rdi
callq 0x28c20
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamWriter_p.cpp
// Function: BamTools::Internal::BamWriterPrivate::Close()
void BamWriterPrivate::Close(void) {

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

    // close output stream
    try {
        m_stream.Close();
    } catch ( BamException& e ) {
        m_errorString = e.what();
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x28820
testb %al, %al
je 0x3c962
movq %rbx, %rdi
callq 0x27180
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
cmpl $0x1, %edx
jne 0x3c9a6
movq %r14, %rdi
callq 0x267d0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
addq $0x48, %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x28000
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x287e0
movq %rax, %r14
callq 0x287e0
movq %r14, %rdi
callq 0x28c20
movq %rax, %rdi
callq 0x2f0bd