#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*/ choose_game_configuration(int *, int *, int *, char *);
int *choose_piece_sequence();
int /*<<< orphan*/ choose_random_generator_seed();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ free(int *);
char getchar();
int /*<<< orphan*/ initialize_random_generator(int /*<<< orphan*/);
int /*<<< orphan*/ play_interactive_game(int, int, int, int, char *, int *);
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  int tetris_implementation;
  int choice;
  int width, height, allow_lines_after_overflow;
  char piece_file_name[256];
  int *piece_sequence;
  initialize_random_generator(time(NULL));
  choice = 0;
  tetris_implementation = 0;
  width = 10;
  height = 20;
  allow_lines_after_overflow = 0;
  strcpy(piece_file_name, "pieces4.dat");
  piece_sequence = NULL;
  while (choice != 9) {
    printf("--- Main menu ---\n");
    printf("0. Set Tetris implementation (to be done, default=simplified)\n");
    printf("1. Play a game\n");
    printf("2. Set the game configuration\n");
    printf("3. Set the sequence of pieces\n");
    printf("4. Set the seed of the random number generator\n");
    printf("5. Quit\n");
    printf("Your choice: ");
    if (scanf("%d", &choice) != 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",
                222, "scanf failed");
        exit(1);
      } while (0);
    };
    while (getchar() != '\n')
      ;
    printf("\n");
    switch (choice) {
    case 1:
      printf("Play a game\n");
      play_interactive_game(tetris_implementation, width, height,
                            allow_lines_after_overflow, piece_file_name,
                            piece_sequence);
      break;
    case 2:
      printf("Game configuration\n");
      choose_game_configuration(&width, &height, &allow_lines_after_overflow,
                                piece_file_name);
      printf("Configuration saved.\n");
      break;
    case 3:
      printf("Sequence of pieces\n");
      piece_sequence = choose_piece_sequence();
      printf("Configuration saved.\n");
      break;
    case 4:
      printf("Seed of the random number generator\n");
      choose_random_generator_seed();
      printf("Seed initialized.\n");
      break;
    }
    printf("\n");
  }
  if (piece_sequence != NULL) {
    if (piece_sequence != NULL) {
      free(piece_sequence);
      piece_sequence = NULL;
    } else {
      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",
                257, "INVALID MEMORY FREE()\n");
        exit(1);
      } while (0);
    };
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10c0 <time@plt>
mov    %eax,%edi
call   1050 <initialize_random_generator@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0xa,-0x1c(%rbp)
movl   $0x14,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
lea    -0x130(%rbp),%rdi
lea    0xde6(%rip),%rsi
call   1040 <strcpy@plt>
movq   $0x0,-0x138(%rbp)
cmpl   $0x9,-0x18(%rbp)
je     140c <main+0x23c>
lea    0xdd1(%rip),%rdi
call   1060 <printf@plt>
lea    0xdd8(%rip),%rdi
call   1060 <printf@plt>
lea    0xe0b(%rip),%rdi
call   1060 <printf@plt>
lea    0xe0f(%rip),%rdi
call   1060 <printf@plt>
lea    0xe22(%rip),%rdi
call   1060 <printf@plt>
lea    0xe35(%rip),%rdi
call   1060 <printf@plt>
lea    0xe59(%rip),%rdi
call   1060 <printf@plt>
lea    0xe56(%rip),%rdi
call   1060 <printf@plt>
lea    0xe58(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   10e0 <scanf@plt>
cmp    $0x1,%eax
je     12f4 <main+0x124>
jmp    12c2 <main+0xf2>
mov    0x2d17(%rip),%rax
mov    (%rax),%edi
lea    0xe34(%rip),%rsi
lea    0xe4b(%rip),%rdx
mov    $0xde,%ecx
lea    0xee6(%rip),%r8
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
jmp    12f9 <main+0x129>
mov    $0x0,%al
call   1080 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1311 <main+0x141>
jmp    12f9 <main+0x129>
lea    0xf4b(%rip),%rdi
call   1060 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x140(%rbp)
sub    $0x3,%eax
ja     13fb <main+0x22b>
mov    -0x140(%rbp),%rax
lea    0xcbd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xd1e(%rip),%rdi
call   1060 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
lea    -0x130(%rbp),%r8
mov    -0x138(%rbp),%r9
call   10d0 <play_interactive_game@plt>
jmp    13fb <main+0x22b>
lea    0xe55(%rip),%rdi
call   1060 <printf@plt>
lea    -0x130(%rbp),%rcx
lea    -0x1c(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x24(%rbp),%rdx
call   10a0 <choose_game_configuration@plt>
lea    0xe45(%rip),%rdi
call   1060 <printf@plt>
jmp    13fb <main+0x22b>
lea    0xe4a(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1070 <choose_piece_sequence@plt>
mov    %rax,-0x138(%rbp)
lea    0xe1a(%rip),%rdi
call   1060 <printf@plt>
jmp    13fb <main+0x22b>
lea    0xe33(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   10b0 <choose_random_generator_seed@plt>
lea    0xe45(%rip),%rdi
call   1060 <printf@plt>
lea    0xe61(%rip),%rdi
call   1060 <printf@plt>
jmp    123a <main+0x6a>
cmpq   $0x0,-0x138(%rbp)
je     1480 <main+0x2b0>
cmpq   $0x0,-0x138(%rbp)
je     1444 <main+0x274>
mov    -0x138(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x138(%rbp)
jmp    147b <main+0x2ab>
jmp    1449 <main+0x279>
mov    0x2b90(%rip),%rax
mov    (%rax),%edi
lea    0xcad(%rip),%rsi
lea    0xcc4(%rip),%rdx
mov    $0x101,%ecx
lea    0xde2(%rip),%r8
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
jmp    1480 <main+0x2b0>
xor    %eax,%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
xor    %edi,%edi
call   10e0 <time@plt>
mov    %eax,%edi
call   1070 <initialize_random_generator@plt>
movl   $0x0,(%rsp)
movl   $0xa,0xc(%rsp)
movl   $0x14,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xddb(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1050 <strcpy@plt>
lea    0xf83(%rip),%r15
lea    0xdcf(%rip),%r12
lea    0xdd6(%rip),%r13
mov    %rsp,%rbx
lea    0xda2(%rip),%r14
xor    %ebp,%ebp
jmp    1295 <main+0xa5>
lea    0xf68(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   10d0 <choose_random_generator_seed@plt>
lea    0xf79(%rip),%rdi
call   1060 <puts@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
cmpl   $0x9,(%rsp)
je     13bc <main+0x1cc>
lea    0xe63(%rip),%rdi
call   1060 <puts@plt>
lea    0xe69(%rip),%rdi
call   1060 <puts@plt>
lea    0xe9b(%rip),%rdi
call   1060 <puts@plt>
lea    0xe9e(%rip),%rdi
call   1060 <puts@plt>
lea    0xeb0(%rip),%rdi
call   1060 <puts@plt>
lea    0xec2(%rip),%rdi
call   1060 <puts@plt>
mov    %r15,%rdi
call   1060 <puts@plt>
mov    %r12,%rdi
call   1080 <printf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1100 <scanf@plt>
cmp    $0x1,%eax
jne    13dd <main+0x1ed>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   10a0 <getchar@plt>
cmp    $0xa,%al
jne    1310 <main+0x120>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    (%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     1281 <main+0x91>
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
lea    0xe0e(%rip),%rdi
call   1060 <puts@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ecx
xor    %edi,%edi
lea    0x10(%rsp),%r8
mov    %rbp,%r9
call   10f0 <play_interactive_game@plt>
jmp    1281 <main+0x91>
lea    0xeaa(%rip),%rdi
call   1060 <puts@plt>
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   10c0 <choose_game_configuration@plt>
lea    0xe98(%rip),%rdi
jmp    127c <main+0x8c>
lea    0xe66(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1090 <choose_piece_sequence@plt>
mov    %rax,%rbp
lea    0xe76(%rip),%rdi
jmp    127c <main+0x8c>
test   %rbp,%rbp
je     13c9 <main+0x1d9>
mov    %rbp,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2bfc(%rip),%rax
mov    (%rax),%edi
lea    0xc40(%rip),%rsi
lea    0xc57(%rip),%rdx
lea    0xcf7(%rip),%r8
mov    $0xde,%ecx
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"pieces4.dat\00"
@.str.1 = [19 x i8] c"--- Main menu ---\0A\00"
@.str.2 = [63 x i8] c"0. Set Tetris implementation (to be done, default=simplified)\0A\00"
@.str.3 = [16 x i8] c"1. Play a game\0A\00"
@.str.4 = [31 x i8] c"2. Set the game configuration\0A\00"
@.str.5 = [31 x i8] c"3. Set the sequence of pieces\0A\00"
@.str.6 = [48 x i8] c"4. Set the seed of the random number generator\0A\00"
@.str.7 = [9 x i8] c"5. Quit\0A\00"
@.str.8 = [14 x i8] c"Your choice: \00"
@.str.9 = [3 x i8] c"%d\00"
@stderr = global i32 0
@.str.10 = [30 x i8] c"ERROR [file %s] [line %d] %s\0A\00"
@.str.11 = [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.12 = [13 x i8] c"scanf failed\00"
@.str.13 = [2 x i8] c"\0A\00"
@.str.14 = [13 x i8] c"Play a game\0A\00"
@.str.15 = [20 x i8] c"Game configuration\0A\00"
@.str.16 = [22 x i8] c"Configuration saved.\0A\00"
@.str.17 = [20 x i8] c"Sequence of pieces\0A\00"
@.str.18 = [37 x i8] c"Seed of the random number generator\0A\00"
@.str.19 = [19 x i8] c"Seed initialized.\0A\00"
@.str.20 = [23 x i8] c"INVALID MEMORY FREE()\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
%11 = alloca [256 x i8]
%12 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = call i32 @time(i32* null)
%14 = call i32 @initialize_random_generator(i32 %13)
store i32 0, i32* %7
store i32 0, i32* %6
store i32 10, i32* %8
store i32 20, i32* %9
store i32 0, i32* %10
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%16 = call i32 @strcpy(i8* %15, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32* null, i32** %12
br label %17
17: ; preds = %68, %2
%18 = load i32, i32* %7
%19 = icmp ne i32 %18, 9
br i1 %19, label %20, label %70
20: ; preds = %17
%21 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%22 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
%23 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%24 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%25 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%26 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0))
%27 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%28 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %7)
%30 = icmp ne i32 %29, 1
br i1 %30, label %31, label %37
31: ; preds = %20
br label %32
32: ; preds = %31
%33 = load i32, i32* @stderr
%34 = call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.11, i64 0, i64 0), i32 222, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0))
%35 = call i32 @exit(i32 1)
unreachable
36: ; No predecessors!
br label %37
37: ; preds = %36, %20
br label %38
38: ; preds = %42, %37
%39 = call signext i8 (...) @getchar()
%40 = sext i8 %39 to i32
%41 = icmp ne i32 %40, 10
br i1 %41, label %42, label %43
42: ; preds = %38
br label %38
43: ; preds = %38
%44 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%45 = load i32, i32* %7
switch i32 %45, label %68 [
i32 1, label %46
i32 2, label %55
i32 3, label %60
i32 4, label %64
]
46: ; preds = %43
%47 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0))
%48 = load i32, i32* %6
%49 = load i32, i32* %8
%50 = load i32, i32* %9
%51 = load i32, i32* %10
%52 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%53 = load i32*, i32** %12
%54 = call i32 @play_interactive_game(i32 %48, i32 %49, i32 %50, i32 %51, i8* %52, i32* %53)
br label %68
55: ; preds = %43
%56 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.15, i64 0, i64 0))
%57 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%58 = call i32 @choose_game_configuration(i32* %8, i32* %9, i32* %10, i8* %57)
%59 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.16, i64 0, i64 0))
br label %68
60: ; preds = %43
%61 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0))
%62 = call i32* (...) @choose_piece_sequence()
store i32* %62, i32** %12
%63 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.16, i64 0, i64 0))
br label %68
64: ; preds = %43
%65 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.18, i64 0, i64 0))
%66 = call i32 (...) @choose_random_generator_seed()
%67 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.19, i64 0, i64 0))
br label %68
68: ; preds = %43, %64, %60, %55, %46
%69 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %17
70: ; preds = %17
%71 = load i32*, i32** %12
%72 = icmp ne i32* %71, null
br i1 %72, label %73, label %86
73: ; preds = %70
%74 = load i32*, i32** %12
%75 = icmp ne i32* %74, null
br i1 %75, label %76, label %79
76: ; preds = %73
%77 = load i32*, i32** %12
%78 = call i32 @free(i32* %77)
store i32* null, i32** %12
br label %85
79: ; preds = %73
br label %80
80: ; preds = %79
%81 = load i32, i32* @stderr
%82 = call i32 @fprintf(i32 %81, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.11, i64 0, i64 0), i32 257, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.20, i64 0, i64 0))
%83 = call i32 @exit(i32 1)
unreachable
84: ; No predecessors!
br label %85
85: ; preds = %84, %76
br label %86
86: ; preds = %85, %70
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"pieces4.dat\00"
@.str.8 = [14 x i8] c"Your choice: \00"
@.str.9 = [3 x i8] c"%d\00"
@stderr = global i32 0
@.str.10 = [30 x i8] c"ERROR [file %s] [line %d] %s\0A\00"
@.str.11 = [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.12 = [13 x i8] c"scanf failed\00"
@str = [18 x i8] c"--- Main menu ---\00"
@str.21 = [62 x i8] c"0. Set Tetris implementation (to be done, default=simplified)\00"
@str.22 = [15 x i8] c"1. Play a game\00"
@str.23 = [30 x i8] c"2. Set the game configuration\00"
@str.24 = [30 x i8] c"3. Set the sequence of pieces\00"
@str.25 = [47 x i8] c"4. Set the seed of the random number generator\00"
@str.26 = [8 x i8] c"5. Quit\00"
@str.27 = [36 x i8] c"Seed of the random number generator\00"
@str.28 = [18 x i8] c"Seed initialized.\00"
@str.29 = [19 x i8] c"Sequence of pieces\00"
@str.31 = [19 x i8] c"Game configuration\00"
@str.32 = [21 x i8] c"Configuration saved.\00"
@str.33 = [12 x i8] c"Play a game\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [256 x i8]
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = bitcast i32* %6 to i8*
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%13 = tail call i32 @time(i32* null)
%14 = tail call i32 @initialize_random_generator(i32 %13)
store i32 0, i32* %3
store i32 10, i32* %4
store i32 20, i32* %5
store i32 0, i32* %6
%15 = call i32 @strcpy(i8* %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %2, %56
%17 = phi i32* [ %57, %56 ], [ null, %2 ]
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.21, i64 0, i64 0))
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.22, i64 0, i64 0))
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.23, i64 0, i64 0))
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.24, i64 0, i64 0))
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.25, i64 0, i64 0))
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.26, i64 0, i64 0))
%25 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %3)
%27 = icmp eq i32 %26, 1
br i1 %27, label %32, label %28
28: ; preds = %16
%29 = load i32, i32* @stderr
%30 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.11, i64 0, i64 0), i32 222, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0))
%31 = call i32 @exit(i32 1)
unreachable
32: ; preds = %16, %32
%33 = call signext i8 (...) @getchar()
%34 = icmp eq i8 %33, 10
br i1 %34, label %35, label %32
35: ; preds = %32
%36 = call i32 @putchar(i32 10)
%37 = load i32, i32* %3
switch i32 %37, label %56 [
i32 1, label %38
i32 2, label %44
i32 3, label %48
i32 4, label %52
]
38: ; preds = %35
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.33, i64 0, i64 0))
%40 = load i32, i32* %4
%41 = load i32, i32* %5
%42 = load i32, i32* %6
%43 = call i32 @play_interactive_game(i32 0, i32 %40, i32 %41, i32 %42, i8* %12, i32* %17)
br label %56
44: ; preds = %35
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.31, i64 0, i64 0))
%46 = call i32 @choose_game_configuration(i32* %4, i32* %5, i32* %6, i8* %12)
%47 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.32, i64 0, i64 0))
br label %56
48: ; preds = %35
%49 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.29, i64 0, i64 0))
%50 = call i32* (...) @choose_piece_sequence()
%51 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.32, i64 0, i64 0))
br label %56
52: ; preds = %35
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.27, i64 0, i64 0))
%54 = call i32 (...) @choose_random_generator_seed()
%55 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.28, i64 0, i64 0))
br label %56
56: ; preds = %35, %52, %48, %44, %38
%57 = phi i32* [ %17, %35 ], [ %17, %52 ], [ %50, %48 ], [ %17, %44 ], [ %17, %38 ]
%58 = call i32 @putchar(i32 10)
%59 = load i32, i32* %3
%60 = icmp eq i32 %59, 9
br i1 %60, label %61, label %16
61: ; preds = %56
%62 = icmp eq i32* %57, null
br i1 %62, label %65, label %63
63: ; preds = %61
%64 = call i32 @free(i32* %57)
br label %65
65: ; preds = %63, %61
ret i32 0
}