// File: /workspace/github_c_makefile_star2_O1/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 0x83b3e(%rip), %r15     # 0xa4d1b
movl $0x30, %edi
movq %r15, %rsi
movl $0x4, %edx
callq 0x390f5
movq %rax, %r14
movq %rbx, %rdi
callq 0x2fa14
movl %eax, 0x20(%r14)
movslq %eax, %rdi
shlq $0x2, %rdi
movq %r15, %rsi
movl $0x6, %edx
callq 0x390f5
movq %rax, 0x10(%r14)
movslq 0x20(%r14), %rdi
movl $0x8, %esi
movq %r15, %rdx
movl $0x7, %ecx
callq 0x39210
movq %rax, (%r14)
movslq 0x20(%r14), %rdi
movl $0x8, %esi
movq %r15, %rdx
movl $0x8, %ecx
callq 0x39210
movq %rax, 0x18(%r14)
movslq 0x20(%r14), %rdi
movl $0x4, %esi
movq %r15, %rdx
movl $0x9, %ecx
callq 0x39210
movq %rax, 0x8(%r14)
movq %rbx, 0x10(%rsp)
testq %rbx, %rbx
je 0x21352
xorl %ebx, %ebx
leaq 0xc(%rsp), %r15
movq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x2eaca
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 0x2eaca
cmpl %eax, %ebp
je 0x21334
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x21078
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 0x390c8
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 0x390c8
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 0x21291
incq %rbx
movq 0x10(%r12), %r12
testq %r12, %r12
jne 0x2127d
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq