// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
leaq 0xd59c9(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x1bc(%rcx), %eax
jge 0x3007e
movl $0x0, -0x20(%rbp)
leaq 0xd59ac(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movl 0x30f08(%rax,%rcx), %eax
movl %eax, -0x3c(%rbp)
testl %eax, %eax
je 0x2fecd
jmp 0x2feb2
movl -0x3c(%rbp), %eax
subl $0x1, %eax
je 0x2ffac
jmp 0x2fec0
movl -0x3c(%rbp), %eax
subl $0x2, %eax
je 0x2ff36
jmp 0x2ffec
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movl (%rax,%rcx,8), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movslq -0x1c(%rbp), %rdx
cmpl (%rcx,%rdx,8), %eax
je 0x2ff31
movl $0x1, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movl (%rax,%rcx,8), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movslq -0x1c(%rbp), %rdx
cmpl (%rcx,%rdx,8), %eax
jge 0x2ff2b
movb $0x3c, -0x21(%rbp)
jmp 0x2ff2f
movb $0x3e, -0x21(%rbp)
jmp 0x2ff31
jmp 0x2ffec
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
ucomisd (%rax,%rcx,8), %xmm0
jne 0x2ff5c
jp 0x2ff5c
jmp 0x2ffaa
movl $0x1, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2ffa4
movb $0x3c, -0x21(%rbp)
jmp 0x2ffa8
movb $0x3e, -0x21(%rbp)
jmp 0x2ffaa
jmp 0x2ffec
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movl (%rax,%rcx,8), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movslq -0x1c(%rbp), %rdx
cmpl (%rcx,%rdx,8), %eax
je 0x2ffea
movl $0x1, -0x20(%rbp)
movb $0x3d, -0x21(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x30(%rbp)
jmp 0x2ffec
cmpl $0x0, -0x20(%rbp)
je 0x3006e
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rsi
shlq $0x4, %rsi
movq -0x18(%rbp), %rax
movl (%rax), %edx
addl $0x1, %edx
callq 0x52d10
movq %rax, -0x38(%rbp)
movl -0x1c(%rbp), %ecx
movq -0x38(%rbp), %rax
movq -0x18(%rbp), %rdx
movslq (%rdx), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movb -0x21(%rbp), %cl
movq -0x38(%rbp), %rax
movq -0x18(%rbp), %rdx
movslq (%rdx), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movb %cl, 0x4(%rax)
movsd -0x30(%rbp), %xmm0
movq -0x38(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq (%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x30070
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2fe6d
movq -0x38(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)