#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 richesat_val(double tk) {
  double c, a1, a2, a3, a4, tr, lesat;
  c = 1013.25;
  a1 = 13.3185;
  a2 = -1.9760;
  a3 = -0.6445;
  a4 = -0.1299;
  tr = 1.0 - (373.15 / tk);
  lesat = c * exp(tr * (a1 + tr * (a2 + tr * (a3 + tr * a4))));
  return (lesat);
}


x86 assembly (clang, -O0):
<richesat_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xf0b(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xef6(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xecc(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeb7(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xea2(%rip),%xmm1
divsd  -0x8(%rbp),%xmm1
movsd  0xe8d(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm6
movsd  -0x38(%rbp),%xmm5
movsd  -0x30(%rbp),%xmm7
mulsd  %xmm7,%xmm5
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<richesat_val>:
push   %rax
movsd  0xee7(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xee3(%rip),%xmm1
movsd  0xee3(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xedf(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xedb(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xed7(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0xece(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @richesat_val(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %2
store double 1.013250e+03, double* %3
store double 1.331850e+01, double* %4
store double -1.976000e+00, double* %5
store double -6.445000e-01, double* %6
store double -1.299000e-01, double* %7
%10 = load double, double* %2
%11 = fdiv double 3.731500e+02, %10
%12 = fsub double 1.000000e+00, %11
store double %12, double* %8
%13 = load double, double* %3
%14 = load double, double* %8
%15 = load double, double* %4
%16 = load double, double* %8
%17 = load double, double* %5
%18 = load double, double* %8
%19 = load double, double* %6
%20 = load double, double* %8
%21 = load double, double* %7
%22 = call double @llvm.fmuladd.f64(double %20, double %21, double %19)
%23 = call double @llvm.fmuladd.f64(double %18, double %22, double %17)
%24 = call double @llvm.fmuladd.f64(double %16, double %23, double %15)
%25 = fmul double %14, %24
%26 = call double @exp(double %25)
%27 = fmul double %13, %26
store double %27, double* %9
%28 = load double, double* %9
ret double %28
}

LLVM IR (-O2):
define double @richesat_val(double %0) {
%2 = fdiv double 3.731500e+02, %0
%3 = fsub double 1.000000e+00, %2
%4 = tail call double @llvm.fmuladd.f64(double %3, double -1.299000e-01, double -6.445000e-01)
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double -1.976000e+00)
%6 = tail call double @llvm.fmuladd.f64(double %3, double %5, double 1.331850e+01)
%7 = fmul double %3, %6
%8 = tail call double @exp(double %7)
%9 = fmul double %8, 1.013250e+03
ret double %9
}