#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 const expm1(double const);
double gauss_coil(double qr) {
  const double x = qr * qr;
  if (x < 0.8) {
    const double C0 = +1.;
    const double C1 = -1. / 3.;
    const double C2 = +1. / 12.;
    const double C3 = -1. / 60.;
    const double C4 = +1. / 360.;
    const double C5 = -1. / 2520.;
    const double C6 = +1. / 20160.;
    const double C7 = -1. / 181440.;
    return ((((((C7 * x + C6) * x + C5) * x + C4) * x + C3) * x + C2) * x +
            C1) *
               x +
           C0;
  }
  return 2.0 * (expm1(-x) + x) / (x * x);
}


x86 assembly (clang, -O0):
<gauss_coil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xecc(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    124c <gauss_coil+0x13c>
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xebf(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeba(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xeb5(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xeb0(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xeb3(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe9e(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe8c(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe88(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe63(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe46(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe29(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe0c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdef(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdd2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1294 <gauss_coil+0x184>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <expm1@plt>
movaps %xmm0,%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  0xd8b(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gauss_coil>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xedc(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    118b <gauss_coil+0x7b>
movsd  0xed6(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xed2(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xece(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xeca(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xec6(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xec2(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xebe(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xeba(%rip),%xmm0
add    $0x18,%rsp
ret
movapd 0xebd(%rip),%xmm0
xorpd  %xmm1,%xmm0
movapd %xmm1,(%rsp)
call   1030 <expm1@plt>
movapd (%rsp),%xmm1
addsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @gauss_coil(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %3
%13 = load double, double* %3
%14 = load double, double* %3
%15 = fmul double %13, %14
store double %15, double* %4
%16 = load double, double* %4
%17 = fcmp olt double %16, 8.000000e-01
br i1 %17, label %18, label %33
18: ; preds = %1
store double 1.000000e+00, double* %5
store double 0xBFD5555555555555, double* %6
store double 0x3FB5555555555555, double* %7
store double 0xBF91111111111111, double* %8
store double 0x3F66C16C16C16C17, double* %9
store double 0xBF3A01A01A01A01A, double* %10
store double 0x3F0A01A01A01A01A, double* %11
store double 0xBED71DE3A556C734, double* %12
%19 = load double, double* %4
%20 = call double @llvm.fmuladd.f64(double 0xBED71DE3A556C734, double %19, double 0x3F0A01A01A01A01A)
%21 = load double, double* %4
%22 = call double @llvm.fmuladd.f64(double %20, double %21, double 0xBF3A01A01A01A01A)
%23 = load double, double* %4
%24 = call double @llvm.fmuladd.f64(double %22, double %23, double 0x3F66C16C16C16C17)
%25 = load double, double* %4
%26 = call double @llvm.fmuladd.f64(double %24, double %25, double 0xBF91111111111111)
%27 = load double, double* %4
%28 = call double @llvm.fmuladd.f64(double %26, double %27, double 0x3FB5555555555555)
%29 = load double, double* %4
%30 = call double @llvm.fmuladd.f64(double %28, double %29, double 0xBFD5555555555555)
%31 = load double, double* %4
%32 = call double @llvm.fmuladd.f64(double %30, double %31, double 1.000000e+00)
store double %32, double* %2
br label %44
33: ; preds = %1
%34 = load double, double* %4
%35 = fneg double %34
%36 = call double @expm1(double %35)
%37 = load double, double* %4
%38 = fadd double %36, %37
%39 = fmul double 2.000000e+00, %38
%40 = load double, double* %4
%41 = load double, double* %4
%42 = fmul double %40, %41
%43 = fdiv double %39, %42
store double %43, double* %2
br label %44
44: ; preds = %33, %18
%45 = load double, double* %2
ret double %45
}

LLVM IR (-O2):
define double @gauss_coil(double %0) {
%2 = fmul double %0, %0
%3 = fcmp olt double %2, 8.000000e-01
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = tail call double @llvm.fmuladd.f64(double %2, double 0xBED71DE3A556C734, double 0x3F0A01A01A01A01A)
%6 = tail call double @llvm.fmuladd.f64(double %5, double %2, double 0xBF3A01A01A01A01A)
%7 = tail call double @llvm.fmuladd.f64(double %6, double %2, double 0x3F66C16C16C16C17)
%8 = tail call double @llvm.fmuladd.f64(double %7, double %2, double 0xBF91111111111111)
%9 = tail call double @llvm.fmuladd.f64(double %8, double %2, double 0x3FB5555555555555)
%10 = tail call double @llvm.fmuladd.f64(double %9, double %2, double 0xBFD5555555555555)
%11 = tail call double @llvm.fmuladd.f64(double %10, double %2, double 1.000000e+00)
br label %19
12: ; preds = %1
%13 = fneg double %2
%14 = tail call double @expm1(double %13)
%15 = fadd double %2, %14
%16 = fmul double %15, 2.000000e+00
%17 = fmul double %2, %2
%18 = fdiv double %16, %17
br label %19
19: ; preds = %12, %4
%20 = phi double [ %11, %4 ], [ %18, %12 ]
ret double %20
}