// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/tests.c
// Function: tukey
int tukey(char **files,int *which,double confidence,double *real_confidence)
{
 /*Last Changed 02.02.2004 added safemalloc*/
 /*Last Changed 28.06.2001*/
 /*One Tailed Test for H0: mu1 <= mu2 H1: mu1 > mu2*/
 /*Two Tailed Test for H0: mu1 = mu2 H1: mu1 != mu2*/
 /*confidence = 0.95 for alpha = 0.05, confidence = 0.99 for alpha = 0.01 etc.*/
 int i, j, counts[2], df;
 double means[2], **observations, mse, sse = 0.0, variance, c1min, c1max, res, tmp;
 observations = read_observations_for_two_file(files, counts);
 if (!observations)
  {
   *real_confidence = 0.5;
   return 0;
  }
 for (i = 0; i < 2; i++)
  {
   means[i] = 0.0;
   for (j = 0; j < counts[i]; j++)
     means[i] += observations[i][j];
   means[i] /= counts[i];
  }
 if (means[0] > means[1])
   (*which) = 1;
 else
   (*which) = 2;
 if (!get_parameter_o("accuracy")) 
   (*which) = 3 - (*which);       
 for (i = 0; i < 2; i++)
   for (j = 0; j < counts[i]; j++)
     sse += pow(observations[i][j] - means[i], 2);
 df = counts[0] + counts[1] - 2;
 mse = sse / df;
 free_2d((void**)observations, 2);
 variance = sqrt((mse / 2) * (1.0 / counts[0] + 1.0 / counts[1]));
 tmp = fabs(means[0] - means[1]) / variance;
 (*real_confidence) = studentized_range(tmp, df, 2);
 res = studentized_range_inverse(confidence, df, 2);
 c1min = means[0] - means[1] - variance * res;
 c1max = means[0] - means[1] + variance * res;
 if (get_parameter_i("tailed") == 2)
   if ((c1min < 0) && (c1max > 0))
     return 0;
   else
     return 1;
 else
   printf(m1316);
 return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdx, %rbx
movsd %xmm0, 0x48(%rsp)
movq %rsi, %r15
leaq 0x18(%rsp), %rsi
callq 0x89dc2
testq %rax, %rax
je 0x8e479
movq %rax, %r14
xorl %eax, %eax
cmpq $0x2, %rax
je 0x8e387
movl 0x18(%rsp,%rax,4), %ecx
testl %ecx, %ecx
movl $0x0, %edx
cmovgl %ecx, %edx
xorpd %xmm0, %xmm0
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x8e374
movq (%r14,%rax,8), %rdi
addsd (%rdi,%rsi,8), %xmm0
movsd %xmm0, 0x30(%rsp,%rax,8)
incq %rsi
jmp 0x8e35b
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp,%rax,8)
incq %rax
jmp 0x8e341
movsd 0x30(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
xorl %eax, %eax
movapd %xmm0, 0x20(%rsp)
movsd %xmm1, 0x10(%rsp)
ucomisd %xmm1, %xmm0
setbe %al
incl %eax
movl %eax, (%r15)
leaq 0xd678(%rip), %rdi      # 0x9ba2c
callq 0x4cff1
testl %eax, %eax
jne 0x8e3c6
pushq $0x3
popq %rax
subl (%r15), %eax
movl %eax, (%r15)
xorpd %xmm1, %xmm1
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0x2, %rcx
je 0x8e405
movl 0x18(%rsp,%rcx,4), %edx
testl %edx, %edx
cmovlel %eax, %edx
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x8e400
movq (%r14,%rcx,8), %rdi
movsd (%rdi,%rsi,8), %xmm0
subsd 0x30(%rsp,%rcx,8), %xmm0
mulsd %xmm0, %xmm0
addsd %xmm0, %xmm1
incq %rsi
jmp 0x8e3df
incq %rcx
jmp 0x8e3ce
pushq $0x2
popq %rsi
movq %r14, %rdi
movsd %xmm1, 0x40(%rsp)
callq 0x34fc3
movq 0x18(%rsp), %rax
movq %rax, %xmm0
pshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
movd %xmm1, %ecx
leal -0x2(%rax,%rcx), %eax
cvtsi2sd %eax, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x40(%rsp), %xmm2
divsd %xmm1, %xmm2
mulsd 0x78d7(%rip), %xmm2     # 0x95d20
cvtdq2pd %xmm0, %xmm0
movapd 0xb9db(%rip), %xmm1     # 0x99e30
divpd %xmm0, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd %xmm2, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x8e48b
sqrtsd %xmm0, %xmm1
jmp 0x8e494
movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000
movq %rax, (%rbx)
jmp 0x8e548
callq 0x4300
movapd %xmm0, %xmm1
movapd 0x20(%rsp), %xmm2
subsd 0x10(%rsp), %xmm2
movapd %xmm2, 0x20(%rsp)
movapd 0x7d32(%rip), %xmm0     # 0x961e0
andpd %xmm2, %xmm0
movsd %xmm1, 0x10(%rsp)
divsd %xmm1, %xmm0
movsd 0x7b84(%rip), %xmm2     # 0x96048
movsd 0x8(%rsp), %xmm1
callq 0x1e0c5
movsd %xmm0, (%rbx)
movsd 0x48(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x7b61(%rip), %xmm2     # 0x96048
callq 0x1e7b3
movsd %xmm0, 0x8(%rsp)
leaq 0xe0e6(%rip), %rdi      # 0x9c5df
callq 0x4cd35
cmpl $0x2, %eax
jne 0x8e53c
movsd 0x10(%rsp), %xmm1
mulsd 0x8(%rsp), %xmm1
movapd %xmm1, %xmm0
movapd 0x20(%rsp), %xmm2
addsd %xmm2, %xmm0
subsd %xmm1, %xmm2
xorpd %xmm1, %xmm1
cmpnltpd %xmm1, %xmm2
cmpnltpd %xmm0, %xmm1
orpd %xmm2, %xmm1
movd %xmm1, %eax
andl $0x1, %eax
jmp 0x8e54a
leaq 0x1395d(%rip), %rdi     # 0xa1ea0
callq 0x4090
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq