#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int type;
  scanf("%d", &type);
  switch (type) {
  case 1:
    printf("hello\n");
    break;
  case 2:
    printf("morning\n");
    break;
  case 3:
    printf("evening\n");
    break;
  case 4:
    printf("GoodBye\n");
  default:
    printf("What???\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     11a7 <main+0x87>
mov    -0x10(%rbp),%rax
lea    0xea1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    11b3 <main+0x93>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    11b3 <main+0x93>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
jmp    11b3 <main+0x93>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     1173 <main+0x53>
lea    0xeee(%rip),%rdi
lea    0xeb4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xecf(%rip),%rdi
jmp    117a <main+0x5a>
lea    0xebe(%rip),%rdi
jmp    117a <main+0x5a>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"hello\0A\00"
@.str.2 = [9 x i8] c"morning\0A\00"
@.str.3 = [9 x i8] c"evening\0A\00"
@.str.4 = [9 x i8] c"GoodBye\0A\00"
@.str.5 = [9 x i8] c"What???\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
switch i32 %4, label %13 [
i32 1, label %5
i32 2, label %7
i32 3, label %9
i32 4, label %11
]
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %15
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %15
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %15
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %13
13: ; preds = %0, %11
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %15
15: ; preds = %13, %9, %7, %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [8 x i8] c"GoodBye\00"
@str.6 = [8 x i8] c"What???\00"
@str.7 = [8 x i8] c"evening\00"
@str.8 = [8 x i8] c"morning\00"
@str.9 = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
switch i32 %4, label %9 [
i32 1, label %10
i32 2, label %5
i32 3, label %6
i32 4, label %7
]
5: ; preds = %0
br label %10
6: ; preds = %0
br label %10
7: ; preds = %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %0, %7
br label %10
10: ; preds = %0, %9, %6, %5
%11 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.6, i64 0, i64 0), %9 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.7, i64 0, i64 0), %6 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.8, i64 0, i64 0), %5 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str.9, i64 0, i64 0), %0 ]
%12 = call i32 @puts(i8* dereferenceable(1) %11)
ret i32 0
}