// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/c45rules.c
// Function: search_best_ruleset
double search_best_ruleset(Ruleset* inlist, Ruleset* outlist, Instanceptr instances, int classno)
{
 /*!Last Changed 31.10.2003*/
 double length, bestlength;
 int found = 1;
 Decisionruleptr inbefore, bestdeleted, bestinserted, outbefore, before, tmp, inlistlast, tmpnext;
 bestlength = description_length_of_all(*inlist, classno, 1, instances);
 while (found)
  {
   found = 0;
   before = NULL;
   tmp = inlist->start;
   while (tmp)
    {
     tmpnext = tmp->next;
     remove_rule_after(inlist, before, tmp);
     length = description_length_of_all(*inlist, classno, 1, instances);
     if (dless(length, bestlength))
      {
       bestlength = length;
       found = 1;
       inbefore = before;
       bestdeleted = tmp;
      }
     add_rule_after(inlist, before, tmp);
     before = tmp;
     tmp = tmpnext;
    }
   before = NULL;
   inlistlast = inlist->end;
   tmp = outlist->start;
   while (tmp)
    {
     tmpnext = tmp->next;
     remove_rule_after(outlist, before, tmp);
     add_rule(inlist, tmp);
     length = description_length_of_all(*inlist, classno, 1, instances);
     if (dless(length, bestlength))
      {
       bestlength = length;
       found = 2;
       outbefore = before;
       bestinserted = tmp;
      }
     remove_rule_after(inlist, inlistlast, tmp);
     add_rule_after(outlist, before, tmp);
     before = tmp;
     tmp = tmpnext;
    }
   if (found)
    {
     if (found == 1)
       remove_rule_after(inlist, inbefore, bestdeleted); 
     else
      {
       remove_rule_after(outlist, outbefore, bestinserted);
       add_rule(inlist, bestinserted);
      }
    }
  }
 return bestlength;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0x1, -0x34(%rbp)
movq -0x8(%rbp), %rcx
movl -0x1c(%rbp), %edi
movq -0x18(%rbp), %rdx
movq 0x20(%rcx), %rsi
movq %rsp, %rax
movq %rsi, 0x20(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
xorl %eax, %eax
movl $0x1, %esi
callq 0x9860
movsd %xmm0, -0x30(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0xa21b
movl $0x0, -0x34(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0xa0e2
movq -0x68(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x68(%rbp), %rdx
callq 0xae850
movq -0x8(%rbp), %rcx
movl -0x1c(%rbp), %edi
movq -0x18(%rbp), %rdx
movq 0x20(%rcx), %rsi
movq %rsp, %rax
movq %rsi, 0x20(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
xorl %eax, %eax
movl $0x1, %esi
callq 0x9860
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
callq 0x52750
cmpl $0x0, %eax
je 0xa0bc
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movl $0x1, -0x34(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x68(%rbp), %rdx
callq 0xae7d0
movq -0x68(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x68(%rbp)
jmp 0xa02a
movq $0x0, -0x60(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0xa1d7
movq -0x68(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x68(%rbp), %rdx
callq 0xae850
movq -0x8(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0xaea30
movq -0x8(%rbp), %rcx
movl -0x1c(%rbp), %edi
movq -0x18(%rbp), %rdx
movq 0x20(%rcx), %rsi
movq %rsp, %rax
movq %rsi, 0x20(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
xorl %eax, %eax
movl $0x1, %esi
callq 0x9860
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
callq 0x52750
cmpl $0x0, %eax
je 0xa1a0
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movl $0x2, -0x34(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
callq 0xae850
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x68(%rbp), %rdx
callq 0xae7d0
movq -0x68(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x68(%rbp)
jmp 0xa101
cmpl $0x0, -0x34(%rbp)
je 0xa216
cmpl $0x1, -0x34(%rbp)
jne 0xa1f6
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0xae850
jmp 0xa214
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0xae850
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0xaea30
jmp 0xa216
jmp 0xa006
movsd -0x30(%rbp), %xmm0
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)