#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 calcFA(double);
double calcFP(double);
double calcFR(double, double, double);
double calcFT(double, double);
double AtmCorrect(double DragCoefficient, double Altitude, double Barometer,
                  double Temperature, double RelativeHumidity) {
  double FA = calcFA(Altitude);
  double FT = calcFT(Temperature, Altitude);
  double FR = calcFR(Temperature, Barometer, RelativeHumidity);
  double FP = calcFP(Barometer);
  double CD = (FA * (1 + FT - FP) * FR);
  return DragCoefficient * CD;
}


x86 assembly (clang, -O0):
<AtmCorrect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1060 <calcFA@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <calcFT@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1030 <calcFR@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <calcFP@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xe47(%rip),%xmm1
addsd  -0x38(%rbp),%xmm1
subsd  -0x48(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AtmCorrect>:
sub    $0x38,%rsp
movsd  %xmm4,0x20(%rsp)
movsd  %xmm3,0x8(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x30(%rsp)
movaps %xmm1,%xmm0
call   1060 <calcFA@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1040 <calcFT@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
call   1030 <calcFR@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
call   1050 <calcFP@plt>
movsd  0x10(%rsp),%xmm1
addsd  0xe43(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x28(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
mulsd  0x30(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @AtmCorrect(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%16 = load double, double* %7
%17 = call double @calcFA(double %16)
store double %17, double* %11
%18 = load double, double* %9
%19 = load double, double* %7
%20 = call double @calcFT(double %18, double %19)
store double %20, double* %12
%21 = load double, double* %9
%22 = load double, double* %8
%23 = load double, double* %10
%24 = call double @calcFR(double %21, double %22, double %23)
store double %24, double* %13
%25 = load double, double* %8
%26 = call double @calcFP(double %25)
store double %26, double* %14
%27 = load double, double* %11
%28 = load double, double* %12
%29 = fadd double 1.000000e+00, %28
%30 = load double, double* %14
%31 = fsub double %29, %30
%32 = fmul double %27, %31
%33 = load double, double* %13
%34 = fmul double %32, %33
store double %34, double* %15
%35 = load double, double* %6
%36 = load double, double* %15
%37 = fmul double %35, %36
ret double %37
}

LLVM IR (-O2):
define double @AtmCorrect(double %0, double %1, double %2, double %3, double %4) {
%6 = tail call double @calcFA(double %1)
%7 = tail call double @calcFT(double %3, double %1)
%8 = tail call double @calcFR(double %3, double %2, double %4)
%9 = tail call double @calcFP(double %2)
%10 = fadd double %7, 1.000000e+00
%11 = fsub double %10, %9
%12 = fmul double %6, %11
%13 = fmul double %8, %12
%14 = fmul double %13, %0
ret double %14
}