LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_sort.cpp
// Function: BamTools::SortTool::SortToolPrivate::WriteTempFile(std::vector<BamTools::BamAlignment, std::allocator<BamTools::BamAlignment>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool SortTool::SortToolPrivate::WriteTempFile(const vector<BamAlignment>& buffer,
                                              const string& tempFilename)
{
    // open temp file for writing
    BamWriter tempWriter;
    if ( !tempWriter.Open(tempFilename, m_headerText, m_references) ) {
        cerr << "bamtools sort ERROR: could not open " << tempFilename
             << " for writing." << endl;
        return false;
    }
  
    // write data
    vector<BamAlignment>::const_iterator buffIter = buffer.begin();
    vector<BamAlignment>::const_iterator buffEnd  = buffer.end();
    for ( ; buffIter != buffEnd; ++buffIter )  {
        const BamAlignment& al = (*buffIter);
        tempWriter.SaveAlignment(al);
    }
  
    // close temp file & return success
    tempWriter.Close();
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsp, %r12
movq %r12, %rdi
callq 0x35350
leaq 0x30(%rbx), %rdx
addq $0x50, %rbx
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rcx
callq 0x359d0
movl %eax, %ebx
testb %al, %al
je 0x54e25
movq (%r15), %r14
movq 0x8(%r15), %r12
movq %rsp, %r15
cmpq %r12, %r14
je 0x54e5c
movq %r15, %rdi
movq %r14, %rsi
callq 0x35c00
addq $0x158, %r14            # imm = 0x158
jmp 0x54e0c
movq 0x401b4(%rip), %rdi     # 0x94fe0
leaq 0x1fcbd(%rip), %rsi     # 0x74af0
callq 0x355b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x35510
leaq 0x1cfb3(%rip), %rsi     # 0x71dfd
movq %rax, %rdi
callq 0x355b0
movq %rax, %rdi
callq 0x35300
jmp 0x54e64
movq %rsp, %rdi
callq 0x35360
movq %rsp, %rdi
callq 0x35420
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x54e7e
jmp 0x54e7e
movq %rax, %rbx
movq %rsp, %rdi
callq 0x35420
movq %rbx, %rdi
callq 0x35b50
movq %rax, %rdi
callq 0x3a198
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_sort.cpp
// Function: BamTools::SortTool::~SortTool()
SortTool::~SortTool(void) {

    delete m_settings;
    m_settings = 0;

    delete m_impl;
    m_impl = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x3f4e2(%rip), %rax     # 0x94b58
movq %rax, (%rdi)
movq 0x8(%rdi), %rbx
testq %rbx, %rbx
je 0x5568a
movq %rbx, %rdi
callq 0x558da
movq %rbx, %rdi
callq 0x35570
andq $0x0, 0x8(%r14)
movq 0x10(%r14), %rbx
testq %rbx, %rbx
je 0x556a8
movq %rbx, %rdi
callq 0x5591c
movq %rbx, %rdi
callq 0x35570
andq $0x0, 0x10(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
jmp 0x556bf
movq %rax, %r14
movq %rbx, %rdi
callq 0x35570
movq %r14, %rdi
callq 0x35b50
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_sort.cpp
// Function: BamTools::SortTool::Run(int, char**)
int SortTool::Run(int argc, char* argv[]) {

    // parse command line arguments
    Options::Parse(argc, argv, 1);

    // initialize SortTool with settings
    m_impl = new SortToolPrivate(m_settings);

    // run SortTool, return success/fail
    if ( m_impl->Run() )
        return 0;
    else
        return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %rax
movl %esi, %edi
movq %rdx, %rsi
movl %eax, %edx
callq 0x6595a
movl $0x80, %edi
callq 0x355d0
movq %rax, %r14
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x548e8
movq %r14, 0x10(%rbx)
movq %r14, %rdi
callq 0x55030
xorb $0x1, %al
movzbl %al, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x35570
movq %rbx, %rdi
callq 0x35b50
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_split.cpp
// Function: BamTools::GetTimestampString[abi:cxx11]()
string GetTimestampString(void) {

    // get human readable timestamp
    time_t currentTime;
    time(&currentTime);
    stringstream timeStream("");
    timeStream << ctime(&currentTime);

    // convert whitespace to '_'
    string timeString = timeStream.str();
    size_t found = timeString.find(" ");
    while (found != string::npos) {
        timeString.replace(found, 1, "_");
        found = timeString.find(" ", found+1);
    }
    return timeString;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, %rbx
leaq 0x10(%rsp), %rdi
callq 0x35540
leaq 0x1eb2b(%rip), %rsi     # 0x767f7
leaq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x35280
leaq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rsi
pushq $0x18
popq %rdx
callq 0x359e0
leaq 0x18(%rsp), %rdi
callq 0x35730
leaq 0x48(%rsp), %r14
leaq 0x10(%rsp), %rdi
callq 0x35260
movq %r14, %rdi
movq %rax, %rsi
callq 0x355b0
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0x359c0
leaq 0x1d78e(%rip), %rsi     # 0x754b3
movq %rbx, %rdi
xorl %edx, %edx
callq 0x35c70
movq %rax, %r14
leaq 0x1cf8b(%rip), %r15     # 0x74cc4
pushq $0x1
popq %r12
leaq 0x1d76f(%rip), %r13     # 0x754b3
cmpq $-0x1, %r14
je 0x57d71
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x35370
incq %r14
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x35c70
movq %rax, %r14
jmp 0x57d44
leaq 0x38(%rsp), %rdi
callq 0x35490
movq %rbx, %rax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x57daa
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x35730
jmp 0x57dbf
movq %rax, %r14
jmp 0x57db5
movq %rax, %r14
jmp 0x57dbf
movq %rax, %r14
movq %rbx, %rdi
callq 0x35730
leaq 0x38(%rsp), %rdi
callq 0x35490
movq %r14, %rdi
callq 0x35b50
movq %rax, %rdi
callq 0x3a198
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_split.cpp
// Function: BamTools::SplitTool::SplitToolPrivate::DetermineOutputFilenameStub()
void SplitTool::SplitToolPrivate::DetermineOutputFilenameStub(void) {
  
    // if user supplied output filename stub, use that
    if ( m_settings->HasCustomOutputStub ) 
        m_outputFilenameStub = m_settings->CustomOutputStub;
    
    // else if user supplied input BAM filename, use that (minus ".bam" extension) as stub
    else if ( m_settings->HasInputFilename )
        m_outputFilenameStub = RemoveFilenameExtension(m_settings->InputFilename);
        
    // otherwise, user did not specify -stub, and input is coming from STDIN
    // generate stub from timestamp
    else m_outputFilenameStub = GetTimestampString();      
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq (%rdi), %rsi
cmpb $0x1, 0x1(%rsi)
jne 0x57e30
addq $0x10, %rsi
addq $0x8, %rbx
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r14
jmp 0x35340
cmpb $0x1, (%rsi)
jne 0x57e57
addq $0x70, %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x57dcf
addq $0x8, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x35340
jmp 0x57e73
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x57ca8
addq $0x8, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x35340
leaq 0x8(%rsp), %rdi
callq 0x35730
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x35730
jmp 0x57ea1
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x35730
movq %rbx, %rdi
callq 0x35b50
movq %rax, %rdi
callq 0x3a198
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_split.cpp
// Function: BamTools::SplitTool::SplitToolPrivate::OpenReader()
bool SplitTool::SplitToolPrivate::OpenReader(void) {

    // attempt to open BAM file
    if ( !m_reader.Open(m_settings->InputFilename) ) {
        cerr << "bamtools split ERROR: could not open BAM file: " << m_settings->InputFilename << endl;
        return false;
    }

    // save file 'metadata' & return success
    m_header     = m_reader.GetHeaderText();
    m_references = m_reader.GetReferenceData();
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
leaq 0x28(%rdi), %r15
movq (%rdi), %rsi
addq $0x70, %rsi
movq %r15, %rdi
callq 0x357b0
movl %eax, %ebx
testb %al, %al
je 0x57f18
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x351f0
leaq 0x30(%r14), %rdi
movq %r12, %rsi
callq 0x35340
leaq 0x8(%rsp), %rdi
callq 0x35730
movq %r15, %rdi
callq 0x35080
addq $0x50, %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x3a1a4
jmp 0x57f42
movq 0x3d0c1(%rip), %rdi     # 0x94fe0
leaq 0x1cda6(%rip), %rsi     # 0x74ccc
callq 0x355b0
movq (%r14), %rsi
addq $0x70, %rsi
movq %rax, %rdi
callq 0x35510
movq %rax, %rdi
callq 0x35300
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x35730
movq %rbx, %rdi
callq 0x35b50
movq %rax, %rdi
callq 0x3a198
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_split.cpp
// Function: BamTools::SplitTool::SplitToolPrivate::Run()
bool SplitTool::SplitToolPrivate::Run(void) {
  
    // determine output stub
    DetermineOutputFilenameStub();

    // open up BamReader
    if ( !OpenReader() )
        return false;
    
    // determine split type from settings
    if ( m_settings->IsSplittingMapped )    return SplitMapped();
    if ( m_settings->IsSplittingPaired )    return SplitPaired();
    if ( m_settings->IsSplittingReference ) return SplitReference();
    if ( m_settings->IsSplittingTag )       return SplitTag();

    // if we get here, no property was specified 
    cerr << "bamtools split ERROR: no property given to split on... " << endl
         << "Please use -mapped, -paired, -reference, or -tag TAG to specify desired split behavior." << endl;
    return false;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x57e06
movq %rbx, %rdi
callq 0x57eb2
testb %al, %al
je 0x57ff4
movq (%rbx), %rax
cmpb $0x1, 0x5(%rax)
jne 0x57f95
movq %rbx, %rdi
popq %rbx
jmp 0x57ff8
cmpb $0x1, 0x6(%rax)
jne 0x57fa4
movq %rbx, %rdi
popq %rbx
jmp 0x5823a
cmpb $0x1, 0x7(%rax)
jne 0x57fb3
movq %rbx, %rdi
popq %rbx
jmp 0x5847c
cmpb $0x1, 0x8(%rax)
jne 0x57fc2
movq %rbx, %rdi
popq %rbx
jmp 0x58830
movq 0x3d017(%rip), %rdi     # 0x94fe0
leaq 0x1cd2c(%rip), %rsi     # 0x74cfc
callq 0x355b0
movq %rax, %rdi
callq 0x35300
leaq 0x1cd50(%rip), %rsi     # 0x74d34
movq %rax, %rdi
callq 0x355b0
movq %rax, %rdi
callq 0x35300
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_split.cpp
// Function: BamTools::SplitTool::~SplitTool()
SplitTool::~SplitTool(void) {
    
    delete m_settings;
    m_settings = 0;
    
    delete m_impl;
    m_impl = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x3b77c(%rip), %rax     # 0x94ba0
movq %rax, (%rdi)
movq 0x8(%rdi), %rbx
testq %rbx, %rbx
je 0x59438
movq %rbx, %rdi
callq 0x5f134
movq %rbx, %rdi
callq 0x35570
andq $0x0, 0x8(%r14)
movq 0x10(%r14), %rbx
testq %rbx, %rbx
je 0x59456
movq %rbx, %rdi
callq 0x5f1dc
movq %rbx, %rdi
callq 0x35570
andq $0x0, 0x10(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
jmp 0x5946d
movq %rax, %r14
movq %rbx, %rdi
callq 0x35570
movq %r14, %rdi
callq 0x35b50
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_split.cpp
// Function: BamTools::SplitTool::Run(int, char**)
int SplitTool::Run(int argc, char* argv[]) {
  
    // parse command line arguments
    Options::Parse(argc, argv, 1);
    
    // initialize SplitTool with settings
    m_impl = new SplitToolPrivate(m_settings);
    
    // run SplitTool, return success/fail
    if ( m_impl->Run() ) 
        return 0;
    else 
        return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %rax
movl %esi, %edi
movq %rdx, %rsi
movl %eax, %edx
callq 0x6595a
pushq $0x68
popq %rdi
callq 0x355d0
movq %rax, %r14
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x5f264
movq %r14, 0x10(%rbx)
movq %r14, %rdi
callq 0x57f6e
xorb $0x1, %al
movzbl %al, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x35570
movq %rbx, %rdi
callq 0x35b50
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_split.cpp
// Function: void BamTools::SplitTool::SplitToolPrivate::CloseWriters<bool>(std::map<bool, BamTools::BamWriter*, std::less<bool>, std::allocator<std::pair<bool const, BamTools::BamWriter*>>>&)
void SplitTool::SplitToolPrivate::CloseWriters(map<T, BamWriter*>& writers) {
  
    typedef map<T, BamWriter*> WriterMap;
    typedef typename WriterMap::iterator WriterMapIterator;
  
    // iterate over writers
    WriterMapIterator writerIter = writers.begin();
    WriterMapIterator writerEnd  = writers.end();
    for ( ; writerIter != writerEnd; ++writerIter ) {
        BamWriter* writer = (*writerIter).second;
        if ( writer == 0 ) continue;

        // close BamWriter
        writer->Close();

        // destroy BamWriter
        delete writer;
        writer = 0;
    }

    // clear the container (destroying the items doesn't remove them)
    writers.clear();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq 0x18(%rsi), %r14
leaq 0x8(%rsi), %r12
cmpq %r12, %r14
je 0x59558
movq 0x28(%r14), %r15
testq %r15, %r15
je 0x5954b
movq %r15, %rdi
callq 0x35360
movq %r15, %rdi
callq 0x35420
movq %r15, %rdi
callq 0x35570
movq %r14, %rdi
callq 0x35410
movq %rax, %r14
jmp 0x59525
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5f4ee
movq %rax, %rbx
movq %r15, %rdi
callq 0x35570
movq %rbx, %rdi
callq 0x35b50
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_stats.cpp
// Function: BamTools::StatsTool::StatsToolPrivate::ProcessAlignment(BamTools::BamAlignment const&)
void StatsTool::StatsToolPrivate::ProcessAlignment(const BamAlignment& al) {
  
    // increment total alignment counter
    ++m_numReads;
    
    // incrememt counters for pairing-independent flags
    if ( al.IsDuplicate() ) ++m_numDuplicates;
    if ( al.IsFailedQC()  ) ++m_numFailedQC;
    if ( al.IsMapped()    ) ++m_numMapped;
    
    // increment strand counters
    if ( al.IsReverseStrand() ) 
        ++m_numReverseStrand;
    else 
        ++m_numForwardStrand;
    
    // if alignment is paired-end
    if ( al.IsPaired() ) {
      
        // increment PE counter
        ++m_numPaired;
      
        // increment first mate/second mate counters
        if ( al.IsFirstMate()  ) ++m_numFirstMate;
        if ( al.IsSecondMate() ) ++m_numSecondMate;
        
        // if alignment is mapped, check mate status
        if ( al.IsMapped() ) {
            // if mate mapped
            if ( al.IsMateMapped() ) 
                ++m_numBothMatesMapped;
            // else singleton
            else 
                ++m_numSingletons;
        }
        
        // check for explicit proper pair flag
        if ( al.IsProperPair() )
            ++m_numProperPair;
        
        // store insert size for first mate 
        if ( m_settings->IsShowingInsertSizeSummary && al.IsFirstMate() && (al.InsertSize != 0) ) {
            int insertSize = abs(al.InsertSize);
            m_insertSizes.push_back( insertSize );
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
incl 0x8(%rdi)
movq %rsi, %rdi
callq 0x35bc0
testb %al, %al
je 0x62e90
incl 0x34(%rbx)
movq %r14, %rdi
callq 0x35640
testb %al, %al
je 0x62e9f
incl 0x30(%rbx)
movq %r14, %rdi
callq 0x350c0
testb %al, %al
je 0x62eae
incl 0x14(%rbx)
movq %r14, %rdi
callq 0x35830
testb %al, %al
je 0x62ebf
incl 0x20(%rbx)
jmp 0x62ec2
incl 0x1c(%rbx)
movq %r14, %rdi
callq 0x35320
testb %al, %al
je 0x62f5c
incl 0xc(%rbx)
movq %r14, %rdi
callq 0x352c0
testb %al, %al
je 0x62ee4
incl 0x24(%rbx)
movq %r14, %rdi
callq 0x35ba0
testb %al, %al
je 0x62ef3
incl 0x28(%rbx)
movq %r14, %rdi
callq 0x350c0
testb %al, %al
je 0x62f13
movq %r14, %rdi
callq 0x356d0
testb %al, %al
je 0x62f10
incl 0x18(%rbx)
jmp 0x62f13
incl 0x2c(%rbx)
movq %r14, %rdi
callq 0x35c20
testb %al, %al
je 0x62f22
incl 0x10(%rbx)
movq (%rbx), %rax
cmpb $0x1, 0x2(%rax)
jne 0x62f5c
movq %r14, %rdi
callq 0x352c0
testb %al, %al
je 0x62f5c
movl 0xd8(%r14), %eax
testl %eax, %eax
je 0x62f5c
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
leaq 0x4(%rsp), %rsi
movl %ecx, (%rsi)
addq $0x38, %rbx
movq %rbx, %rdi
callq 0x526f8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_stats.cpp
// Function: BamTools::StatsTool::~StatsTool()
StatsTool::~StatsTool(void) {

    delete m_settings;
    m_settings = 0;
    
    delete m_impl;
    m_impl = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x316b6(%rip), %rax     # 0x94be8
movq %rax, (%rdi)
movq 0x8(%rdi), %rbx
testq %rbx, %rbx
je 0x63546
movq %rbx, %rdi
callq 0x63662
movq %rbx, %rdi
callq 0x35570
andq $0x0, 0x8(%r14)
movq 0x10(%r14), %rbx
testq %rbx, %rbx
je 0x63565
leaq 0x38(%rbx), %rdi
callq 0x52412
movq %rbx, %rdi
callq 0x35570
andq $0x0, 0x10(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
jmp 0x6357c
movq %rax, %r14
movq %rbx, %rdi
callq 0x35570
movq %r14, %rdi
callq 0x35b50
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_stats.cpp
// Function: BamTools::StatsTool::Run(int, char**)
int StatsTool::Run(int argc, char* argv[]) {
  
    // parse command line arguments
    Options::Parse(argc, argv, 1);
    
    // initialize StatsTool with settings
    m_impl = new StatsToolPrivate(m_settings);
    
    // run StatsTool, return success/fail
    if ( m_impl->Run() )
        return 0;
    else
        return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %rax
movl %esi, %edi
movq %rdx, %rsi
movl %eax, %edx
callq 0x6595a
pushq $0x50
popq %rdi
callq 0x355d0
movq %rax, %r14
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x6286c
movq %r14, 0x10(%rbx)
movq %r14, %rdi
callq 0x62f64
xorb $0x1, %al
movzbl %al, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x35570
movq %rbx, %rdi
callq 0x35b50
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/toolkit/bamtools.cpp
// Function: Version()
int Version(void) {

    stringstream versionStream("");
    versionStream << BAMTOOLS_VERSION_MAJOR << "."
                  << BAMTOOLS_VERSION_MINOR << "."
                  << BAMTOOLS_VERSION_BUILD;

    cout << endl;
    cout << "bamtools " << versionStream.str() << endl;
    cout << "Part of BamTools API and toolkit" << endl;
    cout << "Primary authors: Derek Barnett, Erik Garrison, Michael Stromberg" << endl;
    cout << "(c) 2009-2012 Marth Lab, Biology Dept., Boston College" << endl;
    cout << endl;
    return EXIT_SUCCESS;
}

// Assembly:
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
leaq 0x12c65(%rip), %rsi     # 0x767f7
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x35280
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $0x18
popq %rdx
callq 0x359e0
leaq 0x8(%rsp), %rdi
callq 0x35730
leaq 0x38(%rsp), %rdi
pushq $0x2
popq %rsi
callq 0x35b00
leaq 0x1254d(%rip), %rsi     # 0x7611e
movq %rax, %rdi
callq 0x355b0
pushq $0x4
popq %rsi
movq %rax, %rdi
callq 0x35b00
leaq 0x12533(%rip), %rsi     # 0x7611e
movq %rax, %rdi
callq 0x355b0
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x35b00
movq 0x31393(%rip), %rdi     # 0x94f98
callq 0x35300
movq 0x31387(%rip), %rdi     # 0x94f98
leaq 0x11e9f(%rip), %rsi     # 0x75ab7
callq 0x355b0
movq %rax, %rbx
leaq 0x40(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x359c0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x35510
movq %rax, %rdi
callq 0x35300
leaq 0x8(%rsp), %rdi
callq 0x35730
movq 0x31343(%rip), %rdi     # 0x94f98
leaq 0x11e65(%rip), %rsi     # 0x75ac1
callq 0x355b0
movq %rax, %rdi
callq 0x35300
movq 0x31328(%rip), %rdi     # 0x94f98
leaq 0x11e6b(%rip), %rsi     # 0x75ae2
callq 0x355b0
movq %rax, %rdi
callq 0x35300
movq 0x3130d(%rip), %rdi     # 0x94f98
leaq 0x11e91(%rip), %rsi     # 0x75b23
callq 0x355b0
movq %rax, %rdi
callq 0x35300
movq 0x312f2(%rip), %rdi     # 0x94f98
callq 0x35300
leaq 0x28(%rsp), %rdi
callq 0x35490
xorl %eax, %eax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x35730
jmp 0x63cf2
jmp 0x63ce5
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x35730
jmp 0x63ce8
movq %rax, %rbx
jmp 0x63cf2
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x35490
movq %rbx, %rdi
callq 0x35b50
movq %rax, %rdi
callq 0x3a198
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/toolkit/bamtools.cpp
// Function: main
int main(int argc, char* argv[]) {

    // just 'bamtools'
    if ( argc == 1 ) return Help(argc, argv);
    
    // 'bamtools help', 'bamtools --help', or 'bamtools -h'
    if ( IsHelp(argv[1]) ) return Help(argc, argv); 
    
    // 'bamtools version', 'bamtools --version', or 'bamtools -v'
    if ( IsVersion(argv[1]) ) return Version(); 
        
    // determine desired sub-tool, run if found
    AbstractTool* tool = CreateTool( argv[1] );
    if ( tool ) return tool->Run(argc, argv);

    // no tool matched, show help
    return Help(argc, argv);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
cmpl $0x1, %edi
jne 0x63d17
pushq $0x1
popq %rdi
jmp 0x63d58
movl %edi, %ebp
movq 0x8(%rbx), %r14
leaq 0x32834(%rip), %rsi     # 0x96558
movq %r14, %rdi
callq 0x63e1e
testb %al, %al
jne 0x63d56
leaq 0x32841(%rip), %rsi     # 0x96578
movq %r14, %rdi
callq 0x63e1e
testb %al, %al
jne 0x63d56
leaq 0x3284e(%rip), %rsi     # 0x96598
movq %r14, %rdi
callq 0x63e1e
testb %al, %al
je 0x63d68
movl %ebp, %edi
movq %rbx, %rsi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x6397f
movq 0x8(%rbx), %r14
leaq 0x32845(%rip), %rsi     # 0x965b8
movq %r14, %rdi
callq 0x63e1e
testb %al, %al
jne 0x63da5
leaq 0x32852(%rip), %rsi     # 0x965d8
movq %r14, %rdi
callq 0x63e1e
testb %al, %al
jne 0x63da5
leaq 0x3285f(%rip), %rsi     # 0x965f8
movq %r14, %rdi
callq 0x63e1e
testb %al, %al
je 0x63db5
callq 0x63b83
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x8(%rbx), %rsi
leaq 0x10(%rsp), %r14
leaq 0xf(%rsp), %rdx
movq %r14, %rdi
callq 0x35280
movq %r14, %rdi
callq 0x63720
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x35730
testq %r14, %r14
je 0x63df5
movq (%r14), %rax
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq *0x18(%rax)
jmp 0x63dac
movl %ebp, %edi
movq %rbx, %rsi
callq 0x6397f
jmp 0x63dac
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x35730
movq %rbx, %rdi
callq 0x35b50
movq %rax, %rdi
callq 0x3a198
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/utils/bamtools_fasta.cpp
// Function: BamTools::Fasta::FastaPrivate::Close()
bool Fasta::FastaPrivate::Close(void) {
 
    // close fasta file
    if ( IsOpen ) {
        fclose(Stream);
        IsOpen = false;
    }

    // close index file
    if ( HasIndex && IsIndexOpen ) {
        fclose(IndexStream);
        HasIndex = false;
        IsIndexOpen = false;
    }
  
    // return success
    return true;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpb $0x1, 0x8(%rdi)
jne 0x63e76
movq (%rbx), %rdi
callq 0x355c0
movb $0x0, 0x8(%rbx)
cmpb $0x1, 0x18(%rbx)
jne 0x63e90
cmpb $0x1, 0x19(%rbx)
jne 0x63e90
movq 0x10(%rbx), %rdi
callq 0x355c0
andw $0x0, 0x18(%rbx)
movb $0x1, %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/utils/bamtools_fasta.cpp
// Function: BamTools::Fasta::FastaPrivate::Chomp(char*)
void Fasta::FastaPrivate::Chomp(char* sequence) {
  
    static const int CHAR_LF = 10;
    static const int CHAR_CR = 13;
  
    int seqLength = strlen(sequence);
    if ( seqLength == 0 ) return;
    --seqLength; // ignore null terminator
  
    while ( sequence[seqLength] == CHAR_LF || 
            sequence[seqLength] == CHAR_CR 
          ) 
    {
        sequence[seqLength] = 0;
        --seqLength;
        if (seqLength < 0) 
            break;
    }
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movq %rsi, %rdi
callq 0x352d0
testl %eax, %eax
je 0x63ec6
cltq
incq %rax
movzbl -0x2(%rbx,%rax), %ecx
cmpl $0xd, %ecx
je 0x63eb8
cmpl $0xa, %ecx
jne 0x63ec6
movb $0x0, -0x2(%rbx,%rax)
decq %rax
cmpq $0x1, %rax
jg 0x63ea9
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/utils/bamtools_fasta.cpp
// Function: BamTools::Fasta::FastaPrivate::GetNextHeader(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool Fasta::FastaPrivate::GetNextHeader(string& header) {
  
    // validate input stream
    if ( !IsOpen || feof(Stream) ) 
        return false;
    
    // read in header line
    char buffer[1024];
    if ( fgets(buffer, 1024, Stream) == 0 ) {
        cerr << "FASTA error : could not read from file" << endl;
        return false;
    }
    
    // make sure it's a FASTA header
    if ( buffer[0] != '>' ) { 
        cerr << "FASTA error : expected header ('>'), instead : " << buffer[0] << endl;
        return false;
    }
  
    // import buffer contents to header string
    stringstream headerBuffer("");
    headerBuffer << buffer;
    header = headerBuffer.str();
  
    // return success
    return true;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x5b8, %rsp            # imm = 0x5B8
cmpb $0x1, 0x8(%rdi)
jne 0x642e0
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x35920
testl %eax, %eax
jne 0x642e0
movq (%r14), %rdx
leaq 0x1b0(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x359a0
testq %rax, %rax
je 0x642a0
cmpb $0x3e, 0x1b0(%rsp)
jne 0x642b5
leaq 0x125c8(%rip), %rsi     # 0x767f7
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x35280
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $0x18
popq %rdx
callq 0x359e0
leaq 0x8(%rsp), %rdi
callq 0x35730
leaq 0x38(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x355b0
leaq 0x40(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x359c0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x35340
leaq 0x8(%rsp), %rdi
callq 0x35730
leaq 0x28(%rsp), %rdi
callq 0x35490
movb $0x1, %al
jmp 0x642e2
movq 0x30d39(%rip), %rdi     # 0x94fe0
leaq 0x1190d(%rip), %rsi     # 0x75bbb
callq 0x355b0
jmp 0x642d8
movq 0x30d24(%rip), %rdi     # 0x94fe0
leaq 0x1191f(%rip), %rsi     # 0x75be2
callq 0x355b0
movsbl 0x1b0(%rsp), %esi
movq %rax, %rdi
callq 0x356e0
movq %rax, %rdi
callq 0x35300
xorl %eax, %eax
addq $0x5b8, %rsp            # imm = 0x5B8
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x35730
jmp 0x64310
jmp 0x6430d
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x35730
jmp 0x6431f
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x35490
jmp 0x6431f
movq %rax, %rbx
movq %rbx, %rdi
callq 0x35b50
movq %rax, %rdi
callq 0x3a198
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/utils/bamtools_fasta.cpp
// Function: BamTools::Fasta::FastaPrivate::GetNameFromHeader(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool Fasta::FastaPrivate::GetNameFromHeader(const string& header, string& name) {

    // get rid of the leading greater than sign
    string s = header.substr(1);

    // extract the first non-whitespace segment
    char* pName = (char*)s.data();
    unsigned int nameLen = (unsigned int)s.size();

    unsigned int start = 0;
    while ( (pName[start] == 32) || (pName[start] == 9) || (pName[start] == 10) || (pName[start] == 13) ) {
        start++;
        if ( start == nameLen ) 
            break;
    }

    unsigned int stop  = start;
    if ( stop < nameLen ) {
        while( (pName[stop] != 32) && (pName[stop] != 9) && (pName[stop] != 10) && (pName[stop] != 13) ) {
            stop++;
            if ( stop == nameLen ) 
                break;
        }
    }

    if ( start == stop ) {
        cerr << "FASTA error : could not parse read name from FASTA header" << endl;
        return false;
    }

    name = s.substr(start, stop - start).c_str();
    return true;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
leaq 0x28(%rsp), %r14
pushq $0x1
popq %rdx
pushq $-0x1
popq %rcx
movq %r14, %rdi
callq 0x35600
movq (%r14), %rsi
movq 0x8(%r14), %rax
xorl %edx, %edx
movabsq $0x100002600, %rdi      # imm = 0x100002600
movzbl (%rsi,%rdx), %ecx
cmpq $0x20, %rcx
ja 0x643a8
btq %rcx, %rdi
jae 0x643a8
incq %rdx
cmpl %edx, %eax
jne 0x64360
movq 0x30c62(%rip), %rdi     # 0x94fe0
leaq 0x1188d(%rip), %rsi     # 0x75c12
callq 0x355b0
movq %rax, %rdi
callq 0x35300
xorl %ebx, %ebx
leaq 0x28(%rsp), %rdi
callq 0x35730
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
cmpl %eax, %edx
jae 0x64377
movl %edx, %ecx
movl %ecx, %r8d
movzbl (%rsi,%r8), %r8d
cmpq $0x20, %r8
ja 0x643c2
btq %r8, %rdi
jb 0x643ca
incl %ecx
cmpl %ecx, %eax
jne 0x643ae
movl %eax, %ecx
cmpl %edx, %ecx
je 0x64377
subl %edx, %ecx
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x35600
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x35c40
leaq 0x8(%rsp), %rdi
callq 0x35730
movb $0x1, %bl
jmp 0x64394
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x35730
jmp 0x6440e
jmp 0x6440b
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x35730
movq %rbx, %rdi
callq 0x35b50
movq %rax, %rdi
callq 0x3a198
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/utils/bamtools_fasta.cpp
// Function: BamTools::Fasta::FastaPrivate::GetNextSequence(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool Fasta::FastaPrivate::GetNextSequence(string& sequence) {
  
    // validate input stream
    if ( !IsOpen || feof(Stream) ) 
        return false;
    
    // read in sequence  
    char buffer[1024];
    ostringstream seqBuffer("");
    while(true) {
        
        char ch = fgetc(Stream);
        ungetc(ch, Stream);
        if( (ch == '>') || feof(Stream) ) 
              break;       
        
        if ( fgets(buffer, 1024, Stream) == 0 ) {
            cerr << "FASTA error : could not read from file" << endl;
            return false;
        }
        
        Chomp(buffer);
        seqBuffer << buffer;
    }
    
    // import buffer contents to sequence string
    sequence = seqBuffer.str();
  
    // return success
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x5a0, %rsp            # imm = 0x5A0
cmpb $0x1, 0x8(%rdi)
jne 0x6444f
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x35920
testl %eax, %eax
je 0x64463
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x5a0, %rsp            # imm = 0x5A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1238d(%rip), %rsi     # 0x767f7
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x35280
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $0x10
popq %rdx
callq 0x35850
leaq 0x8(%rsp), %rdi
callq 0x35730
leaq 0x1a0(%rsp), %r15
leaq 0x28(%rsp), %r12
movq (%r14), %rdi
callq 0x35970
movsbl %al, %edi
movl %eax, %ebp
shll $0x18, %ebp
movq (%r14), %rsi
callq 0x350d0
cmpl $0x3e000000, %ebp       # imm = 0x3E000000
je 0x644f8
movq (%r14), %rdi
callq 0x35920
testl %eax, %eax
jne 0x644f8
movq (%r14), %rdx
movq %r15, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x359a0
testq %rax, %rax
je 0x64522
movq %r15, %rsi
callq 0x63e94
movq %r12, %rdi
movq %r15, %rsi
callq 0x355b0
jmp 0x644a2
leaq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x359c0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x35340
leaq 0x8(%rsp), %rdi
callq 0x35730
movb $0x1, %bl
jmp 0x6453f
movq 0x30ab7(%rip), %rdi     # 0x94fe0
leaq 0x1168b(%rip), %rsi     # 0x75bbb
callq 0x355b0
movq %rax, %rdi
callq 0x35300
xorl %ebx, %ebx
leaq 0x28(%rsp), %rdi
callq 0x35160
jmp 0x64451
jmp 0x64575
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x35730
jmp 0x64578
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x35730
jmp 0x64582
jmp 0x64575
movq %rax, %rbx
jmp 0x64582
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x35160
movq %rbx, %rdi
callq 0x35b50
movq %rax, %rdi
callq 0x3a198
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/utils/bamtools_fasta.cpp
// Function: BamTools::Fasta::FastaPrivate::WriteIndexData()
bool Fasta::FastaPrivate::WriteIndexData(void) {
 
    // skip if no index file available
    if ( !IsIndexOpen ) return false; 
  
    // iterate over index entries
    bool success = true;
    stringstream indexBuffer;
    vector<FastaIndexData>::const_iterator indexIter = Index.begin();
    vector<FastaIndexData>::const_iterator indexEnd  = Index.end();
    for ( ; indexIter != indexEnd; ++indexIter ) {
      
        // clear stream
        indexBuffer.str("");
      
        // write data to stream
        const FastaIndexData& data = (*indexIter);
        indexBuffer << data.Name << "\t"
                    << data.Length << "\t"
                    << data.Offset << "\t"
                    << data.LineLength << "\t"
                    << data.ByteLength << endl;
                    
        // write stream to file
        success &= ( fputs(indexBuffer.str().c_str(), IndexStream) >= 0 );
    }
  
    // return success status
    return success;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
cmpb $0x1, 0x19(%rdi)
jne 0x646c2
movq %rdi, %rbx
leaq 0x40(%rsp), %rdi
callq 0x35430
movq 0x20(%rbx), %r15
movq %rbx, 0x10(%rsp)
movq 0x28(%rbx), %rax
movq %rax, 0x18(%rsp)
leaq 0x58(%rsp), %r12
movb $0x1, %bl
leaq 0x20(%rsp), %r13
leaq 0x12217(%rip), %rbp     # 0x767f6
cmpq 0x18(%rsp), %r15
je 0x646c6
movq %r13, %rdi
leaq 0x12203(%rip), %rsi     # 0x767f7
leaq 0xf(%rsp), %rdx
callq 0x35280
movq %r12, %rdi
movq %r13, %rsi
callq 0x358d0
movq %r13, %rdi
callq 0x35730
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x35510
movq %rax, %rdi
movq %rbp, %rsi
callq 0x355b0
movl 0x20(%r15), %esi
movq %rax, %rdi
callq 0x35b00
movq %rax, %rdi
movq %rbp, %rsi
callq 0x355b0
movq 0x28(%r15), %rsi
movq %rax, %rdi
callq 0x35580
movq %rax, %rdi
movq %rbp, %rsi
callq 0x355b0
movl 0x30(%r15), %esi
movq %rax, %rdi
callq 0x35b00
movq %rax, %rdi
movq %rbp, %rsi
callq 0x355b0
movl 0x34(%r15), %esi
movq %rax, %rdi
callq 0x35b00
movq %rax, %rdi
callq 0x35300
movq %r13, %rdi
movq %r12, %r14
movq %r12, %rsi
callq 0x359c0
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rsi
callq 0x35680
movl %eax, %r12d
movq %r13, %rdi
callq 0x35730
testl %r12d, %r12d
setns %al
andb %al, %bl
addq $0x38, %r15
movq %r14, %r12
jmp 0x645df
xorl %ebx, %ebx
jmp 0x646d0
leaq 0x40(%rsp), %rdi
callq 0x35490
andb $0x1, %bl
movl %ebx, %eax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x35730
jmp 0x646fd
jmp 0x646fa
jmp 0x646fa
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x35490
movq %rbx, %rdi
callq 0x35b50
movq %rax, %rdi
callq 0x3a198
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/utils/bamtools_fasta.cpp
// Function: BamTools::Fasta::FastaPrivate::Open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool Fasta::FastaPrivate::Open(const string& filename, const string& indexFilename) {
 
    bool success = true;
  
    // open FASTA filename
    Stream = fopen(filename.c_str(), "rb");
    if ( !Stream ) {
        cerr << "FASTA error: Could not open " << filename << " for reading" << endl;
        return false;
    }
    IsOpen = true;
    success &= IsOpen;
    
    // open index file if it exists
    if ( !indexFilename.empty() ) {
        IndexStream = fopen(indexFilename.c_str(), "rb");
        if ( !IndexStream ) {
            cerr << "FASTA error : Could not open " << indexFilename << " for reading." << endl;
            return false;
        }
        IsIndexOpen = true;
        success &= IsIndexOpen;
        
        // attempt to load index data
        HasIndex = LoadIndexData();
        success &= HasIndex;
    }
    
    // return success status
    return success;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq (%rsi), %rdi
leaq 0xce3c(%rip), %rsi      # 0x71c7e
callq 0x35670
movq %rax, (%r14)
testq %rax, %rax
je 0x64e86
movb $0x1, 0x8(%r14)
cmpq $0x0, 0x8(%rbx)
je 0x64ead
movq (%rbx), %rdi
leaq 0xce19(%rip), %rsi      # 0x71c7e
callq 0x35670
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0x64eb1
movb $0x1, 0x19(%r14)
movq %r14, %rdi
callq 0x64c6c
movb %al, 0x18(%r14)
jmp 0x64ee8
movq 0x30153(%rip), %rdi     # 0x94fe0
leaq 0x10f89(%rip), %rsi     # 0x75e1d
callq 0x355b0
movq %rax, %rdi
movq %r15, %rsi
callq 0x35510
leaq 0x10e1b(%rip), %rsi     # 0x75cc6
jmp 0x64ed6
movb $0x1, %al
jmp 0x64ee8
movq 0x30128(%rip), %rdi     # 0x94fe0
leaq 0x10dce(%rip), %rsi     # 0x75c8d
callq 0x355b0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x35510
leaq 0xcef2(%rip), %rsi      # 0x71dc8
movq %rax, %rdi
callq 0x355b0
movq %rax, %rdi
callq 0x35300
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/utils/bamtools_options.cpp
// Function: BamTools::Options::AddOption(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool&, BamTools::OptionGroup*)
void Options::AddOption(const string& argument,
                        const string& optionDescription,
                        bool& foundArgument,
                        OptionGroup* group)
{
    Option o;
    o.Argument    = argument;
    o.Description = optionDescription;
    o.StoreValue  = false;
    group->Options.push_back(o);

    OptionValue ov;
    ov.pFoundArgument = &foundArgument;
    ov.StoreValue     = false;

    m_optionsMap[argument] = ov;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rcx, %r15
movq %rdx, %rbx
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rsi, %r12
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rdi, %r14
movb %cl, (%rax)
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
movw $0x1, 0x10(%rax)
andq $0x0, 0x18(%rax)
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x35340
leaq 0x48(%rsp), %rdi
movq %r12, %rsi
callq 0x35340
leaq 0x8(%rsp), %rsi
movb $0x0, 0x60(%rsi)
addq $0x20, %r15
movq %r15, %rdi
callq 0x3b1f8
leaq 0x98(%rsp), %rax
andq $0x0, -0x18(%rax)
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
andw $0x0, 0x10(%rax)
movb %cl, 0x12(%rax)
andq $0x0, 0x18(%rax)
movq %rbx, -0x20(%rax)
leaq 0x312fc(%rip), %rdi     # 0x96698
movq %r14, %rsi
callq 0x3b2fa
leaq 0x78(%rsp), %rsi
movq %rax, %rdi
callq 0x3b3ca
leaq 0x78(%rsp), %rdi
callq 0x3b412
leaq 0x8(%rsp), %rdi
callq 0x3b454
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x653e5
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x3b412
jmp 0x653e8
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3b454
movq %rbx, %rdi
callq 0x35b50
movq %rax, %rdi
callq 0x3a198
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/utils/bamtools_pileup_engine.cpp
// Function: BamTools::PileupEngine::PileupEnginePrivate::ApplyVisitors()
void PileupEngine::PileupEnginePrivate::ApplyVisitors(void) {
  
    // parse CIGAR data in BamAlignments to build up current pileup data
    CreatePileupData();
  
    // apply all visitors to current alignment set
    vector<PileupVisitor*>::const_iterator visitorIter = Visitors.begin();
    vector<PileupVisitor*>::const_iterator visitorEnd  = Visitors.end();
    for ( ; visitorIter != visitorEnd; ++visitorIter ) 
        (*visitorIter)->Visit(CurrentPileupData);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x667a8
movq 0x48(%rbx), %r14
movq 0x50(%rbx), %r15
addq $0x20, %rbx
cmpq %r15, %r14
je 0x667a2
movq (%r14), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x10(%rax)
addq $0x8, %r14
jmp 0x6678b
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/utils/bamtools_pileup_engine.cpp
// Function: BamTools::PileupEngine::PileupEnginePrivate::CreatePileupData()
void PileupEngine::PileupEnginePrivate::CreatePileupData(void) {
  
    // remove any non-overlapping alignments
    ClearOldData();
  
    // set pileup refId, position to current markers
    CurrentPileupData.RefId = CurrentId;
    CurrentPileupData.Position = CurrentPosition;
    CurrentPileupData.PileupAlignments.clear();
    
    // parse CIGAR data in remaining alignments 
    vector<BamAlignment>::const_iterator alIter = CurrentAlignments.begin();
    vector<BamAlignment>::const_iterator alEnd  = CurrentAlignments.end(); 
    for ( ; alIter != alEnd; ++alIter )
        ParseAlignmentCigar( (*alIter) );
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x667ec
movq (%rbx), %rax
movq %rax, 0x20(%rbx)
leaq 0x28(%rbx), %rdi
callq 0x66c70
movq 0x8(%rbx), %r14
movq 0x10(%rbx), %r15
cmpq %r15, %r14
je 0x667e6
movq %rbx, %rdi
movq %r14, %rsi
callq 0x668b4
addq $0x158, %r14            # imm = 0x158
jmp 0x667cd
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/utils/bamtools_pileup_engine.cpp
// Function: BamTools::PileupEngine::PileupEnginePrivate::ClearOldData()
void PileupEngine::PileupEnginePrivate::ClearOldData(void) {
 
    // remove any alignments that end before our CurrentPosition
    // N.B. - BAM positions are 0-based, half-open. GetEndPosition() returns a 1-based position,
    //        while our CurrentPosition is 0-based. For example, an alignment with 'endPosition' of
    //        100 does not overlap a 'CurrentPosition' of 100, and should be discarded.

    size_t i = 0;
    size_t j = 0;
    const size_t numAlignments = CurrentAlignments.size();
    while ( i < numAlignments ) {

        // skip over alignment if its (1-based) endPosition is <= to (0-based) CurrentPosition
        // i.e. this entry will not be saved upon vector resize
        const int endPosition = CurrentAlignments[i].GetEndPosition();
        if ( endPosition <= CurrentPosition ) {
            ++i;
            continue;
        }

        // otherwise alignment ends after CurrentPosition
        // move it towards vector beginning, at index j
        if ( i != j )
            CurrentAlignments[j] = CurrentAlignments[i];

        // increment our indices
        ++i;
        ++j;
    }

    // 'squeeze' vector to size j, discarding all remaining alignments in the container
    CurrentAlignments.resize(j);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rdi, %r14
leaq 0x8(%rdi), %rbx
movq 0x10(%rdi), %rax
subq 0x8(%rdi), %rax
movl $0x158, %ecx            # imm = 0x158
cqto
idivq %rcx
movq %rax, %r12
xorl %r13d, %r13d
xorl %r15d, %r15d
xorl %ebp, %ebp
cmpq %rbp, %r12
je 0x66866
movq 0x8(%r14), %rdi
addq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x35530
cmpl 0x4(%r14), %eax
jle 0x6685a
cmpq %r15, %rbp
je 0x66857
movq (%rbx), %rax
leaq (%rax,%r13), %rsi
imulq $0x158, %r15, %rdi      # imm = 0x158
addq %rax, %rdi
callq 0x56026
incq %r15
incq %rbp
addq $0x158, %r13            # imm = 0x158
jmp 0x66821
movq %rsp, %r14
movq %r14, %rdi
callq 0x35200
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x66c30
movq %rsp, %rdi
callq 0x35940
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x35940
movq %rbx, %rdi
callq 0x35b50
movq %rax, %rdi
callq 0x3a198
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/utils/bamtools_utilities.cpp
// Function: BamTools::Utilities::ReverseComplement(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void Utilities::ReverseComplement(string& sequence) {
    
    // do complement, in-place
    size_t seqLength = sequence.length();
    for ( size_t i = 0; i < seqLength; ++i )
        sequence.replace(i, 1, 1, REVCOMP_LOOKUP[(int)sequence.at(i) - 65]);
    
    // reverse it
    Reverse(sequence);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %r12
xorl %r14d, %r14d
leaq 0xe45e(%rip), %r13      # 0x76120
pushq $0x1
popq %r15
cmpq %r14, %r12
je 0x67cf6
movq %rbx, %rdi
movq %r14, %rsi
callq 0x35c50
movsbq (%rax), %rax
movsbl -0x41(%rax,%r13), %r8d
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r15, %rcx
callq 0x35a30
incq %r14
jmp 0x67cc6
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x67c96
nop
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/utils/bamtools_utilities.cpp
// Function: BamTools::Utilities::Split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char)
vector<string> Utilities::Split(const string& source, const char delim) {

    stringstream ss(source);
    string field;
    vector<string> fields;

    while ( getline(ss, field, delim) )
        fields.push_back(field);
    return fields;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movl %edx, %ebp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
pushq $0x18
popq %rdx
movq %r14, %rdi
callq 0x359e0
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
andq $0x0, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movsbl %bpl, %ebp
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x35be0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x67d75
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3a16c
jmp 0x67d4d
movq %rsp, %rdi
callq 0x35730
leaq 0x20(%rsp), %rdi
callq 0x35490
movq %rbx, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x67db0
movq %rax, %r14
movq %rbx, %rdi
callq 0x3abf0
movq %rsp, %rdi
callq 0x35730
leaq 0x20(%rsp), %rdi
callq 0x35490
movq %r14, %rdi
callq 0x35b50
movq %rax, %rdi
callq 0x3a198
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/utils/bamtools_utilities.cpp
// Function: BamTools::Utilities::Split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
vector<string> Utilities::Split(const string& source, const string& delims) {

    vector<string> fields;

    char* tok;
    char* cchars = new char[source.size()+1];
    char* cstr = &cchars[0];
    strcpy(cstr, source.c_str());
    tok = strtok(cstr, delims.c_str());
    while (tok != NULL) {
        fields.push_back(tok);
        tok = strtok(NULL, delims.c_str());
    }

    delete[] cchars;

    return fields;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq 0x8(%rsi), %rdi
incq %rdi
callq 0x35030
movq %rax, %r15
movq (%r12), %rsi
movq %rax, %rdi
callq 0x35560
movq (%r14), %rsi
movq %r15, %rdi
callq 0x35960
leaq 0x10(%rsp), %r12
leaq 0xf(%rsp), %r13
testq %rax, %rax
je 0x67e4d
movq %r12, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x35280
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3a16c
movq %r12, %rdi
callq 0x35730
movq (%r14), %rsi
xorl %edi, %edi
callq 0x35960
jmp 0x67e1b
movq %r15, %rdi
callq 0x35770
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x67e77
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x35730
jmp 0x67e7a
movq %rax, %r14
movq %rbx, %rdi
callq 0x3abf0
movq %r14, %rdi
callq 0x35b50
movq %rax, %rdi
callq 0x3a198
// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/third_party/jsoncpp/json_reader.cpp
// Function: Json::Reader::parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, Json::Value&, bool)
bool
Reader::parse( const std::string &document, 
               Value &root,
               bool collectComments )
{
   document_ = document;
   const char *begin = document_.c_str();
   const char *end = begin + document_.length();
   return parse( begin, end, root, collectComments );
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %ecx, %ebx
movq %rdx, %r14
movq %rdi, %r15
addq $0xa0, %rdi
callq 0x35340
movq 0xa0(%r15), %rsi
movq 0xa8(%r15), %rdx
addq %rsi, %rdx
movq %r15, %rdi
movq %r14, %rcx
movl %ebx, %r8d
popq %rbx
popq %r14
popq %r15
jmp 0x680e8
nop