// File: /workspace/github_c_makefile_star2_O2/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, %r15
movslq %esi, %rax
imulq $0x160, %rax, %rdi      # imm = 0x160
leaq 0x7cbf1(%rip), %rsi     # 0x978b0
pushq $0x3
popq %rdx
callq 0x34f59
movq %rax, %r13
testq %r15, %r15
je 0x1adbf
xorl %ecx, %ecx
testl %ebx, %ebx
cmovlel %ecx, %ebx
movq %r13, 0x88(%rsp)
movq %rbx, 0x80(%rsp)
pushq $0xe
popq %r12
cmpq %rbx, %rcx
je 0x1adef
movl 0x8c(%r15), %eax
movq %rcx, 0x90(%rsp)
imulq $0x160, %rcx, %rbx      # imm = 0x160
leaq (%rbx,%r13), %rcx
movq %rcx, 0x78(%rsp)
movl %eax, 0x8c(%r13,%rbx)
movq %r15, 0x18(%r13,%rbx)
movslq 0x80(%r15), %rax
imulq $0x70, %rax, %rdi
leaq 0x7cb7b(%rip), %rsi     # 0x978b0
pushq $0xa
popq %rdx
callq 0x34f59
movq %rax, 0x58(%r13,%rbx)
xorl %ebx, %ebx
xorl %r13d, %r13d
movslq 0x80(%r15), %rax
cmpq %rax, %r13
jge 0x1ad94
movq 0x78(%rsp), %rax
movq 0x58(%rax), %rbp
addq %rbx, %rbp
movq 0x58(%r15), %rsi
addq %rbx, %rsi
movq %r12, %rcx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x98(%rsp), %r14
movq %r14, %rdi
callq 0x71689
movq %r12, %rcx
movq %rbp, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
incq %r13
addq $0x70, %rbx
jmp 0x1ad47
movq 0x78(%rsp), %rcx
movl %eax, 0x80(%rcx)
movq 0x90(%rsp), %rcx
incq %rcx
movq 0x88(%rsp), %r13
movq 0x80(%rsp), %rbx
jmp 0x1acee
xorl %eax, %eax
testl %ebx, %ebx
cmovlel %eax, %ebx
imulq $0x160, %rbx, %rcx      # imm = 0x160
cmpq %rax, %rcx
je 0x1adef
andq $0x0, 0x18(%r13,%rax)
andq $0x0, 0x58(%r13,%rax)
andl $0x0, 0x80(%r13,%rax)
addq $0x160, %rax            # imm = 0x160
jmp 0x1adcd
imulq $0x160, %rbx, %rax      # imm = 0x160
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x1ae36
orl $-0x1, 0x30(%r13,%rcx)
andq $0x0, 0xa0(%r13,%rcx)
andq $0x0, 0x20(%r13,%rcx)
andl $0x0, 0x130(%r13,%rcx)
andl $0x0, 0x60(%r13,%rcx)
andq $0x0, 0x70(%r13,%rcx)
andq $0x0, 0x50(%r13,%rcx)
addq $0x160, %rcx            # imm = 0x160
jmp 0x1adf8
movq %r13, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq