// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/c45rules.c
// Function: check_all_subsets
Ruleset check_all_subsets(Decisionruleptr start, int rulecount, Instanceptr traindata, int conditioncount)
{
 /*!Last Changed 02.12.2004 added remove_rules_according_indexes_of_rule*/
 /*!Last Changed 30.10.2003*/
 Ruleset result;
 Decisionruleptr* rules;
 int **subsets, *counts, res, i, minindex = -1;
 double minlength = +1000000, length;
 empty_ruleset(&result);
 result.possibleconditioncount = conditioncount;
 rules = create_array_from_link_list_of_rules(start, rulecount);
 subsets = generate_subsets(rulecount, &res, &counts);
 for (i = 0; i < res; i++)
  {
   create_subset_of_ruleset(&result, rules, subsets[i], counts[i]);
   length = description_length_of_all(result, rules[0]->classno, 1, traindata);
   if (dless(length,minlength))
    {
     minlength = length;
     minindex = i;
    }
  }
 create_subset_of_ruleset(&result, rules, subsets[minindex], counts[minindex]);
 remove_rules_according_indexes_of_rule(rules, rulecount, subsets[minindex], counts[minindex]);
 for (i = 0; i < res; i++) 
   if (counts[i] > 0)
     safe_free(subsets[i]);
 safe_free(subsets);
 safe_free(counts);
 safe_free(rules);
 return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x60(%rbp)
movq %rdi, %rax
movq %rax, -0x68(%rbp)
movq %rsi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movq %rcx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl $0xffffffff, -0x44(%rbp) # imm = 0xFFFFFFFF
movsd 0xd8c2c(%rip), %xmm0    # 0xe29c0
movsd %xmm0, -0x50(%rbp)
callq 0xade30
movq -0x60(%rbp), %rdi
movl -0x1c(%rbp), %eax
movl %eax, 0x20(%rdi)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x9f20
movq %rax, -0x28(%rbp)
movl -0xc(%rbp), %edi
leaq -0x3c(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x52000
movq %rax, -0x30(%rbp)
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x9e72
movq -0x60(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x38(%rbp), %rax
movslq -0x40(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
callq 0x9ae0
movq -0x60(%rbp), %rcx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl (%rax), %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, -0x58(%rbp)
movsd -0x58(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
callq 0x52750
cmpl $0x0, %eax
je 0x9e62
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x9e64
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x9dd3
movq -0x60(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
callq 0x9ae0
movq -0x28(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x30(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
callq 0x9bc0
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x9ef4
movq -0x38(%rbp), %rax
movslq -0x40(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jle 0x9ee7
movq -0x30(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x52e80
jmp 0x9ee9
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x9ec0
movq -0x30(%rbp), %rdi
callq 0x52e80
movq -0x38(%rbp), %rdi
callq 0x52e80
movq -0x28(%rbp), %rdi
callq 0x52e80
movq -0x68(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)