#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 *, int);
int main(void) {
  int i;
  for (i = 1; i <= 8; i++) {
    switch (i) {
    case 1:
    case 2:
      printf("%d ==> a\n", i);
      break;
    case 3:
    case 4:
    case 5:
      printf("%d ==> b\n", i);
      break;
    case 6:
      printf("%d ==> c\n", i);
      break;
    default:
      printf("%d ==> d\n", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jg     11ca <main+0xba>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     116c <main+0x5c>
jmp    1147 <main+0x37>
mov    -0xc(%rbp),%eax
add    $0xfffffffd,%eax
sub    $0x3,%eax
jb     1180 <main+0x70>
jmp    115b <main+0x4b>
mov    -0xc(%rbp),%eax
sub    $0x6,%eax
je     1194 <main+0x84>
jmp    11a8 <main+0x98>
mov    -0x8(%rbp),%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
jmp    11b7 <main+0xa7>
mov    -0x8(%rbp),%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
jmp    11b7 <main+0xa7>
mov    -0x8(%rbp),%esi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
jmp    11b7 <main+0xa7>
mov    -0x8(%rbp),%esi
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
jmp    11bc <main+0xac>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
lea    0xea6(%rip),%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d ==> a\0A\00"
@.str.1 = [10 x i8] c"%d ==> b\0A\00"
@.str.2 = [10 x i8] c"%d ==> c\0A\00"
@.str.3 = [10 x i8] c"%d ==> d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %21, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 8
br i1 %5, label %6, label %24
6: ; preds = %3
%7 = load i32, i32* %2
switch i32 %7, label %17 [
i32 1, label %8
i32 2, label %8
i32 3, label %11
i32 4, label %11
i32 5, label %11
i32 6, label %14
]
8: ; preds = %6, %6
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %20
11: ; preds = %6, %6, %6
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %20
14: ; preds = %6
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %15)
br label %20
17: ; preds = %6
%18 = load i32, i32* %2
%19 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %17, %14, %11, %8
br label %21
21: ; preds = %20
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %3
24: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d ==> a\0A\00"
@.str.1 = [10 x i8] c"%d ==> b\0A\00"
@.str.2 = [10 x i8] c"%d ==> c\0A\00"
@.str.3 = [10 x i8] c"%d ==> d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 5)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 6)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 7)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 8)
ret i32 0
}