// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/tests.c
// Function: scheffe
int scheffe(char **files,int *which,double confidence,double *real_confidence)
{
 /*Last Changed 02.02.2004 added safemalloc*/
 /*Last Changed 07.05.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 * (1.0 / counts[0] + 1.0 / counts[1]));
 tmp = fabs(means[0] - means[1]) / variance;
 (*real_confidence) = 1 - f_distribution(tmp * tmp, 1, df);
 if (get_parameter_i("tailed") == 2)
  {
   res = sqrt(f_distribution_inverse(1 - confidence, 1, df));
   c1min = means[0] - means[1] - variance * res;
   c1max = means[0] - means[1] + variance * res;
   if ((c1min < 0) && (c1max > 0))
     return 0;
   else
     return 1;
  }
 else
   printf(m1316);
 return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdx, %rbx
movsd %xmm0, 0x48(%rsp)
movq %rsi, %r15
leaq 0x8(%rsp), %rsi
callq 0x95b63
testq %rax, %rax
je 0x9993c
movq %rax, %r14
xorl %eax, %eax
movq $0x0, 0x10(%rsp,%rax,8)
movslq 0x8(%rsp,%rax,4), %rcx
testq %rcx, %rcx
jle 0x99823
movq (%r14,%rax,8), %rdx
movsd 0x10(%rsp,%rax,8), %xmm0
xorl %esi, %esi
addsd (%rdx,%rsi,8), %xmm0
incq %rsi
cmpq %rsi, %rcx
jne 0x99810
movsd %xmm0, 0x10(%rsp,%rax,8)
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd 0x10(%rsp,%rax,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp,%rax,8)
leaq 0x1(%rax), %rcx
testq %rax, %rax
movq %rcx, %rax
je 0x997f1
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
xorl %eax, %eax
movapd %xmm0, 0x30(%rsp)
movsd %xmm1, 0x20(%rsp)
ucomisd %xmm1, %xmm0
setbe %al
incl %eax
movl %eax, (%r15)
leaq 0xf1c9(%rip), %rdi      # 0xa8a3c
callq 0x536e7
testl %eax, %eax
jne 0x99887
movl $0x3, %eax
subl (%r15), %eax
movl %eax, (%r15)
xorpd %xmm2, %xmm2
xorl %eax, %eax
movslq 0x8(%rsp,%rax,4), %rcx
testq %rcx, %rcx
jle 0x998bc
movq (%r14,%rax,8), %rdx
movsd 0x10(%rsp,%rax,8), %xmm0
xorl %esi, %esi
movsd (%rdx,%rsi,8), %xmm1
subsd %xmm0, %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm2
incq %rsi
cmpq %rsi, %rcx
jne 0x998a3
leaq 0x1(%rax), %rcx
testq %rax, %rax
movq %rcx, %rax
je 0x9988d
movl 0x8(%rsp), %r15d
movl 0xc(%rsp), %r12d
leal (%r15,%r12), %ebp
addl $-0x2, %ebp
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x40(%rsp)
movq %r14, %rdi
movl $0x2, %esi
callq 0x3915f
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
movsd 0x8c19(%rip), %xmm3     # 0xa2520
movapd %xmm3, %xmm1
xorps %xmm2, %xmm2
cvtsi2sd %r12d, %xmm2
divsd %xmm0, %xmm1
movapd %xmm3, %xmm0
divsd %xmm2, %xmm0
addsd %xmm1, %xmm0
mulsd 0x40(%rsp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x9994e
xorps %xmm2, %xmm2
sqrtsd %xmm0, %xmm2
jmp 0x99957
movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000
movq %rax, (%rbx)
jmp 0x999ea
callq 0x4300
movapd %xmm0, %xmm2
movapd 0x30(%rsp), %xmm1
movsd 0x20(%rsp), %xmm0
subsd %xmm0, %xmm1
movapd 0x9871(%rip), %xmm0     # 0xa31e0
movapd %xmm1, 0x30(%rsp)
andpd %xmm1, %xmm0
movapd %xmm2, 0x20(%rsp)
divsd %xmm2, %xmm0
mulsd %xmm0, %xmm0
movl $0x1, %edi
movl %ebp, %esi
callq 0x1faa9
movsd 0x8b85(%rip), %xmm1     # 0xa2520
subsd %xmm0, %xmm1
movsd %xmm1, (%rbx)
leaq 0xfc45(%rip), %rdi      # 0xa95ef
callq 0x5341c
cmpl $0x2, %eax
jne 0x999de
movsd 0x8b64(%rip), %xmm0     # 0xa2520
subsd 0x48(%rsp), %xmm0
movl $0x1, %edi
movl %ebp, %esi
callq 0x1fd87
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x999ee
sqrtsd %xmm0, %xmm0
jmp 0x999f3
leaq 0x154e3(%rip), %rdi     # 0xaeec8
callq 0x4090
xorl %eax, %eax
jmp 0x99a28
callq 0x4300
movapd 0x30(%rsp), %xmm1
movapd 0x20(%rsp), %xmm2
mulsd %xmm0, %xmm2
movapd %xmm1, %xmm0
subsd %xmm2, %xmm0
addsd %xmm1, %xmm2
xorpd %xmm1, %xmm1
cmpnltpd %xmm1, %xmm0
cmpnltpd %xmm2, %xmm1
orpd %xmm0, %xmm1
movd %xmm1, %eax
andl $0x1, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq