// File: /workspace/github_cpp_makefile_star2_O3/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 0x7b7aa
movq (%rsi), %rax
movb 0x64(%rax), %al
leaq 0x5b99e(%rip), %rdx     # 0xd6e68
movslq (%rdx,%rdi,4), %rcx
addq %rdx, %rcx
movb $0x58, %r13b
jmpq *%rcx
cmpb $0x47, %al
movl $0x54, %ecx
movl $0x47, %ebp
jmp 0x7b526
cmpb $0x41, %al
movl $0x47, %ecx
jmp 0x7b521
cmpb $0x43, %al
movl $0x54, %ecx
movl $0x43, %ebp
jmp 0x7b526
cmpb $0x41, %al
sete %bpl
addb %bpl, %bpl
orb $0x41, %bpl
jmp 0x7b529
cmpb $0x43, %al
sete %bpl
shlb $0x2, %bpl
orb $0x43, %bpl
jmp 0x7b529
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 (%r12), %rdi
movq 0x8(%r12), %rax
movb $0x1, %r15b
testq %rax, %rax
je 0x7b583
xorl %ecx, %ecx
movl $0x45, %edx
movzbl (%rdi,%rcx), %esi
leal -0x41(%rsi), %r8d
cmpl $0x6, %r8d
ja 0x7b570
btl %r8d, %edx
jb 0x7b57b
cmpb $0x54, %sil
sete %sil
andb %sil, %r15b
incq %rcx
cmpq %rcx, %rax
jne 0x7b55c
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x7b59a
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 (%r12), %rdi
movq 0x8(%r12), %rax
movb $0x1, %r12b
testq %rax, %rax
je 0x7b5f1
xorl %ecx, %ecx
movl $0x45, %edx
movzbl (%rdi,%rcx), %esi
leal -0x41(%rsi), %r8d
cmpl $0x6, %r8d
ja 0x7b5de
btl %r8d, %edx
jb 0x7b5e9
cmpb $0x54, %sil
sete %sil
andb %sil, %r12b
incq %rcx
cmpq %rcx, %rax
jne 0x7b5ca
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x7b608
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 0x523a1(%rip), %rsi     # 0xcd9ca
movl $0x1, %edx
movq %rax, %rdi
callq 0x84e0
testb $0x1, %r15b
je 0x7b760
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 0x57734(%rip), %rsi     # 0xd2da2
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 0x58740(%rip), %rsi     # 0xd3dda
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 0x627d9(%rip), %rsi     # 0xdde9f
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 0x7b743
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x8480
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x7b79b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7b79b
leaq 0x5b7ac(%rip), %rsi     # 0xd6f13
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 0x7b52c
jmp 0x7b7d4
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7b7d7
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7b7d7
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x7b7f2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
movq %rbx, %rdi
callq 0x8840