// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/data.c
// Function: class_covariance
matrix class_covariance(Instanceptr myptr, int classno, Instanceptr classmean)
{
 /*!Last Changed 26.03.2002*/
 int i,j,size = 0;
 matrix temp;
 Instanceptr current = myptr;
 temp = matrix_alloc(current_dataset->multifeaturecount - 1, current_dataset->multifeaturecount - 1);
 while (current)
  {
   if (give_classno(current) == classno)
    {
     for (i = 0; i < current_dataset->multifeaturecount - 1; i++)
       for (j = 0; j < current_dataset->multifeaturecount - 1; j++)
         temp.values[i][j] += (real_feature(current, i) - real_feature(classmean, i)) * (real_feature(current, j) - real_feature(classmean, j));
     size++;
    }
   current = current->next;
  }
 for (i = 0; i < current_dataset->multifeaturecount - 1; i++)
   for (j = 0; j < current_dataset->multifeaturecount - 1; j++)
     if (size > 1)
       temp.values[i][j] /= (size - 1);
     else
       temp.values[i][j] = 0;
 return temp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x18(%rbp)
movl %esi, -0x1c(%rbp)
movq %rdx, -0x28(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq 0xee197(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x1c0(%rax), %edi
subl $0x1, %edi
leaq 0xee184(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x1c0(%rax), %esi
subl $0x1, %esi
callq 0x57fc0
movq %rax, -0x50(%rbp)
movq %rdx, -0x48(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x17802
movq -0x40(%rbp), %rdi
callq 0x43530
cmpl -0x1c(%rbp), %eax
jne 0x177f1
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
leaq 0xee12d(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
movl 0x1c0(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x177e8
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
leaq 0xee108(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
movl 0x1c0(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x177d8
movq -0x40(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x42c40
movsd %xmm0, -0x68(%rbp)
movq -0x28(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x42c40
movaps %xmm0, %xmm1
movsd -0x68(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x40(%rbp), %rdi
movl -0x30(%rbp), %esi
callq 0x42c40
movsd %xmm0, -0x60(%rbp)
movq -0x28(%rbp), %rdi
movl -0x30(%rbp), %esi
callq 0x42c40
movsd -0x60(%rbp), %xmm2
movaps %xmm0, %xmm1
movsd -0x58(%rbp), %xmm0
subsd %xmm1, %xmm2
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1772e
jmp 0x177da
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x17709
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x176e5
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
leaq 0xee02d(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
movl 0x1c0(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x178ad
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
leaq 0xee008(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
movl 0x1c0(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1789d
cmpl $0x1, -0x34(%rbp)
jle 0x17878
movl -0x34(%rbp), %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm1
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0x17890
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0x17892
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1782e
jmp 0x1789f
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x17809
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)