// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/savecode.c
// Function: code_regressionnode
void code_regressionnode(FILE* testcodefile, PROGRAMMING_LANGUAGE_TYPE language, Datasetptr d, Regressionnodeptr m, int level)
{
 /*!Last Changed 14.06.2006*/
 int i;
 char st[MAXLENGTH], st2[MAXLENGTH], st3[MAXLENGTH], st4[MAXLENGTH];
 if (m->featureno != LEAF_NODE)
  {
   if (m->featureno >= 0)
    {
     code_array_index(st3, language, "testdataconverted", m->featureno);
     sprintf(st4, "%.6f", m->split);
    }
   else
     if (m->featureno == LINEAR)
      {
       code_array_index_variable(st2, language, "testdataconverted", "0");
       sprintf(st3, "%.6f * %s", real_feature(m->leftcenter, 0), st2);
       sprintf(st4, "%.6f * %s", real_feature(m->rightcenter, 0), st2);
       for (i = 1; i < d->multifeaturecount - 1; i++)
        {
         sprintf(st, "%d", i);
         code_array_index_variable(st2, language, "testdataconverted", st);
         sprintf(st3, "%s + %.6f * %s", st3, real_feature(m->leftcenter, i), st2);
         sprintf(st4, "%s + %.6f * %s", st4, real_feature(m->rightcenter, i), st2);
        }
      }
   code_if(testcodefile, language, "<=", st3, st4); 
   code_regressionnode(testcodefile, language, d, m->left, level + 1);
   code_else(testcodefile, language);
   code_regressionnode(testcodefile, language, d, m->right, level + 1);
   code_endif(testcodefile, language);      
  }
 else
  {
   if (m->leaftype == CONSTANTLEAF)
     code_function_return_regression(testcodefile, "regtree", language, m->regressionvalue);
   else
    {
     sprintf(st3, "%.6f", m->w.values[0][0]);
     for (i = 0; i < d->multifeaturecount - 1; i++)
      {
       sprintf(st, "%d", i);
       code_array_index_variable(st2, language, "testdataconverted", st);
       sprintf(st3, "%s + %.6f * %s", st3, m->w.values[i + 1][0], st2);
      }
     code_function_return_string(testcodefile, "regtree", language, st3);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e84a8, %rsp         # imm = 0x1E84A8
movq %rcx, %r12
movq %rdx, %r14
movl %esi, %ebx
movq %rdi, %r15
movl 0x68(%rcx), %ecx
cmpl $-0x1, %ecx
je 0x7d8d1
movl %r8d, 0xc(%rsp)
testl %ecx, %ecx
movq %r14, 0x10(%rsp)
js 0x7d9aa
leaq 0x2ff49(%rip), %rdx     # 0xad7ec
leaq 0x20(%rsp), %rdi
movl %ebx, %esi
callq 0x7c219
movsd 0x50(%r12), %xmm0
leaq 0x2f8f5(%rip), %rsi     # 0xad1b2
leaq 0x7a140(%rsp), %rdi
movb $0x1, %al
callq 0x41b0
jmp 0x7dae2
cmpl $0x0, 0x6c(%r12)
je 0x7db5a
movq %r15, 0x18(%rsp)
movq 0x38(%r12), %rax
movq (%rax), %rax
movsd (%rax), %xmm0
leaq 0x2f8bd(%rip), %rsi     # 0xad1b2
leaq 0x20(%rsp), %rdi
movb $0x1, %al
callq 0x41b0
cmpl $0x2, 0x1c0(%r14)
movl %ebx, 0xc(%rsp)
jl 0x7d98b
movq %r14, %rbx
leaq 0x16e380(%rsp), %r13
leaq 0xf4260(%rsp), %r14
leaq 0x20(%rsp), %rbp
xorl %r15d, %r15d
movq %r13, %rdi
leaq 0x30229(%rip), %rsi     # 0xadb5d
movl %r15d, %edx
xorl %eax, %eax
callq 0x41b0
movq %r14, %rdi
movl 0xc(%rsp), %esi
leaq 0x2fea0(%rip), %rdx     # 0xad7ec
movq %r13, %rcx
callq 0x7c24c
movq 0x38(%r12), %rax
movq 0x8(%rax,%r15,8), %rax
incq %r15
movsd (%rax), %xmm0
movq %rbp, %rdi
leaq 0x2fed6(%rip), %rsi     # 0xad845
movq %rbp, %rdx
movq %r14, %rcx
movb $0x1, %al
callq 0x41b0
movslq 0x1c0(%rbx), %rax
decq %rax
cmpq %rax, %r15
jl 0x7d92a
leaq 0x2949d(%rip), %rsi     # 0xa6e2f
leaq 0x20(%rsp), %rcx
movq 0x18(%rsp), %rdi
movl 0xc(%rsp), %edx
callq 0x7bffb
jmp 0x7db48
cmpl $-0x2, %ecx
jne 0x7dae2
leaq 0x2fe32(%rip), %rdx     # 0xad7ec
leaq 0x257e8(%rip), %rcx     # 0xa31a9
leaq 0xf4260(%rsp), %r14
movq %r14, %rdi
movl %ebx, %esi
callq 0x7c24c
movq 0x80(%r12), %rdi
xorl %esi, %esi
callq 0x2e4b6
movq %r15, %r13
leaq 0x2fe5e(%rip), %r15     # 0xad84a
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
movb $0x1, %al
callq 0x41b0
movq 0x88(%r12), %rdi
xorl %esi, %esi
callq 0x2e4b6
leaq 0x7a140(%rsp), %rdi
movq %r15, %rsi
movq %r13, %r15
movq %r14, %rdx
movb $0x1, %al
callq 0x41b0
movq 0x10(%rsp), %rax
cmpl $0x3, 0x1c0(%rax)
jl 0x7dae2
movl $0x1, %r13d
leaq 0xf4260(%rsp), %rbp
leaq 0x16e380(%rsp), %r14
movq %r14, %rdi
leaq 0x30106(%rip), %rsi     # 0xadb5d
movl %r13d, %edx
xorl %eax, %eax
callq 0x41b0
movq %rbp, %rdi
movl %ebx, %esi
leaq 0x2fd7f(%rip), %rdx     # 0xad7ec
movq %r14, %rcx
callq 0x7c24c
movq 0x80(%r12), %rdi
movl %r13d, %esi
callq 0x2e4b6
leaq 0x20(%rsp), %rdi
leaq 0x2fdb4(%rip), %r14     # 0xad845
movq %r14, %rsi
movq %rdi, %rdx
movq %rbp, %rcx
movb $0x1, %al
callq 0x41b0
movq 0x88(%r12), %rdi
movl %r13d, %esi
callq 0x2e4b6
leaq 0x7a140(%rsp), %rdi
movq %r14, %rsi
movq %rdi, %rdx
movq %rbp, %rcx
movb $0x1, %al
callq 0x41b0
incl %r13d
movq 0x10(%rsp), %rax
movl 0x1c0(%rax), %eax
decl %eax
cmpl %eax, %r13d
jl 0x7da45
leaq 0x28409(%rip), %rdx     # 0xa5ef2
leaq 0x20(%rsp), %rcx
leaq 0x7a140(%rsp), %r8
movq %r15, %rdi
movl %ebx, %esi
callq 0x7c7c3
movq (%r12), %rcx
movl 0xc(%rsp), %ebp
incl %ebp
movq %r15, %rdi
movl %ebx, %esi
movq 0x10(%rsp), %r14
movq %r14, %rdx
movl %ebp, %r8d
callq 0x7d866
movq %r15, %rdi
movl %ebx, %esi
callq 0x7c8ac
movq 0x8(%r12), %rcx
movq %r15, %rdi
movl %ebx, %esi
movq %r14, %rdx
movl %ebp, %r8d
callq 0x7d866
movq %r15, %rdi
movl %ebx, %esi
callq 0x7c903
addq $0x1e84a8, %rsp         # imm = 0x1E84A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd 0x70(%r12), %xmm0
leaq 0x292c7(%rip), %rsi     # 0xa6e2f
movq %r15, %rdi
movl %ebx, %edx
addq $0x1e84a8, %rsp         # imm = 0x1E84A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7c0de