// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/process.c
// Function: test_algorithm
void test_algorithm(int algorithm, void* model, void* parameters, int testsize)
{
 /*!Last Changed 01.08.2007 added confusion_matrix*/
 /*!Last Changed 29.12.2005*/
 Instanceptr test, next;
 int i, testindex = 0, classno;
 double real;
 Prediction predicted;
 if (get_algorithm_type(algorithm) == CLASSIFICATION)
   result = performance_initialize(testsize);
 else
   result = performance_initialize_regression(testsize);
 testmean = find_mean(testdata);
 testvariance = find_variance(testdata);
 test = testdata;
 while (test)
  {
   next = test->next;
   test->next = NULL;
   if (get_algorithm_type(algorithm) == CLASSIFICATION)
    {
     predicted = classification_algorithms[algorithm - SELECTMAX].test_algorithm(test, model, parameters, ((Classificationresultptr) result)->posteriors[testindex]);
     if (current_dataset->classno == 2 && in_list(algorithm, 2, SVM, SIMPLEXSVM))
       ((Classificationresultptr) result)->hingeloss += predicted.hingeloss;
     if (algorithm == KNN)
       for (i = 0; i < 3; i++)
         ((Classificationresultptr) result)->knnloss[i] += predicted.knnloss[i];
     if (get_parameter_o("changedecisionthreshold") == ON && current_dataset->classno == 2)
      {
       if (((Classificationresultptr) result)->posteriors[testindex][0] > get_parameter_f("decisionthreshold"))
         predicted.classno = 0;
       else
         predicted.classno = 1;
      }
    }
   else
    {
     predicted = regression_algorithms[algorithm - ONEFEATURE].test_algorithm(test, model, parameters, NULL);
     if (in_list(algorithm, 2, SVMREG, SIMPLEXSVMREG))
       ((Regressionresultptr) result)->epsilonloss += predicted.epsilonloss;
    }
   test->next = next;
   if (get_algorithm_type(algorithm) == CLASSIFICATION)
    {
     classno = give_classno(test);
     ((Classificationresultptr) result)->class_counts[classno]++;
     if (classno == predicted.classno)
      {
       ((Classificationresultptr) result)->class_performance[classno]++;
       ((Classificationresultptr) result)->performance++;
       test->classified = YES;
      }
     else
      {
       test->classified = NO;
      }
     ((Classificationresultptr) result)->confusion_matrix[classno][predicted.classno]++;
    }
   else
    {
     real = give_regressionvalue(test);
     ((Regressionresultptr) result)->absoluteerrors[testindex] = predicted.regvalue;
     ((Regressionresultptr) result)->regressionperformance += (real - predicted.regvalue) * (real - predicted.regvalue);
    }
   testindex++;
   test = test->next;
  }
 safe_free(testmean.values);
 safe_free(testvariance.values);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x4(%rbp), %edi
callq 0x4400
cmpl $0x0, %eax
jne 0x8a34e
movl -0x1c(%rbp), %edi
callq 0xba40
movq %rax, 0x357cac(%rip)    # 0x3e1ff8
jmp 0x8a35d
movl -0x1c(%rbp), %edi
callq 0xa0320
movq %rax, 0x357c9b(%rip)    # 0x3e1ff8
movq 0x2ddaa4(%rip), %rsi    # 0x367e08
leaq -0xb0(%rbp), %rdi
callq 0x19b30
leaq 0x357c89(%rip), %rdi    # 0x3e2000
leaq -0xb0(%rbp), %rsi
movl $0x30, %edx
callq 0x42b0
movq 0x2dda79(%rip), %rsi    # 0x367e08
leaq -0xe0(%rbp), %rdi
callq 0x1a0a0
leaq 0x357c8e(%rip), %rdi    # 0x3e2030
leaq -0xe0(%rbp), %rsi
movl $0x30, %edx
callq 0x42b0
movq 0x2dda4e(%rip), %rax    # 0x367e08
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x8a6d8
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, 0x10(%rax)
movl -0x4(%rbp), %edi
callq 0x4400
cmpl $0x0, %eax
jne 0x8a542
movl -0x4(%rbp), %eax
subl $0x3e8, %eax            # imm = 0x3E8
movslq %eax, %rcx
leaq 0x79d8c(%rip), %rax     # 0x104190
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq 0x357bd6(%rip), %rdi    # 0x3e1ff8
movq 0x28(%rdi), %rdi
movslq -0x38(%rbp), %r8
movq (%rdi,%r8,8), %r8
leaq -0x118(%rbp), %rdi
callq *%rax
leaq -0x80(%rbp), %rdi
leaq -0x118(%rbp), %rsi
movl $0x38, %edx
callq 0x42b0
movq 0x7b3ed(%rip), %rax     # 0x105840
cmpl $0x2, 0x10(%rax)
jne 0x8a48d
movl -0x4(%rbp), %edi
movl $0x2, %esi
movl $0x3f9, %edx            # imm = 0x3F9
movl $0x3fa, %ecx            # imm = 0x3FA
movb $0x0, %al
callq 0x53e40
cmpl $0x0, %eax
je 0x8a48d
movsd -0x70(%rbp), %xmm0
movq 0x357b75(%rip), %rax    # 0x3e1ff8
addsd 0x38(%rax), %xmm0
movsd %xmm0, 0x38(%rax)
cmpl $0x3e9, -0x4(%rbp)      # imm = 0x3E9
jne 0x8a4d1
movl $0x0, -0x34(%rbp)
cmpl $0x3, -0x34(%rbp)
jge 0x8a4cf
movslq -0x34(%rbp), %rax
movsd -0x60(%rbp,%rax,8), %xmm0
movq 0x357b44(%rip), %rax    # 0x3e1ff8
movslq -0x34(%rbp), %rcx
addsd 0x40(%rax,%rcx,8), %xmm0
movsd %xmm0, 0x40(%rax,%rcx,8)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x8a49d
jmp 0x8a4d1
leaq 0x5d22c(%rip), %rdi     # 0xe7704
callq 0x79440
cmpl $0x1, %eax
jne 0x8a53d
movq 0x7b357(%rip), %rax     # 0x105840
cmpl $0x2, 0x10(%rax)
jne 0x8a53d
movq 0x357b02(%rip), %rax    # 0x3e1ff8
movq 0x28(%rax), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x158(%rbp)
leaq 0x5d1f5(%rip), %rdi     # 0xe770a
callq 0x79040
movaps %xmm0, %xmm1
movsd -0x158(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x8a534
movl $0x0, -0x78(%rbp)
jmp 0x8a53b
movl $0x1, -0x78(%rbp)
jmp 0x8a53d
jmp 0x8a5c2
movl -0x4(%rbp), %eax
subl $0x7d0, %eax            # imm = 0x7D0
movslq %eax, %rcx
leaq 0x7a2ac(%rip), %rax     # 0x104800
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq -0x150(%rbp), %rdi
xorl %r8d, %r8d
callq *%rax
leaq -0x80(%rbp), %rdi
leaq -0x150(%rbp), %rsi
movl $0x38, %edx
callq 0x42b0
movl -0x4(%rbp), %edi
movl $0x2, %esi
movl $0x7d8, %edx            # imm = 0x7D8
movl $0x7d9, %ecx            # imm = 0x7D9
movb $0x0, %al
callq 0x53e40
cmpl $0x0, %eax
je 0x8a5c0
movsd -0x68(%rbp), %xmm0
movq 0x357a42(%rip), %rax    # 0x3e1ff8
addsd 0x18(%rax), %xmm0
movsd %xmm0, 0x18(%rax)
jmp 0x8a5c2
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x4(%rbp), %edi
callq 0x4400
cmpl $0x0, %eax
jne 0x8a66b
movq -0x28(%rbp), %rdi
callq 0x43530
movl %eax, -0x3c(%rbp)
movq 0x357a06(%rip), %rax    # 0x3e1ff8
movq 0x10(%rax), %rax
movslq -0x3c(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
cmpl -0x78(%rbp), %eax
jne 0x8a63e
movq 0x3579e6(%rip), %rax    # 0x3e1ff8
movq 0x8(%rax), %rax
movslq -0x3c(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq 0x3579ce(%rip), %rax    # 0x3e1ff8
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movl $0x1, 0x1c(%rax)
jmp 0x8a649
movq -0x28(%rbp), %rax
movl $0x0, 0x1c(%rax)
movq 0x3579a8(%rip), %rax    # 0x3e1ff8
movq 0x18(%rax), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x78(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x8a6be
movq -0x28(%rbp), %rdi
callq 0x43580
movsd %xmm0, -0x48(%rbp)
movsd -0x80(%rbp), %xmm0
movq 0x357973(%rip), %rax    # 0x3e1ff8
movq (%rax), %rax
movslq -0x38(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x48(%rbp), %xmm0
subsd -0x80(%rbp), %xmm0
movsd -0x48(%rbp), %xmm2
subsd -0x80(%rbp), %xmm2
movq 0x35794c(%rip), %rax    # 0x3e1ff8
movsd 0x8(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rax)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x8a3be
movq 0x357921(%rip), %rdi    # 0x3e2000
callq 0x52e80
movq 0x357945(%rip), %rdi    # 0x3e2030
callq 0x52e80
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopl (%rax)