// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/ripper.c
// Function: simplify_ruleset
void simplify_ruleset(Ruleset* r, int positive, Instanceptr list1, Instanceptr list2, double proportion)
{
 /*!Last Changed 04.12.2003 Rewritten*/
 /*!Last Changed 31.05.2003 Delete rules starting from the last rule until the first rule*/
 /*!Last Changed 19.05.2003 If deleted is the first rule error occurs*/
 /*!Last Changed 18.05.2003*/
 int covered = 0, uncovered, fp = 0, fn, needrecount = 0;
 Decisionruleptr deleted, deletedbefore, tmprule;
 uncovered = data_size(list1) + data_size(list2);
 fn = find_class_count(list1, positive) + find_class_count(list2, positive);
 tmprule = r->start;
 while (tmprule && tmprule->classno != positive)
   tmprule = tmprule->next;
 while (tmprule)
  {
   uncovered -= (tmprule->covered + tmprule->falsepositives);
   covered += (tmprule->covered + tmprule->falsepositives);
   fn -= tmprule->covered;
   fp += tmprule->falsepositives;
   tmprule = tmprule->next;
  }
 deleted = r->end;
 while (deleted)
  {
   tmprule = r->start;
   if (tmprule != deleted)
    {
     while (tmprule->next != deleted)
       tmprule = tmprule->next;
     deletedbefore = tmprule;
    }
   else
     deletedbefore = NULL;
   if (deleted->classno == positive)
     if (can_delete_rule(deleted, &covered, &uncovered, &fp, &fn, proportion, r->possibleconditioncount))
      {
       remove_rule_after(r, deletedbefore, deleted);
       free_rule(*deleted);
       safe_free(deleted);
       needrecount = 1;
      }
   deleted = deletedbefore;
  }
 if (needrecount)
  {
   fp = 0;
   covered = 0;
   uncovered = data_size(list1) + data_size(list2);
   fn = find_class_count(list1, positive) + find_class_count(list2, positive);
   tmprule = r->start;
   while (tmprule && tmprule->classno != positive)
     tmprule = tmprule->next;
   if (tmprule)
    {
     initialize_counts(tmprule);
     update_counts_rules(tmprule, list1, &covered, &uncovered, &fp, &fn);
     update_counts_rules(tmprule, list2, &covered, &uncovered, &fp, &fn);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movsd %xmm0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x449f0
movl %eax, -0x60(%rbp)
movq -0x20(%rbp), %rdi
callq 0x449f0
movl %eax, %ecx
movl -0x60(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x18240
movl %eax, -0x5c(%rbp)
movq -0x20(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x18240
movl %eax, %ecx
movl -0x5c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x58(%rbp)
movb %al, -0x61(%rbp)
je 0xa9b4e
movq -0x58(%rbp), %rax
movl (%rax), %eax
cmpl -0xc(%rbp), %eax
setne %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0xa9b57
jmp 0xa9b65
movq -0x58(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0xa9b33
jmp 0xa9b67
cmpq $0x0, -0x58(%rbp)
je 0xa9bc2
movq -0x58(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x58(%rbp), %rax
addl 0x8(%rax), %ecx
movl -0x30(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x30(%rbp)
movq -0x58(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x58(%rbp), %rcx
addl 0x8(%rcx), %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x58(%rbp), %rax
movl 0x4(%rax), %ecx
movl -0x38(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x38(%rbp)
movq -0x58(%rbp), %rax
movl 0x8(%rax), %eax
addl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x58(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0xa9b67
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0xa9cae
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x48(%rbp), %rax
je 0xa9c16
jmp 0xa9bf0
movq -0x58(%rbp), %rax
movq 0x30(%rax), %rax
cmpq -0x48(%rbp), %rax
je 0xa9c0c
movq -0x58(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0xa9bf0
movq -0x58(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0xa9c1e
movq $0x0, -0x50(%rbp)
movq -0x48(%rbp), %rax
movl (%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0xa9ca1
movq -0x48(%rbp), %rdi
movsd -0x28(%rbp), %xmm0
movq -0x8(%rbp), %rax
movl 0x20(%rax), %r9d
leaq -0x2c(%rbp), %rsi
leaq -0x30(%rbp), %rdx
leaq -0x34(%rbp), %rcx
leaq -0x38(%rbp), %r8
callq 0xda090
cmpl $0x0, %eax
je 0xa9c9f
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0xae850
movq -0x48(%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 -0x48(%rbp), %rdi
callq 0x52e80
movl $0x1, -0x3c(%rbp)
jmp 0xa9ca1
movq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0xa9bce
cmpl $0x0, -0x3c(%rbp)
je 0xa9d93
movl $0x0, -0x34(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x449f0
movl %eax, -0x6c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x449f0
movl %eax, %ecx
movl -0x6c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x18240
movl %eax, -0x68(%rbp)
movq -0x20(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x18240
movl %eax, %ecx
movl -0x68(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x58(%rbp)
movb %al, -0x6d(%rbp)
je 0xa9d30
movq -0x58(%rbp), %rax
movl (%rax), %eax
cmpl -0xc(%rbp), %eax
setne %al
movb %al, -0x6d(%rbp)
movb -0x6d(%rbp), %al
testb $0x1, %al
jne 0xa9d39
jmp 0xa9d47
movq -0x58(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0xa9d15
cmpq $0x0, -0x58(%rbp)
je 0xa9d91
movq -0x58(%rbp), %rdi
callq 0xadc50
movq -0x58(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
leaq -0x30(%rbp), %rcx
leaq -0x34(%rbp), %r8
leaq -0x38(%rbp), %r9
callq 0xd9f80
movq -0x58(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
leaq -0x30(%rbp), %rcx
leaq -0x34(%rbp), %r8
leaq -0x38(%rbp), %r9
callq 0xd9f80
jmp 0xa9d93
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)