// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/network.c
// Function: one_independence_test_indexed
double one_independence_test_indexed(bayesiangraphptr mygraph,int node1, int node2, int given)
{
/*!Last Changed 09.03.2001*/
 int flength=train.row, i, j, k;
 double p1, p2, p3;
 int list1[1], list2[2], list3[3];
 int value_list1[1], value_list2[2], value_list3[3];
 double denom;
	double result = 0;
 double temp;
 if (flength == 0)
   return 0;
 list1[0] = given;
 list3[0] = node1;
 list3[1] = node2;
 list3[2] = given;
 for (k = 0; k < mygraph->nodes[given].value_count; k++)
  {
   value_list1[0]=k;
   denom = count_data(list1,value_list1,1) + (double) 0.0;
   if (denom!=0)
     for (i = 0; i < mygraph->nodes[node1].value_count; i++)
      {
       value_list2[0]=i;
       value_list2[1]=k;
       list2[0]=node1;
       list2[1]=given;
       temp = count_data(list2,value_list2,2) + (double) 0.0;
       p2=temp/denom;
       if (p2!=0)
         for (j = 0; j < mygraph->nodes[node2].value_count; j++)
          {
           value_list3[0]=i;
           value_list3[1]=j;
           value_list3[2]=k;
           temp=count_data(list3,value_list3,3) + (double) 0.0;
           p1 = temp/denom;
           value_list2[0]=j;
           list2[0]=node2;
           temp=count_data(list2,value_list2,2) + (double) 0.0;
           p3=temp/denom;
           if ((p1 != 0) && (p3 != 0))
             result += p1 * log2(p1 / (p2 * p3));
          }
      }
  }
 if (result != 0)
   result = 1 - chi_square((mygraph->nodes[node1].value_count - 1) * (mygraph->nodes[node2].value_count - 1) * (mygraph->nodes[given].value_count - 1) , 2 * result * flength);
 return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl 0x931d2(%rip), %eax     # 0x105490
movl %eax, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x88(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0x722df
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x725e1
movl -0x1c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x58(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x1c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jge 0x72536
movl -0x2c(%rbp), %eax
movl %eax, -0x64(%rbp)
leaq -0x4c(%rbp), %rdi
leaq -0x64(%rbp), %rsi
movl $0x1, %edx
callq 0x37200
cvtsi2sd %eax, %xmm0
xorps %xmm1, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x80(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x7235a
jp 0x7235a
jmp 0x72526
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x14(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jge 0x72524
movl -0x24(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x50(%rbp)
leaq -0x54(%rbp), %rdi
leaq -0x6c(%rbp), %rsi
movl $0x2, %edx
callq 0x37200
cvtsi2sd %eax, %xmm0
xorps %xmm1, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x90(%rbp), %xmm0
divsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x723e4
jp 0x723e4
jmp 0x72514
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x18(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jge 0x72512
movl -0x24(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x74(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x70(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x78(%rbp), %rsi
movl $0x3, %edx
callq 0x37200
cvtsi2sd %eax, %xmm0
xorps %xmm1, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x90(%rbp), %xmm0
divsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x54(%rbp)
leaq -0x54(%rbp), %rdi
leaq -0x6c(%rbp), %rsi
movl $0x2, %edx
callq 0x37200
cvtsi2sd %eax, %xmm0
xorps %xmm1, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x90(%rbp), %xmm0
divsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x38(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x724a8
jp 0x724a8
jmp 0x72502
movsd -0x48(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x724ba
jp 0x724ba
jmp 0x72502
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0x38(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd -0x48(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x52ad0
movaps %xmm0, %xmm2
movsd -0x98(%rbp), %xmm0
movsd -0x88(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
jmp 0x72504
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x723eb
jmp 0x72514
jmp 0x72516
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x72361
jmp 0x72526
jmp 0x72528
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x722fe
movsd -0x88(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x7254e
jp 0x7254e
jmp 0x725d4
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %edi
subl $0x1, %edi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x18(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
subl $0x1, %eax
imull %eax, %edi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
subl $0x1, %eax
imull %eax, %edi
movsd 0x706f9(%rip), %xmm0    # 0xe2ca0
mulsd -0x88(%rbp), %xmm0
cvtsi2sdl -0x20(%rbp), %xmm1
mulsd %xmm1, %xmm0
callq 0x2d5e0
movaps %xmm0, %xmm1
movsd 0x6fa50(%rip), %xmm0    # 0xe2018
subsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0xa0, %rsp
popq %rbp
retq
nop