// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/multivariaterule.c
// Function: simplify_ruleset_multivariate
void simplify_ruleset_multivariate(Ruleset* r, int positive, Instanceptr cvdata)
{
 /*!Last Changed 14.01.2004*/
 Decisionruleptr firstrule, deleted, tmprule, deletedbefore;
 int minerror = error_of_ruleset(*r, cvdata), error;
 firstrule = r->start;
 while (firstrule && firstrule->classno != positive)
   firstrule = firstrule->next;
 if (!firstrule)
   return;
 deleted = r->end;
 while (deleted && deleted->next != firstrule)
  {
   tmprule = r->start;
   if (tmprule != deleted)
    {
     while (tmprule->next != deleted)
       tmprule = tmprule->next;
     deletedbefore = tmprule;
    }
   else
     deletedbefore = NULL;
   remove_rule_after(r, deletedbefore, deleted);
   error = error_of_ruleset(*r, cvdata);
   if (error > minerror)
     add_rule_after(r, deletedbefore, deleted);
   else
    {
     free_rule(*deleted);
     safe_free(deleted);
     minerror = error;
    }
   deleted = deletedbefore;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rdi
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)
callq 0xacee0
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x20(%rbp)
movb %al, -0x41(%rbp)
je 0x6d255
movq -0x20(%rbp), %rax
movl (%rax), %eax
cmpl -0xc(%rbp), %eax
setne %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0x6d25e
jmp 0x6d26c
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x6d23a
cmpq $0x0, -0x20(%rbp)
jne 0x6d278
jmp 0x6d38e
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x28(%rbp)
movb %al, -0x42(%rbp)
je 0x6d2a2
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
cmpq -0x20(%rbp), %rax
setne %al
movb %al, -0x42(%rbp)
movb -0x42(%rbp), %al
testb $0x1, %al
jne 0x6d2ae
jmp 0x6d38e
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x6d2eb
jmp 0x6d2c5
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rax
cmpq -0x28(%rbp), %rax
je 0x6d2e1
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x6d2c5
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x6d2f3
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0xae850
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rdi
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)
callq 0xacee0
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jle 0x6d348
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0xae7d0
jmp 0x6d381
movq -0x28(%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 -0x28(%rbp), %rdi
callq 0x52e80
movl -0x40(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x6d284
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)