#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*/ printf(char *);
int scanf(char *, int *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
void choose_game_configuration(int *width, int *height,
                               int *allow_lines_after_overflow,
                               char *piece_file_name) {
  int user_width, user_height, user_overflow, user_pieces;
  printf("  Board width : ");
  if (scanf("%d", &user_width) != 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",
              54, "scanf failed");
      exit(1);
    } while (0);
  };
  while (user_width <= 2 || user_width > 14) {
    printf("  The board width must be in [2..14].\n");
    if (scanf("%d", &user_width) != 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",
                58, "scanf failed");
        exit(1);
      } while (0);
    };
  }
  printf("  Board height : ");
  if (scanf("%d", &user_height) != 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",
              63, "scanf failed");
      exit(1);
    } while (0);
  };
  while (user_height <= 1) {
    printf("  The board height must be greater than 1.\n");
    if (scanf("%d", &user_height) != 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",
                67, "scanf failed");
        exit(1);
      } while (0);
    };
  }
  user_overflow = 0;
  while (user_overflow < 1 || user_overflow > 2) {
    printf("  Allow lines to be completed when the piece overflows?\n");
    printf("  1. No\n");
    printf("  2. Yes\n");
    printf("  Your choice: ");
    if (scanf("%d", &user_overflow) != 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",
                77, "scanf failed");
        exit(1);
      } while (0);
    };
  }
  user_pieces = 0;
  while (user_pieces < 1 || user_pieces > 2) {
    printf("  Select a set of pieces:\n");
    printf("  1. Standard Tetris pieces (tetraminos)\n");
    printf("  2. Melax's reduced set of pieces\n");
    printf("  Your choice: ");
    if (scanf("%d", &user_pieces) != 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",
                87, "scanf failed");
        exit(1);
      } while (0);
    };
  }
  switch (user_pieces) {
  case 1:
    strcpy(piece_file_name, "pieces4.dat");
    break;
  case 2:
    strcpy(piece_file_name, "pieces_melax.dat");
    break;
  }
  *width = user_width;
  *height = user_height;
  *allow_lines_after_overflow = user_overflow - 1;
}


