#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int sw;
  printf("输入一个整数");
  scanf("%d", &sw);
  switch (sw) {
  case 1:
    puts("A");
    puts("B");
    break;
  case 2:
    puts("C");
  case 5:
    puts("D");
    break;
  case 6:
  case 7:
    puts("E");
    break;
  default:
    puts("F");
    break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed6(%rip),%rdi
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x6,%eax
ja     11cf <main+0x9f>
mov    -0x10(%rbp),%rax
lea    0xe85(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
jmp    11db <main+0xab>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe84(%rip),%rdi
call   1030 <puts@plt>
jmp    11db <main+0xab>
lea    0xe75(%rip),%rdi
call   1030 <puts@plt>
jmp    11db <main+0xab>
lea    0xe66(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee0(%rip),%rdi
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x6,%eax
ja     118c <main+0x5c>
lea    0xed3(%rip),%rbx
lea    0xe94(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xebe(%rip),%rbx
jmp    11a8 <main+0x78>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
jmp    11a8 <main+0x78>
lea    0xea9(%rip),%rbx
jmp    11a8 <main+0x78>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8c(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\95\B4\E6\95\B0\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"A\00"
@.str.3 = [2 x i8] c"B\00"
@.str.4 = [2 x i8] c"C\00"
@.str.5 = [2 x i8] c"D\00"
@.str.6 = [2 x i8] c"E\00"
@.str.7 = [2 x i8] c"F\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
switch i32 %5, label %15 [
i32 1, label %6
i32 2, label %9
i32 5, label %11
i32 6, label %13
i32 7, label %13
]
6: ; preds = %0
%7 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %17
9: ; preds = %0
%10 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %11
11: ; preds = %0, %9
%12 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %17
13: ; preds = %0, %0
%14 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %17
15: ; preds = %0
%16 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %17
17: ; preds = %15, %13, %11, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\95\B4\E6\95\B0\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"A\00"
@.str.3 = [2 x i8] c"B\00"
@.str.4 = [2 x i8] c"C\00"
@.str.5 = [2 x i8] c"D\00"
@.str.6 = [2 x i8] c"E\00"
@.str.7 = [2 x i8] c"F\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
switch i32 %5, label %11 [
i32 1, label %6
i32 2, label %8
i32 5, label %12
i32 6, label %10
i32 7, label %10
]
6: ; preds = %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %12
8: ; preds = %0
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %12
10: ; preds = %0, %0
br label %12
11: ; preds = %0
br label %12
12: ; preds = %8, %0, %11, %10, %6
%13 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), %11 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), %10 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %6 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), %0 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), %8 ]
%14 = call i32 @puts(i8* dereferenceable(1) %13)
ret i32 0
}