// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/tests.c
// Function: hotellingt
int hotellingt(char **files, int *which, double confidence, double *real_confidence)
{
 /*!Last Changed 12.01.2009*/
 int i, k, p, m, df1, df2;
 double *samplemean, num, denom, statistic;
 matrix observations[2], difference, covariance, mean, eigenvec, dummy, result, tmp, meant, weights;
 p = read_multivariate_observations_for_two_file(files, observations);
 if (p == -1)
  {
   matrix_free(observations[0]);
   matrix_free(observations[1]);
   return 0;
  }
 if (observations[0].row != observations[1].row)
  {
   printf(m1426);
   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);
 k = observations[0].row;
 *which = 3;
 difference = matrix_difference(observations[0], observations[1]);
 covariance = matrix_covariance(difference, &samplemean);
 mean = matrix_alloc(1, p);
 memcpy(mean.values[0], samplemean, p * sizeof(double));
 safe_free(samplemean);
 dummy = matrix_copy(covariance);
 if (!matrix_inverse(&dummy))
  {
   find_eigenvalues_eigenvectors(&eigenvec, covariance, &p, 1.0 - DBL_DELTA);
   reduce_dimension_of_covariance_matrix(&covariance, p, eigenvec);
   reduce_dimension_of_vector(&mean, p, eigenvec);
   matrix_free(eigenvec);
   p++;
  }
 set_default_variable("out3", p + 0.0);
 matrix_free(dummy);
 m = k - 1;
 matrix_inverse(&covariance);
 tmp = matrix_multiply(mean, covariance);
 meant = matrix_transpose(mean);
 result = matrix_multiply(tmp, meant);
 weights = matrix_multiply(covariance, meant);
 for (i = 0; i < p; i++)
   write_array_variables("aout", i + 1, 1, "f", weights.values[i][0]); 
 matrix_free(weights);
 num = (m - p + 1) * k * result.values[0][0];
 matrix_free(meant);
 matrix_free(tmp);
 matrix_free(result);
 matrix_free(covariance);
 matrix_free(mean);
 for (i = 0; i < 2; i++)
   matrix_free(observations[i]);
 denom = p * m;
 df1 = p;
 df2 = m - p + 1;
 if (denom != 0)
   (*real_confidence) = 1 - f_distribution(num / denom, df1, df2);
 else
   return 0;
 if (get_parameter_i("tailed") == 2)
  {
   if ((num / denom) < f_distribution_inverse(1 - confidence, df1, df2))
     return 0;
   else
     return 1;
  }
 else
   printf(m1316);
 return 0;  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdx, %r15
movsd %xmm0, 0x20(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x30(%rsp), %rsi
callq 0x98557
movl %eax, 0x4(%rsp)
cmpl $-0x1, %eax
je 0x9a8a9
movl 0x30(%rsp), %r13d
cmpl 0x40(%rsp), %r13d
jne 0x9a8c9
movq %r15, 0x70(%rsp)
movq (%r14), %rdi
leaq 0xa8(%rsp), %r15
movsd 0x20(%rsp), %xmm0
movq %r15, %rsi
callq 0x9a4fe
xorpd %xmm1, %xmm1
movsd (%r15), %xmm0
addsd %xmm1, %xmm0
leaq 0xe824(%rip), %rdi      # 0xa8ffa
callq 0x34a17
movq 0x8(%r14), %rdi
movsd 0x20(%rsp), %xmm0
movq %r15, %rsi
callq 0x9a4fe
xorpd %xmm0, %xmm0
addsd (%r15), %xmm0
leaq 0xe803(%rip), %rdi      # 0xa9000
callq 0x34a17
movl $0x3, (%rbx)
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rcx
callq 0x3faf0
leaq 0xb0(%rsp), %rbx
movq %rax, %rdi
movq %rdx, %rsi
movq %rbx, %rdx
callq 0x40397
movq %rax, %r14
movq %rdx, %r15
movq %rax, 0x58(%rsp)
movq %rdx, 0x60(%rsp)
movslq 0x4(%rsp), %r12
movl $0x1, %edi
movl %r12d, %esi
callq 0x3d79d
movq %rax, 0x10(%rsp)
movq %rdx, 0x18(%rsp)
movq (%rdx), %rdi
movq (%rbx), %rsi
shlq $0x3, %r12
movq %r12, %rdx
callq 0x4310
movq (%rbx), %rdi
callq 0x3a180
movq %r14, %rdi
movq %r15, %rsi
callq 0x3dae3
leaq 0x98(%rsp), %rdi
movq %rax, (%rdi)
movq %rdx, 0x8(%rdi)
callq 0x409b7
testl %eax, %eax
je 0x9a8eb
movl 0x4(%rsp), %eax
jmp 0x9a94d
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x3ed51
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x3ed51
jmp 0x9a8d5
leaq 0x17614(%rip), %rdi     # 0xb1ee4
callq 0x4090
xorl %ebx, %ebx
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x58(%rsp), %r15
movq (%r15), %rsi
movq 0x8(%r15), %rdx
leaq 0xb8(%rsp), %r14
leaq 0x4(%rsp), %rbx
movsd 0x173dc(%rip), %xmm0    # 0xb1ce8
movq %r14, %rdi
movq %rbx, %rcx
callq 0x42921
movl (%rbx), %esi
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
callq 0x1f3b9
movl (%rbx), %esi
movq (%r14), %rdx
movq 0x8(%r14), %rcx
leaq 0x10(%rsp), %rdi
callq 0x1f479
movq (%r14), %rdi
movq 0x8(%r14), %rsi
callq 0x3ed51
movl (%rbx), %eax
incl %eax
movl %eax, (%rbx)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
leaq 0xe699(%rip), %rdi      # 0xa8ff4
callq 0x34a17
movq 0x98(%rsp), %rdi
movq 0xa0(%rsp), %rsi
callq 0x3ed51
movq %r13, 0x68(%rsp)
leal -0x1(%r13), %eax
movl %eax, 0x2c(%rsp)
leaq 0x58(%rsp), %rbp
movq %rbp, %rdi
callq 0x409b7
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq (%rbp), %rdx
movq 0x8(%rbp), %rcx
callq 0x3ee2f
movq %rax, %rbx
movq %rdx, %r14
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x3ed5e
movq %rax, %r12
movq %rdx, %r13
movq %rbx, 0x90(%rsp)
movq %rbx, %rdi
movq %r14, 0x88(%rsp)
movq %r14, %rsi
movq %rax, %rdx
movq %r13, %rcx
callq 0x3ee2f
movq %rax, 0x80(%rsp)
movq %rdx, 0x78(%rsp)
movq (%rbp), %rdi
movq 0x8(%rbp), %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x3ee2f
movq %rax, 0x8(%rsp)
movq %rdx, %r14
cmpl $0x0, 0x4(%rsp)
jle 0x9aa4c
xorl %r15d, %r15d
leaq 0xad95(%rip), %rbp      # 0xa57b0
leaq 0xdc57(%rip), %rbx      # 0xa8679
movq (%r14,%r15,8), %rax
incq %r15
movsd (%rax), %xmm0
movq %rbp, %rdi
movl %r15d, %esi
movl $0x1, %edx
movq %rbx, %rcx
movb $0x1, %al
callq 0x33644
movslq 0x4(%rsp), %rax
cmpq %rax, %r15
jl 0x9aa22
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x3ed51
movl 0x4(%rsp), %ebp
movq 0x78(%rsp), %rbx
movq (%rbx), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x3ed51
movq 0x90(%rsp), %rdi
movq 0x88(%rsp), %rsi
callq 0x3ed51
movq 0x80(%rsp), %rdi
movq %rbx, %rsi
callq 0x3ed51
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x3ed51
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x3ed51
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x3ed51
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x3ed51
movl 0x4(%rsp), %r14d
movl %r14d, %eax
movl 0x2c(%rsp), %r15d
imull %r15d, %eax
xorl %ebx, %ebx
testl %eax, %eax
je 0x9a8d7
subl %r14d, %r15d
incl %r15d
movq 0x68(%rsp), %rdx
movl %edx, %ecx
subl %ebp, %ecx
imull %edx, %ecx
cvtsi2sd %ecx, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movl %r14d, %edi
movl %r15d, %esi
callq 0x201ed
movsd 0xa9e6(%rip), %xmm1     # 0xa5520
subsd %xmm0, %xmm1
movq 0x70(%rsp), %rax
movsd %xmm1, (%rax)
leaq 0x11b6d(%rip), %rdi     # 0xac6bb
callq 0x54920
cmpl $0x2, %eax
jne 0x9ab81
movsd 0xa9c0(%rip), %xmm0     # 0xa5520
subsd 0x20(%rsp), %xmm0
movl %r14d, %edi
movl %r15d, %esi
callq 0x204cb
xorl %ebx, %ebx
ucomisd 0x8(%rsp), %xmm0
setbe %bl
jmp 0x9a8d7
leaq 0x173c0(%rip), %rdi     # 0xb1f48
callq 0x4090
jmp 0x9a8d7