// File: /workspace/github_c_makefile_star2_O2/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, 0x10(%rsp)
movl %esi, 0x4(%rsp)
movl 0x68(%rcx), %ecx
cmpl $-0x1, %ecx
je 0x74656
movq %rdi, 0x8(%rsp)
testl %ecx, %ecx
movl %r8d, 0x1c(%rsp)
js 0x74724
leaq 0x2c1c2(%rip), %rdx     # 0xa07e8
leaq 0x20(%rsp), %rdi
movl 0x4(%rsp), %esi
callq 0x73250
movsd 0x50(%r12), %xmm0
leaq 0x2bb6c(%rip), %rsi     # 0xa01ae
leaq 0x7a140(%rsp), %rdi
movb $0x1, %al
callq 0x41b0
jmp 0x7483f
cmpl $0x0, 0x6c(%r12)
je 0x748c0
movq %rdi, 0x8(%rsp)
movq 0x38(%r12), %rax
movq (%rax), %rax
movsd (%rax), %xmm0
leaq 0x2bb34(%rip), %rsi     # 0xa01ae
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x41b0
leaq 0x16e380(%rsp), %rbp
leaq 0xf4260(%rsp), %r13
leaq 0x2c1a1(%rip), %r15     # 0xa0841
xorl %ebx, %ebx
movq 0x10(%rsp), %rax
movslq 0x1c0(%rax), %rax
decq %rax
cmpq %rax, %rbx
jge 0x74705
movq %rbp, %rdi
leaq 0x2c499(%rip), %rsi     # 0xa0b59
movl %ebx, %edx
xorl %eax, %eax
callq 0x41b0
movq %r13, %rdi
movl 0x4(%rsp), %esi
leaq 0x2c111(%rip), %rdx     # 0xa07e8
movq %rbp, %rcx
callq 0x7327f
movq 0x38(%r12), %rax
movq 0x8(%rax,%rbx,8), %rax
incq %rbx
movsd (%rax), %xmm0
movq %r14, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
movb $0x1, %al
callq 0x41b0
jmp 0x746a2
leaq 0x256bb(%rip), %rsi     # 0x99dc7
leaq 0x20(%rsp), %rcx
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %edx
callq 0x7308c
jmp 0x748ae
cmpl $-0x2, %ecx
jne 0x7483f
leaq 0x2c0b4(%rip), %rdx     # 0xa07e8
leaq 0x21a76(%rip), %rcx     # 0x961b1
leaq 0xf4260(%rsp), %r13
movq %r13, %rdi
movl 0x4(%rsp), %esi
callq 0x7327f
movq 0x80(%r12), %rdi
xorl %esi, %esi
callq 0x2aea2
leaq 0x2c0e1(%rip), %rbx     # 0xa0846
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
movb $0x1, %al
callq 0x41b0
movq 0x88(%r12), %rdi
xorl %esi, %esi
callq 0x2aea2
leaq 0x7a140(%rsp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
movb $0x1, %al
callq 0x41b0
pushq $0x1
popq %r14
leaq 0x16e380(%rsp), %r15
leaq 0x2c093(%rip), %rbp     # 0xa0841
movq 0x10(%rsp), %rax
movl 0x1c0(%rax), %eax
decl %eax
cmpl %eax, %r14d
jge 0x7483f
movq %r15, %rdi
leaq 0x2c38f(%rip), %rsi     # 0xa0b59
movl %r14d, %edx
xorl %eax, %eax
callq 0x41b0
movq %r13, %rdi
movl 0x4(%rsp), %esi
leaq 0x2c006(%rip), %rdx     # 0xa07e8
movq %r15, %rcx
callq 0x7327f
movq 0x80(%r12), %rdi
movl %r14d, %esi
callq 0x2aea2
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
movq %rdi, %rdx
movq %r13, %rcx
movb $0x1, %al
callq 0x41b0
movq 0x88(%r12), %rdi
movl %r14d, %esi
callq 0x2aea2
leaq 0x7a140(%rsp), %rdi
movq %rbp, %rsi
movq %rdi, %rdx
movq %r13, %rcx
movb $0x1, %al
callq 0x41b0
incl %r14d
jmp 0x747ae
leaq 0x2464c(%rip), %rdx     # 0x98e92
leaq 0x20(%rsp), %rcx
leaq 0x7a140(%rsp), %r8
movq 0x8(%rsp), %r15
movq %r15, %rdi
movl 0x4(%rsp), %ebx
movl %ebx, %esi
callq 0x736fc
movq (%r12), %rcx
movl 0x1c(%rsp), %ebp
incl %ebp
movq %r15, %rdi
movl %ebx, %esi
movq 0x10(%rsp), %r14
movq %r14, %rdx
movl %ebp, %r8d
callq 0x745e8
movq %r15, %rdi
movl %ebx, %esi
callq 0x737c1
movq 0x8(%r12), %rcx
movq %r15, %rdi
movl %ebx, %esi
movq %r14, %rdx
movl %ebp, %r8d
callq 0x745e8
movq %r15, %rdi
movl %ebx, %esi
callq 0x737fd
addq $0x1e84a8, %rsp         # imm = 0x1E84A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd 0x70(%r12), %xmm0
leaq 0x254f9(%rip), %rsi     # 0x99dc7
movl 0x4(%rsp), %edx
addq $0x1e84a8, %rsp         # imm = 0x1E84A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7314b