// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/indtests.c
// Function: one_independence_test
double ***one_independence_test(bayesiangraphptr mygraph)
{
	/*!Last Changed 02.02.2004 added safemalloc*/
 /*!Last Changed 27.02.2001*/
 double time;
 int i, j, k, total = mygraph->nodecount * (mygraph->nodecount - 1) * (mygraph->nodecount - 2) / 2;
 double ***result, walk = total / 80.0, c;
	char pst[READLINELENGTH];
 printf(m1270);
 time = -clock();
 result = (double***) safemalloc_3d(sizeof(double **), sizeof(double *), sizeof(double), mygraph->nodecount, mygraph->nodecount, mygraph->nodecount, "one_independence_test", 6);
 c = 0;
 for (i = 0; i < mygraph->nodecount; i++)
   for (j = 0; j < mygraph->nodecount; j++)
     for (k = 0; k < mygraph->nodecount; k++)
       if ((i != j) && (i != k) && (j != k))
        {
         if (i < j)
          {
           result[i][j][k] = one_independence_test_indexed(mygraph, i, j, k);
           c++;
          }
         else
           result[i][j][k] = result[j][i][k];
         while (c >= walk)
          {
           printf(".");
           c -= walk;
          }
        }
       else
         result[i][j][k] = 0;
 time += clock();
	set_precision(pst, "Time for 1 independence calculations:", "\n");
 printf(pst, time / CLOCKS_PER_SEC);
 return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7a138, %rsp          # imm = 0x7A138
movq %rdi, %r14
movl 0x10(%rdi), %r12d
leaq 0x79fb1(%rip), %rdi     # 0xa8a69
callq 0x4090
callq 0x4250
movq %rax, %r15
movl 0x10(%r14), %ecx
leaq 0x79f3e(%rip), %rax     # 0xa8a0e
movl $0x8, %edi
movl $0x8, %esi
movl $0x8, %edx
movl %ecx, %r8d
movl %ecx, %r9d
pushq $0x6
pushq %rax
callq 0x3a419
addq $0x10, %rsp
movq %rax, %rbx
movl 0x10(%r14), %eax
testl %eax, %eax
jle 0x2ec1a
leal -0x1(%r12), %ecx
imull %r12d, %ecx
addl $-0x2, %r12d
imull %ecx, %r12d
movl %r12d, %ecx
shrl $0x1f, %ecx
addl %r12d, %ecx
sarl %ecx
cvtsi2sd %ecx, %xmm1
divsd 0x792e0(%rip), %xmm1    # 0xa7e08
xorpd %xmm2, %xmm2
xorl %r12d, %r12d
movsd %xmm1, 0x8(%rsp)
testl %eax, %eax
jle 0x2ec0b
xorl %r13d, %r13d
testl %eax, %eax
jle 0x2ebfc
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0x2eb95
cmpq %r13, %r12
je 0x2eb95
cmpq %rbp, %r12
je 0x2eb95
cmpq %r13, %r12
jae 0x2eba7
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
movl %ebp, %ecx
movsd %xmm2, (%rsp)
callq 0x4f8ca
movsd (%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
movq (%rbx,%r12,8), %rax
movq (%rax,%r13,8), %rax
movsd %xmm0, (%rax,%rbp,8)
addsd 0x7698d(%rip), %xmm2    # 0xa5520
jmp 0x2ebe1
movq (%rbx,%r12,8), %rax
movq (%rax,%r13,8), %rax
movq $0x0, (%rax,%rbp,8)
jmp 0x2ebe7
movq (%rbx,%r13,8), %rax
movq (%rax,%r12,8), %rax
movsd (%rax,%rbp,8), %xmm0
movq (%rbx,%r12,8), %rax
movq (%rax,%r13,8), %rax
movsd %xmm0, (%rax,%rbp,8)
jmp 0x2ebe1
movsd %xmm2, (%rsp)
movl $0x2e, %edi
callq 0x40d0
movsd (%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
subsd %xmm1, %xmm2
ucomisd %xmm1, %xmm2
jae 0x2ebc3
incq %rbp
movl 0x10(%r14), %eax
movslq %eax, %rcx
cmpq %rcx, %rbp
jl 0x2eb4a
jmp 0x2ebff
movslq %eax, %rcx
incq %r13
cmpq %rcx, %r13
jl 0x2eb40
incq %r12
movslq %eax, %rcx
cmpq %rcx, %r12
jl 0x2eb35
negq %r15
xorps %xmm0, %xmm0
cvtsi2sd %r15, %xmm0
movsd %xmm0, (%rsp)
callq 0x4250
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
addsd (%rsp), %xmm0
movsd %xmm0, (%rsp)
leaq 0x79ddc(%rip), %rsi     # 0xa8a24
leaq 0x7a54c(%rip), %rdx     # 0xa919b
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x3a535
movsd (%rsp), %xmm0
divsd 0x770b7(%rip), %xmm0    # 0xa5d20
movq %r14, %rdi
movb $0x1, %al
callq 0x4030
movq %rbx, %rax
addq $0x7a138, %rsp          # imm = 0x7A138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq