// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/distributions.c
// Function: f_distribution
double f_distribution(double F,int freedom1,int freedom2)
{/*Finds the probability*/
 int i, j;
 int a, b;
 double  w, y, z, d, p;
 if (F < F_EPSILON || freedom1 < 1 || freedom2 < 1)
   return (1.0);
 if (freedom1%2)
   a=1;
 else
   a=2;
 if (freedom2%2)
   b=1;
 else
   b=2;
 w = (F * freedom1) / freedom2;
 z = 1.0 / (1.0 + w);
 if (a == 1)
   if (b == 1)
    {
     p = sqrt (w);
     y = I_PI; /* 1 / 3.14159 */
     d = y * z / p;
     p = 2.0 * y * atan (p);
    }
   else
    {
     p = sqrt (w * z);
     d = 0.5 * p * z / w;
    }
 else
   if (b == 1)
    {
     p = sqrt (z);
     d = 0.5 * z * p;
     p = 1.0 - p;
    }
   else
    {
     d = z * z;
     p = w * z;
    }
 y = 2.0 * w / z;
 for (j = b + 2; j <= freedom2; j += 2)
  {
   d *= (1.0 + a / (j - 2.0)) * z;
   if (a==1)
     p = p + d * y / (j - 1.0);
   else
     p = (p + w) * z;
  }
 y = w * z;
 z = 2.0 / z;
 b = freedom2 - 2;
 for (i = a + 2; i <= freedom1; i += 2)
  {
   j = i + b;
   d *= y * j / (i - 2.0);
   p -= z * d / j;
  }
 if (p < 0.0)
   p = 0.0;
 else
   if (p > 1.0)
     p = 1.0;
 return (1.0-p);
}

// Assembly:
movsd 0x7a001(%rip), %xmm1    # 0x97b40
ucomisd %xmm0, %xmm1
seta %al
testl %edi, %edi
setle %cl
testl %esi, %esi
setle %dl
orb %cl, %dl
orb %al, %dl
je 0x1db63
movsd 0x779c2(%rip), %xmm5    # 0x95520
jmp 0x1dde1
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebx
movl %edi, %ebp
movl %edi, %eax
andl $0x1, %eax
pushq $0x2
popq %r14
subl %eax, %r14d
movl %esi, %r12d
andl $0x1, %r12d
pushq $0x4
popq %r15
cvtsi2sd %edi, %xmm6
cvtsi2sd %esi, %xmm1
mulsd %xmm0, %xmm6
divsd %xmm1, %xmm6
movsd 0x7797e(%rip), %xmm5    # 0x95520
movapd %xmm6, %xmm0
addsd %xmm5, %xmm0
movapd %xmm5, %xmm7
divsd %xmm0, %xmm7
testl %eax, %eax
jne 0x1dbd2
testb $0x1, %bl
jne 0x1dbef
movapd %xmm7, %xmm8
mulsd %xmm7, %xmm8
movapd %xmm6, %xmm0
mulsd %xmm7, %xmm0
jmp 0x1dd02
testb $0x1, %bl
jne 0x1dc02
movapd %xmm6, %xmm0
mulsd %xmm7, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1dc25
sqrtsd %xmm0, %xmm0
jmp 0x1dc4a
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm7
jb 0x1dc67
sqrtsd %xmm7, %xmm1
jmp 0x1dc94
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm6
movsd %xmm6, 0x10(%rsp)
movsd %xmm7, 0x8(%rsp)
jb 0x1dcb5
sqrtsd %xmm6, %xmm0
jmp 0x1dcc4
movsd %xmm6, 0x10(%rsp)
movsd %xmm7, 0x8(%rsp)
callq 0x4300
movsd 0x8(%rsp), %xmm7
movsd 0x10(%rsp), %xmm6
movsd 0x778d6(%rip), %xmm5    # 0x95520
movsd 0x780cd(%rip), %xmm8    # 0x95d20
mulsd %xmm0, %xmm8
mulsd %xmm7, %xmm8
divsd %xmm6, %xmm8
jmp 0x1dd02
movapd %xmm7, %xmm0
movsd %xmm6, 0x10(%rsp)
movsd %xmm7, 0x8(%rsp)
callq 0x4300
movsd 0x8(%rsp), %xmm7
movsd 0x10(%rsp), %xmm6
movsd 0x77890(%rip), %xmm5    # 0x95520
movapd %xmm0, %xmm1
movsd 0x78083(%rip), %xmm8    # 0x95d20
mulsd %xmm7, %xmm8
mulsd %xmm1, %xmm8
movsd 0x77871(%rip), %xmm0    # 0x95520
subsd %xmm1, %xmm0
jmp 0x1dd02
movapd %xmm6, %xmm0
callq 0x4300
movsd 0x8(%rsp), %xmm7
movsd 0x79e7c(%rip), %xmm1    # 0x97b48
mulsd %xmm7, %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rsp)
callq 0x4180
movsd 0x18(%rsp), %xmm8
movsd 0x8(%rsp), %xmm7
mulsd 0x79e5c(%rip), %xmm0    # 0x97b50
movsd 0x77824(%rip), %xmm5    # 0x95520
movsd 0x10(%rsp), %xmm6
subl %r12d, %r15d
movapd %xmm6, %xmm1
addsd %xmm6, %xmm1
divsd %xmm7, %xmm1
cvtsi2sd %r14d, %xmm2
cmpl %ebx, %r15d
jg 0x1dd69
leal -0x2(%r15), %eax
cvtsi2sd %eax, %xmm3
movapd %xmm2, %xmm4
divsd %xmm3, %xmm4
addsd %xmm5, %xmm4
mulsd %xmm7, %xmm4
mulsd %xmm4, %xmm8
testb $0x1, %bpl
jne 0x1dd48
addsd %xmm6, %xmm0
mulsd %xmm7, %xmm0
jmp 0x1dd61
movapd %xmm1, %xmm3
mulsd %xmm8, %xmm3
decl %r15d
cvtsi2sd %r15d, %xmm4
divsd %xmm4, %xmm3
addsd %xmm3, %xmm0
addl $0x4, %eax
movl %eax, %r15d
jmp 0x1dd16
mulsd %xmm7, %xmm6
movsd 0x782d3(%rip), %xmm1    # 0x96048
divsd %xmm7, %xmm1
leal 0x2(%r14), %eax
cmpl %ebp, %eax
jg 0x1ddb5
leal (%rbx,%r14), %ecx
cvtsi2sd %ecx, %xmm2
movapd %xmm6, %xmm3
cvtsi2sd %r14d, %xmm4
mulsd %xmm2, %xmm3
divsd %xmm4, %xmm3
mulsd %xmm3, %xmm8
movapd %xmm1, %xmm3
mulsd %xmm8, %xmm3
divsd %xmm2, %xmm3
subsd %xmm3, %xmm0
movl %eax, %r14d
jmp 0x1dd79
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x1ddd1
ucomisd 0x77759(%rip), %xmm0    # 0x95520
movapd %xmm0, %xmm1
jbe 0x1ddd1
movapd %xmm5, %xmm1
subsd %xmm1, %xmm5
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
movapd %xmm5, %xmm0
retq