#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 fabs(double const);
double get_del(double const, double);
double gauss_medium(const double x) {
  unsigned int i;
  double temp = 0.0;
  double result = 0.0;
  double xnum;
  double xden;
  double absx;
  const double c[9] = {
      0.39894151208813466764, 8.8831497943883759412, 93.506656132177855979,
      597.27027639480026226,  2494.5375852903726711, 6848.1904505362823326,
      11602.651437647350124,  9842.7148383839780218, 1.0765576773720192317e-8};
  const double d[8] = {22.266688044328115691, 235.38790178262499861,
                       1519.377599407554805,  6485.558298266760755,
                       18615.571640885098091, 34900.952721145977266,
                       38912.003286093271411, 19685.429676859990727};
  absx = fabs(x);
  xnum = c[8] * absx;
  xden = absx;
  for (i = 0; i < 7; i++) {
    xnum = (xnum + c[i]) * absx;
    xden = (xden + d[i]) * absx;
  }
  temp = (xnum + c[7]) / (xden + d[7]);
  result = get_del(x, temp);
  return result;
}


x86 assembly (clang, -O0):
<gauss_medium>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xec5(%rip),%rsi
mov    $0x48,%edx
call   1030 <memcpy@plt>
lea    -0xc0(%rbp),%rdi
lea    0xefd(%rip),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
movsd  -0x8(%rbp),%xmm0
movaps 0xe87(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jae    11ed <gauss_medium+0xcd>
movsd  -0x28(%rbp),%xmm0
mov    -0xc(%rbp),%eax
addsd  -0x80(%rbp,%rax,8),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0xc(%rbp),%eax
addsd  -0xc0(%rbp,%rax,8),%xmm0
ff ff
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11a2 <gauss_medium+0x82>
movsd  -0x28(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
addsd  -0x88(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <get_del@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gauss_medium>:
movapd 0xee8(%rip),%xmm2
andpd  %xmm0,%xmm2
movsd  0xf6c(%rip),%xmm1
mulsd  %xmm2,%xmm1
unpcklpd %xmm2,%xmm1
addpd  0xedc(%rip),%xmm1
pshufd $0x44,%xmm2,%xmm2
mulpd  %xmm2,%xmm1
addpd  0xedb(%rip),%xmm1
mulpd  %xmm2,%xmm1
addpd  0xedf(%rip),%xmm1
mulpd  %xmm2,%xmm1
addpd  0xee3(%rip),%xmm1
mulpd  %xmm2,%xmm1
addpd  0xee7(%rip),%xmm1
mulpd  %xmm2,%xmm1
addpd  0xeeb(%rip),%xmm1
mulpd  %xmm2,%xmm1
addpd  0xeef(%rip),%xmm1
mulpd  %xmm2,%xmm1
addpd  0xef3(%rip),%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
divsd  %xmm2,%xmm1
jmp    1030 <get_del@plt>

LLVM IR (-O0):
@__const.gauss_medium.c = [9 x double] [double 0x3FD98841FADBDC66, double 0x4021C42C35B8BC02, double 0x4057606D0DD78164, double 0x4082AA2986ABA462, double 0x40A37D133E6111EC, double 0x40BAC030C15DC8D7, double 0x40C6A953624F0F60, double 0x40C3395B7FD2FC8E, double 0x3E471E703C5F5815]
@__const.gauss_medium.d = [8 x double] [double 0x40364445AAEC9F9B, double 0x406D6C69B0FFCDE7, double 0x4097BD82A96B49BF, double 0x40B9558EECA29D27, double 0x40D22DE495C3A6A3, double 0x40E10A9E7CB10E86, double 0x40E300001AEB6FE4, double 0x40D3395B7FD35F61]
define double @gauss_medium(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca [9 x double]
%10 = alloca [8 x double]
store double %0, double* %2
store double 0.000000e+00, double* %4
store double 0.000000e+00, double* %5
%11 = bitcast [9 x double]* %9 to i8*
%12 = bitcast [8 x double]* %10 to i8*
%13 = load double, double* %2
%14 = call double @llvm.fabs.f64(double %13)
store double %14, double* %8
%15 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 8
%16 = load double, double* %15
%17 = load double, double* %8
%18 = fmul double %16, %17
store double %18, double* %6
%19 = load double, double* %8
store double %19, double* %7
store i32 0, i32* %3
br label %20
20: ; preds = %40, %1
%21 = load i32, i32* %3
%22 = icmp ult i32 %21, 7
br i1 %22, label %23, label %43
23: ; preds = %20
%24 = load double, double* %6
%25 = load i32, i32* %3
%26 = zext i32 %25 to i64
%27 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 %26
%28 = load double, double* %27
%29 = fadd double %24, %28
%30 = load double, double* %8
%31 = fmul double %29, %30
store double %31, double* %6
%32 = load double, double* %7
%33 = load i32, i32* %3
%34 = zext i32 %33 to i64
%35 = getelementptr inbounds [8 x double], [8 x double]* %10, i64 0, i64 %34
%36 = load double, double* %35
%37 = fadd double %32, %36
%38 = load double, double* %8
%39 = fmul double %37, %38
store double %39, double* %7
br label %40
40: ; preds = %23
%41 = load i32, i32* %3
%42 = add i32 %41, 1
store i32 %42, i32* %3
br label %20
43: ; preds = %20
%44 = load double, double* %6
%45 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 7
%46 = load double, double* %45
%47 = fadd double %44, %46
%48 = load double, double* %7
%49 = getelementptr inbounds [8 x double], [8 x double]* %10, i64 0, i64 7
%50 = load double, double* %49
%51 = fadd double %48, %50
%52 = fdiv double %47, %51
store double %52, double* %4
%53 = load double, double* %2
%54 = load double, double* %4
%55 = call double @get_del(double %53, double %54)
store double %55, double* %5
%56 = load double, double* %5
ret double %56
}

LLVM IR (-O2):
define double @gauss_medium(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fmul double %2, 0x3E471E703C5F5815
%4 = insertelement <2 x double> poison, double %3, i64 0
%5 = insertelement <2 x double> %4, double %2, i64 1
%6 = fadd <2 x double> %5, <double 0x3FD98841FADBDC66, double 0x40364445AAEC9F9B>
%7 = insertelement <2 x double> poison, double %2, i64 0
%8 = shufflevector <2 x double> %7, <2 x double> poison, <2 x i32> zeroinitializer
%9 = fmul <2 x double> %8, %6
%10 = fadd <2 x double> %9, <double 0x4021C42C35B8BC02, double 0x406D6C69B0FFCDE7>
%11 = fmul <2 x double> %8, %10
%12 = fadd <2 x double> %11, <double 0x4057606D0DD78164, double 0x4097BD82A96B49BF>
%13 = fmul <2 x double> %8, %12
%14 = fadd <2 x double> %13, <double 0x4082AA2986ABA462, double 0x40B9558EECA29D27>
%15 = fmul <2 x double> %8, %14
%16 = fadd <2 x double> %15, <double 0x40A37D133E6111EC, double 0x40D22DE495C3A6A3>
%17 = fmul <2 x double> %8, %16
%18 = fadd <2 x double> %17, <double 0x40BAC030C15DC8D7, double 0x40E10A9E7CB10E86>
%19 = fmul <2 x double> %8, %18
%20 = fadd <2 x double> %19, <double 0x40C6A953624F0F60, double 0x40E300001AEB6FE4>
%21 = fmul <2 x double> %8, %20
%22 = fadd <2 x double> %21, <double 0x40C3395B7FD2FC8E, double 0x40D3395B7FD35F61>
%23 = extractelement <2 x double> %22, i64 0
%24 = extractelement <2 x double> %22, i64 1
%25 = fdiv double %23, %24
%26 = tail call double @get_del(double %0, double %25)
ret double %26
}