// File: /workspace/github_c_makefile_star2_O3/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 0x74f0f(%rip), %rsi     # 0xb0bf5
movq %r12, %rdx
xorl %eax, %eax
callq 0x4070
movslq 0x30(%rbx), %rax
testq %rax, %rax
js 0x3bd38
imulq $0x340, %rax, %rax      # imm = 0x340
movl 0x30f08(%r15,%rax), %edi
movl $0x2, %esi
movl $0x2, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x3aa8c
testl %eax, %eax
je 0x3bd34
leaq 0x28(%rbx), %rdx
leaq 0x6df56(%rip), %rsi     # 0xa9c80
movq %r14, %rdi
xorl %eax, %eax
callq 0x4070
movl (%r12), %eax
cmpl $-0x1, %eax
je 0x3bdda
movq $0x0, 0xa0(%rbx)
cltq
imulq $0x340, %rax, %rax      # imm = 0x340
movl 0x30f08(%r15,%rax), %edi
movl $0x2, %esi
movl $0x2, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x3aa8c
testl %eax, %eax
je 0x3be07
leaq 0x6df90(%rip), %r12     # 0xa9d0f
movl $0x160, %edi            # imm = 0x160
movq %r12, %rsi
movl $0x14, %edx
callq 0x3a0e1
movq %rax, (%rbx)
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3bca9
movq (%rbx), %rax
movq %rbx, 0x18(%rax)
movl $0x160, %edi            # imm = 0x160
movq %r12, %rsi
movl $0x16, %edx
callq 0x3a0e1
movq %rax, 0x8(%rbx)
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3bca9
movq 0x8(%rbx), %rax
movq %rbx, 0x18(%rax)
jmp 0x3be8b
leaq 0x34(%rbx), %rdx
leaq 0x74e10(%rip), %rsi     # 0xb0bf5
movq %r14, %rdi
xorl %eax, %eax
callq 0x4070
movl 0x10(%r15), %esi
movq %r14, %rdi
callq 0x3b610
movq %rax, 0xa0(%rbx)
jmp 0x3be8b
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 0x6dee3(%rip), %rsi     # 0xa9d0f
movl $0x1b, %edx
callq 0x3a0e1
movq %rax, %rdx
movq %rax, 0x10(%rbx)
movslq 0x30(%rbx), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
cmpl $0x0, 0x18(%r12,%rax)
jle 0x3be8b
xorl %r13d, %r13d
xorl %ebp, %ebp
addq %r13, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3bca9
movq 0x10(%rbx), %rdx
movq %rbx, 0x18(%rdx,%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 0x3be55
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq