#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_n2(double x1, double x2) {
  double p1 = -700., p2 = -37., p3 = -0.8e-8, p4 = 0.8e-8, p5 = 37., p6 = 700.;
  double xt = x1 - x2;
  if (xt < p1 + 1.e-200)
    return 1.;
  else if (xt > p1 && xt < p2 + 1.e-200)
    return (1. - exp(xt));
  else if (xt > p2 && xt < p3 + 1.e-200)
    return (1. / (1. + exp(xt)));
  else if (xt > p3 && xt < p4)
    return (1. / (2. + xt));
  else if (xt > p4 - 1.e-200 && xt < p5)
    return (exp(-xt) / (1. + exp(-xt)));
  else if (xt > p5 - 1.e-200 && xt < p6)
    return (exp(-xt));
  else if (xt > p6 - 1.e-200)
    return 0.;
}


x86 assembly (clang, -O0):
<exp_n2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  0xf06(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xef1(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xedc(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xec7(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xeb2(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe9d(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  0xe74(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11ad <exp_n2+0x9d>
movsd  0xe95(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13e2 <exp_n2+0x2d2>
movsd  -0x50(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    11fc <exp_n2+0xec>
movsd  -0x50(%rbp),%xmm1
movsd  0xe36(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11fc <exp_n2+0xec>
movsd  -0x50(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe4a(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13e2 <exp_n2+0x2d2>
movsd  -0x50(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1254 <exp_n2+0x144>
movsd  -0x50(%rbp),%xmm1
movsd  0xde7(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1254 <exp_n2+0x144>
movsd  -0x50(%rbp),%xmm0
call   1030 <exp@plt>
movsd  0xdfe(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xdf2(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13e2 <exp_n2+0x2d2>
movsd  -0x50(%rbp),%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    129b <exp_n2+0x18b>
movsd  -0x50(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    129b <exp_n2+0x18b>
movsd  0xdc0(%rip),%xmm1
addsd  -0x50(%rbp),%xmm1
movsd  0xdab(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13e2 <exp_n2+0x2d2>
movsd  -0x50(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  0xd53(%rip),%xmm2
subsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    1338 <exp_n2+0x228>
movsd  -0x50(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1338 <exp_n2+0x228>
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm2
movsd  -0x58(%rbp),%xmm0
movsd  0xd12(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13e2 <exp_n2+0x2d2>
movsd  -0x50(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  0xcb6(%rip),%xmm2
subsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    1397 <exp_n2+0x287>
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1397 <exp_n2+0x287>
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    13e2 <exp_n2+0x2d2>
movsd  -0x50(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  0xc57(%rip),%xmm2
subsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    13c4 <exp_n2+0x2b4>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13e2 <exp_n2+0x2d2>
jmp    13c9 <exp_n2+0x2b9>
jmp    13ce <exp_n2+0x2be>
jmp    13d3 <exp_n2+0x2c3>
jmp    13d8 <exp_n2+0x2c8>
jmp    13dd <exp_n2+0x2cd>
jmp    13e2 <exp_n2+0x2d2>
movsd  -0x8(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp_n2>:
sub    $0x28,%rsp
subsd  %xmm1,%xmm0
movsd  0xee8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1133 <exp_n2+0x23>
movsd  0xed2(%rip),%xmm2
jmp    123e <exp_n2+0x12e>
ucomisd 0xecd(%rip),%xmm0
jbe    1161 <exp_n2+0x51>
movsd  0xecb(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1161 <exp_n2+0x51>
call   1030 <exp@plt>
movsd  0xea8(%rip),%xmm2
subsd  %xmm0,%xmm2
jmp    123e <exp_n2+0x12e>
ucomisd 0xea7(%rip),%xmm0
jbe    1193 <exp_n2+0x83>
movsd  0xea5(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1193 <exp_n2+0x83>
call   1030 <exp@plt>
movsd  0xe7a(%rip),%xmm2
addsd  %xmm2,%xmm0
divsd  %xmm0,%xmm2
jmp    123e <exp_n2+0x12e>
ucomisd 0xe7d(%rip),%xmm0
jbe    11c1 <exp_n2+0xb1>
movsd  0xe7b(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    11c1 <exp_n2+0xb1>
addsd  0xe85(%rip),%xmm0
movsd  0xe45(%rip),%xmm2
divsd  %xmm0,%xmm2
jmp    123e <exp_n2+0x12e>
ucomisd 0xe57(%rip),%xmm0
jbe    1211 <exp_n2+0x101>
movsd  0xe55(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1211 <exp_n2+0x101>
xorpd  0xe5f(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
call   1030 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movapd 0x10(%rsp),%xmm0
call   1030 <exp@plt>
movsd  0x8(%rsp),%xmm2
addsd  0xdf5(%rip),%xmm0
divsd  %xmm0,%xmm2
jmp    123e <exp_n2+0x12e>
ucomisd 0xe0f(%rip),%xmm0
xorpd  %xmm2,%xmm2
jbe    123e <exp_n2+0x12e>
movsd  0xe09(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    123e <exp_n2+0x12e>
xorpd  0xe0b(%rip),%xmm0
add    $0x28,%rsp
jmp    1030 <exp@plt>
movapd %xmm2,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @exp_n2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %4
store double %1, double* %5
store double -7.000000e+02, double* %6
store double -3.700000e+01, double* %7
store double -8.000000e-09, double* %8
store double 8.000000e-09, double* %9
store double 3.700000e+01, double* %10
store double 7.000000e+02, double* %11
%13 = load double, double* %4
%14 = load double, double* %5
%15 = fsub double %13, %14
store double %15, double* %12
%16 = load double, double* %12
%17 = load double, double* %6
%18 = fadd double %17, 0x16687E92154EF7AC
%19 = fcmp olt double %16, %18
br i1 %19, label %20, label %21
20: ; preds = %2
store double 1.000000e+00, double* %3
br label %103
21: ; preds = %2
%22 = load double, double* %12
%23 = load double, double* %6
%24 = fcmp ogt double %22, %23
br i1 %24, label %25, label %34
25: ; preds = %21
%26 = load double, double* %12
%27 = load double, double* %7
%28 = fadd double %27, 0x16687E92154EF7AC
%29 = fcmp olt double %26, %28
br i1 %29, label %30, label %34
30: ; preds = %25
%31 = load double, double* %12
%32 = call double @exp(double %31)
%33 = fsub double 1.000000e+00, %32
store double %33, double* %3
br label %103
34: ; preds = %25, %21
%35 = load double, double* %12
%36 = load double, double* %7
%37 = fcmp ogt double %35, %36
br i1 %37, label %38, label %48
38: ; preds = %34
%39 = load double, double* %12
%40 = load double, double* %8
%41 = fadd double %40, 0x16687E92154EF7AC
%42 = fcmp olt double %39, %41
br i1 %42, label %43, label %48
43: ; preds = %38
%44 = load double, double* %12
%45 = call double @exp(double %44)
%46 = fadd double 1.000000e+00, %45
%47 = fdiv double 1.000000e+00, %46
store double %47, double* %3
br label %103
48: ; preds = %38, %34
%49 = load double, double* %12
%50 = load double, double* %8
%51 = fcmp ogt double %49, %50
br i1 %51, label %52, label %60
52: ; preds = %48
%53 = load double, double* %12
%54 = load double, double* %9
%55 = fcmp olt double %53, %54
br i1 %55, label %56, label %60
56: ; preds = %52
%57 = load double, double* %12
%58 = fadd double 2.000000e+00, %57
%59 = fdiv double 1.000000e+00, %58
store double %59, double* %3
br label %103
60: ; preds = %52, %48
%61 = load double, double* %12
%62 = load double, double* %9
%63 = fsub double %62, 0x16687E92154EF7AC
%64 = fcmp ogt double %61, %63
br i1 %64, label %65, label %78
65: ; preds = %60
%66 = load double, double* %12
%67 = load double, double* %10
%68 = fcmp olt double %66, %67
br i1 %68, label %69, label %78
69: ; preds = %65
%70 = load double, double* %12
%71 = fneg double %70
%72 = call double @exp(double %71)
%73 = load double, double* %12
%74 = fneg double %73
%75 = call double @exp(double %74)
%76 = fadd double 1.000000e+00, %75
%77 = fdiv double %72, %76
store double %77, double* %3
br label %103
78: ; preds = %65, %60
%79 = load double, double* %12
%80 = load double, double* %10
%81 = fsub double %80, 0x16687E92154EF7AC
%82 = fcmp ogt double %79, %81
br i1 %82, label %83, label %91
83: ; preds = %78
%84 = load double, double* %12
%85 = load double, double* %11
%86 = fcmp olt double %84, %85
br i1 %86, label %87, label %91
87: ; preds = %83
%88 = load double, double* %12
%89 = fneg double %88
%90 = call double @exp(double %89)
store double %90, double* %3
br label %103
91: ; preds = %83, %78
%92 = load double, double* %12
%93 = load double, double* %11
%94 = fsub double %93, 0x16687E92154EF7AC
%95 = fcmp ogt double %92, %94
br i1 %95, label %96, label %97
96: ; preds = %91
store double 0.000000e+00, double* %3
br label %103
97: ; preds = %91
br label %98
98: ; preds = %97
br label %99
99: ; preds = %98
br label %100
100: ; preds = %99
br label %101
101: ; preds = %100
br label %102
102: ; preds = %101
br label %103
103: ; preds = %20, %30, %43, %56, %69, %87, %96, %102
%104 = load double, double* %3
ret double %104
}

LLVM IR (-O2):
define double @exp_n2(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fcmp olt double %3, -7.000000e+02
br i1 %4, label %44, label %5
5: ; preds = %2
%6 = fcmp ogt double %3, -7.000000e+02
%7 = fcmp olt double %3, -3.700000e+01
%8 = and i1 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = tail call double @exp(double %3)
%11 = fsub double 1.000000e+00, %10
br label %44
12: ; preds = %5
%13 = fcmp ogt double %3, -3.700000e+01
%14 = fcmp olt double %3, -8.000000e-09
%15 = and i1 %13, %14
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = tail call double @exp(double %3)
%18 = fadd double %17, 1.000000e+00
%19 = fdiv double 1.000000e+00, %18
br label %44
20: ; preds = %12
%21 = fcmp ogt double %3, -8.000000e-09
%22 = fcmp olt double %3, 8.000000e-09
%23 = and i1 %21, %22
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = fadd double %3, 2.000000e+00
%26 = fdiv double 1.000000e+00, %25
br label %44
27: ; preds = %20
%28 = fcmp ogt double %3, 8.000000e-09
%29 = fcmp olt double %3, 3.700000e+01
%30 = and i1 %28, %29
br i1 %30, label %31, label %37
31: ; preds = %27
%32 = fneg double %3
%33 = tail call double @exp(double %32)
%34 = tail call double @exp(double %32)
%35 = fadd double %34, 1.000000e+00
%36 = fdiv double %33, %35
br label %44
37: ; preds = %27
%38 = fcmp ogt double %3, 3.700000e+01
%39 = fcmp olt double %3, 7.000000e+02
%40 = and i1 %38, %39
br i1 %40, label %41, label %44
41: ; preds = %37
%42 = fneg double %3
%43 = tail call double @exp(double %42)
br label %44
44: ; preds = %37, %2, %41, %31, %24, %16, %9
%45 = phi double [ %11, %9 ], [ %19, %16 ], [ %26, %24 ], [ %36, %31 ], [ %43, %41 ], [ 1.000000e+00, %2 ], [ 0.000000e+00, %37 ]
ret double %45
}