// File: gcollet[P]MstatX/src/msa.cpp
// Function: Msa::countFreq()
void
Msa :: countFreq(){
	int total = 0;
	vector<int> tmp_freq(alphabet.size(), 0);
	
	aa_freq = vector<float>(alphabet.size());
	/* Count the number of each amino acid type defined in alphabet */
	for(int col(0); col < ncol; ++col){
		for(int row(0); row < nseq; ++row){
			if (mali_seq[row][col] != '-' && mali_seq[row][col] != ' '){
				total++;
			}
			int pos = (int) alphabet.find(mali_seq[row][col]);
			if (pos >= (int) alphabet.size()){
			  cerr << "error : symbol is not in the alphabet\n";
				exit(0);
			}
			tmp_freq[pos]++;
		}
	}

	/* Divide by the total */
	for (int i(0); i < (int) aa_freq.size(); ++i){
		aa_freq[i] = (float) tmp_freq[i] ;
		aa_freq[i] /= (float) total;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x88(%rbp)
movl $0x0, -0xc(%rbp)
callq 0x4260
movq %rax, -0x80(%rbp)
movl $0x0, -0x2c(%rbp)
leaq -0x2d(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x9090
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rcx
leaq -0x28(%rbp), %rdi
leaq -0x2c(%rbp), %rdx
callq 0x90b0
jmp 0x12345
leaq -0x2d(%rbp), %rdi
callq 0x9130
movq -0x88(%rbp), %rdi
callq 0x4260
movq %rax, -0x98(%rbp)
leaq -0x59(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x7510
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
leaq -0x58(%rbp), %rdi
callq 0x137b0
jmp 0x1238a
movq -0x88(%rbp), %rdi
addq $0x80, %rdi
leaq -0x58(%rbp), %rsi
callq 0x13820
leaq -0x58(%rbp), %rdi
callq 0x4ea0
leaq -0x59(%rbp), %rdi
callq 0x5120
movl $0x0, -0x60(%rbp)
movq -0x88(%rbp), %rcx
movl -0x60(%rbp), %eax
cmpl 0xcc(%rcx), %eax
jge 0x12571
movl $0x0, -0x64(%rbp)
movq -0x88(%rbp), %rcx
movl -0x64(%rbp), %eax
cmpl 0xc8(%rcx), %eax
jge 0x12561
movq -0x88(%rbp), %rdi
addq $0x38, %rdi
movslq -0x64(%rbp), %rsi
callq 0x74a0
movq %rax, %rdi
movslq -0x60(%rbp), %rsi
callq 0x46c0
movq %rax, -0xa0(%rbp)
jmp 0x12416
movq -0xa0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x124b1
movq -0x88(%rbp), %rdi
addq $0x38, %rdi
movslq -0x64(%rbp), %rsi
callq 0x74a0
movq %rax, %rdi
movslq -0x60(%rbp), %rsi
callq 0x46c0
movq %rax, -0xa8(%rbp)
jmp 0x12452
movq -0xa8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
je 0x124b1
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x124b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x2d(%rbp), %rdi
callq 0x9130
jmp 0x12642
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x59(%rbp), %rdi
callq 0x5120
jmp 0x12639
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x12639
movq -0x88(%rbp), %rdi
movq %rdi, %rax
movq %rax, -0xb8(%rbp)
addq $0x38, %rdi
movslq -0x64(%rbp), %rsi
callq 0x74a0
movq %rax, %rdi
movslq -0x60(%rbp), %rsi
callq 0x46c0
movq %rax, -0xb0(%rbp)
jmp 0x124e4
movq -0xb0(%rbp), %rax
movq -0xb8(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
movsbl (%rax), %esi
callq 0x4480
movq -0x88(%rbp), %rdi
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0xbc(%rbp)
callq 0x4260
movq %rax, %rcx
movl -0xbc(%rbp), %eax
cmpl %ecx, %eax
jl 0x1253f
movq 0x13abe(%rip), %rdi     # 0x25fe8
leaq 0x91a0(%rip), %rsi      # 0x1b6d1
callq 0x4330
jmp 0x12538
xorl %edi, %edi
callq 0x4400
movslq -0x68(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x7480
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x123d7
jmp 0x12563
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x123ba
movl $0x0, -0x6c(%rbp)
movq -0x88(%rbp), %rdi
movl -0x6c(%rbp), %eax
movl %eax, -0xc0(%rbp)
addq $0x80, %rdi
callq 0x5160
movq %rax, %rcx
movl -0xc0(%rbp), %eax
cmpl %ecx, %eax
jge 0x12627
movslq -0x6c(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x7480
movq -0x88(%rbp), %rdi
cvtsi2ssl (%rax), %xmm0
movss %xmm0, -0xc8(%rbp)
addq $0x80, %rdi
movslq -0x6c(%rbp), %rsi
callq 0x5180
movss -0xc8(%rbp), %xmm0
movq -0x88(%rbp), %rdi
movss %xmm0, (%rax)
cvtsi2ssl -0xc(%rbp), %xmm0
movss %xmm0, -0xc4(%rbp)
addq $0x80, %rdi
movslq -0x6c(%rbp), %rsi
callq 0x5180
movss -0xc4(%rbp), %xmm1
movss (%rax), %xmm0
divss %xmm1, %xmm0
movss %xmm0, (%rax)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x12578
leaq -0x28(%rbp), %rdi
callq 0x9170
addq $0xd0, %rsp
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x9170
movq -0x38(%rbp), %rdi
callq 0x45e0
nopl (%rax,%rax)