void test_prandom_int_range() {
  int min = 1;
  int max = 2;
  int val = prandom_int_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",
                     55, "prandom_int_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",
                     55, "prandom_int_range.")) ||
      diag("Expected %d to be between %d and %d.", val, min, max);
}


x86 assembly (clang, -O0):
<test_prandom_int_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <prandom_int_range@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     11a9 <test_prandom_int_range+0x79>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11a9 <test_prandom_int_range+0x79>
mov    $0x1,%edi
lea    0xe86(%rip),%rsi
lea    0xe96(%rip),%rdx
mov    $0x37,%ecx
lea    0xf1a(%rip),%r8
mov    $0x0,%al
call   1050 <_gen_result@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
jne    11fc <test_prandom_int_range+0xcc>
jmp    11dc <test_prandom_int_range+0xac>
xor    %edi,%edi
lea    0xe4e(%rip),%rsi
lea    0xe5e(%rip),%rdx
mov    $0x37,%ecx
lea    0xee2(%rip),%r8
mov    $0x0,%al
call   1050 <_gen_result@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
jne    11fc <test_prandom_int_range+0xcc>
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1040 <diag@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_prandom_int_range>:
push   %rbx
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <prandom_int_range@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%eax
lea    0xeb2(%rip),%rsi
lea    0xec2(%rip),%rdx
lea    0xf4b(%rip),%r8
cmp    $0x1,%eax
ja     1168 <test_prandom_int_range+0x38>
mov    $0x1,%edi
jmp    116a <test_prandom_int_range+0x3a>
xor    %edi,%edi
mov    $0x37,%ecx
xor    %eax,%eax
call   1050 <_gen_result@plt>
test   %eax,%eax
je     117c <test_prandom_int_range+0x4c>
pop    %rbx
ret
lea    0xf37(%rip),%rdi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
xor    %eax,%eax
pop    %rbx
jmp    1040 <diag@plt>

LLVM IR (-O0):
@__func__.test_prandom_int_range = [23 x i8] c"test_prandom_int_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 = [19 x i8] c"prandom_int_range.\00"
@.str.2 = [37 x i8] c"Expected %d to be between %d and %d.\00"
define void @test_prandom_int_range() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 1, i32* %1
store i32 2, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @prandom_int_range to i32 (i32, i32, ...)*)(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %1
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %0
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_gen_result to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__func__.test_prandom_int_range, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 55, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp ne i32 %15, 0
br i1 %16, label %26, label %20
17: ; preds = %10, %0
%18 = call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_gen_result to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__func__.test_prandom_int_range, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 55, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp ne i32 %18, 0
br i1 %19, label %26, label %20
20: ; preds = %17, %14
%21 = load i32, i32* %3
%22 = load i32, i32* %1
%23 = load i32, i32* %2
%24 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @diag to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %21, i32 %22, i32 %23)
%25 = icmp ne i32 %24, 0
br label %26
26: ; preds = %20, %17, %14
%27 = phi i1 [ true, %17 ], [ true, %14 ], [ %25, %20 ]
%28 = zext i1 %27 to i32
ret void
}

LLVM IR (-O2):
@__func__.test_prandom_int_range = [23 x i8] c"test_prandom_int_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 = [19 x i8] c"prandom_int_range.\00"
@.str.2 = [37 x i8] c"Expected %d to be between %d and %d.\00"
define void @test_prandom_int_range() {
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @prandom_int_range to i32 (i32, i32, ...)*)(i32 1, i32 2)
%2 = add i32 %1, -1
%3 = icmp ult i32 %2, 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 ([23 x i8], [23 x i8]* @__func__.test_prandom_int_range, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 55, i8* getelementptr inbounds ([19 x i8], [19 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 ([23 x i8], [23 x i8]* @__func__.test_prandom_int_range, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 55, i8* getelementptr inbounds ([19 x i8], [19 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*, i32, i32, i32, ...) bitcast (i32 (...)* @diag to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %1, i32 1, i32 2)
br label %12
12: ; preds = %10, %7, %4
ret void
}