// File: /workspace/github_cpp_makefile_star2_O2/gcollet[P]MstatX/src/mvector.cpp
// Function: MVectStat::calculate(Msa&)
void
MVectStat :: calculate(Msa & msa)
{
	int L = msa.getNcol();
	int N = msa.getNseq();
	
	/* Get the scoring matrix */
	ScoringMatrix score_mat(Options::Get().matrix_fname);
	
	/* Remove the unknown symbol from msa (consider them as gaps)*/
	sm_alphabet = score_mat.getAlphabet();
	msa.fitToAlphabet(sm_alphabet);
	
	/* Calculate the mean vector for each column */
	int K = (int) sm_alphabet.size();
	means = vector<vector<float> >(L);
	
	for (int col(0); col < L; col++) {
		vector<float> mean_col(K, 0.0);
		for (int seq(0); seq < N; ++seq) {
			if (msa.getSymbol(seq,col) == '-'){
				continue;
			} else {
				for (int a(0); a < K; ++a) {
					mean_col[a] += score_mat.normScore(sm_alphabet[a],msa.getSymbol(seq,col));
				}
			}
		}
		for (int a(0); a < K; ++a) {
			mean_col[a] /= (float) N;
		}
		means[col] = mean_col;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, %rbx
movq %rdi, %r15
movslq 0xcc(%rsi), %r13
movl 0xc8(%rsi), %eax
movq %rax, 0x10(%rsp)
callq 0x4a00
leaq 0x88(%rax), %rsi
leaq 0x80(%rsp), %r14
movq %r14, %rdi
callq 0x4350
leaq 0xa0(%rsp), %rdi
movq %r14, %rsi
callq 0xadc0
leaq 0x80(%rsp), %rdi
callq 0x4110
leaq 0xa8(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0x4350
leaq 0x8(%r15), %r12
leaq 0x40(%rsp), %r14
movq %r12, %rdi
movq %r14, %rsi
callq 0x42f0
movq %r14, %rdi
callq 0x4110
leaq 0x60(%rsp), %rdi
movq %r12, %rsi
callq 0x4350
leaq 0x60(%rsp), %rsi
movq %rbx, %rdi
callq 0x9ce6
leaq 0x60(%rsp), %rdi
callq 0x4110
movq 0x10(%r15), %rbp
leaq 0x40(%rsp), %rdi
leaq 0xc(%rsp), %rdx
movq %r13, %r14
movq %r13, %rsi
callq 0xaaa2
addq $0x28, %r15
leaq 0x40(%rsp), %rax
movq %r15, 0x28(%rsp)
movq %r15, %rdi
movq %rax, %r15
movq %rax, %rsi
callq 0xad3c
movq %r15, %rdi
callq 0xaaf4
movslq %ebp, %rcx
movq 0x10(%rsp), %rax
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x1c(%rsp)
xorl %ebp, %ebp
testl %ecx, %ecx
movl $0x0, %r13d
movq %rcx, 0x30(%rsp)
cmovgl %ecx, %r13d
testl %eax, %eax
cmovlel %ebp, %eax
movq %rax, 0x10(%rsp)
testl %r14d, %r14d
cmovlel %ebp, %r14d
movq %r14, 0x20(%rsp)
cmpq %r14, %rbp
je 0xa835
andl $0x0, 0xc(%rsp)
movq %r15, %rdi
movq 0x30(%rsp), %rsi
leaq 0xc(%rsp), %rdx
leaq 0xb(%rsp), %rcx
callq 0xa1ac
xorl %ecx, %ecx
cmpq 0x10(%rsp), %rcx
je 0xa7eb
movq 0x38(%rbx), %rax
movq %rcx, 0x38(%rsp)
movq %rcx, %r15
shlq $0x5, %r15
movq (%rax,%r15), %rax
cmpb $0x2d, (%rax,%rbp)
jne 0xa7ab
movq 0x38(%rsp), %rcx
incq %rcx
leaq 0x40(%rsp), %r15
jmp 0xa77b
xorl %r14d, %r14d
cmpq %r14, %r13
je 0xa79c
movq (%r12), %rax
movsbl (%rax,%r14), %esi
movq 0x38(%rbx), %rax
movq (%rax,%r15), %rax
movsbl (%rax,%rbp), %edx
leaq 0xa0(%rsp), %rdi
callq 0xb47c
movq 0x40(%rsp), %rax
addss (%rax,%r14,4), %xmm0
movss %xmm0, (%rax,%r14,4)
incq %r14
jmp 0xa7ae
movq 0x40(%rsp), %rax
xorl %ecx, %ecx
cmpq %rcx, %r13
je 0xa80c
movss (%rax,%rcx,4), %xmm0
divss 0x1c(%rsp), %xmm0
movss %xmm0, (%rax,%rcx,4)
incq %rcx
jmp 0xa7f2
imulq $0x18, %rbp, %rdi
movq 0x28(%rsp), %rax
addq (%rax), %rdi
movq %r15, %rsi
callq 0xab16
movq %r15, %rdi
callq 0x49cc
incq %rbp
movq 0x20(%rsp), %r14
jmp 0xa754
leaq 0xa0(%rsp), %rdi
callq 0xb3a0
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa87d
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x4110
jmp 0xa88f
jmp 0xa87d
jmp 0xa87d
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x4110
jmp 0xa89c
jmp 0xa882
movq %rax, %rbx
jmp 0xa88f
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x49cc
leaq 0xa0(%rsp), %rdi
callq 0xb3a0
movq %rbx, %rdi
callq 0x4430