#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ free(char *);
int fscanf(int /*<<< orphan*/ *, char *, int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ *open_data_file(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, ...);
int /*<<< orphan*/ stderr;
int *choose_piece_sequence(void) {
  int choice, i, sequence_length;
  int *piece_sequence = NULL;
  char *sequence_file_name;
  FILE *sequence_file;
  printf("  1. Random pieces\n");
  printf("  2. S/Z tetraminos alternance\n");
  printf("  3. Set a custom sequence\n");
  printf("  4. Load a sequence from a file\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",
              123, "scanf failed");
      exit(1);
    } while (0);
  };
  switch (choice) {
  case 1:
    piece_sequence = NULL;
    break;
  case 2:
    if ((piece_sequence = (int *)malloc(3 * sizeof(int))) == NULL) {
      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",
                131, "MEMORY FULL\n");
        exit(1);
      } while (0);
    };
    piece_sequence[0] = 3;
    piece_sequence[1] = 4;
    piece_sequence[2] = -1;
    break;
  case 3:
    printf("  Number of pieces in a sequence: ");
    if (scanf("%d", &sequence_length) != 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",
                139, "scanf failed");
        exit(1);
      } while (0);
    };
    if ((piece_sequence = (int *)malloc(sequence_length + 1 * sizeof(int))) ==
        NULL) {
      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",
                140, "MEMORY FULL\n");
        exit(1);
      } while (0);
    };
    for (i = 0; i < sequence_length; i++) {
      printf("  Piece %d: ", i);
      if (scanf("%d", &piece_sequence[i]) != 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",
                  143, "scanf failed");
          exit(1);
        } while (0);
      };
    }
    piece_sequence[i] = -1;
    break;
  case 4:
    if ((sequence_file_name = (char *)malloc(256 * sizeof(char))) == NULL) {
      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",
                149, "MEMORY FULL\n");
        exit(1);
      } while (0);
    };
    printf("  Name of file containing the sequence: ");
    if (scanf("%s", sequence_file_name) != 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",
                151, "scanf failed");
        exit(1);
      } while (0);
    };
    sequence_file = open_data_file(sequence_file_name, "r");
    if (sequence_file_name != NULL) {
      free(sequence_file_name);
      sequence_file_name = 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",
                154, "INVALID MEMORY FREE()\n");
        exit(1);
      } while (0);
    };
    if (sequence_file == NULL) {
      do {
        fprintf(stderr,
                "ERROR [file %s] [line %d] "
                "Cannot read the feature file '%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",
                156, sequence_file_name);
        exit(1);
      } while (0);
    }
    if (fscanf(sequence_file, "%d", &sequence_length) != 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",
                158, "fscanf failed");
        exit(1);
      } while (0);
    };
    if ((piece_sequence = (int *)malloc(sequence_length + 1 * sizeof(int))) ==
        NULL) {
      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",
                159, "MEMORY FULL\n");
        exit(1);
      } while (0);
    };
    for (i = 0; i < sequence_length; i++) {
      if (fscanf(sequence_file, "%d", &(piece_sequence[i])) != 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",
                  161, "fscanf failed");
          exit(1);
        } while (0);
      };
    }
    piece_sequence[i] = -1;
    break;
  }
  return piece_sequence;
}


