#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 GetHumRatioFromRelHum(double, double, double);
double GetTWetBulbFromHumRatio(double, double, double);
double GetTWetBulbFromRelHum(double TDryBulb, double RelHum, double Pressure) {
  double HumRatio;
  if (!(RelHum >= 0 && RelHum <= 1)) {
    Assert("Relative humidity is outside range [0,1]",
           "/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",
           221);
  }
  HumRatio = GetHumRatioFromRelHum(TDryBulb, RelHum, Pressure);
  return GetTWetBulbFromHumRatio(TDryBulb, HumRatio, Pressure);
}


x86 assembly (clang, -O0):
<GetTWetBulbFromRelHum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     116c <GetTWetBulbFromRelHum+0x3c>
movsd  0xe9f(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jae    1184 <GetTWetBulbFromRelHum+0x54>
lea    0xe95(%rip),%rdi
lea    0xeb7(%rip),%rsi
mov    $0xdd,%edx
call   1050 <Assert@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <GetHumRatioFromRelHum@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <GetTWetBulbFromHumRatio@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTWetBulbFromRelHum>:
sub    $0x18,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm0,(%rsp)
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     1157 <GetTWetBulbFromRelHum+0x27>
movsd  0xeaf(%rip),%xmm0
ucomisd %xmm1,%xmm0
jae    117b <GetTWetBulbFromRelHum+0x4b>
lea    0xeaa(%rip),%rdi
lea    0xecc(%rip),%rsi
mov    $0xdd,%edx
movsd  %xmm1,0x10(%rsp)
call   1050 <Assert@plt>
movsd  0x10(%rsp),%xmm1
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
call   1040 <GetHumRatioFromRelHum@plt>
movaps %xmm0,%xmm1
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
add    $0x18,%rsp
jmp    1030 <GetTWetBulbFromHumRatio@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Relative humidity is outside range [0,1]\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 @GetTWetBulbFromRelHum(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %5
%9 = fcmp oge double %8, 0.000000e+00
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load double, double* %5
%12 = fcmp ole double %11, 1.000000e+00
br i1 %12, label %15, label %13
13: ; preds = %10, %3
%14 = call i32 @Assert(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 221)
br label %15
15: ; preds = %13, %10
%16 = load double, double* %4
%17 = load double, double* %5
%18 = load double, double* %6
%19 = call double @GetHumRatioFromRelHum(double %16, double %17, double %18)
store double %19, double* %7
%20 = load double, double* %4
%21 = load double, double* %7
%22 = load double, double* %6
%23 = call double @GetTWetBulbFromHumRatio(double %20, double %21, double %22)
ret double %23
}

LLVM IR (-O2):
@.str = [41 x i8] c"Relative humidity is outside range [0,1]\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 @GetTWetBulbFromRelHum(double %0, double %1, double %2) {
%4 = fcmp oge double %1, 0.000000e+00
%5 = fcmp ole double %1, 1.000000e+00
%6 = and i1 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @Assert(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 221)
br label %9
9: ; preds = %3, %7
%10 = tail call double @GetHumRatioFromRelHum(double %0, double %1, double %2)
%11 = tail call double @GetTWetBulbFromHumRatio(double %0, double %10, double %2)
ret double %11
}