#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 Ei1(double);
double Ei2(double);
double Ei3(double);
double Ei(double x) {
  if (x < -5.)
    return Ei1(x);
  if (x < 6.8)
    return Ei2(x);
  if (x < 50.)
    return Ei3(x);
  return Ei1(x);
}


x86 assembly (clang, -O0):
<Ei>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xebb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1164 <Ei+0x34>
movsd  -0x10(%rbp),%xmm0
call   1040 <Ei1@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11c1 <Ei+0x91>
movsd  0xe9c(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    118b <Ei+0x5b>
movsd  -0x10(%rbp),%xmm0
call   1050 <Ei2@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11c1 <Ei+0x91>
movsd  0xe7d(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11b2 <Ei+0x82>
movsd  -0x10(%rbp),%xmm0
call   1030 <Ei3@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11c1 <Ei+0x91>
movsd  -0x10(%rbp),%xmm0
call   1040 <Ei1@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ei>:
movsd  0xec8(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1164 <Ei+0x34>
movsd  0xec2(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1151 <Ei+0x21>
jmp    1050 <Ei2@plt>
movsd  0xeb7(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1164 <Ei+0x34>
jmp    1030 <Ei3@plt>
jmp    1040 <Ei1@plt>

LLVM IR (-O0):
define double @Ei(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, -5.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = call double @Ei1(double %7)
store double %8, double* %2
br label %24
9: ; preds = %1
%10 = load double, double* %3
%11 = fcmp olt double %10, 6.800000e+00
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load double, double* %3
%14 = call double @Ei2(double %13)
store double %14, double* %2
br label %24
15: ; preds = %9
%16 = load double, double* %3
%17 = fcmp olt double %16, 5.000000e+01
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load double, double* %3
%20 = call double @Ei3(double %19)
store double %20, double* %2
br label %24
21: ; preds = %15
%22 = load double, double* %3
%23 = call double @Ei1(double %22)
store double %23, double* %2
br label %24
24: ; preds = %21, %18, %12, %6
%25 = load double, double* %2
ret double %25
}

LLVM IR (-O2):
define double @Ei(double %0) {
%2 = fcmp olt double %0, -5.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @Ei1(double %0)
br label %15
5: ; preds = %1
%6 = fcmp olt double %0, 6.800000e+00
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call double @Ei2(double %0)
br label %15
9: ; preds = %5
%10 = fcmp olt double %0, 5.000000e+01
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = tail call double @Ei3(double %0)
br label %15
13: ; preds = %9
%14 = tail call double @Ei1(double %0)
br label %15
15: ; preds = %13, %11, %7, %3
%16 = phi double [ %4, %3 ], [ %8, %7 ], [ %12, %11 ], [ %14, %13 ]
ret double %16
}