#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 */
scalar_t__ isIP();
double GetHumRatioFromEnthalpyAndTDryBulb(double MoistAirEnthalpy,
                                          double TDryBulb) {
  double HumRatio;
  if (isIP())
    HumRatio =
        (MoistAirEnthalpy - 0.240 * TDryBulb) / (1061.0 + 0.444 * TDryBulb);
  else
    HumRatio = (MoistAirEnthalpy / 1000.0 - 1.006 * TDryBulb) /
               (2501.0 + 1.86 * TDryBulb);
  return (((HumRatio) > (1e-7)) ? (HumRatio) : (1e-7));
}


x86 assembly (clang, -O0):
<GetHumRatioFromEnthalpyAndTDryBulb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <isIP@plt>
cmp    $0x0,%rax
je     1178 <GetHumRatioFromEnthalpyAndTDryBulb+0x68>
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xeeb(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xec6(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xec2(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11c4 <GetHumRatioFromEnthalpyAndTDryBulb+0xb4>
movsd  -0x8(%rbp),%xmm1
movsd  0xe93(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xe7a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe55(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe51(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe67(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11ea <GetHumRatioFromEnthalpyAndTDryBulb+0xda>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11fc <GetHumRatioFromEnthalpyAndTDryBulb+0xec>
movsd  0xe46(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11fc <GetHumRatioFromEnthalpyAndTDryBulb+0xec>
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetHumRatioFromEnthalpyAndTDryBulb>:
sub    $0x28,%rsp
movaps %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <isIP@plt>
test   %rax,%rax
je     114b <GetHumRatioFromEnthalpyAndTDryBulb+0x3b>
movapd 0x10(%rsp),%xmm0
unpcklpd %xmm0,%xmm0
movapd (%rsp),%xmm1
shufpd $0x2,0xebf(%rip),%xmm1
mulpd  0xec7(%rip),%xmm0
jmp    1173 <GetHumRatioFromEnthalpyAndTDryBulb+0x63>
movapd (%rsp),%xmm1
divsd  0xee8(%rip),%xmm1
movapd 0x10(%rsp),%xmm0
unpcklpd %xmm0,%xmm0
shufpd $0x2,0xeb5(%rip),%xmm1
mulpd  0xebd(%rip),%xmm0
addpd  %xmm1,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
divsd  %xmm1,%xmm0
maxsd  0xebd(%rip),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @GetHumRatioFromEnthalpyAndTDryBulb(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = call i64 (...) @isIP()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load double, double* %3
%10 = load double, double* %4
%11 = call double @llvm.fmuladd.f64(double -2.400000e-01, double %10, double %9)
%12 = load double, double* %4
%13 = call double @llvm.fmuladd.f64(double 4.440000e-01, double %12, double 1.061000e+03)
%14 = fdiv double %11, %13
store double %14, double* %5
br label %23
15: ; preds = %2
%16 = load double, double* %3
%17 = fdiv double %16, 1.000000e+03
%18 = load double, double* %4
%19 = call double @llvm.fmuladd.f64(double -1.006000e+00, double %18, double %17)
%20 = load double, double* %4
%21 = call double @llvm.fmuladd.f64(double 1.860000e+00, double %20, double 2.501000e+03)
%22 = fdiv double %19, %21
store double %22, double* %5
br label %23
23: ; preds = %15, %8
%24 = load double, double* %5
%25 = fcmp ogt double %24, 0x3E7AD7F29ABCAF48
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load double, double* %5
br label %29
28: ; preds = %23
br label %29
29: ; preds = %28, %26
%30 = phi double [ %27, %26 ], [ 0x3E7AD7F29ABCAF48, %28 ]
ret double %30
}

LLVM IR (-O2):
define double @GetHumRatioFromEnthalpyAndTDryBulb(double %0, double %1) {
%3 = tail call i64 (...) @isIP()
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = insertelement <2 x double> poison, double %1, i64 0
%7 = shufflevector <2 x double> %6, <2 x double> poison, <2 x i32> zeroinitializer
%8 = insertelement <2 x double> <double poison, double 1.061000e+03>, double %0, i64 0
%9 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %7, <2 x double> <double -2.400000e-01, double 4.440000e-01>, <2 x double> %8)
%10 = extractelement <2 x double> %9, i64 0
%11 = extractelement <2 x double> %9, i64 1
%12 = fdiv double %10, %11
br label %22
13: ; preds = %2
%14 = fdiv double %0, 1.000000e+03
%15 = insertelement <2 x double> poison, double %1, i64 0
%16 = shufflevector <2 x double> %15, <2 x double> poison, <2 x i32> zeroinitializer
%17 = insertelement <2 x double> <double poison, double 2.501000e+03>, double %14, i64 0
%18 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %16, <2 x double> <double -1.006000e+00, double 1.860000e+00>, <2 x double> %17)
%19 = extractelement <2 x double> %18, i64 0
%20 = extractelement <2 x double> %18, i64 1
%21 = fdiv double %19, %20
br label %22
22: ; preds = %13, %5
%23 = phi double [ %12, %5 ], [ %21, %13 ]
%24 = fcmp ogt double %23, 0x3E7AD7F29ABCAF48
%25 = select i1 %24, double %23, double 0x3E7AD7F29ABCAF48
ret double %25
}