#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 printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int s;
  printf("과목의 점수를 입력하세요: ");
  scanf("%d", &s);
  switch (s / 10) {
  default:
    printf(s >= 90 ? "수" : "가");
    break;
  case 8:
    printf("우");
    break;
  case 7:
    printf("미");
    break;
  case 6:
    printf("양");
  }
  return printf("\n") * 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    0xee4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movslq -0x8(%rbp),%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
sub    $0x6,%eax
je     11da <main+0xba>
jmp    1174 <main+0x54>
mov    -0xc(%rbp),%eax
sub    $0x7,%eax
je     11c9 <main+0xa9>
jmp    1185 <main+0x65>
mov    -0xc(%rbp),%eax
sub    $0x8,%eax
je     11b8 <main+0x98>
jmp    1196 <main+0x76>
mov    -0x8(%rbp),%ecx
lea    0xe8d(%rip),%rdi
lea    0xe82(%rip),%rax
cmp    $0x5a,%ecx
cmovge %rax,%rdi
call   1030 <printf@plt>
jmp    11e6 <main+0xc6>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
jmp    11e6 <main+0xc6>
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
jmp    11e6 <main+0xc6>
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
imul   $0x0,%eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xee2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
sar    $0x22,%rdx
shr    $0x3f,%rcx
add    %edx,%ecx
add    $0xfffffffa,%ecx
cmp    $0x3,%ecx
jae    1182 <main+0x52>
movslq %ecx,%rax
lea    0xec7(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1197 <main+0x67>
cmp    $0x5a,%eax
lea    0xe9d(%rip),%rax
lea    0xe9a(%rip),%rdi
cmovge %rax,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"\EA\B3\BC\EB\AA\A9\EC\9D\98 \EC\A0\90\EC\88\98\EB\A5\BC \EC\9E\85\EB\A0\A5\ED\95\98\EC\84\B8\EC\9A\94: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"\EC\88\98\00"
@.str.3 = [4 x i8] c"\EA\B0\80\00"
@.str.4 = [4 x i8] c"\EC\9A\B0\00"
@.str.5 = [4 x i8] c"\EB\AF\B8\00"
@.str.6 = [4 x i8] c"\EC\96\91\00"
@.str.7 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 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
%6 = sdiv i32 %5, 10
switch i32 %6, label %7 [
i32 8, label %13
i32 7, label %15
i32 6, label %17
]
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp sge i32 %8, 90
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%12 = call i32 @printf(i8* %11)
br label %19
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %19
15: ; preds = %0
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %19
17: ; preds = %0
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %19
19: ; preds = %17, %15, %13, %7
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%21 = mul nsw i32 %20, 0
ret i32 %21
}

LLVM IR (-O2):
@.str = [38 x i8] c"\EA\B3\BC\EB\AA\A9\EC\9D\98 \EC\A0\90\EC\88\98\EB\A5\BC \EC\9E\85\EB\A0\A5\ED\95\98\EC\84\B8\EC\9A\94: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"\EC\88\98\00"
@.str.3 = [4 x i8] c"\EA\B0\80\00"
@.str.4 = [4 x i8] c"\EC\9A\B0\00"
@.str.5 = [4 x i8] c"\EB\AF\B8\00"
@.str.6 = [4 x i8] c"\EC\96\91\00"
@reltable.main = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.6 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.5 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.4 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 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
%6 = sdiv i32 %5, 10
%7 = add nsw i32 %6, -6
%8 = icmp ult i32 %7, 3
br i1 %8, label %12, label %9
9: ; preds = %0
%10 = icmp sgt i32 %5, 89
%11 = select i1 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
br label %16
12: ; preds = %0
%13 = sext i32 %7 to i64
%14 = shl i64 %13, 2
%15 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.main to i8*), i64 %14)
br label %16
16: ; preds = %12, %9
%17 = phi i8* [ %11, %9 ], [ %15, %12 ]
%18 = call i32 @printf(i8* dereferenceable(1) %17)
%19 = call i32 @putchar(i32 10)
ret i32 0
}