#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 dfunc(double x) {
  const double delta = (double)256 / 7.0;
  double dd, dn, dtemp, dret;
  if (x <= -256) {
    dret = 0.0;
  } else if (x >= 256) {
    dret = 0.0;
  } else {
    dn = exp(-x / delta);
    dtemp = dn + 1.0;
    dd = delta * dtemp * dtemp;
    dret = dn / dd;
  }
  return dret;
}


x86 assembly (clang, -O0):
<dfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xece(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     114a <dfunc+0x3a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    11dd <dfunc+0xcd>
movsd  -0x8(%rbp),%xmm0
movsd  0xeb9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     116e <dfunc+0x5e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    11d8 <dfunc+0xc8>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe76(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xe70(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe4e(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    11dd <dfunc+0xcd>
movsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dfunc>:
push   %rax
movapd %xmm0,%xmm1
movsd  0xee3(%rip),%xmm0
ucomisd %xmm1,%xmm0
xorpd  %xmm0,%xmm0
jae    1162 <dfunc+0x52>
ucomisd 0xed9(%rip),%xmm1
jae    1162 <dfunc+0x52>
divsd  0xed7(%rip),%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
movsd  0xece(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeca(%rip),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dfunc(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %2
store double 0x4042492492492492, double* %3
%8 = load double, double* %2
%9 = fcmp ole double %8, -2.560000e+02
br i1 %9, label %10, label %11
10: ; preds = %1
store double 0.000000e+00, double* %7
br label %30
11: ; preds = %1
%12 = load double, double* %2
%13 = fcmp oge double %12, 2.560000e+02
br i1 %13, label %14, label %15
14: ; preds = %11
store double 0.000000e+00, double* %7
br label %29
15: ; preds = %11
%16 = load double, double* %2
%17 = fneg double %16
%18 = fdiv double %17, 0x4042492492492492
%19 = call double @exp(double %18)
store double %19, double* %5
%20 = load double, double* %5
%21 = fadd double %20, 1.000000e+00
store double %21, double* %6
%22 = load double, double* %6
%23 = fmul double 0x4042492492492492, %22
%24 = load double, double* %6
%25 = fmul double %23, %24
store double %25, double* %4
%26 = load double, double* %5
%27 = load double, double* %4
%28 = fdiv double %26, %27
store double %28, double* %7
br label %29
29: ; preds = %15, %14
br label %30
30: ; preds = %29, %10
%31 = load double, double* %7
ret double %31
}

LLVM IR (-O2):
define double @dfunc(double %0) {
%2 = fcmp ugt double %0, -2.560000e+02
%3 = fcmp ult double %0, 2.560000e+02
%4 = and i1 %2, %3
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = fdiv double %0, 0xC042492492492492
%7 = tail call double @exp(double %6)
%8 = fadd double %7, 1.000000e+00
%9 = fmul double %8, 0x4042492492492492
%10 = fmul double %8, %9
%11 = fdiv double %7, %10
br label %12
12: ; preds = %1, %5
%13 = phi double [ %11, %5 ], [ 0.000000e+00, %1 ]
ret double %13
}