// File: /workspace/github_c_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdx, %rbx
movsd %xmm0, 0x10(%rsp)
movq %rsi, %r15
leaq 0x18(%rsp), %r12
movq %r12, %rsi
callq 0x98796
testq %rax, %rax
je 0x9d623
movq %rax, %r14
leaq 0x1c(%rsp), %r13
leaq 0x20(%rsp), %rdx
movb $0x1, %al
xorl %edi, %edi
leaq 0x38(%rsp), %rcx
movslq (%r12), %rsi
testq %rsi, %rsi
jle 0x9d4e5
movq (%r14,%rdi,8), %rdi
xorpd %xmm0, %xmm0
xorl %r8d, %r8d
addsd (%rdi,%r8,8), %xmm0
incq %r8
cmpq %r8, %rsi
jne 0x9d4d5
jmp 0x9d4e9
xorpd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %esi, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, (%rdx)
movl $0x1, %edi
movq %rcx, %rdx
movq %r13, %r12
testb $0x1, %al
movl $0x0, %eax
jne 0x9d4c1
movsd 0x20(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
xorl %eax, %eax
movapd %xmm0, 0x40(%rsp)
movsd %xmm1, 0x8(%rsp)
ucomisd %xmm1, %xmm0
setbe %al
incl %eax
movl %eax, (%r15)
leaq 0xe5cf(%rip), %rdi      # 0xabb08
callq 0x54bec
testl %eax, %eax
jne 0x9d54d
movl $0x3, %eax
subl (%r15), %eax
movl %eax, (%r15)
xorpd %xmm2, %xmm2
leaq 0x18(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movb $0x1, %al
xorl %edx, %edx
leaq 0x38(%rsp), %rcx
movslq (%rdi), %rdi
testq %rdi, %rdi
jle 0x9d58f
movq (%r14,%rdx,8), %rdx
movsd (%rsi), %xmm0
xorl %esi, %esi
movsd (%rdx,%rsi,8), %xmm1
subsd %xmm0, %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm2
incq %rsi
cmpq %rsi, %rdi
jne 0x9d576
movl $0x1, %edx
movq %rcx, %rsi
movq %r13, %rdi
testb $0x1, %al
movl $0x0, %eax
jne 0x9d564
movq %r14, %rdi
movl $0x2, %esi
movsd %xmm2, 0x58(%rsp)
callq 0x3a14b
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
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd 0x58(%rsp), %xmm2
divsd %xmm1, %xmm2
mulsd 0x8732(%rip), %xmm2     # 0xa5d18
movapd %xmm2, %xmm3
cvtdq2pd %xmm0, %xmm0
movapd 0xc90a(%rip), %xmm2     # 0xa9f00
divpd %xmm0, %xmm2
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
addsd %xmm2, %xmm0
mulsd %xmm3, %xmm0
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
movsd %xmm1, 0x30(%rsp)
jb 0x9d635
xorps %xmm3, %xmm3
sqrtsd %xmm0, %xmm3
jmp 0x9d644
movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000
movq %rax, (%rbx)
jmp 0x9d6f6
callq 0x4300
movsd 0x30(%rsp), %xmm1
movapd %xmm0, %xmm3
movapd 0x40(%rsp), %xmm2
movsd 0x8(%rsp), %xmm0
subsd %xmm0, %xmm2
movapd %xmm2, 0x40(%rsp)
movapd 0x8b7e(%rip), %xmm0     # 0xa61e0
andpd %xmm2, %xmm0
movsd %xmm3, 0x8(%rsp)
divsd %xmm3, %xmm0
movsd 0x89c8(%rip), %xmm2     # 0xa6040
callq 0x207bb
movsd %xmm0, (%rbx)
movsd 0x10(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
movsd 0x89ab(%rip), %xmm2     # 0xa6040
callq 0x20e03
movsd %xmm0, 0x10(%rsp)
leaq 0xf014(%rip), %rdi      # 0xac6bb
callq 0x54920
cmpl $0x2, %eax
jne 0x9d6ea
movsd 0x8(%rsp), %xmm1
mulsd 0x10(%rsp), %xmm1
movapd %xmm1, %xmm0
movapd 0x40(%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 0x9d6f8
leaq 0x14857(%rip), %rdi     # 0xb1f48
callq 0x4090
xorl %eax, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq