#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*/ printf(char *);
main() {
  char a[10] = "\\0\0\2bc";
  int i = 0;
  while (i < 3) {
    switch (a[i++]) {
    case '\\':
      printf("\nThis question is good");
      break;
    case 0:
      printf("\nThis question is too good");
      break;
    default:
      printf("\nPredict the output");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xed7(%rip),%ax
mov    %ax,-0x6(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    11ab <main+0x9b>
movslq -0x14(%rbp),%rax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movsbl -0xe(%rbp,%rax,1),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     1189 <main+0x79>
jmp    1167 <main+0x57>
mov    -0x18(%rbp),%eax
sub    $0x5c,%eax
jne    119a <main+0x8a>
jmp    1178 <main+0x68>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
jmp    11a6 <main+0x96>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
jmp    11a6 <main+0x96>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    113c <main+0x2c>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0e(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [10 x i8] c"\\0\00\02bc\00\00\00\00"
@.str = [23 x i8] c"\0AThis question is good\00"
@.str.1 = [27 x i8] c"\0AThis question is too good\00"
@.str.2 = [20 x i8] c"\0APredict the output\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [10 x i8]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %21, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
switch i32 %14, label %19 [
i32 92, label %15
i32 0, label %17
]
15: ; preds = %8
%16 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %21
17: ; preds = %8
%18 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %21
19: ; preds = %8
%20 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %19, %17, %15
br label %5
22: ; preds = %5
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0AThis question is good\00"
@.str.1 = [27 x i8] c"\0AThis question is too good\00"
@.str.2 = [20 x i8] c"\0APredict the output\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}