void test_prandom_double_range() {
  double min = 0.0;
  double max = 1.0;
  double val = prandom_double_range(min, max);
  ((val >= min && val <= max)
       ? _gen_result(1, __func__,
                     "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                     "outputs/2022-01-22/02-19-57/repos/modulated/uti-c/refs/"
                     "heads/master/tests/random.test.c",
                     68, "prandom_double_range.")
       : _gen_result(0, __func__,
                     "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                     "outputs/2022-01-22/02-19-57/repos/modulated/uti-c/refs/"
                     "heads/master/tests/random.test.c",
                     68, "prandom_double_range.")) ||
      diag("Expected %f to be between %f and %f.", val, min, max);
}


x86 assembly (clang, -O0):
<test_prandom_double_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xeb8(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    $0x2,%al
call   1050 <prandom_double_range@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     11c6 <test_prandom_double_range+0x96>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     11c6 <test_prandom_double_range+0x96>
mov    $0x1,%edi
lea    0xe71(%rip),%rsi
lea    0xe84(%rip),%rdx
mov    $0x44,%ecx
lea    0xf08(%rip),%r8
mov    $0x0,%al
call   1040 <_gen_result@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
jne    121f <test_prandom_double_range+0xef>
jmp    11f9 <test_prandom_double_range+0xc9>
xor    %edi,%edi
lea    0xe39(%rip),%rsi
lea    0xe4c(%rip),%rdx
mov    $0x44,%ecx
lea    0xed0(%rip),%r8
mov    $0x0,%al
call   1040 <_gen_result@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
jne    121f <test_prandom_double_range+0xef>
movsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
lea    0xeb9(%rip),%rdi
mov    $0x3,%al
call   1030 <diag@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_prandom_double_range>:
push   %rbx
movsd  0xec7(%rip),%xmm1
xorps  %xmm0,%xmm0
mov    $0x2,%al
call   1050 <prandom_double_range@plt>
mov    %eax,%ebx
lea    0xebc(%rip),%rsi
lea    0xecf(%rip),%rdx
lea    0xf58(%rip),%r8
cmp    $0x1,%eax
ja     1166 <test_prandom_double_range+0x36>
mov    $0x1,%edi
jmp    1168 <test_prandom_double_range+0x38>
xor    %edi,%edi
mov    $0x44,%ecx
xor    %eax,%eax
call   1040 <_gen_result@plt>
test   %eax,%eax
je     117a <test_prandom_double_range+0x4a>
pop    %rbx
ret
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
lea    0xf40(%rip),%rdi
movsd  0xe70(%rip),%xmm2
xorps  %xmm1,%xmm1
mov    $0x3,%al
pop    %rbx
jmp    1030 <diag@plt>

LLVM IR (-O0):
@__func__.test_prandom_double_range = [26 x i8] c"test_prandom_double_range\00"
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/modulated/uti-c/refs/heads/master/tests/random.test.c\00"
@.str.1 = [22 x i8] c"prandom_double_range.\00"
@.str.2 = [37 x i8] c"Expected %f to be between %f and %f.\00"
define void @test_prandom_double_range() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
store double 0.000000e+00, double* %1
store double 1.000000e+00, double* %2
%4 = load double, double* %1
%5 = load double, double* %2
%6 = call i32 (double, double, ...) bitcast (i32 (...)* @prandom_double_range to i32 (double, double, ...)*)(double %4, double %5)
%7 = sitofp i32 %6 to double
store double %7, double* %3
%8 = load double, double* %3
%9 = load double, double* %1
%10 = fcmp oge double %8, %9
br i1 %10, label %11, label %18
11: ; preds = %0
%12 = load double, double* %3
%13 = load double, double* %2
%14 = fcmp ole double %12, %13
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_gen_result to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @__func__.test_prandom_double_range, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 68, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp ne i32 %16, 0
br i1 %17, label %27, label %21
18: ; preds = %11, %0
%19 = call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_gen_result to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @__func__.test_prandom_double_range, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 68, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp ne i32 %19, 0
br i1 %20, label %27, label %21
21: ; preds = %18, %15
%22 = load double, double* %3
%23 = load double, double* %1
%24 = load double, double* %2
%25 = call i32 (i8*, double, double, double, ...) bitcast (i32 (...)* @diag to i32 (i8*, double, double, double, ...)*)(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), double %22, double %23, double %24)
%26 = icmp ne i32 %25, 0
br label %27
27: ; preds = %21, %18, %15
%28 = phi i1 [ true, %18 ], [ true, %15 ], [ %26, %21 ]
%29 = zext i1 %28 to i32
ret void
}

LLVM IR (-O2):
@__func__.test_prandom_double_range = [26 x i8] c"test_prandom_double_range\00"
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/modulated/uti-c/refs/heads/master/tests/random.test.c\00"
@.str.1 = [22 x i8] c"prandom_double_range.\00"
@.str.2 = [37 x i8] c"Expected %f to be between %f and %f.\00"
define void @test_prandom_double_range() {
%1 = tail call i32 (double, double, ...) bitcast (i32 (...)* @prandom_double_range to i32 (double, double, ...)*)(double 0.000000e+00, double 1.000000e+00)
%2 = sitofp i32 %1 to double
%3 = icmp ult i32 %1, 2
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_gen_result to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @__func__.test_prandom_double_range, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 68, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %12
7: ; preds = %0
%8 = tail call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_gen_result to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @__func__.test_prandom_double_range, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 68, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7, %4
%11 = tail call i32 (i8*, double, double, double, ...) bitcast (i32 (...)* @diag to i32 (i8*, double, double, double, ...)*)(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), double %2, double 0.000000e+00, double 1.000000e+00)
br label %12
12: ; preds = %10, %7, %4
ret void
}