#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 esat(double temperature) {
  double zes;
  double es;
  double tc;
  tc = temperature - 273.16;
  if (tc < 0.0)
    zes = 21.8745584 * tc / (temperature - 7.66);
  else
    zes = 17.2693882 * tc / (temperature - 35.86);
  es = 610.78 * exp(zes);
  return es;
}


x86 assembly (clang, -O0):
<esat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    116d <esat+0x5d>
movsd  0xed7(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xebd(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1194 <esat+0x84>
movsd  0xe9b(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xe81(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe7f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esat>:
push   %rax
movsd  0xee7(%rip),%xmm1
addsd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
xor    %eax,%eax
ucomisd %xmm1,%xmm2
seta   %al
lea    0xedf(%rip),%rcx
mulsd  (%rcx,%rax,8),%xmm1
lea    0xee3(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0xeb1(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @esat(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = fsub double %6, 2.731600e+02
store double %7, double* %5
%8 = load double, double* %5
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %16
10: ; preds = %1
%11 = load double, double* %5
%12 = fmul double 0x4035DFE30F2E712D, %11
%13 = load double, double* %2
%14 = fsub double %13, 7.660000e+00
%15 = fdiv double %12, %14
store double %15, double* %3
br label %22
16: ; preds = %1
%17 = load double, double* %5
%18 = fmul double 0x403144F6A004EDA6, %17
%19 = load double, double* %2
%20 = fsub double %19, 3.586000e+01
%21 = fdiv double %18, %20
store double %21, double* %3
br label %22
22: ; preds = %16, %10
%23 = load double, double* %3
%24 = call double @exp(double %23)
%25 = fmul double 6.107800e+02, %24
store double %25, double* %4
%26 = load double, double* %4
ret double %26
}

LLVM IR (-O2):
define double @esat(double %0) {
%2 = fadd double %0, -2.731600e+02
%3 = fcmp olt double %2, 0.000000e+00
%4 = select i1 %3, double 0x4035DFE30F2E712D, double 0x403144F6A004EDA6
%5 = select i1 %3, double -7.660000e+00, double -3.586000e+01
%6 = fmul double %2, %4
%7 = fadd double %5, %0
%8 = fdiv double %6, %7
%9 = tail call double @exp(double %8)
%10 = fmul double %9, 6.107800e+02
ret double %10
}