// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/decisiontree.c
// Function: createnewnode
Decisionnodeptr createnewnode(Decisionnodeptr parentnode, int howmany)
{
 /*!Last Changed 14.07.2006*/
 /*!Last Changed 23.11.2004 added possibleconditioncount*/
 /*!Last Changed 26.09.2004 added parent*/
 /*!Last Changed 02.02.2004 added safemalloc*/
 /*!Last Changed 08.04.2003*/
 int i,j;
 Decisionnodeptr newnode;
 newnode = (Decisionnodeptr)safemalloc(howmany * sizeof(struct decisionnode), "createnewnode", 3);
 if (parentnode)
  {
   for (j = 0; j < howmany; j++)
    {
     newnode[j].possibleconditioncount = parentnode->possibleconditioncount;
     newnode[j].parent = parentnode;
     newnode[j].rule = safemalloc(parentnode->conditioncount*sizeof(Decisioncondition), "createnewnode", 10);
     for (i = 0; i < parentnode->conditioncount; i++)
       newnode[j].rule[i] = copy_of_condition(parentnode->rule[i]); 
     newnode[j].conditioncount = parentnode->conditioncount;
    }
  }
 else
   for (j = 0; j < howmany; j++)
    {
     newnode[j].parent = parentnode;
     newnode[j].rule = NULL;
     newnode[j].conditioncount = 0;
    } 
 for (j = 0; j < howmany; j++)
  {
   newnode[j].featureno = LEAF_NODE;
   newnode[j].counts = NULL;
   newnode[j].instances = NULL;
   newnode[j].expanded = BOOLEAN_FALSE;
   newnode[j].leaftype = CONSTANTLEAF;
   newnode[j].outputs = NULL;
   newnode[j].w0s = NULL;
  }
 return newnode;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %esi, %ebx
movq %rdi, %r14
movslq %esi, %rax
imulq $0x160, %rax, %rdi      # imm = 0x160
leaq 0x87f33(%rip), %rsi     # 0xa48f0
movl $0x3, %edx
callq 0x390f5
movq %rax, %r15
movl %ebx, %eax
movq %rax, 0x78(%rsp)
testq %r14, %r14
movl %ebx, 0x84(%rsp)
je 0x1cabc
testl %ebx, %ebx
jle 0x1caef
xorl %r13d, %r13d
leaq 0x98(%rsp), %r12
movq %r15, 0x88(%rsp)
movl 0x8c(%r14), %eax
imulq $0x160, %r13, %rbx      # imm = 0x160
leaq (%r15,%rbx), %rbp
movl %eax, 0x8c(%r15,%rbx)
movq %r14, 0x18(%r15,%rbx)
movslq 0x80(%r14), %rax
imulq $0x70, %rax, %rdi
leaq 0x87ec3(%rip), %rsi     # 0xa48f0
movl $0xa, %edx
callq 0x390f5
movq %rax, 0x58(%r15,%rbx)
movl 0x80(%r14), %eax
testl %eax, %eax
jle 0x1caa6
movq %r13, 0x90(%rsp)
xorl %r15d, %r15d
xorl %ebx, %ebx
movq 0x58(%rbp), %r13
addq %r15, %r13
movq 0x58(%r14), %rsi
addq %r15, %rsi
movl $0xe, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq %r12, %rdi
callq 0x7a39e
movl $0xe, %ecx
movq %r13, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
incq %rbx
movslq 0x80(%r14), %rax
addq $0x70, %r15
cmpq %rax, %rbx
jl 0x1ca54
movq 0x88(%rsp), %r15
movq 0x90(%rsp), %r13
movl %eax, 0x80(%rbp)
incq %r13
cmpq 0x78(%rsp), %r13
jne 0x1c9fc
jmp 0x1caef
testl %ebx, %ebx
jle 0x1caef
imulq $0x160, 0x78(%rsp), %rax # imm = 0x160
xorl %ecx, %ecx
xorl %edx, %edx
movq %rcx, 0x18(%r15,%rdx)
movq %rcx, 0x58(%r15,%rdx)
movl $0x0, 0x80(%r15,%rdx)
addq $0x160, %rdx            # imm = 0x160
cmpq %rdx, %rax
jne 0x1cacd
cmpl $0x0, 0x84(%rsp)
jle 0x1cb3f
imulq $0x160, 0x78(%rsp), %rax # imm = 0x160
xorl %ecx, %ecx
xorl %edx, %edx
movl $0xffffffff, 0x30(%r15,%rdx) # imm = 0xFFFFFFFF
movq %rcx, 0xa0(%r15,%rdx)
movq %rcx, 0x20(%r15,%rdx)
movl %ecx, 0x130(%r15,%rdx)
movl %ecx, 0x60(%r15,%rdx)
movq %rcx, 0x70(%r15,%rdx)
movq %rcx, 0x50(%r15,%rdx)
addq $0x160, %rdx            # imm = 0x160
cmpq %rdx, %rax
jne 0x1cb06
movq %r15, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq