// File: /workspace/github_c_makefile_star2_O1/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, 0x28(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x40(%rsp), %rsi
callq 0x9592c
movl %eax, 0xc(%rsp)
cmpl $-0x1, %eax
je 0x97e0f
movl 0x40(%rsp), %eax
cmpl 0x50(%rsp), %eax
jne 0x97e2f
movq %rax, 0x10(%rsp)
movq %r15, 0x68(%rsp)
movq (%r14), %rdi
leaq 0xa8(%rsp), %r15
movsd 0x28(%rsp), %xmm0
movq %r15, %rsi
callq 0x977f3
xorpd %xmm1, %xmm1
movsd (%r15), %xmm0
addsd %xmm1, %xmm0
leaq 0xe4fc(%rip), %rdi      # 0xa5fca
callq 0x3403a
movq 0x8(%r14), %rdi
movsd 0x28(%rsp), %xmm0
movq %r15, %rsi
callq 0x977f3
xorpd %xmm0, %xmm0
addsd (%r15), %xmm0
leaq 0xe4db(%rip), %rdi      # 0xa5fd0
callq 0x3403a
movl $0x3, (%rbx)
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq 0x58(%rsp), %rcx
callq 0x3e799
leaq 0xb0(%rsp), %rbx
movq %rax, %rdi
movq %rdx, %rsi
movq %rbx, %rdx
callq 0x3f03e
movq %rax, 0x30(%rsp)
movq %rdx, 0x38(%rsp)
movl 0xc(%rsp), %esi
movl $0x1, %edi
callq 0x3c6e5
movq %rax, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
movq (%rdx), %rdi
movq (%rbx), %rsi
movslq 0xc(%rsp), %rdx
shlq $0x3, %rdx
callq 0x4310
movq (%rbx), %rdi
callq 0x39194
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x3ca3c
leaq 0x98(%rsp), %rdi
movq %rax, (%rdi)
movq %rdx, 0x8(%rdi)
callq 0x3f648
testl %eax, %eax
jne 0x97bf2
leaq 0x30(%rsp), %r15
movq (%r15), %rsi
movq 0x8(%r15), %rdx
leaq 0xb8(%rsp), %r14
leaq 0xc(%rsp), %rbx
movsd 0x170ab(%rip), %xmm0    # 0xaec60
movq %r14, %rdi
movq %rbx, %rcx
callq 0x415a9
movl (%rbx), %esi
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %r15, %rdi
callq 0x1ec28
movl (%rbx), %esi
movq (%r14), %rdx
movq 0x8(%r14), %rcx
leaq 0x18(%rsp), %rdi
callq 0x1ece8
movq (%r14), %rdi
movq 0x8(%r14), %rsi
callq 0x3dbad
incl (%rbx)
xorps %xmm0, %xmm0
cvtsi2sdl 0xc(%rsp), %xmm0
leaq 0xe3c2(%rip), %rdi      # 0xa5fc4
callq 0x3403a
movq 0x98(%rsp), %rdi
movq 0xa0(%rsp), %rsi
callq 0x3dbad
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
callq 0x3f648
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq (%rbp), %rdx
movq 0x8(%rbp), %rcx
callq 0x3dc8b
movq %rax, %rbx
movq %rdx, %r14
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x3dbba
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 0x3dc8b
movq %rax, 0x80(%rsp)
movq %rdx, 0x78(%rsp)
movq (%rbp), %rdi
movq 0x8(%rbp), %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x3dc8b
movq %rax, 0x70(%rsp)
movq %rdx, %r15
cmpl $0x0, 0xc(%rsp)
jle 0x97ce4
xorl %ebp, %ebp
leaq 0xaafc(%rip), %rbx      # 0xa27b0
leaq 0xd966(%rip), %r14      # 0xa5621
movq (%r15,%rbp,8), %rax
incq %rbp
movsd (%rax), %xmm0
movq %rbx, %rdi
movl %ebp, %esi
movl $0x1, %edx
movq %r14, %rcx
movb $0x1, %al
callq 0x32c64
movslq 0xc(%rsp), %rax
cmpq %rax, %rbp
jl 0x97cbb
movq 0x10(%rsp), %rbx
leal -0x1(%rbx), %ebp
movq 0x70(%rsp), %rdi
movq %r15, %rsi
callq 0x3dbad
movl %ebx, %r15d
subl 0xc(%rsp), %r15d
imull %ebx, %r15d
movq 0x78(%rsp), %rbx
movq (%rbx), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x3dbad
movq 0x90(%rsp), %rdi
movq 0x88(%rsp), %rsi
callq 0x3dbad
movq 0x80(%rsp), %rdi
movq %rbx, %rsi
callq 0x3dbad
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x3dbad
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x3dbad
xorl %ebx, %ebx
movq 0x40(%rsp,%rbx), %rdi
movq 0x48(%rsp,%rbx), %rsi
callq 0x3dbad
addq $0x10, %rbx
cmpq $0x10, %rbx
je 0x97d67
movl 0xc(%rsp), %r14d
movl %r14d, %eax
imull %ebp, %eax
xorl %ebx, %ebx
testl %eax, %eax
je 0x97e3d
subl %r14d, %ebp
incl %ebp
cvtsi2sd %r15d, %xmm1
movsd 0x10(%rsp), %xmm0
mulsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movl %r14d, %edi
movl %ebp, %esi
callq 0x1faa9
movsd 0xa754(%rip), %xmm1     # 0xa2520
subsd %xmm0, %xmm1
movq 0x68(%rsp), %rax
movsd %xmm1, (%rax)
leaq 0x1180f(%rip), %rdi     # 0xa95ef
callq 0x5341c
cmpl $0x2, %eax
jne 0x97e51
movsd 0xa72e(%rip), %xmm0     # 0xa2520
subsd 0x28(%rsp), %xmm0
movl %r14d, %edi
movl %ebp, %esi
callq 0x1fd87
xorl %ebx, %ebx
ucomisd 0x10(%rsp), %xmm0
setbe %bl
jmp 0x97e3d
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x3dbad
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x3dbad
jmp 0x97e3b
leaq 0x1702e(%rip), %rdi     # 0xaee64
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 0x17070(%rip), %rdi     # 0xaeec8
callq 0x4090
jmp 0x97e3d