LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: find_parents
int* find_parents(bayesiangraphptr mygraph, int node)
{
 /*!Last changed 15.01.2001*/
 int i = 0, where, *result = NULL;
 where = mygraph->nodes[node].pointer;
 while (where != -1)
  {
   i++;
   result = alloc(result, i * sizeof(int), i);
   result[i - 1] = mygraph->dest[where];
   where = mygraph->arcs[where].pointer;
  }
 return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
movslq %esi, %rcx
leaq (%rcx,%rcx,8), %rcx
movl 0x30(%rax,%rcx,8), %r15d
cmpl $-0x1, %r15d
je 0x4d133
movq %rdi, %rbx
movl $0x4, %r14d
movl $0x1, %ebp
xorl %eax, %eax
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x390c8
movq 0x28(%rbx), %rcx
movslq %r15d, %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, -0x4(%rax,%r14)
movq 0x18(%rbx), %rcx
movl (%rcx,%rdx,4), %r15d
addq $0x4, %r14
incl %ebp
cmpl $-0x1, %r15d
jne 0x4d101
jmp 0x4d135
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: parent_index
int parent_index(bayesiangraphptr mygraph, int node, int pindex)
{
 int i = 0, where;
 where = mygraph->nodes[node].pointer;
 while (i < pindex)
  {
   i++;
   where = mygraph->arcs[where].pointer;
  }
 return mygraph->dest[where];
}

// Assembly:
movq 0x8(%rdi), %rax
movslq %esi, %rcx
leaq (%rcx,%rcx,8), %rcx
movl 0x30(%rax,%rcx,8), %eax
testl %edx, %edx
jle 0x4d160
movq 0x18(%rdi), %rcx
cltq
movl (%rcx,%rax,4), %eax
decl %edx
jne 0x4d157
movq 0x28(%rdi), %rcx
cltq
movl (%rcx,%rax,4), %eax
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: add_one_node
nodeptr add_one_node(bayesiangraphptr mygraph, char *st)
{
/*!Last Changed 15.01.2001*/
 nodeptr current;
 mygraph->nodecount++;
 mygraph->nodes = alloc(mygraph->nodes, mygraph->nodecount * sizeof(struct node), mygraph->nodecount);
 current = &(mygraph->nodes[mygraph->nodecount - 1]);
 current->value_count = 0;
 current->parents = 0;
 current->table_count = 1;
 current->pointer = -1;
 current->name = strcopy(current->name, st);
 return current;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x10(%rdi), %rax
leaq 0x1(%rax), %rdx
movl %edx, 0x10(%rdi)
movq 0x8(%rdi), %rdi
leaq 0x8(,%rax,8), %rax
leaq (%rax,%rax,8), %rsi
callq 0x390c8
movq %rax, 0x8(%r14)
movslq 0x10(%r14), %rcx
leaq (%rcx,%rcx,8), %rcx
leaq (%rax,%rcx,8), %r14
addq $-0x48, %r14
xorl %eax, %eax
movl %eax, 0x10(%r14)
movl %eax, 0x20(%r14)
movq $0x1, 0x28(%r14)
movl $0xffffffff, 0x30(%r14) # imm = 0xFFFFFFFF
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3a404
movq %rax, (%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: find_arc_with_no
int find_arc_with_no(bayesiangraphptr mygraph, int arc_no, int *from, int *to, int *from_order, int *before)
{
/*!Last Changed 25.02.2001*/
 int i, pos1;
 for (i = 0; i < mygraph->nodecount; i++)
  {
   pos1 = mygraph->nodes[i].pointer;
   if (pos1 == -1)
     continue;
   *from_order = 0;
   *before = -1;
   if (pos1 == arc_no)
    {
     *to = i;
     *from = mygraph->dest[arc_no];
     return arc_no;
    }
   else
     while (mygraph->arcs[pos1].pointer != -1)
      {
       (*from_order)++;
       *before = pos1;
       if (mygraph->arcs[pos1].pointer == arc_no)
        {
         *from = mygraph->dest[arc_no];
         *to = i;
         return pos1;
        }
       pos1 = mygraph->arcs[pos1].pointer;
      }
  }
 return -1;
}

// Assembly:
cmpl $0x0, 0x10(%rdi)
jle 0x4d254
pushq %r14
pushq %rbx
movl %esi, %eax
movq 0x8(%rdi), %r10
xorl %esi, %esi
leaq (%rsi,%rsi,8), %r11
movl 0x30(%r10,%r11,8), %ebx
cmpl $-0x1, %ebx
je 0x4d22d
movl $0x0, (%r8)
movl $0xffffffff, (%r9)      # imm = 0xFFFFFFFF
cmpl %eax, %ebx
je 0x4d25a
movq 0x18(%rdi), %r14
movl %ebx, %r11d
movslq %ebx, %rbx
cmpl $-0x1, (%r14,%rbx,4)
je 0x4d22d
incl (%r8)
movl %ebx, (%r9)
movl (%r14,%rbx,4), %ebx
cmpl %eax, %ebx
jne 0x4d210
jmp 0x4d240
incq %rsi
movslq 0x10(%rdi), %r11
cmpq %r11, %rsi
jl 0x4d1ec
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4d250
movq 0x28(%rdi), %rdi
cltq
movl (%rdi,%rax,4), %eax
movl %eax, (%rdx)
movl %esi, (%rcx)
movl %r11d, %eax
popq %rbx
popq %r14
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
movl %esi, (%rcx)
movq 0x28(%rdi), %rcx
movslq %eax, %rsi
movl (%rcx,%rsi,4), %ecx
movl %ecx, (%rdx)
jmp 0x4d250
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: modify_one_arc
void modify_one_arc(bayesiangraphptr G, int arc_no, int *from, int *to, int *from_order)
{
 /*!Last Changed 25.02.2001*/
 int before = -1;
 find_arc_with_no(G, arc_no, from, to, from_order, &before);
 if (before == -1)
   G->nodes[*to].pointer = G->arcs[arc_no].pointer;
 else
   G->arcs[before].pointer = G->arcs[arc_no].pointer;
 before = G->nodes[*from].pointer;
 if (before == -1)
   G->nodes[*from].pointer = arc_no;
 else
  {
   while (G->arcs[before].pointer != -1)
     before = G->arcs[before].pointer;
   G->arcs[before].pointer = arc_no;
  }
 G->arcs[arc_no].pointer = -1;
 G->dest[arc_no] = *to;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r14
leaq 0xc(%rsp), %r12
movl $0xffffffff, (%r12)     # imm = 0xFFFFFFFF
movq %r12, %r9
callq 0x4d1db
movslq (%r12), %rdx
movq 0x18(%r14), %rsi
movslq %ebp, %rax
movl (%rsi,%rax,4), %ecx
cmpq $-0x1, %rdx
je 0x4d2af
movl %ecx, (%rsi,%rdx,4)
jmp 0x4d2be
movq 0x8(%r14), %rdx
movslq (%rbx), %rsi
leaq (%rsi,%rsi,8), %rsi
movl %ecx, 0x30(%rdx,%rsi,8)
movq 0x8(%r14), %rcx
movslq (%r15), %rdx
leaq (%rdx,%rdx,8), %rdx
movl 0x30(%rcx,%rdx,8), %esi
movl %esi, 0xc(%rsp)
cmpl $-0x1, %esi
je 0x4d2f2
movq 0x18(%r14), %rcx
movl 0xc(%rsp), %edx
movslq %edx, %rsi
movl (%rcx,%rsi,4), %edx
cmpl $-0x1, %edx
jne 0x4d2de
movl %esi, 0xc(%rsp)
movl %ebp, (%rcx,%rsi,4)
jmp 0x4d2fc
leaq (%rcx,%rdx,8), %rcx
addq $0x30, %rcx
movl %ebp, (%rcx)
movq 0x18(%r14), %rcx
movl $0xffffffff, (%rcx,%rax,4) # imm = 0xFFFFFFFF
movl (%rbx), %ecx
movq 0x28(%r14), %rdx
movl %ecx, (%rdx,%rax,4)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: delete_one_arc
void delete_one_arc(bayesiangraphptr mygraph, int arc_no, int *from, int *to, int *from_order)
{
 /*!Last Changed 07.03.2001*/
 int i, dummy;
/*Once silinecek arcin yeri bulunuyor ve ondan sonra gelen parentlarin yerleri bir one aliniyor*/
 find_arc_with_no(mygraph, arc_no, from, to, from_order, &dummy);
 if (mygraph->nodes[*to].pointer == arc_no)
   mygraph->nodes[*to].pointer = mygraph->arcs[arc_no].pointer;
 else
   mygraph->arcs[dummy].pointer = mygraph->arcs[arc_no].pointer;
/*Silinecek arcdan sonrakileri teker teker kaydir*/
 for (i = arc_no; i < mygraph->arccount - 1; i++)
  {
   mygraph->arcs[i].pointer = mygraph->arcs[i + 1].pointer;
   mygraph->dest[i] = mygraph->dest[i + 1];
  }
/*Silinecek arcdan daha yuksek arc numarasi olanlarin arc numarasini bir azalt*/
 for (i = 0; i < mygraph->nodecount; i++)
   if (mygraph->nodes[i].pointer > arc_no)
     mygraph->nodes[i].pointer--;
 for (i = 0; i < mygraph->arccount; i++)
   if (mygraph->arcs[i].pointer > arc_no)
     mygraph->arcs[i].pointer--;
/*Arc ve desti yeniden realloc et*/
 mygraph->arccount--;
 mygraph->arcs = alloc(mygraph->arcs, mygraph->arccount * sizeof(struct arc), mygraph->arccount);
 mygraph->dest = alloc(mygraph->dest, mygraph->arccount * sizeof(int), mygraph->arccount);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movl %esi, %ebp
movq %rdi, %rbx
leaq 0xc(%rsp), %r9
callq 0x4d1db
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
movslq (%r14), %rdx
leaq (%rdx,%rdx,8), %rdi
movslq %ebp, %rsi
movl (%rcx,%rsi,4), %edx
cmpl %ebp, 0x30(%rax,%rdi,8)
jne 0x4d35e
leaq (%rax,%rdi,8), %rcx
addq $0x30, %rcx
movl %edx, (%rcx)
jmp 0x4d366
movslq 0xc(%rsp), %rdi
movl %edx, (%rcx,%rdi,4)
movl 0x20(%rbx), %edx
leal -0x1(%rdx), %ecx
cmpl %ebp, %ecx
jle 0x4d39c
movq 0x18(%rbx), %rdi
movq 0x28(%rbx), %r8
movl 0x4(%rdi,%rsi,4), %ecx
movl %ecx, (%rdi,%rsi,4)
movl 0x4(%r8,%rsi,4), %ecx
movl %ecx, (%r8,%rsi,4)
leaq 0x1(%rsi), %r9
movslq 0x20(%rbx), %rdx
leaq -0x1(%rdx), %rcx
movq %r9, %rsi
cmpq %rcx, %r9
jl 0x4d378
movslq 0x10(%rbx), %rsi
testq %rsi, %rsi
jle 0x4d3ca
shlq $0x3, %rsi
leaq (%rsi,%rsi,8), %rsi
xorl %edi, %edi
movl 0x30(%rax,%rdi), %r8d
cmpl %ebp, %r8d
jle 0x4d3c1
decl %r8d
movl %r8d, 0x30(%rax,%rdi)
addq $0x48, %rdi
cmpq %rdi, %rsi
jne 0x4d3af
testl %edx, %edx
jle 0x4d3ea
movq 0x18(%rbx), %rax
movl %edx, %edx
xorl %esi, %esi
movl (%rax,%rsi,4), %edi
cmpl %ebp, %edi
jle 0x4d3e2
decl %edi
movl %edi, (%rax,%rsi,4)
incq %rsi
cmpq %rsi, %rdx
jne 0x4d3d6
movl %ecx, 0x20(%rbx)
movq 0x18(%rbx), %rdi
movslq %ecx, %rdx
leaq (,%rdx,4), %rsi
callq 0x390c8
movq %rax, 0x18(%rbx)
movq 0x28(%rbx), %rdi
movslq 0x20(%rbx), %rdx
movq %rdx, %rsi
shlq $0x2, %rsi
callq 0x390c8
movq %rax, 0x28(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: add_one_arc
Arcptr add_one_arc(bayesiangraphptr mygraph)
{
/*!Last Changed 25.02.2001*/
 mygraph->arccount++;
 mygraph->arcs = alloc(mygraph->arcs, mygraph->arccount * sizeof(struct arc), mygraph->arccount);
 mygraph->dest = alloc(mygraph->dest, mygraph->arccount * sizeof(int), mygraph->arccount);
 mygraph->arcs[mygraph->arccount - 1].pointer = -1;
 return &mygraph->arcs[mygraph->arccount - 1];
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movslq 0x20(%rdi), %rax
leaq 0x1(%rax), %rdx
movl %edx, 0x20(%rdi)
movq 0x18(%rdi), %rdi
leaq 0x4(,%rax,4), %rsi
callq 0x390c8
movq %rax, 0x18(%rbx)
movq 0x28(%rbx), %rdi
movslq 0x20(%rbx), %rdx
movq %rdx, %rsi
shlq $0x2, %rsi
callq 0x390c8
movq %rax, 0x28(%rbx)
movq 0x18(%rbx), %rax
movslq 0x20(%rbx), %rcx
leaq (%rax,%rcx,4), %rax
addq $-0x4, %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: add_one_pointer
void add_one_pointer(bayesiangraphptr mygraph, nodeptr src, int dest)
{
 /*!Last Changed 23.12.2000*/
 int where;
 if (src->pointer == -1)
   src->pointer = mygraph->arccount - 1;
 else
  {
   where = src->pointer;
   while (mygraph->arcs[where].pointer != -1)
     where = mygraph->arcs[where].pointer;
   mygraph->arcs[where].pointer = mygraph->arccount - 1;
  }
 mygraph->dest[mygraph->arccount - 1] = dest;
}

// Assembly:
movl 0x30(%rsi), %ecx
cmpl $-0x1, %ecx
je 0x4d49b
movq 0x18(%rdi), %rax
movslq %ecx, %rsi
movl (%rax,%rsi,4), %ecx
cmpl $-0x1, %ecx
jne 0x4d486
movl 0x20(%rdi), %ecx
decl %ecx
movl %ecx, (%rax,%rsi,4)
jmp 0x4d4a3
movl 0x20(%rdi), %eax
decl %eax
movl %eax, 0x30(%rsi)
movq 0x28(%rdi), %rax
movslq 0x20(%rdi), %rcx
movl %edx, -0x4(%rax,%rcx,4)
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: delete_parent_counts
void delete_parent_counts(nodeptr Node, int parent_order)
{ /*Delete one parent from the parent_counts array*/
/*!Last Changed 25.02.2001*/
 int i;
 Node->table_count/=Node->parent_counts[parent_order];
 for (i=parent_order;i<Node->parents-1;i++)
   Node->parent_counts[i]=Node->parent_counts[i+1];
 Node->parents--;/*Yer kucultmede alloc yapma*/
 Node->parent_counts = alloc(Node->parent_counts, Node->parents * sizeof(int), Node->parents);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movslq %esi, %rcx
movslq (%rdi,%rcx,4), %rsi
movq 0x28(%rbx), %rax
cqto
idivq %rsi
movq %rax, 0x28(%rbx)
movl 0x20(%rbx), %eax
decl %eax
cmpl %ecx, %eax
jle 0x4d4ef
movl 0x4(%rdi,%rcx,4), %eax
movl %eax, (%rdi,%rcx,4)
leaq 0x1(%rcx), %rdx
movslq 0x20(%rbx), %rax
decq %rax
movq %rdx, %rcx
cmpq %rax, %rdx
jl 0x4d4d5
movl %eax, 0x20(%rbx)
movslq %eax, %rdx
leaq (,%rdx,4), %rsi
callq 0x390c8
movq %rax, 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: add_parent_counts
void add_parent_counts(bayesiangraphptr mygraph,nodeptr Node,int parent)
{ /*Add one parent in the parent_counts array*/
/*!Last Changed 23.12.2000*/
 Node->parents++;
 Node->parent_counts=alloc(Node->parent_counts,Node->parents*sizeof(int),Node->parents);
 Node->parent_counts[Node->parents-1]=mygraph->nodes[parent].value_count;
 Node->table_count*=mygraph->nodes[parent].value_count;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movslq 0x20(%rsi), %rax
leaq 0x1(%rax), %rdx
movl %edx, 0x20(%rsi)
movq 0x18(%rsi), %rdi
leaq 0x4(,%rax,4), %rsi
callq 0x390c8
movq %rax, 0x18(%r14)
movq 0x8(%r15), %rcx
movslq %ebx, %rdx
leaq (%rdx,%rdx,8), %rdx
movl 0x10(%rcx,%rdx,8), %esi
movslq 0x20(%r14), %rdi
movl %esi, -0x4(%rax,%rdi,4)
movslq 0x10(%rcx,%rdx,8), %rax
imulq 0x28(%r14), %rax
movq %rax, 0x28(%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: add_one_value
void add_one_value(nodeptr current,char *st)
{/*Verilmis bir node a bir deger ekliyor*/
/*!Last Changed 15.01.2001*/
 current->value_count++;
 current->values=alloc(current->values,current->value_count*sizeof(char *),current->value_count);
 current->values[current->value_count-1]=strcopy(current->values[current->value_count-1],st);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x10(%rdi), %rax
leaq 0x1(%rax), %rdx
movl %edx, 0x10(%rdi)
movq 0x8(%rdi), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x390c8
movq %rax, 0x8(%r14)
movslq 0x10(%r14), %rcx
movq -0x8(%rax,%rcx,8), %rdi
movq %rbx, %rsi
callq 0x3a404
movq 0x8(%r14), %rcx
movslq 0x10(%r14), %rdx
movq %rax, -0x8(%rcx,%rdx,8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: find_parent_order
int find_parent_order(bayesiangraphptr G,int parent,int node)
{
/* parentin nodeun kacinci parenti olduguna doner,
   eger parent bulunamazsa -1 e doner */
/*!Last Changed 03.01.2001*/
 int where=G->nodes[node].pointer,order=-1;
 while (where!=-1)
  {
   order++;
   if (G->dest[where]==parent)
     return order;
   where=G->arcs[where].pointer;
  }
 return -1;
}

// Assembly:
movq 0x8(%rdi), %rax
movslq %edx, %rcx
leaq (%rcx,%rcx,8), %rcx
movl 0x30(%rax,%rcx,8), %r8d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $-0x1, %r8d
je 0x4d616
movq 0x28(%rdi), %rdx
xorl %ecx, %ecx
movslq %r8d, %r8
cmpl %esi, (%rdx,%r8,4)
je 0x4d617
movq 0x18(%rdi), %r9
movl (%r9,%r8,4), %r8d
incl %ecx
cmpl $-0x1, %r8d
jne 0x4d5fd
retq
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: find_arc_no
int find_arc_no(bayesiangraphptr G,int from, int to, int *arc_no, int *before)
{
/* eger belirtilen arc yoksa 0 a varsa 1 e donsun....*/
/* arc_no from-->to arcinin numarasi, before bundan bir oncekinin numarasi*/
/*!Last Changed 03.01.2001*/
 *before = -1;
 if ((to<0)||(to>=G->nodecount))
   return 0;
 if ((from<0)||(from>=G->nodecount))
   return 0;
 *arc_no=G->nodes[to].pointer;
 while ((*arc_no!=-1)&&(G->dest[*arc_no]!=from))
  {
   *before=*arc_no;
   *arc_no=G->arcs[*arc_no].pointer;
  }
 if (*arc_no==-1)
   return 0;
 else
   return 1;
}

// Assembly:
movl $0xffffffff, (%r8)      # imm = 0xFFFFFFFF
xorl %eax, %eax
testl %edx, %edx
js 0x4d689
movl 0x10(%rdi), %r9d
cmpl %edx, %r9d
jle 0x4d689
testl %esi, %esi
sets %r10b
cmpl %esi, %r9d
setle %r9b
orb %r10b, %r9b
jne 0x4d689
movq 0x8(%rdi), %rax
movl %edx, %edx
leaq (%rdx,%rdx,8), %rdx
movslq 0x30(%rax,%rdx,8), %rax
movl %eax, (%rcx)
cmpq $-0x1, %rax
setne %r9b
je 0x4d685
movq 0x28(%rdi), %rdx
cmpl %esi, (%rdx,%rax,4)
je 0x4d685
movq 0x18(%rdi), %rdi
movl %eax, (%r8)
movslq (%rcx), %rax
movslq (%rdi,%rax,4), %rax
movl %eax, (%rcx)
cmpq $-0x1, %rax
setne %r9b
je 0x4d685
cmpl %esi, (%rdx,%rax,4)
jne 0x4d66a
movzbl %r9b, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: create_graph
bayesiangraphptr create_graph(char *graph_name)
{
 /*!Last Changed 02.02.2004 added safemalloc*/
 /*!Last Changed 07.03.2001*/
 bayesiangraphptr result;
 result = (bayesiangraphptr)safemalloc(sizeof(bayesiangraph), "create_graph", 2);
 result->nodecount=0;
 result->arccount=0;
 result->ordering=NULL;
 result->independence=NULL;
 result->one_independence=NULL;
 result->name=strcopy(result->name,graph_name);
 return result;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x5a017(%rip), %rsi     # 0xa76af
movl $0x48, %edi
movl $0x2, %edx
callq 0x390f5
movq %rax, %r14
xorl %eax, %eax
movl %eax, 0x10(%r14)
movl %eax, 0x20(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r14)
movq $0x0, 0x40(%r14)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3a404
movq %rax, (%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: deallocate_graph
void deallocate_graph(bayesiangraphptr G)
{
 /*!Last Changed 07.03.2001*/
 int i;
 safe_free(G->name);
 for (i = 0; i < G->nodecount; i++)
  {
   safe_free(G->nodes[i].name);
			free_2d((void**)G->nodes[i].values, G->nodes[i].value_count);
   if (G->nodes[i].parents)
     safe_free(G->nodes[i].parent_counts);
			free_2d((void**)G->nodes[i].table, G->nodes[i].table_count);
  }
 if (G->independence!=NULL)
		 free_2d((void**)G->independence, G->nodecount);
 if (G->one_independence!=NULL)
		 free_3d((void***)G->one_independence, G->nodecount, G->nodecount);
 safe_free(G->dest);
 safe_free(G->arcs);
 safe_free(G->nodes);
 safe_free(G);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x39194
movl 0x10(%rbx), %esi
testl %esi, %esi
jle 0x4d753
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x39194
movq 0x8(%rbx), %rax
movq 0x8(%rax,%r14), %rdi
movl 0x10(%rax,%r14), %esi
callq 0x3915f
movq 0x8(%rbx), %rax
cmpl $0x0, 0x20(%rax,%r14)
je 0x4d730
movq 0x18(%rax,%r14), %rdi
callq 0x39194
movq 0x8(%rbx), %rax
movq 0x38(%rax,%r14), %rdi
movl 0x28(%rax,%r14), %esi
callq 0x3915f
incq %r15
movslq 0x10(%rbx), %rsi
addq $0x48, %r14
cmpq %rsi, %r15
jl 0x4d6fa
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x4d761
callq 0x3915f
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x4d774
movl 0x10(%rbx), %edx
movl %edx, %esi
callq 0x39199
movq 0x28(%rbx), %rdi
callq 0x39194
movq 0x18(%rbx), %rdi
callq 0x39194
movq 0x8(%rbx), %rdi
callq 0x39194
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x39194
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: swap_independence
void swap_independence(double **result,int i,int j)
{
/*!Last Changed 11.02.2001*/
 double temp;
 int k;
 for (k=0;k<3;k++)
  {
   temp=result[i][k];
   result[i][k]=result[j][k];
   result[j][k]=temp;
  }
}

// Assembly:
movslq %esi, %rax
movq (%rdi,%rax,8), %rax
movslq %edx, %rcx
movq (%rdi,%rcx,8), %rcx
xorl %edx, %edx
movsd (%rax,%rdx,8), %xmm0
movsd (%rcx,%rdx,8), %xmm1
movsd %xmm1, (%rax,%rdx,8)
movsd %xmm0, (%rcx,%rdx,8)
incq %rdx
cmpq $0x3, %rdx
jne 0x4d7ac
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: qsort_independence
void qsort_independence(double **result,int left,int right)
{
/*!Last Changed 11.02.2001*/
 int i,last;
 if (left>=right)
   return;
 swap_independence(result,left,(left+right)/2);
 last=left;
 for (i=left+1;i<=right;i++)
   if (result[i][2]>result[left][2])
    {
     last++;
     swap_independence(result,last,i);
    }
 swap_independence(result,left,last);
 qsort_independence(result,left,last-1);
 qsort_independence(result,last+1,right);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
movslq %edx, %r15
cmpl %ebx, %esi
jge 0x4d8ab
leal (%rbx,%rsi), %eax
movl %eax, %edx
shrl $0x1f, %edx
addl %eax, %edx
sarl %edx
movslq %esi, %rcx
movq (%r14,%rcx,8), %rax
movslq %edx, %rdx
movq (%r14,%rdx,8), %rdx
xorl %edi, %edi
movsd (%rax,%rdi,8), %xmm0
movsd (%rdx,%rdi,8), %xmm1
movsd %xmm1, (%rax,%rdi,8)
movsd %xmm0, (%rdx,%rdi,8)
incq %rdi
cmpq $0x3, %rdi
jne 0x4d7fe
movl %esi, %r12d
cmpl %ebx, %esi
jge 0x4d86d
movl %esi, %r12d
movq 0x8(%r14,%rcx,8), %rdx
movsd 0x10(%rdx), %xmm0
ucomisd 0x10(%rax), %xmm0
jbe 0x4d865
movslq %r12d, %rdi
incl %r12d
movq 0x8(%r14,%rdi,8), %rdi
xorl %r8d, %r8d
movsd (%rdi,%r8,8), %xmm0
movsd (%rdx,%r8,8), %xmm1
movsd %xmm1, (%rdi,%r8,8)
movsd %xmm0, (%rdx,%r8,8)
incq %r8
cmpq $0x3, %r8
jne 0x4d844
incq %rcx
cmpq %r15, %rcx
jne 0x4d825
movslq %r12d, %rcx
movq (%r14,%rcx,8), %rcx
xorl %edx, %edx
movsd (%rax,%rdx,8), %xmm0
movsd (%rcx,%rdx,8), %xmm1
movsd %xmm1, (%rax,%rdx,8)
movsd %xmm0, (%rcx,%rdx,8)
incq %rdx
cmpq $0x3, %rdx
jne 0x4d876
leal -0x1(%r12), %edx
movq %r14, %rdi
callq 0x4d7ca
incl %r12d
movl %r12d, %esi
jmp 0x4d7da
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: sort_independence
double **sort_independence(bayesiangraphptr mygraph)
{
	/*!Last Changed 02.02.2004 added safemalloc*/
 /*!Last Changed 21.01.2001*/
 int total=(mygraph->nodecount)*(mygraph->nodecount-1)/2,i,j,k;
 double **result;
 result = (double **)safemalloc_2d(sizeof(double *), sizeof(double), total, 3, "sort_independence", 3);
 k=0;
 for (i=0;i<mygraph->nodecount;i++)
   for (j=i+1;j<mygraph->nodecount;j++)
    {
     result[k][0]=i;
     result[k][1]=j;
     result[k][2]=mygraph->independence[i][j];
     k++;
    }
 qsort_independence(result,0,total-1);
 return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movl 0x10(%rdi), %eax
leal -0x1(%rax), %ecx
imull %eax, %ecx
movl %ecx, %ebx
shrl $0x1f, %ebx
addl %ecx, %ebx
sarl %ebx
leaq 0x59dde(%rip), %r8      # 0xa76bc
movl $0x8, %r12d
movl $0x8, %edi
movl $0x8, %esi
movl %ebx, %edx
movl $0x3, %ecx
movl $0x3, %r9d
callq 0x393b5
movq %rax, %r15
movslq 0x10(%r14), %rax
testq %rax, %rax
jle 0x4d988
movq %rax, %rcx
negq %rcx
xorl %esi, %esi
movl $0x1, %edx
xorl %edi, %edi
movq %rsi, %r8
incq %rsi
cmpq %rax, %rsi
jae 0x4d97c
xorps %xmm0, %xmm0
cvtsi2sd %r8d, %xmm0
movq 0x30(%r14), %r9
movslq %edi, %r10
movq (%r9,%r8,8), %r8
addq %r12, %r8
leaq (%rcx,%rdx), %r9
leaq (%r15,%r10,8), %r11
xorl %r10d, %r10d
movq (%r11,%r10,8), %r13
movsd %xmm0, (%r13)
leal (%rdx,%r10), %ebp
xorps %xmm1, %xmm1
cvtsi2sd %ebp, %xmm1
movsd %xmm1, 0x8(%r13)
movsd (%r8,%r10,8), %xmm1
movsd %xmm1, 0x10(%r13)
incq %r10
movq %r9, %r13
addq %r10, %r13
jne 0x4d947
addl %r10d, %edi
incq %rdx
addq $0x8, %r12
cmpq %rax, %rsi
jne 0x4d91b
decl %ebx
movq %r15, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x4d7ca
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: cycle_now
int cycle_now(bayesiangraphptr mygraph,int from,int to)
{
/*!Last Changed 25.02.2001*/
/*Daha onceden fromdan toya bir arc vard. Bu arc yon degistirince cycle oluyor mu?*/
 int pos;
 pos=mygraph->nodes[to].pointer;
 while (pos!=-1)
  {
   if (from==mygraph->dest[pos])
     return 1;
   if (cycle_now(mygraph,from,mygraph->dest[pos]))
     return 1;
   pos=mygraph->arcs[pos].pointer;
  }
 return 0; 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x8(%rdi), %rax
movslq %edx, %rcx
leaq (%rcx,%rcx,8), %rcx
movl 0x30(%rax,%rcx,8), %eax
cmpl $-0x1, %eax
je 0x4d9f8
movl %esi, %ebx
movq %rdi, %r14
movq 0x28(%rdi), %r15
movl $0x1, %ebp
movslq %eax, %r12
movl (%r15,%r12,4), %edx
cmpl %ebx, %edx
je 0x4d9fa
movq %r14, %rdi
movl %ebx, %esi
callq 0x4d9a8
testl %eax, %eax
jne 0x4d9fa
movq 0x18(%r14), %rax
movl (%rax,%r12,4), %eax
cmpl $-0x1, %eax
jne 0x4d9d2
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: add_arcs_according_to_ordering
void add_arcs_according_to_ordering(bayesiangraphptr mygraph,double **edges,int edgecount)
{
/*!Last Changed 13.03.2001*/
 int i,j,k;
 for (i = 0; i < edgecount; i++)
  {
   j = (int) edges[i][0];
   k = (int) edges[i][1];
   add_one_arc(mygraph);
   if (mygraph->ordering[j]>mygraph->ordering[k])
    {
     add_one_pointer(mygraph,&mygraph->nodes[j],k);
     add_parent_counts(mygraph,&mygraph->nodes[j],k);
    }
   else
    {
     add_one_pointer(mygraph,&mygraph->nodes[k],j);
     add_parent_counts(mygraph,&mygraph->nodes[k],j);
    }
  }
}

// Assembly:
testl %edx, %edx
jle 0x4e148
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl %edx, %r12d
xorl %r13d, %r13d
movq (%rbx,%r13,8), %rax
cvttsd2si (%rax), %ebp
cvttsd2si 0x8(%rax), %r15d
movq %r14, %rdi
callq 0x4d426
movq 0x40(%r14), %rdx
movslq %ebp, %rax
movl (%rdx,%rax,4), %esi
movslq %r15d, %rcx
cmpl (%rdx,%rcx,4), %esi
jle 0x4e0c3
movq 0x8(%r14), %rcx
leaq (%rax,%rax,8), %rax
leaq (%rcx,%rax,8), %rsi
movl 0x30(%rsi), %ecx
cmpl $-0x1, %ecx
je 0x4e0f1
movq 0x18(%r14), %rax
movslq %ecx, %rdx
movl (%rax,%rdx,4), %ecx
cmpl $-0x1, %ecx
jne 0x4e0ad
movl 0x20(%r14), %ecx
decl %ecx
movl %ecx, (%rax,%rdx,4)
jmp 0x4e0fa
movq 0x8(%r14), %rax
leaq (%rcx,%rcx,8), %rcx
leaq (%rax,%rcx,8), %rsi
movl 0x30(%rsi), %ecx
cmpl $-0x1, %ecx
je 0x4e10f
movq 0x18(%r14), %rax
movslq %ecx, %rdx
movl (%rax,%rdx,4), %ecx
cmpl $-0x1, %ecx
jne 0x4e0db
movl 0x20(%r14), %ecx
decl %ecx
movl %ecx, (%rax,%rdx,4)
jmp 0x4e118
movl 0x20(%r14), %eax
decl %eax
movl %eax, 0x30(%rsi)
movq 0x28(%r14), %rax
movslq 0x20(%r14), %rcx
movl %r15d, -0x4(%rax,%rcx,4)
movq %r14, %rdi
movl %r15d, %edx
jmp 0x4e129
movl 0x20(%r14), %eax
decl %eax
movl %eax, 0x30(%rsi)
movq 0x28(%r14), %rax
movslq 0x20(%r14), %rcx
movl %ebp, -0x4(%rax,%rcx,4)
movq %r14, %rdi
movl %ebp, %edx
callq 0x4d508
incq %r13
cmpq %r12, %r13
jne 0x4e06d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: load_network
void load_network(char *filename)
{
 int i = net_extension(filename);
 bayesiangraphptr newnetwork = NULL;
 switch (i)
  {
   case NET_FILE  :newnetwork = (bayesiangraphptr)read_network_net(filename);
                   break;
   case XML_FILE  :newnetwork = (bayesiangraphptr)read_network_xml(filename);
                   break;
   case HUGIN_FILE:newnetwork = (bayesiangraphptr)read_network_hugin(filename);
                   break;
   case BIF_FILE  :newnetwork = (bayesiangraphptr)read_network_bif(filename);
                   break;
 };
 if (newnetwork==NULL)
  {
   printf(m1044);
   return;
  }
 add_network(newnetwork);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x381e3
cmpl $0x3, %eax
ja 0x4e72f
movl %eax, %eax
leaq 0x58fce(%rip), %rcx     # 0xa767c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x704d5
jmp 0x4e6dd
movq %rbx, %rdi
callq 0x6fa08
jmp 0x4e6dd
movq %rbx, %rdi
callq 0x6f4c8
jmp 0x4e6dd
movq %rbx, %rdi
callq 0x6fd3a
movq %rax, %rbx
testq %rbx, %rbx
je 0x4e71e
leaq 0x83e14(%rip), %r14     # 0xd2500
movslq (%r14), %rax
leaq 0x1(%rax), %rdx
movl %edx, (%r14)
leaq 0x2e676b(%rip), %r15    # 0x334e68
movq (%r15), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x390c8
movq %rax, (%r15)
movslq (%r14), %rcx
movq %rbx, -0x8(%rax,%rcx,8)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x58ff5(%rip), %rdi     # 0xa771a
popq %rbx
popq %r14
popq %r15
jmp 0x4090
xorl %ebx, %ebx
jmp 0x4e6e0
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: print_independences
void print_independences(void (*print)(bayesiangraphptr mygraph), char* networkname)
{
 bayesiangraphptr G;
 if (networkname)
  {
   G = find_network(networkname);
   if (G)
     print(G);
   else
     printf(m1273, networkname);
  }
 else
   printf(m1020);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x4e75e
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x4e789
testq %rax, %rax
je 0x4e771
movq %rax, %rdi
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
leaq 0x58fcf(%rip), %rdi     # 0xa7734
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4090
leaq 0x58f7c(%rip), %rdi     # 0xa76f4
movq %rbx, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4030
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/network.c
// Function: learn_network
void learn_network(char *graph_name, char *train_file, char *cv_file, char *test_file, int algorithm)
{
 bayesiangraphptr newnetwork;
 switch (algorithm){
   case 0:newnetwork = (bayesiangraphptr)simulated_annealing_bn(graph_name, train_file, cv_file, test_file, get_parameter_l("ordering"), get_parameter_f("infthreshold"));
          break;
   case 1:newnetwork = (bayesiangraphptr)k2_bn(graph_name, train_file, cv_file, test_file, get_parameter_l("ordering"), 2);
          break;
 }
 if (newnetwork)
   add_network(newnetwork);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
cmpl $0x1, %r8d
je 0x4e82e
testl %r8d, %r8d
jne 0x4e857
leaq 0x59245(%rip), %rdi     # 0xa7a4a
callq 0x535f7
movl %eax, %ebp
leaq 0x58efa(%rip), %rdi     # 0xa770d
callq 0x534b6
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movl %ebp, %r8d
callq 0x8da50
jmp 0x4e854
leaq 0x59215(%rip), %rdi     # 0xa7a4a
callq 0x535f7
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movl %eax, %r8d
movl $0x2, %r9d
callq 0x8db47
movq %rax, %r12
testq %r12, %r12
je 0x4e88e
leaq 0x83c9d(%rip), %rbx     # 0xd2500
movslq (%rbx), %rax
leaq 0x1(%rax), %rdx
movl %edx, (%rbx)
leaq 0x2e65f5(%rip), %r14    # 0x334e68
movq (%r14), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x390c8
movq %rax, (%r14)
movslq (%rbx), %rcx
movq %r12, -0x8(%rax,%rcx,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/nodeboundedtree.c
// Function: prune_node_bounded_tree_nodes
void prune_node_bounded_tree_nodes(Decisionnodeptr root, Decisionnodeptr toberemoved, Nodeboundedtree_parameterptr param, Decisionnodeptr* nodes, double* generalizationerror, int* index, int datasize)
{
 /*!Last Changed 30.09.2007*/
 int tmp, h;
 double error;
 if (toberemoved->featureno == LEAF_NODE)
   return;
 (*index)++;
 nodes[*index] = toberemoved;
 tmp = toberemoved->featureno;
 toberemoved->featureno = LEAF_NODE;
 error = decisiontree_falsepositive_count(root) / (datasize + 0.0);
 h = decisiontree_vc_dimension_wrt_nodetype(current_dataset, decisiontree_node_count(root), param->model - 5);
 generalizationerror[*index] = srm_classification(error, h, datasize, param->a1, param->a2);
 toberemoved->featureno = tmp;
 prune_node_bounded_tree_nodes(root, toberemoved->left, param, nodes, generalizationerror, index, datasize);
 prune_node_bounded_tree_nodes(root, toberemoved->right, param, nodes, generalizationerror, index, datasize);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %rbx
movq %r8, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
cvtsi2sdl 0x70(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x20(%rsp), %r15
cmpl $-0x1, 0x30(%r13)
je 0x4e998
movslq (%rbx), %rax
leaq 0x1(%rax), %rcx
movl %ecx, (%rbx)
movq %r13, 0x8(%r15,%rax,8)
movl 0x30(%r13), %eax
movl %eax, 0x14(%rsp)
movl $0xffffffff, 0x30(%r13) # imm = 0xFFFFFFFF
movq %rbp, %rdi
callq 0x1c3b2
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
leaq 0x83f50(%rip), %rax     # 0xd2870
movq (%rax), %r14
movq %rbp, %rdi
callq 0x1c583
movl 0x8(%r12), %edx
addl $-0x5, %edx
movq %r14, %rdi
movl %eax, %esi
callq 0xa0337
movsd 0x18(%r12), %xmm1
movsd 0x20(%r12), %xmm2
movsd 0x30(%rsp), %xmm0
movl %eax, %edi
movl 0x70(%rsp), %r14d
movl %r14d, %esi
callq 0x475c7
movslq (%rbx), %rax
movq 0x28(%rsp), %r8
movsd %xmm0, (%r8,%rax,8)
movl 0x14(%rsp), %eax
movl %eax, 0x30(%r13)
movq (%r13), %rsi
movl %r14d, (%rsp)
movq %rbp, %rdi
movq %r12, %rdx
movq %r15, %rcx
movq %rbx, %r9
callq 0x4e8a0
movq 0x8(%r13), %r13
jmp 0x4e8d5
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/nodeboundedtree.c
// Function: add_node_to_heap
void add_node_to_heap(Decisionnodeptr node, Node_expandedptr* list, int nodeindex)
{
 /*!Last Changed 11.07.2006*/
 Node_expandedptr newexpanded, tmp, tmpbefore = NULL;
 newexpanded = safemalloc(sizeof(Node_expanded), "add_node_to_expanded_list", 8);
 newexpanded->next = NULL;
 newexpanded->node = node;
 if (nodeindex == -1)
   newexpanded->value = -log_likelihood_for_classification(node->counts);
 else
   if (nodeindex == -2)
     newexpanded->value = -entropy(node->counts);
   else
     newexpanded->value = -nodeindex;
 if (!(*list))
   *list = newexpanded;
 else
  {
   tmp = *list;
   while (tmp && tmp->value > newexpanded->value)
    {
     tmpbefore = tmp;
     tmp = tmp->next;
    }
   if (tmpbefore)
    {
     newexpanded->next = tmpbefore->next;
     tmpbefore->next = newexpanded;
    }
   else
    {
     newexpanded->next = *list;
     *list = newexpanded;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x58c3a(%rip), %rsi     # 0xa7774
movl $0x18, %edi
movl $0x8, %edx
callq 0x390f5
movq %rax, %r14
movq $0x0, 0x10(%rax)
movq %r15, (%rax)
cmpl $-0x2, %ebp
je 0x4eb6f
cmpl $-0x1, %ebp
jne 0x4eb85
movq 0xa0(%r15), %rdi
callq 0x1d726
jmp 0x4eb7b
movq 0xa0(%r15), %rdi
callq 0x1d411
xorpd 0x5464d(%rip), %xmm0    # 0xa31d0
jmp 0x4eb8b
negl %ebp
cvtsi2sd %ebp, %xmm0
movsd %xmm0, 0x8(%r14)
movq (%rbx), %rax
testq %rax, %rax
je 0x4ebdc
movsd 0x8(%r14), %xmm0
movsd 0x8(%rax), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x4ebc6
movq %rax, %rdx
movq %rdx, %rcx
movq 0x10(%rdx), %rdx
testq %rdx, %rdx
je 0x4ebc8
movsd 0x8(%rdx), %xmm1
ucomisd %xmm0, %xmm1
ja 0x4ebad
jmp 0x4ebc8
xorl %ecx, %ecx
testq %rcx, %rcx
je 0x4ebd8
movq 0x10(%rcx), %rax
addq $0x10, %rcx
movq %rcx, %rbx
movq %rax, 0x10(%r14)
movq %r14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/nodeboundedtree.c
// Function: add_node_to_expanded_list
int add_node_to_expanded_list(Decisionnodeptr node, Node_expandedptr* list, int nodeindex, int usediscrete)
{
 /*!Last Changed 01.07.2006 added nodeindex*/
 /*!Last Changed 19.03.2006*/
 if (!usediscrete)
   node->conditiontype = HYBRID_CONDITION;
 else
   node->conditiontype = UNIVARIATE_CONDITION;
 if (!can_be_divided(node, NULL))
  {
   make_leaf_node(node);
   return 0;
  }
 add_node_to_heap(node, list, nodeindex);
 return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
xorl %eax, %eax
testl %ecx, %ecx
sete %al
addl %eax, %eax
movl %eax, 0x98(%rdi)
xorl %r12d, %r12d
xorl %esi, %esi
callq 0x1c8e2
movq %r14, %rdi
testl %eax, %eax
je 0x4ec2c
movq %r15, %rsi
movl %ebx, %edx
callq 0x4eb24
movl $0x1, %r12d
jmp 0x4ec31
callq 0x1c39c
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/nodeboundedtree.c
// Function: empty_heap
void empty_heap(Node_expandedptr header)
{
 /*!Last Changed 01.07.2006*/
 Node_expandedptr nextexpanded;
 while (header)
  {
   nextexpanded = header->next;
   make_leaf_node(header->node);
   safe_free(header);
   header = nextexpanded;
  }
}

// Assembly:
testq %rdi, %rdi
je 0x4ec6f
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rbx), %rdi
movq 0x10(%rbx), %r14
callq 0x1c39c
movq %rbx, %rdi
callq 0x39194
movq %r14, %rbx
testq %r14, %r14
jne 0x4ec4c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/nodeboundedtree.c
// Function: create_binary_tree_according_model_string
Decisionnodeptr create_binary_tree_according_model_string(char* model)
{
 /*!Last Changed 11.07.2006*/
 Node_expandedptr header = NULL, nextexpanded;
 int nodeindex = 0;
 char ch;
 Decisionnodeptr rootnode, expanded_node, leftnode, rightnode;
 rootnode = createnewnode(NULL, 1);
 add_node_to_heap(rootnode, &header, nodeindex);
 nodeindex++;
 while (header)
  {
   nextexpanded = header->next;
   expanded_node = header->node;
   ch = model[-2 * (int) (header->value) + 1];
   safe_free(header);
   header = nextexpanded;
   expanded_node->featureno = DUMMY_MODEL;
   leftnode = createnewnode(expanded_node, 1);
   expanded_node->left = leftnode;
   rightnode = createnewnode(expanded_node, 1);
   expanded_node->right = rightnode; 
   switch (ch)
    {
     case '1':add_node_to_heap(leftnode, &header, nodeindex);
              nodeindex++;
              break;
     case '2':add_node_to_heap(leftnode, &header, nodeindex);
              nodeindex++;
              add_node_to_heap(rightnode, &header, nodeindex);
              nodeindex++;
              break;
    }
  }
 return rootnode;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r12
movq $0x0, (%r12)
movl $0x1, %r14d
xorl %edi, %edi
movl $0x1, %esi
callq 0x1c996
movq %rax, 0x10(%rsp)
movq %rax, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x4eb24
movq (%r12), %rdi
testq %rdi, %rdi
je 0x4ed61
movq (%rdi), %r15
movq 0x10(%rdi), %r13
cvttsd2si 0x8(%rdi), %eax
addl %eax, %eax
negl %eax
cltq
movzbl 0x1(%rbx,%rax), %r12d
callq 0x39194
movq %r13, 0x8(%rsp)
movl $0xfffffc18, 0x30(%r15) # imm = 0xFFFFFC18
movq %r15, %rdi
movl $0x1, %esi
callq 0x1c996
movq %rax, %r13
movq %rax, (%r15)
movq %r15, %rdi
movl $0x1, %esi
callq 0x1c996
movq %rax, 0x8(%r15)
cmpl $0x32, %r12d
je 0x4ed2e
cmpl $0x31, %r12d
jne 0x4ed57
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
movl %r14d, %edx
callq 0x4eb24
incl %r14d
jmp 0x4ed57
movq %rax, %rbp
movq %r13, %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
movl %r14d, %edx
callq 0x4eb24
leal 0x1(%r14), %edx
movq %rbp, %rdi
movq %r15, %rsi
callq 0x4eb24
addl $0x2, %r14d
movq 0x8(%rsp), %rdi
jmp 0x4ecb6
movq 0x10(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/omnivariaterule.c
// Function: write_nodetypes_rule
void write_nodetypes_rule(Ruleset r, char* st)
{
 /*!Last Changed 19.02.2005*/
 /*!Last Changed 24.01.2004*/
 Decisionruleptr tmprule;
 Decisionconditionptr tmpcondition;
 sprintf(st, "%s", "");
 tmprule = r.start;
 while (tmprule)
  {
   tmpcondition = tmprule->start;
   while (tmpcondition)
    {     
     if (tmpcondition->featureindex == LINEAR)
       sprintf(st, "%sL", st);
     else
       if (tmpcondition->featureindex == QUADRATIC)
         sprintf(st, "%sQ", st);
       else 
         if (tmpcondition->featureindex == UNIVARIATE)
           sprintf(st, "%sU", st);
         else
           if (tmpcondition->featureindex == DISCRETEMIX)
             sprintf(st, "%s%c", st, 'A' + tmpcondition->ksplit.featurecount - 1);
           else
             sprintf(st, "%sU", st);
     tmpcondition = tmpcondition->next;
    }
   sprintf(st, "%s-%d;", st, tmprule->classno);
   tmprule = tmprule->next;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movb $0x0, (%rdi)
movq 0x40(%rsp), %r14
testq %r14, %r14
je 0x4f3fd
movq %rdi, %rbx
leaq 0x584ae(%rip), %r15     # 0xa7814
leaq 0x58487(%rip), %r12     # 0xa77f4
leaq 0x58498(%rip), %rbp     # 0xa780c
movq 0x18(%r14), %r13
testq %r13, %r13
je 0x4f3d9
movl (%r13), %eax
addl $0x5, %eax
cmpl $0x5, %eax
ja 0x4f392
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movq %rbx, %rdi
movq %r15, %rsi
jmp 0x4f3c9
movq %rbx, %rdi
leaq 0x5846c(%rip), %rsi     # 0xa7810
jmp 0x4f3c9
movl 0x50(%r13), %ecx
addl $0x40, %ecx
movq %rbx, %rdi
leaq 0x54215(%rip), %rsi     # 0xa35cc
movq %rbx, %rdx
xorl %eax, %eax
callq 0x41b0
jmp 0x4f3d3
movq %rbx, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x41b0
movq 0x48(%r13), %r13
jmp 0x4f378
movl (%r14), %ecx
movq %rbx, %rdi
leaq 0x58432(%rip), %rsi     # 0xa7818
movq %rbx, %rdx
xorl %eax, %eax
callq 0x41b0
movq 0x30(%r14), %r14
testq %r14, %r14
jne 0x4f374
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/omnivariaterule.c
// Function: write_datasizes_and_nodetypes_rule
void write_datasizes_and_nodetypes_rule(Ruleset r, char* st)
{
 /*!Last Changed 19.02.2005*/
 /*!Last Changed 24.01.2004*/
 Decisionruleptr tmprule;
 Decisionconditionptr tmpcondition;
 sprintf(st, "%s", "");
 tmprule = r.start;
 while (tmprule)
  {
   tmpcondition = tmprule->start;
   while (tmpcondition)
    {
     sprintf(st,"%s-%d,",st,tmpcondition->datasize);
     if (tmpcondition->featureindex == LINEAR)
       sprintf(st,"%sL",st);
     else 
       if (tmpcondition->featureindex == QUADRATIC)         
         sprintf(st,"%sQ",st);
       else
         sprintf(st,"%sU",st);
     tmpcondition = tmpcondition->next;
    }
   sprintf(st,"%s;",st);
   tmprule = tmprule->next;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movb $0x0, (%rdi)
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x4f4b3
movq %rdi, %rbx
leaq 0x583ed(%rip), %r15     # 0xa781f
leaq 0x583d7(%rip), %r13     # 0xa7810
leaq 0x583d4(%rip), %rbp     # 0xa7814
leaq 0x583c5(%rip), %r14     # 0xa780c
movq %rax, (%rsp)
movq 0x18(%rax), %r12
testq %r12, %r12
je 0x4f492
movl 0x38(%r12), %ecx
movq %rbx, %rdi
movq %r15, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x41b0
movl (%r12), %eax
cmpl $-0x3, %eax
movq %rbp, %rsi
cmoveq %r13, %rsi
cmpl $-0x2, %eax
cmoveq %r14, %rsi
movq %rbx, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x41b0
movq 0x48(%r12), %r12
jmp 0x4f44f
movq %rbx, %rdi
leaq 0x5838a(%rip), %rsi     # 0xa7826
movq %rbx, %rdx
xorl %eax, %eax
callq 0x41b0
movq (%rsp), %rax
movq 0x30(%rax), %rax
testq %rax, %rax
jne 0x4f447
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/omnivariaterule.c
// Function: log_likelihood_for_rule_induction
double log_likelihood_for_rule_induction(int poscount, int negcount)
{
 /*!Last Changed 20.02.2005*/
 int sum;
 double ratio;
 sum = poscount + negcount;
 if (sum * poscount * negcount == 0)
   return 0;
 ratio = poscount / (sum + 0.0);
 return poscount * log2(ratio);
}

// Assembly:
leal (%rsi,%rdi), %eax
imull %edi, %esi
imull %eax, %esi
testl %esi, %esi
je 0x4f4f0
pushq %rax
cvtsi2sd %edi, %xmm0
movsd %xmm0, (%rsp)
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
callq 0x38e99
mulsd (%rsp), %xmm0
addq $0x8, %rsp
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/omnivariaterule.c
// Function: log_likelihood_of_condition
double log_likelihood_of_condition(Decisionconditionptr c, Instanceptr list, int positive, int* covered)
{
 /*!Last Changed 19.02.2005*/
 int poscovered = 0, negcovered = 0, posuncovered = 0, neguncovered = 0, classno;
 Instanceptr tmp;
 tmp = list;
 while (tmp)
  {
   classno = give_classno(tmp);
   if (condition_cover_instance(tmp, c))
     if (classno == positive)
       poscovered++;
     else
       negcovered++;
   else
     if (classno == positive)
       posuncovered++;
     else
       neguncovered++;
   tmp = tmp->next;
  }
 *covered = poscovered + posuncovered;
 return log_likelihood_for_rule_induction(poscovered, negcovered) + log_likelihood_for_rule_induction(posuncovered, neguncovered);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
testq %rsi, %rsi
je 0x4f57a
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
xorl %r13d, %r13d
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x2eaca
movl %eax, %r12d
movq %r14, %rdi
movq %r15, %rsi
callq 0x795f2
testl %eax, %eax
je 0x4f54e
cmpl %ebp, %r12d
jne 0x4f561
incl %r13d
jmp 0x4f56f
cmpl %ebp, %r12d
jne 0x4f565
movq 0x8(%rsp), %rax
incl %eax
movq %rax, 0x8(%rsp)
jmp 0x4f56f
incl %ebx
jmp 0x4f56f
movq (%rsp), %rax
incl %eax
movq %rax, (%rsp)
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0x4f52a
jmp 0x4f590
xorl %ebx, %ebx
movq $0x0, 0x8(%rsp)
movq $0x0, (%rsp)
xorl %r13d, %r13d
movq 0x8(%rsp), %r14
leal (%r14,%r13), %eax
movq 0x10(%rsp), %rcx
movl %eax, (%rcx)
leal (%rbx,%r13), %eax
imull %r13d, %ebx
imull %eax, %ebx
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
testl %ebx, %ebx
je 0x4f5e3
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
movsd %xmm0, 0x10(%rsp)
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
callq 0x38e99
movapd %xmm0, %xmm1
xorpd %xmm0, %xmm0
mulsd 0x10(%rsp), %xmm1
movq (%rsp), %rcx
leal (%rcx,%r14), %eax
imull %r14d, %ecx
imull %eax, %ecx
testl %ecx, %ecx
je 0x4f624
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
movsd %xmm0, (%rsp)
movsd %xmm1, 0x8(%rsp)
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
callq 0x38e99
movsd 0x8(%rsp), %xmm1
mulsd (%rsp), %xmm0
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/omnivariaterule.c
// Function: log_likelihood_of_rule
double log_likelihood_of_rule(Decisionruleptr c, Instanceptr list, int* covered)
{
 /*!Last Changed 19.02.2005*/
 int poscovered = 0, negcovered = 0, posuncovered = 0, neguncovered = 0, classno;
 Instanceptr tmp;
 tmp = list;
 while (tmp)
  {
   classno = give_classno(tmp);
   if (rule_cover_instance(tmp, *c))
     if (classno == c->classno)
       poscovered++;
     else
       negcovered++;
   else
     if (classno == c->classno)
       posuncovered++;
     else
       neguncovered++;
   tmp = tmp->next;
  }
 *covered = poscovered + posuncovered;
 return log_likelihood_for_rule_induction(poscovered, negcovered) + log_likelihood_for_rule_induction(posuncovered, neguncovered);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, 0x40(%rsp)
testq %rsi, %rsi
je 0x4f6dd
movq %rsi, %r14
movq %rdi, %r15
xorl %ebx, %ebx
xorl %r13d, %r13d
movq $0x0, 0x38(%rsp)
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x2eaca
movl %eax, %ebp
movq 0x30(%r15), %rax
movq %rax, 0x30(%rsp)
movupd (%r15), %xmm0
movupd 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x20(%rsp)
movupd %xmm1, 0x10(%rsp)
movupd %xmm0, (%rsp)
movq %r14, %rdi
callq 0x7a0fc
movl (%r15), %ecx
testl %eax, %eax
je 0x4f6b8
cmpl %ecx, %ebp
jne 0x4f6ca
incl %ebx
jmp 0x4f6d2
cmpl %ecx, %ebp
jne 0x4f6cf
movq 0x38(%rsp), %rax
incl %eax
movq %rax, 0x38(%rsp)
jmp 0x4f6d2
incl %r12d
jmp 0x4f6d2
incl %r13d
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0x4f66e
jmp 0x4f6ee
xorl %r12d, %r12d
movq $0x0, 0x38(%rsp)
xorl %r13d, %r13d
xorl %ebx, %ebx
movq 0x38(%rsp), %r14
leal (%rbx,%r14), %eax
movq 0x40(%rsp), %rcx
movl %eax, (%rcx)
leal (%rbx,%r12), %eax
imull %ebx, %r12d
imull %eax, %r12d
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
testl %r12d, %r12d
je 0x4f742
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
movsd %xmm0, 0x40(%rsp)
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
callq 0x38e99
movapd %xmm0, %xmm1
xorpd %xmm0, %xmm0
mulsd 0x40(%rsp), %xmm1
leal (%r14,%r13), %eax
imull %r14d, %r13d
imull %eax, %r13d
testl %r13d, %r13d
je 0x4f783
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
movsd %xmm0, 0x40(%rsp)
movsd %xmm1, 0x38(%rsp)
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
callq 0x38e99
movsd 0x38(%rsp), %xmm1
mulsd 0x40(%rsp), %xmm0
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq