#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double _fmax(double, int /*<<< orphan*/);
int /*<<< orphan*/ _fmin(double, double);
double invigauss_quick(double);
double sqrt(double);
double invibeta_quick(double p, double a, double b) {
  double x, m, s;
  x = a + b;
  m = a / x;
  s = sqrt((a * b) / (x * x * (x + 1)));
  return (_fmax(0.0, _fmin(1.0, invigauss_quick(p) * s + m)));
}


x86 assembly (clang, -O0):
<invibeta_quick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  0xe6f(%rip),%xmm2
addsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <invigauss_quick@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe31(%rip),%xmm0
call   1040 <_fmin@plt>
mov    %eax,%edi
xorps  %xmm0,%xmm0
call   1030 <_fmax@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invibeta_quick>:
sub    $0x18,%rsp
movapd %xmm0,%xmm4
movapd %xmm1,%xmm0
addsd  %xmm2,%xmm0
movapd %xmm1,%xmm3
divsd  %xmm0,%xmm3
movsd  %xmm3,0x10(%rsp)
mulsd  %xmm2,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe8e(%rip),%xmm0
mulsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     118d <invibeta_quick+0x4d>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    11a2 <invibeta_quick+0x62>
movapd %xmm1,%xmm0
movsd  %xmm4,0x8(%rsp)
call   1060 <sqrt@plt>
movsd  0x8(%rsp),%xmm4
movsd  %xmm0,(%rsp)
movapd %xmm4,%xmm0
call   1050 <invigauss_quick@plt>
movsd  (%rsp),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%rsp),%xmm1
movsd  0xe39(%rip),%xmm0
call   1040 <_fmin@plt>
xorps  %xmm0,%xmm0
mov    %eax,%edi
add    $0x18,%rsp
jmp    1030 <_fmax@plt>

LLVM IR (-O0):
define double @invibeta_quick(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%10 = load double, double* %5
%11 = load double, double* %6
%12 = fadd double %10, %11
store double %12, double* %7
%13 = load double, double* %5
%14 = load double, double* %7
%15 = fdiv double %13, %14
store double %15, double* %8
%16 = load double, double* %5
%17 = load double, double* %6
%18 = fmul double %16, %17
%19 = load double, double* %7
%20 = load double, double* %7
%21 = fmul double %19, %20
%22 = load double, double* %7
%23 = fadd double %22, 1.000000e+00
%24 = fmul double %21, %23
%25 = fdiv double %18, %24
%26 = call double @sqrt(double %25)
store double %26, double* %9
%27 = load double, double* %4
%28 = call double @invigauss_quick(double %27)
%29 = load double, double* %9
%30 = load double, double* %8
%31 = call double @llvm.fmuladd.f64(double %28, double %29, double %30)
%32 = call i32 @_fmin(double 1.000000e+00, double %31)
%33 = call double @_fmax(double 0.000000e+00, i32 %32)
ret double %33
}

LLVM IR (-O2):
define double @invibeta_quick(double %0, double %1, double %2) {
%4 = fadd double %1, %2
%5 = fdiv double %1, %4
%6 = fmul double %1, %2
%7 = fmul double %4, %4
%8 = fadd double %4, 1.000000e+00
%9 = fmul double %7, %8
%10 = fdiv double %6, %9
%11 = tail call double @sqrt(double %10)
%12 = tail call double @invigauss_quick(double %0)
%13 = tail call double @llvm.fmuladd.f64(double %12, double %11, double %5)
%14 = tail call i32 @_fmin(double 1.000000e+00, double %13)
%15 = tail call double @_fmax(double 0.000000e+00, i32 %14)
ret double %15
}