#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 exp(double);
double BLAST_Expm1(double x) {
  double absx = ((x) >= 0 ? (x) : -(x));
  if (absx > .33)
    return exp(x) - 1.;
  if (absx < 1.e-16)
    return x;
  return x *
         (1. +
          x * (1. / 2. +
               x * (1. / 6. +
                    x * (1. / 24. +
                         x * (1. / 120. +
                              x * (1. / 720. +
                                   x * (1. / 5040. +
                                        x * (1. / 40320. +
                                             x * (1. / 362880. +
                                                  x * (1. / 3628800. +
                                                       x * (1. / 39916800. +
                                                            x * (1. /
                                                                     479001600. +
                                                                 x / 6227020800.))))))))))));
}


x86 assembly (clang, -O0):
<BLAST_Expm1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     113e <BLAST_Expm1+0x2e>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    115f <BLAST_Expm1+0x4f>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe8a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11a0 <BLAST_Expm1+0x90>
movsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movsd  0xe7e(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12ec <BLAST_Expm1+0x1dc>
movsd  0xe60(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    11c2 <BLAST_Expm1+0xb2>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12ec <BLAST_Expm1+0x1dc>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm3
movsd  -0x10(%rbp),%xmm4
movsd  -0x10(%rbp),%xmm5
movsd  -0x10(%rbp),%xmm6
movsd  -0x10(%rbp),%xmm7
movsd  -0x10(%rbp),%xmm8
movsd  -0x10(%rbp),%xmm9
movsd  -0x10(%rbp),%xmm10
movsd  -0x10(%rbp),%xmm11
movsd  -0x10(%rbp),%xmm13
movsd  0xe5f(%rip),%xmm12
divsd  %xmm12,%xmm13
movsd  0xe49(%rip),%xmm12
addsd  %xmm13,%xmm12
mulsd  %xmm12,%xmm11
movsd  0xe2e(%rip),%xmm12
addsd  %xmm12,%xmm11
mulsd  %xmm11,%xmm10
movsd  0xe13(%rip),%xmm11
addsd  %xmm11,%xmm10
mulsd  %xmm10,%xmm9
movsd  0xdf8(%rip),%xmm10
addsd  %xmm10,%xmm9
mulsd  %xmm9,%xmm8
movsd  0xddd(%rip),%xmm9
addsd  %xmm9,%xmm8
mulsd  %xmm8,%xmm7
movsd  0xdc2(%rip),%xmm8
addsd  %xmm8,%xmm7
mulsd  %xmm7,%xmm6
movsd  0xda9(%rip),%xmm7
addsd  %xmm7,%xmm6
mulsd  %xmm6,%xmm5
movsd  0xd91(%rip),%xmm6
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm4
movsd  0xd79(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xd61(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xd49(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd31(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BLAST_Expm1>:
push   %rax
movapd 0xee7(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm1,%xmm1
cmplesd %xmm0,%xmm1
movapd %xmm1,%xmm3
andpd  %xmm0,%xmm3
andnpd %xmm2,%xmm1
orpd   %xmm3,%xmm1
ucomisd 0xed2(%rip),%xmm1
jbe    114f <BLAST_Expm1+0x3f>
call   1030 <exp@plt>
addsd  0xf3b(%rip),%xmm0
pop    %rax
ret
movsd  0xec1(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     11fd <BLAST_Expm1+0xed>
movapd %xmm0,%xmm1
divsd  0xeb3(%rip),%xmm1
addsd  0xeb3(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeaf(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeab(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xea7(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xea3(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe9f(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe9b(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe97(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe93(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe8f(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe8b(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe87(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @BLAST_Expm1(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fcmp oge double %5, 0.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load double, double* %3
br label %12
9: ; preds = %1
%10 = load double, double* %3
%11 = fneg double %10
br label %12
12: ; preds = %9, %7
%13 = phi double [ %8, %7 ], [ %11, %9 ]
store double %13, double* %4
%14 = load double, double* %4
%15 = fcmp ogt double %14, 3.300000e-01
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load double, double* %3
%18 = call double @exp(double %17)
%19 = fsub double %18, 1.000000e+00
store double %19, double* %2
br label %53
20: ; preds = %12
%21 = load double, double* %4
%22 = fcmp olt double %21, 0x3C9CD2B297D889BC
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = load double, double* %3
store double %24, double* %2
br label %53
25: ; preds = %20
%26 = load double, double* %3
%27 = load double, double* %3
%28 = load double, double* %3
%29 = load double, double* %3
%30 = load double, double* %3
%31 = load double, double* %3
%32 = load double, double* %3
%33 = load double, double* %3
%34 = load double, double* %3
%35 = load double, double* %3
%36 = load double, double* %3
%37 = load double, double* %3
%38 = load double, double* %3
%39 = fdiv double %38, 0x41F7328CC0000000
%40 = fadd double 0x3E21EED8EFF8D898, %39
%41 = call double @llvm.fmuladd.f64(double %37, double %40, double 0x3E5AE64567F544E4)
%42 = call double @llvm.fmuladd.f64(double %36, double %41, double 0x3E927E4FB7789F5C)
%43 = call double @llvm.fmuladd.f64(double %35, double %42, double 0x3EC71DE3A556C734)
%44 = call double @llvm.fmuladd.f64(double %34, double %43, double 0x3EFA01A01A01A01A)
%45 = call double @llvm.fmuladd.f64(double %33, double %44, double 0x3F2A01A01A01A01A)
%46 = call double @llvm.fmuladd.f64(double %32, double %45, double 0x3F56C16C16C16C17)
%47 = call double @llvm.fmuladd.f64(double %31, double %46, double 0x3F81111111111111)
%48 = call double @llvm.fmuladd.f64(double %30, double %47, double 0x3FA5555555555555)
%49 = call double @llvm.fmuladd.f64(double %29, double %48, double 0x3FC5555555555555)
%50 = call double @llvm.fmuladd.f64(double %28, double %49, double 5.000000e-01)
%51 = call double @llvm.fmuladd.f64(double %27, double %50, double 1.000000e+00)
%52 = fmul double %26, %51
store double %52, double* %2
br label %53
53: ; preds = %25, %23, %16
%54 = load double, double* %2
ret double %54
}

LLVM IR (-O2):
define double @BLAST_Expm1(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
%5 = fcmp ogt double %4, 3.300000e-01
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call double @exp(double %0)
%8 = fadd double %7, -1.000000e+00
br label %26
9: ; preds = %1
%10 = fcmp olt double %4, 0x3C9CD2B297D889BC
br i1 %10, label %26, label %11
11: ; preds = %9
%12 = fdiv double %0, 0x41F7328CC0000000
%13 = fadd double %12, 0x3E21EED8EFF8D898
%14 = tail call double @llvm.fmuladd.f64(double %0, double %13, double 0x3E5AE64567F544E4)
%15 = tail call double @llvm.fmuladd.f64(double %0, double %14, double 0x3E927E4FB7789F5C)
%16 = tail call double @llvm.fmuladd.f64(double %0, double %15, double 0x3EC71DE3A556C734)
%17 = tail call double @llvm.fmuladd.f64(double %0, double %16, double 0x3EFA01A01A01A01A)
%18 = tail call double @llvm.fmuladd.f64(double %0, double %17, double 0x3F2A01A01A01A01A)
%19 = tail call double @llvm.fmuladd.f64(double %0, double %18, double 0x3F56C16C16C16C17)
%20 = tail call double @llvm.fmuladd.f64(double %0, double %19, double 0x3F81111111111111)
%21 = tail call double @llvm.fmuladd.f64(double %0, double %20, double 0x3FA5555555555555)
%22 = tail call double @llvm.fmuladd.f64(double %0, double %21, double 0x3FC5555555555555)
%23 = tail call double @llvm.fmuladd.f64(double %0, double %22, double 5.000000e-01)
%24 = tail call double @llvm.fmuladd.f64(double %0, double %23, double 1.000000e+00)
%25 = fmul double %24, %0
br label %26
26: ; preds = %9, %11, %6
%27 = phi double [ %8, %6 ], [ %25, %11 ], [ %0, %9 ]
ret double %27
}