// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/tests.c
// Function: smirnov
int smirnov(char **files, int *which, double confidence, double *real_confidence)
{
 matrix distancematrix;
 int p, m, n, i, j, r, s, N;
 double D, d_i, statistic;
 Graphptr mst;
 matrix observations[2];
 p = read_multivariate_observations_for_two_file(files, observations);
 if (p == -1)
  {
   matrix_free(observations[0]);
   matrix_free(observations[1]);
   return 0;
  }
 multivariate_normality_test(files[0], confidence, &statistic);
 set_default_variable("out4",statistic + 0.0);
 multivariate_normality_test(files[1], confidence, &statistic);
 set_default_variable("out5",statistic + 0.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);
 if (mst == NULL)
   return 0;
 ranks_from_minimum_spanning_tree(mst, distancematrix);
 for (i = 0; i < m; i++)
   write_array_variables("aout", i + 1, 5, "d", mst->visitorder[i]);
 for (i = m; i < N; i++)
   write_array_variables("aout", i - m + 1, 6, "d", mst->visitorder[i]);
 if (p == 2)
   save_mst_to_array_variables(mst, observations, 2);
 matrix_free(observations[0]);
 matrix_free(observations[1]);
 D = 0;
 for (i = 1; i <= N; i++)
  {
   r = 0;
   s = 0;
   for (j = 0; j < N; j++)
     if (mst->visitorder[j] <= i)
      {
       if (j < m)
         r++;
       else 
         s++;
      }
   d_i = fabs(r / (m + 0.0) - s / (n + 0.0));
   if (d_i > D)
     D = d_i;
  }
 if (get_parameter_o("displayresulton") == ON)
   printf("D: %.2f\n", D);
 set_default_variable("out3", D);
 matrix_free(distancematrix);
 free_graph(mst);
 if (get_parameter_i("tailed") == 2)
  {
   *real_confidence = 1 - kolmogorov_two_sample(m, n, D);
   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 $0x78, %rsp
movq %rdx, %r15
movsd %xmm0, (%rsp)
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x40(%rsp), %rsi
callq 0x98557
cmpl $-0x1, %eax
je 0x9a41b
movq %r15, 0x68(%rsp)
movl %eax, 0xc(%rsp)
movq (%r14), %rdi
leaq 0x70(%rsp), %r15
movsd (%rsp), %xmm0
movq %r15, %rsi
callq 0x9a4fe
xorpd %xmm1, %xmm1
movsd (%r15), %xmm0
addsd %xmm1, %xmm0
leaq 0xedcf(%rip), %rdi      # 0xa8ffa
callq 0x34a17
movq 0x8(%r14), %rdi
movsd (%rsp), %xmm0
movq %r15, %rsi
callq 0x9a4fe
xorpd %xmm0, %xmm0
addsd (%r15), %xmm0
leaq 0xedaf(%rip), %rdi      # 0xa9000
callq 0x34a17
leaq 0x40(%rsp), %rdi
movl (%rdi), %r14d
movl 0x10(%rdi), %r15d
leal (%r15,%r14), %r12d
movl $0x3, (%rbx)
movl $0x2, %esi
movl %r12d, %edx
callq 0x99958
movq %rax, %r13
movq %rdx, %rbp
movq %rax, %rsi
movl %r12d, 0x10(%rsp)
movl %r12d, %r8d
callq 0x99f51
movq %rax, %rbx
xorl %eax, %eax
testq %rbx, %rbx
je 0x9a4ef
movq %rbx, %rdi
movq %r13, 0x28(%rsp)
movq %r13, %rsi
movq %rbp, 0x20(%rsp)
movq %rbp, %rdx
callq 0x9a0a7
testl %r14d, %r14d
jle 0x9a2ee
leaq 0xb4ef(%rip), %r12      # 0xa57b0
leaq 0x1692e(%rip), %r13     # 0xb0bf6
xorl %ebp, %ebp
movl 0xf433a0(%rbx,%rbp,4), %r8d
incq %rbp
movq %r12, %rdi
movl %ebp, %esi
movl $0x5, %edx
movq %r13, %rcx
xorl %eax, %eax
callq 0x33644
cmpq %rbp, %r14
jne 0x9a2ca
movq %r14, 0x38(%rsp)
movq %r15, 0x30(%rsp)
testl %r15d, %r15d
jle 0x9a343
movslq 0x38(%rsp), %r14
movslq 0x10(%rsp), %r15
movl $0x1, %r13d
leaq 0xb49c(%rip), %rbp      # 0xa57b0
leaq 0x168db(%rip), %r12     # 0xb0bf6
movl 0xf433a0(%rbx,%r14,4), %r8d
movq %rbp, %rdi
movl %r13d, %esi
movl $0x6, %edx
movq %r12, %rcx
xorl %eax, %eax
callq 0x33644
incq %r14
incl %r13d
cmpq %r15, %r14
jl 0x9a31b
cmpl $0x2, 0xc(%rsp)
jne 0x9a35c
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x99adc
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x3ed51
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x3ed51
movl 0x10(%rsp), %r9d
testl %r9d, %r9d
movq 0x68(%rsp), %r14
movq 0x38(%rsp), %r15
jle 0x9a43e
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x30(%rsp), %xmm1
movslq %r15d, %rax
movl %r9d, %ecx
xorpd %xmm3, %xmm3
movl $0x1, %edx
movapd 0xbe26(%rip), %xmm2     # 0xa61e0
movq 0x28(%rsp), %r12
movq 0x20(%rsp), %r13
xorl %edi, %edi
xorl %r8d, %r8d
xorl %esi, %esi
cmpl %edx, 0xf433a0(%rbx,%rdi,4)
jg 0x9a3e0
cmpq %rax, %rdi
jge 0x9a3de
incl %r8d
jmp 0x9a3e0
incl %esi
incq %rdi
cmpq %rdi, %rcx
jne 0x9a3cb
xorps %xmm5, %xmm5
cvtsi2sd %r8d, %xmm5
divsd %xmm0, %xmm5
xorps %xmm4, %xmm4
cvtsi2sd %esi, %xmm4
divsd %xmm1, %xmm4
subsd %xmm4, %xmm5
andpd %xmm2, %xmm5
maxsd %xmm3, %xmm5
leal 0x1(%rdx), %esi
movapd %xmm5, %xmm3
cmpl %r9d, %edx
movl %esi, %edx
jne 0x9a3c4
jmp 0x9a44c
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x3ed51
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x3ed51
jmp 0x9a4ed
xorpd %xmm5, %xmm5
movq 0x28(%rsp), %r12
movq 0x20(%rsp), %r13
movapd %xmm5, 0x10(%rsp)
leaq 0xc20c(%rip), %rdi      # 0xa6665
callq 0x54bec
cmpl $0x1, %eax
jne 0x9a477
leaq 0x178f7(%rip), %rdi     # 0xb1d61
movapd 0x10(%rsp), %xmm0
movb $0x1, %al
callq 0x4030
leaq 0xeb76(%rip), %rdi      # 0xa8ff4
movapd 0x10(%rsp), %xmm0
callq 0x34a17
movq %r12, %rdi
movq %r13, %rsi
callq 0x3ed51
movq %rbx, %rdi
callq 0x1bbac
leaq 0x12218(%rip), %rdi     # 0xac6bb
callq 0x54920
cmpl $0x2, %eax
jne 0x9a4e1
movl %r15d, %edi
movq 0x30(%rsp), %rsi
movapd 0x10(%rsp), %xmm0
callq 0x210c8
movsd 0xb058(%rip), %xmm1     # 0xa5520
subsd %xmm0, %xmm1
movsd %xmm1, (%r14)
xorl %eax, %eax
movsd (%rsp), %xmm0
ucomisd %xmm1, %xmm0
setbe %al
jmp 0x9a4ef
leaq 0x17a60(%rip), %rdi     # 0xb1f48
callq 0x4090
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq