// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_stats.cpp
// Function: BamTools::StatsTool::StatsToolPrivate::Run()
bool StatsTool::StatsToolPrivate::Run() {
  
    // set to default input if none provided
    if ( !m_settings->HasInput && !m_settings->HasInputFilelist )
        m_settings->InputFiles.push_back(Options::StandardIn());

    // add files in the filelist to the input file list
    if ( m_settings->HasInputFilelist ) {

        ifstream filelist(m_settings->InputFilelist.c_str(), ios::in);
        if ( !filelist.is_open() ) {
            cerr << "bamtools stats ERROR: could not open input BAM file list... Aborting." << endl;
            return false;
        }

        string line;
        while ( getline(filelist, line) )
            m_settings->InputFiles.push_back(line);
    }

    // open the BAM files
    BamMultiReader reader;
    if ( !reader.Open(m_settings->InputFiles) ) {
        cerr << "bamtools stats ERROR: could not open input BAM file(s)... Aborting." << endl;
        reader.Close();
        return false;
    }
    
    // plow through alignments, keeping track of stats
    BamAlignment al;
    while ( reader.GetNextAlignmentCore(al) )
        ProcessAlignment(al);
    reader.Close();
    
    // print stats & exit
    PrintStats();
    return true; 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
movq %rdi, %rbx
movq (%rdi), %r14
cmpb $0x0, (%r14)
jne 0x6033d
cmpb $0x0, 0x1(%r14)
jne 0x6033d
addq $0x8, %r14
callq 0x641a2
movq %r14, %rdi
movq %rax, %rsi
callq 0x2e190
movq (%rbx), %r14
cmpb $0x1, 0x1(%r14)
jne 0x6043f
movq 0x20(%r14), %rsi
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x27b90
leaq 0xa0(%rsp), %rdi
callq 0x27130
testb %al, %al
je 0x603cf
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq 0x8(%rsp), %r15
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x27590
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x27ba0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x60426
movq (%rbx), %rdi
addq $0x8, %rdi
movq %r15, %rsi
callq 0x2e190
jmp 0x6038c
movq 0x2ec0a(%rip), %rbx     # 0x8efe0
leaq 0x1518d(%rip), %rsi     # 0x7556a
movl $0x45, %edx
movq %rbx, %rdi
callq 0x276b0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x27590
movsbl %al, %esi
movq 0x2ebd8(%rip), %rdi     # 0x8efe0
callq 0x27040
movq %rax, %rdi
callq 0x27410
leaq 0x28(%rsp), %rdi
callq 0x27170
xorl %ebp, %ebp
jmp 0x60509
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x60435
callq 0x27560
leaq 0x28(%rsp), %rdi
callq 0x27170
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x27b30
movq (%rbx), %rsi
addq $0x8, %rsi
movq %r14, %rdi
callq 0x273c0
movl %eax, %ebp
testb %al, %al
je 0x60491
leaq 0x28(%rsp), %rdi
callq 0x27220
leaq 0x8(%rsp), %r14
leaq 0x28(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x27140
testb %al, %al
je 0x604e3
movq %rbx, %rdi
movq %r15, %rsi
callq 0x601fc
jmp 0x60475
movq 0x2eb48(%rip), %rbx     # 0x8efe0
leaq 0x15111(%rip), %rsi     # 0x755b0
movl $0x43, %edx
movq %rbx, %rdi
callq 0x276b0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x27590
movsbl %al, %esi
movq 0x2eb16(%rip), %rdi     # 0x8efe0
callq 0x27040
movq %rax, %rdi
callq 0x27410
leaq 0x8(%rsp), %rdi
callq 0x27190
jmp 0x604ff
leaq 0x8(%rsp), %rdi
callq 0x27190
movq %rbx, %rdi
callq 0x5f8f4
leaq 0x28(%rsp), %rdi
callq 0x27920
leaq 0x8(%rsp), %rdi
callq 0x27110
movl %ebp, %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x60529
jmp 0x60524
movq %rax, %rbx
jmp 0x60554
movq %rax, %rbx
jmp 0x60536
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x27920
leaq 0x8(%rsp), %rdi
callq 0x27110
jmp 0x6055e
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x60554
callq 0x27560
leaq 0x28(%rsp), %rdi
callq 0x27170
movq %rbx, %rdi
callq 0x27b10
movq %rax, %rdi
callq 0x2e1cd