// File: c2-d2[P]disty/src/main.cpp
// Function: void pair_matrix_char_acgt<std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>>(std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&, pair_char_t&)
void pair_matrix_char_acgt(T &pair_matrix, pair_char_t &pair_char) {
    assert(pair_matrix.size()==128);
    assert(pair_matrix[0].size()==128);

    pair_char.matches=0;
    pair_char.mismatches=0;
    pair_char.unknown=0;

    for(unsigned char i=0;i<128;i++){
        char n1_nt4=acgt_nt256_nt4[i];
        for(unsigned char j=0;j<128;j++){
            char n2_nt4=acgt_nt256_nt4[j];

            if (n1_nt4==4 || n2_nt4==4){
                pair_char.unknown+=pair_matrix[i][j];
            }
            else{
                if(n1_nt4==n2_nt4){
                    pair_char.matches+=pair_matrix[i][j];
                }
                else {
                    pair_char.mismatches+=pair_matrix[i][j];
                }
            }
        }
    }
    //cout << pair_char.matches << " " << pair_char.mismatches << " " << pair_char.unknown << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x7b40
cmpq $0x80, %rax
jne 0x50c3
jmp 0x50e2
leaq 0x3a14(%rip), %rdi      # 0x8ade
leaq 0x34fd(%rip), %rsi      # 0x85ce
movl $0x1a3, %edx            # imm = 0x1A3
leaq 0x3a34(%rip), %rcx      # 0x8b11
callq 0x2110
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x53b0
movq %rax, %rdi
callq 0x7610
cmpq $0x80, %rax
jne 0x5101
jmp 0x5120
leaq 0x39ee(%rip), %rdi      # 0x8af6
leaq 0x34bf(%rip), %rsi      # 0x85ce
movl $0x1a4, %edx            # imm = 0x1A4
leaq 0x39f6(%rip), %rcx      # 0x8b11
callq 0x2110
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x8(%rax)
movb $0x0, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x80, %eax
jge 0x5247
movzbl -0x11(%rbp), %eax
movl %eax, %ecx
leaq 0x2f90(%rip), %rax      # 0x80f0
movb (%rax,%rcx), %al
movb %al, -0x12(%rbp)
movb $0x0, -0x13(%rbp)
movzbl -0x13(%rbp), %eax
cmpl $0x80, %eax
jge 0x5238
movzbl -0x13(%rbp), %eax
movl %eax, %ecx
leaq 0x2f6a(%rip), %rax      # 0x80f0
movb (%rax,%rcx), %al
movb %al, -0x14(%rbp)
movsbl -0x12(%rbp), %eax
cmpl $0x4, %eax
je 0x519e
movsbl -0x14(%rbp), %eax
cmpl $0x4, %eax
jne 0x51c9
movq -0x8(%rbp), %rdi
movzbl -0x11(%rbp), %eax
movl %eax, %esi
callq 0x53b0
movq %rax, %rdi
movzbl -0x13(%rbp), %eax
movl %eax, %esi
callq 0x53d0
movl (%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
jmp 0x5229
movsbl -0x12(%rbp), %eax
movsbl -0x14(%rbp), %ecx
cmpl %ecx, %eax
jne 0x51fe
movq -0x8(%rbp), %rdi
movzbl -0x11(%rbp), %eax
movl %eax, %esi
callq 0x53b0
movq %rax, %rdi
movzbl -0x13(%rbp), %eax
movl %eax, %esi
callq 0x53d0
movl (%rax), %ecx
movq -0x10(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x5227
movq -0x8(%rbp), %rdi
movzbl -0x11(%rbp), %eax
movl %eax, %esi
callq 0x53b0
movq %rax, %rdi
movzbl -0x13(%rbp), %eax
movl %eax, %esi
callq 0x53d0
movl (%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
jmp 0x5229
jmp 0x522b
movb -0x13(%rbp), %al
addb $0x1, %al
movb %al, -0x13(%rbp)
jmp 0x516a
jmp 0x523a
movb -0x11(%rbp), %al
addb $0x1, %al
movb %al, -0x11(%rbp)
jmp 0x5144
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)