// File: /workspace/github_c_makefile_star2_O2/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
leaq 0x40(%rsp), %rax
andq $0x0, (%rax)
movq %rsi, %r15
movq %rdi, %r12
movq (%r12), %rdi
movl %ebp, %esi
callq 0x10855
testl %eax, %eax
je 0x45c03
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
leaq 0x50(%rsp), %r13
movq %r13, %rdx
pushq $0x3
popq %rcx
callq 0x2cfe5
movq %r13, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x45224
movq %rax, %r13
cmpq $0x0, 0x18(%rax)
je 0x45b13
movq 0x48(%rsp), %rsi
movq %r13, %rdi
movl %ebp, %edx
pushq $0x2
popq %rcx
callq 0x90239
movq 0x50(%rsp), %rsi
movq %r13, %rdi
pushq $0x1
popq %rdx
callq 0x722ae
movq 0x48(%rsp), %rsi
movq %r13, %rdi
xorl %edx, %edx
callq 0x722ae
cmpq $0x0, 0x18(%r13)
je 0x45baf
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 0x7247e
ucomisd 0x501b2(%rip), %xmm0    # 0x95d20
jae 0x45baf
movq %r15, %rdi
movq %r13, %rsi
callq 0x7228a
movq (%r12), %rdi
movq 0x50(%rsp), %rsi
callq 0x2d2da
movq %rax, (%r12)
movq 0x48(%rsp), %rsi
movq %r12, %rdi
callq 0x2c6e4
movq %r12, %rdi
leaq 0x40(%rsp), %rsi
movq %r13, %rdx
callq 0x90582
jmp 0x45abf
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 0x71be8
movq %r13, %rdi
callq 0x34ff7
movq (%r12), %rdi
movq 0x50(%rsp), %rsi
callq 0x2d2da
movq %rax, (%r12)
movq 0x48(%rsp), %rsi
movq %r12, %rdi
callq 0x2c6e4
xorl %r13d, %r13d
movq 0x40(%rsp), %rsi
cmpl 0x10(%rbx), %r13d
jge 0x45c70
movq %r12, %rdi
callq 0x2c6e4
andq $0x0, 0x40(%rsp)
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rdx
movq %r14, %rcx
movq %rbx, %r8
callq 0x44c65
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x454d2
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 0x90483
incl %r13d
jmp 0x45c06
movq %rsi, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq