// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/data.c
// Function: within_class_matrix
matrix within_class_matrix(Instanceptr myptr)
{
 /*!Last Changed 26.01.2002*/
 int i,j,k;
 Instanceptr temp;
 int *c_counts;
 Instanceptr c_means; 
 matrix result, current_matrix;
 temp = myptr;
 result = matrix_alloc(current_dataset->multifeaturecount - 1, current_dataset->multifeaturecount - 1);
 current_matrix = matrix_alloc(current_dataset->multifeaturecount - 1, current_dataset->multifeaturecount - 1);
 c_counts = find_class_counts(temp);
 c_means = find_class_means(temp, c_counts);
 for (i = 0; i < current_dataset->classno; i++)
  {
   temp = myptr;
   while (temp)
    {
     if (give_classno(temp) == i)
       for (j = 0; j < current_dataset->multifeaturecount - 1; j++)
         for (k = 0; k < current_dataset->multifeaturecount - 1; k++)
           current_matrix.values[j][k] += (real_feature(temp, j) - real_feature(data_x(c_means, i), j)) * (real_feature(temp, k) - real_feature(data_x(c_means, i), k));
     temp = temp->next;
    }
   matrix_add(&result, current_matrix);
   for (j = 0; j < current_dataset->multifeaturecount - 1; j++)
     for (k = 0; k < current_dataset->multifeaturecount - 1; k++)
       current_matrix.values[j][k] = 0;
  }
 matrix_free(current_matrix);
 safe_free(c_counts);
 deallocate(c_means);
 return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0xc3b5a(%rip), %r14     # 0xd5870
movq (%r14), %rax
movl 0x1c0(%rax), %edi
decl %edi
movl %edi, %esi
callq 0x3d79d
movq %rax, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
movq (%r14), %rax
movl 0x1c0(%rax), %edi
decl %edi
movl %edi, %esi
callq 0x3d79d
movq %rax, 0x8(%rsp)
movq %rdx, %r15
movq %rbx, %rdi
callq 0x115a6
movq %rbx, 0x10(%rsp)
movq %rbx, %rdi
movq %rax, 0x28(%rsp)
movq %rax, %rsi
callq 0x118da
movq %rax, %r13
movq (%r14), %rax
cmpl $0x0, 0x10(%rax)
jle 0x11ede
xorl %ebp, %ebp
cmpq $0x0, 0x10(%rsp)
je 0x11e7e
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x2f33a
cmpl %ebp, %eax
leaq 0xc3ad3(%rip), %rax     # 0xd5870
jne 0x11e71
movq (%rax), %rax
movl 0x1c0(%rax), %eax
cmpl $0x2, %eax
jl 0x11e71
xorl %r14d, %r14d
cmpl $0x1, %eax
jle 0x11e5f
xorl %r12d, %r12d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2ed6a
movsd %xmm0, (%rsp)
movq %r13, %rdi
movl %ebp, %esi
callq 0x31851
movq %rax, %rdi
movl %r14d, %esi
callq 0x2ed6a
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movq %rbx, %rdi
movl %r12d, %esi
callq 0x2ed6a
movsd %xmm0, 0x30(%rsp)
movq %r13, %rdi
movl %ebp, %esi
callq 0x31851
movq %rax, %rdi
movl %r12d, %esi
callq 0x2ed6a
movsd 0x30(%rsp), %xmm1
subsd %xmm0, %xmm1
mulsd (%rsp), %xmm1
movq (%r15,%r14,8), %rax
addsd (%rax,%r12,8), %xmm1
movsd %xmm1, (%rax,%r12,8)
incq %r12
leaq 0xc3a2a(%rip), %rax     # 0xd5870
movq (%rax), %rax
movslq 0x1c0(%rax), %rax
leaq -0x1(%rax), %rcx
cmpq %rcx, %r12
jl 0x11dc4
jmp 0x11e65
leal -0x1(%rax), %ecx
movslq %ecx, %rcx
incq %r14
cmpq %rcx, %r14
jl 0x11db8
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
jne 0x11d8c
leaq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
callq 0x3f993
leaq 0xc39d9(%rip), %rax     # 0xd5870
movq (%rax), %rax
movq %rax, (%rsp)
movl 0x1c0(%rax), %r12d
cmpl $0x2, %r12d
jl 0x11ecf
decl %r12d
leaq (,%r12,8), %rbx
xorl %r14d, %r14d
movq (%r15,%r14,8), %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x4050
incq %r14
cmpq %r14, %r12
jne 0x11eb9
incl %ebp
movq (%rsp), %rax
cmpl 0x10(%rax), %ebp
jl 0x11d7b
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x3ed51
movq 0x28(%rsp), %rdi
callq 0x3a180
movq %r13, %rdi
callq 0x2ff55
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rdx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq