// File: /workspace/github_cpp_makefile_star2_O2/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 $0x58, %rsp
movq %rcx, %r14
movq %rdx, 0x10(%rsp)
movq %rdi, %r15
movq (%rdi), %rax
movzbl 0x64(%rax), %ecx
movb $0x58, %bl
addl $-0x4b, %ecx
cmpl $0xe, %ecx
ja 0x5eac9
movq (%rsi), %rax
movb 0x64(%rax), %al
leaq 0x47731(%rip), %rdx     # 0xa6060
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
movb $0x58, %dl
jmpq *%rcx
cmpb $0x47, %al
pushq $0x54
popq %rcx
pushq $0x47
jmp 0x5e972
cmpb $0x41, %al
pushq $0x47
jmp 0x5e96f
cmpb $0x43, %al
pushq $0x54
popq %rcx
pushq $0x43
jmp 0x5e972
cmpb $0x41, %al
sete %bl
addb %bl, %bl
orb $0x41, %bl
jmp 0x5e976
cmpb $0x43, %al
sete %bl
shlb $0x2, %bl
orb $0x43, %bl
jmp 0x5e976
cmpb $0x41, %al
pushq $0x54
popq %rcx
pushq $0x41
popq %rbx
cmovel %ecx, %ebx
movl %eax, %edx
movb %dl, 0xf(%rsp)
leaq 0x18(%rsp), %r12
pushq $0x65
popq %rdx
pushq $0x1c
popq %r13
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rcx
callq 0x84b0
movq %r12, %rdi
callq 0x5eaf6
movl %eax, %ebp
movq %r12, %rdi
callq 0x8978
leaq 0x18(%rsp), %r12
pushq $0x48
popq %rdx
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rcx
callq 0x84b0
movq %r12, %rdi
callq 0x5eaf6
movl %eax, %r13d
movq %r12, %rdi
callq 0x8978
orb %bpl, %r13b
movq (%r14), %rdi
movq 0x10(%rsp), %rsi
callq 0x8430
leaq 0x3b436(%rip), %rsi     # 0x99e1e
movq %rax, %rdi
callq 0x8480
movq %rax, %r14
cmpb $0x1, %r13b
jne 0x5eaa3
leaq 0x18(%rsp), %r12
pushq $0x64
popq %rcx
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x84b0
movq %r14, %rdi
movq %r12, %rsi
callq 0x8430
leaq 0x42abe(%rip), %rsi     # 0xa14e2
movq %rax, %rdi
callq 0x8480
movsbl 0xf(%rsp), %esi
movq %rax, %rdi
callq 0x8510
leaq 0x43ada(%rip), %rsi     # 0xa251a
movq %rax, %rdi
callq 0x8480
movzbl %bl, %esi
movq %rax, %rdi
callq 0x8510
leaq 0x4fbec(%rip), %rsi     # 0xae646
movq %rax, %rdi
callq 0x8480
movq %rax, %r14
leaq 0x38(%rsp), %rdi
pushq $0x65
popq %rdx
pushq $-0x1
popq %rcx
movq %r15, %rsi
callq 0x84b0
leaq 0x38(%rsp), %rsi
movq %r14, %rdi
callq 0x8430
movq %rax, %rdi
callq 0x8230
leaq 0x38(%rsp), %rdi
callq 0x8978
leaq 0x18(%rsp), %rdi
callq 0x8978
jmp 0x5eaba
leaq 0x47661(%rip), %rsi     # 0xa610b
movq %r14, %rdi
callq 0x8480
movq %rax, %rdi
callq 0x8230
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x58, %dl
jmp 0x5e978
jmp 0x5eae1
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x8978
jmp 0x5eae4
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x8978
movq %rbx, %rdi
callq 0x8870