#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 */
int exp(double);
int fabs(double);
double FF(double x) {
  if (fabs(x) > 1e-2) {
    return (exp(x) - 1) / x;
  } else {
    return 1 + x * (1 + x * (1 + x * (1 + x / 5) / 4) / 3) / 2;
  }
}


x86 assembly (clang, -O0):
<FF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xebd(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    116d <FF+0x4d>
movsd  -0x10(%rbp),%xmm0
call   1040 <exp@plt>
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11f2 <FF+0xd2>
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm3
movsd  -0x10(%rbp),%xmm4
movsd  0xe9f(%rip),%xmm0
divsd  %xmm0,%xmm4
movsd  0xe73(%rip),%xmm0
addsd  %xmm4,%xmm0
mulsd  %xmm0,%xmm3
movsd  0xe7b(%rip),%xmm0
divsd  %xmm0,%xmm3
movsd  0xe57(%rip),%xmm0
addsd  %xmm3,%xmm0
mulsd  %xmm0,%xmm2
movsd  0xe57(%rip),%xmm0
divsd  %xmm0,%xmm2
movsd  0xe3b(%rip),%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe33(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe1f(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FF>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <fabs@plt>
test   %eax,%eax
jle    114a <FF+0x2a>
movsd  (%rsp),%xmm0
call   1040 <exp@plt>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  (%rsp),%xmm0
pop    %rax
ret
movsd  (%rsp),%xmm2
movapd %xmm2,%xmm0
divsd  0xea5(%rip),%xmm0
movsd  0xea5(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
mulsd  0xe9d(%rip),%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
divsd  0xe95(%rip),%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
mulsd  0xe8d(%rip),%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @FF(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call i32 @fabs(double %4)
%6 = sitofp i32 %5 to double
%7 = fcmp ogt double %6, 1.000000e-02
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load double, double* %3
%10 = call i32 @exp(double %9)
%11 = sub nsw i32 %10, 1
%12 = sitofp i32 %11 to double
%13 = load double, double* %3
%14 = fdiv double %12, %13
store double %14, double* %2
br label %31
15: ; preds = %1
%16 = load double, double* %3
%17 = load double, double* %3
%18 = load double, double* %3
%19 = load double, double* %3
%20 = fdiv double %19, 5.000000e+00
%21 = fadd double 1.000000e+00, %20
%22 = fmul double %18, %21
%23 = fdiv double %22, 4.000000e+00
%24 = fadd double 1.000000e+00, %23
%25 = fmul double %17, %24
%26 = fdiv double %25, 3.000000e+00
%27 = fadd double 1.000000e+00, %26
%28 = fmul double %16, %27
%29 = fdiv double %28, 2.000000e+00
%30 = fadd double 1.000000e+00, %29
store double %30, double* %2
br label %31
31: ; preds = %15, %8
%32 = load double, double* %2
ret double %32
}

LLVM IR (-O2):
define double @FF(double %0) {
%2 = tail call i32 @fabs(double %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @exp(double %0)
%6 = add nsw i32 %5, -1
%7 = sitofp i32 %6 to double
%8 = fdiv double %7, %0
br label %21
9: ; preds = %1
%10 = fdiv double %0, 5.000000e+00
%11 = fadd double %10, 1.000000e+00
%12 = fmul double %11, %0
%13 = fmul double %12, 2.500000e-01
%14 = fadd double %13, 1.000000e+00
%15 = fmul double %14, %0
%16 = fdiv double %15, 3.000000e+00
%17 = fadd double %16, 1.000000e+00
%18 = fmul double %17, %0
%19 = fmul double %18, 5.000000e-01
%20 = fadd double %19, 1.000000e+00
br label %21
21: ; preds = %9, %4
%22 = phi double [ %8, %4 ], [ %20, %9 ]
ret double %22
}