// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/multivariaterule.c
// Function: learn_multivariate_rules_for_positive_class
Instanceptr learn_multivariate_rules_for_positive_class(Instanceptr* instances, Ruleset* ruleset, int posclass, Instanceptr cvdata, Ripper_parameterptr param)
{
 Instanceptr grow, prune, removed = NULL;
 Decisionruleptr newrule;
 int j;
 while (class_exists_in_list(*instances, posclass))
  {
   divide_instancelist(instances, &prune, &grow, 3);    
   newrule = growrule_multivariate(&grow, posclass, param);
   if (newrule->start)
     prunerule(newrule, prune, posclass, 2);
   update_counts(newrule, grow, 1);
   update_counts(newrule, prune, 0);
   if (!(newrule->start) || (error_rate_of_rule(*newrule) >= 0.5))
    {
     free_rule(*newrule);
     safe_free(newrule);
     *instances = restore_instancelist(*instances, grow);
     merge_instancelist(instances, prune);
     break;
    }
   add_rule(ruleset, newrule);
   *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;
   optimize_ruleset_multivariate(ruleset, posclass, instances, cvdata, param);
   simplify_ruleset_multivariate(ruleset, posclass, cvdata);
   remove_covered_by_ruleset(instances, &removed, *ruleset, 0);
  }
 return removed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %rbx
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r12
movq $0x0, 0x40(%rsp)
movq (%rdi), %rdi
movl %edx, %esi
callq 0x1152e
testl %eax, %eax
je 0x4cded
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
leaq 0x50(%rsp), %r13
movq %r13, %rdx
movl $0x3, %ecx
callq 0x31019
movq %r13, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x4c3b3
movq %rax, %r13
cmpq $0x0, 0x18(%rax)
je 0x4ccf5
movq 0x48(%rsp), %rsi
movq %r13, %rdi
movl %ebp, %edx
movl $0x2, %ecx
callq 0x9f536
movq 0x50(%rsp), %rsi
movq %r13, %rdi
movl $0x1, %edx
callq 0x7c9ed
movq 0x48(%rsp), %rsi
movq %r13, %rdi
xorl %edx, %edx
callq 0x7c9ed
cmpq $0x0, 0x18(%r13)
je 0x4cd99
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 0x7cbcf
ucomisd 0x58fc6(%rip), %xmm0    # 0xa5d18
jae 0x4cd99
movq %r15, %rdi
movq %r13, %rsi
callq 0x7c9c6
movq (%r12), %rdi
movq 0x50(%rsp), %rsi
callq 0x31345
movq %rax, (%r12)
movq 0x48(%rsp), %rsi
movq %r12, %rdi
callq 0x30648
movq %r12, %rdi
leaq 0x40(%rsp), %rsi
movq %r13, %rdx
callq 0x9f94e
movq (%r12), %rdi
movl %ebp, %esi
jmp 0x4cca3
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 0x7c251
movq %r13, %rdi
callq 0x3a180
movq (%r12), %rdi
movq 0x50(%rsp), %rsi
callq 0x31345
movq %rax, (%r12)
movq 0x48(%rsp), %rsi
movq %r12, %rdi
callq 0x30648
cmpl $0x0, 0x10(%rbx)
jle 0x4ce61
xorl %r13d, %r13d
movq 0x40(%rsp), %rsi
movq %r12, %rdi
callq 0x30648
movq $0x0, 0x40(%rsp)
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rdx
movq %r14, %rcx
movq %rbx, %r8
callq 0x4bdbc
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x4c690
movq 0x20(%r15), %rax
movq %rax, 0x20(%rsp)
movupd (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups %xmm1, 0x10(%rsp)
movupd %xmm0, (%rsp)
movq %r12, %rdi
leaq 0x40(%rsp), %rsi
xorl %edx, %edx
callq 0x9f84f
incl %r13d
cmpl 0x10(%rbx), %r13d
jl 0x4cdf6
movq 0x40(%rsp), %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq