#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() {
  char grade;
  scanf("%c", &grade);
  switch (grade) {
  default:
    printf("잘못입력");
    break;
  case 'A':
    printf("매우잘함");
    break;
  case 'B':
    printf("잘함");
    break;
  case 'C':
    printf("보통임");
    break;
  case 'D':
    printf("노력요함");
    break;
  case 'F':
    printf("낙제");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1169 <main+0x49>
mov    -0x10(%rbp),%rax
lea    0xea0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    11ca <main+0xaa>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    11ca <main+0xaa>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
jmp    11ca <main+0xaa>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
jmp    11ca <main+0xaa>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
jmp    11ca <main+0xaa>
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    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
movsbq 0x7(%rsp),%rax
add    $0xffffffffffffffbf,%rax
cmp    $0x5,%eax
ja     1151 <main+0x31>
lea    0xef4(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1158 <main+0x38>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [13 x i8] c"\EC\9E\98\EB\AA\BB\EC\9E\85\EB\A0\A5\00"
@.str.2 = [13 x i8] c"\EB\A7\A4\EC\9A\B0\EC\9E\98\ED\95\A8\00"
@.str.3 = [7 x i8] c"\EC\9E\98\ED\95\A8\00"
@.str.4 = [10 x i8] c"\EB\B3\B4\ED\86\B5\EC\9E\84\00"
@.str.5 = [13 x i8] c"\EB\85\B8\EB\A0\A5\EC\9A\94\ED\95\A8\00"
@.str.6 = [7 x i8] c"\EB\82\99\EC\A0\9C\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %6 [
i32 65, label %8
i32 66, label %10
i32 67, label %12
i32 68, label %14
i32 70, label %16
]
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %18
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %18
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %18
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
br label %18
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %18
16: ; preds = %0
%17 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %18
18: ; preds = %16, %14, %12, %10, %8, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [13 x i8] c"\EC\9E\98\EB\AA\BB\EC\9E\85\EB\A0\A5\00"
@.str.2 = [13 x i8] c"\EB\A7\A4\EC\9A\B0\EC\9E\98\ED\95\A8\00"
@.str.3 = [7 x i8] c"\EC\9E\98\ED\95\A8\00"
@.str.4 = [10 x i8] c"\EB\B3\B4\ED\86\B5\EC\9E\84\00"
@.str.5 = [13 x i8] c"\EB\85\B8\EB\A0\A5\EC\9A\94\ED\95\A8\00"
@.str.6 = [7 x i8] c"\EB\82\99\EC\A0\9C\00"
@reltable.main = [6 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.2 to i64), i64 ptrtoint ([6 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.3 to i64), i64 ptrtoint ([6 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.4 to i64), i64 ptrtoint ([6 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.5 to i64), i64 ptrtoint ([6 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.1 to i64), i64 ptrtoint ([6 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.6 to i64), i64 ptrtoint ([6 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = add nsw i32 %4, -65
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = sext i32 %5 to i64
%9 = shl i64 %8, 2
%10 = call i8* @llvm.load.relative.i64(i8* bitcast ([6 x i32]* @reltable.main to i8*), i64 %9)
br label %11
11: ; preds = %7, %0
%12 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %0 ], [ %10, %7 ]
%13 = call i32 @printf(i8* dereferenceable(1) %12)
ret i32 0
}