// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_coding_sequences.cpp
// Function: codingSequenceErrorChecks(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::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>> const&, int, std::basic_ofstream<char, std::char_traits<char>>*&)
bool codingSequenceErrorChecks(const string& geneSeq, const string& transcriptName, const std::vector<std::vector<string> >& annotation, const int k, std::ofstream*& badStartStopCodonFile) {
    string::size_type l = geneSeq.length();
    bool divisibleByThree = true;
    if (l % 3 != 0) {
#ifdef DEBUG2
        std::cerr << "Error!!! The length of the gene: " << transcriptName << " is not divisible by three (" << l << ") composed of " << annotation[k].size() << " coding sequences" << std::endl;
        for (std::vector<std::string>::size_type j = 0; j != annotation[k].size(); j++) {
            std::cerr << annotation[k][j] << std::endl;
        }
#endif
        divisibleByThree = false;
    }
    if (!(geneSeq[0] == 'A' && geneSeq[1] == 'T' && geneSeq[2] == 'G')) {
        std::cerr << "Possible error!!! The coding sequence of the gene: " << transcriptName << " does not start with ATG (start codon). Maybe a SNP? Or an annotation error..." << std::endl;
        *badStartStopCodonFile << transcriptName << "\t" << "start" << "\t" << geneSeq.substr(0,3) << std::endl;
    }
    if (geneSeq[l-3] != 'T' && ((geneSeq[l-2] == 'A' && geneSeq[l-1] == 'G') || (geneSeq[l-2] == 'A' && geneSeq[l-1] == 'A') || (geneSeq[l-2] == 'G' && geneSeq[l-1] == 'A'))) {
        std::cerr << "Possible error!!! The coding sequence of the gene: " << transcriptName << " does not end with TAG,TAA, or TGA (stop codons). Maybe a SNP? Or an annotation error..." << std::endl;
        *badStartStopCodonFile << transcriptName << "\t" << "stop" << "\t" << geneSeq.substr(l-3,3) << std::endl;
    }
    return divisibleByThree;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r12
movq %rsi, %r15
movq %rdi, %r14
movq (%rdi), %rax
movq 0x8(%rdi), %rbx
cmpb $0x41, (%rax)
jne 0x5785e
cmpb $0x54, 0x1(%rax)
jne 0x5785e
cmpb $0x47, 0x2(%rax)
je 0x57903
movq 0x85783(%rip), %rdi     # 0xdcfe8
leaq 0x4ce03(%rip), %rsi     # 0xa466f
callq 0x8480
movq %rax, %rdi
movq %r15, %rsi
callq 0x8430
leaq 0x4ce20(%rip), %rsi     # 0xa46a3
movq %rax, %rdi
callq 0x8480
movq %rax, %rdi
callq 0x8230
movq (%r12), %rdi
movq %r15, %rsi
callq 0x8430
leaq 0x42578(%rip), %r13     # 0x99e1e
movq %rax, %rdi
movq %r13, %rsi
callq 0x8480
leaq 0x4ce3a(%rip), %rsi     # 0xa46f2
movq %rax, %rdi
callq 0x8480
movq %rax, %rdi
movq %r13, %rsi
callq 0x8480
movq %rax, %r13
leaq 0x8(%rsp), %rbp
pushq $0x3
popq %rcx
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x84b0
movq %r13, %rdi
movq %rbp, %rsi
callq 0x8430
movq %rax, %rdi
callq 0x8230
leaq 0x8(%rsp), %rdi
callq 0x8978
movq (%r14), %rax
cmpb $0x54, -0x3(%rax,%rbx)
je 0x579e7
movzbl -0x2(%rax,%rbx), %ecx
cmpl $0x47, %ecx
je 0x57935
cmpl $0x41, %ecx
jne 0x579e7
movzbl -0x1(%rax,%rbx), %eax
cmpl $0x41, %eax
je 0x57940
cmpl $0x47, %eax
je 0x57940
jmp 0x579e7
cmpb $0x41, -0x1(%rax,%rbx)
jne 0x579e7
leaq -0x3(%rbx), %r13
movq 0x8569d(%rip), %rdi     # 0xdcfe8
leaq 0x4cd1d(%rip), %rsi     # 0xa466f
callq 0x8480
movq %rax, %rdi
movq %r15, %rsi
callq 0x8430
leaq 0x4cd8f(%rip), %rsi     # 0xa46f8
movq %rax, %rdi
callq 0x8480
movq %rax, %rdi
callq 0x8230
movq (%r12), %rdi
movq %r15, %rsi
callq 0x8430
leaq 0x42492(%rip), %r15     # 0x99e1e
movq %rax, %rdi
movq %r15, %rsi
callq 0x8480
leaq 0x4cb28(%rip), %rsi     # 0xa44c6
movq %rax, %rdi
callq 0x8480
movq %rax, %rdi
movq %r15, %rsi
callq 0x8480
movq %rax, %r15
leaq 0x8(%rsp), %r12
pushq $0x3
popq %rcx
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x84b0
movq %r15, %rdi
movq %r12, %rsi
callq 0x8430
movq %rax, %rdi
callq 0x8230
leaq 0x8(%rsp), %rdi
callq 0x8978
pushq $0x3
popq %rcx
movq %rbx, %rax
xorl %edx, %edx
divq %rcx
testq %rdx, %rdx
sete %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x57a09
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x8978
movq %rbx, %rdi
callq 0x8870