// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/cn2.c
// Function: find_best_complex
Decisionruleptr find_best_complex(Instanceptr* instances, int positive, int maxstar, double positive_ratio)
{
 Ruleset star;
 Ruleset newstar;
 Decisionruleptr best_complex = NULL;
 Decisionruleptr rule;
 empty_ruleset(&star);
 rule = empty_rule(positive);
 rule->covered = find_class_count(*instances, positive);
 rule->falsepositives = data_size(*instances) - rule->covered;
 add_rule(&star, rule);
 while (star.rulecount > 0)
  {
   /*Specialize complexes*/
   empty_ruleset(&newstar);
   rule = star.start;
   while (rule)
    {
     if (rule->falsepositives != 0)
       specialize_complex(rule, &newstar, instances, positive, maxstar);
     rule = rule->next;
    }
   /*Check for best complex*/
   rule = newstar.start;
   while (rule)
    {
     if (rule_significantly_better(rule, positive_ratio) && (best_complex == NULL || laplace_estimate_of_rule(*rule) < laplace_estimate_of_rule(*best_complex)))
      {
       if (best_complex != NULL)
        {
         free_rule(*best_complex);
         safe_free(best_complex);
        }
       best_complex = create_copy_of_rule(rule);
      }
     rule = rule->next;
    }
   free_ruleset(star);
   star = newstar;
  }
 safe_free(star.counts);
 return best_complex;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movq $0x0, -0x70(%rbp)
leaq -0x40(%rbp), %rdi
callq 0xade30
movl -0xc(%rbp), %edi
callq 0xad8b0
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl -0xc(%rbp), %esi
callq 0x18240
movl %eax, %ecx
movq -0x78(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x449f0
movl %eax, %ecx
movq -0x78(%rbp), %rax
subl 0x4(%rax), %ecx
movq -0x78(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x78(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0xaea30
cmpl $0x0, -0x30(%rbp)
jle 0x12abd
leaq -0x68(%rbp), %rdi
callq 0xade30
movq -0x40(%rbp), %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0x1299a
movq -0x78(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x1298c
movq -0x78(%rbp), %rdi
movq -0x8(%rbp), %rdx
movl -0xc(%rbp), %ecx
movl -0x10(%rbp), %r8d
leaq -0x68(%rbp), %rsi
callq 0x12190
movq -0x78(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x78(%rbp)
jmp 0x12963
movq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0x12a87
movq -0x78(%rbp), %rdi
movsd -0x18(%rbp), %xmm0
callq 0x12700
cmpl $0x0, %eax
je 0x12a76
cmpq $0x0, -0x70(%rbp)
je 0x12a2f
movq -0x78(%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, -0x80(%rbp)
movq -0x70(%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 -0x80(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x12a76
cmpq $0x0, -0x70(%rbp)
je 0x12a69
movq -0x70(%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 0xadd10
movq -0x70(%rbp), %rdi
callq 0x52e80
movq -0x78(%rbp), %rdi
callq 0xad610
movq %rax, -0x70(%rbp)
movq -0x78(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x78(%rbp)
jmp 0x129a2
movq -0x20(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x20(%rax)
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0xaddb0
leaq -0x40(%rbp), %rdi
leaq -0x68(%rbp), %rsi
movl $0x28, %edx
callq 0x42b0
jmp 0x12948
movq -0x28(%rbp), %rdi
callq 0x52e80
movq -0x70(%rbp), %rax
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)