// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_filter.cpp
// Function: BamTools::FilterTool::FilterToolPrivate::GetScriptContents[abi:cxx11]()
const string FilterTool::FilterToolPrivate::GetScriptContents(void) {
  
    // open script for reading
    FILE* inFile = fopen(m_settings->ScriptFilename.c_str(), "rb");
    if ( !inFile ) {
        cerr << "bamtools filter ERROR: could not open script: "
             << m_settings->ScriptFilename << " for reading" << endl;
        return string();
    }
    
    // read in entire script contents  
    char buffer[1024];
    ostringstream docStream("");
    while ( true ) {
        
        // peek ahead, make sure there is data available
        char ch = fgetc(inFile);
        ungetc(ch, inFile);
        if( feof(inFile) )
            break;
        
        // read next block of data
        if ( fgets(buffer, 1024, inFile) == 0 ) {
            cerr << "bamtools filter ERROR: could not read script contents" << endl;
            return string();
        }
        
        docStream << buffer;
    }
    
    // close script file
    fclose(inFile);
    
    // import buffer contents to document, return
    return docStream.str();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5a8, %rsp            # imm = 0x5A8
movq %rsi, %r15
movq %rdi, %rbx
movq 0x18(%rsi), %rax
movq 0x80(%rax), %rdi
leaq 0x40f5e(%rip), %rsi     # 0x72cf1
callq 0x27670
testq %rax, %rax
je 0x31ed1
movq %rax, %r14
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x45a67(%rip), %rdx     # 0x7781b
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x2f1b2
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movl $0x10, %edx
callq 0x27830
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x31de4
callq 0x27560
leaq 0x10(%rbx), %r13
leaq 0x1a0(%rsp), %r15
movq 0x5e1e9(%rip), %r12     # 0x8ffe0
movq %r14, %rdi
callq 0x27960
movsbl %al, %edi
movq %r14, %rsi
callq 0x270e0
movq %r14, %rdi
callq 0x27910
movl $0x3, %ebp
testl %eax, %eax
jne 0x31ea0
movq %r15, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdx
callq 0x27980
testq %rax, %rax
je 0x31e50
movq %r15, %rdi
callq 0x272f0
xorl %ebp, %ebp
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x276c0
jmp 0x31ea0
movl $0x35, %edx
movq %r12, %rdi
leaq 0x40ec4(%rip), %rsi     # 0x72d23
callq 0x276c0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x27590
movsbl %al, %esi
movq %r12, %rdi
callq 0x27040
movq %rax, %rdi
callq 0x27410
movq %r13, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movl $0x1, %ebp
testl %ebp, %ebp
je 0x31df7
cmpl $0x3, %ebp
jne 0x31ec2
movq %r14, %rdi
callq 0x275b0
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x279a0
leaq 0x28(%rsp), %rdi
callq 0x27160
jmp 0x31f57
movq 0x5e108(%rip), %r14     # 0x8ffe0
leaq 0x40e15(%rip), %rsi     # 0x72cf4
movl $0x2e, %edx
movq %r14, %rdi
callq 0x276c0
movq 0x18(%r15), %rax
movq 0x80(%rax), %rsi
movq 0x88(%rax), %rdx
movq %r14, %rdi
callq 0x276c0
movq %rax, %r14
leaq 0x44df0(%rip), %rsi     # 0x76d00
movl $0xc, %edx
movq %rax, %rdi
callq 0x276c0
movq (%r14), %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 0x10(%rbx), %rax
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq %rbx, %rax
addq $0x5a8, %rsp            # imm = 0x5A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x31f87
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x31f94
callq 0x27560
jmp 0x31f94
movq %rax, %rbx
jmp 0x31f94
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x27160
movq %rbx, %rdi
callq 0x27b20
movq %rax, %rdi
callq 0x2e1ed