// File: /workspace/github_cpp_makefile_star2_O1/millanek[P]evo/process_vcf_sequenom.cpp
// Function: writeSequenomOutput(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::basic_ofstream<char, std::char_traits<char>>*&)
void writeSequenomOutput(const std::string& regionSeq, const std::string& refSeq, const std::string& loc, std::ofstream*& sequenomFile) {
    
    char refBase = refSeq[100];
    char altBase = regionSeq[100];
    switch (altBase)
    {
        case 'K': altBase = (refBase == 'G') ? 'T' : 'G'; break;
        case 'M': altBase = (refBase == 'A') ? 'C' : 'A'; break;
        case 'R': altBase = (refBase == 'A') ? 'G' : 'A'; break;
        case 'S': altBase = (refBase == 'C') ? 'G' : 'C'; break;
        case 'W': altBase = (refBase == 'A') ? 'T' : 'A'; break;
        case 'Y': altBase = (refBase == 'C') ? 'T' : 'C'; break;
        default: altBase = 'X'; refBase = 'X'; break;
    }
    
    bool bPrimerCanBeDesigned = true;
    bool bRightAllDNA = checkAllDNA(regionSeq.substr(101,28));
    bool bLeftAllDNA = checkAllDNA(regionSeq.substr(72,28));
    if (bRightAllDNA == false && bLeftAllDNA == false) {
        bPrimerCanBeDesigned = false;
    }
    
    if (bPrimerCanBeDesigned)
        *sequenomFile << loc << "\t" << regionSeq.substr(0,100) << "[" << refBase << "/" << altBase << "]" << regionSeq.substr(101, string::npos) << std::endl;
    else
        *sequenomFile << loc << "\t" << "Primer problem 28bp" << std::endl;
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r14
movq %rdi, %rbx
movq (%rdi), %rax
movzbl 0x64(%rax), %edi
movb $0x58, %bpl
addl $-0x4b, %edi
cmpl $0xe, %edi
movq %rcx, 0x40(%rsp)
ja 0x7bbd4
movq (%rsi), %rax
movb 0x64(%rax), %al
leaq 0x624f4(%rip), %rdx     # 0xdddd8
movslq (%rdx,%rdi,4), %rcx
addq %rdx, %rcx
movb $0x58, %r13b
jmpq *%rcx
cmpb $0x47, %al
movl $0x54, %ecx
movl $0x47, %ebp
jmp 0x7b940
cmpb $0x41, %al
movl $0x47, %ecx
jmp 0x7b93b
cmpb $0x43, %al
movl $0x54, %ecx
movl $0x43, %ebp
jmp 0x7b940
cmpb $0x41, %al
sete %bpl
addb %bpl, %bpl
orb $0x41, %bpl
jmp 0x7b943
cmpb $0x43, %al
sete %bpl
shlb $0x2, %bpl
orb $0x43, %bpl
jmp 0x7b943
cmpb $0x41, %al
movl $0x54, %ecx
movl $0x41, %ebp
cmovel %ecx, %ebp
movl %eax, %r13d
movq %rsp, %r12
movl $0x65, %edx
movl $0x1c, %ecx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x84a0
movq 0x8(%r12), %rax
movb $0x1, %r15b
testq %rax, %rax
je 0x7b9a1
movq (%rsp), %rcx
xorl %edx, %edx
movl $0x45, %esi
xorl %edi, %edi
movzbl (%rcx,%rdi), %r8d
leal -0x41(%r8), %r9d
cmpl $0x6, %r9d
ja 0x7b98d
btl %r9d, %esi
jb 0x7b999
cmpb $0x54, %r8b
movzbl %r15b, %r15d
cmovnel %edx, %r15d
incq %rdi
cmpq %rdi, %rax
jne 0x7b978
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7b9bc
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
movq %rsp, %r12
movl $0x48, %edx
movl $0x1c, %ecx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x84a0
movq 0x8(%r12), %rax
movb $0x1, %r12b
testq %rax, %rax
je 0x7ba17
movq (%rsp), %rcx
xorl %edx, %edx
movl $0x45, %esi
xorl %edi, %edi
movzbl (%rcx,%rdi), %r8d
leal -0x41(%r8), %r9d
cmpl $0x6, %r9d
ja 0x7ba03
btl %r9d, %esi
jb 0x7ba0f
cmpb $0x54, %r8b
movzbl %r12b, %r12d
cmovnel %edx, %r12d
incq %rdi
cmpq %rdi, %rax
jne 0x7b9ee
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x7ba32
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
orb %r12b, %r15b
movq 0x40(%rsp), %rax
movq (%rax), %rdi
movq (%r14), %rsi
movq 0x8(%r14), %rdx
callq 0x84e0
movq %rax, %r14
leaq 0x5622b(%rip), %rsi     # 0xd1c7e
movl $0x1, %edx
movq %rax, %rdi
callq 0x84e0
testb $0x1, %r15b
je 0x7bb8a
movq %rsp, %r15
movl $0x64, %ecx
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x84a0
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x84e0
movq %rax, %r14
leaq 0x5d7ca(%rip), %rsi     # 0xd9262
movl $0x1, %edx
movq %rax, %rdi
callq 0x84e0
leaq 0x20(%rsp), %rsi
movb %r13b, (%rsi)
movl $0x1, %edx
movq %r14, %rdi
callq 0x84e0
movq %rax, %r14
leaq 0x5e7d6(%rip), %rsi     # 0xda29a
movl $0x1, %edx
movq %rax, %rdi
callq 0x84e0
leaq 0x20(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %r14, %rdi
callq 0x84e0
movq %rax, %r14
leaq 0x6a87d(%rip), %rsi     # 0xe636d
movl $0x1, %edx
movq %rax, %rdi
callq 0x84e0
leaq 0x20(%rsp), %rdi
movl $0x65, %edx
movq %rbx, %rsi
movq $-0x1, %rcx
callq 0x84a0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %r14, %rdi
callq 0x84e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7bb6d
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x8480
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x7bbc5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7bbc5
leaq 0x622f2(%rip), %rsi     # 0xdde83
movl $0x13, %edx
movq %r14, %rdi
callq 0x84e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r14, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x58, %r13b
jmp 0x7b946
jmp 0x7bbfe
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7bc01
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7bc01
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x7bc1c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
movq %rbx, %rdi
callq 0x8840