// File: /workspace/github_c_makefile_star2_O3/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, %rbx
leaq 0x86405(%rip), %r15     # 0xa7da3
movl $0x30, %edi
movq %r15, %rsi
movl $0x4, %edx
callq 0x3a0e1
movq %rax, %r14
movq %rbx, %rdi
callq 0x30309
movl %eax, 0x20(%r14)
movslq %eax, %rdi
shlq $0x2, %rdi
movq %r15, %rsi
movl $0x6, %edx
callq 0x3a0e1
movq %rax, 0x10(%r14)
movslq 0x20(%r14), %rdi
movl $0x8, %esi
movq %r15, %rdx
movl $0x7, %ecx
callq 0x3a1fc
movq %rax, (%r14)
movslq 0x20(%r14), %rdi
movl $0x8, %esi
movq %r15, %rdx
movl $0x8, %ecx
callq 0x3a1fc
movq %rax, 0x18(%r14)
movslq 0x20(%r14), %rdi
movl $0x4, %esi
movq %r15, %rdx
movl $0x9, %ecx
callq 0x3a1fc
movq %rax, 0x8(%r14)
movq %rbx, 0x10(%rsp)
testq %rbx, %rbx
je 0x21b13
xorl %ebx, %ebx
leaq 0xc(%rsp), %r15
movq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x2f33a
movq 0x10(%r14), %rcx
movl %eax, (%rcx,%rbx,4)
movq 0x10(%rsp), %r13
movq 0x10(%r14), %rax
movl (%rax,%rbx,4), %ebp
movq %r13, %rdi
callq 0x2f33a
cmpl %eax, %ebp
je 0x21af5
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x21851
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 0x3a0b4
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 0x3a0b4
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
testq %r13, %r13
jne 0x21a52
incq %rbx
movq 0x10(%r12), %r12
testq %r12, %r12
jne 0x21a3e
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)