#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 pow(double, int);
double libballistics_calcFR(double temperature, double barometricPressure,
                            double relativeHumidity) {
  double VPw = 4e-6 * pow(temperature, 3) - 0.0004 * pow(temperature, 2) +
               0.0234 * temperature - 0.2517;
  double FRH = 0.995 * (barometricPressure /
                        (barometricPressure - 0.3783 * relativeHumidity * VPw));
  return FRH;
}


x86 assembly (clang, -O0):
<libballistics_calcFR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  0xece(%rip),%xmm0
mulsd  %xmm2,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xea3(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xe86(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe6e(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  0xe4b(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm3
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movsd  0xe0e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libballistics_calcFR>:
sub    $0x28,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    $0x3,%edi
call   1030 <pow@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  0xeb2(%rip),%xmm0
movsd  0x10(%rsp),%xmm2
mulsd  0xeac(%rip),%xmm2
movsd  0x8(%rsp),%xmm1
mulsd  0xea6(%rip),%xmm1
addsd  %xmm0,%xmm2
addsd  %xmm2,%xmm1
addsd  0xe9e(%rip),%xmm1
movapd %xmm1,%xmm0
movsd  0x18(%rsp),%xmm1
mulsd  0xe94(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x20(%rsp),%xmm0
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
mulsd  0xe82(%rip),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @libballistics_calcFR(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %4
%10 = call double @pow(double %9, i32 3)
%11 = load double, double* %4
%12 = call double @pow(double %11, i32 2)
%13 = fmul double 4.000000e-04, %12
%14 = fneg double %13
%15 = call double @llvm.fmuladd.f64(double 4.000000e-06, double %10, double %14)
%16 = load double, double* %4
%17 = call double @llvm.fmuladd.f64(double 2.340000e-02, double %16, double %15)
%18 = fsub double %17, 2.517000e-01
store double %18, double* %7
%19 = load double, double* %5
%20 = load double, double* %5
%21 = load double, double* %6
%22 = fmul double 3.783000e-01, %21
%23 = load double, double* %7
%24 = fneg double %22
%25 = call double @llvm.fmuladd.f64(double %24, double %23, double %20)
%26 = fdiv double %19, %25
%27 = fmul double 0x3FEFD70A3D70A3D7, %26
store double %27, double* %8
%28 = load double, double* %8
ret double %28
}

LLVM IR (-O2):
define double @libballistics_calcFR(double %0, double %1, double %2) {
%4 = tail call double @pow(double %0, i32 3)
%5 = tail call double @pow(double %0, i32 2)
%6 = fmul double %5, -4.000000e-04
%7 = tail call double @llvm.fmuladd.f64(double %4, double 4.000000e-06, double %6)
%8 = tail call double @llvm.fmuladd.f64(double %0, double 2.340000e-02, double %7)
%9 = fadd double %8, -2.517000e-01
%10 = fmul double %2, -3.783000e-01
%11 = tail call double @llvm.fmuladd.f64(double %10, double %9, double %1)
%12 = fdiv double %1, %11
%13 = fmul double %12, 0x3FEFD70A3D70A3D7
ret double %13
}