#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*/ getchar();
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int aux_x, aux_o, i, j, jj = 0, num_jogos, cont_x = 0, cont_o = 0;
  int jogo[3][3];
  char aux[5];
  scanf("%d", &num_jogos);
  getchar();
  for (; num_jogos > 0; --num_jogos) {
    for (i = 0; i < 3; ++i) {
      gets(aux);
      for (j = 0; j <= 5; j = j + 2) {
        jogo[i][jj] = (int)aux[j];
        ++jj;
      }
      jj = 0;
    }
    for (i = 0; i < 3; ++i) {
      for (j = 0; j < 3; ++j) {
        if (jogo[i][j] == (int)'X')
          ++cont_x;
        if (jogo[i][j] == (int)'O')
          ++cont_o;
      }
      if (cont_x == 3)
        aux_x = 3;
      if (cont_o == 3)
        aux_o = 3;
      cont_x = 0;
      cont_o = 0;
    }
    if (aux_x == 3)
      cont_x = 3;
    if (aux_o == 3)
      cont_o = 3;
    if (cont_x != 3 && cont_o != 3) {
      for (i = 0; i < 3; ++i) {
        if (jogo[i][i] == (int)'X')
          ++cont_x;
        if (jogo[i][i] == (int)'O')
          ++cont_o;
      }
      if (cont_x != 3 && cont_o != 3) {
        cont_x = 0;
        cont_o = 0;
      }
    }
    if (cont_x != 3 && cont_o != 3) {
      j = 2;
      for (i = 0; i < 3; ++i) {
        if (jogo[i][j] == (int)'X')
          ++cont_x;
        if (jogo[i][j] == (int)'O')
          ++cont_o;
        --j;
      }
      if (cont_x != 3 && cont_o != 3) {
        cont_x = 0;
        cont_o = 0;
      }
      j = 0;
    }
    if (cont_x == cont_o)
      printf("ILEGAL\n");
    else if (cont_x == 3)
      printf("X_VENCEU\n");
    else if (cont_o == 3)
      printf("O_VENCEU\n");
    else
      printf("EM_ANDAMENTO\n");
    cont_x = 0;
    cont_o = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xe95(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
cmpl   $0x0,-0x1c(%rbp)
jle    14c4 <main+0x384>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    11fb <main+0xbb>
lea    -0x55(%rbp),%rdi
call   1050 <gets@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jg     11e6 <main+0xa6>
movslq -0x14(%rbp),%rax
movsbl -0x55(%rbp,%rax,1),%edx
movslq -0x10(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    11a6 <main+0x66>
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    118c <main+0x4c>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    12ba <main+0x17a>
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    127c <main+0x13c>
movslq -0x10(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x58,(%rax,%rcx,4)
jne    1243 <main+0x103>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movslq -0x10(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x4f,(%rax,%rcx,4)
jne    1269 <main+0x129>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    126e <main+0x12e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1213 <main+0xd3>
cmpl   $0x3,-0x20(%rbp)
jne    128d <main+0x14d>
movl   $0x3,-0x8(%rbp)
cmpl   $0x3,-0x24(%rbp)
jne    129e <main+0x15e>
movl   $0x3,-0xc(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1202 <main+0xc2>
cmpl   $0x3,-0x8(%rbp)
jne    12cb <main+0x18b>
movl   $0x3,-0x20(%rbp)
cmpl   $0x3,-0xc(%rbp)
jne    12dc <main+0x19c>
movl   $0x3,-0x24(%rbp)
cmpl   $0x3,-0x20(%rbp)
je     1387 <main+0x247>
cmpl   $0x3,-0x24(%rbp)
je     1387 <main+0x247>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1360 <main+0x220>
movslq -0x10(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x58,(%rax,%rcx,4)
jne    1327 <main+0x1e7>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movslq -0x10(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x4f,(%rax,%rcx,4)
jne    134d <main+0x20d>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1352 <main+0x212>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12f7 <main+0x1b7>
cmpl   $0x3,-0x20(%rbp)
je     1382 <main+0x242>
cmpl   $0x3,-0x24(%rbp)
je     1382 <main+0x242>
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
jmp    1387 <main+0x247>
cmpl   $0x3,-0x20(%rbp)
je     143f <main+0x2ff>
cmpl   $0x3,-0x24(%rbp)
je     143f <main+0x2ff>
movl   $0x2,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1416 <main+0x2d6>
movslq -0x10(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x58,(%rax,%rcx,4)
jne    13d9 <main+0x299>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movslq -0x10(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x4f,(%rax,%rcx,4)
jne    13ff <main+0x2bf>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    13a9 <main+0x269>
cmpl   $0x3,-0x20(%rbp)
je     1438 <main+0x2f8>
cmpl   $0x3,-0x24(%rbp)
je     1438 <main+0x2f8>
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jne    145c <main+0x31c>
lea    0xbb1(%rip),%rdi
call   1030 <printf@plt>
jmp    14a8 <main+0x368>
cmpl   $0x3,-0x20(%rbp)
jne    1477 <main+0x337>
lea    0xb9e(%rip),%rdi
call   1030 <printf@plt>
jmp    14a3 <main+0x363>
cmpl   $0x3,-0x24(%rbp)
jne    1492 <main+0x352>
lea    0xb8d(%rip),%rdi
call   1030 <printf@plt>
jmp    149e <main+0x35e>
lea    0xb86(%rip),%rdi
call   1030 <printf@plt>
jmp    14a3 <main+0x363>
jmp    14a8 <main+0x368>
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    117b <main+0x3b>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xeb2(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmpl   $0x0,0xc(%rsp)
jle    11b0 <main+0x70>
lea    0x13(%rsp),%rbx
lea    0xe91(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
cmp    $0x1,%eax
jg     1180 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"ILEGAL\0A\00"
@.str.2 = [10 x i8] c"X_VENCEU\0A\00"
@.str.3 = [10 x i8] c"O_VENCEU\0A\00"
@.str.4 = [14 x i8] c"EM_ANDAMENTO\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [3 x [3 x i32]]
%11 = alloca [5 x i8]
store i32 0, i32* %1
store i32 0, i32* %6
store i32 0, i32* %8
store i32 0, i32* %9
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%13 = call i32 (...) @getchar()
br label %14
14: ; preds = %219, %0
%15 = load i32, i32* %7
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %222
17: ; preds = %14
store i32 0, i32* %4
br label %18
18: ; preds = %45, %17
%19 = load i32, i32* %4
%20 = icmp slt i32 %19, 3
br i1 %20, label %21, label %48
21: ; preds = %18
%22 = getelementptr inbounds [5 x i8], [5 x i8]* %11, i64 0, i64 0
%23 = call i32 @gets(i8* %22)
store i32 0, i32* %5
br label %24
24: ; preds = %41, %21
%25 = load i32, i32* %5
%26 = icmp sle i32 %25, 5
br i1 %26, label %27, label %44
27: ; preds = %24
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [5 x i8], [5 x i8]* %11, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = load i32, i32* %4
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %10, i64 0, i64 %34
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [3 x i32], [3 x i32]* %35, i64 0, i64 %37
store i32 %32, i32* %38
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
br label %41
41: ; preds = %27
%42 = load i32, i32* %5
%43 = add nsw i32 %42, 2
store i32 %43, i32* %5
br label %24
44: ; preds = %24
store i32 0, i32* %6
br label %45
45: ; preds = %44
%46 = load i32, i32* %4
%47 = add nsw i32 %46, 1
store i32 %47, i32* %4
br label %18
48: ; preds = %18
store i32 0, i32* %4
br label %49
49: ; preds = %93, %48
%50 = load i32, i32* %4
%51 = icmp slt i32 %50, 3
br i1 %51, label %52, label %96
52: ; preds = %49
store i32 0, i32* %5
br label %53
53: ; preds = %81, %52
%54 = load i32, i32* %5
%55 = icmp slt i32 %54, 3
br i1 %55, label %56, label %84
56: ; preds = %53
%57 = load i32, i32* %4
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %10, i64 0, i64 %58
%60 = load i32, i32* %5
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [3 x i32], [3 x i32]* %59, i64 0, i64 %61
%63 = load i32, i32* %62
%64 = icmp eq i32 %63, 88
br i1 %64, label %65, label %68
65: ; preds = %56
%66 = load i32, i32* %8
%67 = add nsw i32 %66, 1
store i32 %67, i32* %8
br label %68
68: ; preds = %65, %56
%69 = load i32, i32* %4
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %10, i64 0, i64 %70
%72 = load i32, i32* %5
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [3 x i32], [3 x i32]* %71, i64 0, i64 %73
%75 = load i32, i32* %74
%76 = icmp eq i32 %75, 79
br i1 %76, label %77, label %80
77: ; preds = %68
%78 = load i32, i32* %9
%79 = add nsw i32 %78, 1
store i32 %79, i32* %9
br label %80
80: ; preds = %77, %68
br label %81
81: ; preds = %80
%82 = load i32, i32* %5
%83 = add nsw i32 %82, 1
store i32 %83, i32* %5
br label %53
84: ; preds = %53
%85 = load i32, i32* %8
%86 = icmp eq i32 %85, 3
br i1 %86, label %87, label %88
87: ; preds = %84
store i32 3, i32* %2
br label %88
88: ; preds = %87, %84
%89 = load i32, i32* %9
%90 = icmp eq i32 %89, 3
br i1 %90, label %91, label %92
91: ; preds = %88
store i32 3, i32* %3
br label %92
92: ; preds = %91, %88
store i32 0, i32* %8
store i32 0, i32* %9
br label %93
93: ; preds = %92
%94 = load i32, i32* %4
%95 = add nsw i32 %94, 1
store i32 %95, i32* %4
br label %49
96: ; preds = %49
%97 = load i32, i32* %2
%98 = icmp eq i32 %97, 3
br i1 %98, label %99, label %100
99: ; preds = %96
store i32 3, i32* %8
br label %100
100: ; preds = %99, %96
%101 = load i32, i32* %3
%102 = icmp eq i32 %101, 3
br i1 %102, label %103, label %104
103: ; preds = %100
store i32 3, i32* %9
br label %104
104: ; preds = %103, %100
%105 = load i32, i32* %8
%106 = icmp ne i32 %105, 3
br i1 %106, label %107, label %150
107: ; preds = %104
%108 = load i32, i32* %9
%109 = icmp ne i32 %108, 3
br i1 %109, label %110, label %150
110: ; preds = %107
store i32 0, i32* %4
br label %111
111: ; preds = %139, %110
%112 = load i32, i32* %4
%113 = icmp slt i32 %112, 3
br i1 %113, label %114, label %142
114: ; preds = %111
%115 = load i32, i32* %4
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %10, i64 0, i64 %116
%118 = load i32, i32* %4
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [3 x i32], [3 x i32]* %117, i64 0, i64 %119
%121 = load i32, i32* %120
%122 = icmp eq i32 %121, 88
br i1 %122, label %123, label %126
123: ; preds = %114
%124 = load i32, i32* %8
%125 = add nsw i32 %124, 1
store i32 %125, i32* %8
br label %126
126: ; preds = %123, %114
%127 = load i32, i32* %4
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %10, i64 0, i64 %128
%130 = load i32, i32* %4
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds [3 x i32], [3 x i32]* %129, i64 0, i64 %131
%133 = load i32, i32* %132
%134 = icmp eq i32 %133, 79
br i1 %134, label %135, label %138
135: ; preds = %126
%136 = load i32, i32* %9
%137 = add nsw i32 %136, 1
store i32 %137, i32* %9
br label %138
138: ; preds = %135, %126
br label %139
139: ; preds = %138
%140 = load i32, i32* %4
%141 = add nsw i32 %140, 1
store i32 %141, i32* %4
br label %111
142: ; preds = %111
%143 = load i32, i32* %8
%144 = icmp ne i32 %143, 3
br i1 %144, label %145, label %149
145: ; preds = %142
%146 = load i32, i32* %9
%147 = icmp ne i32 %146, 3
br i1 %147, label %148, label %149
148: ; preds = %145
store i32 0, i32* %8
store i32 0, i32* %9
br label %149
149: ; preds = %148, %145, %142
br label %150
150: ; preds = %149, %107, %104
%151 = load i32, i32* %8
%152 = icmp ne i32 %151, 3
br i1 %152, label %153, label %198
153: ; preds = %150
%154 = load i32, i32* %9
%155 = icmp ne i32 %154, 3
br i1 %155, label %156, label %198
156: ; preds = %153
store i32 2, i32* %5
store i32 0, i32* %4
br label %157
157: ; preds = %187, %156
%158 = load i32, i32* %4
%159 = icmp slt i32 %158, 3
br i1 %159, label %160, label %190
160: ; preds = %157
%161 = load i32, i32* %4
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %10, i64 0, i64 %162
%164 = load i32, i32* %5
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds [3 x i32], [3 x i32]* %163, i64 0, i64 %165
%167 = load i32, i32* %166
%168 = icmp eq i32 %167, 88
br i1 %168, label %169, label %172
169: ; preds = %160
%170 = load i32, i32* %8
%171 = add nsw i32 %170, 1
store i32 %171, i32* %8
br label %172
172: ; preds = %169, %160
%173 = load i32, i32* %4
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %10, i64 0, i64 %174
%176 = load i32, i32* %5
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds [3 x i32], [3 x i32]* %175, i64 0, i64 %177
%179 = load i32, i32* %178
%180 = icmp eq i32 %179, 79
br i1 %180, label %181, label %184
181: ; preds = %172
%182 = load i32, i32* %9
%183 = add nsw i32 %182, 1
store i32 %183, i32* %9
br label %184
184: ; preds = %181, %172
%185 = load i32, i32* %5
%186 = add nsw i32 %185, -1
store i32 %186, i32* %5
br label %187
187: ; preds = %184
%188 = load i32, i32* %4
%189 = add nsw i32 %188, 1
store i32 %189, i32* %4
br label %157
190: ; preds = %157
%191 = load i32, i32* %8
%192 = icmp ne i32 %191, 3
br i1 %192, label %193, label %197
193: ; preds = %190
%194 = load i32, i32* %9
%195 = icmp ne i32 %194, 3
br i1 %195, label %196, label %197
196: ; preds = %193
store i32 0, i32* %8
store i32 0, i32* %9
br label %197
197: ; preds = %196, %193, %190
store i32 0, i32* %5
br label %198
198: ; preds = %197, %153, %150
%199 = load i32, i32* %8
%200 = load i32, i32* %9
%201 = icmp eq i32 %199, %200
br i1 %201, label %202, label %204
202: ; preds = %198
%203 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %218
204: ; preds = %198
%205 = load i32, i32* %8
%206 = icmp eq i32 %205, 3
br i1 %206, label %207, label %209
207: ; preds = %204
%208 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %217
209: ; preds = %204
%210 = load i32, i32* %9
%211 = icmp eq i32 %210, 3
br i1 %211, label %212, label %214
212: ; preds = %209
%213 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %216
214: ; preds = %209
%215 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %216
216: ; preds = %214, %212
br label %217
217: ; preds = %216, %207
br label %218
218: ; preds = %217, %202
store i32 0, i32* %8
store i32 0, i32* %9
br label %219
219: ; preds = %218
%220 = load i32, i32* %7
%221 = add nsw i32 %220, -1
store i32 %221, i32* %7
br label %14
222: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [7 x i8] c"ILEGAL\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 (...) @getchar()
%7 = load i32, i32* %1
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %0, %9
%10 = call i32 @gets(i8* %4)
%11 = call i32 @gets(i8* %4)
%12 = call i32 @gets(i8* %4)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%14 = load i32, i32* %1
%15 = add nsw i32 %14, -1
store i32 %15, i32* %1
%16 = icmp sgt i32 %14, 1
br i1 %16, label %9, label %17
17: ; preds = %9, %0
ret i32 0
}