// File: /workspace/github_c_makefile_star2_O1/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 0x777ef(%rip), %rdi     # 0xa59f1
callq 0x4090
callq 0x4250
movq %rax, %r15
movl 0x10(%r14), %ecx
leaq 0x7777c(%rip), %rax     # 0xa5996
movl $0x8, %edi
movl $0x8, %esi
movl $0x8, %edx
movl %ecx, %r8d
movl %ecx, %r9d
pushq $0x6
pushq %rax
callq 0x39422
addq $0x10, %rsp
movq %rax, %rbx
cmpl $0x0, 0x10(%r14)
jle 0x2e366
leal -0x1(%r12), %eax
imull %r12d, %eax
addl $-0x2, %r12d
imull %eax, %r12d
movl %r12d, %eax
shrl $0x1f, %eax
addl %r12d, %eax
sarl %eax
cvtsi2sd %eax, %xmm1
divsd 0x76b0f(%rip), %xmm1    # 0xa4d80
xorpd %xmm2, %xmm2
xorl %r12d, %r12d
movsd %xmm1, 0x8(%rsp)
cmpl $0x0, 0x10(%r14)
jle 0x2e356
xorl %r13d, %r13d
cmpl $0x0, 0x10(%r14)
jle 0x2e346
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0x2e2e4
cmpq %r13, %r12
je 0x2e2e4
cmpq %rbp, %r12
je 0x2e2e4
cmpq %r13, %r12
jae 0x2e2f6
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
movl %ebp, %ecx
movsd %xmm2, (%rsp)
callq 0x4e38c
movsd (%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
movq (%rbx,%r12,8), %rax
movq (%rax,%r13,8), %rax
movsd %xmm0, (%rax,%rbp,8)
addsd 0x7423e(%rip), %xmm2    # 0xa2520
jmp 0x2e330
movq (%rbx,%r12,8), %rax
movq (%rax,%r13,8), %rax
movq $0x0, (%rax,%rbp,8)
jmp 0x2e336
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 0x2e330
movsd %xmm2, (%rsp)
movl $0x2e, %edi
callq 0x40d0
movsd (%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
subsd %xmm1, %xmm2
ucomisd %xmm1, %xmm2
jae 0x2e312
incq %rbp
movslq 0x10(%r14), %rax
cmpq %rax, %rbp
jl 0x2e299
incq %r13
movslq 0x10(%r14), %rax
cmpq %rax, %r13
jl 0x2e28c
incq %r12
movslq 0x10(%r14), %rax
cmpq %rax, %r12
jl 0x2e27e
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 0x77618(%rip), %rsi     # 0xa59ac
leaq 0x77dd0(%rip), %rdx     # 0xa616b
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x39529
movsd (%rsp), %xmm0
divsd 0x7496b(%rip), %xmm0    # 0xa2d20
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