// File: 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:
subq $0x608, %rsp            # imm = 0x608
movq %rdi, 0x20(%rsp)
movq %rdi, %rax
movq %rax, 0x28(%rsp)
movq %rdi, 0x600(%rsp)
movq %rsi, 0x5f8(%rsp)
movq 0x5f8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x18(%rax), %rdi
addq $0x80, %rdi
callq 0x86320
movq %rax, %rdi
leaq 0x94d8b(%rip), %rsi     # 0x12f4c6
callq 0x86810
movq %rax, 0x5f0(%rsp)
cmpq $0x0, 0x5f0(%rsp)
jne 0x9a7ab
movq 0xca886(%rip), %rdi     # 0x164fe0
leaq 0x94d68(%rip), %rsi     # 0x12f4c9
callq 0x86700
movq %rax, %rdi
movq 0x30(%rsp), %rax
movq 0x18(%rax), %rsi
addq $0x80, %rsi
callq 0x86640
movq %rax, %rdi
leaq 0x996f8(%rip), %rsi     # 0x133e80
callq 0x86700
movq %rax, %rdi
movq 0xca7d9(%rip), %rsi     # 0x164f70
callq 0x86770
movq 0x20(%rsp), %rdi
callq 0x86a30
jmp 0x9a95a
leaq 0x57(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x86da0
movq 0x18(%rsp), %rdx
leaq 0x9a4ad(%rip), %rsi     # 0x134c73
leaq 0x58(%rsp), %rdi
callq 0x86a00
jmp 0x9a7d2
leaq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rsi
movl $0x10, %edx
callq 0x86a50
jmp 0x9a7e8
leaq 0x58(%rsp), %rdi
callq 0x86f68
jmp 0x9a7f4
leaq 0x57(%rsp), %rdi
callq 0x867b0
jmp 0x9a800
movq 0x5f0(%rsp), %rdi
callq 0x86b70
movl %eax, 0x14(%rsp)
jmp 0x9a813
movl 0x14(%rsp), %eax
movb %al, 0x43(%rsp)
movsbl 0x43(%rsp), %edi
movq 0x5f0(%rsp), %rsi
callq 0x86100
jmp 0x9a82f
movq 0x5f0(%rsp), %rdi
callq 0x86b10
cmpl $0x0, %eax
je 0x9a89e
jmp 0x9a924
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
jmp 0x9a872
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x86f68
jmp 0x9a870
jmp 0x9a872
leaq 0x57(%rsp), %rdi
callq 0x867b0
jmp 0x9a967
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x861b0
jmp 0x9a958
movq 0x5f0(%rsp), %rdx
leaq 0x1f0(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x86ba0
movq %rax, 0x8(%rsp)
jmp 0x9a8bf
movq 0x8(%rsp), %rax
cmpq $0x0, %rax
jne 0x9a90b
movq 0xca70f(%rip), %rdi     # 0x164fe0
leaq 0x94c20(%rip), %rsi     # 0x12f4f8
callq 0x86700
movq %rax, (%rsp)
jmp 0x9a8e3
movq (%rsp), %rdi
movq 0xca682(%rip), %rsi     # 0x164f70
callq 0x86770
jmp 0x9a8f5
movq 0x20(%rsp), %rdi
callq 0x86a30
jmp 0x9a901
movl $0x1, 0x3c(%rsp)
jmp 0x9a94c
leaq 0x78(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
callq 0x86700
jmp 0x9a91f
jmp 0x9a7fe
movq 0x5f0(%rsp), %rdi
callq 0x86710
jmp 0x9a933
movq 0x20(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x86740
jmp 0x9a944
movl $0x1, 0x3c(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x861b0
jmp 0x9a95a
jmp 0x9a967
movq 0x28(%rsp), %rax
addq $0x608, %rsp            # imm = 0x608
retq
movq 0x48(%rsp), %rdi
callq 0x86d80
movq %rax, %rdi
callq 0x91290
nopl (%rax)