// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdi, %rbx
movq (%rdi), %r14
cmpb $0x0, (%r14)
jne 0x4ba87
cmpb $0x0, 0x1(%r14)
jne 0x4ba87
addq $0x8, %r14
callq 0x65ebe
movq %r14, %rdi
movq %rax, %rsi
callq 0x3a16c
movq (%rbx), %r14
cmpb $0x1, 0x1(%r14)
jne 0x4bb2d
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 0x4baf9
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 0x4bb16
movq (%rbx), %rdi
addq $0x8, %rdi
movq %r15, %rsi
callq 0x3a16c
jmp 0x4bacf
movq 0x494e0(%rip), %rdi     # 0x94fe0
leaq 0x26c86(%rip), %rsi     # 0x7278d
callq 0x355b0
movq %rax, %rdi
callq 0x35300
jmp 0x4bb1e
movq %rsp, %rdi
callq 0x35730
leaq 0x20(%rsp), %rdi
callq 0x35170
testb %bpl, %bpl
je 0x4bbac
movq %rsp, %r14
movq %r14, %rdi
callq 0x35b70
movq (%rbx), %rsi
addq $0x8, %rsi
movq %r14, %rdi
callq 0x353c0
movl %eax, %ebx
testb %al, %al
je 0x4bb87
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x354d0
movq 0x49437(%rip), %rdi     # 0x94f98
leaq 0x20(%rsp), %rsi
callq 0x35510
movq %rax, %rdi
callq 0x35300
leaq 0x20(%rsp), %rdi
callq 0x35730
movq %rsp, %rdi
callq 0x35190
jmp 0x4bba2
movq 0x49452(%rip), %rdi     # 0x94fe0
leaq 0x26c3f(%rip), %rsi     # 0x727d4
callq 0x355b0
movq %rax, %rdi
callq 0x35300
movq %rsp, %rdi
callq 0x35110
jmp 0x4bbae
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4bbc0
movq %rax, %rbx
jmp 0x4bbee
jmp 0x4bbd6
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x35730
jmp 0x4bbd9
movq %rax, %rbx
movq %rsp, %rdi
callq 0x35110
jmp 0x4bbf8
movq %rax, %rbx
movq %rsp, %rdi
callq 0x35730
leaq 0x20(%rsp), %rdi
callq 0x35170
movq %rbx, %rdi
callq 0x35b50
movq %rax, %rdi
callq 0x3a198