// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/divs.c
// Function: learn_ruleset_divs
Model_divsptr learn_ruleset_divs(Instanceptr instances)
{
 int i, count;
 Instanceptr training_example, counter_example;
 Model_divsptr m;
 Condition* current;
 m = safemalloc(sizeof(Model_divs), "learn_ruleset_divs", 4);
 m->datacount = data_size(instances);
 m->classno = safemalloc(m->datacount * sizeof(int), "learn_ruleset_divs", 6);
 m->hypotheses = safecalloc(m->datacount, sizeof(Condition**), "learn_ruleset_divs", 7);
 m->conditioncounts = safecalloc(m->datacount, sizeof(int *), "learn_ruleset_divs", 8);
 m->rulecounts = safecalloc(m->datacount, sizeof(int), "learn_ruleset_divs", 9);
 training_example = instances;
 i = 0;
 while (training_example)
  {
   counter_example = instances;
   m->classno[i] = give_classno(training_example);
   while (counter_example)
    {
     if (m->classno[i] != give_classno(counter_example))
      {
       current = discriminating_rule(training_example, counter_example, &count);
       m->hypotheses[i] = alloc(m->hypotheses[i], (m->rulecounts[i] + 1) * sizeof(Condition*), m->rulecounts[i] + 1);
       m->hypotheses[i][m->rulecounts[i]] = current;
       m->conditioncounts[i] = alloc(m->conditioncounts[i], (m->rulecounts[i] + 1) * sizeof(int), m->rulecounts[i] + 1);
       m->conditioncounts[i][m->rulecounts[i]] = count;
       (m->rulecounts[i])++;
      }
     counter_example = counter_example->next;
    }
   i++;
   training_example = training_example->next;
  }
 return m; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl $0x30, %edi
leaq 0xb4883(%rip), %rsi     # 0xe492b
movl $0x4, %edx
callq 0x52d70
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x449f0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x28(%rbp), %rax
movslq 0x20(%rax), %rdi
shlq $0x2, %rdi
leaq 0xb4850(%rip), %rsi     # 0xe492b
movl $0x6, %edx
callq 0x52d70
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movslq 0x20(%rax), %rdi
movl $0x8, %esi
leaq 0xb4827(%rip), %rdx     # 0xe492b
movl $0x7, %ecx
callq 0x52f40
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movslq 0x20(%rax), %rdi
movl $0x8, %esi
leaq 0xb47ff(%rip), %rdx     # 0xe492b
movl $0x8, %ecx
callq 0x52f40
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
movslq 0x20(%rax), %rdi
movl $0x4, %esi
leaq 0xb47d6(%rip), %rdx     # 0xe492b
movl $0x9, %ecx
callq 0x52f40
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0xc(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x3031f
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x43530
movl %eax, %edx
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
cmpq $0x0, -0x20(%rbp)
je 0x30305
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rdi
callq 0x43530
movl %eax, %ecx
movl -0x34(%rbp), %eax
cmpl %ecx, %eax
je 0x302f4
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x10(%rbp), %rdx
callq 0x2fe40
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl $0x1, %eax
movslq %eax, %rsi
shlq $0x3, %rsi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
callq 0x52d10
movq %rax, %rdx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x30(%rbp), %rdx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x28(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0xc(%rbp), %rsi
movslq (%rcx,%rsi,4), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl $0x1, %eax
movslq %eax, %rsi
shlq $0x2, %rsi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
callq 0x52d10
movq %rax, %rdx
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0xc(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x10(%rbp), %edx
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x28(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0xc(%rbp), %rsi
movslq (%rcx,%rsi,4), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x301a6
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x30179
movq -0x28(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)