// File: /workspace/github_cpp_makefile_star2_O1/millanek[P]evo/./process_vcf_coding_sequences.h
// Function: addN_S_Nd_Sd_SameIndividualsH1againstH2(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&, 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&, std::map<unsigned long, int, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, int>>>&, std::map<unsigned long, int, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, int>>>&, CDSComparisonMatrices&)
inline void addN_S_Nd_Sd_SameIndividualsH1againstH2(const std::vector<string>& altCodons, const std::vector<string>& altCodonsH2, std::map<std::vector<string>::size_type, int>& haveStop, std::map<std::vector<string>::size_type, int>& haveStopH2, CDSComparisonMatrices& p) {
    int numSamples = (int)altCodons.size();
    for (std::vector<std::string>::size_type j = 0; j != numSamples; j++) {
        if (haveStop[j] == 1 || getAminoAcid(altCodons[j]) == "Uncrecognised codon....")
            continue; // only consider this individual if it did not have a premature stop codon
        if (haveStopH2[j] == 1 || getAminoAcid(altCodonsH2[j]) == "Uncrecognised codon....")
            continue;
        
        int d = getCodonDistance(altCodons[j],altCodonsH2[j]);
        // Nd
        double n_d_ijk = calculateNd(altCodons[j],altCodonsH2[j], d);
        double s_d_ijk = d - n_d_ijk;
        p.N_d_jk[j][j] = p.N_d_jk[j][j] + n_d_ijk;
        p.S_d_jk[j][j] = p.S_d_jk[j][j] + s_d_ijk;
        // N
        double N_ijk = calculateN(altCodons[j],altCodonsH2[j], d, false);
        double S_ijk = (3 - N_ijk);
        p.N_jk[j][j] = p.N_jk[j][j] + N_ijk; p.S_jk[j][j] = p.S_jk[j][j] + S_ijk;
        // NtS -- for incorporating tS/tV mutation probabilities
        double N_tS = calculateNtS(altCodons[j],altCodonsH2[j], d, false);
        p.tS_N_jk[j][j] = p.tS_N_jk[j][j] + N_tS;
        p.tS_S_jk[j][j] = p.tS_S_jk[j][j] + (1 - N_tS);
        p.tV_N_jk[j][j] = p.tV_N_jk[j][j] + (N_ijk - N_tS);
        p.tV_S_jk[j][j] = p.tV_S_jk[j][j] + (2 - (N_ijk - N_tS));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x8(%rdi), %rax
subq (%rdi), %rax
movq %rax, %rcx
shlq $0x1b, %rcx
movq $0x0, 0x8(%rsp)
je 0x77a6d
movq %r8, %rbx
movq %rdi, %r12
movq %rsi, %r13
shrq $0x5, %rax
movslq %eax, %rbp
movq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x76548
movl (%rax), %r14d
movb $0x1, %r15b
cmpl $0x1, %r14d
je 0x77812
movq 0x8(%rsp), %rsi
shlq $0x5, %rsi
addq (%r12), %rsi
leaq 0x48(%rsp), %r15
movq %r15, %rdi
callq 0x766fe
movq %r15, %rdi
leaq 0x65d14(%rip), %rsi     # 0xdd51b
callq 0x8160
testl %eax, %eax
sete %r15b
cmpl $0x1, %r14d
je 0x77834
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x77834
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x8480
testb %r15b, %r15b
jne 0x77a57
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x76548
movl (%rax), %r14d
movb $0x1, %r15b
cmpl $0x1, %r14d
je 0x77887
movq 0x8(%rsp), %rsi
shlq $0x5, %rsi
addq (%r13), %rsi
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x766fe
movq %r15, %rdi
leaq 0x65c9f(%rip), %rsi     # 0xdd51b
callq 0x8160
testl %eax, %eax
sete %r15b
cmpl $0x1, %r14d
je 0x778a9
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x778a9
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x8480
testb %r15b, %r15b
jne 0x77a57
movq 0x8(%rsp), %rcx
movq (%r12), %rdi
shlq $0x5, %rcx
movq (%r13), %rsi
movq 0x8(%rdi,%rcx), %rax
cmpq 0x8(%rsi,%rcx), %rax
jne 0x77a7c
addq %rcx, %rdi
addq %rcx, %rsi
testq %rax, %rax
je 0x77906
movq (%rdi), %rcx
movq (%rsi), %rdx
xorl %r8d, %r8d
xorl %r14d, %r14d
movb (%rcx,%r8), %r9b
xorl %r10d, %r10d
cmpb (%rdx,%r8), %r9b
setne %r10b
addl %r10d, %r14d
incq %r8
cmpq %r8, %rax
jne 0x778ea
jmp 0x77909
xorl %r14d, %r14d
movl %r14d, %edx
callq 0x77b5b
xorps %xmm1, %xmm1
cvtsi2sd %r14d, %xmm1
subsd %xmm0, %xmm1
movq 0x8(%rsp), %rsi
movq (%rbx), %rax
leaq (,%rsi,8), %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx), %rax
addsd (%rax,%rsi,8), %xmm0
movsd %xmm0, (%rax,%rsi,8)
movq 0x30(%rbx), %rax
movq (%rax,%rcx), %rax
addsd (%rax,%rsi,8), %xmm1
movsd %xmm1, (%rax,%rsi,8)
shlq $0x5, %rsi
movq (%r12), %rdi
addq %rsi, %rdi
addq (%r13), %rsi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0x785e2
movapd %xmm0, %xmm2
movsd %xmm0, 0x10(%rsp)
movsd 0x6466c(%rip), %xmm0    # 0xdbfe8
subsd %xmm2, %xmm0
movq 0x8(%rsp), %rsi
movq 0x18(%rbx), %rax
leaq (,%rsi,8), %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx), %rax
movsd (%rax,%rsi,8), %xmm1
addsd %xmm2, %xmm1
movsd %xmm1, (%rax,%rsi,8)
movq 0x48(%rbx), %rax
movq (%rax,%rcx), %rax
addsd (%rax,%rsi,8), %xmm0
movsd %xmm0, (%rax,%rsi,8)
shlq $0x5, %rsi
movq (%r12), %rdi
addq %rsi, %rdi
addq (%r13), %rsi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0x791c0
movq 0x8(%rsp), %rax
movq 0x60(%rbx), %rcx
leaq (,%rax,8), %rdx
leaq (%rdx,%rdx,2), %rdx
movq (%rcx,%rdx), %rcx
movsd (%rcx,%rax,8), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rcx,%rax,8)
movq 0x78(%rbx), %rcx
movq (%rcx,%rdx), %rcx
movsd 0x57a37(%rip), %xmm1    # 0xcf440
subsd %xmm0, %xmm1
addsd (%rcx,%rax,8), %xmm1
movsd %xmm1, (%rcx,%rax,8)
movq 0x90(%rbx), %rcx
movq (%rcx,%rdx), %rcx
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd 0x645ac(%rip), %xmm0    # 0xdbfe0
subsd %xmm1, %xmm0
addsd (%rcx,%rax,8), %xmm1
movsd %xmm1, (%rcx,%rax,8)
movq 0xa8(%rbx), %rcx
movq (%rcx,%rdx), %rcx
addsd (%rcx,%rax,8), %xmm0
movsd %xmm0, (%rcx,%rax,8)
movq 0x8(%rsp), %rax
incq %rax
movq %rax, 0x8(%rsp)
cmpq %rbp, %rax
jne 0x777c8
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x65ab0(%rip), %rdi     # 0xdd533
leaq 0x5b088(%rip), %rsi     # 0xd2b12
leaq 0x65be5(%rip), %rcx     # 0xdd676
movl $0x218, %edx            # imm = 0x218
callq 0x82c0