// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_cbs.cpp
// Function: findUndeterminedRegions()
void findUndeterminedRegions() {
    // Open a connection to read from the genome file
    std::ifstream* genomeFile = new std::ifstream(opt::genomeFile.c_str());
    string genomeFileRoot = stripExtension(opt::genomeFile);
    string undeterminedRegionsFileName = genomeFileRoot + ".ns";
    std::ofstream* undeterminedRegionsFile = new std::ofstream(undeterminedRegionsFileName.c_str());
    
    string nextScaffoldName;
    getline(*genomeFile, nextScaffoldName);
    string currentScaffoldReference;
    int thisUndeterminedRegionStart;
    int thisUndeterminedRegionEnd;
    while (nextScaffoldName != "") {
        //std::cerr << "Processing " << nextScaffoldName << "..." << std::endl;
        string thisScaffold = nextScaffoldName;
        currentScaffoldReference = readScaffold(genomeFile, nextScaffoldName);
        *undeterminedRegionsFile << thisScaffold << "\t" << currentScaffoldReference.length() << std::endl;
        bool bInUndetermined = false;
        for (string::size_type i = 0; i != currentScaffoldReference.size(); i++) {
            if (currentScaffoldReference[i] == 'N') {
                if (!bInUndetermined)
                    thisUndeterminedRegionStart = (int)i;
                if (i == currentScaffoldReference.size()-1) {
                    if (bInUndetermined)
                        *undeterminedRegionsFile << thisUndeterminedRegionStart << "\t" << i << std::endl;
                    else
                        *undeterminedRegionsFile << i << "\t" << i << std::endl;
                }
                bInUndetermined = true;
            } else {
                if (bInUndetermined) {
                    thisUndeterminedRegionEnd = (int)i-1;
                    *undeterminedRegionsFile << thisUndeterminedRegionStart << "\t" << thisUndeterminedRegionEnd << std::endl;
                    bInUndetermined = false;
                }
            }
        }
    }
    
    string line;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl $0x208, %edi            # imm = 0x208
callq 0x8490
movq %rax, %rbx
movq 0xa588f(%rip), %rsi     # 0xde090
pushq $0x8
popq %rdx
movq %rax, %rdi
callq 0x8890
movq %rbx, (%rsp)
leaq 0xa5879(%rip), %rsi     # 0xde090
leaq 0x88(%rsp), %rbx
movq %rbx, %rdi
callq 0x404d7
leaq 0x65632(%rip), %rdx     # 0x9de60
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
callq 0x28806
movl $0x200, %edi            # imm = 0x200
callq 0x8490
movq %rax, %rbx
movq 0x68(%rsp), %rsi
pushq $0x10
popq %rdx
movq %rax, %rdi
callq 0x84e0
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq (%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x80a0
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x28(%rsp), %r15
leaq 0x48(%rsp), %r12
leaq 0xa8(%rsp), %r13
movq %r13, %rbp
movq %r15, %rdi
leaq 0x61578(%rip), %rsi     # 0x99e1f
callq 0x2ea9b
testb %al, %al
je 0x38a0f
movq %r12, %rdi
movq %r15, %rsi
callq 0x8600
movq %r13, %rdi
movq %rsp, %rsi
movq %r15, %rdx
callq 0x3a53b
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x8550
movq %r13, %rdi
callq 0x8978
movq %rbx, %rdi
movq %r12, %r15
movq %r12, %rsi
callq 0x8430
movq %rax, %rdi
leaq 0x61524(%rip), %rsi     # 0x99e1e
callq 0x8480
movq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x8320
movq %rax, %rdi
callq 0x8230
xorl %eax, %eax
xorl %r12d, %r12d
movq 0x10(%rsp), %rcx
cmpq %rcx, %r12
je 0x389fa
movq 0x8(%rsp), %rdx
cmpb $0x4e, (%rdx,%r12)
jne 0x3897a
testb $0x1, %al
movl %r12d, %edx
cmovnel %r14d, %edx
decq %rcx
movb $0x1, %r13b
cmpq %rcx, %r12
jne 0x389b2
testb $0x1, %al
je 0x389bc
movq %rbx, %rdi
movl %r14d, %esi
callq 0x8840
movq %rax, %rdi
leaq 0x614be(%rip), %rsi     # 0x99e1e
callq 0x8480
movq %rax, %rdi
movq %r12, %rsi
callq 0x8320
movq %rax, %rdi
callq 0x8230
jmp 0x389ec
testb $0x1, %al
je 0x389b7
movq %rbx, %rdi
movl %r14d, %esi
callq 0x8840
movq %rax, %rdi
leaq 0x6148b(%rip), %rsi     # 0x99e1e
callq 0x8480
leaq -0x1(%r12), %rsi
movq %rax, %rdi
callq 0x8840
movq %rax, %rdi
callq 0x8230
xorl %r13d, %r13d
jmp 0x389ec
movl %edx, %r14d
jmp 0x389ec
movl %eax, %r13d
jmp 0x389ec
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8320
movq %rax, %rdi
leaq 0x6144d(%rip), %rsi     # 0x99e1e
callq 0x8480
movq %rax, %rdi
movq %r12, %rsi
callq 0x8320
movq %rax, %rdi
callq 0x8230
movl %r12d, %r14d
incq %r12
movl %r13d, %eax
movq %rbp, %r13
jmp 0x38919
movq %r15, %r12
movq %r15, %rdi
callq 0x8978
leaq 0x28(%rsp), %r15
jmp 0x3889d
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x48(%rsp), %rdi
callq 0x8978
leaq 0x8(%rsp), %rdi
callq 0x8978
leaq 0x28(%rsp), %rdi
callq 0x8978
leaq 0x68(%rsp), %rdi
callq 0x8978
leaq 0x88(%rsp), %rdi
callq 0x8978
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x38aba
movq %rax, %r14
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdi
callq 0x84a0
jmp 0x38ac4
movq %rax, %r14
jmp 0x38ac4
movq %rax, %r14
jmp 0x38ace
movq %rax, %r14
movl $0x208, %esi            # imm = 0x208
movq %rbx, %rdi
callq 0x84a0
jmp 0x38adb
jmp 0x38aa3
movq %rax, %r14
jmp 0x38ab0
jmp 0x38aa3
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x8978
leaq 0x8(%rsp), %rdi
callq 0x8978
leaq 0x28(%rsp), %rdi
callq 0x8978
leaq 0x68(%rsp), %rdi
callq 0x8978
leaq 0x88(%rsp), %rdi
callq 0x8978
movq %r14, %rdi
callq 0x8870