#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 *, double *);
int main() {
  double grade;
  scanf("%lf", &grade);
  switch ((int)grade) {
  default:
    printf("다음 학기에 재수강하세요.");
    break;
  case 4:
    printf("장학금을 받아가세요.");
    break;
  case 3:
    printf("다음 학기를 준비하세요.");
    break;
  case 2:
    printf("계절 학기에 등록하세요.");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x2,%eax
je     11aa <main+0x8a>
jmp    1155 <main+0x35>
mov    -0x14(%rbp),%eax
sub    $0x3,%eax
je     1199 <main+0x79>
jmp    1166 <main+0x46>
mov    -0x14(%rbp),%eax
sub    $0x4,%eax
je     1188 <main+0x68>
jmp    1177 <main+0x57>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
jmp    11b6 <main+0x96>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    11b6 <main+0x96>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    11b6 <main+0x96>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cvttsd2si (%rsp),%eax
add    $0xfffffffe,%eax
cmp    $0x2,%eax
ja     114f <main+0x2f>
cltq
lea    0xf46(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1156 <main+0x36>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [37 x i8] c"\EB\8B\A4\EC\9D\8C \ED\95\99\EA\B8\B0\EC\97\90 \EC\9E\AC\EC\88\98\EA\B0\95\ED\95\98\EC\84\B8\EC\9A\94.\00"
@.str.2 = [30 x i8] c"\EC\9E\A5\ED\95\99\EA\B8\88\EC\9D\84 \EB\B0\9B\EC\95\84\EA\B0\80\EC\84\B8\EC\9A\94.\00"
@.str.3 = [34 x i8] c"\EB\8B\A4\EC\9D\8C \ED\95\99\EA\B8\B0\EB\A5\BC \EC\A4\80\EB\B9\84\ED\95\98\EC\84\B8\EC\9A\94.\00"
@.str.4 = [34 x i8] c"\EA\B3\84\EC\A0\88 \ED\95\99\EA\B8\B0\EC\97\90 \EB\93\B1\EB\A1\9D\ED\95\98\EC\84\B8\EC\9A\94.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%4 = load double, double* %2
%5 = fptosi double %4 to i32
switch i32 %5, label %6 [
i32 4, label %8
i32 3, label %10
i32 2, label %12
]
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
br label %14
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
br label %14
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
br label %14
14: ; preds = %12, %10, %8, %6
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [37 x i8] c"\EB\8B\A4\EC\9D\8C \ED\95\99\EA\B8\B0\EC\97\90 \EC\9E\AC\EC\88\98\EA\B0\95\ED\95\98\EC\84\B8\EC\9A\94.\00"
@.str.2 = [30 x i8] c"\EC\9E\A5\ED\95\99\EA\B8\88\EC\9D\84 \EB\B0\9B\EC\95\84\EA\B0\80\EC\84\B8\EC\9A\94.\00"
@.str.3 = [34 x i8] c"\EB\8B\A4\EC\9D\8C \ED\95\99\EA\B8\B0\EB\A5\BC \EC\A4\80\EB\B9\84\ED\95\98\EC\84\B8\EC\9A\94.\00"
@.str.4 = [34 x i8] c"\EA\B3\84\EC\A0\88 \ED\95\99\EA\B8\B0\EC\97\90 \EB\93\B1\EB\A1\9D\ED\95\98\EC\84\B8\EC\9A\94.\00"
@reltable.main = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([34 x i8]* @.str.4 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([34 x i8]* @.str.3 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([30 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fptosi double %4 to i32
%6 = add i32 %5, -2
%7 = icmp ult i32 %6, 3
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = sext i32 %6 to i64
%10 = shl i64 %9, 2
%11 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.main to i8*), i64 %10)
br label %12
12: ; preds = %8, %0
%13 = phi i8* [ getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), %0 ], [ %11, %8 ]
%14 = call i32 @printf(i8* dereferenceable(1) %13)
ret i32 0
}