// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_header.cpp
// Function: BamTools::HeaderTool::HeaderToolPrivate::Run()
bool HeaderTool::HeaderToolPrivate::Run(void) {

    // 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 header ERROR: could not open input BAM file list... Aborting." << endl;
            return false;
        }

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

    // attemp to open BAM files
    BamMultiReader reader;
    if ( !reader.Open(m_settings->InputFiles) ) {
        cerr << "bamtools header ERROR: could not open BAM file(s) for reading... Aborting." << endl;
        return false;
    }

    // dump (merged) header contents to stdout
    cout << reader.GetHeaderText() << endl;

    // clean up & exit
    reader.Close();
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdi, %rbx
movq (%rdi), %r14
cmpb $0x0, (%r14)
jne 0x42da4
cmpb $0x0, 0x1(%r14)
jne 0x42da4
addq $0x8, %r14
callq 0x641a2
movq %r14, %rdi
movq %rax, %rsi
callq 0x2e190
movq (%rbx), %r14
cmpb $0x1, 0x1(%r14)
jne 0x42ea3
movq 0x20(%r14), %rsi
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x27b90
leaq 0x98(%rsp), %rdi
callq 0x27130
testb %al, %al
je 0x42e34
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movq %rsp, %r15
movq 0x20(%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 0x42e8b
movq (%rbx), %rdi
addq $0x8, %rdi
movq %r15, %rsi
callq 0x2e190
jmp 0x42df1
movq 0x4c1a5(%rip), %rbx     # 0x8efe0
leaq 0x2f9d2(%rip), %rsi     # 0x72814
movl $0x46, %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 0x4c173(%rip), %rdi     # 0x8efe0
callq 0x27040
movq %rax, %rdi
callq 0x27410
leaq 0x20(%rsp), %rdi
callq 0x27170
xorl %ebx, %ebx
jmp 0x42f7b
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x42e99
callq 0x27560
leaq 0x20(%rsp), %rdi
callq 0x27170
movq %rsp, %r14
movq %r14, %rdi
callq 0x27b30
movq (%rbx), %rsi
addq $0x8, %rsi
movq %r14, %rdi
callq 0x273c0
movl %eax, %ebx
testb %al, %al
je 0x42f2d
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x274d0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x4c0af(%rip), %rdi     # 0x8ef90
callq 0x276b0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x27590
movsbl %al, %esi
movq %r14, %rdi
callq 0x27040
movq %rax, %rdi
callq 0x27410
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x42f23
callq 0x27560
movq %rsp, %rdi
callq 0x27190
jmp 0x42f73
movq 0x4c0ac(%rip), %r14     # 0x8efe0
leaq 0x2f920(%rip), %rsi     # 0x7285b
movl $0x4a, %edx
movq %r14, %rdi
callq 0x276b0
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x27590
movsbl %al, %esi
movq 0x4c07a(%rip), %rdi     # 0x8efe0
callq 0x27040
movq %rax, %rdi
callq 0x27410
movq %rsp, %rdi
callq 0x27110
movl %ebx, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x42fab
movq %rax, %rbx
jmp 0x42fc9
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x42fae
callq 0x27560
jmp 0x42fae
movq %rax, %rbx
movq %rsp, %rdi
callq 0x27110
jmp 0x42fd3
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x42fc9
callq 0x27560
leaq 0x20(%rsp), %rdi
callq 0x27170
movq %rbx, %rdi
callq 0x27b10
movq %rax, %rdi
callq 0x2e1cd
nop