// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/savecode.c
// Function: code_decisionnode
void code_decisionnode(FILE* testcodefile, PROGRAMMING_LANGUAGE_TYPE language, char* algorithm, char* arrayname, Datasetptr d, Decisionnodeptr m, int level)
{
 /*!Last Changed 24.06.2006 added linear model*/
 /*!Last Changed 14.06.2006*/
 int i, *cases;
 char st[MAXLENGTH], st2[MAXLENGTH], st3[MAXLENGTH], operand1[MAXLENGTH], operand2[MAXLENGTH];
 if (m->featureno != LEAF_NODE)
  {
		 if (m->featureno >= 0)
			 {
     if (d->features[m->featureno].type == STRING)
					 {
       cases = safemalloc(sizeof(int), "code_decisionnode", 3);
       code_array_index(st, language, arrayname, m->featureno);
       code_switch(testcodefile, language, st);
       for (i = 0; i < d->features[m->featureno].valuecount; i++)
							 {
         cases[0] = i;
         code_case(testcodefile, language, cases, 1);
         code_decisionnode(testcodefile, language, algorithm, arrayname, d, &(m->string[i]), level + 1);
         code_endcase(testcodefile, language);
							 }
       code_endswitch(testcodefile, language);
       safe_free(cases);
					 }
     else
					 {
       code_array_index(st, language, arrayname, m->featureno);
       sprintf(st2, "%.6f", m->split);
       code_if(testcodefile, language, "<=", st, st2); 
       code_decisionnode(testcodefile, language, algorithm, arrayname, d, m->left, level + 1);
       code_else(testcodefile, language);
       code_decisionnode(testcodefile, language, algorithm, arrayname, d, m->right, level + 1);
       code_endif(testcodefile, language);
					 }
			 }
			else
     if (m->featureno == LINEAR)
					 {
       sprintf(operand2, "%.6f", m->w0);
       sprintf(st2, "%d", 0);
       code_array_index_variable(st3, language, "testdataconverted", st2);
       sprintf(operand1, "%.6f * %s", m->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, m->w.values[0][i], st3);
							 }     
       code_if(testcodefile, language, "<=", operand1, operand2); 
       code_decisionnode(testcodefile, language, algorithm, arrayname, d, m->left, level + 1);
       code_else(testcodefile, language);
       code_decisionnode(testcodefile, language, algorithm, arrayname, d, m->right, level + 1);
       code_endif(testcodefile, language);
					 }
	 }
 else
   code_function_return_classification(testcodefile, algorithm, language, m->classno);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2625f0, %rsp         # imm = 0x2625F0
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpl $-0x1, 0x30(%rax)
je 0xb2af7
movq -0x30(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jl 0xb2949
movq -0x28(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movq -0x30(%rbp), %rcx
movslq 0x30(%rcx), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
cmpl $0x1, (%rax)
jne 0xb2882
movl $0x4, %edi
leaq 0x3a7ca(%rip), %rsi     # 0xecf5c
movl $0x3, %edx
callq 0x52d70
movq %rax, -0x40(%rbp)
leaq -0x7a160(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x20(%rbp), %rdx
movq -0x30(%rbp), %rax
movl 0x30(%rax), %ecx
callq 0xb0420
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x7a160(%rbp), %rdx
callq 0xb0930
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x28(%rbp), %rcx
addq $0x30f08, %rcx          # imm = 0x30F08
movq -0x30(%rbp), %rdx
movslq 0x30(%rdx), %rdx
imulq $0x340, %rdx, %rdx      # imm = 0x340
addq %rdx, %rcx
cmpl 0x18(%rcx), %eax
jge 0xb2868
movl -0x34(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x40(%rbp), %rdx
movl $0x1, %ecx
callq 0xb06d0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %rax
movq 0x10(%rax), %r9
movslq -0x34(%rbp), %rax
imulq $0x160, %rax, %rax      # imm = 0x160
addq %rax, %r9
movl 0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
callq 0xb2720
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb08e0
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xb27d4
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb09e0
movq -0x40(%rbp), %rdi
callq 0x52e80
jmp 0xb2944
leaq -0x7a160(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x20(%rbp), %rdx
movq -0x30(%rbp), %rax
movl 0x30(%rax), %ecx
callq 0xb0420
leaq -0xf4280(%rbp), %rdi
movq -0x30(%rbp), %rax
movsd 0x28(%rax), %xmm0
leaq 0x3a007(%rip), %rsi     # 0xec8ba
movb $0x1, %al
callq 0x4170
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x7a160(%rbp), %rcx
leaq -0xf4280(%rbp), %r8
leaq 0x331ec(%rip), %rdx     # 0xe5ac2
callq 0xb0d00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %rax
movq (%rax), %r9
movl 0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
callq 0xb2720
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb0e70
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %rax
movq 0x8(%rax), %r9
movl 0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
callq 0xb2720
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb0ec0
jmp 0xb2af5
movq -0x30(%rbp), %rax
cmpl $-0x2, 0x30(%rax)
jne 0xb2af3
leaq -0x2625e0(%rbp), %rdi
movq -0x30(%rbp), %rax
movsd 0x48(%rax), %xmm0
leaq 0x39f4c(%rip), %rsi     # 0xec8ba
movb $0x1, %al
callq 0x4170
leaq -0xf4280(%rbp), %rdi
leaq 0x3a8e2(%rip), %rsi     # 0xed265
xorl %edx, %edx
movb $0x0, %al
callq 0x4170
leaq -0x16e3a0(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0xf4280(%rbp), %rcx
leaq 0x3a550(%rip), %rdx     # 0xecef4
callq 0xb04c0
leaq -0x1e84c0(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movsd (%rax), %xmm0
leaq -0x16e3a0(%rbp), %rdx
leaq 0x3a585(%rip), %rsi     # 0xecf52
movb $0x1, %al
callq 0x4170
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x28(%rbp), %rcx
movl 0x1c0(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0xb2a69
leaq -0xf4280(%rbp), %rdi
movl -0x34(%rbp), %edx
leaq 0x3a865(%rip), %rsi     # 0xed265
movb $0x0, %al
callq 0x4170
leaq -0x16e3a0(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0xf4280(%rbp), %rcx
leaq 0x3a4d5(%rip), %rdx     # 0xecef4
callq 0xb04c0
leaq -0x1e84c0(%rbp), %rdi
leaq -0x1e84c0(%rbp), %rdx
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq -0x16e3a0(%rbp), %rcx
leaq 0x3a4f9(%rip), %rsi     # 0xecf4d
movb $0x1, %al
callq 0x4170
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xb29db
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x1e84c0(%rbp), %rcx
leaq -0x2625e0(%rbp), %r8
leaq 0x3303d(%rip), %rdx     # 0xe5ac2
callq 0xb0d00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %rax
movq (%rax), %r9
movl 0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
callq 0xb2720
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb0e70
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %rax
movq 0x8(%rax), %r9
movl 0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
callq 0xb2720
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb0ec0
jmp 0xb2af5
jmp 0xb2b0e
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0xc(%rbp), %edx
movq -0x30(%rbp), %rax
movl 0x34(%rax), %ecx
callq 0xb0120
addq $0x2625f0, %rsp         # imm = 0x2625F0
popq %rbp
retq
nopw (%rax,%rax)