x86 assembly (clang, -O0):
<choose_piece_sequence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movq   $0x0,-0x18(%rbp)
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb5(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
cmp    $0x1,%eax
je     1228 <choose_piece_sequence+0xa8>
jmp    11f6 <choose_piece_sequence+0x76>
mov    0x2de3(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
lea    0xea6(%rip),%rdx
mov    $0x7b,%ecx
lea    0x1001(%rip),%r8
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0x3,%eax
ja     16c4 <choose_piece_sequence+0x544>
mov    -0x30(%rbp),%rax
lea    0xdb8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movq   $0x0,-0x18(%rbp)
jmp    16c4 <choose_piece_sequence+0x544>
mov    $0xc,%edi
call   1070 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    12ad <choose_piece_sequence+0x12d>
jmp    127b <choose_piece_sequence+0xfb>
mov    0x2d5e(%rip),%rax
mov    (%rax),%edi
lea    0xe0a(%rip),%rsi
lea    0xe21(%rip),%rdx
mov    $0x83,%ecx
lea    0xebc(%rip),%r8
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x4,0x4(%rax)
mov    -0x18(%rbp),%rax
movl   $0xffffffff,0x8(%rax)
jmp    16c4 <choose_piece_sequence+0x544>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdab(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
cmp    $0x1,%eax
je     1332 <choose_piece_sequence+0x1b2>
jmp    1300 <choose_piece_sequence+0x180>
mov    0x2cd9(%rip),%rax
mov    (%rax),%edi
lea    0xd85(%rip),%rsi
lea    0xd9c(%rip),%rdx
mov    $0x8b,%ecx
lea    0xef7(%rip),%r8
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
movslq -0xc(%rbp),%rax
add    $0x4,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1386 <choose_piece_sequence+0x206>
jmp    1354 <choose_piece_sequence+0x1d4>
mov    0x2c85(%rip),%rax
mov    (%rax),%edi
lea    0xd31(%rip),%rsi
lea    0xd48(%rip),%rdx
mov    $0x8c,%ecx
lea    0xde3(%rip),%r8
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    141a <choose_piece_sequence+0x29a>
mov    -0x8(%rbp),%esi
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rsi
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xcd2(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
cmp    $0x1,%eax
je     1407 <choose_piece_sequence+0x287>
jmp    13d5 <choose_piece_sequence+0x255>
mov    0x2c04(%rip),%rax
mov    (%rax),%edi
lea    0xcb0(%rip),%rsi
lea    0xcc7(%rip),%rdx
mov    $0x8f,%ecx
lea    0xe22(%rip),%r8
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
jmp    140c <choose_piece_sequence+0x28c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    138d <choose_piece_sequence+0x20d>
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
jmp    16c4 <choose_piece_sequence+0x544>
mov    $0x100,%edi
call   1070 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    147d <choose_piece_sequence+0x2fd>
jmp    144b <choose_piece_sequence+0x2cb>
mov    0x2b8e(%rip),%rax
mov    (%rax),%edi
lea    0xc3a(%rip),%rsi
lea    0xc51(%rip),%rdx
mov    $0x95,%ecx
lea    0xcec(%rip),%r8
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
lea    0xd13(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xd2a(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
cmp    $0x1,%eax
je     14dd <choose_piece_sequence+0x35d>
jmp    14ab <choose_piece_sequence+0x32b>
mov    0x2b2e(%rip),%rax
mov    (%rax),%edi
lea    0xbda(%rip),%rsi
lea    0xbf1(%rip),%rdx
mov    $0x97,%ecx
lea    0xd4c(%rip),%r8
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x20(%rbp),%rdi
lea    0xcdb(%rip),%rsi
call   10a0 <open_data_file@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1512 <choose_piece_sequence+0x392>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x20(%rbp)
jmp    1549 <choose_piece_sequence+0x3c9>
jmp    1517 <choose_piece_sequence+0x397>
mov    0x2ac2(%rip),%rax
mov    (%rax),%edi
lea    0xb6e(%rip),%rsi
lea    0xb85(%rip),%rdx
mov    $0x9a,%ecx
lea    0xc8b(%rip),%r8
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
cmpq   $0x0,-0x28(%rbp)
jne    1588 <choose_piece_sequence+0x408>
jmp    1559 <choose_piece_sequence+0x3d9>
mov    0x2a80(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%r8
lea    0xc6f(%rip),%rsi
lea    0xb3f(%rip),%rdx
mov    $0x9c,%ecx
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x28(%rbp),%rdi
lea    0xaff(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <fscanf@plt>
cmp    $0x1,%eax
je     15dc <choose_piece_sequence+0x45c>
jmp    15aa <choose_piece_sequence+0x42a>
mov    0x2a2f(%rip),%rax
mov    (%rax),%edi
lea    0xadb(%rip),%rsi
lea    0xaf2(%rip),%rdx
mov    $0x9e,%ecx
lea    0xc4c(%rip),%r8
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
movslq -0xc(%rbp),%rax
add    $0x4,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1630 <choose_piece_sequence+0x4b0>
jmp    15fe <choose_piece_sequence+0x47e>
mov    0x29db(%rip),%rax
mov    (%rax),%edi
lea    0xa87(%rip),%rsi
lea    0xa9e(%rip),%rdx
mov    $0x9f,%ecx
lea    0xb39(%rip),%r8
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    16b5 <choose_piece_sequence+0x535>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rdx
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xa35(%rip),%rsi
call   1050 <fscanf@plt>
cmp    $0x1,%eax
je     16a2 <choose_piece_sequence+0x522>
jmp    1670 <choose_piece_sequence+0x4f0>
mov    0x2969(%rip),%rax
mov    (%rax),%edi
lea    0xa15(%rip),%rsi
lea    0xa2c(%rip),%rdx
mov    $0xa1,%ecx
lea    0xb86(%rip),%r8
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
jmp    16a7 <choose_piece_sequence+0x527>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1637 <choose_piece_sequence+0x4b7>
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choose_piece_sequence>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xfea(%rip),%rdi
call   1040 <puts@plt>
lea    0xff1(%rip),%rdi
call   1040 <puts@plt>
lea    0x1004(%rip),%rdi
call   1040 <puts@plt>
lea    0x1013(%rip),%rdi
call   1040 <puts@plt>
lea    0xe2c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe2e(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
cmp    $0x1,%eax
jne    1438 <choose_piece_sequence+0x2a8>
mov    0xc(%rsp),%eax
cmp    $0x4,%eax
je     1241 <choose_piece_sequence+0xb1>
cmp    $0x3,%eax
je     131e <choose_piece_sequence+0x18e>
cmp    $0x2,%eax
jne    13b6 <choose_piece_sequence+0x226>
mov    $0xc,%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     145d <choose_piece_sequence+0x2cd>
mov    %rax,%r14
movabs $0x400000003,%rax
mov    %rax,(%r14)
mov    %r14,%rax
add    $0x8,%rax
jmp    13ca <choose_piece_sequence+0x23a>
mov    $0x100,%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     1482 <choose_piece_sequence+0x2f2>
mov    %rax,%r14
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed2(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
cmp    $0x1,%eax
jne    14a7 <choose_piece_sequence+0x317>
lea    0xebb(%rip),%rsi
mov    %r14,%rdi
call   10b0 <open_data_file@plt>
mov    %rax,%r12
mov    %r14,%rdi
call   1030 <free@plt>
test   %r12,%r12
je     14cf <choose_piece_sequence+0x33f>
lea    0xd67(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %r12,%rdi
call   1060 <fscanf@plt>
cmp    $0x1,%eax
jne    14f3 <choose_piece_sequence+0x363>
mov    0x8(%rsp),%edi
add    $0x4,%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     151b <choose_piece_sequence+0x38b>
mov    %rax,%r14
cmpl   $0x0,0x8(%rsp)
jle    13c3 <choose_piece_sequence+0x233>
xor    %r13d,%r13d
lea    0xd24(%rip),%r15
mov    %r14,%rbx
nop
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1060 <fscanf@plt>
cmp    $0x1,%eax
jne    13e1 <choose_piece_sequence+0x251>
add    $0x1,%r13
movslq 0x8(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%r13
jl     12f0 <choose_piece_sequence+0x160>
jmp    13c6 <choose_piece_sequence+0x236>
lea    0xdc0(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xcdd(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
cmp    $0x1,%eax
jne    1543 <choose_piece_sequence+0x3b3>
mov    0x8(%rsp),%edi
add    $0x4,%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     156b <choose_piece_sequence+0x3db>
mov    %rax,%r14
cmpl   $0x0,0x8(%rsp)
jle    13bb <choose_piece_sequence+0x22b>
lea    0xd9a(%rip),%r15
lea    0xc9b(%rip),%r12
mov    %r14,%r13
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
cmp    $0x1,%eax
jne    1406 <choose_piece_sequence+0x276>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
add    $0x4,%r13
cmp    %rax,%rbx
jl     1380 <choose_piece_sequence+0x1f0>
lea    (%r14,%rbx,4),%rax
jmp    13ca <choose_piece_sequence+0x23a>
xor    %r14d,%r14d
jmp    13d0 <choose_piece_sequence+0x240>
xor    %ebx,%ebx
lea    (%r14,%rbx,4),%rax
jmp    13ca <choose_piece_sequence+0x23a>
xor    %r13d,%r13d
lea    (%r14,%r13,4),%rax
movl   $0xffffffff,(%rax)
mov    %r14,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
mov    0x2bf8(%rip),%rax
mov    (%rax),%edi
lea    0xc22(%rip),%rsi
lea    0xc39(%rip),%rdx
lea    0xd81(%rip),%r8
mov    $0xa1,%ecx
jmp    1429 <choose_piece_sequence+0x299>
mov    0x2bd3(%rip),%rax
mov    (%rax),%edi
lea    0xbfd(%rip),%rsi
lea    0xc14(%rip),%rdx
lea    0xd5d(%rip),%r8
mov    $0x8f,%ecx
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    0x2ba1(%rip),%rax
mov    (%rax),%edi
lea    0xbcb(%rip),%rsi
lea    0xbe2(%rip),%rdx
lea    0xd2b(%rip),%r8
mov    $0x7b,%ecx
jmp    1429 <choose_piece_sequence+0x299>
mov    0x2b7c(%rip),%rax
mov    (%rax),%edi
lea    0xba6(%rip),%rsi
lea    0xbbd(%rip),%rdx
lea    0xc5d(%rip),%r8
mov    $0x83,%ecx
jmp    1429 <choose_piece_sequence+0x299>
mov    0x2b57(%rip),%rax
mov    (%rax),%edi
lea    0xb81(%rip),%rsi
lea    0xb98(%rip),%rdx
lea    0xc38(%rip),%r8
mov    $0x95,%ecx
jmp    1429 <choose_piece_sequence+0x299>
mov    0x2b32(%rip),%rax
mov    (%rax),%edi
lea    0xb5c(%rip),%rsi
lea    0xb73(%rip),%rdx
lea    0xcbc(%rip),%r8
mov    $0x97,%ecx
jmp    1429 <choose_piece_sequence+0x299>
mov    0x2b0a(%rip),%rax
mov    (%rax),%edi
lea    0xc64(%rip),%rsi
lea    0xb4b(%rip),%rdx
mov    $0x9c,%ecx
xor    %r8d,%r8d
jmp    1429 <choose_piece_sequence+0x299>
mov    0x2ae6(%rip),%rax
mov    (%rax),%edi
lea    0xb10(%rip),%rsi
lea    0xb27(%rip),%rdx
lea    0xc6f(%rip),%r8
mov    $0x9e,%ecx
jmp    1429 <choose_piece_sequence+0x299>
mov    0x2abe(%rip),%rax
mov    (%rax),%edi
lea    0xae8(%rip),%rsi
lea    0xaff(%rip),%rdx
lea    0xb9f(%rip),%r8
mov    $0x9f,%ecx
jmp    1429 <choose_piece_sequence+0x299>
mov    0x2a96(%rip),%rax
mov    (%rax),%edi
lea    0xac0(%rip),%rsi
lea    0xad7(%rip),%rdx
lea    0xc20(%rip),%r8
mov    $0x8b,%ecx
jmp    1429 <choose_piece_sequence+0x299>
mov    0x2a6e(%rip),%rax
mov    (%rax),%edi
lea    0xa98(%rip),%rsi
lea    0xaaf(%rip),%rdx
lea    0xb4f(%rip),%r8
mov    $0x8c,%ecx
jmp    1429 <choose_piece_sequence+0x299>

LLVM IR (-O0):
@.str = [20 x i8] c" 1. Random pieces\0A\00"
@.str.1 = [32 x i8] c" 2. S/Z tetraminos alternance\0A\00"
@.str.2 = [28 x i8] c" 3. Set a custom sequence\0A\00"
@.str.3 = [34 x i8] c" 4. Load a sequence from a file\0A\00"
@.str.4 = [16 x i8] c" Your choice: \00"
@.str.5 = [3 x i8] c"%d\00"
@stderr = global i32 0
@.str.6 = [30 x i8] c"ERROR [file %s] [line %d] %s\0A\00"
@.str.7 = [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.8 = [13 x i8] c"scanf failed\00"
@.str.9 = [13 x i8] c"MEMORY FULL\0A\00"
@.str.10 = [35 x i8] c" Number of pieces in a sequence: \00"
@.str.11 = [13 x i8] c" Piece %d: \00"
@.str.12 = [41 x i8] c" Name of file containing the sequence: \00"
@.str.13 = [3 x i8] c"%s\00"
@.str.14 = [2 x i8] c"r\00"
@.str.15 = [23 x i8] c"INVALID MEMORY FREE()\0A\00"
@.str.16 = [61 x i8] c"ERROR [file %s] [line %d] Cannot read the feature file '%s'\0A\00"
@.str.17 = [14 x i8] c"fscanf failed\00"
define i32* @choose_piece_sequence() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32*
store i32* null, i32** %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %1)
%13 = icmp ne i32 %12, 1
br i1 %13, label %14, label %20
14: ; preds = %0
br label %15
15: ; preds = %14
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 123, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%18 = call i32 @exit(i32 1)
unreachable
19: ; No predecessors!
br label %20
20: ; preds = %19, %0
%21 = load i32, i32* %1
switch i32 %21, label %190 [
i32 1, label %22
i32 2, label %23
i32 3, label %40
i32 4, label %93
]
22: ; preds = %20
store i32* null, i32** %4
br label %190
23: ; preds = %20
%24 = call i64 @malloc(i32 12)
%25 = inttoptr i64 %24 to i32*
store i32* %25, i32** %4
%26 = icmp eq i32* %25, null
br i1 %26, label %27, label %33
27: ; preds = %23
br label %28
28: ; preds = %27
%29 = load i32, i32* @stderr
%30 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 131, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
%31 = call i32 @exit(i32 1)
unreachable
32: ; No predecessors!
br label %33
33: ; preds = %32, %23
%34 = load i32*, i32** %4
%35 = getelementptr inbounds i32, i32* %34, i64 0
store i32 3, i32* %35
%36 = load i32*, i32** %4
%37 = getelementptr inbounds i32, i32* %36, i64 1
store i32 4, i32* %37
%38 = load i32*, i32** %4
%39 = getelementptr inbounds i32, i32* %38, i64 2
store i32 -1, i32* %39
br label %190
40: ; preds = %20
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0))
%42 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%43 = icmp ne i32 %42, 1
br i1 %43, label %44, label %50
44: ; preds = %40
br label %45
45: ; preds = %44
%46 = load i32, i32* @stderr
%47 = call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 139, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%48 = call i32 @exit(i32 1)
unreachable
49: ; No predecessors!
br label %50
50: ; preds = %49, %40
%51 = load i32, i32* %3
%52 = sext i32 %51 to i64
%53 = add i64 %52, 4
%54 = trunc i64 %53 to i32
%55 = call i64 @malloc(i32 %54)
%56 = inttoptr i64 %55 to i32*
store i32* %56, i32** %4
%57 = icmp eq i32* %56, null
br i1 %57, label %58, label %64
58: ; preds = %50
br label %59
59: ; preds = %58
%60 = load i32, i32* @stderr
%61 = call i32 @fprintf(i32 %60, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 140, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
%62 = call i32 @exit(i32 1)
unreachable
63: ; No predecessors!
br label %64
64: ; preds = %63, %50
store i32 0, i32* %2
br label %65
65: ; preds = %85, %64
%66 = load i32, i32* %2
%67 = load i32, i32* %3
%68 = icmp slt i32 %66, %67
br i1 %68, label %69, label %88
69: ; preds = %65
%70 = load i32, i32* %2
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 %70)
%72 = load i32*, i32** %4
%73 = load i32, i32* %2
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i32, i32* %72, i64 %74
%76 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %75)
%77 = icmp ne i32 %76, 1
br i1 %77, label %78, label %84
78: ; preds = %69
br label %79
79: ; preds = %78
%80 = load i32, i32* @stderr
%81 = call i32 @fprintf(i32 %80, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 143, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%82 = call i32 @exit(i32 1)
unreachable
83: ; No predecessors!
br label %84
84: ; preds = %83, %69
br label %85
85: ; preds = %84
%86 = load i32, i32* %2
%87 = add nsw i32 %86, 1
store i32 %87, i32* %2
br label %65
88: ; preds = %65
%89 = load i32*, i32** %4
%90 = load i32, i32* %2
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i32, i32* %89, i64 %91
store i32 -1, i32* %92
br label %190
93: ; preds = %20
%94 = call i64 @malloc(i32 256)
%95 = inttoptr i64 %94 to i8*
store i8* %95, i8** %5
%96 = icmp eq i8* %95, null
br i1 %96, label %97, label %103
97: ; preds = %93
br label %98
98: ; preds = %97
%99 = load i32, i32* @stderr
%100 = call i32 @fprintf(i32 %99, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 149, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
%101 = call i32 @exit(i32 1)
unreachable
102: ; No predecessors!
br label %103
103: ; preds = %102, %93
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.12, i64 0, i64 0))
%105 = load i8*, i8** %5
%106 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %105)
%107 = icmp ne i32 %106, 1
br i1 %107, label %108, label %114
108: ; preds = %103
br label %109
109: ; preds = %108
%110 = load i32, i32* @stderr
%111 = call i32 @fprintf(i32 %110, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 151, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%112 = call i32 @exit(i32 1)
unreachable
113: ; No predecessors!
br label %114
114: ; preds = %113, %103
%115 = load i8*, i8** %5
%116 = call i32* @open_data_file(i8* %115, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
store i32* %116, i32** %6
%117 = load i8*, i8** %5
%118 = icmp ne i8* %117, null
br i1 %118, label %119, label %122
119: ; preds = %114
%120 = load i8*, i8** %5
%121 = call i32 @free(i8* %120)
store i8* null, i8** %5
br label %128
122: ; preds = %114
br label %123
123: ; preds = %122
%124 = load i32, i32* @stderr
%125 = call i32 @fprintf(i32 %124, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 154, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.15, i64 0, i64 0))
%126 = call i32 @exit(i32 1)
unreachable
127: ; No predecessors!
br label %128
128: ; preds = %127, %119
%129 = load i32*, i32** %6
%130 = icmp eq i32* %129, null
br i1 %130, label %131, label %138
131: ; preds = %128
br label %132
132: ; preds = %131
%133 = load i32, i32* @stderr
%134 = load i8*, i8** %5
%135 = call i32 @fprintf(i32 %133, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 156, i8* %134)
%136 = call i32 @exit(i32 1)
unreachable
137: ; No predecessors!
br label %138
138: ; preds = %137, %128
%139 = load i32*, i32** %6
%140 = call i32 @fscanf(i32* %139, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%141 = icmp ne i32 %140, 1
br i1 %141, label %142, label %148
142: ; preds = %138
br label %143
143: ; preds = %142
%144 = load i32, i32* @stderr
%145 = call i32 @fprintf(i32 %144, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 158, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0))
%146 = call i32 @exit(i32 1)
unreachable
147: ; No predecessors!
br label %148
148: ; preds = %147, %138
%149 = load i32, i32* %3
%150 = sext i32 %149 to i64
%151 = add i64 %150, 4
%152 = trunc i64 %151 to i32
%153 = call i64 @malloc(i32 %152)
%154 = inttoptr i64 %153 to i32*
store i32* %154, i32** %4
%155 = icmp eq i32* %154, null
br i1 %155, label %156, label %162
156: ; preds = %148
br label %157
157: ; preds = %156
%158 = load i32, i32* @stderr
%159 = call i32 @fprintf(i32 %158, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 159, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
%160 = call i32 @exit(i32 1)
unreachable
161: ; No predecessors!
br label %162
162: ; preds = %161, %148
store i32 0, i32* %2
br label %163
163: ; preds = %182, %162
%164 = load i32, i32* %2
%165 = load i32, i32* %3
%166 = icmp slt i32 %164, %165
br i1 %166, label %167, label %185
167: ; preds = %163
%168 = load i32*, i32** %6
%169 = load i32*, i32** %4
%170 = load i32, i32* %2
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds i32, i32* %169, i64 %171
%173 = call i32 @fscanf(i32* %168, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %172)
%174 = icmp ne i32 %173, 1
br i1 %174, label %175, label %181
175: ; preds = %167
br label %176
176: ; preds = %175
%177 = load i32, i32* @stderr
%178 = call i32 @fprintf(i32 %177, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 161, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0))
%179 = call i32 @exit(i32 1)
unreachable
180: ; No predecessors!
br label %181
181: ; preds = %180, %167
br label %182
182: ; preds = %181
%183 = load i32, i32* %2
%184 = add nsw i32 %183, 1
store i32 %184, i32* %2
br label %163
185: ; preds = %163
%186 = load i32*, i32** %4
%187 = load i32, i32* %2
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds i32, i32* %186, i64 %188
store i32 -1, i32* %189
br label %190
190: ; preds = %20, %185, %88, %33, %22
%191 = load i32*, i32** %4
ret i32* %191
}

LLVM IR (-O2):
@.str.4 = [16 x i8] c" Your choice: \00"
@.str.5 = [3 x i8] c"%d\00"
@stderr = global i32 0
@.str.6 = [30 x i8] c"ERROR [file %s] [line %d] %s\0A\00"
@.str.7 = [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.8 = [13 x i8] c"scanf failed\00"
@.str.9 = [13 x i8] c"MEMORY FULL\0A\00"
@.str.10 = [35 x i8] c" Number of pieces in a sequence: \00"
@.str.11 = [13 x i8] c" Piece %d: \00"
@.str.12 = [41 x i8] c" Name of file containing the sequence: \00"
@.str.13 = [3 x i8] c"%s\00"
@.str.14 = [2 x i8] c"r\00"
@.str.16 = [61 x i8] c"ERROR [file %s] [line %d] Cannot read the feature file '%s'\0A\00"
@.str.17 = [14 x i8] c"fscanf failed\00"
@str = [19 x i8] c" 1. Random pieces\00"
@str.18 = [31 x i8] c" 2. S/Z tetraminos alternance\00"
@str.19 = [27 x i8] c" 3. Set a custom sequence\00"
@str.20 = [33 x i8] c" 4. Load a sequence from a file\00"
define i32* @choose_piece_sequence() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.18, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.19, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.20, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %1)
%11 = icmp eq i32 %10, 1
br i1 %11, label %16, label %12
12: ; preds = %0
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 123, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %0
%17 = load i32, i32* %1
switch i32 %17, label %137 [
i32 4, label %71
i32 2, label %18
i32 3, label %29
]
18: ; preds = %16
%19 = call i64 @malloc(i32 12)
%20 = inttoptr i64 %19 to i32*
%21 = icmp eq i64 %19, 0
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i32, i32* @stderr
%24 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 131, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
%25 = call i32 @exit(i32 1)
unreachable
26: ; preds = %18
store i32 3, i32* %20
%27 = getelementptr inbounds i32, i32* %20, i64 1
store i32 4, i32* %27
%28 = getelementptr inbounds i32, i32* %20, i64 2
br label %134
29: ; preds = %16
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0))
%31 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
%32 = icmp eq i32 %31, 1
br i1 %32, label %37, label %33
33: ; preds = %29
%34 = load i32, i32* @stderr
%35 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 139, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%36 = call i32 @exit(i32 1)
unreachable
37: ; preds = %29
%38 = load i32, i32* %2
%39 = add i32 %38, 4
%40 = call i64 @malloc(i32 %39)
%41 = inttoptr i64 %40 to i32*
%42 = icmp eq i64 %40, 0
br i1 %42, label %46, label %43
43: ; preds = %37
%44 = load i32, i32* %2
%45 = icmp sgt i32 %44, 0
br i1 %45, label %50, label %68
46: ; preds = %37
%47 = load i32, i32* @stderr
%48 = call i32 @fprintf(i32 %47, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 140, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
%49 = call i32 @exit(i32 1)
unreachable
50: ; preds = %43, %61
%51 = phi i64 [ %62, %61 ], [ 0, %43 ]
%52 = trunc i64 %51 to i32
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 %52)
%54 = getelementptr inbounds i32, i32* %41, i64 %51
%55 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %54)
%56 = icmp eq i32 %55, 1
br i1 %56, label %61, label %57
57: ; preds = %50
%58 = load i32, i32* @stderr
%59 = call i32 @fprintf(i32 %58, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 143, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%60 = call i32 @exit(i32 1)
unreachable
61: ; preds = %50
%62 = add nuw nsw i64 %51, 1
%63 = load i32, i32* %2
%64 = sext i32 %63 to i64
%65 = icmp slt i64 %62, %64
br i1 %65, label %50, label %66
66: ; preds = %61
%67 = and i64 %62, 4294967295
br label %68
68: ; preds = %66, %43
%69 = phi i64 [ 0, %43 ], [ %67, %66 ]
%70 = getelementptr inbounds i32, i32* %41, i64 %69
br label %134
71: ; preds = %16
%72 = call i64 @malloc(i32 256)
%73 = inttoptr i64 %72 to i8*
%74 = icmp eq i64 %72, 0
br i1 %74, label %75, label %79
75: ; preds = %71
%76 = load i32, i32* @stderr
%77 = call i32 @fprintf(i32 %76, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 149, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
%78 = call i32 @exit(i32 1)
unreachable
79: ; preds = %71
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.12, i64 0, i64 0))
%81 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %73)
%82 = icmp eq i32 %81, 1
br i1 %82, label %87, label %83
83: ; preds = %79
%84 = load i32, i32* @stderr
%85 = call i32 @fprintf(i32 %84, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 151, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%86 = call i32 @exit(i32 1)
unreachable
87: ; preds = %79
%88 = call i32* @open_data_file(i8* %73, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%89 = call i32 @free(i8* %73)
%90 = icmp eq i32* %88, null
br i1 %90, label %91, label %95
91: ; preds = %87
%92 = load i32, i32* @stderr
%93 = call i32 @fprintf(i32 %92, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 156, i8* null)
%94 = call i32 @exit(i32 1)
unreachable
95: ; preds = %87
%96 = call i32 @fscanf(i32* %88, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
%97 = icmp eq i32 %96, 1
br i1 %97, label %102, label %98
98: ; preds = %95
%99 = load i32, i32* @stderr
%100 = call i32 @fprintf(i32 %99, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 158, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0))
%101 = call i32 @exit(i32 1)
unreachable
102: ; preds = %95
%103 = load i32, i32* %2
%104 = add i32 %103, 4
%105 = call i64 @malloc(i32 %104)
%106 = inttoptr i64 %105 to i32*
%107 = icmp eq i64 %105, 0
br i1 %107, label %111, label %108
108: ; preds = %102
%109 = load i32, i32* %2
%110 = icmp sgt i32 %109, 0
br i1 %110, label %115, label %131
111: ; preds = %102
%112 = load i32, i32* @stderr
%113 = call i32 @fprintf(i32 %112, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 159, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
%114 = call i32 @exit(i32 1)
unreachable
115: ; preds = %108, %124
%116 = phi i64 [ %125, %124 ], [ 0, %108 ]
%117 = getelementptr inbounds i32, i32* %106, i64 %116
%118 = call i32 @fscanf(i32* %88, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %117)
%119 = icmp eq i32 %118, 1
br i1 %119, label %124, label %120
120: ; preds = %115
%121 = load i32, i32* @stderr
%122 = call i32 @fprintf(i32 %121, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i32 161, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0))
%123 = call i32 @exit(i32 1)
unreachable
124: ; preds = %115
%125 = add nuw nsw i64 %116, 1
%126 = load i32, i32* %2
%127 = sext i32 %126 to i64
%128 = icmp slt i64 %125, %127
br i1 %128, label %115, label %129
129: ; preds = %124
%130 = and i64 %125, 4294967295
br label %131
131: ; preds = %129, %108
%132 = phi i64 [ 0, %108 ], [ %130, %129 ]
%133 = getelementptr inbounds i32, i32* %106, i64 %132
br label %134
134: ; preds = %26, %68, %131
%135 = phi i32* [ %133, %131 ], [ %70, %68 ], [ %28, %26 ]
%136 = phi i32* [ %106, %131 ], [ %41, %68 ], [ %20, %26 ]
store i32 -1, i32* %135
br label %137
137: ; preds = %134, %16
%138 = phi i32* [ null, %16 ], [ %136, %134 ]
ret i32* %138
}