#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int main() {
  char garage[17];
  int position = 0;
  int digits[30] = {0};
  int count = 0;
  int help = 0;
  while (scanf("%s", garage) != EOF) {
    if (!strcmp(garage, "button_clicked")) {
      if (position == 0) {
        position = 1;
        digits[count] = position;
        count++;
      } else if (position == 1) {
        position = 2;
        digits[count] = position;
        count++;
      } else if (position == 2) {
        position = 3;
        digits[count] = position;
        count++;
      } else if (position == 3) {
        position = 4;
        digits[count] = position;
        count++;
      } else if (position == 4) {
        position = 1;
        digits[count] = position;
        count++;
      } else if (position == 5) {
        position = 3;
        digits[count] = position;
        count++;
      }
    }
    if (!strcmp(garage, "cycle_complete")) {
      if (position == 1) {
        position = 5;
        digits[count] = position;
        count++;
      } else if (position == 3) {
        position = 0;
        digits[count] = position;
        count++;
      }
    }
  }
  printf("Door: CLOSED\n");
  for (help = 0; help < count; help++) {
    if (digits[help] == 0) {
      printf("Door: CLOSED\n");
    }
    if (digits[help] == 1) {
      printf("Door: OPENING\n");
    }
    if (digits[help] == 2) {
      printf("Door: STOPED_WHILE_OPENING\n");
    }
    if (digits[help] == 3) {
      printf("Door: CLOSING\n");
    }
    if (digits[help] == 4) {
      printf("Door: STOPED_WHILE_CLOSING\n");
    }
    if (digits[help] == 5) {
      printf("Door: OPEN\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x78,%edx
call   1040 <memset@plt>
movl   $0x0,-0xa4(%rbp)
movl   $0x0,-0xa8(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xe75(%rip),%rdi
call   1060 <scanf@plt>
mov    0x2e51(%rip),%rcx
cmp    (%rcx),%rax
je     13a5 <main+0x265>
lea    -0x20(%rbp),%rdi
lea    0xe58(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1316 <main+0x1d6>
cmpl   $0x0,-0x24(%rbp)
jne    11ef <main+0xaf>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
movslq -0xa4(%rbp),%rax
mov    %ecx,-0xa0(%rbp,%rax,4)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1311 <main+0x1d1>
cmpl   $0x1,-0x24(%rbp)
jne    1225 <main+0xe5>
movl   $0x2,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
movslq -0xa4(%rbp),%rax
mov    %ecx,-0xa0(%rbp,%rax,4)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    130c <main+0x1cc>
cmpl   $0x2,-0x24(%rbp)
jne    125b <main+0x11b>
movl   $0x3,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
movslq -0xa4(%rbp),%rax
mov    %ecx,-0xa0(%rbp,%rax,4)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1307 <main+0x1c7>
cmpl   $0x3,-0x24(%rbp)
jne    1291 <main+0x151>
movl   $0x4,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
movslq -0xa4(%rbp),%rax
mov    %ecx,-0xa0(%rbp,%rax,4)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1302 <main+0x1c2>
cmpl   $0x4,-0x24(%rbp)
jne    12c7 <main+0x187>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
movslq -0xa4(%rbp),%rax
mov    %ecx,-0xa0(%rbp,%rax,4)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    12fd <main+0x1bd>
cmpl   $0x5,-0x24(%rbp)
jne    12f8 <main+0x1b8>
movl   $0x3,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
movslq -0xa4(%rbp),%rax
mov    %ecx,-0xa0(%rbp,%rax,4)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    12fd <main+0x1bd>
jmp    1302 <main+0x1c2>
jmp    1307 <main+0x1c7>
jmp    130c <main+0x1cc>
jmp    1311 <main+0x1d1>
jmp    1316 <main+0x1d6>
lea    -0x20(%rbp),%rdi
lea    0xcf1(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    13a0 <main+0x260>
cmpl   $0x1,-0x24(%rbp)
jne    1365 <main+0x225>
movl   $0x5,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
movslq -0xa4(%rbp),%rax
mov    %ecx,-0xa0(%rbp,%rax,4)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    139b <main+0x25b>
cmpl   $0x3,-0x24(%rbp)
jne    1396 <main+0x256>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
movslq -0xa4(%rbp),%rax
mov    %ecx,-0xa0(%rbp,%rax,4)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    139b <main+0x25b>
jmp    13a0 <main+0x260>
jmp    1180 <main+0x40>
lea    0xc75(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
cmp    -0xa4(%rbp),%eax
jge    14ac <main+0x36c>
movslq -0xa8(%rbp),%rax
cmpl   $0x0,-0xa0(%rbp,%rax,4)
jne    13ee <main+0x2ae>
lea    0xc38(%rip),%rdi
call   1030 <printf@plt>
movslq -0xa8(%rbp),%rax
cmpl   $0x1,-0xa0(%rbp,%rax,4)
01
jne    140f <main+0x2cf>
lea    0xc25(%rip),%rdi
call   1030 <printf@plt>
movslq -0xa8(%rbp),%rax
cmpl   $0x2,-0xa0(%rbp,%rax,4)
02
jne    1430 <main+0x2f0>
lea    0xc13(%rip),%rdi
call   1030 <printf@plt>
movslq -0xa8(%rbp),%rax
cmpl   $0x3,-0xa0(%rbp,%rax,4)
03
jne    1451 <main+0x311>
lea    0xc0e(%rip),%rdi
call   1030 <printf@plt>
movslq -0xa8(%rbp),%rax
cmpl   $0x4,-0xa0(%rbp,%rax,4)
04
jne    1472 <main+0x332>
lea    0xbfc(%rip),%rdi
call   1030 <printf@plt>
movslq -0xa8(%rbp),%rax
cmpl   $0x5,-0xa0(%rbp,%rax,4)
05
jne    1493 <main+0x353>
lea    0xbf7(%rip),%rdi
call   1030 <printf@plt>
jmp    1498 <main+0x358>
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    13bb <main+0x27b>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movq   $0x0,0x90(%rsp)
lea    0xe93(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    0x2e6c(%rip),%r12
cmp    (%r12),%rax
jne    1193 <main+0x73>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
jmp    12a2 <main+0x182>
xor    %ebx,%ebx
movabs $0x6574656c706d6f,%rbp
lea    0xe5a(%rip),%r14
mov    %rsp,%r15
xor    %r13d,%r13d
jmp    11d4 <main+0xb4>
mov    $0x5,%r13d
movslq %ebx,%rbx
mov    %r13d,0x20(%rsp,%rbx,4)
add    $0x1,%ebx
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
je     125b <main+0x13b>
mov    (%rsp),%rax
movabs $0x635f6e6f74747562,%rcx
6e 5f 63
xor    %rcx,%rax
mov    0x7(%rsp),%rcx
movabs $0x64656b63696c63,%rdx
xor    %rdx,%rcx
or     %rax,%rcx
jne    1221 <main+0x101>
mov    $0x3,%eax
cmp    $0x4,%r13d
ja     1214 <main+0xf4>
movslq %r13d,%rax
lea    0xe7b(%rip),%rcx
mov    (%rcx,%rax,4),%eax
movslq %ebx,%rbx
mov    %eax,0x20(%rsp,%rbx,4)
add    $0x1,%ebx
mov    %eax,%r13d
mov    (%rsp),%rax
movabs $0x6f635f656c637963,%rcx
5f 63 6f
xor    %rcx,%rax
mov    0x7(%rsp),%rcx
xor    %rbp,%rcx
or     %rax,%rcx
jne    11bf <main+0x9f>
cmp    $0x1,%r13d
je     11ae <main+0x8e>
cmp    $0x3,%r13d
jne    11bf <main+0x9f>
xor    %r13d,%r13d
jmp    11b4 <main+0x94>
lea    0xe1c(%rip),%rdi
call   1030 <puts@plt>
test   %ebx,%ebx
jle    12a2 <main+0x182>
mov    %ebx,%ebx
xor    %ebp,%ebp
lea    0xe2a(%rip),%r14
jmp    1289 <main+0x169>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%rbx
je     12a2 <main+0x182>
movslq 0x20(%rsp,%rbp,4),%rax
cmp    $0x5,%rax
ja     1280 <main+0x160>
movslq (%r14,%rax,4),%rdi
add    %r14,%rdi
call   1030 <puts@plt>
jmp    1280 <main+0x160>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.1 = [15 x i8] c"button_clicked\00"
@.str.2 = [15 x i8] c"cycle_complete\00"
@str.9 = [11 x i8] c"Door: OPEN\00"
@str.10 = [27 x i8] c"Door: STOPED_WHILE_CLOSING\00"
@str.11 = [14 x i8] c"Door: CLOSING\00"
@str.12 = [27 x i8] c"Door: STOPED_WHILE_OPENING\00"
@str.13 = [14 x i8] c"Door: OPENING\00"
@str.14 = [13 x i8] c"Door: CLOSED\00"
@switch.table.main = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 1]
@reltable.main = [6 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.14 to i64), i64 ptrtoint ([6 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @str.13 to i64), i64 ptrtoint ([6 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([27 x i8]* @str.12 to i64), i64 ptrtoint ([6 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @str.11 to i64), i64 ptrtoint ([6 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([27 x i8]* @str.10 to i64), i64 ptrtoint ([6 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @str.9 to i64), i64 ptrtoint ([6 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca [17 x i8]
%2 = alloca [30 x i32]
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%4 = bitcast [30 x i32]* %2 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.14, i64 0, i64 0))
br label %62
10: ; preds = %0, %38
%11 = phi i32 [ %40, %38 ], [ 0, %0 ]
%12 = phi i32 [ %39, %38 ], [ 0, %0 ]
%13 = call i32 @bcmp(i8* dereferenceable(15) %3, i8* dereferenceable(15) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i64 15)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = icmp ult i32 %12, 5
br i1 %16, label %17, label %21
17: ; preds = %15
%18 = sext i32 %12 to i64
%19 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.main, i64 0, i64 %18
%20 = load i32, i32* %19
br label %21
21: ; preds = %15, %17
%22 = phi i32 [ %20, %17 ], [ 3, %15 ]
%23 = sext i32 %11 to i64
%24 = getelementptr inbounds [30 x i32], [30 x i32]* %2, i64 0, i64 %23
store i32 %22, i32* %24
%25 = add nsw i32 %11, 1
br label %26
26: ; preds = %21, %10
%27 = phi i32 [ %12, %10 ], [ %22, %21 ]
%28 = phi i32 [ %11, %10 ], [ %25, %21 ]
%29 = call i32 @bcmp(i8* dereferenceable(15) %3, i8* dereferenceable(15) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i64 15)
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %38
31: ; preds = %26
switch i32 %27, label %38 [
i32 1, label %33
i32 3, label %32
]
32: ; preds = %31
br label %33
33: ; preds = %31, %32
%34 = phi i32 [ 0, %32 ], [ 5, %31 ]
%35 = sext i32 %28 to i64
%36 = getelementptr inbounds [30 x i32], [30 x i32]* %2, i64 0, i64 %35
store i32 %34, i32* %36
%37 = add nsw i32 %28, 1
br label %38
38: ; preds = %33, %31, %26
%39 = phi i32 [ %27, %26 ], [ %27, %31 ], [ %34, %33 ]
%40 = phi i32 [ %28, %26 ], [ %28, %31 ], [ %37, %33 ]
%41 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%42 = load i64, i64* @EOF
%43 = icmp eq i64 %41, %42
br i1 %43, label %44, label %10
44: ; preds = %38
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.14, i64 0, i64 0))
%46 = icmp sgt i32 %40, 0
br i1 %46, label %47, label %62
47: ; preds = %44
%48 = zext i32 %40 to i64
br label %49
49: ; preds = %47, %59
%50 = phi i64 [ 0, %47 ], [ %60, %59 ]
%51 = getelementptr inbounds [30 x i32], [30 x i32]* %2, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = icmp ult i32 %52, 6
br i1 %53, label %54, label %59
54: ; preds = %49
%55 = sext i32 %52 to i64
%56 = shl i64 %55, 2
%57 = call i8* @llvm.load.relative.i64(i8* bitcast ([6 x i32]* @reltable.main to i8*), i64 %56)
%58 = call i32 @puts(i8* dereferenceable(1) %57)
br label %59
59: ; preds = %49, %54
%60 = add nuw nsw i64 %50, 1
%61 = icmp eq i64 %60, %48
br i1 %61, label %62, label %49
62: ; preds = %59, %8, %44
ret i32 0
}