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


x86 assembly (clang, -O0):
<GetTDryBulbFromEnthalpyAndHumRatio>:
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 <GetTDryBulbFromEnthalpyAndHumRatio+0x3c>
lea    0xef5(%rip),%rdi
lea    0xf09(%rip),%rsi
mov    $0x2c3,%edx
call   1030 <Assert@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xe97(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1182 <GetTDryBulbFromEnthalpyAndHumRatio+0x62>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1194 <GetTDryBulbFromEnthalpyAndHumRatio+0x74>
movsd  0xe76(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1194 <GetTDryBulbFromEnthalpyAndHumRatio+0x74>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1040 <isIP@plt>
cmp    $0x0,%rax
je     11f4 <GetTDryBulbFromEnthalpyAndHumRatio+0xd4>
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  0xe77(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xe52(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe4e(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1240 <GetTDryBulbFromEnthalpyAndHumRatio+0x120>
movsd  -0x10(%rbp),%xmm1
movsd  0xe1f(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  0xe06(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xde1(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xddd(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTDryBulbFromEnthalpyAndHumRatio>:
sub    $0x28,%rsp
movapd %xmm0,0x10(%rsp)
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jae    1156 <GetTDryBulbFromEnthalpyAndHumRatio+0x36>
lea    0xf15(%rip),%rdi
lea    0xf29(%rip),%rsi
mov    $0x2c3,%edx
movapd %xmm1,(%rsp)
call   1030 <Assert@plt>
movapd (%rsp),%xmm1
maxsd  0xea2(%rip),%xmm1
movapd %xmm1,(%rsp)
xor    %eax,%eax
call   1040 <isIP@plt>
test   %rax,%rax
je     1191 <GetTDryBulbFromEnthalpyAndHumRatio+0x71>
movapd (%rsp),%xmm1
unpcklpd %xmm1,%xmm1
movapd 0x10(%rsp),%xmm0
shufpd $0x2,0xe89(%rip),%xmm0
mulpd  0xe91(%rip),%xmm1
jmp    11b9 <GetTDryBulbFromEnthalpyAndHumRatio+0x99>
movapd 0x10(%rsp),%xmm0
divsd  0xe69(%rip),%xmm0
movapd (%rsp),%xmm1
unpcklpd %xmm1,%xmm1
shufpd $0x2,0xe7f(%rip),%xmm0
mulpd  0xe87(%rip),%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%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 @GetTDryBulbFromEnthalpyAndHumRatio(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 707)
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 = call double @llvm.fmuladd.f64(double -1.061000e+03, double %23, double %22)
%25 = load double, double* %6
%26 = call double @llvm.fmuladd.f64(double 4.440000e-01, double %25, double 2.400000e-01)
%27 = fdiv double %24, %26
store double %27, double* %3
br label %36
28: ; preds = %17
%29 = load double, double* %4
%30 = fdiv double %29, 1.000000e+03
%31 = load double, double* %6
%32 = call double @llvm.fmuladd.f64(double -2.501000e+03, double %31, double %30)
%33 = load double, double* %6
%34 = call double @llvm.fmuladd.f64(double 1.860000e+00, double %33, double 1.006000e+00)
%35 = fdiv double %32, %34
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 @GetTDryBulbFromEnthalpyAndHumRatio(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 707)
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 %19, label %11
11: ; preds = %6
%12 = insertelement <2 x double> poison, double %8, i64 0
%13 = shufflevector <2 x double> %12, <2 x double> poison, <2 x i32> zeroinitializer
%14 = insertelement <2 x double> <double poison, double 2.400000e-01>, double %0, i64 0
%15 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %13, <2 x double> <double -1.061000e+03, double 4.440000e-01>, <2 x double> %14)
%16 = extractelement <2 x double> %15, i64 0
%17 = extractelement <2 x double> %15, i64 1
%18 = fdiv double %16, %17
br label %28
19: ; preds = %6
%20 = fdiv double %0, 1.000000e+03
%21 = insertelement <2 x double> poison, double %8, i64 0
%22 = shufflevector <2 x double> %21, <2 x double> poison, <2 x i32> zeroinitializer
%23 = insertelement <2 x double> <double poison, double 1.006000e+00>, double %20, i64 0
%24 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %22, <2 x double> <double -2.501000e+03, double 1.860000e+00>, <2 x double> %23)
%25 = extractelement <2 x double> %24, i64 0
%26 = extractelement <2 x double> %24, i64 1
%27 = fdiv double %25, %26
br label %28
28: ; preds = %19, %11
%29 = phi double [ %18, %11 ], [ %27, %19 ]
ret double %29
}