#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);
double GetTKelvinFromTCelsius(double);
double GetTRankineFromTFahrenheit(double);
scalar_t__ isIP();
double GetMoistAirVolume(double TDryBulb, double HumRatio, double Pressure) {
  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",
           877);
  }
  BoundedHumRatio = (((HumRatio) > (1e-7)) ? (HumRatio) : (1e-7));
  if (isIP())
    return 53.350 * GetTRankineFromTFahrenheit(TDryBulb) *
           (1. + 1.607858 * BoundedHumRatio) / (144. * Pressure);
  else
    return 287.042 * GetTKelvinFromTCelsius(TDryBulb) *
           (1. + 1.607858 * BoundedHumRatio) / Pressure;
}


x86 assembly (clang, -O0):
<GetMoistAirVolume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    1181 <GetMoistAirVolume+0x41>
lea    0xec0(%rip),%rdi
lea    0xed4(%rip),%rsi
mov    $0x36d,%edx
call   1040 <Assert@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xe72(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11a7 <GetMoistAirVolume+0x67>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    11b9 <GetMoistAirVolume+0x79>
movsd  0xe51(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    11b9 <GetMoistAirVolume+0x79>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    $0x0,%al
call   1050 <isIP@plt>
cmp    $0x0,%rax
je     1229 <GetMoistAirVolume+0xe9>
movsd  -0x10(%rbp),%xmm0
call   1060 <GetTRankineFromTFahrenheit@plt>
movaps %xmm0,%xmm1
movsd  0xe3f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  0xe0e(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe0a(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe0a(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    126d <GetMoistAirVolume+0x12d>
movsd  -0x10(%rbp),%xmm0
call   1030 <GetTKelvinFromTCelsius@plt>
movaps %xmm0,%xmm1
movsd  0xdda(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  0xdb9(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xdb5(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMoistAirVolume>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jae    117c <GetMoistAirVolume+0x3c>
lea    0xecf(%rip),%rdi
lea    0xee3(%rip),%rsi
mov    $0x36d,%edx
movsd  %xmm1,(%rsp)
call   1040 <Assert@plt>
movsd  (%rsp),%xmm1
maxsd  0xe7c(%rip),%xmm1
movsd  %xmm1,(%rsp)
xor    %eax,%eax
call   1050 <isIP@plt>
test   %rax,%rax
je     11d5 <GetMoistAirVolume+0x95>
movsd  0x8(%rsp),%xmm0
call   1060 <GetTRankineFromTFahrenheit@plt>
mulsd  0xe60(%rip),%xmm0
movsd  (%rsp),%xmm1
mulsd  0xe5b(%rip),%xmm1
addsd  0xe5b(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  0xe51(%rip),%xmm0
divsd  %xmm0,%xmm1
jmp    1207 <GetMoistAirVolume+0xc7>
movsd  0x8(%rsp),%xmm0
call   1030 <GetTKelvinFromTCelsius@plt>
mulsd  0xe40(%rip),%xmm0
movsd  (%rsp),%xmm1
mulsd  0xe1b(%rip),%xmm1
addsd  0xe1b(%rip),%xmm1
mulsd  %xmm0,%xmm1
divsd  0x10(%rsp),%xmm1
movapd %xmm1,%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 @GetMoistAirVolume(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* %5
store double %1, double* %6
store double %2, double* %7
%9 = load double, double* %6
%10 = fcmp oge double %9, 0.000000e+00
br i1 %10, label %13, label %11
11: ; preds = %3
%12 = 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 877)
br label %13
13: ; preds = %11, %3
%14 = load double, double* %6
%15 = fcmp ogt double %14, 0x3E7AD7F29ABCAF48
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load double, double* %6
br label %19
18: ; preds = %13
br label %19
19: ; preds = %18, %16
%20 = phi double [ %17, %16 ], [ 0x3E7AD7F29ABCAF48, %18 ]
store double %20, double* %8
%21 = call i64 (...) @isIP()
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %33
23: ; preds = %19
%24 = load double, double* %5
%25 = call double @GetTRankineFromTFahrenheit(double %24)
%26 = fmul double 5.335000e+01, %25
%27 = load double, double* %8
%28 = call double @llvm.fmuladd.f64(double 0x3FF9B9C94F69CA9F, double %27, double 1.000000e+00)
%29 = fmul double %26, %28
%30 = load double, double* %7
%31 = fmul double 1.440000e+02, %30
%32 = fdiv double %29, %31
store double %32, double* %4
br label %42
33: ; preds = %19
%34 = load double, double* %5
%35 = call double @GetTKelvinFromTCelsius(double %34)
%36 = fmul double 2.870420e+02, %35
%37 = load double, double* %8
%38 = call double @llvm.fmuladd.f64(double 0x3FF9B9C94F69CA9F, double %37, double 1.000000e+00)
%39 = fmul double %36, %38
%40 = load double, double* %7
%41 = fdiv double %39, %40
store double %41, double* %4
br label %42
42: ; preds = %33, %23
%43 = load double, double* %4
ret double %43
}

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 @GetMoistAirVolume(double %0, double %1, double %2) {
%4 = fcmp ult double %1, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = 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 877)
br label %7
7: ; preds = %5, %3
%8 = fcmp ogt double %1, 0x3E7AD7F29ABCAF48
%9 = select i1 %8, double %1, double 0x3E7AD7F29ABCAF48
%10 = tail call i64 (...) @isIP()
%11 = icmp eq i64 %10, 0
br i1 %11, label %19, label %12
12: ; preds = %7
%13 = tail call double @GetTRankineFromTFahrenheit(double %0)
%14 = fmul double %13, 5.335000e+01
%15 = tail call double @llvm.fmuladd.f64(double %9, double 0x3FF9B9C94F69CA9F, double 1.000000e+00)
%16 = fmul double %15, %14
%17 = fmul double %2, 1.440000e+02
%18 = fdiv double %16, %17
br label %25
19: ; preds = %7
%20 = tail call double @GetTKelvinFromTCelsius(double %0)
%21 = fmul double %20, 2.870420e+02
%22 = tail call double @llvm.fmuladd.f64(double %9, double 0x3FF9B9C94F69CA9F, double 1.000000e+00)
%23 = fmul double %22, %21
%24 = fdiv double %23, %2
br label %25
25: ; preds = %19, %12
%26 = phi double [ %18, %12 ], [ %24, %19 ]
ret double %26
}