// File: /workspace/github_c_makefile_star2_O1/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 0x855ae
leaq 0x287e3(%rip), %r12     # 0xadd74
movl %ebp, %r14d
movl $0x2, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x42c0
decl %r14d
jne 0x85594
leaq 0x200d8(%rip), %rdx     # 0xa568d
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x39529
movl 0x30(%r15), %edx
leaq 0x276e1(%rip), %rsi     # 0xaccad
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
movslq 0x30(%r15), %rax
testq %rax, %rax
js 0x8561a
imulq $0x340, %rax, %rax      # imm = 0x340
movl 0x30f08(%r13,%rax), %edi
movl $0x2, %esi
movl $0x2, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x39a80
testl %eax, %eax
je 0x8561a
movsd 0x28(%r15), %xmm0
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
movb $0x1, %al
callq 0x42e0
cmpl $-0x1, 0x30(%r15)
je 0x85680
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 0x39a80
testl %eax, %eax
je 0x856aa
movq (%r15), %rdx
incl %ebp
movq %rbx, %rdi
movq %r13, %rsi
movl %ebp, %ecx
callq 0x8556a
movq 0x8(%r15), %rdx
movq %rbx, %rdi
movq %r13, %rsi
movl %ebp, %ecx
callq 0x8556a
jmp 0x8570d
movl 0x34(%r15), %edx
leaq 0x27622(%rip), %rsi     # 0xaccad
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
movq 0xa0(%r15), %rsi
movl 0x10(%r13), %edx
movq %rbx, %rdi
callq 0x84eee
jmp 0x8570d
leaq 0x30f08(%r13), %r12
movslq 0x30(%r15), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
cmpl $0x0, 0x18(%r12,%rax)
movl %ebp, 0xc(%rsp)
jle 0x8570d
movq %r15, %rbp
movq %r13, %r15
incl 0xc(%rsp)
xorl %r13d, %r13d
xorl %r14d, %r14d
movq 0x10(%rbp), %rdx
addq %r13, %rdx
movq %rbx, %rdi
movq %r15, %rsi
movl 0xc(%rsp), %ecx
callq 0x8556a
incq %r14
movslq 0x30(%rbp), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movslq 0x18(%r12,%rax), %rax
addq $0x160, %r13            # imm = 0x160
cmpq %rax, %r14
jl 0x856d8
addq $0x7a138, %rsp          # imm = 0x7A138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq