// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/savemodel.c
// Function: save_model_c45
void save_model_c45(FILE* modelfile, Datasetptr d, Decisionnodeptr m, int level)
{
 /*Last Changed 22.12.2005*/
 char pst[READLINELENGTH];
 int i;
	for (i = 0; i < level; i++)
		 fprintf(modelfile, "  ");
 set_precision(pst, NULL, " "); 
 fprintf(modelfile, "%d ", m->featureno);
 if (m->featureno >= 0 && in_list(d->features[m->featureno].type, 2, REAL, INTEGER))
   fprintf(modelfile, pst, m->split);
 if (m->featureno == LEAF_NODE)
  {
   fprintf(modelfile, "%d ", m->classno);
   save_array_int(modelfile, m->counts, d->classno);
   return;
  }
 else
	 {
		 fprintf(modelfile, "\n");
   if (in_list(d->features[m->featureno].type, 2, REAL, INTEGER))
    {
     save_model_c45(modelfile, d, m->left, level + 1);
     save_model_c45(modelfile, d, m->right, level + 1);
    }
   else
     for (i = 0; i < d->features[m->featureno].valuecount; i++)
       save_model_c45(modelfile, d, &(m->string[i]), level + 1);
	 }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7a138, %rsp          # imm = 0x7A138
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %rbx
testl %ecx, %ecx
jle 0x87e02
leaq 0x29027(%rip), %r12     # 0xb0e0c
movl %ebp, %r14d
movl $0x2, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x42c0
decl %r14d
jne 0x87de8
leaq 0x208dc(%rip), %rdx     # 0xa86e5
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x3a535
movl 0x30(%r15), %edx
leaq 0x27f65(%rip), %rsi     # 0xafd85
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
movslq 0x30(%r15), %rax
testq %rax, %rax
js 0x87e72
imulq $0x340, %rax, %rax      # imm = 0x340
movl 0x30f08(%r13,%rax), %edi
movl $0x2, %esi
movl $0x2, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x3aa8c
testl %eax, %eax
je 0x87e6e
movsd 0x28(%r15), %xmm0
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
movb $0x1, %al
callq 0x42e0
movl 0x30(%r15), %eax
cmpl $-0x1, %eax
je 0x87ed6
movl $0xa, %edi
movq %rbx, %rsi
callq 0x4150
movslq 0x30(%r15), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movl 0x30f08(%r13,%rax), %edi
movl $0x2, %esi
movl $0x2, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x3aa8c
testl %eax, %eax
je 0x87f00
movq (%r15), %rdx
incl %ebp
movq %rbx, %rdi
movq %r13, %rsi
movl %ebp, %ecx
callq 0x87dbe
movq 0x8(%r15), %rdx
movq %rbx, %rdi
movq %r13, %rsi
movl %ebp, %ecx
callq 0x87dbe
jmp 0x87f60
movl 0x34(%r15), %edx
leaq 0x27ea4(%rip), %rsi     # 0xafd85
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
movq 0xa0(%r15), %rsi
movl 0x10(%r13), %edx
movq %rbx, %rdi
callq 0x87742
jmp 0x87f60
leaq 0x30f08(%r13), %r12
movslq 0x30(%r15), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
cmpl $0x0, 0x18(%r12,%rax)
movl %ebp, 0xc(%rsp)
jle 0x87f60
movq %r13, %rbp
incl 0xc(%rsp)
xorl %r13d, %r13d
xorl %r14d, %r14d
movq 0x10(%r15), %rdx
addq %r13, %rdx
movq %rbx, %rdi
movq %rbp, %rsi
movl 0xc(%rsp), %ecx
callq 0x87dbe
incq %r14
movslq 0x30(%r15), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movslq 0x18(%r12,%rax), %rax
addq $0x160, %r13            # imm = 0x160
cmpq %rax, %r14
jl 0x87f2b
addq $0x7a138, %rsp          # imm = 0x7A138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq