#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 /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ initialize_random_generator(unsigned int);
int /*<<< orphan*/ printf(char *);
int scanf(char *, unsigned int *);
int /*<<< orphan*/ stderr;
void choose_random_generator_seed(void) {
  unsigned int seed;
  printf("  Seed: ");
  if (scanf("%ud", &seed) != 1) {
    do {
      fprintf(stderr, "ERROR [file %s] [line %d] %s\n",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/amarack/python-rl/refs/heads/master/"
              "pyrl/environments/mdptetris/src/tetris.c",
              183, "scanf failed");
      exit(1);
    } while (0);
  };
  initialize_random_generator(seed);
}


x86 assembly (clang, -O0):
<choose_random_generator_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9e(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
je     11b4 <choose_random_generator_seed+0x64>
jmp    1182 <choose_random_generator_seed+0x32>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
lea    0xe7b(%rip),%rsi
lea    0xe92(%rip),%rdx
mov    $0xb7,%ecx
lea    0xf2d(%rip),%r8
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x4(%rbp),%edi
call   1030 <initialize_random_generator@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choose_random_generator_seed>:
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
lea    0xea5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    117e <choose_random_generator_seed+0x2e>
mov    0x4(%rsp),%edi
call   1030 <initialize_random_generator@plt>
pop    %rax
ret
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
lea    0xe7f(%rip),%rsi
lea    0xe96(%rip),%rdx
lea    0xf36(%rip),%r8
mov    $0xb7,%ecx
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c" Seed: \00"
@.str.1 = [4 x i8] c"%ud\00"
@stderr = global i32 0
@.str.2 = [30 x i8] c"ERROR [file %s] [line %d] %s\0A\00"
@.str.3 = [167 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/amarack/python-rl/refs/heads/master/pyrl/environments/mdptetris/src/tetris.c\00"
@.str.4 = [13 x i8] c"scanf failed\00"
define void @choose_random_generator_seed() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = icmp ne i32 %3, 1
br i1 %4, label %5, label %11
5: ; preds = %0
br label %6
6: ; preds = %5
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.3, i64 0, i64 0), i32 183, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; No predecessors!
br label %11
11: ; preds = %10, %0
%12 = load i32, i32* %1
%13 = call i32 @initialize_random_generator(i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c" Seed: \00"
@.str.1 = [4 x i8] c"%ud\00"
@stderr = global i32 0
@.str.2 = [30 x i8] c"ERROR [file %s] [line %d] %s\0A\00"
@.str.3 = [167 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/amarack/python-rl/refs/heads/master/pyrl/environments/mdptetris/src/tetris.c\00"
@.str.4 = [13 x i8] c"scanf failed\00"
define void @choose_random_generator_seed() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %10, label %6
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.3, i64 0, i64 0), i32 183, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = load i32, i32* %1
%12 = call i32 @initialize_random_generator(i32 %11)
ret void
}