// File: /workspace/github_c_makefile_star2_O1/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 0x20(%rsp), %rsi
callq 0x9592c
cmpl $-0x1, %eax
je 0x97718
movq %r15, 0x68(%rsp)
movl %eax, 0xc(%rsp)
movq (%r14), %rdi
leaq 0x70(%rsp), %r15
movsd (%rsp), %xmm0
movq %r15, %rsi
callq 0x977f3
xorpd %xmm1, %xmm1
movsd (%r15), %xmm0
addsd %xmm1, %xmm0
leaq 0xea99(%rip), %rdi      # 0xa5fca
callq 0x3403a
movq 0x8(%r14), %rdi
movsd (%rsp), %xmm0
movq %r15, %rsi
callq 0x977f3
xorpd %xmm0, %xmm0
addsd (%r15), %xmm0
leaq 0xea79(%rip), %rdi      # 0xa5fd0
callq 0x3403a
leaq 0x20(%rsp), %rdi
movl (%rdi), %r14d
movl 0x10(%rdi), %r13d
leal (%r14,%r13), %r12d
movl $0x3, (%rbx)
movl $0x2, %esi
movl %r12d, %edx
callq 0x96c9b
movq %rax, %r15
movq %rdx, %rbp
movq %rax, %rsi
movl %r12d, 0x10(%rsp)
movl %r12d, %r8d
callq 0x97268
movq %rax, %rbx
xorl %eax, %eax
testq %rbx, %rbx
je 0x977e4
movq %rbx, %rdi
movq %r15, 0x50(%rsp)
movq %r15, %rsi
movq %rbp, 0x48(%rsp)
movq %rbp, %rdx
callq 0x973ad
testl %r14d, %r14d
jle 0x975f4
leaq 0xb1e9(%rip), %r15      # 0xa27b0
leaq 0x16590(%rip), %r12     # 0xadb5e
xorl %ebp, %ebp
movl 0xf433a0(%rbx,%rbp,4), %r8d
incq %rbp
movq %r15, %rdi
movl %ebp, %esi
movl $0x5, %edx
movq %r12, %rcx
xorl %eax, %eax
callq 0x32c64
cmpq %rbp, %r14
jne 0x975d0
movq %r14, 0x60(%rsp)
movslq %r14d, %rbp
movq %r13, 0x58(%rsp)
testl %r13d, %r13d
jle 0x97647
movslq 0x10(%rsp), %r14
movl $0x1, %r15d
leaq 0x16546(%rip), %r12     # 0xadb5e
movq %rbp, %r13
movl 0xf433a0(%rbx,%r13,4), %r8d
leaq 0xb186(%rip), %rdi      # 0xa27b0
movl %r15d, %esi
movl $0x6, %edx
movq %r12, %rcx
xorl %eax, %eax
callq 0x32c64
incq %r13
incl %r15d
cmpq %r14, %r13
jl 0x9761b
cmpl $0x2, 0xc(%rsp)
jne 0x97660
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x96e1b
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x3dbad
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x3dbad
movl 0x10(%rsp), %ecx
testl %ecx, %ecx
movq 0x68(%rsp), %r14
movq 0x60(%rsp), %r15
movq 0x58(%rsp), %r12
jle 0x9773b
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r12d, %xmm1
movl %r15d, %eax
addl %r12d, %eax
movl %ecx, %ecx
xorpd %xmm3, %xmm3
movl $0x1, %edx
movapd 0xbb1e(%rip), %xmm2     # 0xa31e0
xorl %edi, %edi
xorl %r8d, %r8d
xorl %esi, %esi
cmpl %edx, 0xf433a0(%rbx,%rdi,4)
jg 0x976de
cmpq %rbp, %rdi
jge 0x976dc
incl %r8d
jmp 0x976de
incl %esi
incq %rdi
cmpq %rdi, %rcx
jne 0x976c9
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 %eax, %edx
movl %esi, %edx
jne 0x976c2
jmp 0x9773f
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x3dbad
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x3dbad
jmp 0x977e2
xorpd %xmm5, %xmm5
movapd %xmm5, 0x10(%rsp)
leaq 0xbed5(%rip), %rdi      # 0xa3621
callq 0x536e7
cmpl $0x1, %eax
jne 0x9776a
leaq 0x17584(%rip), %rdi     # 0xaece1
movapd 0x10(%rsp), %xmm0
movb $0x1, %al
callq 0x4030
leaq 0xe853(%rip), %rdi      # 0xa5fc4
movapd 0x10(%rsp), %xmm0
callq 0x3403a
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x3dbad
movq %rbx, %rdi
callq 0x1b530
leaq 0x11e55(%rip), %rdi     # 0xa95ef
callq 0x5341c
cmpl $0x2, %eax
jne 0x977d6
movl %r15d, %edi
movl %r12d, %esi
movapd 0x10(%rsp), %xmm0
callq 0x2094e
movsd 0xad63(%rip), %xmm1     # 0xa2520
subsd %xmm0, %xmm1
movsd %xmm1, (%r14)
xorl %eax, %eax
movsd (%rsp), %xmm0
ucomisd %xmm1, %xmm0
setbe %al
jmp 0x977e4
leaq 0x176eb(%rip), %rdi     # 0xaeec8
callq 0x4090
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq