#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 GetHumRatioFromSpecificHum(double SpecificHum) {
  double HumRatio;
  if (!(SpecificHum >= 0.0 && SpecificHum < 1.0)) {
    Assert("Specific 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",
           640);
  }
  HumRatio = SpecificHum / (1.0 - SpecificHum);
  return (((HumRatio) > (1e-7)) ? (HumRatio) : (1e-7));
}


x86 assembly (clang, -O0):
<GetHumRatioFromSpecificHum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1142 <GetHumRatioFromSpecificHum+0x32>
movsd  0xec9(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
ja     115a <GetHumRatioFromSpecificHum+0x4a>
lea    0xec7(%rip),%rdi
lea    0xeea(%rip),%rsi
mov    $0x280,%edx
call   1030 <Assert@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xe99(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe86(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    119b <GetHumRatioFromSpecificHum+0x8b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11ad <GetHumRatioFromSpecificHum+0x9d>
movsd  0xe65(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11ad <GetHumRatioFromSpecificHum+0x9d>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetHumRatioFromSpecificHum>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1129 <GetHumRatioFromSpecificHum+0x19>
movsd  0xedd(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     114b <GetHumRatioFromSpecificHum+0x3b>
lea    0xee0(%rip),%rdi
lea    0xf03(%rip),%rsi
mov    $0x280,%edx
movsd  %xmm0,(%rsp)
call   1030 <Assert@plt>
movsd  (%rsp),%xmm0
movsd  0xead(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
maxsd  0xea5(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Specific 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 @GetHumRatioFromSpecificHum(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp olt double %7, 1.000000e+00
br i1 %8, label %11, label %9
9: ; preds = %6, %1
%10 = call i32 @Assert(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 640)
br label %11
11: ; preds = %9, %6
%12 = load double, double* %2
%13 = load double, double* %2
%14 = fsub double 1.000000e+00, %13
%15 = fdiv double %12, %14
store double %15, double* %3
%16 = load double, double* %3
%17 = fcmp ogt double %16, 0x3E7AD7F29ABCAF48
br i1 %17, label %18, label %20
18: ; preds = %11
%19 = load double, double* %3
br label %21
20: ; preds = %11
br label %21
21: ; preds = %20, %18
%22 = phi double [ %19, %18 ], [ 0x3E7AD7F29ABCAF48, %20 ]
ret double %22
}

LLVM IR (-O2):
@.str = [42 x i8] c"Specific 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 @GetHumRatioFromSpecificHum(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = fcmp olt double %0, 1.000000e+00
%4 = and i1 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @Assert(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 640)
br label %7
7: ; preds = %1, %5
%8 = fsub double 1.000000e+00, %0
%9 = fdiv double %0, %8
%10 = fcmp ogt double %9, 0x3E7AD7F29ABCAF48
%11 = select i1 %10, double %9, double 0x3E7AD7F29ABCAF48
ret double %11
}