#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 pow(double, double);
double e_sat(double lst, double dem) {
  double t0 = lst / pow((1.0 - dem / 44331.0), 1.5029);
  if (t0 > 100)
    t0 -= 273.15;
  double esat = 611.0 * exp(17.502 * t0 / (t0 + 240.97));
  return (esat);
}


x86 assembly (clang, -O0):
<e_sat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xecf(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xebb(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0xea7(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe7c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11a4 <e_sat+0x84>
movsd  -0x18(%rbp),%xmm0
movsd  0xe85(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe8c(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xe77(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe56(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_sat>:
sub    $0x18,%rsp
movapd %xmm1,%xmm2
movaps %xmm0,(%rsp)
divsd  0xecc(%rip),%xmm2
addsd  0xecc(%rip),%xmm2
movsd  0xecc(%rip),%xmm1
movapd %xmm2,%xmm0
call   1040 <pow@plt>
movapd (%rsp),%xmm2
divsd  %xmm0,%xmm2
movsd  0xeba(%rip),%xmm0
addsd  %xmm2,%xmm0
movsd  0xeb6(%rip),%xmm1
cmpltsd %xmm2,%xmm1
andpd  %xmm1,%xmm0
andnpd %xmm2,%xmm1
orpd   %xmm0,%xmm1
movsd  0xea5(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xea1(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0xe98(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @e_sat(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fdiv double %8, 4.433100e+04
%10 = fsub double 1.000000e+00, %9
%11 = call double @pow(double %10, double 1.502900e+00)
%12 = fdiv double %7, %11
store double %12, double* %5
%13 = load double, double* %5
%14 = fcmp ogt double %13, 1.000000e+02
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = load double, double* %5
%17 = fsub double %16, 2.731500e+02
store double %17, double* %5
br label %18
18: ; preds = %15, %2
%19 = load double, double* %5
%20 = fmul double 1.750200e+01, %19
%21 = load double, double* %5
%22 = fadd double %21, 2.409700e+02
%23 = fdiv double %20, %22
%24 = call double @exp(double %23)
%25 = fmul double 6.110000e+02, %24
store double %25, double* %6
%26 = load double, double* %6
ret double %26
}

LLVM IR (-O2):
define double @e_sat(double %0, double %1) {
%3 = fdiv double %1, 4.433100e+04
%4 = fsub double 1.000000e+00, %3
%5 = tail call double @pow(double %4, double 1.502900e+00)
%6 = fdiv double %0, %5
%7 = fcmp ogt double %6, 1.000000e+02
%8 = fadd double %6, -2.731500e+02
%9 = select i1 %7, double %8, double %6
%10 = fmul double %9, 1.750200e+01
%11 = fadd double %9, 2.409700e+02
%12 = fdiv double %10, %11
%13 = tail call double @exp(double %12)
%14 = fmul double %13, 6.110000e+02
ret double %14
}