#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 erf(double);
double sqrt(double);
double fgamma_0(double x) {
  double t;
  if (x < 0.0005)
    return 1.0 - x / 3.0 + x * x / 10.0;
  t = sqrt(x);
  return (double)0.8862269254528 * erf(t) / t;
}


x86 assembly (clang, -O0):
<fgamma_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xecb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1181 <fgamma_0+0x61>
movsd  -0x10(%rbp),%xmm1
movsd  0xed3(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xebf(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xea1(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11b3 <fgamma_0+0x93>
movsd  -0x10(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <erf@plt>
movaps %xmm0,%xmm1
movsd  0xe63(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgamma_0>:
push   %rax
movsd  0xed7(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1159 <fgamma_0+0x39>
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
unpcklpd %xmm1,%xmm0
divpd  0xedd(%rip),%xmm0
movsd  0xec5(%rip),%xmm1
subsd  %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1169 <fgamma_0+0x49>
sqrtsd %xmm0,%xmm0
jmp    116e <fgamma_0+0x4e>
call   1030 <sqrt@plt>
movsd  %xmm0,(%rsp)
call   1040 <erf@plt>
mulsd  0xe88(%rip),%xmm0
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fgamma_0(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fcmp olt double %5, 5.000000e-04
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load double, double* %3
%9 = fdiv double %8, 3.000000e+00
%10 = fsub double 1.000000e+00, %9
%11 = load double, double* %3
%12 = load double, double* %3
%13 = fmul double %11, %12
%14 = fdiv double %13, 1.000000e+01
%15 = fadd double %10, %14
store double %15, double* %2
br label %24
16: ; preds = %1
%17 = load double, double* %3
%18 = call double @sqrt(double %17)
store double %18, double* %4
%19 = load double, double* %4
%20 = call double @erf(double %19)
%21 = fmul double 0x3FEC5BF891B4F0E5, %20
%22 = load double, double* %4
%23 = fdiv double %21, %22
store double %23, double* %2
br label %24
24: ; preds = %16, %7
%25 = load double, double* %2
ret double %25
}

LLVM IR (-O2):
define double @fgamma_0(double %0) {
%2 = fcmp olt double %0, 5.000000e-04
br i1 %2, label %3, label %12
3: ; preds = %1
%4 = fmul double %0, %0
%5 = insertelement <2 x double> poison, double %0, i64 0
%6 = insertelement <2 x double> %5, double %4, i64 1
%7 = fdiv <2 x double> %6, <double 3.000000e+00, double 1.000000e+01>
%8 = extractelement <2 x double> %7, i64 0
%9 = fsub double 1.000000e+00, %8
%10 = extractelement <2 x double> %7, i64 1
%11 = fadd double %9, %10
br label %17
12: ; preds = %1
%13 = tail call double @sqrt(double %0)
%14 = tail call double @erf(double %13)
%15 = fmul double %14, 0x3FEC5BF891B4F0E5
%16 = fdiv double %15, %13
br label %17
17: ; preds = %12, %3
%18 = phi double [ %11, %3 ], [ %16, %12 ]
ret double %18
}