#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 */
int /*<<< orphan*/ Assert(char *, char *, int);
scalar_t__ isIP();
double GetMoistAirEnthalpy(double TDryBulb, double HumRatio) {
  double BoundedHumRatio;
  if (!(HumRatio >= 0.)) {
    Assert("Humidity ratio is negative",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/psychrometrics/psychrolib/refs/heads/"
           "master/src/c/psychrolib.c",
           856);
  }
  BoundedHumRatio = (((HumRatio) > (1e-7)) ? (HumRatio) : (1e-7));
  if (isIP())
    return 0.240 * TDryBulb + BoundedHumRatio * (1061. + 0.444 * TDryBulb);
  else
    return (1.006 * TDryBulb + BoundedHumRatio * (2501. + 1.86 * TDryBulb)) *
           1000.;
}


x86 assembly (clang, -O0):
<GetMoistAirEnthalpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    115c <GetMoistAirEnthalpy+0x3c>
lea    0xef5(%rip),%rdi
lea    0xf09(%rip),%rsi
mov    $0x358,%edx
call   1030 <Assert@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xe97(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1182 <GetMoistAirEnthalpy+0x62>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1194 <GetMoistAirEnthalpy+0x74>
movsd  0xe76(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1194 <GetMoistAirEnthalpy+0x74>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1040 <isIP@plt>
cmp    $0x0,%rax
je     11f4 <GetMoistAirEnthalpy+0xd4>
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  0xe6a(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe66(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe46(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1240 <GetMoistAirEnthalpy+0x120>
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  0xe0d(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe09(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xde9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xdd1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMoistAirEnthalpy>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jae    1158 <GetMoistAirEnthalpy+0x38>
lea    0xf05(%rip),%rdi
lea    0xf19(%rip),%rsi
mov    $0x358,%edx
movsd  %xmm1,0x8(%rsp)
call   1030 <Assert@plt>
movsd  0x8(%rsp),%xmm1
maxsd  0xea0(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1040 <isIP@plt>
test   %rax,%rax
je     11a3 <GetMoistAirEnthalpy+0x83>
movsd  0xe8e(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  0xe84(%rip),%xmm1
mulsd  0x8(%rsp),%xmm1
mulsd  0xe7e(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret
movsd  0xe75(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  0xe6b(%rip),%xmm1
mulsd  0xe6b(%rip),%xmm0
mulsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm0
mulsd  0xe61(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Humidity ratio is negative\00"
@.str.1 = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/psychrometrics/psychrolib/refs/heads/master/src/c/psychrolib.c\00"
define double @GetMoistAirEnthalpy(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %5
%8 = fcmp oge double %7, 0.000000e+00
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 @Assert(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 856)
br label %11
11: ; preds = %9, %2
%12 = load double, double* %5
%13 = fcmp ogt double %12, 0x3E7AD7F29ABCAF48
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load double, double* %5
br label %17
16: ; preds = %11
br label %17
17: ; preds = %16, %14
%18 = phi double [ %15, %14 ], [ 0x3E7AD7F29ABCAF48, %16 ]
store double %18, double* %6
%19 = call i64 (...) @isIP()
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %28
21: ; preds = %17
%22 = load double, double* %4
%23 = load double, double* %6
%24 = load double, double* %4
%25 = call double @llvm.fmuladd.f64(double 4.440000e-01, double %24, double 1.061000e+03)
%26 = fmul double %23, %25
%27 = call double @llvm.fmuladd.f64(double 2.400000e-01, double %22, double %26)
store double %27, double* %3
br label %36
28: ; preds = %17
%29 = load double, double* %4
%30 = load double, double* %6
%31 = load double, double* %4
%32 = call double @llvm.fmuladd.f64(double 1.860000e+00, double %31, double 2.501000e+03)
%33 = fmul double %30, %32
%34 = call double @llvm.fmuladd.f64(double 1.006000e+00, double %29, double %33)
%35 = fmul double %34, 1.000000e+03
store double %35, double* %3
br label %36
36: ; preds = %28, %21
%37 = load double, double* %3
ret double %37
}

LLVM IR (-O2):
@.str = [27 x i8] c"Humidity ratio is negative\00"
@.str.1 = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/psychrometrics/psychrolib/refs/heads/master/src/c/psychrolib.c\00"
define double @GetMoistAirEnthalpy(double %0, double %1) {
%3 = fcmp ult double %1, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @Assert(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 856)
br label %6
6: ; preds = %4, %2
%7 = fcmp ogt double %1, 0x3E7AD7F29ABCAF48
%8 = select i1 %7, double %1, double 0x3E7AD7F29ABCAF48
%9 = tail call i64 (...) @isIP()
%10 = icmp eq i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = tail call double @llvm.fmuladd.f64(double %0, double 4.440000e-01, double 1.061000e+03)
%13 = fmul double %12, %8
%14 = tail call double @llvm.fmuladd.f64(double %0, double 2.400000e-01, double %13)
br label %20
15: ; preds = %6
%16 = tail call double @llvm.fmuladd.f64(double %0, double 1.860000e+00, double 2.501000e+03)
%17 = fmul double %16, %8
%18 = tail call double @llvm.fmuladd.f64(double %0, double 1.006000e+00, double %17)
%19 = fmul double %18, 1.000000e+03
br label %20
20: ; preds = %15, %11
%21 = phi double [ %14, %11 ], [ %19, %15 ]
ret double %21
}