// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/savecode.c
// Function: code_condition
void code_condition(PROGRAMMING_LANGUAGE_TYPE language, Datasetptr d, Decisionconditionptr condition, char* st)
{
 /*!Last Changed 15.06.2006*/ 
 char stop[3], operand1[MAXLENGTH], operand2[MAXLENGTH], st2[MAXLENGTH], st3[MAXLENGTH];
 int i;
 switch (condition->comparison){
   case '<':strcpy(stop, "<=");
            break;
   case '>':strcpy(stop, ">");
            break;
   case '=':strcpy(stop, "==");
            break;
 }
 if (condition->featureindex >= 0)
  {
   code_array_index(operand1, language, "testdata", condition->featureindex);
   switch (d->features[condition->featureindex].type){
     case INTEGER:
     case STRING :sprintf(operand2, "%d", (int) condition->value);
                  break;
     case REAL   :sprintf(operand2, "%.6f", condition->value);
                  break;
   }
  }
 else
   if (condition->featureindex == LINEAR)
    {
     sprintf(operand2, "%.6f", condition->w0);
     sprintf(st2, "%d", 0);
     code_array_index_variable(st3, language, "testdataconverted", st2);
     sprintf(operand1, "%.6f * %s", condition->w.values[0][0], st3);
     for (i = 1; i < d->multifeaturecount - 1; i++)
      {
       sprintf(st2, "%d", i);
       code_array_index_variable(st3, language, "testdataconverted", st2);
       sprintf(operand1, "%s + %.6f * %s", operand1, condition->w.values[0][i], st3);
      }     
    }
 code_simple_logical_expression(language, stop, operand1, operand2, st);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e84a8, %rsp         # imm = 0x1E84A8
movq %rcx, 0x18(%rsp)
movq %rdx, %r14
movq %rsi, 0x8(%rsp)
movl %edi, %ebp
movzbl 0x4(%rdx), %eax
cmpl $0x3e, %eax
je 0x7fbf7
cmpl $0x3d, %eax
je 0x7fbe9
cmpl $0x3c, %eax
jne 0x7fbfe
movb $0x0, 0x6(%rsp)
movw $0x3d3c, 0x4(%rsp)      # imm = 0x3D3C
jmp 0x7fbfe
movb $0x0, 0x6(%rsp)
movw $0x3d3d, 0x4(%rsp)      # imm = 0x3D3D
jmp 0x7fbfe
movw $0x3e, 0x4(%rsp)
movl (%r14), %ecx
testl %ecx, %ecx
js 0x7fc56
leaq 0x30cf2(%rip), %rdx     # 0xb08fe
leaq 0x7a140(%rsp), %rdi
movl %ebp, %esi
callq 0x7db6a
movslq (%r14), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movq 0x8(%rsp), %rcx
cmpl $0x2, 0x30f08(%rcx,%rax)
jae 0x7fd9d
cvttsd2si 0x8(%r14), %edx
leaq 0x30fb0(%rip), %rsi     # 0xb0bf5
leaq 0x20(%rsp), %rdi
xorl %eax, %eax
callq 0x41b0
jmp 0x7fdb8
cmpl $-0x2, %ecx
jne 0x7fdb8
movsd 0x30(%r14), %xmm0
leaq 0x305de(%rip), %rsi     # 0xb024a
leaq 0x20(%rsp), %rdi
movb $0x1, %al
callq 0x41b0
leaq 0x30f76(%rip), %rsi     # 0xb0bf5
leaq 0x16e380(%rsp), %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x41b0
movl %ebp, %eax
movq %rax, 0x10(%rsp)
cmpl $0x5, %ebp
ja 0x7fcca
movq 0x10(%rsp), %rax
leaq 0x540d8(%rip), %rcx     # 0xd3d80
movq (%rcx,%rax,8), %rsi
leaq 0x30bd1(%rip), %rdx     # 0xb0884
leaq 0xf4260(%rsp), %rdi
leaq 0x16e380(%rsp), %rcx
xorl %eax, %eax
callq 0x41b0
movq 0x28(%r14), %rax
movq (%rax), %rax
movsd (%rax), %xmm0
leaq 0x30c06(%rip), %rsi     # 0xb08e2
leaq 0x7a140(%rsp), %rdi
leaq 0xf4260(%rsp), %rdx
movb $0x1, %al
callq 0x41b0
movq 0x8(%rsp), %rax
cmpl $0x3, 0x1c0(%rax)
jl 0x7fdb8
movl $0x1, %r12d
leaq 0x16e380(%rsp), %rbx
leaq 0xf4260(%rsp), %r13
leaq 0x7a140(%rsp), %r15
movq %rbx, %rdi
leaq 0x30ec8(%rip), %rsi     # 0xb0bf5
movl %r12d, %edx
xorl %eax, %eax
callq 0x41b0
cmpl $0x5, %ebp
ja 0x7fd60
movq 0x10(%rsp), %rax
leaq 0x54038(%rip), %rcx     # 0xd3d80
movq (%rcx,%rax,8), %rsi
movq %r13, %rdi
leaq 0x30b2e(%rip), %rdx     # 0xb0884
movq %rbx, %rcx
xorl %eax, %eax
callq 0x41b0
movq 0x28(%r14), %rax
movq (%rax), %rax
movsd (%rax,%r12,8), %xmm0
movq %r15, %rdi
leaq 0x30b66(%rip), %rsi     # 0xb08dd
movq %r15, %rdx
movq %r13, %rcx
movb $0x1, %al
callq 0x41b0
incq %r12
movq 0x8(%rsp), %rax
movslq 0x1c0(%rax), %rax
decq %rax
cmpq %rax, %r12
jl 0x7fd23
jmp 0x7fdb8
jne 0x7fdb8
movsd 0x8(%r14), %xmm0
leaq 0x3049e(%rip), %rsi     # 0xb024a
leaq 0x20(%rsp), %rdi
movb $0x1, %al
callq 0x41b0
leaq 0x4(%rsp), %rsi
leaq 0x7a140(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movl %ebp, %edi
movq 0x18(%rsp), %r8
callq 0x7df46
addq $0x1e84a8, %rsp         # imm = 0x1E84A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq