// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/classification.c
// Function: test_rexripper
Prediction test_rexripper(Instanceptr data, void* model, void* parameters, double* posterior)
{
 /*!Last Changed 03.12.2004 added deallocate(exceptiondata)*/
 /*!Last Changed 08.05.2004*/
 Model_rexripperptr m;
 Ripper_parameterptr p;
 int covered = 0, j, *classcounts;
 double besterror = 1.5, error;
 Instanceptr *neighbors;
 Decisionruleptr tmp;
 Prediction predicted;
 m = (Model_rexripperptr) model;
 p = (Ripper_parameterptr) parameters;
 tmp = m->r.start;
 predicted.classno = -1;
 while (tmp)
  {
   if (rule_cover_instance(data, *tmp))
    {
     covered = 1;
     error = laplace_estimate_of_rule(*tmp);
     if (error < besterror)
      {
       besterror = error;
       predicted.classno = tmp->classno;
      }
     tmp = get_next_class_rule(tmp);
     if (tmp)
       continue;
     else
       break;
    }
   tmp = tmp->next;
  }
 if (!covered)
  {
   data->isexception = 1;
   neighbors = find_nearest_neighbors_before_normalize(m->exceptiondata, data, p->nearcount, testmean, testvariance);
   classcounts = safecalloc(current_dataset->classno, sizeof(int), "test_rexripper", 40);
   for (j = 0; j < p->nearcount; j++)
     if (neighbors[j])
       classcounts[give_classno(neighbors[j])]++;
     else
       break;
   predicted.classno = find_max_in_list(classcounts, current_dataset->classno);
   safe_free(classcounts);
   safe_free(neighbors);
  }
 return predicted;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x70(%rbp)
movq %rdi, %rax
movq %rax, -0x68(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl $0x0, -0x34(%rbp)
movsd 0xd29a3(%rip), %xmm0    # 0xe2a78
movsd %xmm0, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movl $0xffffffff, 0x8(%rdi)  # imm = 0xFFFFFFFF
cmpq $0x0, -0x60(%rbp)
je 0x101c3
movq -0x8(%rbp), %rdi
movq -0x60(%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 0x101b2
movl $0x1, -0x34(%rbp)
movq -0x60(%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, -0x50(%rbp)
movsd -0x50(%rbp), %xmm1
movsd -0x48(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x10197
movq -0x70(%rbp), %rax
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x60(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, 0x8(%rax)
movq -0x60(%rbp), %rdi
callq 0xaeeb0
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0x101b0
jmp 0x100fc
jmp 0x101c3
movq -0x60(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x100fc
cmpl $0x0, -0x34(%rbp)
jne 0x102e9
movq -0x8(%rbp), %rax
movl $0x1, 0x20(%rax)
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x8(%rbp), %rsi
movq -0x30(%rbp), %rax
movl 0x40(%rax), %edx
leaq 0x3d1e3e(%rip), %rax    # 0x3e2030
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movq %rsp, %rax
movups %xmm2, 0x50(%rax)
movups %xmm1, 0x40(%rax)
movups %xmm0, 0x30(%rax)
leaq 0x3d1ded(%rip), %rcx    # 0x3e2000
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x46980
movq %rax, -0x58(%rbp)
leaq 0xf5607(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq 0x10(%rax), %rdi
movl $0x4, %esi
leaq 0xd2a03(%rip), %rdx     # 0xe2c4f
movl $0x28, %ecx
callq 0x52f40
movq %rax, -0x40(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x40(%rcx), %eax
jge 0x102b8
movq -0x58(%rbp), %rax
movslq -0x38(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x102a9
movq -0x40(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x58(%rbp), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x43530
movl %eax, %ecx
movq -0x78(%rbp), %rax
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x102ab
jmp 0x102b8
jmp 0x102ad
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x10261
movq -0x40(%rbp), %rdi
leaq 0xf557d(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %esi
callq 0x50070
movl %eax, %ecx
movq -0x70(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x40(%rbp), %rdi
callq 0x52e80
movq -0x58(%rbp), %rdi
callq 0x52e80
movq -0x68(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)