// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/classification.c
// Function: test_irep
Prediction test_irep(Instanceptr data, void* model, void* parameters, double* posterior)
{
 /*!Last Changed 10.11.2003 Rulecount, decisioncount and mdl added*/
 /*!Last Changed 21.05.2003 free_ruleset function is added*/
 /*!Last Changed 13.05.2003*/
 int bestclass, rulesordered;
 BOOLEAN covered = BOOLEAN_FALSE;
 double besterror = 1.5, error; 
 Ruleset* r;
 Decisionruleptr tmp, bestrule = NULL;
 Prediction predicted;
 r = (Ruleset*) model;
 tmp = r->start;
 rulesordered = ((Ripper_parameterptr) parameters)->rulesordered;
 while (tmp)
  {
   if (rule_cover_instance(data, *tmp))
    {
     covered = BOOLEAN_TRUE;
     if (rulesordered)
      {
       if (get_parameter_o("laplaceestimate") == ON)
         normalize_array_laplace(tmp->counts, posterior, current_dataset->classno);
       else
         normalize_array(tmp->counts, posterior, current_dataset->classno);
       predicted.classno = tmp->classno;
       return predicted;
      }
     else
      {
       error = laplace_estimate_of_rule(*tmp);
       if (error < besterror)
        {
         besterror = error;
         bestclass = tmp->classno;
         bestrule = tmp;
        }
       tmp = get_next_class_rule(tmp);
       if (tmp)
         continue;
       else
         break;
      }
    }
   tmp = tmp->next;
  }
 if (!covered)
  {
   if (get_parameter_o("laplaceestimate") == ON)
     normalize_array_laplace(r->counts, posterior, current_dataset->classno);
			else
     normalize_array(r->counts, posterior, current_dataset->classno);
   predicted.classno = r->defaultclass;
   return predicted;
  }
 else
   if (!rulesordered)
    {
  			if (get_parameter_o("laplaceestimate") == ON)
       normalize_array_laplace(bestrule->counts, posterior, current_dataset->classno);
			  else
       normalize_array(bestrule->counts, posterior, current_dataset->classno);
     predicted.classno = bestclass;
     return predicted;
    }
   else
    {
  			if (get_parameter_o("laplaceestimate") == ON)
       normalize_array_laplace(r->counts, posterior, current_dataset->classno);
			  else
       normalize_array(r->counts, posterior, current_dataset->classno);
     predicted.classno = r->defaultclass;
     return predicted;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x68(%rbp)
movq %rdi, -0x60(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl $0x0, -0x2c(%rbp)
movsd 0xd3de6(%rip), %xmm0    # 0xe2a78
movsd %xmm0, -0x38(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x28(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0xedf2
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rcx
movq 0x30(%rcx), %rdx
movq %rsp, %rax
movq %rdx, 0x30(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0xacfd0
cmpl $0x0, %eax
je 0xede1
movl $0x1, -0x2c(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0xed6c
leaq 0xd3e41(%rip), %rdi     # 0xe2b53
callq 0x79440
cmpl $0x1, %eax
jne 0xed3c
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rsi
leaq 0xf6b11(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %edx
callq 0x50ad0
jmp 0xed5a
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rsi
leaq 0xf6af1(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %edx
callq 0x50a20
movq -0x68(%rbp), %rax
movq -0x50(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, 0x8(%rax)
jmp 0xef18
movq -0x50(%rbp), %rcx
movq 0x30(%rcx), %rdx
movq %rsp, %rax
movq %rdx, 0x30(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0xaee50
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm1
movsd -0x38(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xedc6
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x50(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
callq 0xaeeb0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0xeddf
jmp 0xecbc
jmp 0xedf2
movq -0x50(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0xecbc
cmpl $0x0, -0x2c(%rbp)
jne 0xee5a
leaq 0xd3d54(%rip), %rdi     # 0xe2b53
callq 0x79440
cmpl $0x1, %eax
jne 0xee29
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
leaq 0xf6a24(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %edx
callq 0x50ad0
jmp 0xee47
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
leaq 0xf6a04(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %edx
callq 0x50a20
movq -0x68(%rbp), %rax
movq -0x48(%rbp), %rcx
movl 0x14(%rcx), %ecx
movl %ecx, 0x8(%rax)
jmp 0xef18
cmpl $0x0, -0x28(%rbp)
jne 0xeebb
leaq 0xd3cec(%rip), %rdi     # 0xe2b53
callq 0x79440
cmpl $0x1, %eax
jne 0xee91
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rsi
leaq 0xf69bc(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %edx
callq 0x50ad0
jmp 0xeeaf
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rsi
leaq 0xf699c(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %edx
callq 0x50a20
movq -0x68(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0xef18
leaq 0xd3c91(%rip), %rdi     # 0xe2b53
callq 0x79440
cmpl $0x1, %eax
jne 0xeeec
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
leaq 0xf6961(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %edx
callq 0x50ad0
jmp 0xef0a
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
leaq 0xf6941(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %edx
callq 0x50a20
movq -0x68(%rbp), %rax
movq -0x48(%rbp), %rcx
movl 0x14(%rcx), %ecx
movl %ecx, 0x8(%rax)
movq -0x60(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)