// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/loadmodel.c
// Function: load_model_c45
void load_model_c45(FILE* infile, Datasetptr d, Decisionnodeptr rootnode)
{
 /*!Last Changed 17.07.2006*/
 /*!Last Changed 22.12.2005*/
	int i;
 rootnode->left = NULL;
 rootnode->parent = NULL;
 rootnode->right = NULL;
 rootnode->string = NULL;
	rootnode->rule = NULL;
	rootnode->instances = NULL;
 rootnode->conditiontype = UNIVARIATE_CONDITION; 
 fscanf(infile, "%d", &(rootnode->featureno));
	if (rootnode->featureno >= 0 && in_list(d->features[rootnode->featureno].type, 2, REAL, INTEGER))
		 fscanf(infile, "%lf", &(rootnode->split));
	if (rootnode->featureno == LEAF_NODE)
	 {
		 fscanf(infile, "%d", &(rootnode->classno));
			rootnode->counts = load_array_int(infile, d->classno);
	 }
	else
	 {
		 rootnode->counts = NULL;
   if (in_list(d->features[rootnode->featureno].type, 2, REAL, INTEGER))
    {
				 rootnode->left = safemalloc(sizeof(Decisionnode), "load_model_c45", 20);
     load_model_c45(infile, d, rootnode->left);
     rootnode->left->parent = rootnode;
				 rootnode->right = safemalloc(sizeof(Decisionnode), "load_model_c45", 22);
     load_model_c45(infile, d, rootnode->right);
     rootnode->right->parent = rootnode;
    }
   else
			 {
				 rootnode->string = safemalloc(d->features[rootnode->featureno].valuecount * sizeof(Decisionnode), "load_model_c45", 27);
     for (i = 0; i < d->features[rootnode->featureno].valuecount; i++)
      {
						 load_model_c45(infile, d, &(rootnode->string[i]));
       rootnode->string[i].parent = rootnode;      
      }
			 }
	 }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
xorl %eax, %eax
movq %rax, 0x58(%rdx)
movl $0x0, 0x98(%rdx)
leaq 0x30(%rdx), %r12
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
movups %xmm0, 0x10(%rdx)
movq %rax, 0x20(%rdx)
leaq 0x72f07(%rip), %rsi     # 0xadb5d
movq %r12, %rdx
xorl %eax, %eax
callq 0x4070
movslq 0x30(%rbx), %rax
testq %rax, %rax
js 0x3aca4
imulq $0x340, %rax, %rax      # imm = 0x340
movl 0x30f08(%r15,%rax), %edi
movl $0x2, %esi
movl $0x2, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x39a80
testl %eax, %eax
je 0x3aca4
leaq 0x28(%rbx), %rdx
leaq 0x6bf76(%rip), %rsi     # 0xa6c10
movq %r14, %rdi
xorl %eax, %eax
callq 0x4070
movslq (%r12), %rax
cmpq $-0x1, %rax
je 0x3ad49
movq $0x0, 0xa0(%rbx)
imulq $0x340, %rax, %rax      # imm = 0x340
movl 0x30f08(%r15,%rax), %edi
movl $0x2, %esi
movl $0x2, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x39a80
testl %eax, %eax
je 0x3ad76
leaq 0x6bfb1(%rip), %r12     # 0xa6c9f
movl $0x160, %edi            # imm = 0x160
movq %r12, %rsi
movl $0x14, %edx
callq 0x390f5
movq %rax, (%rbx)
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3ac19
movq (%rbx), %rax
movq %rbx, 0x18(%rax)
movl $0x160, %edi            # imm = 0x160
movq %r12, %rsi
movl $0x16, %edx
callq 0x390f5
movq %rax, 0x8(%rbx)
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3ac19
movq 0x8(%rbx), %rax
movq %rbx, 0x18(%rax)
jmp 0x3adfb
leaq 0x34(%rbx), %rdx
leaq 0x72e09(%rip), %rsi     # 0xadb5d
movq %r14, %rdi
xorl %eax, %eax
callq 0x4070
movl 0x10(%r15), %esi
movq %r14, %rdi
callq 0x3a580
movq %rax, 0xa0(%rbx)
jmp 0x3adfb
leaq 0x30f08(%r15), %r12
movslq 0x30(%rbx), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movslq 0x18(%r12,%rax), %rax
imulq $0x160, %rax, %rdi      # imm = 0x160
leaq 0x6bf04(%rip), %rsi     # 0xa6c9f
movl $0x1b, %edx
callq 0x390f5
movq %rax, 0x10(%rbx)
movslq 0x30(%rbx), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
cmpl $0x0, 0x18(%r12,%rax)
jle 0x3adfb
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x10(%rbx), %rdx
addq %r13, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3ac19
movq 0x10(%rbx), %rax
movq %rbx, 0x18(%rax,%r13)
incq %rbp
movslq 0x30(%rbx), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movslq 0x18(%r12,%rax), %rax
addq $0x160, %r13            # imm = 0x160
cmpq %rax, %rbp
jl 0x3adc1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq