// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r13
leaq 0x78ab7(%rip), %r15     # 0x97d23
pushq $0x30
popq %rdi
pushq $0x4
popq %rdx
movq %r15, %rsi
callq 0x34f59
movq %rax, %r14
movq %r13, %rdi
callq 0x2c3cc
movl %eax, 0x20(%r14)
movslq %eax, %rdi
shlq $0x2, %rdi
pushq $0x6
popq %rdx
movq %r15, %rsi
callq 0x34f59
movq %rax, 0x10(%r14)
movslq 0x20(%r14), %rdi
pushq $0x8
popq %r12
pushq $0x7
popq %rcx
movq %r12, %rsi
movq %r15, %rdx
callq 0x35067
movq %rax, (%r14)
movslq 0x20(%r14), %rdi
pushq $0x8
popq %rcx
movq %r12, %rsi
movq %r15, %rdx
callq 0x35067
movq %rax, 0x18(%r14)
movslq 0x20(%r14), %rdi
pushq $0x4
popq %rsi
pushq $0x9
popq %rcx
movq %r15, %rdx
callq 0x35067
movq %rax, 0x8(%r14)
xorl %ebx, %ebx
leaq 0xc(%rsp), %r15
movq %r13, 0x10(%rsp)
movq %r13, %r12
testq %r12, %r12
je 0x1f3d2
movq %r12, %rdi
callq 0x2b47e
movq 0x10(%r14), %rcx
movl %eax, (%rcx,%rbx,4)
movq 0x10(%rsp), %r13
testq %r13, %r13
je 0x1f3c5
movq 0x10(%r14), %rax
movl (%rax,%rbx,4), %ebp
movq %r13, %rdi
callq 0x2b47e
cmpl %eax, %ebp
je 0x1f3bc
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x1f138
movq %rax, %rbp
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq (%rax,%rbx,8), %rdi
movslq (%rcx,%rbx,4), %rdx
leaq 0x8(,%rdx,8), %rsi
incq %rdx
callq 0x34f30
movq (%r14), %rcx
movq %rax, (%rcx,%rbx,8)
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq (%rax,%rbx,8), %rax
movslq (%rcx,%rbx,4), %rcx
movq %rbp, (%rax,%rcx,8)
movq 0x8(%r14), %rax
movq 0x18(%r14), %rcx
movq (%rcx,%rbx,8), %rdi
movslq (%rax,%rbx,4), %rdx
leaq 0x4(,%rdx,4), %rsi
incq %rdx
callq 0x34f30
movq 0x18(%r14), %rcx
movq %rax, (%rcx,%rbx,8)
movl 0xc(%rsp), %eax
movq 0x8(%r14), %rcx
movq 0x18(%r14), %rdx
movq (%rdx,%rbx,8), %rdx
movslq (%rcx,%rbx,4), %rsi
movl %eax, (%rdx,%rsi,4)
incl (%rcx,%rbx,4)
movq 0x10(%r13), %r13
jmp 0x1f310
incq %rbx
movq 0x10(%r12), %r12
jmp 0x1f2f3
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq