// File: /workspace/github_c_makefile_star2_O1/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 0x11569
testl %eax, %eax
je 0x4b947
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
leaq 0x50(%rsp), %r13
movq %r13, %rdx
movl $0x3, %ecx
callq 0x30746
movq %r13, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x4af27
movq %rax, %r13
cmpq $0x0, 0x18(%rax)
je 0x4b84f
movq 0x48(%rsp), %rsi
movq %r13, %rdi
movl %ebp, %edx
movl $0x2, %ecx
callq 0x9c4fc
movq 0x50(%rsp), %rsi
movq %r13, %rdi
movl $0x1, %edx
callq 0x7b122
movq 0x48(%rsp), %rsi
movq %r13, %rdi
xorl %edx, %edx
callq 0x7b122
cmpq $0x0, 0x18(%r13)
je 0x4b8f3
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 0x7b300
ucomisd 0x5746c(%rip), %xmm0    # 0xa2d18
jae 0x4b8f3
movq %r15, %rdi
movq %r13, %rsi
callq 0x7b0fb
movq (%r12), %rdi
movq 0x50(%rsp), %rsi
callq 0x30ad5
movq %rax, (%r12)
movq 0x48(%rsp), %rsi
movq %r12, %rdi
callq 0x2fd59
movq %r12, %rdi
leaq 0x40(%rsp), %rsi
movq %r13, %rdx
callq 0x9c951
movq (%r12), %rdi
movl %ebp, %esi
jmp 0x4b7fd
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 0x7a989
movq %r13, %rdi
callq 0x39194
movq (%r12), %rdi
movq 0x50(%rsp), %rsi
callq 0x30ad5
movq %rax, (%r12)
movq 0x48(%rsp), %rsi
movq %r12, %rdi
callq 0x2fd59
cmpl $0x0, 0x10(%rbx)
jle 0x4b9bb
xorl %r13d, %r13d
movq 0x40(%rsp), %rsi
movq %r12, %rdi
callq 0x2fd59
movq $0x0, 0x40(%rsp)
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rdx
movq %r14, %rcx
movq %rbx, %r8
callq 0x4a943
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x4b1ea
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 0x9c7df
incl %r13d
cmpl 0x10(%rbx), %r13d
jl 0x4b950
movq 0x40(%rsp), %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq