// File: /workspace/github_c_makefile_star2_O3/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 0x8a802(%rip), %rsi     # 0xa7930
movl $0x3, %edx
callq 0x3a0e1
movq %rax, %r15
testq %r14, %r14
je 0x1d230
testl %ebx, %ebx
jle 0x1d2b9
movl %ebx, 0x7c(%rsp)
movl %ebx, %eax
movq %rax, 0x88(%rsp)
xorl %r13d, %r13d
leaq 0x98(%rsp), %r12
movq %r15, 0x80(%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 0x8a792(%rip), %rsi     # 0xa7930
movl $0xa, %edx
callq 0x3a0e1
movq %rax, 0x58(%r15,%rbx)
movl 0x80(%r14), %eax
testl %eax, %eax
jle 0x1d217
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 0x7bc98
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 0x1d1c5
movq 0x80(%rsp), %r15
movq 0x90(%rsp), %r13
movl %eax, 0x80(%rbp)
incq %r13
cmpq 0x88(%rsp), %r13
jne 0x1d16d
jmp 0x1d26b
testl %ebx, %ebx
jle 0x1d2b9
movl %ebx, 0x7c(%rsp)
movl %ebx, %eax
imulq $0x160, %rax, %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 0x1d249
movl 0x7c(%rsp), %eax
testl %eax, %eax
jle 0x1d2b9
movl %eax, %eax
imulq $0x160, %rax, %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 0x1d280
movq %r15, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq