#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int score;
  puts("input your score:");
  scanf("%d", &score);
  if (score < 0 || score > 100) {
    puts("input error!");
    return -1;
  } else if (score < 60)
    puts("NO PASS!");
  else if (score < 70)
    puts("D");
  else if (score < 80)
    puts("C");
  else if (score < 90)
    puts("B");
  else
    puts("A");
  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 <puts@plt>
lea    0xed0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jl     115f <main+0x3f>
cmpl   $0x64,-0x8(%rbp)
jle    1177 <main+0x57>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    120a <main+0xea>
cmpl   $0x3c,-0x8(%rbp)
jge    1192 <main+0x72>
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
jmp    11fe <main+0xde>
cmpl   $0x46,-0x8(%rbp)
jge    11ad <main+0x8d>
lea    0xe88(%rip),%rdi
call   1030 <puts@plt>
jmp    11f9 <main+0xd9>
cmpl   $0x50,-0x8(%rbp)
jge    11c8 <main+0xa8>
lea    0xe6f(%rip),%rdi
call   1030 <puts@plt>
jmp    11f4 <main+0xd4>
cmpl   $0x5a,-0x8(%rbp)
jge    11e3 <main+0xc3>
lea    0xe56(%rip),%rdi
call   1030 <puts@plt>
jmp    11ef <main+0xcf>
lea    0xe47(%rip),%rdi
call   1030 <puts@plt>
jmp    11f4 <main+0xd4>
jmp    11f9 <main+0xd9>
jmp    11fe <main+0xde>
jmp    1203 <main+0xe3>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeda(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x64,%eax
jbe    1159 <main+0x39>
mov    $0xffffffff,%ebx
lea    0xebe(%rip),%rdi
jmp    119a <main+0x7a>
xor    %ebx,%ebx
cmp    $0x3c,%eax
jae    1169 <main+0x49>
lea    0xebb(%rip),%rdi
jmp    119a <main+0x7a>
cmp    $0x46,%eax
jae    1177 <main+0x57>
lea    0xeb6(%rip),%rdi
jmp    119a <main+0x7a>
cmp    $0x50,%eax
jae    1185 <main+0x65>
lea    0xeaa(%rip),%rdi
jmp    119a <main+0x7a>
cmp    $0x5a,%eax
lea    0xea0(%rip),%rax
lea    0xe9b(%rip),%rdi
cmovb  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"input your score:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"input error!\00"
@.str.3 = [9 x i8] c"NO PASS!\00"
@.str.4 = [2 x i8] c"D\00"
@.str.5 = [2 x i8] c"C\00"
@.str.6 = [2 x i8] c"B\00"
@.str.7 = [2 x i8] c"A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 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 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 100
br i1 %9, label %10, label %12
10: ; preds = %7, %0
%11 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %1
br label %39
12: ; preds = %7
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 60
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %37
17: ; preds = %12
%18 = load i32, i32* %2
%19 = icmp slt i32 %18, 70
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %36
22: ; preds = %17
%23 = load i32, i32* %2
%24 = icmp slt i32 %23, 80
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %35
27: ; preds = %22
%28 = load i32, i32* %2
%29 = icmp slt i32 %28, 90
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %34
32: ; preds = %27
%33 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %34
34: ; preds = %32, %30
br label %35
35: ; preds = %34, %25
br label %36
36: ; preds = %35, %20
br label %37
37: ; preds = %36, %15
br label %38
38: ; preds = %37
store i32 0, i32* %1
br label %39
39: ; preds = %38, %10
%40 = load i32, i32* %1
ret i32 %40
}

LLVM IR (-O2):
@.str = [18 x i8] c"input your score:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"input error!\00"
@.str.3 = [9 x i8] c"NO PASS!\00"
@.str.4 = [2 x i8] c"D\00"
@.str.5 = [2 x i8] c"C\00"
@.str.6 = [2 x i8] c"B\00"
@.str.7 = [2 x i8] c"A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 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 = icmp ugt i32 %5, 100
br i1 %6, label %16, label %7
7: ; preds = %0
%8 = icmp ult i32 %5, 60
br i1 %8, label %16, label %9
9: ; preds = %7
%10 = icmp ult i32 %5, 70
br i1 %10, label %16, label %11
11: ; preds = %9
%12 = icmp ult i32 %5, 80
br i1 %12, label %16, label %13
13: ; preds = %11
%14 = icmp ult i32 %5, 90
%15 = select i1 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0)
br label %16
16: ; preds = %13, %11, %9, %7, %0
%17 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), %0 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), %7 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), %9 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), %11 ], [ %15, %13 ]
%18 = phi i32 [ -1, %0 ], [ 0, %7 ], [ 0, %9 ], [ 0, %11 ], [ 0, %13 ]
%19 = call i32 @puts(i8* dereferenceable(1) %17)
ret i32 %18
}