void test_prandom_seed() {
  int test1 = prandom_int();
  prandom_seed(10);
  int test2 = prandom_int();
  ((test1 != test2)
       ? _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",
                     45, "prandom_seed.")
       : _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",
                     45, "prandom_seed.")) ||
      diag("Got %d and %d, should be different", test1, test2);
}


x86 assembly (clang, -O0):
<test_prandom_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <prandom_int@plt>
mov    %eax,-0x4(%rbp)
mov    $0xa,%edi
mov    $0x0,%al
call   1060 <prandom_seed@plt>
mov    $0x0,%al
call   1040 <prandom_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     11af <test_prandom_seed+0x6f>
mov    $0x1,%edi
lea    0xe80(%rip),%rsi
lea    0xe8b(%rip),%rdx
mov    $0x2d,%ecx
lea    0xf0f(%rip),%r8
mov    $0x0,%al
call   1050 <_gen_result@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    11ff <test_prandom_seed+0xbf>
jmp    11e2 <test_prandom_seed+0xa2>
xor    %edi,%edi
lea    0xe48(%rip),%rsi
lea    0xe53(%rip),%rdx
mov    $0x2d,%ecx
lea    0xed7(%rip),%r8
mov    $0x0,%al
call   1050 <_gen_result@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    11ff <test_prandom_seed+0xbf>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <diag@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_prandom_seed>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <prandom_int@plt>
mov    %eax,%ebx
mov    $0xa,%edi
xor    %eax,%eax
call   1060 <prandom_seed@plt>
xor    %eax,%eax
call   1040 <prandom_int@plt>
mov    %eax,%ebp
lea    0xe98(%rip),%rsi
lea    0xea3(%rip),%rdx
lea    0xf2c(%rip),%r8
cmp    %eax,%ebx
jne    117e <test_prandom_seed+0x3e>
xor    %edi,%edi
jmp    1183 <test_prandom_seed+0x43>
mov    $0x1,%edi
mov    $0x2d,%ecx
xor    %eax,%eax
call   1050 <_gen_result@plt>
test   %eax,%eax
je     119a <test_prandom_seed+0x5a>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xf0f(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <diag@plt>

LLVM IR (-O0):
@__func__.test_prandom_seed = [18 x i8] c"test_prandom_seed\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 = [14 x i8] c"prandom_seed.\00"
@.str.2 = [35 x i8] c"Got %d and %d, should be different\00"
define void @test_prandom_seed() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @prandom_int()
store i32 %3, i32* %1
%4 = call i32 (i32, ...) bitcast (i32 (...)* @prandom_seed to i32 (i32, ...)*)(i32 10)
%5 = call i32 (...) @prandom_int()
store i32 %5, i32* %2
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_gen_result to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.test_prandom_seed, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 45, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp ne i32 %10, 0
br i1 %11, label %20, label %15
12: ; preds = %0
%13 = call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_gen_result to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.test_prandom_seed, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 45, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp ne i32 %13, 0
br i1 %14, label %20, label %15
15: ; preds = %12, %9
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @diag to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %16, i32 %17)
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %15, %12, %9
%21 = phi i1 [ true, %12 ], [ true, %9 ], [ %19, %15 ]
%22 = zext i1 %21 to i32
ret void
}

LLVM IR (-O2):
@__func__.test_prandom_seed = [18 x i8] c"test_prandom_seed\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 = [14 x i8] c"prandom_seed.\00"
@.str.2 = [35 x i8] c"Got %d and %d, should be different\00"
define void @test_prandom_seed() {
%1 = tail call i32 (...) @prandom_int()
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @prandom_seed to i32 (i32, ...)*)(i32 10)
%3 = tail call i32 (...) @prandom_int()
%4 = icmp eq i32 %1, %3
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = tail call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_gen_result to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.test_prandom_seed, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 45, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %13
8: ; preds = %0
%9 = tail call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_gen_result to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.test_prandom_seed, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 45, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8, %5
%12 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @diag to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %1, i32 %3)
br label %13
13: ; preds = %11, %8, %5
ret void
}