x86 assembly (clang, -O0):
<choose_game_configuration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
je     11c4 <choose_game_configuration+0x74>
jmp    1192 <choose_game_configuration+0x42>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
lea    0xe72(%rip),%rsi
lea    0xe89(%rip),%rdx
mov    $0x36,%ecx
lea    0xf24(%rip),%r8
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
jmp    11c9 <choose_game_configuration+0x79>
mov    $0x1,%al
cmpl   $0x2,-0x24(%rbp)
mov    %al,-0x31(%rbp)
jle    11e2 <choose_game_configuration+0x92>
cmpl   $0xe,-0x24(%rbp)
setg   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
test   $0x1,%al
jne    11f2 <choose_game_configuration+0xa2>
jmp    1253 <choose_game_configuration+0x103>
lea    0xeed(%rip),%rdi
call   1040 <printf@plt>
lea    0xe0c(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
je     124e <choose_game_configuration+0xfe>
jmp    121c <choose_game_configuration+0xcc>
mov    0x2dbd(%rip),%rax
mov    (%rax),%edi
lea    0xde8(%rip),%rsi
lea    0xdff(%rip),%rdx
mov    $0x3a,%ecx
lea    0xe9a(%rip),%r8
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
jmp    11c9 <choose_game_configuration+0x79>
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xdab(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
je     12af <choose_game_configuration+0x15f>
jmp    127d <choose_game_configuration+0x12d>
mov    0x2d5c(%rip),%rax
mov    (%rax),%edi
lea    0xd87(%rip),%rsi
lea    0xd9e(%rip),%rdx
mov    $0x3f,%ecx
lea    0xe39(%rip),%r8
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
jmp    12b4 <choose_game_configuration+0x164>
cmpl   $0x1,-0x28(%rbp)
jg     131f <choose_game_configuration+0x1cf>
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
lea    0xd40(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
je     131a <choose_game_configuration+0x1ca>
jmp    12e8 <choose_game_configuration+0x198>
mov    0x2cf1(%rip),%rax
mov    (%rax),%edi
lea    0xd1c(%rip),%rsi
lea    0xd33(%rip),%rdx
mov    $0x43,%ecx
lea    0xdce(%rip),%r8
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
jmp    12b4 <choose_game_configuration+0x164>
movl   $0x0,-0x2c(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0x2c(%rbp)
mov    %al,-0x32(%rbp)
jl     133f <choose_game_configuration+0x1ef>
cmpl   $0x2,-0x2c(%rbp)
setg   %al
mov    %al,-0x32(%rbp)
mov    -0x32(%rbp),%al
test   $0x1,%al
jne    134f <choose_game_configuration+0x1ff>
jmp    13d4 <choose_game_configuration+0x284>
lea    0xdf5(%rip),%rdi
call   1040 <printf@plt>
lea    0xe22(%rip),%rdi
call   1040 <printf@plt>
lea    0xe1f(%rip),%rdi
call   1040 <printf@plt>
lea    0xe1d(%rip),%rdi
call   1040 <printf@plt>
lea    0xc8b(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
je     13cf <choose_game_configuration+0x27f>
jmp    139d <choose_game_configuration+0x24d>
mov    0x2c3c(%rip),%rax
mov    (%rax),%edi
lea    0xc67(%rip),%rsi
lea    0xc7e(%rip),%rdx
mov    $0x4d,%ecx
lea    0xd19(%rip),%r8
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
jmp    1326 <choose_game_configuration+0x1d6>
movl   $0x0,-0x30(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0x30(%rbp)
mov    %al,-0x33(%rbp)
jl     13f4 <choose_game_configuration+0x2a4>
cmpl   $0x2,-0x30(%rbp)
setg   %al
mov    %al,-0x33(%rbp)
mov    -0x33(%rbp),%al
test   $0x1,%al
jne    1404 <choose_game_configuration+0x2b4>
jmp    1489 <choose_game_configuration+0x339>
lea    0xd9c(%rip),%rdi
call   1040 <printf@plt>
lea    0xdab(%rip),%rdi
call   1040 <printf@plt>
lea    0xdc9(%rip),%rdi
call   1040 <printf@plt>
lea    0xd68(%rip),%rdi
call   1040 <printf@plt>
lea    0xbd6(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
je     1484 <choose_game_configuration+0x334>
jmp    1452 <choose_game_configuration+0x302>
mov    0x2b87(%rip),%rax
mov    (%rax),%edi
lea    0xbb2(%rip),%rsi
lea    0xbc9(%rip),%rdx
mov    $0x57,%ecx
lea    0xc64(%rip),%r8
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
jmp    13db <choose_game_configuration+0x28b>
mov    -0x30(%rbp),%eax
mov    %eax,-0x38(%rbp)
sub    $0x1,%eax
je     14ae <choose_game_configuration+0x35e>
jmp    149d <choose_game_configuration+0x34d>
mov    -0x38(%rbp),%eax
sub    $0x2,%eax
je     14c3 <choose_game_configuration+0x373>
jmp    14d3 <choose_game_configuration+0x383>
mov    -0x20(%rbp),%rdi
lea    0xd57(%rip),%rsi
call   1030 <strcpy@plt>
jmp    14d3 <choose_game_configuration+0x383>
mov    -0x20(%rbp),%rdi
lea    0xd4e(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x24(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choose_game_configuration>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rcx,0x30(%rsp)
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r13
lea    0xe7d(%rip),%rdi
call   1050 <printf@plt>
lea    0xe82(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1070 <scanf@plt>
cmp    $0x1,%eax
jne    144f <choose_game_configuration+0x2ef>
lea    0x1056(%rip),%r14
lea    0xe61(%rip),%rbp
lea    0x10(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x10(%rsp),%eax
add    $0xfffffff1,%eax
cmp    $0xfffffff3,%eax
ja     120c <choose_game_configuration+0xac>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
cmp    $0x1,%eax
je     11c0 <choose_game_configuration+0x60>
mov    0x2df5(%rip),%rax
mov    (%rax),%edi
lea    0xe20(%rip),%rsi
lea    0xe37(%rip),%rdx
lea    0xed7(%rip),%r8
mov    $0x3a,%ecx
jmp    1440 <choose_game_configuration+0x2e0>
lea    0xed3(%rip),%rdi
call   1050 <printf@plt>
lea    0xdf2(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
cmp    $0x1,%eax
jne    1474 <choose_game_configuration+0x314>
lea    0xf9b(%rip),%r14
lea    0xdd1(%rip),%rbp
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
cmpl   $0x1,0xc(%rsp)
jg     1297 <choose_game_configuration+0x137>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
cmp    $0x1,%eax
je     1250 <choose_game_configuration+0xf0>
mov    0x2d6a(%rip),%rax
mov    (%rax),%edi
lea    0xd95(%rip),%rsi
lea    0xdac(%rip),%rdx
lea    0xe4c(%rip),%r8
mov    $0x43,%ecx
jmp    1440 <choose_game_configuration+0x2e0>
mov    %r13,0x18(%rsp)
mov    %r12,0x20(%rsp)
mov    %r15,0x28(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xed6(%rip),%r12
lea    0xf07(%rip),%r14
lea    0xf08(%rip),%r15
lea    0xe2e(%rip),%r13
lea    0xd40(%rip),%rbx
lea    0x8(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1070 <scanf@plt>
cmp    $0x1,%eax
jne    13f8 <choose_game_configuration+0x298>
mov    0x8(%rsp),%eax
add    $0xfffffffd,%eax
cmp    $0xfffffffe,%eax
jb     12e0 <choose_game_configuration+0x180>
movl   $0x0,0x14(%rsp)
lea    0xdf6(%rip),%rbx
lea    0xe09(%rip),%rbp
lea    0xe2b(%rip),%r12
lea    0xdb4(%rip),%r14
lea    0xcc6(%rip),%r15
lea    0x14(%rsp),%r13
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   1070 <scanf@plt>
cmp    $0x1,%eax
jne    141d <choose_game_configuration+0x2bd>
mov    0x14(%rsp),%eax
lea    -0x3(%rax),%ecx
cmp    $0xfffffffd,%ecx
jbe    1350 <choose_game_configuration+0x1f0>
cmp    $0x1,%eax
je     13b2 <choose_game_configuration+0x252>
cmp    $0x2,%eax
mov    0x28(%rsp),%r14
mov    0x20(%rsp),%rbp
mov    0x18(%rsp),%rbx
jne    13d2 <choose_game_configuration+0x272>
lea    0xd64(%rip),%rsi
jmp    13c8 <choose_game_configuration+0x268>
lea    0xd4f(%rip),%rsi
mov    0x28(%rsp),%r14
mov    0x20(%rsp),%rbp
mov    0x18(%rsp),%rbx
mov    0x30(%rsp),%rdi
call   1030 <strcpy@plt>
mov    0x10(%rsp),%eax
mov    %eax,(%rbx)
mov    0xc(%rsp),%eax
mov    %eax,0x0(%rbp)
mov    0x8(%rsp),%eax
add    $0xffffffff,%eax
mov    %eax,(%r14)
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2be1(%rip),%rax
mov    (%rax),%edi
lea    0xc0c(%rip),%rsi
lea    0xc23(%rip),%rdx
lea    0xcc3(%rip),%r8
mov    $0x4d,%ecx
jmp    1440 <choose_game_configuration+0x2e0>
mov    0x2bbc(%rip),%rax
mov    (%rax),%edi
lea    0xbe7(%rip),%rsi
lea    0xbfe(%rip),%rdx
lea    0xc9e(%rip),%r8
mov    $0x57,%ecx
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    0x2b8a(%rip),%rax
mov    (%rax),%edi
lea    0xbb5(%rip),%rsi
lea    0xbcc(%rip),%rdx
lea    0xc6c(%rip),%r8
mov    $0x36,%ecx
jmp    1440 <choose_game_configuration+0x2e0>
mov    0x2b65(%rip),%rax
mov    (%rax),%edi
lea    0xb90(%rip),%rsi
lea    0xba7(%rip),%rdx
lea    0xc47(%rip),%r8
mov    $0x3f,%ecx
jmp    1440 <choose_game_configuration+0x2e0>

LLVM IR (-O0):
@.str = [17 x i8] c" Board width : \00"
@.str.1 = [3 x i8] c"%d\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"
@.str.5 = [39 x i8] c" The board width must be in [2..14].\0A\00"
@.str.6 = [18 x i8] c" Board height : \00"
@.str.7 = [44 x i8] c" The board height must be greater than 1.\0A\00"
@.str.8 = [57 x i8] c" Allow lines to be completed when the piece overflows?\0A\00"
@.str.9 = [9 x i8] c" 1. No\0A\00"
@.str.10 = [10 x i8] c" 2. Yes\0A\00"
@.str.11 = [16 x i8] c" Your choice: \00"
@.str.12 = [27 x i8] c" Select a set of pieces:\0A\00"
@.str.13 = [42 x i8] c" 1. Standard Tetris pieces (tetraminos)\0A\00"
@.str.14 = [36 x i8] c" 2. Melax's reduced set of pieces\0A\00"
@.str.15 = [12 x i8] c"pieces4.dat\00"
@.str.16 = [17 x i8] c"pieces_melax.dat\00"
define void @choose_game_configuration(i32* %0, i32* %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%13 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%15 = icmp ne i32 %14, 1
br i1 %15, label %16, label %22
16: ; preds = %4
br label %17
17: ; preds = %16
%18 = load i32, i32* @stderr
%19 = call i32 @fprintf(i32 %18, 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 54, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 @exit(i32 1)
unreachable
21: ; No predecessors!
br label %22
22: ; preds = %21, %4
br label %23
23: ; preds = %41, %22
%24 = load i32, i32* %9
%25 = icmp sle i32 %24, 2
br i1 %25, label %29, label %26
26: ; preds = %23
%27 = load i32, i32* %9
%28 = icmp sgt i32 %27, 14
br label %29
29: ; preds = %26, %23
%30 = phi i1 [ true, %23 ], [ %28, %26 ]
br i1 %30, label %31, label %42
31: ; preds = %29
%32 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0))
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%34 = icmp ne i32 %33, 1
br i1 %34, label %35, label %41
35: ; preds = %31
br label %36
36: ; preds = %35
%37 = load i32, i32* @stderr
%38 = call i32 @fprintf(i32 %37, 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 58, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%39 = call i32 @exit(i32 1)
unreachable
40: ; No predecessors!
br label %41
41: ; preds = %40, %31
br label %23
42: ; preds = %29
%43 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%44 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%45 = icmp ne i32 %44, 1
br i1 %45, label %46, label %52
46: ; preds = %42
br label %47
47: ; preds = %46
%48 = load i32, i32* @stderr
%49 = call i32 @fprintf(i32 %48, 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 63, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%50 = call i32 @exit(i32 1)
unreachable
51: ; No predecessors!
br label %52
52: ; preds = %51, %42
br label %53
53: ; preds = %66, %52
%54 = load i32, i32* %10
%55 = icmp sle i32 %54, 1
br i1 %55, label %56, label %67
56: ; preds = %53
%57 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0))
%58 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%59 = icmp ne i32 %58, 1
br i1 %59, label %60, label %66
60: ; preds = %56
br label %61
61: ; preds = %60
%62 = load i32, i32* @stderr
%63 = call i32 @fprintf(i32 %62, 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 67, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%64 = call i32 @exit(i32 1)
unreachable
65: ; No predecessors!
br label %66
66: ; preds = %65, %56
br label %53
67: ; preds = %53
store i32 0, i32* %11
br label %68
68: ; preds = %89, %67
%69 = load i32, i32* %11
%70 = icmp slt i32 %69, 1
br i1 %70, label %74, label %71
71: ; preds = %68
%72 = load i32, i32* %11
%73 = icmp sgt i32 %72, 2
br label %74
74: ; preds = %71, %68
%75 = phi i1 [ true, %68 ], [ %73, %71 ]
br i1 %75, label %76, label %90
76: ; preds = %74
%77 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.8, i64 0, i64 0))
%78 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%79 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
%80 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
%81 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %11)
%82 = icmp ne i32 %81, 1
br i1 %82, label %83, label %89
83: ; preds = %76
br label %84
84: ; preds = %83
%85 = load i32, i32* @stderr
%86 = call i32 @fprintf(i32 %85, 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 77, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%87 = call i32 @exit(i32 1)
unreachable
88: ; No predecessors!
br label %89
89: ; preds = %88, %76
br label %68
90: ; preds = %74
store i32 0, i32* %12
br label %91
91: ; preds = %112, %90
%92 = load i32, i32* %12
%93 = icmp slt i32 %92, 1
br i1 %93, label %97, label %94
94: ; preds = %91
%95 = load i32, i32* %12
%96 = icmp sgt i32 %95, 2
br label %97
97: ; preds = %94, %91
%98 = phi i1 [ true, %91 ], [ %96, %94 ]
br i1 %98, label %99, label %113
99: ; preds = %97
%100 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0))
%101 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.13, i64 0, i64 0))
%102 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.14, i64 0, i64 0))
%103 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
%104 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
%105 = icmp ne i32 %104, 1
br i1 %105, label %106, label %112
106: ; preds = %99
br label %107
107: ; preds = %106
%108 = load i32, i32* @stderr
%109 = call i32 @fprintf(i32 %108, 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 87, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%110 = call i32 @exit(i32 1)
unreachable
111: ; No predecessors!
br label %112
112: ; preds = %111, %99
br label %91
113: ; preds = %97
%114 = load i32, i32* %12
switch i32 %114, label %121 [
i32 1, label %115
i32 2, label %118
]
115: ; preds = %113
%116 = load i8*, i8** %8
%117 = call i32 @strcpy(i8* %116, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0))
br label %121
118: ; preds = %113
%119 = load i8*, i8** %8
%120 = call i32 @strcpy(i8* %119, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.16, i64 0, i64 0))
br label %121
121: ; preds = %113, %118, %115
%122 = load i32, i32* %9
%123 = load i32*, i32** %5
store i32 %122, i32* %123
%124 = load i32, i32* %10
%125 = load i32*, i32** %6
store i32 %124, i32* %125
%126 = load i32, i32* %11
%127 = sub nsw i32 %126, 1
%128 = load i32*, i32** %7
store i32 %127, i32* %128
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c" Board width : \00"
@.str.1 = [3 x i8] c"%d\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"
@.str.6 = [18 x i8] c" Board height : \00"
@.str.11 = [16 x i8] c" Your choice: \00"
@.str.15 = [12 x i8] c"pieces4.dat\00"
@.str.16 = [17 x i8] c"pieces_melax.dat\00"
@str = [26 x i8] c" Select a set of pieces:\00"
@str.17 = [41 x i8] c" 1. Standard Tetris pieces (tetraminos)\00"
@str.18 = [35 x i8] c" 2. Melax's reduced set of pieces\00"
@str.19 = [56 x i8] c" Allow lines to be completed when the piece overflows?\00"
@str.20 = [8 x i8] c" 1. No\00"
@str.21 = [9 x i8] c" 2. Yes\00"
@str.22 = [43 x i8] c" The board height must be greater than 1.\00"
@str.23 = [38 x i8] c" The board width must be in [2..14].\00"
define void @choose_game_configuration(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = bitcast i32* %7 to i8*
%12 = bitcast i32* %8 to i8*
%13 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%15 = icmp eq i32 %14, 1
br i1 %15, label %20, label %16
16: ; preds = %4
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, 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 54, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %4, %24
%21 = load i32, i32* %5
%22 = add i32 %21, -15
%23 = icmp ult i32 %22, -12
br i1 %23, label %24, label %32
24: ; preds = %20
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.23, i64 0, i64 0))
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%27 = icmp eq i32 %26, 1
br i1 %27, label %20, label %28
28: ; preds = %24
%29 = load i32, i32* @stderr
%30 = call i32 @fprintf(i32 %29, 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 58, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%31 = call i32 @exit(i32 1)
unreachable
32: ; preds = %20
%33 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%35 = icmp eq i32 %34, 1
br i1 %35, label %40, label %36
36: ; preds = %32
%37 = load i32, i32* @stderr
%38 = call i32 @fprintf(i32 %37, 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 63, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%39 = call i32 @exit(i32 1)
unreachable
40: ; preds = %32, %43
%41 = load i32, i32* %6
%42 = icmp slt i32 %41, 2
br i1 %42, label %43, label %51
43: ; preds = %40
%44 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.22, i64 0, i64 0))
%45 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%46 = icmp eq i32 %45, 1
br i1 %46, label %40, label %47
47: ; preds = %43
%48 = load i32, i32* @stderr
%49 = call i32 @fprintf(i32 %48, 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 67, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%50 = call i32 @exit(i32 1)
unreachable
51: ; preds = %40
store i32 0, i32* %7
br label %52
52: ; preds = %51, %59
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.19, i64 0, i64 0))
%54 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.20, i64 0, i64 0))
%55 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.21, i64 0, i64 0))
%56 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
%57 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%58 = icmp eq i32 %57, 1
br i1 %58, label %59, label %63
59: ; preds = %52
%60 = load i32, i32* %7
%61 = add i32 %60, -3
%62 = icmp ult i32 %61, -2
br i1 %62, label %52, label %67
63: ; preds = %52
%64 = load i32, i32* @stderr
%65 = call i32 @fprintf(i32 %64, 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 77, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%66 = call i32 @exit(i32 1)
unreachable
67: ; preds = %59
store i32 0, i32* %8
br label %72
68: ; preds = %72
%69 = load i32, i32* %8
%70 = add i32 %69, -3
%71 = icmp ult i32 %70, -2
br i1 %71, label %72, label %83
72: ; preds = %67, %68
%73 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%74 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.17, i64 0, i64 0))
%75 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.18, i64 0, i64 0))
%76 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
%77 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%78 = icmp eq i32 %77, 1
br i1 %78, label %68, label %79
79: ; preds = %72
%80 = load i32, i32* @stderr
%81 = call i32 @fprintf(i32 %80, 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 87, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%82 = call i32 @exit(i32 1)
unreachable
83: ; preds = %68
switch i32 %69, label %88 [
i32 1, label %85
i32 2, label %84
]
84: ; preds = %83
br label %85
85: ; preds = %83, %84
%86 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.16, i64 0, i64 0), %84 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), %83 ]
%87 = call i32 @strcpy(i8* %3, i8* %86)
br label %88
88: ; preds = %85, %83
%89 = load i32, i32* %5
store i32 %89, i32* %0
%90 = load i32, i32* %6
store i32 %90, i32* %1
%91 = load i32, i32* %7
%92 = add nsw i32 %91, -1
store i32 %92, i32* %2
ret void
}