#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 input[20];
  int commands[1000] = {0};
  int i = 0;
  int temp = 0;
  for (i = 1; scanf(" %s", input) != EOF; i++) {
    if (!strcmp(input, "button_clicked") && commands[i - 1] == 0) {
      commands[i] = 1;
    } else if (!strcmp(input, "button_clicked") && commands[i - 1] == 2) {
      commands[i] = 3;
    } else if (!strcmp(input, "button_clicked") && commands[i - 1] == 1) {
      commands[i] = 5;
    } else if (!strcmp(input, "button_clicked") && commands[i - 1] == 5) {
      commands[i] = 3;
    } else if (!strcmp(input, "button_clicked") && commands[i - 1] == 3) {
      commands[i] = 4;
    } else if (!strcmp(input, "button_clicked") && commands[i - 1] == 4) {
      commands[i] = 1;
    } else if (!strcmp(input, "cycle_complete") && commands[i - 1] == 1) {
      commands[i] = 2;
    } else if (!strcmp(input, "cycle_complete") && commands[i - 1] == 3) {
      continue;
    }
  }
  temp = i;
  for (i = 0; i < temp; i++) {
    printf("Door: ");
    switch (commands[i]) {
    case 0:
      printf("CLOSED\n");
      break;
    case 1:
      printf("OPENING\n");
      break;
    case 2:
      printf("OPEN\n");
      break;
    case 3:
      printf("CLOSING\n");
      break;
    case 4:
      printf("STOPPED_WHILE_CLOSING\n");
      break;
    case 5:
      printf("STOPPED_WHILE_OPENING\n");
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xfc0(%rbp),%rdi
xor    %esi,%esi
mov    $0xfa0,%edx
call   1040 <memset@plt>
movl   $0x0,-0xfc4(%rbp)
movl   $0x0,-0xfc8(%rbp)
movl   $0x1,-0xfc4(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xe8a(%rip),%rdi
call   1060 <scanf@plt>
mov    0x2e4e(%rip),%rcx
cmp    (%rcx),%rax
je     1415 <main+0x2d5>
lea    -0x20(%rbp),%rdi
lea    0xe6e(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11ec <main+0xac>
mov    -0xfc4(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x0,-0xfc0(%rbp,%rax,4)
jne    11ec <main+0xac>
movslq -0xfc4(%rbp),%rax
movl   $0x1,-0xfc0(%rbp,%rax,4)
jmp    13fc <main+0x2bc>
lea    -0x20(%rbp),%rdi
lea    0xe25(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1235 <main+0xf5>
mov    -0xfc4(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x2,-0xfc0(%rbp,%rax,4)
02
jne    1235 <main+0xf5>
movslq -0xfc4(%rbp),%rax
movl   $0x3,-0xfc0(%rbp,%rax,4)
jmp    13f7 <main+0x2b7>
lea    -0x20(%rbp),%rdi
lea    0xddc(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    127e <main+0x13e>
mov    -0xfc4(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x1,-0xfc0(%rbp,%rax,4)
01
jne    127e <main+0x13e>
movslq -0xfc4(%rbp),%rax
movl   $0x5,-0xfc0(%rbp,%rax,4)
jmp    13f2 <main+0x2b2>
lea    -0x20(%rbp),%rdi
lea    0xd93(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    12c7 <main+0x187>
mov    -0xfc4(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x5,-0xfc0(%rbp,%rax,4)
05
jne    12c7 <main+0x187>
movslq -0xfc4(%rbp),%rax
movl   $0x3,-0xfc0(%rbp,%rax,4)
jmp    13ed <main+0x2ad>
lea    -0x20(%rbp),%rdi
lea    0xd4a(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1310 <main+0x1d0>
mov    -0xfc4(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x3,-0xfc0(%rbp,%rax,4)
03
jne    1310 <main+0x1d0>
movslq -0xfc4(%rbp),%rax
movl   $0x4,-0xfc0(%rbp,%rax,4)
jmp    13e8 <main+0x2a8>
lea    -0x20(%rbp),%rdi
lea    0xd01(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1359 <main+0x219>
mov    -0xfc4(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x4,-0xfc0(%rbp,%rax,4)
04
jne    1359 <main+0x219>
movslq -0xfc4(%rbp),%rax
movl   $0x1,-0xfc0(%rbp,%rax,4)
jmp    13e3 <main+0x2a3>
lea    -0x20(%rbp),%rdi
lea    0xcc7(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    13a2 <main+0x262>
mov    -0xfc4(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x1,-0xfc0(%rbp,%rax,4)
01
jne    13a2 <main+0x262>
movslq -0xfc4(%rbp),%rax
movl   $0x2,-0xfc0(%rbp,%rax,4)
jmp    13de <main+0x29e>
lea    -0x20(%rbp),%rdi
lea    0xc7e(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    13d9 <main+0x299>
mov    -0xfc4(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x3,-0xfc0(%rbp,%rax,4)
03
jne    13d9 <main+0x299>
jmp    1401 <main+0x2c1>
jmp    13de <main+0x29e>
jmp    13e3 <main+0x2a3>
jmp    13e8 <main+0x2a8>
jmp    13ed <main+0x2ad>
jmp    13f2 <main+0x2b2>
jmp    13f7 <main+0x2b7>
jmp    13fc <main+0x2bc>
jmp    1401 <main+0x2c1>
mov    -0xfc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfc4(%rbp)
jmp    1183 <main+0x43>
mov    -0xfc4(%rbp),%eax
mov    %eax,-0xfc8(%rbp)
movl   $0x0,-0xfc4(%rbp)
mov    -0xfc4(%rbp),%eax
cmp    -0xfc8(%rbp),%eax
jge    14f9 <main+0x3b9>
lea    0xbf6(%rip),%rdi
call   1030 <printf@plt>
movslq -0xfc4(%rbp),%rax
mov    -0xfc0(%rbp,%rax,4),%eax
mov    %rax,-0xfd0(%rbp)
sub    $0x5,%rax
ja     14e0 <main+0x3a0>
mov    -0xfd0(%rbp),%rax
lea    0xb8a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xbbb(%rip),%rdi
call   1030 <printf@plt>
jmp    14e0 <main+0x3a0>
lea    0xbdd(%rip),%rdi
call   1030 <printf@plt>
jmp    14e0 <main+0x3a0>
lea    0xba1(%rip),%rdi
call   1030 <printf@plt>
jmp    14e0 <main+0x3a0>
lea    0xba4(%rip),%rdi
call   1030 <printf@plt>
jmp    14e0 <main+0x3a0>
lea    0xb85(%rip),%rdi
call   1030 <printf@plt>
jmp    14e0 <main+0x3a0>
lea    0xb8b(%rip),%rdi
call   1030 <printf@plt>
jmp    14e5 <main+0x3a5>
mov    -0xfc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfc4(%rbp)
jmp    142b <main+0x2eb>
xor    %eax,%eax
add    $0xfd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xfc8,%rsp
lea    0x20(%rsp),%rdi
mov    $0xfa0,%edx
xor    %esi,%esi
call   1050 <memset@plt>
lea    0xe97(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
mov    0x2e70(%rip),%rcx
mov    $0x1,%r15d
mov    $0x1,%ebx
cmp    (%rcx),%rax
jne    11ee <main+0xae>
cmp    $0x2,%ebx
cmovae %ebx,%r15d
xor    %ebp,%ebp
lea    0xe8a(%rip),%r14
lea    0xedd(%rip),%rbx
jmp    11b9 <main+0x79>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%r15
je     11da <main+0x9a>
mov    %r14,%rdi
call   1040 <printf@plt>
movslq 0x20(%rsp,%rbp,4),%rax
cmp    $0x5,%rax
ja     11b0 <main+0x70>
movslq (%rbx,%rax,4),%rdi
add    %rbx,%rdi
call   1030 <puts@plt>
jmp    11b0 <main+0x70>
xor    %eax,%eax
add    $0xfc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%ebx
movabs $0x635f6e6f74747562,%rbp
6e 5f 63
movabs $0x64656b63696c63,%r13
lea    0xdf2(%rip),%r14
mov    %rsp,%r12
jmp    1240 <main+0x100>
lea    0xe4a(%rip),%rcx
mov    (%rcx,%rax,4),%eax
mov    %eax,0x20(%rsp,%rbx,4)
add    $0x1,%rbx
mov    %r14,%rdi
mov    %r12,%rsi
call   1060 <scanf@plt>
mov    0x2db1(%rip),%rcx
cmp    (%rcx),%rax
je     1188 <main+0x48>
mov    (%rsp),%rax
xor    %rbp,%rax
mov    0x7(%rsp),%rcx
xor    %r13,%rcx
or     %rax,%rcx
jne    125f <main+0x11f>
movslq 0x1c(%rsp,%rbx,4),%rax
cmp    $0x6,%rax
jb     1213 <main+0xd3>
mov    (%rsp),%rax
movabs $0x6f635f656c637963,%rcx
5f 63 6f
xor    %rcx,%rax
mov    0x7(%rsp),%rcx
movabs $0x6574656c706d6f,%rdx
xor    %rdx,%rcx
or     %rax,%rcx
jne    1221 <main+0xe1>
mov    $0x2,%eax
cmpl   $0x1,0x1c(%rsp,%rbx,4)
je     121d <main+0xdd>
jmp    1221 <main+0xe1>

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

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