// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/divs.c
// Function: discriminating_rule
Condition* discriminating_rule(Instanceptr training, Instanceptr counter, int* count)
{
 int i, add;
 char comparison;
 double value;
 Condition* rule = NULL;
 *count = 0;
 for (i = 0; i < current_dataset->featurecount; i++)
  {
   add = NO;
   switch (current_dataset->features[i].type)
    {
     case INTEGER:if (training->values[i].intvalue != counter->values[i].intvalue)
                   {
                    add = YES;
                    value = counter->values[i].intvalue;
                    if (training->values[i].intvalue < counter->values[i].intvalue)
                      comparison = '<';
                    else 
                      comparison = '>';
                   }
                  break;
     case    REAL:if (training->values[i].floatvalue != counter->values[i].floatvalue)
                   {
                    add = YES;
                    value = counter->values[i].floatvalue;
                    if (training->values[i].floatvalue < counter->values[i].floatvalue)
                      comparison = '<';
                    else 
                      comparison = '>';
                   }
                  break;
     case  STRING:if (training->values[i].stringindex != counter->values[i].stringindex)
                   {
                    add = YES;
                    comparison = '=';
                    value = training->values[i].stringindex;
                   }
                  break;
    }
   if (add)
    {
     rule = alloc(rule, ((*count) + 1) * sizeof(Condition), (*count) + 1);
     rule[*count].featureindex = i;
     rule[*count].comparison = comparison;
     rule[*count].value = value;
     (*count)++;
    }
  }
 return rule;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
andl $0x0, (%rdx)
movq %rsi, %r14
movq %rdi, %r15
leaq 0xae71a(%rip), %rax     # 0xcd870
movq (%rax), %rcx
xorl %edx, %edx
movl $0x61e1, %r13d          # imm = 0x61E1
xorl %ebp, %ebp
xorl %eax, %eax
movslq 0x1bc(%rcx), %rsi
cmpq %rsi, %rbp
jge 0x1f245
movl (%rcx,%r13,8), %esi
cmpl $0x2, %esi
je 0x1f1c8
cmpl $0x1, %esi
je 0x1f1ac
testl %esi, %esi
jne 0x1f239
movq (%r15), %rdi
movq (%r14), %rsi
movl (%rsi,%rbp,8), %esi
cmpl %esi, (%rdi,%rbp,8)
je 0x1f239
cvtsi2sd %esi, %xmm0
movsd %xmm0, (%rsp)
setge %r12b
jmp 0x1f1ed
movq (%r15), %rsi
movl (%rsi,%rbp,8), %esi
movq (%r14), %rdi
cmpl (%rdi,%rbp,8), %esi
je 0x1f239
cvtsi2sd %esi, %xmm0
movsd %xmm0, (%rsp)
movb $0x3d, %r12b
jmp 0x1f1f4
movq (%r15), %rsi
movsd (%rsi,%rbp,8), %xmm0
movq (%r14), %rsi
movsd (%rsi,%rbp,8), %xmm1
ucomisd %xmm1, %xmm0
jne 0x1f1e0
jnp 0x1f239
movsd %xmm1, (%rsp)
ucomisd %xmm0, %xmm1
setbe %r12b
addb %r12b, %r12b
orb $0x3c, %r12b
movslq %edx, %rsi
incl %edx
shlq $0x4, %rsi
addq $0x10, %rsi
movq %rax, %rdi
callq 0x34f30
movslq (%rbx), %rcx
shlq $0x4, %rcx
movl %ebp, (%rax,%rcx)
movslq (%rbx), %rcx
leal 0x1(%rcx), %edx
shlq $0x4, %rcx
movb %r12b, 0x4(%rax,%rcx)
movsd (%rsp), %xmm0
movsd %xmm0, 0x8(%rax,%rcx)
movl %edx, (%rbx)
leaq 0xae63a(%rip), %rcx     # 0xcd870
movq (%rcx), %rcx
incq %rbp
addq $0x68, %r13
jmp 0x1f165
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq