// File: /workspace/github_c_makefile_star2_O1/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
subq $0x18, %rsp
movq %rsi, 0x8(%rsp)
movl $0x0, (%rdx)
leaq 0xb17d8(%rip), %r14     # 0xd2870
movq (%r14), %rcx
cmpl $0x0, 0x1bc(%rcx)
jle 0x211b4
movq %rdx, %rbx
movq %rdi, %r15
movl $0x61e1, %r13d          # imm = 0x61E1
xorl %ebp, %ebp
xorl %eax, %eax
movl (%rcx,%r13,8), %edx
movb $0x1, %cl
cmpl $0x2, %edx
je 0x21124
cmpl $0x1, %edx
je 0x210fd
testl %edx, %edx
jne 0x21158
movq (%r15), %rsi
movq 0x8(%rsp), %rdx
movq (%rdx), %rdx
movl (%rdx,%rbp,8), %edx
cmpl %edx, (%rsi,%rbp,8)
je 0x21158
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
movsd %xmm0, 0x10(%rsp)
setge %r12b
addb %r12b, %r12b
orb $0x3c, %r12b
jmp 0x21120
movq (%r15), %rdx
movl (%rdx,%rbp,8), %edx
movq 0x8(%rsp), %rsi
movq (%rsi), %rsi
cmpl (%rsi,%rbp,8), %edx
je 0x21158
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
movsd %xmm0, 0x10(%rsp)
movb $0x3d, %r12b
xorl %ecx, %ecx
jmp 0x21158
movq (%r15), %rdx
movsd (%rdx,%rbp,8), %xmm1
movq 0x8(%rsp), %rdx
movq (%rdx), %rdx
movsd (%rdx,%rbp,8), %xmm0
ucomisd %xmm0, %xmm1
jne 0x21141
jnp 0x21158
ucomisd %xmm1, %xmm0
setbe %r12b
addb %r12b, %r12b
orb $0x3c, %r12b
xorl %ecx, %ecx
movsd %xmm0, 0x10(%rsp)
testb %cl, %cl
jne 0x21198
movslq (%rbx), %rdx
incq %rdx
movq %rdx, %rsi
shlq $0x4, %rsi
movq %rax, %rdi
callq 0x390c8
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 0x10(%rsp), %xmm0
movsd %xmm0, 0x8(%rax,%rcx)
movl %edx, (%rbx)
incq %rbp
movq (%r14), %rcx
movslq 0x1bc(%rcx), %rdx
addq $0x68, %r13
cmpq %rdx, %rbp
jl 0x210b8
jmp 0x211b6
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq