#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 __BNF_trans_string(char *);
int item_to_open_close(void) {
  int state;
  do {
    state = __BNF_trans_string("door");
    if (!state)
      break;
    state = __BNF_trans_string("grate");
    if (!state)
      break;
    state = __BNF_trans_string("house");
    if (!state)
      break;
    state = __BNF_trans_string("oyster");
    if (!state)
      break;
    state = __BNF_trans_string("clam");
    if (!state)
      break;
    state = __BNF_trans_string("chain");
    if (!state)
      break;
    state = __BNF_trans_string("jar");
    if (!state)
      break;
    state = __BNF_trans_string("bottle");
  } while (0);
  return state;
}


x86 assembly (clang, -O0):
<item_to_open_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1136 <item_to_open_close+0x26>
jmp    11f9 <item_to_open_close+0xe9>
lea    0xec8(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1154 <item_to_open_close+0x44>
jmp    11f9 <item_to_open_close+0xe9>
lea    0xeb0(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1172 <item_to_open_close+0x62>
jmp    11f9 <item_to_open_close+0xe9>
lea    0xe98(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1190 <item_to_open_close+0x80>
jmp    11f9 <item_to_open_close+0xe9>
lea    0xe81(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    11ae <item_to_open_close+0x9e>
jmp    11f9 <item_to_open_close+0xe9>
lea    0xe68(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    11cc <item_to_open_close+0xbc>
jmp    11f9 <item_to_open_close+0xe9>
lea    0xe50(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    11ea <item_to_open_close+0xda>
jmp    11f9 <item_to_open_close+0xe9>
lea    0xe36(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<item_to_open_close>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
test   %eax,%eax
je     118e <item_to_open_close+0x7e>
lea    0xedd(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
test   %eax,%eax
je     118e <item_to_open_close+0x7e>
lea    0xed3(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
test   %eax,%eax
je     118e <item_to_open_close+0x7e>
lea    0xec9(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
test   %eax,%eax
je     118e <item_to_open_close+0x7e>
lea    0xec0(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
test   %eax,%eax
je     118e <item_to_open_close+0x7e>
lea    0xeb5(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
test   %eax,%eax
je     118e <item_to_open_close+0x7e>
lea    0xeab(%rip),%rdi
call   1030 <__BNF_trans_string@plt>
test   %eax,%eax
je     118e <item_to_open_close+0x7e>
lea    0xe9f(%rip),%rdi
pop    %rax
jmp    1030 <__BNF_trans_string@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"door\00"
@.str.1 = [6 x i8] c"grate\00"
@.str.2 = [6 x i8] c"house\00"
@.str.3 = [7 x i8] c"oyster\00"
@.str.4 = [5 x i8] c"clam\00"
@.str.5 = [6 x i8] c"chain\00"
@.str.6 = [4 x i8] c"jar\00"
@.str.7 = [7 x i8] c"bottle\00"
define i32 @item_to_open_close() {
%1 = alloca i32
br label %2
2: ; preds = %0
%3 = call i32 @__BNF_trans_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %2
br label %39
7: ; preds = %2
%8 = call i32 @__BNF_trans_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %7
br label %39
12: ; preds = %7
%13 = call i32 @__BNF_trans_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 %13, i32* %1
%14 = load i32, i32* %1
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %12
br label %39
17: ; preds = %12
%18 = call i32 @__BNF_trans_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
store i32 %18, i32* %1
%19 = load i32, i32* %1
%20 = icmp ne i32 %19, 0
br i1 %20, label %22, label %21
21: ; preds = %17
br label %39
22: ; preds = %17
%23 = call i32 @__BNF_trans_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i32 %23, i32* %1
%24 = load i32, i32* %1
%25 = icmp ne i32 %24, 0
br i1 %25, label %27, label %26
26: ; preds = %22
br label %39
27: ; preds = %22
%28 = call i32 @__BNF_trans_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
store i32 %28, i32* %1
%29 = load i32, i32* %1
%30 = icmp ne i32 %29, 0
br i1 %30, label %32, label %31
31: ; preds = %27
br label %39
32: ; preds = %27
%33 = call i32 @__BNF_trans_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
store i32 %33, i32* %1
%34 = load i32, i32* %1
%35 = icmp ne i32 %34, 0
br i1 %35, label %37, label %36
36: ; preds = %32
br label %39
37: ; preds = %32
%38 = call i32 @__BNF_trans_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
store i32 %38, i32* %1
br label %39
39: ; preds = %37, %36, %31, %26, %21, %16, %11, %6
%40 = load i32, i32* %1
ret i32 %40
}

LLVM IR (-O2):
@.str = [5 x i8] c"door\00"
@.str.1 = [6 x i8] c"grate\00"
@.str.2 = [6 x i8] c"house\00"
@.str.3 = [7 x i8] c"oyster\00"
@.str.4 = [5 x i8] c"clam\00"
@.str.5 = [6 x i8] c"chain\00"
@.str.6 = [4 x i8] c"jar\00"
@.str.7 = [7 x i8] c"bottle\00"
define i32 @item_to_open_close() {
%1 = tail call i32 @__BNF_trans_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %23, label %3
3: ; preds = %0
%4 = tail call i32 @__BNF_trans_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %23, label %6
6: ; preds = %3
%7 = tail call i32 @__BNF_trans_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %23, label %9
9: ; preds = %6
%10 = tail call i32 @__BNF_trans_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %23, label %12
12: ; preds = %9
%13 = tail call i32 @__BNF_trans_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %23, label %15
15: ; preds = %12
%16 = tail call i32 @__BNF_trans_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %23, label %18
18: ; preds = %15
%19 = tail call i32 @__BNF_trans_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %18
%22 = tail call i32 @__BNF_trans_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %23
23: ; preds = %18, %15, %12, %9, %6, %3, %0, %21
%24 = phi i32 [ %22, %21 ], [ 0, %18 ], [ 0, %15 ], [ 0, %12 ], [ 0, %9 ], [ 0, %6 ], [ 0, %3 ], [ 0, %0 ]
ret i32 %24
}