#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_n(double xt) {
  double p1 = -700.0, p3 = -0.8e-8, p4 = 0.8e-8, p6 = 700.0;
  if (xt < p1)
    return 0;
  else if (xt > p6)
    return 1e200;
  else if (xt > p3 && xt < p4)
    return (1.0 + xt);
  else
    return exp(xt);
}


x86 assembly (clang, -O0):
<exp_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xef3(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xede(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeb4(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1172 <exp_n+0x62>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11de <exp_n+0xce>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    1194 <exp_n+0x84>
movsd  0xe9e(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11de <exp_n+0xce>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    11cf <exp_n+0xbf>
movsd  -0x10(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11cf <exp_n+0xbf>
movsd  0xe60(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11de <exp_n+0xce>
movsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp_n>:
xorpd  %xmm1,%xmm1
movsd  0xee4(%rip),%xmm2
ucomisd %xmm0,%xmm2
jbe    1127 <exp_n+0x17>
movapd %xmm1,%xmm0
ret
ucomisd 0xee1(%rip),%xmm0
jbe    113a <exp_n+0x2a>
movsd  0xecf(%rip),%xmm0
ret
ucomisd 0xed6(%rip),%xmm0
jbe    1163 <exp_n+0x53>
movsd  0xed4(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1163 <exp_n+0x53>
addsd  0xece(%rip),%xmm0
movapd %xmm0,%xmm1
movapd %xmm1,%xmm0
ret
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define double @exp_n(double %0) {
%2 = fcmp olt double %0, -7.000000e+02
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = fcmp ogt double %0, 7.000000e+02
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = fcmp ogt double %0, -8.000000e-09
%7 = fcmp olt double %0, 8.000000e-09
%8 = and i1 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = fadd double %0, 1.000000e+00
br label %13
11: ; preds = %5
%12 = tail call double @exp(double %0)
br label %13
13: ; preds = %3, %1, %11, %9
%14 = phi double [ %10, %9 ], [ %12, %11 ], [ 0.000000e+00, %1 ], [ 0x6974E718D7D7625A, %3 ]
ret double %14
}