// File: /workspace/github_c_makefile_star2_O1/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 0x9592c
cmpl $-0x1, %eax
je 0x97123
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 0x96c9b
movq %rax, %r12
movq %rdx, %r13
movq %rax, %rsi
movl %r14d, %r8d
callq 0x97268
movq %rax, %r15
movq %r12, %rdi
movq %r13, %rsi
callq 0x3dbad
testq %r15, %r15
je 0x97257
cmpl $0x2, %ebp
jne 0x97021
leaq 0x30(%rsp), %rsi
movq %r15, %rdi
movl $0x2, %edx
callq 0x96e1b
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x3dbad
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x3dbad
movslq 0xf46280(%r15), %rax
movsd 0xb4d2(%rip), %xmm0     # 0xa2520
movsd %xmm0, 0x10(%rsp)
testq %rax, %rax
jle 0x970c2
movl $0x1, %ecx
xorl %edx, %edx
movq %r15, %rsi
movslq 0xf42400(%r15,%rdx,4), %rdi
testq %rdi, %rdi
jle 0x970a6
shlq $0x4, %rdi
xorl %r8d, %r8d
cmpq %rbx, %rdx
setl %r9b
movslq (%rsi,%r8), %r10
cmpq %r10, %rdx
setl %r11b
cmpl %ebx, %r10d
setl %r10b
xorb %r9b, %r10b
andb %r11b, %r10b
movzbl %r10b, %r9d
addl %r9d, %ecx
addq $0x10, %r8
cmpq %r8, %rdi
jne 0x97077
incq %rdx
addq $0x3e80, %rsi           # imm = 0x3E80
cmpq %rax, %rdx
jne 0x97063
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)
cmpl $0x0, 0xf46280(%r15)
jle 0x97146
xorl %r13d, %r13d
xorl %ebp, %ebp
movl 0xf42400(%r15,%r13,4), %edi
cmpl $0x2, %edi
jl 0x97112
movl $0x2, %esi
callq 0x38eff
addl %eax, %ebp
incq %r13
movslq 0xf46280(%r15), %rax
cmpq %rax, %r13
jl 0x970f9
jmp 0x97148
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x3dbad
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x3dbad
jmp 0x97257
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x1b530
leaq 0xee6d(%rip), %rdi      # 0xa5fc4
movsd 0x10(%rsp), %xmm0
callq 0x3403a
movsd 0xbc3e(%rip), %xmm0     # 0xa2da8
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 0x971db
sqrtsd %xmm0, %xmm0
jmp 0x971e0
callq 0x4300
movsd %xmm0, 0x8(%rsp)
movq 0x28(%rsp), %rbx
leaq 0x123fd(%rip), %rdi     # 0xa95ef
callq 0x5341c
cmpl $0x2, %eax
jne 0x9724b
movsd 0xb31c(%rip), %xmm0     # 0xa2520
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 0x1fecd
movsd %xmm0, (%rbx)
xorl %eax, %eax
movsd 0x50(%rsp), %xmm1
ucomisd %xmm0, %xmm1
setbe %al
jmp 0x97259
leaq 0x17c76(%rip), %rdi     # 0xaeec8
callq 0x4090
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq