#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int nth_position(unsigned int, int);
int /*<<< orphan*/ printf(char *, unsigned int, ...);
int /*<<< orphan*/ remove_new_line(char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int /*<<< orphan*/ set_bit(unsigned int *, int, int);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  unsigned int n;
  scanf("%u%*c", &n);
  unsigned int field[n];
  int i;
  for (i = 0; i < n; i++) {
    scanf("%u%*c", &field[i]);
  }
  int row = 0, col = 0, newRow, newCol;
  char comand[8];
  fgets(comand, 8, stdin);
  remove_new_line(comand);
  while (strcmp(comand, "end") != 0) {
    newCol = col, newRow = row;
    if (strcmp(comand, "right") == 0) {
      newCol--;
      if (newCol < 0) {
        newCol = 31;
      }
    } else if (strcmp(comand, "left") == 0) {
      newCol++;
      if (newCol >= 31) {
        newCol = 0;
      }
    } else if (strcmp(comand, "up") == 0) {
      newRow--;
      if (newRow < 0) {
        newRow = n - 1;
      }
    } else {
      newRow++;
      if (newRow >= n) {
        newRow = 0;
      }
    }
    int bitValue = nth_position(field[newRow], newCol);
    if (bitValue == 1) {
      printf("GAME OVER. Stepped a mine at %d %d\n", newRow, newCol);
      break;
    }
    set_bit(&field[row], col, 0);
    set_bit(&field[newRow], newCol, 1);
    row = newRow;
    col = newCol;
    fgets(comand, 8, stdin);
    remove_new_line(comand);
  }
  for (i = 0; i < n; i++) {
    printf("%u\n", field[i]);
  }
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe73(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    11f9 <main+0x89>
mov    -0x50(%rbp),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe1a(%rip),%rdi
call   1070 <scanf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11c4 <main+0x54>
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
lea    -0x44(%rbp),%rdi
mov    0x2dd6(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%esi
call   1040 <fgets@plt>
lea    -0x44(%rbp),%rdi
call   1090 <remove_new_line@plt>
lea    -0x44(%rbp),%rdi
lea    0xdd4(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     13c4 <main+0x254>
mov    -0x34(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x38(%rbp)
lea    -0x44(%rbp),%rdi
lea    0xdb2(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1286 <main+0x116>
mov    -0x3c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jge    1281 <main+0x111>
movl   $0x1f,-0x3c(%rbp)
jmp    1325 <main+0x1b5>
lea    -0x44(%rbp),%rdi
lea    0xd7f(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    12bf <main+0x14f>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
cmpl   $0x1f,-0x3c(%rbp)
jl     12ba <main+0x14a>
movl   $0x0,-0x3c(%rbp)
jmp    1320 <main+0x1b0>
lea    -0x44(%rbp),%rdi
lea    0xd4b(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    12fa <main+0x18a>
mov    -0x38(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jge    12f5 <main+0x185>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    131b <main+0x1ab>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x14(%rbp),%eax
jb     1316 <main+0x1a6>
movl   $0x0,-0x38(%rbp)
jmp    131b <main+0x1ab>
jmp    1320 <main+0x1b0>
jmp    1325 <main+0x1b5>
mov    -0x50(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x3c(%rbp),%esi
call   1080 <nth_position@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0x1,-0x48(%rbp)
jne    135e <main+0x1ee>
mov    -0x38(%rbp),%esi
mov    -0x3c(%rbp),%edx
lea    0xcc6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13c4 <main+0x254>
mov    -0x50(%rbp),%rdi
movslq -0x30(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x34(%rbp),%esi
xor    %edx,%edx
call   1050 <set_bit@plt>
mov    -0x50(%rbp),%rdi
movslq -0x38(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x3c(%rbp),%esi
mov    $0x1,%edx
call   1050 <set_bit@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x34(%rbp)
lea    -0x44(%rbp),%rdi
mov    0x2c3e(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%esi
call   1040 <fgets@plt>
lea    -0x44(%rbp),%rdi
call   1090 <remove_new_line@plt>
jmp    1227 <main+0xb7>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    13fe <main+0x28e>
mov    -0x50(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xc53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    13cb <main+0x25b>
mov    0x2bd3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xe78(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1070 <scanf@plt>
mov    %rsp,-0x48(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rsp,%rcx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
cmpl   $0x0,-0x2c(%rbp)
je     11eb <main+0x7b>
xor    %r15d,%r15d
lea    0xe3f(%rip),%r14
mov    -0x38(%rbp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
add    $0x1,%r15
mov    -0x2c(%rbp),%eax
add    $0x4,%rbx
cmp    %rax,%r15
jb     11d0 <main+0x60>
mov    0x2df6(%rip),%rax
mov    (%rax),%edx
lea    -0x40(%rbp),%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1090 <remove_new_line@plt>
lea    0xdf2(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
mov    -0x38(%rbp),%r15
je     1379 <main+0x209>
lea    -0x40(%rbp),%rbx
xor    %r13d,%r13d
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
lea    0xdc0(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
mov    %r12,-0x50(%rbp)
je     12a0 <main+0x130>
mov    %rbx,%rdi
lea    0xdae(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     12c0 <main+0x150>
mov    %rbx,%rdi
lea    0xd9f(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     12d6 <main+0x166>
lea    0x1(%r12),%ecx
cmp    -0x2c(%rbp),%ecx
mov    $0x0,%eax
cmovae %eax,%ecx
jmp    12f0 <main+0x180>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%r13),%r14d
test   %r13d,%r13d
mov    $0x1f,%eax
cmovle %eax,%r14d
mov    %r12d,%ecx
jmp    12f3 <main+0x183>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%r13),%r14d
cmp    $0x1e,%r13d
mov    $0x0,%eax
cmovge %eax,%r14d
mov    %r12d,%ecx
jmp    12f3 <main+0x183>
test   %r12d,%r12d
jle    12e2 <main+0x172>
lea    -0x1(%r12),%ecx
jmp    12f0 <main+0x180>
mov    -0x2c(%rbp),%ecx
add    $0xffffffff,%ecx
nopl   0x0(%rax,%rax,1)
mov    %r13d,%r14d
mov    %ecx,%r12d
movslq %ecx,%rbx
mov    (%r15,%rbx,4),%edi
mov    %r14d,%esi
call   1080 <nth_position@plt>
cmp    $0x1,%eax
je     1381 <main+0x211>
mov    -0x38(%rbp),%rax
lea    (%rax,%rbx,4),%r15
movslq -0x50(%rbp),%rax
mov    -0x38(%rbp),%rcx
lea    (%rcx,%rax,4),%rdi
mov    %r13d,%esi
xor    %edx,%edx
call   1050 <set_bit@plt>
mov    %r15,%rdi
mov    -0x38(%rbp),%r15
mov    %r14d,%esi
mov    $0x1,%edx
call   1050 <set_bit@plt>
mov    0x2ca5(%rip),%rax
mov    (%rax),%edx
lea    -0x40(%rbp),%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1090 <remove_new_line@plt>
mov    %rbx,%rdi
lea    0xc9e(%rip),%rsi
call   1060 <strcmp@plt>
mov    %r14d,%r13d
test   %rax,%rax
jne    1240 <main+0xd0>
cmpl   $0x0,-0x2c(%rbp)
jne    139b <main+0x22b>
jmp    13ca <main+0x25a>
lea    0xc90(%rip),%rdi
mov    %r12d,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x0,-0x2c(%rbp)
je     13ca <main+0x25a>
lea    0xc9a(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
mov    -0x2c(%rbp),%eax
cmp    %rax,%rbx
jb     13b0 <main+0x240>
mov    0x2c07(%rip),%rax
mov    (%rax),%eax
mov    -0x48(%rbp),%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%u%*c\00"
@stdin = global i32 0
@.str.1 = [4 x i8] c"end\00"
@.str.2 = [6 x i8] c"right\00"
@.str.3 = [5 x i8] c"left\00"
@.str.4 = [3 x i8] c"up\00"
@.str.5 = [36 x i8] c"GAME OVER. Stepped a mine at %d %d\0A\00"
@.str.6 = [4 x i8] c"%u\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [8 x i8]
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %6)
%17 = load i32, i32* %6
%18 = zext i32 %17 to i64
%19 = call i8* @llvm.stacksave()
store i8* %19, i8** %7
%20 = alloca i32, i64 %18
store i64 %18, i64* %8
store i32 0, i32* %9
br label %21
21: ; preds = %30, %2
%22 = load i32, i32* %9
%23 = load i32, i32* %6
%24 = icmp ult i32 %22, %23
br i1 %24, label %25, label %33
25: ; preds = %21
%26 = load i32, i32* %9
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %20, i64 %27
%29 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %28)
br label %30
30: ; preds = %25
%31 = load i32, i32* %9
%32 = add nsw i32 %31, 1
store i32 %32, i32* %9
br label %21
33: ; preds = %21
store i32 0, i32* %10
store i32 0, i32* %11
%34 = getelementptr inbounds [8 x i8], [8 x i8]* %14, i64 0, i64 0
%35 = load i32, i32* @stdin
%36 = call i32 @fgets(i8* %34, i32 8, i32 %35)
%37 = getelementptr inbounds [8 x i8], [8 x i8]* %14, i64 0, i64 0
%38 = call i32 @remove_new_line(i8* %37)
br label %39
39: ; preds = %103, %33
%40 = getelementptr inbounds [8 x i8], [8 x i8]* %14, i64 0, i64 0
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %121
43: ; preds = %39
%44 = load i32, i32* %11
store i32 %44, i32* %13
%45 = load i32, i32* %10
store i32 %45, i32* %12
%46 = getelementptr inbounds [8 x i8], [8 x i8]* %14, i64 0, i64 0
%47 = call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %56
49: ; preds = %43
%50 = load i32, i32* %13
%51 = add nsw i32 %50, -1
store i32 %51, i32* %13
%52 = load i32, i32* %13
%53 = icmp slt i32 %52, 0
br i1 %53, label %54, label %55
54: ; preds = %49
store i32 31, i32* %13
br label %55
55: ; preds = %54, %49
br label %90
56: ; preds = %43
%57 = getelementptr inbounds [8 x i8], [8 x i8]* %14, i64 0, i64 0
%58 = call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %67
60: ; preds = %56
%61 = load i32, i32* %13
%62 = add nsw i32 %61, 1
store i32 %62, i32* %13
%63 = load i32, i32* %13
%64 = icmp sge i32 %63, 31
br i1 %64, label %65, label %66
65: ; preds = %60
store i32 0, i32* %13
br label %66
66: ; preds = %65, %60
br label %89
67: ; preds = %56
%68 = getelementptr inbounds [8 x i8], [8 x i8]* %14, i64 0, i64 0
%69 = call i64 @strcmp(i8* %68, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %80
71: ; preds = %67
%72 = load i32, i32* %12
%73 = add nsw i32 %72, -1
store i32 %73, i32* %12
%74 = load i32, i32* %12
%75 = icmp slt i32 %74, 0
br i1 %75, label %76, label %79
76: ; preds = %71
%77 = load i32, i32* %6
%78 = sub i32 %77, 1
store i32 %78, i32* %12
br label %79
79: ; preds = %76, %71
br label %88
80: ; preds = %67
%81 = load i32, i32* %12
%82 = add nsw i32 %81, 1
store i32 %82, i32* %12
%83 = load i32, i32* %12
%84 = load i32, i32* %6
%85 = icmp uge i32 %83, %84
br i1 %85, label %86, label %87
86: ; preds = %80
store i32 0, i32* %12
br label %87
87: ; preds = %86, %80
br label %88
88: ; preds = %87, %79
br label %89
89: ; preds = %88, %66
br label %90
90: ; preds = %89, %55
%91 = load i32, i32* %12
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i32, i32* %20, i64 %92
%94 = load i32, i32* %93
%95 = load i32, i32* %13
%96 = call i32 @nth_position(i32 %94, i32 %95)
store i32 %96, i32* %15
%97 = load i32, i32* %15
%98 = icmp eq i32 %97, 1
br i1 %98, label %99, label %103
99: ; preds = %90
%100 = load i32, i32* %12
%101 = load i32, i32* %13
%102 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i32 %100, i32 %101)
br label %121
103: ; preds = %90
%104 = load i32, i32* %10
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i32, i32* %20, i64 %105
%107 = load i32, i32* %11
%108 = call i32 @set_bit(i32* %106, i32 %107, i32 0)
%109 = load i32, i32* %12
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds i32, i32* %20, i64 %110
%112 = load i32, i32* %13
%113 = call i32 @set_bit(i32* %111, i32 %112, i32 1)
%114 = load i32, i32* %12
store i32 %114, i32* %10
%115 = load i32, i32* %13
store i32 %115, i32* %11
%116 = getelementptr inbounds [8 x i8], [8 x i8]* %14, i64 0, i64 0
%117 = load i32, i32* @stdin
%118 = call i32 @fgets(i8* %116, i32 8, i32 %117)
%119 = getelementptr inbounds [8 x i8], [8 x i8]* %14, i64 0, i64 0
%120 = call i32 @remove_new_line(i8* %119)
br label %39
121: ; preds = %99, %39
store i32 0, i32* %9
br label %122
122: ; preds = %132, %121
%123 = load i32, i32* %9
%124 = load i32, i32* %6
%125 = icmp ult i32 %123, %124
br i1 %125, label %126, label %135
126: ; preds = %122
%127 = load i32, i32* %9
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds i32, i32* %20, i64 %128
%130 = load i32, i32* %129
%131 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %130)
br label %132
132: ; preds = %126
%133 = load i32, i32* %9
%134 = add nsw i32 %133, 1
store i32 %134, i32* %9
br label %122
135: ; preds = %122
%136 = load i32, i32* @EXIT_SUCCESS
store i32 %136, i32* %3
%137 = load i8*, i8** %7
%138 = load i32, i32* %3
ret i32 %138
}

LLVM IR (-O2):
@.str = [6 x i8] c"%u%*c\00"
@stdin = global i32 0
@.str.1 = [4 x i8] c"end\00"
@.str.2 = [6 x i8] c"right\00"
@.str.3 = [5 x i8] c"left\00"
@.str.4 = [3 x i8] c"up\00"
@.str.5 = [36 x i8] c"GAME OVER. Stepped a mine at %d %d\0A\00"
@.str.6 = [4 x i8] c"%u\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [8 x i8]
%5 = bitcast i32* %3 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
%10 = alloca i32, i64 %8
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 0
br i1 %12, label %21, label %13
13: ; preds = %2, %13
%14 = phi i64 [ %17, %13 ], [ 0, %2 ]
%15 = getelementptr inbounds i32, i32* %10, i64 %14
%16 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %15)
%17 = add nuw nsw i64 %14, 1
%18 = load i32, i32* %3
%19 = zext i32 %18 to i64
%20 = icmp ult i64 %17, %19
br i1 %20, label %13, label %21
21: ; preds = %13, %2
%22 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%23 = load i32, i32* @stdin
%24 = call i32 @fgets(i8* %22, i32 8, i32 %23)
%25 = call i32 @remove_new_line(i8* %22)
%26 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %78, label %28
28: ; preds = %21, %68
%29 = phi i32 [ %60, %68 ], [ 0, %21 ]
%30 = phi i32 [ %59, %68 ], [ 0, %21 ]
%31 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %37
33: ; preds = %28
%34 = add nsw i32 %29, -1
%35 = icmp slt i32 %29, 1
%36 = select i1 %35, i32 31, i32 %34
br label %58
37: ; preds = %28
%38 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %44
40: ; preds = %37
%41 = add nsw i32 %29, 1
%42 = icmp sgt i32 %29, 29
%43 = select i1 %42, i32 0, i32 %41
br label %58
44: ; preds = %37
%45 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %53
47: ; preds = %44
%48 = add nsw i32 %30, -1
%49 = icmp slt i32 %30, 1
br i1 %49, label %50, label %58
50: ; preds = %47
%51 = load i32, i32* %3
%52 = add i32 %51, -1
br label %58
53: ; preds = %44
%54 = add nsw i32 %30, 1
%55 = load i32, i32* %3
%56 = icmp ult i32 %54, %55
%57 = select i1 %56, i32 %54, i32 0
br label %58
58: ; preds = %40, %47, %50, %53, %33
%59 = phi i32 [ %30, %33 ], [ %30, %40 ], [ %52, %50 ], [ %48, %47 ], [ %57, %53 ]
%60 = phi i32 [ %36, %33 ], [ %43, %40 ], [ %29, %50 ], [ %29, %47 ], [ %29, %53 ]
%61 = sext i32 %59 to i64
%62 = getelementptr inbounds i32, i32* %10, i64 %61
%63 = load i32, i32* %62
%64 = call i32 @nth_position(i32 %63, i32 %60)
%65 = icmp eq i32 %64, 1
br i1 %65, label %66, label %68
66: ; preds = %58
%67 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i32 %59, i32 %60)
br label %78
68: ; preds = %58
%69 = sext i32 %30 to i64
%70 = getelementptr inbounds i32, i32* %10, i64 %69
%71 = call i32 @set_bit(i32* %70, i32 %29, i32 0)
%72 = call i32 @set_bit(i32* %62, i32 %60, i32 1)
%73 = load i32, i32* @stdin
%74 = call i32 @fgets(i8* %22, i32 8, i32 %73)
%75 = call i32 @remove_new_line(i8* %22)
%76 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%77 = icmp eq i64 %76, 0
br i1 %77, label %78, label %28
78: ; preds = %68, %21, %66
%79 = load i32, i32* %3
%80 = icmp eq i32 %79, 0
br i1 %80, label %90, label %81
81: ; preds = %78, %81
%82 = phi i64 [ %86, %81 ], [ 0, %78 ]
%83 = getelementptr inbounds i32, i32* %10, i64 %82
%84 = load i32, i32* %83
%85 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %84)
%86 = add nuw nsw i64 %82, 1
%87 = load i32, i32* %3
%88 = zext i32 %87 to i64
%89 = icmp ult i64 %86, %88
br i1 %89, label %81, label %90
90: ; preds = %81, %78
%91 = load i32, i32* @EXIT_SUCCESS
ret i32 %91
}