// File: /workspace/github_c_makefile_star2_O2/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 $0x68, %rsp
movq %rdx, %r13
movsd %xmm0, 0x10(%rsp)
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x20(%rsp), %rsi
callq 0x89b89
cmpl $-0x1, %eax
je 0x8b884
movl %eax, 0x1c(%rsp)
movq (%rbx), %rdi
leaq 0x60(%rsp), %r14
movsd 0x10(%rsp), %xmm0
movq %r14, %rsi
callq 0x8b8c1
xorpd %xmm1, %xmm1
movsd (%r14), %xmm0
addsd %xmm1, %xmm0
leaq 0xd94c(%rip), %rdi      # 0x98f6a
callq 0x30597
movq 0x8(%rbx), %rdi
movsd 0x10(%rsp), %xmm0
movq %r14, %rsi
callq 0x8b8c1
xorpd %xmm0, %xmm0
addsd (%r14), %xmm0
leaq 0xd92b(%rip), %rdi      # 0x98f70
callq 0x30597
leaq 0x20(%rsp), %rdi
movslq (%rdi), %r15
movslq 0x10(%rdi), %rbx
leaq (%rbx,%r15), %rbp
movl $0x3, (%r12)
pushq $0x2
popq %rsi
movl %ebp, %edx
callq 0x8ae48
movq %rax, %r14
movq %rdx, %r12
movq %rax, %rsi
movq %rbp, 0x8(%rsp)
movl %ebp, %r8d
callq 0x8b34c
testq %rax, %rax
je 0x8b8b0
movq %rax, %rbp
movq %rbx, 0x50(%rsp)
movq %r13, 0x58(%rsp)
movq %rax, %rdi
movq %r14, 0x48(%rsp)
movq %r14, %rsi
movq %r12, 0x40(%rsp)
movq %r12, %rdx
callq 0x8b49c
testl %r15d, %r15d
movl $0x0, %ebx
cmovgl %r15d, %ebx
leaq 0x15497(%rip), %r14     # 0xa0b5a
pushq $0x5
popq %r12
xorl %r13d, %r13d
cmpq %r13, %rbx
je 0x8b6f3
movl 0xf433a0(%rbp,%r13,4), %r8d
incq %r13
leaq 0xa0cf(%rip), %rdi      # 0x957b0
movl %r13d, %esi
movl %r12d, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2f310
jmp 0x8b6ca
pushq $0x1
popq %r12
leaq 0x1545c(%rip), %rbx     # 0xa0b5a
pushq $0x6
popq %r13
movq %r15, %r14
cmpq 0x8(%rsp), %r14
jge 0x8b733
movl 0xf433a0(%rbp,%r14,4), %r8d
leaq 0xa095(%rip), %rdi      # 0x957b0
movl %r12d, %esi
movl %r13d, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2f310
incq %r14
incl %r12d
jmp 0x8b705
cmpl $0x2, 0x1c(%rsp)
jne 0x8b74a
leaq 0x20(%rsp), %rsi
pushq $0x2
popq %rdx
movq %rbp, %rdi
callq 0x8af60
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x3929f
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x3929f
cvtsi2sd %r15d, %xmm0
movq 0x50(%rsp), %r14
cvtsi2sd %r14d, %xmm1
xorl %eax, %eax
movq 0x8(%rsp), %rcx
testl %ecx, %ecx
cmovgl %ecx, %eax
incl %eax
movl %ecx, %ecx
pushq $0x1
popq %rdx
xorpd %xmm5, %xmm5
movapd 0xaa4a(%rip), %xmm2     # 0x961e0
movq 0x58(%rsp), %rbx
movq 0x40(%rsp), %r12
cmpl %eax, %edx
je 0x8b7ef
xorl %edi, %edi
xorl %esi, %esi
xorl %r8d, %r8d
cmpq %rdi, %rcx
je 0x8b7ca
cmpl %edx, 0xf433a0(%rbp,%rdi,4)
jg 0x8b7c5
cmpq %r15, %rdi
jge 0x8b7c3
incl %r8d
jmp 0x8b7c5
incl %esi
incq %rdi
jmp 0x8b7ab
cvtsi2sd %r8d, %xmm3
divsd %xmm0, %xmm3
cvtsi2sd %esi, %xmm4
divsd %xmm1, %xmm4
subsd %xmm4, %xmm3
andpd %xmm2, %xmm3
maxsd %xmm5, %xmm3
incl %edx
movapd %xmm3, %xmm5
jmp 0x8b7a0
movsd %xmm5, 0x8(%rsp)
leaq 0xae09(%rip), %rdi      # 0x96605
callq 0x4cff1
cmpl $0x1, %eax
jne 0x8b81a
leaq 0x164ac(%rip), %rdi     # 0xa1cb9
movsd 0x8(%rsp), %xmm0
movb $0x1, %al
callq 0x4030
leaq 0xd743(%rip), %rdi      # 0x98f64
movsd 0x8(%rsp), %xmm0
callq 0x30597
movq 0x48(%rsp), %rdi
movq %r12, %rsi
callq 0x3929f
movq %rbp, %rdi
callq 0x19992
leaq 0x10d97(%rip), %rdi     # 0x9c5df
callq 0x4cd35
cmpl $0x2, %eax
jne 0x8b8a4
movl %r15d, %edi
movl %r14d, %esi
movsd 0x8(%rsp), %xmm0
callq 0x1ea70
movsd 0x9cb5(%rip), %xmm1     # 0x95520
subsd %xmm0, %xmm1
movsd %xmm1, (%rbx)
xorl %eax, %eax
movsd 0x10(%rsp), %xmm0
ucomisd %xmm1, %xmm0
setbe %al
jmp 0x8b8b2
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x3929f
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x3929f
jmp 0x8b8b0
leaq 0x165f5(%rip), %rdi     # 0xa1ea0
callq 0x4090
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq