#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*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int strlen(int *);
int main() {
  char in[16];
  int out[101];
  int i, l;
  out[0] = 1;
  for (i = 1; !feof(stdin); i++) {
    scanf("%s", in);
    if (strcmp(in, "button_clicked") == 0) {
      if (out[i - 1] == 1)
        out[i] = 4;
      if (out[i - 1] == 2)
        out[i] = 3;
      if (out[i - 1] == 3)
        out[i] = 5;
      if (out[i - 1] == 4)
        out[i] = 6;
      if (out[i - 1] == 5)
        out[i] = 4;
      if (out[i - 1] == 6)
        out[i] = 3;
    }
    if (strcmp(in, "cycle_complete") == 0) {
      if (out[i - 1] == 3)
        out[i] = 1;
      if (out[i - 1] == 4)
        out[i] = 2;
    }
  }
  l = strlen(out);
  for (i = 0; i < l - 1; i++) {
    if (out[i] == 1)
      printf("\nCLOSED");
    if (out[i] == 2)
      printf("\nOPEN");
    if (out[i] == 3)
      printf("\nCLOSING");
    if (out[i] == 4)
      printf("\nOPENING");
    if (out[i] == 5)
      printf("\nSTOPPED_WHILE_CLOSING");
    if (out[i] == 6)
      printf("\nSTOPPED_WHILE_OPENING");
  }
  return 420;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x1c0(%rbp)
movl   $0x1,-0x1c4(%rbp)
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1060 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1199 <main+0x49>
jmp    1358 <main+0x208>
lea    -0x20(%rbp),%rsi
lea    0xe5c(%rip),%rdi
call   1070 <scanf@plt>
lea    -0x20(%rbp),%rdi
lea    0xe4f(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12ca <main+0x17a>
mov    -0x1c4(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x1,-0x1c0(%rbp,%rax,4)
01
jne    11ee <main+0x9e>
movslq -0x1c4(%rbp),%rax
movl   $0x4,-0x1c0(%rbp,%rax,4)
mov    -0x1c4(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x2,-0x1c0(%rbp,%rax,4)
jne    1219 <main+0xc9>
movslq -0x1c4(%rbp),%rax
movl   $0x3,-0x1c0(%rbp,%rax,4)
mov    -0x1c4(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x3,-0x1c0(%rbp,%rax,4)
03
jne    1244 <main+0xf4>
movslq -0x1c4(%rbp),%rax
movl   $0x5,-0x1c0(%rbp,%rax,4)
mov    -0x1c4(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x4,-0x1c0(%rbp,%rax,4)
04
jne    126f <main+0x11f>
movslq -0x1c4(%rbp),%rax
movl   $0x6,-0x1c0(%rbp,%rax,4)
mov    -0x1c4(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x5,-0x1c0(%rbp,%rax,4)
05
jne    129a <main+0x14a>
movslq -0x1c4(%rbp),%rax
movl   $0x4,-0x1c0(%rbp,%rax,4)
mov    -0x1c4(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x6,-0x1c0(%rbp,%rax,4)
06
jne    12c5 <main+0x175>
movslq -0x1c4(%rbp),%rax
movl   $0x3,-0x1c0(%rbp,%rax,4)
jmp    12ca <main+0x17a>
lea    -0x20(%rbp),%rdi
lea    0xd3d(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    133f <main+0x1ef>
mov    -0x1c4(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x3,-0x1c0(%rbp,%rax,4)
03
jne    130f <main+0x1bf>
movslq -0x1c4(%rbp),%rax
movl   $0x1,-0x1c0(%rbp,%rax,4)
mov    -0x1c4(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x4,-0x1c0(%rbp,%rax,4)
04
jne    133a <main+0x1ea>
movslq -0x1c4(%rbp),%rax
movl   $0x2,-0x1c0(%rbp,%rax,4)
jmp    133f <main+0x1ef>
jmp    1344 <main+0x1f4>
mov    -0x1c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c4(%rbp)
jmp    1176 <main+0x26>
lea    -0x1c0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c8(%rbp)
movl   $0x0,-0x1c4(%rbp)
mov    -0x1c4(%rbp),%eax
mov    -0x1c8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    146a <main+0x31a>
movslq -0x1c4(%rbp),%rax
cmpl   $0x1,-0x1c0(%rbp,%rax,4)
01
jne    13ac <main+0x25c>
lea    0xc7a(%rip),%rdi
call   1040 <printf@plt>
movslq -0x1c4(%rbp),%rax
cmpl   $0x2,-0x1c0(%rbp,%rax,4)
02
jne    13cd <main+0x27d>
lea    0xc61(%rip),%rdi
call   1040 <printf@plt>
movslq -0x1c4(%rbp),%rax
cmpl   $0x3,-0x1c0(%rbp,%rax,4)
03
jne    13ee <main+0x29e>
lea    0xc46(%rip),%rdi
call   1040 <printf@plt>
movslq -0x1c4(%rbp),%rax
cmpl   $0x4,-0x1c0(%rbp,%rax,4)
04
jne    140f <main+0x2bf>
lea    0xc2e(%rip),%rdi
call   1040 <printf@plt>
movslq -0x1c4(%rbp),%rax
cmpl   $0x5,-0x1c0(%rbp,%rax,4)
05
jne    1430 <main+0x2e0>
lea    0xc16(%rip),%rdi
call   1040 <printf@plt>
movslq -0x1c4(%rbp),%rax
cmpl   $0x6,-0x1c0(%rbp,%rax,4)
06
jne    1451 <main+0x301>
lea    0xc0c(%rip),%rdi
call   1040 <printf@plt>
jmp    1456 <main+0x306>
mov    -0x1c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c4(%rbp)
jmp    1374 <main+0x224>
mov    $0x1a4,%eax
add    $0x1d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1a8,%rsp
movl   $0x1,0x10(%rsp)
mov    0x2e78(%rip),%r12
mov    (%r12),%edi
call   1060 <feof@plt>
test   %eax,%eax
je     128a <main+0x13a>
lea    0x10(%rsp),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     1273 <main+0x123>
mov    %eax,%ebx
add    $0xffffffff,%ebx
xor    %r15d,%r15d
lea    0xe8c(%rip),%r12
lea    0xe8e(%rip),%r13
lea    0xe90(%rip),%rbp
lea    0xea0(%rip),%r14
jmp    11cd <main+0x7d>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r15
cmp    %r15,%rbx
je     1273 <main+0x123>
mov    0x10(%rsp,%r15,4),%eax
cmp    $0x1,%eax
je     1200 <main+0xb0>
cmp    $0x2,%eax
je     1216 <main+0xc6>
cmp    $0x3,%eax
je     122c <main+0xdc>
cmp    $0x4,%eax
je     123e <main+0xee>
cmp    $0x5,%eax
je     1250 <main+0x100>
cmp    $0x6,%eax
jne    11c0 <main+0x70>
jmp    1266 <main+0x116>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xe1a(%rip),%rdi
call   1040 <printf@plt>
mov    0x10(%rsp,%r15,4),%eax
cmp    $0x2,%eax
jne    11dc <main+0x8c>
lea    0xe0c(%rip),%rdi
call   1040 <printf@plt>
mov    0x10(%rsp,%r15,4),%eax
cmp    $0x3,%eax
jne    11e1 <main+0x91>
mov    %r12,%rdi
call   1040 <printf@plt>
mov    0x10(%rsp,%r15,4),%eax
cmp    $0x4,%eax
jne    11e6 <main+0x96>
mov    %r13,%rdi
call   1040 <printf@plt>
mov    0x10(%rsp,%r15,4),%eax
cmp    $0x5,%eax
jne    11eb <main+0x9b>
mov    %rbp,%rdi
call   1040 <printf@plt>
mov    0x10(%rsp,%r15,4),%eax
cmp    $0x6,%eax
jne    11c0 <main+0x70>
mov    %r14,%rdi
call   1040 <printf@plt>
jmp    11c0 <main+0x70>
mov    $0x1a4,%eax
add    $0x1a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x14(%rsp),%rbx
lea    0xd6a(%rip),%r14
mov    %rsp,%rbp
lea    0xd63(%rip),%r15
lea    0xd6b(%rip),%r13
jmp    12c5 <main+0x175>
mov    $0x1,%eax
mov    %eax,(%rbx)
mov    (%r12),%edi
call   1060 <feof@plt>
add    $0x4,%rbx
test   %eax,%eax
jne    1181 <main+0x31>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1070 <scanf@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1300 <main+0x1b0>
mov    -0x4(%rbx),%eax
add    $0xffffffff,%eax
cmp    $0x5,%eax
ja     1300 <main+0x1b0>
cltq
lea    0xd7c(%rip),%rcx
mov    (%rcx,%rax,4),%eax
mov    %eax,(%rbx)
nopl   0x0(%rax)
mov    %rbp,%rdi
mov    %r13,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    12b0 <main+0x160>
mov    -0x4(%rbx),%eax
cmp    $0x3,%eax
je     12a9 <main+0x159>
cmp    $0x4,%eax
jne    12b0 <main+0x160>
mov    $0x2,%eax
jmp    12ae <main+0x15e>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [15 x i8] c"button_clicked\00"
@.str.2 = [15 x i8] c"cycle_complete\00"
@.str.3 = [8 x i8] c"\0ACLOSED\00"
@.str.4 = [6 x i8] c"\0AOPEN\00"
@.str.5 = [9 x i8] c"\0ACLOSING\00"
@.str.6 = [9 x i8] c"\0AOPENING\00"
@.str.7 = [23 x i8] c"\0ASTOPPED_WHILE_CLOSING\00"
@.str.8 = [23 x i8] c"\0ASTOPPED_WHILE_OPENING\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = alloca [101 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 0
store i32 1, i32* %6
store i32 1, i32* %4
br label %7
7: ; preds = %113, %0
%8 = load i32, i32* @stdin
%9 = call i32 @feof(i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %12, label %116
12: ; preds = %7
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %85
18: ; preds = %12
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = icmp eq i32 %23, 1
br i1 %24, label %25, label %29
25: ; preds = %18
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %27
store i32 4, i32* %28
br label %29
29: ; preds = %25, %18
%30 = load i32, i32* %4
%31 = sub nsw i32 %30, 1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = icmp eq i32 %34, 2
br i1 %35, label %36, label %40
36: ; preds = %29
%37 = load i32, i32* %4
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %38
store i32 3, i32* %39
br label %40
40: ; preds = %36, %29
%41 = load i32, i32* %4
%42 = sub nsw i32 %41, 1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = icmp eq i32 %45, 3
br i1 %46, label %47, label %51
47: ; preds = %40
%48 = load i32, i32* %4
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %49
store i32 5, i32* %50
br label %51
51: ; preds = %47, %40
%52 = load i32, i32* %4
%53 = sub nsw i32 %52, 1
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = icmp eq i32 %56, 4
br i1 %57, label %58, label %62
58: ; preds = %51
%59 = load i32, i32* %4
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %60
store i32 6, i32* %61
br label %62
62: ; preds = %58, %51
%63 = load i32, i32* %4
%64 = sub nsw i32 %63, 1
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %65
%67 = load i32, i32* %66
%68 = icmp eq i32 %67, 5
br i1 %68, label %69, label %73
69: ; preds = %62
%70 = load i32, i32* %4
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %71
store i32 4, i32* %72
br label %73
73: ; preds = %69, %62
%74 = load i32, i32* %4
%75 = sub nsw i32 %74, 1
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %76
%78 = load i32, i32* %77
%79 = icmp eq i32 %78, 6
br i1 %79, label %80, label %84
80: ; preds = %73
%81 = load i32, i32* %4
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %82
store i32 3, i32* %83
br label %84
84: ; preds = %80, %73
br label %85
85: ; preds = %84, %12
%86 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%87 = call i64 @strcmp(i8* %86, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%88 = icmp eq i64 %87, 0
br i1 %88, label %89, label %112
89: ; preds = %85
%90 = load i32, i32* %4
%91 = sub nsw i32 %90, 1
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %92
%94 = load i32, i32* %93
%95 = icmp eq i32 %94, 3
br i1 %95, label %96, label %100
96: ; preds = %89
%97 = load i32, i32* %4
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %98
store i32 1, i32* %99
br label %100
100: ; preds = %96, %89
%101 = load i32, i32* %4
%102 = sub nsw i32 %101, 1
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %103
%105 = load i32, i32* %104
%106 = icmp eq i32 %105, 4
br i1 %106, label %107, label %111
107: ; preds = %100
%108 = load i32, i32* %4
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %109
store i32 2, i32* %110
br label %111
111: ; preds = %107, %100
br label %112
112: ; preds = %111, %85
br label %113
113: ; preds = %112
%114 = load i32, i32* %4
%115 = add nsw i32 %114, 1
store i32 %115, i32* %4
br label %7
116: ; preds = %7
%117 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 0
%118 = call i32 @strlen(i32* %117)
store i32 %118, i32* %5
store i32 0, i32* %4
br label %119
119: ; preds = %173, %116
%120 = load i32, i32* %4
%121 = load i32, i32* %5
%122 = sub nsw i32 %121, 1
%123 = icmp slt i32 %120, %122
br i1 %123, label %124, label %176
124: ; preds = %119
%125 = load i32, i32* %4
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %126
%128 = load i32, i32* %127
%129 = icmp eq i32 %128, 1
br i1 %129, label %130, label %132
130: ; preds = %124
%131 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %132
132: ; preds = %130, %124
%133 = load i32, i32* %4
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %134
%136 = load i32, i32* %135
%137 = icmp eq i32 %136, 2
br i1 %137, label %138, label %140
138: ; preds = %132
%139 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %140
140: ; preds = %138, %132
%141 = load i32, i32* %4
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %142
%144 = load i32, i32* %143
%145 = icmp eq i32 %144, 3
br i1 %145, label %146, label %148
146: ; preds = %140
%147 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %148
148: ; preds = %146, %140
%149 = load i32, i32* %4
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %150
%152 = load i32, i32* %151
%153 = icmp eq i32 %152, 4
br i1 %153, label %154, label %156
154: ; preds = %148
%155 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
br label %156
156: ; preds = %154, %148
%157 = load i32, i32* %4
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %158
%160 = load i32, i32* %159
%161 = icmp eq i32 %160, 5
br i1 %161, label %162, label %164
162: ; preds = %156
%163 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
br label %164
164: ; preds = %162, %156
%165 = load i32, i32* %4
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %166
%168 = load i32, i32* %167
%169 = icmp eq i32 %168, 6
br i1 %169, label %170, label %172
170: ; preds = %164
%171 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
br label %172
172: ; preds = %170, %164
br label %173
173: ; preds = %172
%174 = load i32, i32* %4
%175 = add nsw i32 %174, 1
store i32 %175, i32* %4
br label %119
176: ; preds = %119
ret i32 420
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [15 x i8] c"button_clicked\00"
@.str.2 = [15 x i8] c"cycle_complete\00"
@.str.3 = [8 x i8] c"\0ACLOSED\00"
@.str.4 = [6 x i8] c"\0AOPEN\00"
@.str.5 = [9 x i8] c"\0ACLOSING\00"
@.str.6 = [9 x i8] c"\0AOPENING\00"
@.str.7 = [23 x i8] c"\0ASTOPPED_WHILE_CLOSING\00"
@.str.8 = [23 x i8] c"\0ASTOPPED_WHILE_OPENING\00"
@switch.table.main = [6 x i32] [i32 4, i32 3, i32 5, i32 6, i32 4, i32 3]
define i32 @main() {
%1 = alloca [16 x i8]
%2 = alloca [101 x i32]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%4 = bitcast [101 x i32]* %2 to i8*
%5 = getelementptr inbounds [101 x i32], [101 x i32]* %2, i64 0, i64 0
store i32 1, i32* %5
%6 = load i32, i32* @stdin
%7 = call i32 @feof(i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %41
9: ; preds = %0, %36
%10 = phi i64 [ %37, %36 ], [ 1, %0 ]
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%12 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %25
14: ; preds = %9
%15 = add nsw i64 %10, -1
%16 = getelementptr inbounds [101 x i32], [101 x i32]* %2, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = add i32 %17, -1
%19 = icmp ult i32 %18, 6
br i1 %19, label %20, label %25
20: ; preds = %14
%21 = sext i32 %18 to i64
%22 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.main, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = getelementptr inbounds [101 x i32], [101 x i32]* %2, i64 0, i64 %10
store i32 %23, i32* %24
br label %25
25: ; preds = %14, %20, %9
%26 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %36
28: ; preds = %25
%29 = add nsw i64 %10, -1
%30 = getelementptr inbounds [101 x i32], [101 x i32]* %2, i64 0, i64 %29
%31 = load i32, i32* %30
switch i32 %31, label %36 [
i32 3, label %33
i32 4, label %32
]
32: ; preds = %28
br label %33
33: ; preds = %28, %32
%34 = phi i32 [ 2, %32 ], [ 1, %28 ]
%35 = getelementptr inbounds [101 x i32], [101 x i32]* %2, i64 0, i64 %10
store i32 %34, i32* %35
br label %36
36: ; preds = %33, %28, %25
%37 = add nuw i64 %10, 1
%38 = load i32, i32* @stdin
%39 = call i32 @feof(i32 %38)
%40 = icmp eq i32 %39, 0
br i1 %40, label %9, label %41
41: ; preds = %36, %0
%42 = call i32 @strlen(i32* %5)
%43 = icmp sgt i32 %42, 1
br i1 %43, label %44, label %87
44: ; preds = %41
%45 = add nsw i32 %42, -1
%46 = zext i32 %45 to i64
br label %47
47: ; preds = %44, %84
%48 = phi i64 [ 0, %44 ], [ %85, %84 ]
%49 = getelementptr inbounds [101 x i32], [101 x i32]* %2, i64 0, i64 %48
%50 = load i32, i32* %49
%51 = icmp eq i32 %50, 1
br i1 %51, label %52, label %55
52: ; preds = %47
%53 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%54 = load i32, i32* %49
br label %55
55: ; preds = %52, %47
%56 = phi i32 [ %54, %52 ], [ %50, %47 ]
%57 = icmp eq i32 %56, 2
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%60 = load i32, i32* %49
br label %61
61: ; preds = %58, %55
%62 = phi i32 [ %60, %58 ], [ %56, %55 ]
%63 = icmp eq i32 %62, 3
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%66 = load i32, i32* %49
br label %67
67: ; preds = %64, %61
%68 = phi i32 [ %66, %64 ], [ %62, %61 ]
%69 = icmp eq i32 %68, 4
br i1 %69, label %70, label %73
70: ; preds = %67
%71 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%72 = load i32, i32* %49
br label %73
73: ; preds = %70, %67
%74 = phi i32 [ %72, %70 ], [ %68, %67 ]
%75 = icmp eq i32 %74, 5
br i1 %75, label %76, label %79
76: ; preds = %73
%77 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
%78 = load i32, i32* %49
br label %79
79: ; preds = %76, %73
%80 = phi i32 [ %78, %76 ], [ %74, %73 ]
%81 = icmp eq i32 %80, 6
br i1 %81, label %82, label %84
82: ; preds = %79
%83 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
br label %84
84: ; preds = %79, %82
%85 = add nuw nsw i64 %48, 1
%86 = icmp eq i64 %85, %46
br i1 %86, label %87, label %47
87: ; preds = %84, %41
ret i32 420
}