// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/data.c
// Function: dimension_reduce_with_pca
void dimension_reduce_with_pca(Instanceptr inst, int howmany, matrix eigenvect)
{
 /*!Last Changed 02.02.2004 added safemalloc*/
 Instanceptr tmp = inst;
 int i, j, k;
 double* values, sum;
 values = (double *)safemalloc((current_dataset->multifeaturecount - 1) * sizeof(double), "dimension_reduce_with_pca", 4);
 while (tmp)
  {
   for (i = 0; i < howmany; i++)
    {
     sum = 0;
     for (j = 0; j < current_dataset->multifeaturecount - 1; j++)
       sum += eigenvect.values[j][i] * real_feature(tmp, j);
     values[i] = sum;
    }
   k = 0;
   for (j = 0; j < current_dataset->multifeaturecount - 1 && k < howmany; j++)
     if (in_list(current_dataset->features[j].type, 2, REAL, INTEGER))
      {
       tmp->values[j].floatvalue = (double) values[k];
       k++;
      }
   tmp = tmp->next;
  }
 safe_free(values);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdx, -0x10(%rbp)
movq %rcx, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movl %esi, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq 0xee74a(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x1c0(%rax), %eax
subl $0x1, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
leaq 0xcbf09(%rip), %rsi     # 0xe3019
movl $0x4, %edx
callq 0x52d70
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x1728e
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x171d0
xorps %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
leaq 0xee6eb(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
movl 0x1c0(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x171b0
movq -0x8(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x28(%rbp), %rdi
movl -0x30(%rbp), %esi
callq 0x42c40
movaps %xmm0, %xmm2
movsd -0x50(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1714b
movsd -0x48(%rbp), %xmm0
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x17130
movl $0x0, -0x34(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %ecx
leaq 0xee658(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x1c0(%rax), %edx
subl $0x1, %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x51(%rbp)
jge 0x17209
movl -0x34(%rbp), %eax
cmpl -0x1c(%rbp), %eax
setl %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0x17212
jmp 0x1727d
leaq 0xee627(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x30(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl (%rax), %edi
movl $0x2, %edx
xorl %ecx, %ecx
movl %edx, %esi
movb $0x0, %al
callq 0x53e40
cmpl $0x0, %eax
je 0x1726d
movq -0x40(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x30(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1726f
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x171de
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x1711e
movq -0x40(%rbp), %rdi
callq 0x52e80
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)