#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);
void richesat_ptr(double tk, double *esatmb_p, double *eslope_p) {
  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))));
  *eslope_p = (373.15 * lesat / (tk * tk)) *
              (a1 + tr * (2 * a2 + tr * (3 * a3 + tr * (4 * a4))));
  *esatmb_p = lesat;
}


x86 assembly (clang, -O0):
<richesat_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  0xf13(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xefe(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xed4(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xebf(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xea2(%rip),%xmm1
divsd  -0x8(%rbp),%xmm1
movsd  0xe9d(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm4
movsd  -0x48(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm6
movsd  -0x48(%rbp),%xmm5
movsd  -0x40(%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  -0x58(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe20(%rip),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm3
movsd  -0x48(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm5
movsd  -0x48(%rbp),%xmm6
movsd  0xddf(%rip),%xmm7
mulsd  -0x40(%rbp),%xmm7
mulsd  %xmm7,%xmm6
movsd  0xdc6(%rip),%xmm7
mulsd  %xmm7,%xmm5
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm4
addsd  %xmm3,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<richesat_ptr>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
movsd  0xedb(%rip),%xmm2
divsd  %xmm0,%xmm2
movsd  0xed7(%rip),%xmm1
subsd  %xmm2,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xecd(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xec9(%rip),%xmm0
mov    %rsi,%rbx
mov    %rdi,%r14
mulsd  %xmm1,%xmm0
addsd  0xebf(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xebb(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0xeb2(%rip),%xmm0
movsd  0xe7a(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm2
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm2
movsd  0xe94(%rip),%xmm1
movsd  0x8(%rsp),%xmm3
mulsd  %xmm3,%xmm1
addsd  0xe8a(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xe86(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xe5a(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,(%rbx)
movsd  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @richesat_ptr(double %0, double* %1, double* %2) {
%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
%13 = alloca double
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
store double 1.013250e+03, double* %7
store double 1.331850e+01, double* %8
store double -1.976000e+00, double* %9
store double -6.445000e-01, double* %10
store double -1.299000e-01, double* %11
%14 = load double, double* %4
%15 = fdiv double 3.731500e+02, %14
%16 = fsub double 1.000000e+00, %15
store double %16, double* %12
%17 = load double, double* %7
%18 = load double, double* %12
%19 = load double, double* %8
%20 = load double, double* %12
%21 = load double, double* %9
%22 = load double, double* %12
%23 = load double, double* %10
%24 = load double, double* %12
%25 = load double, double* %11
%26 = call double @llvm.fmuladd.f64(double %24, double %25, double %23)
%27 = call double @llvm.fmuladd.f64(double %22, double %26, double %21)
%28 = call double @llvm.fmuladd.f64(double %20, double %27, double %19)
%29 = fmul double %18, %28
%30 = call double @exp(double %29)
%31 = fmul double %17, %30
store double %31, double* %13
%32 = load double, double* %13
%33 = fmul double 3.731500e+02, %32
%34 = load double, double* %4
%35 = load double, double* %4
%36 = fmul double %34, %35
%37 = fdiv double %33, %36
%38 = load double, double* %8
%39 = load double, double* %12
%40 = load double, double* %9
%41 = load double, double* %12
%42 = load double, double* %10
%43 = load double, double* %12
%44 = load double, double* %11
%45 = fmul double 4.000000e+00, %44
%46 = fmul double %43, %45
%47 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %42, double %46)
%48 = fmul double %41, %47
%49 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %40, double %48)
%50 = call double @llvm.fmuladd.f64(double %39, double %49, double %38)
%51 = fmul double %37, %50
%52 = load double*, double** %6
store double %51, double* %52
%53 = load double, double* %13
%54 = load double*, double** %5
store double %53, double* %54
ret void
}

LLVM IR (-O2):
define void @richesat_ptr(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = fdiv double 3.731500e+02, %0
%5 = fsub double 1.000000e+00, %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double -1.299000e-01, double -6.445000e-01)
%7 = tail call double @llvm.fmuladd.f64(double %5, double %6, double -1.976000e+00)
%8 = tail call double @llvm.fmuladd.f64(double %5, double %7, double 1.331850e+01)
%9 = fmul double %5, %8
%10 = tail call double @exp(double %9)
%11 = fmul double %10, 1.013250e+03
%12 = fmul double %11, 3.731500e+02
%13 = fmul double %0, %0
%14 = fdiv double %12, %13
%15 = fmul double %5, 5.196000e-01
%16 = fsub double -1.933500e+00, %15
%17 = fmul double %5, %16
%18 = fadd double %17, -3.952000e+00
%19 = tail call double @llvm.fmuladd.f64(double %5, double %18, double 1.331850e+01)
%20 = fmul double %19, %14
store double %20, double* %2
store double %11, double* %1
ret void
}