// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/process.c
// Function: test_meta_algorithm
void test_meta_algorithm(int meta_algorithm, int algorithm, void** model, void* parameters, int testsize)
{
 Instanceptr test, next;
 int 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 = meta_classification_algorithms[meta_algorithm - ONE_VERSUS_ONE].test_algorithm(test, model, algorithm, parameters, ((Classificationresultptr) result)->posteriors[testindex]);
     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 = meta_regression_algorithms[meta_algorithm - BAGGING_REGRESSION].test_algorithm(test, model, algorithm, parameters, NULL);
   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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %r8d, %r15d
movq %rcx, 0x8(%rsp)
movq %rdx, %r14
movl %esi, %ebp
movl %edi, %r12d
movl %esi, %edi
callq 0x445c
movl %r15d, %edi
testl %eax, %eax
je 0x60d7e
callq 0x7232d
jmp 0x60d83
callq 0x8ad8
movq %rax, 0x35129e(%rip)    # 0x3b2028
movq 0x2d70a7(%rip), %rsi    # 0x337e38
leaq 0x30(%rsp), %r15
movq %r15, %rdi
callq 0x1247b
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x35129d(%rip)   # 0x3b2050
movups %xmm1, 0x351286(%rip)   # 0x3b2040
movups %xmm0, 0x35126f(%rip)   # 0x3b2030
movq 0x2d7070(%rip), %rsi    # 0x337e38
leaq 0x30(%rsp), %r15
movq %r15, %rdi
callq 0x127bd
movupd (%r15), %xmm0
movupd 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x351294(%rip)   # 0x3b2080
movupd %xmm1, 0x35127c(%rip)   # 0x3b2070
movupd %xmm0, 0x351264(%rip)   # 0x3b2060
movq 0x2d7035(%rip), %r15    # 0x337e38
testq %r15, %r15
je 0x60faf
leal -0xc8(%r12), %eax
cltq
leaq (%rax,%rax,2), %rax
leaq 0x741df(%rip), %rcx     # 0xd5000
leaq (%rcx,%rax,8), %rax
addq $0x8, %rax
movq %rax, 0x28(%rsp)
addl $-0x64, %r12d
movslq %r12d, %rax
leaq (%rax,%rax,2), %rax
leaq 0x74170(%rip), %rcx     # 0xd4fb0
leaq (%rcx,%rax,8), %rax
addq $0x8, %rax
movq %rax, 0x20(%rsp)
xorl %r12d, %r12d
movq 0x10(%r15), %r13
movq $0x0, 0x10(%r15)
movl %ebp, %edi
callq 0x445c
testl %eax, %eax
je 0x60e98
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebp, %ecx
movq 0x8(%rsp), %r8
xorl %r9d, %r9d
movq 0x28(%rsp), %rax
callq *(%rax)
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0x38(%rsp), %ebx
jmp 0x60f22
movq 0x351189(%rip), %rax    # 0x3b2028
movq 0x28(%rax), %rax
movq (%rax,%r12), %r9
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebp, %ecx
movq 0x8(%rsp), %r8
movq 0x20(%rsp), %rax
callq *(%rax)
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0x38(%rsp), %ebx
leaq 0x49dcd(%rip), %rdi     # 0xaaca4
callq 0x54bec
cmpl $0x1, %eax
jne 0x60f22
movq 0x74988(%rip), %rax     # 0xd5870
cmpl $0x2, 0x10(%rax)
jne 0x60f22
movq 0x351133(%rip), %rax    # 0x3b2028
movq 0x28(%rax), %rax
movq (%rax,%r12), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0x49d9c(%rip), %rdi     # 0xaacaa
callq 0x549ba
xorl %ebx, %ebx
movsd 0x18(%rsp), %xmm1
ucomisd %xmm0, %xmm1
setbe %bl
movq %r13, 0x10(%r15)
movl %ebp, %edi
callq 0x445c
movq %r15, %rdi
testl %eax, %eax
je 0x60f63
callq 0x2f35e
movq 0x3510e8(%rip), %rax    # 0x3b2028
movq (%rax), %rcx
movsd 0x10(%rsp), %xmm1
movsd %xmm1, (%rcx,%r12)
subsd %xmm1, %xmm0
mulsd %xmm0, %xmm0
addsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rax)
jmp 0x60f9e
callq 0x2f33a
movq 0x3510b9(%rip), %rcx    # 0x3b2028
movq 0x10(%rcx), %rdx
cltq
incl (%rdx,%rax,4)
xorl %edx, %edx
cmpl %ebx, %eax
jne 0x60f8c
movq 0x8(%rcx), %rdx
incl (%rdx,%rax,4)
incl (%rcx)
movl $0x1, %edx
movl %edx, 0x1c(%r15)
movq 0x18(%rcx), %rcx
movq (%rcx,%rax,8), %rax
movslq %ebx, %rcx
incl (%rax,%rcx,4)
movq 0x10(%r15), %r15
addq $0x8, %r12
testq %r15, %r15
jne 0x60e50
movq 0x35107a(%rip), %rdi    # 0x3b2030
callq 0x3a180
movq 0x35109e(%rip), %rdi    # 0x3b2060
callq 0x3a180
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq