// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/omnivariaterule.c
// Function: hybrid_rule_learner
Ruleset hybrid_rule_learner(Instanceptr* instances, Instanceptr cvdata, Ripper_parameterptr param)
{
 /*!Last Changed 19.02.2005*/
 Ruleset result;
 int classno, *counts, *classes, posclass, classcount, i, j, maxcount;
 Instanceptr grow, prune, removed = NULL, totalremoved = NULL;
 Decisionruleptr newrule;
 empty_ruleset(&result);
 classno = all_in_one_class(*instances, &maxcount);
 if (!(classno % 10))
   return result;
 counts = find_class_counts(*instances);
 classes = find_max_occured(counts, current_dataset->classno, &classcount);
 safe_free(counts);
 result.defaultclass = classes[0];
 for (i = classcount - 1; i > 0; i--)
  {
   posclass = classes[i];
   while (class_exists_in_list(*instances, posclass))
    {
     if (param->modelselectionmethod == 0)
      {
       divide_instancelist(instances, &prune, &grow, 3);
       newrule = growrule_omnivariate(&grow, posclass, param);
      }
     else
       newrule = growrule_omnivariate(instances, posclass, param);
     if (newrule->start)
      {
       if (param->modelselectionmethod == 0)       
         prunerule(newrule, prune, posclass, 2);
       else
         prunerule_with_modelselection(newrule, *instances, param->modelselectionmethod);
      }
     if (param->modelselectionmethod == 0)
      {
       update_counts(newrule, grow, 1);
       update_counts(newrule, prune, 0);
      }
     else
       update_counts(newrule, *instances, 1);
     if (!(newrule->start) || (error_rate_of_rule(*newrule) >= 0.5))
      {
       free_rule(*newrule);
       safe_free(newrule);
       if (param->modelselectionmethod == 0)
        {
         *instances = restore_instancelist(*instances, grow);
         merge_instancelist(instances, prune);
        }
       break;
      }
     add_rule(&result, newrule);
     if (param->modelselectionmethod == 0)
      {
       *instances = restore_instancelist(*instances, grow);
       merge_instancelist(instances, prune);     
      }
     remove_covered(instances, &removed, newrule);
    }
   for (j = 0; j < param->optimizecount; j++)
    {
     merge_instancelist(instances, removed);
     removed = NULL;
     if (param->modelselectionmethod == 0)
      {
       optimize_ruleset_multivariate(&result, posclass, instances, cvdata, param);
       simplify_ruleset_multivariate(&result, posclass, cvdata);
      }
     else
      {
       optimize_ruleset_modelselection(&result, posclass, instances, param);
       simplify_ruleset_modelselection(&result, posclass, *instances, param->modelselectionmethod);
      }
     remove_covered_by_ruleset(instances, &removed, result, 0);
    }
   merge_instancelist(&totalremoved, removed);
   removed = NULL;
  }
 safe_free(classes);
 merge_instancelist(instances, totalremoved);
 return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x80(%rbp)
movq %rdi, %rax
movq %rax, -0x78(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
callq 0xade30
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq -0x44(%rbp), %rsi
callq 0x18420
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x75def
jmp 0x7613d
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x183a0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x8fa36(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %esi
leaq -0x38(%rbp), %rdx
callq 0x50160
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x52e80
movq -0x80(%rbp), %rax
movq -0x30(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, 0x14(%rax)
movl -0x38(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jle 0x76127
movq -0x30(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl -0x34(%rbp), %esi
callq 0x182a0
cmpl $0x0, %eax
je 0x7603a
movq -0x18(%rbp), %rax
cmpl $0x0, 0x38(%rax)
jne 0x75ea2
movq -0x8(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x50(%rbp), %rdx
movl $0x3, %ecx
callq 0x45f60
movl -0x34(%rbp), %esi
movq -0x18(%rbp), %rdx
leaq -0x50(%rbp), %rdi
callq 0x74970
movq %rax, -0x70(%rbp)
jmp 0x75eb6
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x74970
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x75efb
movq -0x18(%rbp), %rax
cmpl $0x0, 0x38(%rax)
jne 0x75ee2
movq -0x70(%rbp), %rdi
movq -0x58(%rbp), %rsi
movl -0x34(%rbp), %edx
movl $0x2, %ecx
callq 0xdb170
jmp 0x75ef9
movq -0x70(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x18(%rbp), %rax
movl 0x38(%rax), %edx
callq 0x74b70
jmp 0x75efb
movq -0x18(%rbp), %rax
cmpl $0x0, 0x38(%rax)
jne 0x75f28
movq -0x70(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl $0x1, %edx
callq 0xaea90
movq -0x70(%rbp), %rdi
movq -0x58(%rbp), %rsi
xorl %edx, %edx
callq 0xaea90
jmp 0x75f3d
movq -0x70(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movl $0x1, %edx
callq 0xaea90
movq -0x70(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x75f80
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 0xaedc0
movsd 0x6ca3e(%rip), %xmm1    # 0xe29b8
ucomisd %xmm1, %xmm0
jb 0x75fe6
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 -0x18(%rbp), %rax
cmpl $0x0, 0x38(%rax)
jne 0x75fe4
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x50(%rbp), %rsi
callq 0x464e0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x44f40
jmp 0x7603a
movq -0x80(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0xaea30
movq -0x18(%rbp), %rax
cmpl $0x0, 0x38(%rax)
jne 0x76024
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x50(%rbp), %rsi
callq 0x464e0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x44f40
movq -0x8(%rbp), %rdi
movq -0x70(%rbp), %rdx
leaq -0x60(%rbp), %rsi
callq 0xdb5b0
jmp 0x75e54
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x76104
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x44f40
movq $0x0, -0x60(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x38(%rax)
jne 0x7609a
movq -0x80(%rbp), %rdi
movl -0x34(%rbp), %esi
movq -0x8(%rbp), %rdx
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %r8
callq 0x6c7b0
movq -0x80(%rbp), %rdi
movl -0x34(%rbp), %esi
movq -0x10(%rbp), %rdx
callq 0x6d1f0
jmp 0x760c8
movq -0x80(%rbp), %rdi
movl -0x34(%rbp), %esi
movq -0x8(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x74360
movq -0x80(%rbp), %rdi
movl -0x34(%rbp), %esi
movq -0x8(%rbp), %rax
movq (%rax), %rdx
movq -0x18(%rbp), %rax
movl 0x38(%rax), %ecx
callq 0x74f60
movq -0x80(%rbp), %rcx
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movq 0x20(%rcx), %rdx
movq %rsp, %rax
movq %rdx, 0x20(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
leaq -0x60(%rbp), %rsi
xorl %edx, %edx
callq 0xdb410
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x76041
movq -0x60(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x44f40
movq $0x0, -0x60(%rbp)
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x75e3c
movq -0x30(%rbp), %rdi
callq 0x52e80
movq -0x8(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x44f40
movq -0x78(%rbp), %rax
addq $0xc0, %rsp
popq %rbp
retq
nopw (%rax,%rax)