// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/classification.c
// Function: test_c45rules
Prediction test_c45rules(Instanceptr data, void* model, void* parameters, double* posterior)
{
 int covered = 0, bestclass;
 double besterror = 1.5, error; 
 Ruleset* r;
 Prediction predicted;
 Decisionruleptr tmp, bestrule = NULL;
 r = (Ruleset*) model;
 tmp = r->start;
 while (tmp)
  {
   if (rule_cover_instance(data, *tmp))
    {
     covered = 1;
     error = laplace_estimate_of_rule(*tmp);
     if (error < besterror)
      {
       bestrule = tmp;
       besterror = error;
       bestclass = tmp->classno;
      }
     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 (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;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, 0x40(%rsp)
movq %rdx, %r15
movq %rdi, 0x48(%rsp)
movq (%rdx), %r13
testq %r13, %r13
je 0xb477
movq %rsi, %r12
movsd 0x9aa56(%rip), %xmm0    # 0xa5de0
movsd %xmm0, 0x50(%rsp)
movb $0x1, %bl
xorl %r14d, %r14d
movq 0x30(%r13), %rax
movq %rax, 0x30(%rsp)
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movups 0x20(%r13), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r12, %rdi
callq 0x7b9ee
testl %eax, %eax
jne 0xb3d5
movq 0x30(%r13), %r13
testq %r13, %r13
jne 0xb395
jmp 0xb472
movq 0x30(%r13), %rax
movq %rax, 0x30(%rsp)
movupd (%r13), %xmm0
movups 0x10(%r13), %xmm1
movups 0x20(%r13), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movupd %xmm0, (%rsp)
callq 0x7cc0e
movsd 0x50(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0xb41b
movl (%r13), %ebp
movsd %xmm0, 0x50(%rsp)
movq %r13, %r14
movq %r13, %rdi
callq 0x7cc5f
testq %rax, %rax
je 0xb4a5
movq %rax, %r13
movq 0x30(%rax), %rax
movq %rax, 0x30(%rsp)
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movups 0x20(%r13), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r12, %rdi
callq 0x7b9ee
testl %eax, %eax
jne 0xb3d5
movq 0x30(%r13), %r13
xorl %ebx, %ebx
testq %r13, %r13
jne 0xb395
jmp 0xb4a5
testb $0x1, %bl
je 0xb4a5
leaq 0x9aa3d(%rip), %rdi     # 0xa5ebb
callq 0x54bec
movq 0x18(%r15), %rdi
leaq 0xca3e2(%rip), %rcx     # 0xd5870
movq (%rcx), %rcx
movl 0x10(%rcx), %edx
cmpl $0x1, %eax
jne 0xb4d3
movq 0x40(%rsp), %rsi
callq 0x38636
jmp 0xb4dd
leaq 0x9aa0f(%rip), %rdi     # 0xa5ebb
callq 0x54bec
movq 0x10(%r14), %rdi
leaq 0xca3b4(%rip), %rcx     # 0xd5870
movq (%rcx), %rcx
movl 0x10(%rcx), %edx
cmpl $0x1, %eax
jne 0xb4e8
movq 0x40(%rsp), %rsi
callq 0x38636
jmp 0xb4f2
movq 0x40(%rsp), %rsi
callq 0x38540
movq 0x48(%rsp), %rax
movl 0x14(%r15), %ebp
jmp 0xb4f7
movq 0x40(%rsp), %rsi
callq 0x38540
movq 0x48(%rsp), %rax
movl %ebp, 0x8(%rax)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq