// File: /workspace/github_c_makefile_star2_O2/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 $0x68, %rsp
movq %rdx, %rbx
movsd %xmm0, 0x60(%rsp)
movq %rsi, %r15
leaq 0x20(%rsp), %rsi
callq 0x89b89
cmpl $-0x1, %eax
je 0x8b2b5
movl %eax, %ebp
movq %rbx, 0x10(%rsp)
leaq 0x20(%rsp), %rdi
movslq (%rdi), %rbx
movl 0x10(%rdi), %eax
movq %rax, (%rsp)
leal (%rax,%rbx), %r14d
movl $0x3, (%r15)
pushq $0x2
popq %rsi
movl %r14d, %edx
callq 0x8ae48
movq %rax, %r12
movq %rdx, %r13
movq %rax, %rsi
movq %r14, 0x18(%rsp)
movl %r14d, %r8d
callq 0x8b34c
movq %rax, %r15
movq %r12, %rdi
movq %r13, %rsi
callq 0x3929f
testq %r15, %r15
je 0x8b33b
cmpl $0x2, %ebp
jne 0x8b121
leaq 0x20(%rsp), %rsi
pushq $0x2
popq %rdx
movq %r15, %rdi
callq 0x8af60
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x3929f
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x3929f
movl 0xf46280(%r15), %eax
xorl %ecx, %ecx
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
pushq $0x1
popq %r13
movq %r15, %rsi
xorl %edi, %edi
cmpq %rdx, %rdi
je 0x8b1b3
movl 0xf42400(%r15,%rdi,4), %r8d
testl %r8d, %r8d
cmovlel %ecx, %r8d
shlq $0x4, %r8
xorl %r9d, %r9d
cmpq %r9, %r8
je 0x8b1a7
cmpq %rbx, %rdi
setl %r10b
movslq (%rsi,%r9), %r11
cmpq %r11, %rdi
setl %bpl
cmpl %ebx, %r11d
setge %r11b
andb %r10b, %bpl
andb %r11b, %bpl
movzbl %bpl, %r10d
addl %r10d, %r13d
addq $0x10, %r9
jmp 0x8b176
incq %rdi
addq $0x3e80, %rsi           # imm = 0x3E80
jmp 0x8b15b
movl %ebx, %ecx
imull (%rsp), %ecx
addl %ecx, %ecx
movl %ecx, 0xc(%rsp)
cvtsi2sd %ecx, %xmm1
cvtsi2sdl 0x18(%rsp), %xmm2
movsd 0xa34f(%rip), %xmm0     # 0x95520
movsd %xmm2, 0x50(%rsp)
addsd %xmm2, %xmm0
movsd %xmm1, 0x58(%rsp)
divsd %xmm0, %xmm1
movsd %xmm1, 0x48(%rsp)
xorl %r14d, %r14d
pushq $0x2
popq %r12
xorl %ebp, %ebp
movslq %eax, %rcx
cmpq %rcx, %r14
jge 0x8b21f
movl 0xf42400(%r15,%r14,4), %edi
cmpl $0x2, %edi
jl 0x8b21a
movl %r12d, %esi
callq 0x34dce
addl %eax, %ebp
movl 0xf46280(%r15), %eax
incq %r14
jmp 0x8b1f4
movq %r15, %rdi
callq 0x19992
cvtsi2sd %r13d, %xmm0
leaq 0xdd31(%rip), %rdi      # 0x98f64
movsd %xmm0, 0x40(%rsp)
callq 0x30597
movsd 0xab6a(%rip), %xmm0     # 0x95db0
movsd 0x50(%rsp), %xmm3
addsd %xmm3, %xmm0
mulsd %xmm3, %xmm0
movsd 0x58(%rsp), %xmm2
divsd %xmm0, %xmm2
movq 0x18(%rsp), %rsi
movl 0xc(%rsp), %eax
subl %esi, %eax
cvtsi2sd %eax, %xmm1
divsd %xmm3, %xmm1
subl %esi, %ebp
addl $0x2, %ebp
leal -0x2(%rsi), %eax
leal -0x3(%rsi), %ecx
imull %eax, %ecx
movl %ebp, %eax
cltd
idivl %ecx
leal -0x1(%rsi), %ecx
imull %esi, %ecx
imull (%rsp), %ebx
shll $0x2, %ebx
subl %ebx, %ecx
addl $0x2, %ecx
imull %eax, %ecx
cvtsi2sd %ecx, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm2, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x8b2d5
sqrtsd %xmm0, %xmm0
jmp 0x8b2da
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x3929f
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x3929f
jmp 0x8b33b
callq 0x4300
movsd %xmm0, (%rsp)
movq 0x10(%rsp), %rbx
leaq 0x112f4(%rip), %rdi     # 0x9c5df
callq 0x4cd35
cmpl $0x2, %eax
jne 0x8b32f
movsd 0x48(%rsp), %xmm1
addsd 0xa21d(%rip), %xmm1     # 0x95520
movsd 0x40(%rsp), %xmm0
subsd %xmm1, %xmm0
divsd (%rsp), %xmm0
pushq $0x1
popq %rdi
callq 0x1df1d
movsd %xmm0, (%rbx)
xorl %eax, %eax
movsd 0x60(%rsp), %xmm1
ucomisd %xmm0, %xmm1
setbe %al
jmp 0x8b33d
leaq 0x16b6a(%rip), %rdi     # 0xa1ea0
callq 0x4090
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq