// File: /workspace/github_c_makefile_star2_O3/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, (%rsp)
movl %esi, %ebx
movl 0x68(%rcx), %ecx
cmpl $-0x1, %ecx
je 0x7f48a
movl %r8d, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
testl %ecx, %ecx
js 0x7f57f
leaq 0x31428(%rip), %rdx     # 0xb0884
leaq 0x20(%rsp), %rdi
movl %ebx, %esi
callq 0x7db6a
movsd 0x50(%r12), %xmm0
leaq 0x30dd4(%rip), %rsi     # 0xb024a
leaq 0x7a140(%rsp), %rdi
movb $0x1, %al
callq 0x41b0
jmp 0x7f6ea
cmpl $0x0, 0x6c(%r12)
je 0x7f766
movq %rdi, 0x8(%rsp)
movq 0x38(%r12), %rax
movq (%rax), %rax
movsd (%rax), %xmm0
leaq 0x30d9c(%rip), %rsi     # 0xb024a
leaq 0x20(%rsp), %rdi
movb $0x1, %al
callq 0x41b0
movq (%rsp), %rax
cmpl $0x2, 0x1c0(%rax)
jl 0x7f562
movl %ebx, %eax
movq %rax, 0x10(%rsp)
leaq 0x16e380(%rsp), %r13
leaq 0xf4260(%rsp), %rbp
leaq 0x20(%rsp), %r14
xorl %r15d, %r15d
movq %r13, %rdi
leaq 0x31701(%rip), %rsi     # 0xb0bf5
movl %r15d, %edx
xorl %eax, %eax
callq 0x41b0
cmpl $0x5, %ebx
ja 0x7f527
movq 0x10(%rsp), %rax
leaq 0x54871(%rip), %rcx     # 0xd3d80
movq (%rcx,%rax,8), %rsi
movq %rbp, %rdi
leaq 0x31367(%rip), %rdx     # 0xb0884
movq %r13, %rcx
xorl %eax, %eax
callq 0x41b0
movq 0x38(%r12), %rax
movq 0x8(%rax,%r15,8), %rax
incq %r15
movsd (%rax), %xmm0
movq %r14, %rdi
leaq 0x3139b(%rip), %rsi     # 0xb08dd
movq %r14, %rdx
movq %rbp, %rcx
movb $0x1, %al
callq 0x41b0
movq (%rsp), %rax
movslq 0x1c0(%rax), %rax
decq %rax
cmpq %rax, %r15
jl 0x7f4ea
leaq 0x2a936(%rip), %rsi     # 0xa9e9f
leaq 0x20(%rsp), %rcx
movq 0x8(%rsp), %rdi
movl %ebx, %edx
callq 0x7d912
jmp 0x7f754
cmpl $-0x2, %ecx
jne 0x7f6ea
movl %ebx, %eax
movq %rax, 0x18(%rsp)
cmpl $0x5, %ebx
ja 0x7f5c1
leaq 0x547e5(%rip), %rax     # 0xd3d80
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x312d9(%rip), %rdx     # 0xb0884
leaq 0x26bf7(%rip), %rcx     # 0xa61a9
leaq 0xf4260(%rsp), %rdi
xorl %eax, %eax
callq 0x41b0
movq 0x80(%r12), %rdi
xorl %esi, %esi
callq 0x2ed6a
leaq 0x3130b(%rip), %r14     # 0xb08e2
leaq 0x20(%rsp), %rdi
leaq 0xf4260(%rsp), %r13
movq %r14, %rsi
movq %r13, %rdx
movb $0x1, %al
callq 0x41b0
movq 0x88(%r12), %rdi
xorl %esi, %esi
callq 0x2ed6a
leaq 0x7a140(%rsp), %rdi
movq %r14, %rsi
movq %r13, %rdx
movb $0x1, %al
callq 0x41b0
movq (%rsp), %rax
cmpl $0x3, 0x1c0(%rax)
jl 0x7f6ea
movl $0x1, %r13d
leaq 0xf4260(%rsp), %rbp
leaq 0x7a140(%rsp), %r14
leaq 0x16e380(%rsp), %rdi
leaq 0x315aa(%rip), %rsi     # 0xb0bf5
movl %r13d, %edx
xorl %eax, %eax
callq 0x41b0
cmpl $0x5, %ebx
ja 0x7f683
leaq 0x5471f(%rip), %rax     # 0xd3d80
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movq %rbp, %rdi
leaq 0x31210(%rip), %rdx     # 0xb0884
leaq 0x16e380(%rsp), %rcx
xorl %eax, %eax
callq 0x41b0
movq 0x80(%r12), %rdi
movl %r13d, %esi
callq 0x2ed6a
leaq 0x20(%rsp), %rdi
leaq 0x3123e(%rip), %r15     # 0xb08dd
movq %r15, %rsi
movq %rdi, %rdx
movq %rbp, %rcx
movb $0x1, %al
callq 0x41b0
movq 0x88(%r12), %rdi
movl %r13d, %esi
callq 0x2ed6a
movq %r14, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbp, %rcx
movb $0x1, %al
callq 0x41b0
incl %r13d
movq (%rsp), %rax
movl 0x1c0(%rax), %eax
decl %eax
cmpl %eax, %r13d
jl 0x7f63c
leaq 0x29831(%rip), %rdx     # 0xa8f22
leaq 0x20(%rsp), %rcx
leaq 0x7a140(%rsp), %r8
movq 0x8(%rsp), %r14
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e0fa
movq (%r12), %rcx
movl 0x10(%rsp), %ebp
incl %ebp
movq %r14, %rdi
movl %ebx, %esi
movq (%rsp), %r15
movq %r15, %rdx
movl %ebp, %r8d
callq 0x7f421
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e1e3
movq 0x8(%r12), %rcx
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
movl %ebp, %r8d
callq 0x7f421
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e23a
addq $0x1e84a8, %rsp         # imm = 0x1E84A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd 0x70(%r12), %xmm0
leaq 0x2a72b(%rip), %rsi     # 0xa9e9f
movl %ebx, %edx
addq $0x1e84a8, %rsp         # imm = 0x1E84A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7da0f