#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 *, char *);
int main() {
  printf("1:c++");
  printf("2:java");
  printf("3:qie");
  char ch;
  scanf(" %c", &ch);
  switch (ch) {
  case 1:
    printf("1....c++");
    break;
  case 2:
    printf("2.....java");
    break;
  case 3:
    printf("3.....qie");
    break;
  default:
    printf(".......over.....");
  }
  printf("Good bye!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     119a <main+0x7a>
jmp    1178 <main+0x58>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     11ab <main+0x8b>
jmp    1189 <main+0x69>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     11bc <main+0x9c>
jmp    11cd <main+0xad>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
jmp    11d9 <main+0xb9>
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
jmp    11d9 <main+0xb9>
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
jmp    11d9 <main+0xb9>
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
movsbq 0x7(%rsp),%rax
add    $0xffffffffffffffff,%rax
cmp    $0x2,%eax
ja     1175 <main+0x55>
lea    0xee4(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    117c <main+0x5c>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1:c++\00"
@.str.1 = [7 x i8] c"2:java\00"
@.str.2 = [6 x i8] c"3:qie\00"
@.str.3 = [4 x i8] c" %c\00"
@.str.4 = [9 x i8] c"1....c++\00"
@.str.5 = [11 x i8] c"2.....java\00"
@.str.6 = [10 x i8] c"3.....qie\00"
@.str.7 = [17 x i8] c".......over.....\00"
@.str.8 = [10 x i8] c"Good bye!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
switch i32 %8, label %15 [
i32 1, label %9
i32 2, label %11
i32 3, label %13
]
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %17
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
br label %17
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
br label %17
15: ; preds = %0
%16 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
br label %17
17: ; preds = %15, %13, %11, %9
%18 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"1:c++\00"
@.str.1 = [7 x i8] c"2:java\00"
@.str.2 = [6 x i8] c"3:qie\00"
@.str.3 = [4 x i8] c" %c\00"
@.str.4 = [9 x i8] c"1....c++\00"
@.str.5 = [11 x i8] c"2.....java\00"
@.str.6 = [10 x i8] c"3.....qie\00"
@.str.7 = [17 x i8] c".......over.....\00"
@.str.8 = [10 x i8] c"Good bye!\00"
@reltable.main = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.4 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.5 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.6 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, -1
%9 = icmp ult i32 %8, 3
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = sext i32 %8 to i64
%12 = shl i64 %11, 2
%13 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.main to i8*), i64 %12)
br label %14
14: ; preds = %0, %10
%15 = phi i8* [ %13, %10 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), %0 ]
%16 = call i32 @printf(i8* dereferenceable(1) %15)
%17 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}