#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ GetSeed(long *);
int /*<<< orphan*/ PlantSeeds(int);
int /*<<< orphan*/ PutSeed(int);
double Random();
int /*<<< orphan*/ SelectStream(int);
int TestRandomNotVerbose(void) {
  long i;
  long x;
  double u;
  char ok = 0;
  SelectStream(0);
  PutSeed(1);
  for (i = 0; i < 10000; i++)
    u = Random();
  GetSeed(&x);
  ok = (x == 113988298);
  SelectStream(1);
  PlantSeeds(1);
  GetSeed(&x);
  ok = ok && (x == 22925);
  if (ok) {
    return EXIT_SUCCESS;
  } else {
    return EXIT_FAILURE;
  }
}


x86 assembly (clang, -O0):
<TestRandomNotVerbose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movb   $0x0,-0x21(%rbp)
xor    %edi,%edi
call   1040 <SelectStream@plt>
mov    $0x1,%edi
call   1070 <PutSeed@plt>
movq   $0x0,-0x10(%rbp)
cmpq   $0x2710,-0x10(%rbp)
jge    11a0 <TestRandomNotVerbose+0x50>
mov    $0x0,%al
call   1060 <Random@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1175 <TestRandomNotVerbose+0x25>
lea    -0x18(%rbp),%rdi
call   1050 <GetSeed@plt>
cmpq   $0x6cb52ca,-0x18(%rbp)
06
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x21(%rbp)
mov    $0x1,%edi
call   1040 <SelectStream@plt>
mov    $0x1,%edi
call   1030 <PlantSeeds@plt>
lea    -0x18(%rbp),%rdi
call   1050 <GetSeed@plt>
movsbl -0x21(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x22(%rbp)
je     11f9 <TestRandomNotVerbose+0xa9>
cmpq   $0x598d,-0x18(%rbp)
sete   %al
mov    %al,-0x22(%rbp)
mov    -0x22(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x21(%rbp)
cmpb   $0x0,-0x21(%rbp)
je     121f <TestRandomNotVerbose+0xcf>
mov    0x2dc3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    122b <TestRandomNotVerbose+0xdb>
mov    0x2dba(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestRandomNotVerbose>:
push   %r14
push   %rbx
push   %rax
xor    %edi,%edi
call   1040 <SelectStream@plt>
mov    $0x1,%edi
call   1070 <PutSeed@plt>
mov    $0x2710,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <Random@plt>
add    $0xffffffffffffffff,%rbx
jne    1170 <TestRandomNotVerbose+0x20>
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <GetSeed@plt>
mov    $0x6cb52ca,%ebx
xor    (%rsp),%rbx
mov    $0x1,%edi
call   1040 <SelectStream@plt>
mov    $0x1,%edi
call   1030 <PlantSeeds@plt>
mov    %r14,%rdi
call   1050 <GetSeed@plt>
mov    $0x598d,%eax
xor    (%rsp),%rax
or     %rbx,%rax
jne    11c4 <TestRandomNotVerbose+0x74>
mov    0x2e16(%rip),%rax
jmp    11cb <TestRandomNotVerbose+0x7b>
mov    0x2e15(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @TestRandomNotVerbose() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca double
%5 = alloca i8
store i8 0, i8* %5
%6 = call i32 @SelectStream(i32 0)
%7 = call i32 @PutSeed(i32 1)
store i64 0, i64* %2
br label %8
8: ; preds = %13, %0
%9 = load i64, i64* %2
%10 = icmp slt i64 %9, 10000
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = call double (...) @Random()
store double %12, double* %4
br label %13
13: ; preds = %11
%14 = load i64, i64* %2
%15 = add nsw i64 %14, 1
store i64 %15, i64* %2
br label %8
16: ; preds = %8
%17 = call i32 @GetSeed(i64* %3)
%18 = load i64, i64* %3
%19 = icmp eq i64 %18, 113988298
%20 = zext i1 %19 to i32
%21 = trunc i32 %20 to i8
store i8 %21, i8* %5
%22 = call i32 @SelectStream(i32 1)
%23 = call i32 @PlantSeeds(i32 1)
%24 = call i32 @GetSeed(i64* %3)
%25 = load i8, i8* %5
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %16
%29 = load i64, i64* %3
%30 = icmp eq i64 %29, 22925
br label %31
31: ; preds = %28, %16
%32 = phi i1 [ false, %16 ], [ %30, %28 ]
%33 = zext i1 %32 to i32
%34 = trunc i32 %33 to i8
store i8 %34, i8* %5
%35 = load i8, i8* %5
%36 = icmp ne i8 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %31
%38 = load i32, i32* @EXIT_SUCCESS
store i32 %38, i32* %1
br label %41
39: ; preds = %31
%40 = load i32, i32* @EXIT_FAILURE
store i32 %40, i32* %1
br label %41
41: ; preds = %39, %37
%42 = load i32, i32* %1
ret i32 %42
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @TestRandomNotVerbose() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 @SelectStream(i32 0)
%4 = tail call i32 @PutSeed(i32 1)
br label %5
5: ; preds = %0, %5
%6 = phi i64 [ 0, %0 ], [ %8, %5 ]
%7 = tail call double (...) @Random()
%8 = add nuw nsw i64 %6, 1
%9 = icmp eq i64 %8, 10000
br i1 %9, label %10, label %5
10: ; preds = %5
%11 = call i32 @GetSeed(i64* %1)
%12 = load i64, i64* %1
%13 = icmp eq i64 %12, 113988298
%14 = call i32 @SelectStream(i32 1)
%15 = call i32 @PlantSeeds(i32 1)
%16 = call i32 @GetSeed(i64* %1)
%17 = load i64, i64* %1
%18 = icmp eq i64 %17, 22925
%19 = select i1 %13, i1 %18, i1 false
%20 = load i32, i32* @EXIT_SUCCESS
%21 = load i32, i32* @EXIT_FAILURE
%22 = select i1 %19, i32 %20, i32 %21
ret i32 %22
}