// File: /workspace/github_cpp_makefile_star2_O3/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 0x8470
movq %rax, %rbx
movq 0xbf20b(%rip), %rsi     # 0x103060
movq %rax, %rdi
movl $0x8, %edx
callq 0x8860
movq %rbx, 0x60(%rsp)
leaq 0xbf1f2(%rip), %rsi     # 0x103060
leaq 0x88(%rsp), %rbx
movq %rbx, %rdi
callq 0x4d82f
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x2ba06
leaq 0x8b08a(%rip), %rsi     # 0xcef2c
leaq 0x20(%rsp), %rdi
callq 0x88c0
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq %rax, %rbx
movq 0x20(%rsp), %rsi
movq %rax, %rdi
movl $0x10, %edx
callq 0x84c0
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x60(%rsp), %r14
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
movq %rsp, %rsi
movq %r14, %rdi
callq 0x8870
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x89aaa(%rip), %rsi     # 0xcd9cb
movq %rsp, %rdi
callq 0x8160
testl %eax, %eax
je 0x441a8
leaq 0xa8(%rsp), %r13
movq %r13, %r14
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x2ba06
movq %r13, %rdi
leaq 0x60(%rsp), %rsi
movq %rsp, %rdx
callq 0x465f2
leaq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0x8540
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x43f9e
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq %rbx, %rdi
callq 0x84e0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x89a08(%rip), %rsi     # 0xcd9ca
callq 0x84e0
movq 0x48(%rsp), %rsi
movq %r15, %rdi
callq 0x82f0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r12, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x48(%rsp), %rax
testq %rax, %rax
je 0x44175
xorl %r12d, %r12d
xorl %ecx, %ecx
movq 0x40(%rsp), %rdx
cmpb $0x4e, (%rdx,%r12)
jne 0x44099
testb $0x1, %cl
movl %r12d, %edx
cmovnel %ebp, %edx
decq %rax
movb $0x1, %r13b
cmpq %rax, %r12
jne 0x440fb
testb $0x1, %cl
je 0x44104
movq %rbx, %rdi
movl %ebp, %esi
callq 0x8810
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x89970(%rip), %rsi     # 0xcd9ca
callq 0x84e0
movq %r15, %rdi
movq %r12, %rsi
callq 0x82f0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r15, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
jmp 0x4415e
testb $0x1, %cl
je 0x440ff
movq %rbx, %rdi
movl %ebp, %esi
callq 0x8810
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x89910(%rip), %rsi     # 0xcd9ca
callq 0x84e0
leaq -0x1(%r12), %rsi
movq %r15, %rdi
callq 0x8810
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r15, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
xorl %r13d, %r13d
jmp 0x4415e
movl %edx, %ebp
jmp 0x4415e
movl %ecx, %r13d
jmp 0x4415e
movq %rbx, %rdi
movq %r12, %rsi
callq 0x82f0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x898a9(%rip), %rsi     # 0xcd9ca
callq 0x84e0
movq %r15, %rdi
movq %r12, %rsi
callq 0x82f0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r15, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movl %r12d, %ebp
incq %r12
movq 0x48(%rsp), %rax
movl %r13d, %ecx
cmpq %rax, %r12
movq %r14, %r13
jne 0x44011
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x44191
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x8480
movq %rsp, %rdi
leaq 0x89830(%rip), %rsi     # 0xcd9cb
callq 0x8160
testl %eax, %eax
jne 0x43f3c
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x441c4
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x8480
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x441df
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x441fb
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4421c
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x8480
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdi
jmp 0x442b9
jmp 0x4423d
movq %rax, %r14
jmp 0x442be
movq %rax, %r14
jmp 0x442da
movq %rax, %r14
movl $0x208, %esi            # imm = 0x208
movq %rbx, %rdi
jmp 0x442f6
movq %rax, %r14
jmp 0x442a3
movq %rax, %r14
jmp 0x44287
jmp 0x44268
jmp 0x44268
movq %rax, %r14
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x44287
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x442a3
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x8480
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x442be
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x442da
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x442fb
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x8480
movq %r14, %rdi
callq 0x8840