#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 const expf(float);
float fabsf(float);
float func(float X) {
  float y, a, t;
  const float c1 = 0.319381530f;
  const float c2 = -0.356563782f;
  const float c3 = 1.781477937f;
  const float c4 = -1.821255978f;
  const float c5 = 1.330274429f;
  const float oneBySqrt2pi = 0.398942280f;
  a = fabsf(X);
  t = 1.0f / (1.0f + 0.2316419f * a);
  y = 1.0f - oneBySqrt2pi * expf(-X * X / 2.0f) * t *
                 (c1 + t * (c2 + t * (c3 + t * (c4 + t * c5))));
  return (X < 0.0f) ? (1.0f - y) : y;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedf(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xed6(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xecd(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xec8(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xeb7(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  0xeb2(%rip),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x4(%rbp),%xmm0
movaps 0xeb9(%rip),%xmm1
pand   %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm1
movss  0xe93(%rip),%xmm0
mulss  %xmm0,%xmm1
movss  0xe67(%rip),%xmm0
addss  %xmm0,%xmm1
movss  0xe5b(%rip),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xe4f(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <expf@plt>
movaps %xmm0,%xmm1
movss  0xe37(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  -0x10(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movss  -0x10(%rbp),%xmm4
movss  0xe0a(%rip),%xmm5
mulss  %xmm5,%xmm4
movss  0xe02(%rip),%xmm5
addss  %xmm5,%xmm4
mulss  %xmm4,%xmm3
movss  0xdea(%rip),%xmm4
addss  %xmm4,%xmm3
mulss  %xmm3,%xmm2
movss  0xdd6(%rip),%xmm3
addss  %xmm3,%xmm2
mulss  %xmm2,%xmm1
movss  0xdc2(%rip),%xmm2
addss  %xmm2,%xmm1
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm1,%xmm0
movss  0xda1(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    128c <func+0x17c>
movss  0xd83(%rip),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
jmp    1296 <func+0x186>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
sub    $0x28,%rsp
movaps %xmm0,0x10(%rsp)
movaps 0xee0(%rip),%xmm1
andps  %xmm0,%xmm1
mulss  0xee5(%rip),%xmm1
movss  0xee1(%rip),%xmm2
addss  %xmm2,%xmm1
divss  %xmm1,%xmm2
movss  %xmm2,0xc(%rsp)
mulss  %xmm0,%xmm0
mulss  0xecb(%rip),%xmm0
call   1030 <expf@plt>
movss  0xec2(%rip),%xmm1
movss  0xc(%rsp),%xmm2
mulss  %xmm2,%xmm1
addss  0xeb4(%rip),%xmm1
mulss  %xmm2,%xmm1
addss  0xeac(%rip),%xmm1
mulss  %xmm2,%xmm1
addss  0xea4(%rip),%xmm1
mulss  %xmm2,%xmm1
addss  0xe9c(%rip),%xmm1
mulss  0xe98(%rip),%xmm0
mulss  %xmm2,%xmm0
mulss  %xmm1,%xmm0
movss  0xe6c(%rip),%xmm1
addss  %xmm1,%xmm0
subss  %xmm0,%xmm1
movaps %xmm1,%xmm3
xorps  %xmm1,%xmm1
movaps 0x10(%rsp),%xmm2
cmpltss %xmm1,%xmm2
movaps %xmm2,%xmm1
andnps %xmm0,%xmm1
andps  %xmm3,%xmm2
orps   %xmm1,%xmm2
movaps %xmm2,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @func(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
store float %0, float* %2
store float 0x3FD470BF40000000, float* %6
store float 0xBFD6D1F0E0000000, float* %7
store float 0x3FFC80EF00000000, float* %8
store float 0xBFFD23DD40000000, float* %9
store float 0x3FF548CDE0000000, float* %10
store float 0x3FD9884540000000, float* %11
%12 = load float, float* %2
%13 = call float @llvm.fabs.f32(float %12)
store float %13, float* %4
%14 = load float, float* %4
%15 = call float @llvm.fmuladd.f32(float 0x3FCDA67120000000, float %14, float 1.000000e+00)
%16 = fdiv float 1.000000e+00, %15
store float %16, float* %5
%17 = load float, float* %2
%18 = fneg float %17
%19 = load float, float* %2
%20 = fmul float %18, %19
%21 = fdiv float %20, 2.000000e+00
%22 = call float @expf(float %21)
%23 = fmul float 0x3FD9884540000000, %22
%24 = load float, float* %5
%25 = fmul float %23, %24
%26 = load float, float* %5
%27 = load float, float* %5
%28 = load float, float* %5
%29 = load float, float* %5
%30 = call float @llvm.fmuladd.f32(float %29, float 0x3FF548CDE0000000, float 0xBFFD23DD40000000)
%31 = call float @llvm.fmuladd.f32(float %28, float %30, float 0x3FFC80EF00000000)
%32 = call float @llvm.fmuladd.f32(float %27, float %31, float 0xBFD6D1F0E0000000)
%33 = call float @llvm.fmuladd.f32(float %26, float %32, float 0x3FD470BF40000000)
%34 = fneg float %25
%35 = call float @llvm.fmuladd.f32(float %34, float %33, float 1.000000e+00)
store float %35, float* %3
%36 = load float, float* %2
%37 = fcmp olt float %36, 0.000000e+00
br i1 %37, label %38, label %41
38: ; preds = %1
%39 = load float, float* %3
%40 = fsub float 1.000000e+00, %39
br label %43
41: ; preds = %1
%42 = load float, float* %3
br label %43
43: ; preds = %41, %38
%44 = phi float [ %40, %38 ], [ %42, %41 ]
ret float %44
}

LLVM IR (-O2):
define float @func(float %0) {
%2 = tail call float @llvm.fabs.f32(float %0)
%3 = tail call float @llvm.fmuladd.f32(float %2, float 0x3FCDA67120000000, float 1.000000e+00)
%4 = fdiv float 1.000000e+00, %3
%5 = fneg float %0
%6 = fmul float %5, %0
%7 = fmul float %6, 5.000000e-01
%8 = tail call float @expf(float %7)
%9 = tail call float @llvm.fmuladd.f32(float %4, float 0x3FF548CDE0000000, float 0xBFFD23DD40000000)
%10 = tail call float @llvm.fmuladd.f32(float %4, float %9, float 0x3FFC80EF00000000)
%11 = tail call float @llvm.fmuladd.f32(float %4, float %10, float 0xBFD6D1F0E0000000)
%12 = tail call float @llvm.fmuladd.f32(float %4, float %11, float 0x3FD470BF40000000)
%13 = fmul float %8, 0xBFD9884540000000
%14 = fmul float %4, %13
%15 = tail call float @llvm.fmuladd.f32(float %14, float %12, float 1.000000e+00)
%16 = fcmp olt float %0, 0.000000e+00
%17 = fsub float 1.000000e+00, %15
%18 = select i1 %16, float %17, float %15
ret float %18
}