// File: millanek[P]evo/./process_vcf_coding_sequences.h
// Function: addN_S_Nd_Sd_DifferentIndividualsH1againstH2(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_DifferentIndividualsH1againstH2(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
        for (std::vector<std::string>::size_type k = 0; k != numSamples; k++) {
            if (haveStopH2[k] == 1 || getAminoAcid(altCodonsH2[k]) == "Uncrecognised codon....")
                continue;
            if (j != k) {
                int d = getCodonDistance(altCodons[j],altCodonsH2[k]);
                // Nd
                double n_d_ijk = calculateNd(altCodons[j],altCodonsH2[k], d);
                double s_d_ijk = d - n_d_ijk;
                p.N_d_jk[j][k] = p.N_d_jk[j][k] + n_d_ijk;
                p.S_d_jk[j][k] = p.S_d_jk[j][k] + s_d_ijk;
                // N
                double N_ijk = calculateN(altCodons[j],altCodonsH2[k], d, false);
                double S_ijk = (3 - N_ijk);
                p.N_jk[j][k] = p.N_jk[j][k] + N_ijk; p.S_jk[j][k] = p.S_jk[j][k] + S_ijk;
                // NtS
                double N_tS = calculateNtS(altCodons[j],altCodonsH2[k], d, false);
                p.tS_N_jk[j][k] = p.tS_N_jk[j][k] + N_tS;
                p.tS_S_jk[j][k] = p.tS_S_jk[j][k] + (1 - N_tS);
                p.tV_N_jk[j][k] = p.tV_N_jk[j][k] + (N_ijk - N_tS);
                p.tV_S_jk[j][k] = p.tV_S_jk[j][k] + (2 - (N_ijk - N_tS));
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3ffd0
movl %eax, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movslq -0x2c(%rbp), %rcx
cmpq %rcx, %rax
je 0xb9a98
movq -0x18(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xb7ac0
movl (%rax), %ecx
movb $0x0, -0x59(%rbp)
movb $0x1, %al
cmpl $0x1, %ecx
movb %al, -0xc9(%rbp)
je 0xb9501
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x52960
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0xb7da0
movq -0xd8(%rbp), %rdi
movb $0x1, -0x59(%rbp)
leaq 0x87ce9(%rip), %rsi     # 0x1411cf
callq 0x2d770
movb %al, -0xca(%rbp)
jmp 0xb94f3
movb -0xca(%rbp), %al
movb %al, -0xc9(%rbp)
jmp 0xb9501
movb -0xc9(%rbp), %al
movb %al, -0xd9(%rbp)
testb $0x1, -0x59(%rbp)
jne 0xb9515
jmp 0xb951e
leaq -0x58(%rbp), %rdi
callq 0xac88
movb -0xd9(%rbp), %al
testb $0x1, %al
jne 0xb952a
jmp 0xb9551
jmp 0xb9a87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
testb $0x1, -0x59(%rbp)
jne 0xb9543
jmp 0xb954c
leaq -0x58(%rbp), %rdi
callq 0xac88
jmp 0xb9aa1
movq $0x0, -0x78(%rbp)
movq -0x78(%rbp), %rax
movslq -0x2c(%rbp), %rcx
cmpq %rcx, %rax
je 0xb9a85
movq -0x20(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0xb7ac0
movl (%rax), %ecx
movb $0x0, -0x99(%rbp)
movb $0x1, %al
cmpl $0x1, %ecx
movb %al, -0xda(%rbp)
je 0xb95e0
movq -0x10(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x52960
movq %rax, %rsi
leaq -0x98(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0xb7da0
movq -0xe8(%rbp), %rdi
movb $0x1, -0x99(%rbp)
leaq 0x87c0a(%rip), %rsi     # 0x1411cf
callq 0x2d770
movb %al, -0xdb(%rbp)
jmp 0xb95d2
movb -0xdb(%rbp), %al
movb %al, -0xda(%rbp)
jmp 0xb95e0
movb -0xda(%rbp), %al
movb %al, -0xe9(%rbp)
testb $0x1, -0x99(%rbp)
jne 0xb95f7
jmp 0xb9603
leaq -0x98(%rbp), %rdi
callq 0xac88
movb -0xe9(%rbp), %al
testb $0x1, %al
jne 0xb960f
jmp 0xb963c
jmp 0xb9a74
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
testb $0x1, -0x99(%rbp)
jne 0xb962b
jmp 0xb9637
leaq -0x98(%rbp), %rdi
callq 0xac88
jmp 0xb9aa1
movq -0x38(%rbp), %rax
cmpq -0x78(%rbp), %rax
je 0xb9a72
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x52960
movq %rax, -0x150(%rbp)
movq -0x10(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x52960
movq -0x150(%rbp), %rdi
movq %rax, %rsi
callq 0xba750
movl %eax, -0xa0(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x52960
movq %rax, -0x148(%rbp)
movq -0x10(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x52960
movq -0x148(%rbp), %rdi
movq %rax, %rsi
movl -0xa0(%rbp), %edx
callq 0xbac40
movsd %xmm0, -0xa8(%rbp)
cvtsi2sdl -0xa0(%rbp), %xmm0
subsd -0xa8(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x651e0
movq %rax, %rdi
movq -0x78(%rbp), %rsi
callq 0x3ec30
movsd (%rax), %xmm0
addsd -0xa8(%rbp), %xmm0
movsd %xmm0, -0x140(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x651e0
movq %rax, %rdi
movq -0x78(%rbp), %rsi
callq 0x3ec30
movsd -0x140(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x28(%rbp), %rdi
addq $0x30, %rdi
movq -0x38(%rbp), %rsi
callq 0x651e0
movq %rax, %rdi
movq -0x78(%rbp), %rsi
callq 0x3ec30
movsd (%rax), %xmm0
addsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0x138(%rbp)
movq -0x28(%rbp), %rdi
addq $0x30, %rdi
movq -0x38(%rbp), %rsi
callq 0x651e0
movq %rax, %rdi
movq -0x78(%rbp), %rsi
callq 0x3ec30
movsd -0x138(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x52960
movq %rax, -0x130(%rbp)
movq -0x10(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x52960
movq -0x130(%rbp), %rdi
movq %rax, %rsi
movl -0xa0(%rbp), %edx
xorl %ecx, %ecx
callq 0xbbdf0
movsd %xmm0, -0xb8(%rbp)
movsd 0x8706e(%rip), %xmm0    # 0x140838
subsd -0xb8(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movq -0x28(%rbp), %rdi
addq $0x18, %rdi
movq -0x38(%rbp), %rsi
callq 0x651e0
movq %rax, %rdi
movq -0x78(%rbp), %rsi
callq 0x3ec30
movsd (%rax), %xmm0
addsd -0xb8(%rbp), %xmm0
movsd %xmm0, -0x128(%rbp)
movq -0x28(%rbp), %rdi
addq $0x18, %rdi
movq -0x38(%rbp), %rsi
callq 0x651e0
movq %rax, %rdi
movq -0x78(%rbp), %rsi
callq 0x3ec30
movsd -0x128(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x28(%rbp), %rdi
addq $0x48, %rdi
movq -0x38(%rbp), %rsi
callq 0x651e0
movq %rax, %rdi
movq -0x78(%rbp), %rsi
callq 0x3ec30
movsd (%rax), %xmm0
addsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0x120(%rbp)
movq -0x28(%rbp), %rdi
addq $0x48, %rdi
movq -0x38(%rbp), %rsi
callq 0x651e0
movq %rax, %rdi
movq -0x78(%rbp), %rsi
callq 0x3ec30
movsd -0x120(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x52960
movq %rax, -0x118(%rbp)
movq -0x10(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x52960
movq -0x118(%rbp), %rdi
movq %rax, %rsi
movl -0xa0(%rbp), %edx
xorl %ecx, %ecx
callq 0xbd750
movsd %xmm0, -0xc8(%rbp)
movq -0x28(%rbp), %rdi
addq $0x60, %rdi
movq -0x38(%rbp), %rsi
callq 0x651e0
movq %rax, %rdi
movq -0x78(%rbp), %rsi
callq 0x3ec30
movsd (%rax), %xmm0
addsd -0xc8(%rbp), %xmm0
movsd %xmm0, -0x110(%rbp)
movq -0x28(%rbp), %rdi
addq $0x60, %rdi
movq -0x38(%rbp), %rsi
callq 0x651e0
movq %rax, %rdi
movq -0x78(%rbp), %rsi
callq 0x3ec30
movsd -0x110(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x28(%rbp), %rdi
addq $0x78, %rdi
movq -0x38(%rbp), %rsi
callq 0x651e0
movq %rax, %rdi
movq -0x78(%rbp), %rsi
callq 0x3ec30
movsd (%rax), %xmm0
movsd 0x78967(%rip), %xmm1    # 0x1322b8
subsd -0xc8(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x108(%rbp)
movq -0x28(%rbp), %rdi
addq $0x78, %rdi
movq -0x38(%rbp), %rsi
callq 0x651e0
movq %rax, %rdi
movq -0x78(%rbp), %rsi
callq 0x3ec30
movsd -0x108(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x28(%rbp), %rdi
addq $0x90, %rdi
movq -0x38(%rbp), %rsi
callq 0x651e0
movq %rax, %rdi
movq -0x78(%rbp), %rsi
callq 0x3ec30
movsd (%rax), %xmm0
movsd -0xb8(%rbp), %xmm1
subsd -0xc8(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x100(%rbp)
movq -0x28(%rbp), %rdi
addq $0x90, %rdi
movq -0x38(%rbp), %rsi
callq 0x651e0
movq %rax, %rdi
movq -0x78(%rbp), %rsi
callq 0x3ec30
movsd -0x100(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x28(%rbp), %rdi
addq $0xa8, %rdi
movq -0x38(%rbp), %rsi
callq 0x651e0
movq %rax, %rdi
movq -0x78(%rbp), %rsi
callq 0x3ec30
movsd (%rax), %xmm0
movsd -0xb8(%rbp), %xmm2
subsd -0xc8(%rbp), %xmm2
movsd 0x79c92(%rip), %xmm1    # 0x1336c8
subsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0xf8(%rbp)
movq -0x28(%rbp), %rdi
addq $0xa8, %rdi
movq -0x38(%rbp), %rsi
callq 0x651e0
movq %rax, %rdi
movq -0x78(%rbp), %rsi
callq 0x3ec30
movsd -0xf8(%rbp), %xmm0
movsd %xmm0, (%rax)
jmp 0xb9a74
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0xb9559
jmp 0xb9a87
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xb9483
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0xab50
nopw (%rax,%rax)