#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 exp_l(double n_sub, double ind, double nu) {
  double bin_size, func;
  if (nu == 0.0)
    nu = 1e-14;
  if (n_sub == 0.0)
    n_sub = 1.0;
  bin_size = 1.0 / n_sub;
  ind *= bin_size;
  func = exp(-nu * (1.0 - ind)) - exp(-nu);
  func /= (1.0 - exp(-nu));
  return func;
}


x86 assembly (clang, -O0):
<exp_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    114c <exp_l+0x3c>
jp     114c <exp_l+0x3c>
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1171 <exp_l+0x61>
jp     1171 <exp_l+0x61>
movsd  0xe9c(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xe8f(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe52(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  0xde4(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp_l>:
sub    $0x28,%rsp
xorpd  %xmm3,%xmm3
movapd %xmm2,%xmm5
cmpeqsd %xmm3,%xmm5
movsd  0xed7(%rip),%xmm4
andpd  %xmm5,%xmm4
andnpd %xmm2,%xmm5
orpd   %xmm4,%xmm5
movsd  0xecb(%rip),%xmm4
ucomisd %xmm3,%xmm0
movapd %xmm4,%xmm2
jne    1149 <exp_l+0x39>
jnp    1155 <exp_l+0x45>
movsd  0xeb7(%rip),%xmm2
divsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
xorpd  0xeaf(%rip),%xmm5
movapd %xmm5,0x10(%rsp)
movapd %xmm4,%xmm0
subsd  %xmm2,%xmm0
mulsd  %xmm5,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movapd 0x10(%rsp),%xmm0
call   1030 <exp@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd 0x10(%rsp),%xmm0
call   1030 <exp@plt>
movsd  0xe5c(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
divsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @exp_l(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %6
%10 = fcmp oeq double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %3
store double 0x3D06849B86A12B9B, double* %6
br label %12
12: ; preds = %11, %3
%13 = load double, double* %4
%14 = fcmp oeq double %13, 0.000000e+00
br i1 %14, label %15, label %16
15: ; preds = %12
store double 1.000000e+00, double* %4
br label %16
16: ; preds = %15, %12
%17 = load double, double* %4
%18 = fdiv double 1.000000e+00, %17
store double %18, double* %7
%19 = load double, double* %7
%20 = load double, double* %5
%21 = fmul double %20, %19
store double %21, double* %5
%22 = load double, double* %6
%23 = fneg double %22
%24 = load double, double* %5
%25 = fsub double 1.000000e+00, %24
%26 = fmul double %23, %25
%27 = call double @exp(double %26)
%28 = load double, double* %6
%29 = fneg double %28
%30 = call double @exp(double %29)
%31 = fsub double %27, %30
store double %31, double* %8
%32 = load double, double* %6
%33 = fneg double %32
%34 = call double @exp(double %33)
%35 = fsub double 1.000000e+00, %34
%36 = load double, double* %8
%37 = fdiv double %36, %35
store double %37, double* %8
%38 = load double, double* %8
ret double %38
}

LLVM IR (-O2):
define double @exp_l(double %0, double %1, double %2) {
%4 = fcmp oeq double %2, 0.000000e+00
%5 = select i1 %4, double 0x3D06849B86A12B9B, double %2
%6 = fcmp oeq double %0, 0.000000e+00
%7 = fdiv double 1.000000e+00, %0
%8 = select i1 %6, double 1.000000e+00, double %7
%9 = fmul double %8, %1
%10 = fneg double %5
%11 = fsub double 1.000000e+00, %9
%12 = fmul double %11, %10
%13 = tail call double @exp(double %12)
%14 = tail call double @exp(double %10)
%15 = fsub double %13, %14
%16 = tail call double @exp(double %10)
%17 = fsub double 1.000000e+00, %16
%18 = fdiv double %15, %17
ret double %18
}