// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/instancelist.c
// Function: instancelist_to_matrix
matrix instancelist_to_matrix(Instanceptr list, int problemtype, int positive, MULTIVARIATE_TYPE multivariate_type)
{
 /*!Last Changed 28.05.2004*/
 /*!Last Changed 22.03.2004*/
 matrix result;
 int i, dim, matrixdim, x, j;
 Instanceptr tmp;
 long int dataindex;
 dim = current_dataset->multifeaturecount - 1;
 if (multivariate_type == MULTIVARIATE_LINEAR)
   matrixdim = dim;
 else
   matrixdim = multifeaturecount_2d(current_dataset);
 result = matrix_alloc(data_size(list), matrixdim + 1);
 tmp = list;
 dataindex = 0;
 while (tmp)
  {
   if (multivariate_type == MULTIVARIATE_LINEAR)
     for (i = 0; i < current_dataset->multifeaturecount - 1; i++)
       result.values[dataindex][i] = real_feature(tmp, i);
   else
     if (multivariate_type == MULTIVARIATE_QUADRATIC)
      {
       x = 0;
       for (i = 0; i < dim; i++)
         for (j = i; j < dim; j++)
          {
           result.values[dataindex][x] = real_feature(tmp, i) * real_feature(tmp, j);
           x++;
          }
       for (i = 0; i < dim; i++)
        {
         result.values[dataindex][x] = real_feature(tmp, i);
         x++;
        }
      }
   switch (problemtype)
    {
     case CLASSIFICATION:result.values[dataindex][matrixdim] = give_classno(tmp);
                         break;
     case REGRESSION    :result.values[dataindex][matrixdim] = give_regressionvalue(tmp);
                         break;
     case 2             :if (give_classno(tmp) == positive)
                           result.values[dataindex][matrixdim] = 0;
                         else
                           result.values[dataindex][matrixdim] = 1;
                         break;
     case 3             :result.values[dataindex][matrixdim] = positive;
                         break;
     default            :printf(m1241, problemtype);
                         break;
    }
   tmp = tmp->next;
   dataindex++;
  }
 return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x18(%rbp)
movl %esi, -0x1c(%rbp)
movl %edx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
leaq 0xc1104(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x1c0(%rax), %eax
subl $0x1, %eax
movl %eax, -0x2c(%rbp)
cmpl $-0x2, -0x24(%rbp)
jne 0x44759
movl -0x2c(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x4476b
leaq 0xc10e0(%rip), %rax     # 0x105840
movq (%rax), %rdi
callq 0x1b690
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x449f0
movl %eax, %edi
movl -0x30(%rbp), %esi
addl $0x1, %esi
callq 0x57fc0
movq %rax, -0x58(%rbp)
movq %rdx, -0x50(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x449de
cmpl $-0x2, -0x24(%rbp)
jne 0x4480c
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
leaq 0xc1075(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
movl 0x1c0(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x44807
movq -0x40(%rbp), %rdi
movl -0x28(%rbp), %esi
callq 0x42c40
movq -0x8(%rbp), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x447c1
jmp 0x448e1
cmpl $-0x3, -0x24(%rbp)
jne 0x448df
movl $0x0, -0x34(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x44899
movl -0x28(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x4488c
movq -0x40(%rbp), %rdi
movl -0x28(%rbp), %esi
callq 0x42c40
movsd %xmm0, -0x60(%rbp)
movq -0x40(%rbp), %rdi
movl -0x38(%rbp), %esi
callq 0x42c40
movaps %xmm0, %xmm1
movsd -0x60(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x34(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x44832
jmp 0x4488e
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x44824
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x448dd
movq -0x40(%rbp), %rdi
movl -0x28(%rbp), %esi
callq 0x42c40
movq -0x8(%rbp), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x34(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x448a0
jmp 0x448df
jmp 0x448e1
movl -0x1c(%rbp), %eax
movq %rax, -0x68(%rbp)
subq $0x3, %rax
ja 0x449b0
movq -0x68(%rbp), %rax
leaq 0xa0d43(%rip), %rcx     # 0xe5640
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x40(%rbp), %rdi
callq 0x43530
cvtsi2sd %eax, %xmm0
movq -0x8(%rbp), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x449c1
movq -0x40(%rbp), %rdi
callq 0x43580
movq -0x8(%rbp), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x449c1
movq -0x40(%rbp), %rdi
callq 0x43530
cmpl -0x20(%rbp), %eax
jne 0x44975
movq -0x8(%rbp), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0x44992
movq -0x8(%rbp), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movsd 0x9d68b(%rip), %xmm0    # 0xe2018
movsd %xmm0, (%rax,%rcx,8)
jmp 0x449c1
cvtsi2sdl -0x20(%rbp), %xmm0
movq -0x8(%rbp), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x449c1
movl -0x1c(%rbp), %esi
leaq 0xa0c96(%rip), %rdi     # 0xe5650
movb $0x0, %al
callq 0x4030
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x447a9
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)