// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/network.c
// Function: make_one_conditional_table
void make_one_conditional_table(bayesiangraphptr mygraph,int node)
{
 /*!Last Changed 02.02.2004 added safemalloc*/
 /*!Last Changed 09.03.2001*/
 int i,j,k,value_pos,pos;
 int *list1,*parents;
 double sum;
 alloc_conditional_table(&mygraph->nodes[node]);
 if (mygraph->nodes[node].parents)
  {
   parents=find_parents(mygraph,node);
   list1 = safemalloc(mygraph->nodes[node].parents*sizeof(int), "make_one_conditional_table", 8);
  }
 for (i=0;i<train.row;i++)
  {
   value_pos=train.data[i][node];
   if (mygraph->nodes[node].parents)
    {
     for (k=0;k<mygraph->nodes[node].parents;k++)
       list1[k]=train.data[i][parents[k]];
     pos=table_pos(mygraph->nodes[node],list1);
    }
   else/*No parents*/
     pos=0;
   mygraph->nodes[node].table[pos][value_pos]++;
  }
 if (mygraph->nodes[node].parents)
  {
   safe_free(parents);
   safe_free(list1);
  } 
 for (j=0;j<mygraph->nodes[node].table_count;j++)
  {
   sum=0;
   for (k=0;k<mygraph->nodes[node].value_count;k++)
     sum+=mygraph->nodes[node].table[j][k];
   if (sum!=0)
    {
     for (k=0;k<mygraph->nodes[node].value_count;k++)
       mygraph->nodes[node].table[j][k]/=sum;
    }
   else
     for (k=0;k<mygraph->nodes[node].value_count;k++)
       mygraph->nodes[node].table[j][k] = (double) 1.0 / mygraph->nodes[node].value_count;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movslq -0xc(%rbp), %rax
imulq $0x48, %rax, %rax
addq %rax, %rdi
callq 0x70d30
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x20(%rax)
je 0x71f63
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x70420
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movslq 0x20(%rax), %rdi
shlq $0x2, %rdi
leaq 0x75348(%rip), %rsi     # 0xe729d
movl $0x8, %edx
callq 0x52d70
movq %rax, -0x28(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl 0x9351d(%rip), %eax     # 0x105490
jge 0x72099
movq 0x93508(%rip), %rax     # 0x105488
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x20(%rax)
je 0x7204f
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0xc(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x20(%rcx), %eax
jge 0x72005
movq 0x934b0(%rip), %rax     # 0x105488
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x30(%rbp), %rcx
movslq -0x18(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %edx
movq -0x28(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x71fb6
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
movslq -0xc(%rbp), %rax
imulq $0x48, %rax, %rax
addq %rax, %rcx
movq -0x28(%rbp), %rdi
movq 0x40(%rcx), %rdx
movq %rsp, %rax
movq %rdx, 0x40(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups 0x30(%rcx), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x703b0
movl %eax, -0x20(%rbp)
jmp 0x72056
movl $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq 0x38(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movsd 0x6ff97(%rip), %xmm0    # 0xe2018
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x71f6a
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x20(%rax)
je 0x720c4
movq -0x30(%rbp), %rdi
callq 0x52e80
movq -0x28(%rbp), %rdi
callq 0x52e80
movl $0x0, -0x14(%rbp)
movslq -0x14(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0xc(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x28(%rcx), %rax
jge 0x72255
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0xc(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jge 0x72153
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq 0x38(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x720fb
movsd -0x38(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x72165
jp 0x72165
jmp 0x721ca
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0xc(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jge 0x721c8
movsd -0x38(%rbp), %xmm1
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq 0x38(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x7216c
jmp 0x72245
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0xc(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jge 0x72243
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cvtsi2sdl 0x10(%rax), %xmm1
movsd 0x6fe0c(%rip), %xmm0    # 0xe2018
divsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq 0x38(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x721d1
jmp 0x72245
jmp 0x72247
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x720cb
addq $0x80, %rsp
popq %rbp
retq
nop