// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/tests.c
// Function: waldwolfowitz
int waldwolfowitz(char **files, int *which, double confidence, double *real_confidence)
{
 int p, m, n, i, j, R, N, C;
 double expectation, variance, statistic;
 matrix observations[2], distancematrix;
 Graphptr mst;
 p = read_multivariate_observations_for_two_file(files, observations);
 if (p == -1)
  {
   matrix_free(observations[0]);
   matrix_free(observations[1]);
   return 0;
  }
 m = observations[0].row;
 n = observations[1].row;
 N = m + n;
 *which = 3;
 distancematrix = distance_matrix_for_multiple_multivariate_sample(observations, 2, N); 
 mst = minimum_spanning_tree_from_observations(observations, distancematrix, 2, N);
 matrix_free(distancematrix);
 if (mst == NULL)
   return 0;
 if (p == 2)
   save_mst_to_array_variables(mst, observations, 2);
 matrix_free(observations[0]);
 matrix_free(observations[1]);
 R = 1;
 for (i = 0; i < mst->nvertices; i++)
   for (j = 0; j < mst->degree[i]; j++)
     if (i < mst->edges[i][j].v && ((i < m && mst->edges[i][j].v >= m) || (i >= m && mst->edges[i][j].v < m)))
       R++;
 expectation = 2 * m * n / (N + 1.0) + 1;
 C = 0;
 for (i = 0; i < mst->nvertices; i++)
   if (mst->degree[i] > 1)
     C += binom(mst->degree[i], 2);
 free_graph(mst);
 set_default_variable("out3", R);
 variance = ((2 * m * n) / (N * (N - 1.0))) * ((2 * m * n - N) / (N + 0.0) + ((C - N + 2) / ((N - 2) * (N - 3))) * (N * (N - 1) - 4 * m * n + 2));
 statistic = (R - expectation) / sqrt(variance);
 if (get_parameter_i("tailed") == 2)
  {
   (*real_confidence) = normal(statistic, 1);
   if ((*real_confidence) < confidence)
     return 0;
   else
     return 1;
  }
 else
   printf(m1316);
 return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %rbx
movsd %xmm0, 0x50(%rsp)
movq %rsi, %r15
leaq 0x30(%rsp), %rsi
callq 0x98557
cmpl $-0x1, %eax
je 0x99e0c
movl %eax, %ebp
movq %rbx, 0x28(%rsp)
leaq 0x30(%rsp), %rdi
movslq (%rdi), %rbx
movl 0x10(%rdi), %eax
movq %rax, 0x8(%rsp)
leal (%rax,%rbx), %r14d
movl $0x3, (%r15)
movl $0x2, %esi
movl %r14d, %edx
callq 0x99958
movq %rax, %r12
movq %rdx, %r13
movq %rax, %rsi
movl %r14d, %r8d
callq 0x99f51
movq %rax, %r15
movq %r12, %rdi
movq %r13, %rsi
callq 0x3ed51
testq %r15, %r15
je 0x99f40
cmpl $0x2, %ebp
jne 0x99d0d
leaq 0x30(%rsp), %rsi
movq %r15, %rdi
movl $0x2, %edx
callq 0x99adc
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x3ed51
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x3ed51
movslq 0xf46280(%r15), %rax
movsd 0xb7e6(%rip), %xmm0     # 0xa5520
movsd %xmm0, 0x10(%rsp)
testq %rax, %rax
jle 0x99dae
movl $0x1, %ecx
xorl %edx, %edx
movq %r15, %rsi
movslq 0xf42400(%r15,%rdx,4), %rdi
testq %rdi, %rdi
jle 0x99d92
shlq $0x4, %rdi
xorl %r8d, %r8d
cmpq %rbx, %rdx
setl %r9b
movslq (%rsi,%r8), %r10
cmpq %r10, %rdx
setl %r11b
cmpl %ebx, %r10d
setge %r10b
andb %r9b, %r11b
andb %r10b, %r11b
movzbl %r11b, %r9d
addl %r9d, %ecx
addq $0x10, %r8
cmpq %r8, %rdi
jne 0x99d63
incq %rdx
addq $0x3e80, %rsi           # imm = 0x3E80
cmpq %rax, %rdx
jne 0x99d4f
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0x10(%rsp)
movl %ebx, %r12d
imull 0x8(%rsp), %r12d
addl %r12d, %r12d
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
movsd %xmm0, 0x20(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
movsd %xmm0, 0x18(%rsp)
testl %eax, %eax
jle 0x99e2f
xorl %r13d, %r13d
xorl %ebp, %ebp
movl 0xf42400(%r15,%r13,4), %edi
cmpl $0x2, %edi
jl 0x99dff
movl $0x2, %esi
callq 0x39ce8
addl %eax, %ebp
movl 0xf46280(%r15), %eax
incq %r13
movslq %eax, %rcx
cmpq %rcx, %r13
jl 0x99ddf
jmp 0x99e31
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x3ed51
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x3ed51
jmp 0x99f40
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x1bbac
leaq 0xf1b4(%rip), %rdi      # 0xa8ff4
movsd 0x10(%rsp), %xmm0
callq 0x34a17
movsd 0xbf55(%rip), %xmm0     # 0xa5da8
movsd 0x18(%rsp), %xmm3
addsd %xmm3, %xmm0
mulsd %xmm3, %xmm0
movsd 0x20(%rsp), %xmm1
divsd %xmm0, %xmm1
subl %r14d, %r12d
cvtsi2sd %r12d, %xmm2
divsd %xmm3, %xmm2
subl %r14d, %ebp
addl $0x2, %ebp
leal -0x2(%r14), %eax
leal -0x3(%r14), %ecx
imull %eax, %ecx
movl %ebp, %eax
cltd
idivl %ecx
leal -0x1(%r14), %ecx
imull %r14d, %ecx
imull 0x8(%rsp), %ebx
shll $0x2, %ebx
subl %ebx, %ecx
addl $0x2, %ecx
imull %eax, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
addsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x99ec4
sqrtsd %xmm0, %xmm0
jmp 0x99ec9
callq 0x4300
movsd %xmm0, 0x8(%rsp)
movq 0x28(%rsp), %rbx
leaq 0x127e0(%rip), %rdi     # 0xac6bb
callq 0x54920
cmpl $0x2, %eax
jne 0x99f34
movsd 0xb633(%rip), %xmm0     # 0xa5520
movsd 0x18(%rsp), %xmm2
addsd %xmm0, %xmm2
movsd 0x20(%rsp), %xmm1
divsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
subsd %xmm1, %xmm0
divsd 0x8(%rsp), %xmm0
movl $0x1, %edi
callq 0x20611
movsd %xmm0, (%rbx)
xorl %eax, %eax
movsd 0x50(%rsp), %xmm1
ucomisd %xmm0, %xmm1
setbe %al
jmp 0x99f42
leaq 0x1800d(%rip), %rdi     # 0xb1f48
callq 0x4090
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq