// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdi, %rbx
movq (%rdi), %r14
cmpb $0x0, (%r14)
jne 0x62f9b
cmpb $0x0, 0x1(%r14)
jne 0x62f9b
addq $0x8, %r14
callq 0x65ebe
movq %r14, %rdi
movq %rax, %rsi
callq 0x3a16c
movq (%rbx), %r14
cmpb $0x1, 0x1(%r14)
jne 0x63045
movq 0x20(%r14), %rsi
leaq 0x20(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x35bd0
leaq 0x98(%rsp), %rdi
callq 0x35130
movl %eax, %ebp
testb %al, %al
je 0x6300d
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x20(%rsp), %r14
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x35100
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x6302a
movq (%rbx), %rdi
addq $0x8, %rdi
movq %r15, %rsi
callq 0x3a16c
jmp 0x62fe3
movq 0x31fcc(%rip), %rdi     # 0x94fe0
leaq 0x1250f(%rip), %rsi     # 0x7552a
callq 0x355b0
movq %rax, %rdi
callq 0x35300
jmp 0x63032
movq %rsp, %rdi
callq 0x35730
leaq 0x20(%rsp), %rdi
callq 0x35170
testb %bpl, %bpl
je 0x630dc
movq %rsp, %r14
movq %r14, %rdi
callq 0x35b70
movq (%rbx), %rsi
addq $0x8, %rsi
movq %r14, %rdi
callq 0x353c0
movl %eax, %ebp
testb %al, %al
je 0x63093
leaq 0x20(%rsp), %rdi
callq 0x35200
movq %rsp, %r14
leaq 0x20(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x35140
testb %al, %al
je 0x630b8
movq %rbx, %rdi
movq %r15, %rsi
callq 0x62e74
jmp 0x63077
movq 0x31f46(%rip), %rdi     # 0x94fe0
leaq 0x124cf(%rip), %rsi     # 0x75570
callq 0x355b0
movq %rax, %rdi
callq 0x35300
movq %rsp, %rdi
callq 0x35190
jmp 0x630d2
movq %rsp, %rdi
callq 0x35190
movq %rbx, %rdi
callq 0x6295c
leaq 0x20(%rsp), %rdi
callq 0x35940
movq %rsp, %rdi
callq 0x35110
jmp 0x630de
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x630f0
movq %rax, %rbx
jmp 0x63109
jmp 0x63115
jmp 0x630f9
movq %rax, %rbx
jmp 0x63122
movq %rax, %rbx
movq %rsp, %rdi
callq 0x35730
leaq 0x20(%rsp), %rdi
callq 0x35170
jmp 0x6312a
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x35940
movq %rsp, %rdi
callq 0x35110
movq %rbx, %rdi
callq 0x35b50
movq %rax, %rdi
callq 0x3a198