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


x86 assembly (clang, -O0):
<fgamma_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1195 <fgamma_0+0x75>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xebf(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeab(%rip),%xmm0
subsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe89(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11c7 <fgamma_0+0xa7>
movss  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <erf@plt>
movaps %xmm0,%xmm1
movss  0xe67(%rip),%xmm0
mulss  %xmm1,%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgamma_0>:
push   %rax
cvtss2sd %xmm0,%xmm1
movsd  0xed3(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    1163 <fgamma_0+0x43>
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movlhps %xmm0,%xmm1
divpd  0xeda(%rip),%xmm1
movsd  0xeba(%rip),%xmm0
subsd  %xmm1,%xmm0
unpckhpd %xmm1,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1171 <fgamma_0+0x51>
sqrtss %xmm0,%xmm0
jmp    1176 <fgamma_0+0x56>
call   1030 <sqrt@plt>
movss  %xmm0,0x4(%rsp)
call   1040 <erf@plt>
mulss  0xe87(%rip),%xmm0
divss  0x4(%rsp),%xmm0
pop    %rax
ret

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

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