// File: /workspace/github_c_makefile_star2_O1/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, 0x50(%rsp)
movq (%rdx), %r13
xorl %ebx, %ebx
testq %r13, %r13
je 0xb41f
movq %rsi, %r12
movsd 0x97aa9(%rip), %xmm0    # 0xa2de0
movsd %xmm0, 0x48(%rsp)
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 0x7a0fc
testl %eax, %eax
je 0xb407
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 0x7b33f
movsd 0x48(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0xb3bc
movl (%r13), %ebp
movsd %xmm0, 0x48(%rsp)
movq %r13, %r14
movq %r13, %rdi
callq 0x7b390
testq %rax, %rax
je 0xb41b
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 0x7a0fc
testl %eax, %eax
jne 0xb376
movl $0x1, %ebx
movq 0x30(%r13), %r13
testq %r13, %r13
jne 0xb340
testl %ebx, %ebx
sete %bl
jmp 0xb424
xorl %ebx, %ebx
jmp 0xb424
movb $0x1, %bl
xorl %r14d, %r14d
leaq 0x97a90(%rip), %rdi     # 0xa2ebb
callq 0x536e7
leaq 0xc7439(%rip), %rcx     # 0xd2870
movq (%rcx), %rcx
movl 0x10(%rcx), %edx
testb %bl, %bl
je 0xb456
movq 0x18(%r15), %rdi
cmpl $0x1, %eax
jne 0xb46b
movq 0x40(%rsp), %rsi
callq 0x37a9c
jmp 0xb475
movq 0x10(%r14), %rdi
cmpl $0x1, %eax
jne 0xb47b
movq 0x40(%rsp), %rsi
callq 0x37a9c
jmp 0xb485
movq 0x40(%rsp), %rsi
callq 0x37a34
movl 0x14(%r15), %ebp
jmp 0xb485
movq 0x40(%rsp), %rsi
callq 0x37a34
movq 0x50(%rsp), %rax
movl %ebp, 0x8(%rax)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq