#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 check_errors();
int check_gen();
int /*<<< orphan*/ ignore(char *);
unsigned int make_new_seed();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int result = 1;
  int temp, myid;
  unsigned int seed1, seed2;
  ignore("Checking make_sprng_seed ...  ");
  seed1 = make_new_seed();
  seed2 = make_new_seed();
  if (seed1 != seed2)
    ignore("  ... Checked make_sprng_seed\n");
  else {
    result = 0;
    printf("\nERROR: make_sprng_seed does not return unique seeds\n");
  }
  if (check_gen() != 1)
    result = 0;
  if (check_errors() != 1)
    result = 0;
  if (result == 1)
    printf("\nResult:\t PASSED\n\n");
  else
    printf("\nResult:\t FAILED\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xe8c(%rip),%rdi
call   1030 <ignore@plt>
mov    $0x0,%al
call   1060 <make_new_seed@plt>
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1060 <make_new_seed@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     11aa <main+0x5a>
lea    0xe7f(%rip),%rdi
call   1030 <ignore@plt>
jmp    11bd <main+0x6d>
movl   $0x0,-0x14(%rbp)
lea    0xe86(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <check_gen@plt>
cmp    $0x1,%eax
je     11d4 <main+0x84>
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1070 <check_errors@plt>
cmp    $0x1,%eax
je     11eb <main+0x9b>
movl   $0x0,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1206 <main+0xb6>
lea    0xe78(%rip),%rdi
call   1050 <printf@plt>
jmp    1212 <main+0xc2>
lea    0xe7a(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xea5(%rip),%rdi
call   1040 <ignore@plt>
xor    %eax,%eax
call   1060 <make_new_seed@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1060 <make_new_seed@plt>
mov    %eax,%ebp
cmp    %eax,%r14d
jne    1186 <main+0x36>
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
jmp    1192 <main+0x42>
lea    0xe92(%rip),%rdi
call   1040 <ignore@plt>
xor    %eax,%eax
call   1050 <check_gen@plt>
mov    %eax,%ebx
xor    $0x1,%ebx
xor    %eax,%eax
call   1070 <check_errors@plt>
xor    $0x1,%eax
cmp    %ebp,%r14d
lea    0xec1(%rip),%rcx
lea    0xecc(%rip),%rdi
cmove  %rcx,%rdi
or     %ebx,%eax
cmovne %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Checking make_sprng_seed ... \00"
@.str.1 = [31 x i8] c" ... Checked make_sprng_seed\0A\00"
@.str.2 = [54 x i8] c"\0AERROR: make_sprng_seed does not return unique seeds\0A\00"
@.str.3 = [19 x i8] c"\0AResult:\09 PASSED\0A\0A\00"
@.str.4 = [19 x i8] c"\0AResult:\09 FAILED\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%11 = call i32 @ignore(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (...) @make_new_seed()
store i32 %12, i32* %9
%13 = call i32 (...) @make_new_seed()
store i32 %13, i32* %10
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = icmp ne i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 @ignore(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %21
19: ; preds = %2
store i32 0, i32* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
%22 = call i32 (...) @check_gen()
%23 = icmp ne i32 %22, 1
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 0, i32* %6
br label %25
25: ; preds = %24, %21
%26 = call i32 (...) @check_errors()
%27 = icmp ne i32 %26, 1
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 0, i32* %6
br label %29
29: ; preds = %28, %25
%30 = load i32, i32* %6
%31 = icmp eq i32 %30, 1
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
br label %36
34: ; preds = %29
%35 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
br label %36
36: ; preds = %34, %32
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
@.str = [31 x i8] c"Checking make_sprng_seed ... \00"
@.str.1 = [31 x i8] c" ... Checked make_sprng_seed\0A\00"
@str = [53 x i8] c"\0AERROR: make_sprng_seed does not return unique seeds\00"
@str.5 = [18 x i8] c"\0AResult:\09 FAILED\0A\00"
@str.6 = [18 x i8] c"\0AResult:\09 PASSED\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @ignore(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @make_new_seed()
%5 = tail call i32 (...) @make_new_seed()
%6 = icmp eq i32 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @ignore(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %2
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = xor i1 %6, true
%13 = tail call i32 (...) @check_gen()
%14 = icmp eq i32 %13, 1
%15 = tail call i32 (...) @check_errors()
%16 = icmp eq i32 %15, 1
%17 = select i1 %16, i1 %14, i1 false
%18 = select i1 %17, i1 %12, i1 false
%19 = select i1 %18, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.5, i64 0, i64 0)
%20 = tail call i32 @puts(i8* dereferenceable(1) %19)
ret i32 0
}