// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/savemodel.c
// Function: save_model_regtree
void save_model_regtree(FILE* modelfile, Datasetptr d, Regressionnodeptr m, int level)
{
 /*Last Changed 29.05.2006*/
 char pst[READLINELENGTH];
 int i, size;
 for (i = 0; i < level; i++)
   fprintf(modelfile, "  ");
 set_precision(pst, NULL, "\n"); 
 fprintf(modelfile, "%d ", m->featureno);
 if (m->featureno == LEAF_NODE)
  {
   size = data_size(m->instances);
   fprintf(modelfile, "%d ", m->leaftype);
   if (m->leaftype == CONSTANTLEAF)
     fprintf(modelfile, pst, m->regressionvalue);   
   else
     save_matrix(modelfile, m->w);   
  }
 else
  {
   if (m->featureno >= 0)
     fprintf(modelfile, pst, m->split);   
   else
     if (m->featureno == LINEAR)
      {
       save_instance(modelfile, d, m->leftcenter, BOOLEAN_FALSE);
       save_instance(modelfile, d, m->rightcenter, BOOLEAN_FALSE);
      }
     else
       if (m->featureno == QUADRATIC)
        {
         save_instance_2d(modelfile, d, m->leftcenter, BOOLEAN_FALSE);
         save_instance_2d(modelfile, d, m->rightcenter, BOOLEAN_FALSE);
        }
       else
         if (m->featureno == SOFTLIN)
           save_matrix(modelfile, m->w);
   save_model_regtree(modelfile, d, m->left, level + 1);
   save_model_regtree(modelfile, d, m->right, level + 1);
  } 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x7a150, %rsp          # imm = 0x7A150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0x0, -0x7a144(%rbp)
movl -0x7a144(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0xbb982
movq -0x8(%rbp), %rdi
leaq 0x31b12(%rip), %rsi     # 0xed47c
movb $0x0, %al
callq 0x4280
movl -0x7a144(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7a144(%rbp)
jmp 0xbb954
leaq -0x7a140(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x2a3a7(%rip), %rdx     # 0xe5d3b
callq 0x53310
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x68(%rax), %edx
leaq 0x30aea(%rip), %rsi     # 0xec495
movb $0x0, %al
callq 0x4280
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x68(%rax)
jne 0xbba29
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x449f0
movl %eax, -0x7a148(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x6c(%rax), %edx
leaq 0x30ab4(%rip), %rsi     # 0xec495
movb $0x0, %al
callq 0x4280
movq -0x18(%rbp), %rax
cmpl $0x0, 0x6c(%rax)
jne 0xbba0f
movq -0x8(%rbp), %rdi
leaq -0x7a140(%rbp), %rsi
movq -0x18(%rbp), %rax
movsd 0x70(%rax), %xmm0
movb $0x1, %al
callq 0x4280
jmp 0xbba24
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rsi
movq 0x38(%rax), %rdx
callq 0xb9ad0
jmp 0xbbb2d
movq -0x18(%rbp), %rax
cmpl $0x0, 0x68(%rax)
jl 0xbba53
movq -0x8(%rbp), %rdi
leaq -0x7a140(%rbp), %rsi
movq -0x18(%rbp), %rax
movsd 0x50(%rax), %xmm0
movb $0x1, %al
callq 0x4280
jmp 0xbbaf8
movq -0x18(%rbp), %rax
cmpl $-0x2, 0x68(%rax)
jne 0xbba93
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x80(%rax), %rdx
xorl %ecx, %ecx
callq 0xb9e90
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rdx
xorl %ecx, %ecx
callq 0xb9e90
jmp 0xbbaf6
movq -0x18(%rbp), %rax
cmpl $-0x3, 0x68(%rax)
jne 0xbbad3
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x80(%rax), %rdx
xorl %ecx, %ecx
callq 0xb9f90
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rdx
xorl %ecx, %ecx
callq 0xb9f90
jmp 0xbbaf4
movq -0x18(%rbp), %rax
cmpl $-0x6, 0x68(%rax)
jne 0xbbaf2
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rsi
movq 0x38(%rax), %rdx
callq 0xb9ad0
jmp 0xbbaf4
jmp 0xbbaf6
jmp 0xbbaf8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
callq 0xbb930
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
callq 0xbb930
addq $0x7a150, %rsp          # imm = 0x7A150
popq %rbp
retq
nopw %cs:(%rax,%rax)