// File: /workspace/github_c_makefile_star2_O3/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
movl $0x0, (%rdx)
leaq 0xb4004(%rip), %rax     # 0xd5870
movq (%rax), %rcx
xorl %edx, %edx
cmpl $0x0, 0x1bc(%rcx)
jle 0x21975
movq %rsi, %r14
movq %rdi, %r15
movl $0x61e1, %r13d          # imm = 0x61E1
xorl %ebp, %ebp
xorl %eax, %eax
movl (%rcx,%r13,8), %esi
cmpl $0x2, %esi
je 0x218eb
cmpl $0x1, %esi
je 0x218c8
testl %esi, %esi
jne 0x2195c
movq (%r15), %rdi
movq (%r14), %rsi
movl (%rsi,%rbp,8), %esi
cmpl %esi, (%rdi,%rbp,8)
je 0x2195c
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
movsd %xmm0, (%rsp)
setge %r12b
jmp 0x21910
movq (%r15), %rsi
movl (%rsi,%rbp,8), %esi
movq (%r14), %rdi
cmpl (%rdi,%rbp,8), %esi
je 0x2195c
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
movsd %xmm0, (%rsp)
movb $0x3d, %r12b
jmp 0x21917
movq (%r15), %rsi
movsd (%rsi,%rbp,8), %xmm0
movq (%r14), %rsi
movsd (%rsi,%rbp,8), %xmm1
ucomisd %xmm1, %xmm0
jne 0x21903
jnp 0x2195c
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 0x3a0b4
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 0xb3f17(%rip), %rcx     # 0xd5870
movq (%rcx), %rcx
incq %rbp
movslq 0x1bc(%rcx), %rsi
addq $0x68, %r13
cmpq %rsi, %rbp
jl 0x2188e
jmp 0x21977
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq