#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 *);
scalar_t__ strcmp(char *, char *);
int main() {
  char gate[20];
  int state = 0;
  int clicks = 0;
  printf("Door: CLOSED");
  while (scanf("%s", gate) != EOF) {
    if (strcmp(gate, "button_clicked") == 0 && (state == 0 || state == 5)) {
      printf("Door: OPENING");
      state = 2;
      clicks++;
    }
    if (strcmp(gate, "button_clicked") == 0 && state == 2 && clicks == 5) {
      state = 4;
      clicks++;
      printf("Door: STOPPED_WHILE_OPENING");
      continue;
    }
    if (strcmp(gate, "cycle_complete") == 0 && state == 2 && clicks == 1) {
      printf("Door: OPEN");
      state = 1;
      clicks++;
    }
    if (strcmp(gate, "cycle_complete") == 0 && state == 3 && clicks == 7) {
      printf("Door: CLOSED");
      state = 0;
      clicks++;
    }
    if (strcmp(gate, "button_clicked") == 0 && state == 3 && clicks == 3) {
      printf("Door: STOPPED_WHILE_CLOSING");
      state = 5;
      clicks++;
      continue;
    }
    if (strcmp(gate, "button_clicked") == 0 && (state == 1 || state == 4) &&
        clicks == 2) {
      printf("Door: CLOSING");
      state = 3;
      clicks++;
    }
    if (strcmp(gate, "button_clicked") == 0 && (state == 4 || state == 1) &&
        clicks == 6) {
      printf("Door: CLOSING");
      state = 3;
      clicks++;
    }
    if ((state == 5 || state == 0) && clicks == 4 &&
        strcmp(gate, "button_clicked") == 0) {
      printf("Door: OPENING");
      state = 2;
      clicks++;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1050 <scanf@plt>
mov    0x2e78(%rip),%rcx
cmp    (%rcx),%rax
je     13f6 <main+0x2c6>
lea    -0x20(%rbp),%rdi
lea    0xe8c(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11c3 <main+0x93>
cmpl   $0x0,-0x24(%rbp)
je     11a7 <main+0x77>
cmpl   $0x5,-0x24(%rbp)
jne    11c3 <main+0x93>
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0x24(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    0xe42(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1212 <main+0xe2>
cmpl   $0x2,-0x24(%rbp)
jne    1212 <main+0xe2>
cmpl   $0x5,-0x28(%rbp)
jne    1212 <main+0xe2>
movl   $0x4,-0x24(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
lea    0xe25(%rip),%rdi
call   1030 <printf@plt>
jmp    1159 <main+0x29>
lea    -0x20(%rbp),%rdi
lea    0xe2c(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    125c <main+0x12c>
cmpl   $0x2,-0x24(%rbp)
jne    125c <main+0x12c>
cmpl   $0x1,-0x28(%rbp)
jne    125c <main+0x12c>
lea    0xe11(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x24(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    0xde2(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12a6 <main+0x176>
cmpl   $0x3,-0x24(%rbp)
jne    12a6 <main+0x176>
cmpl   $0x7,-0x28(%rbp)
jne    12a6 <main+0x176>
lea    0xd6f(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    0xd5f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12f5 <main+0x1c5>
cmpl   $0x3,-0x24(%rbp)
jne    12f5 <main+0x1c5>
cmpl   $0x3,-0x28(%rbp)
jne    12f5 <main+0x1c5>
lea    0xd88(%rip),%rdi
call   1030 <printf@plt>
movl   $0x5,-0x24(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1159 <main+0x29>
lea    -0x20(%rbp),%rdi
lea    0xd10(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1349 <main+0x219>
cmpl   $0x1,-0x24(%rbp)
je     1323 <main+0x1f3>
cmpl   $0x4,-0x24(%rbp)
jne    1349 <main+0x219>
cmpl   $0x2,-0x28(%rbp)
jne    1349 <main+0x219>
lea    0xd4b(%rip),%rdi
call   1030 <printf@plt>
movl   $0x3,-0x24(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    0xcbc(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    139d <main+0x26d>
cmpl   $0x4,-0x24(%rbp)
je     1377 <main+0x247>
cmpl   $0x1,-0x24(%rbp)
jne    139d <main+0x26d>
cmpl   $0x6,-0x28(%rbp)
jne    139d <main+0x26d>
lea    0xcf7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x3,-0x24(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x5,-0x24(%rbp)
je     13b1 <main+0x281>
cmpl   $0x0,-0x24(%rbp)
jne    13f1 <main+0x2c1>
cmpl   $0x4,-0x28(%rbp)
jne    13f1 <main+0x2c1>
lea    -0x20(%rbp),%rdi
lea    0xc4a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    13f1 <main+0x2c1>
lea    0xc43(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0x24(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1159 <main+0x29>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    0x2e88(%rip),%rbp
cmp    0x0(%rbp),%rax
jne    1177 <main+0x47>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r15d,%r15d
lea    0xe8f(%rip),%r14
mov    %rsp,%rbx
lea    0xebe(%rip),%r13
xor    %r12d,%r12d
jmp    11bd <main+0x8d>
mov    $0x6,%r15d
mov    $0x4,%r12d
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
lea    0xe5e(%rip),%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    0x0(%rbp),%rax
je     1166 <main+0x36>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11ee <main+0xbe>
cmp    $0x5,%r12d
je     11d8 <main+0xa8>
test   %r12d,%r12d
jne    11ee <main+0xbe>
lea    0xe40(%rip),%rdi
call   1030 <printf@plt>
add    $0x1,%r15d
mov    $0x2,%r12d
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    120a <main+0xda>
cmp    $0x2,%r12d
jne    120a <main+0xda>
cmp    $0x5,%r15d
je     1190 <main+0x60>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    123e <main+0x10e>
cmp    $0x2,%r12d
jne    123e <main+0x10e>
cmp    $0x1,%r15d
jne    123e <main+0x10e>
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%r15d
mov    $0x1,%r12d
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    126f <main+0x13f>
cmp    $0x3,%r12d
jne    126f <main+0x13f>
cmp    $0x7,%r15d
jne    126f <main+0x13f>
lea    0xd9f(%rip),%rdi
call   1030 <printf@plt>
mov    $0x8,%r15d
xor    %r12d,%r12d
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    12b0 <main+0x180>
cmp    $0x3,%r12d
jne    12b0 <main+0x180>
cmp    $0x3,%r15d
jne    12b0 <main+0x180>
mov    $0x4,%r15d
mov    $0x5,%r12d
lea    0xdc5(%rip),%rdi
jmp    11a3 <main+0x73>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    12f0 <main+0x1c0>
cmp    $0x1,%r12d
setne  %al
cmp    $0x4,%r12d
setne  %cl
test   %cl,%al
jne    12f0 <main+0x1c0>
cmp    $0x2,%r15d
jne    12f0 <main+0x1c0>
lea    0xda0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%r12d
mov    $0x3,%r15d
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1351 <main+0x221>
cmp    $0x5,%r12d
setne  %al
test   %r12d,%r12d
setne  %cl
test   %cl,%al
jne    11a8 <main+0x78>
cmp    $0x4,%r15d
jne    11a8 <main+0x78>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
mov    $0x4,%r15d
test   %rax,%rax
jne    11a8 <main+0x78>
mov    $0x5,%r15d
mov    $0x2,%r12d
lea    0xcd3(%rip),%rdi
jmp    11a3 <main+0x73>
cmp    $0x4,%r12d
setne  %al
cmp    $0x1,%r12d
setne  %cl
test   %cl,%al
jne    1300 <main+0x1d0>
cmp    $0x6,%r15d
jne    1300 <main+0x1d0>
mov    $0x7,%r15d
mov    $0x3,%r12d
lea    0xd03(%rip),%rdi
jmp    11a3 <main+0x73>

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

LLVM IR (-O2):
@.str = [13 x i8] c"Door: CLOSED\00"
@.str.1 = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.2 = [15 x i8] c"button_clicked\00"
@.str.3 = [14 x i8] c"Door: OPENING\00"
@.str.4 = [28 x i8] c"Door: STOPPED_WHILE_OPENING\00"
@.str.5 = [15 x i8] c"cycle_complete\00"
@.str.6 = [11 x i8] c"Door: OPEN\00"
@.str.7 = [28 x i8] c"Door: STOPPED_WHILE_CLOSING\00"
@.str.8 = [14 x i8] c"Door: CLOSING\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %95, label %7
7: ; preds = %0, %30
%8 = phi i32 [ %32, %30 ], [ 0, %0 ]
%9 = phi i32 [ %31, %30 ], [ 0, %0 ]
%10 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %7
switch i32 %9, label %16 [
i32 5, label %13
i32 0, label %13
]
13: ; preds = %12, %12
%14 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%15 = add nsw i32 %8, 1
br label %16
16: ; preds = %12, %13, %7
%17 = phi i32 [ 2, %13 ], [ %9, %12 ], [ %9, %7 ]
%18 = phi i32 [ %15, %13 ], [ %8, %12 ], [ %8, %7 ]
%19 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
%21 = icmp eq i32 %17, 2
%22 = select i1 %20, i1 %21, i1 false
%23 = icmp eq i32 %18, 5
%24 = select i1 %22, i1 %23, i1 false
br i1 %24, label %25, label %36
25: ; preds = %16, %92, %80, %55
%26 = phi i8* [ getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), %55 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), %80 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), %92 ], [ getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), %16 ]
%27 = phi i32 [ 5, %55 ], [ 3, %80 ], [ 2, %92 ], [ 4, %16 ]
%28 = phi i32 [ 4, %55 ], [ 7, %80 ], [ 5, %92 ], [ 6, %16 ]
%29 = call i32 @printf(i8* dereferenceable(1) %26)
br label %30
30: ; preds = %25, %92, %86
%31 = phi i32 [ %76, %92 ], [ %76, %86 ], [ %27, %25 ]
%32 = phi i32 [ 4, %92 ], [ %77, %86 ], [ %28, %25 ]
%33 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%34 = load i64, i64* @EOF
%35 = icmp eq i64 %33, %34
br i1 %35, label %95, label %7
36: ; preds = %16
%37 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
%39 = select i1 %38, i1 %21, i1 false
%40 = icmp eq i32 %18, 1
%41 = select i1 %39, i1 %40, i1 false
br i1 %41, label %42, label %44
42: ; preds = %36
%43 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
br label %44
44: ; preds = %42, %36
%45 = phi i32 [ 1, %42 ], [ %17, %36 ]
%46 = phi i32 [ 2, %42 ], [ %18, %36 ]
%47 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
%49 = icmp eq i32 %45, 3
%50 = select i1 %48, i1 %49, i1 false
%51 = icmp eq i32 %46, 7
%52 = select i1 %50, i1 %51, i1 false
br i1 %52, label %53, label %55
53: ; preds = %44
%54 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %55
55: ; preds = %53, %44
%56 = phi i32 [ 0, %53 ], [ %45, %44 ]
%57 = phi i32 [ 8, %53 ], [ %46, %44 ]
%58 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
%60 = icmp eq i32 %56, 3
%61 = select i1 %59, i1 %60, i1 false
%62 = icmp eq i32 %57, 3
%63 = select i1 %61, i1 %62, i1 false
br i1 %63, label %25, label %64
64: ; preds = %55
%65 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %75
67: ; preds = %64
%68 = icmp eq i32 %56, 1
%69 = icmp eq i32 %56, 4
%70 = or i1 %68, %69
%71 = icmp eq i32 %57, 2
%72 = select i1 %70, i1 %71, i1 false
br i1 %72, label %73, label %75
73: ; preds = %67
%74 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
br label %75
75: ; preds = %67, %73, %64
%76 = phi i32 [ 3, %73 ], [ %56, %67 ], [ %56, %64 ]
%77 = phi i32 [ 3, %73 ], [ %57, %67 ], [ %57, %64 ]
%78 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%79 = icmp eq i64 %78, 0
br i1 %79, label %80, label %86
80: ; preds = %75
%81 = icmp eq i32 %76, 4
%82 = icmp eq i32 %76, 1
%83 = or i1 %81, %82
%84 = icmp eq i32 %77, 6
%85 = select i1 %83, i1 %84, i1 false
br i1 %85, label %25, label %86
86: ; preds = %80, %75
%87 = icmp eq i32 %76, 5
%88 = icmp eq i32 %76, 0
%89 = or i1 %87, %88
%90 = icmp eq i32 %77, 4
%91 = select i1 %89, i1 %90, i1 false
br i1 %91, label %92, label %30
92: ; preds = %86
%93 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%94 = icmp eq i64 %93, 0
br i1 %94, label %25, label %30
95: ; preds = %30, %0
ret i32 0
}