#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, int *);
int main() {
  int score;
  while (scanf("%d", &score) != EOF) {
    if (score > 100 || score < 0) {
      printf("Score is error!\n");
    } else {
      if (score <= 100 && score >= 90) {
        printf("A\n");
      } else if (score <= 89 && score >= 80) {
        printf("B\n");
      } else if (score <= 79 && score >= 70) {
        printf("C\n");
      } else if (score <= 69 && score >= 60) {
        printf("D\n");
      } else {
        printf("E\n");
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
je     122d <main+0x10d>
cmpl   $0x64,-0x8(%rbp)
jg     1163 <main+0x43>
cmpl   $0x0,-0x8(%rbp)
jge    1174 <main+0x54>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1228 <main+0x108>
cmpl   $0x64,-0x8(%rbp)
jg     1199 <main+0x79>
cmpl   $0x5a,-0x8(%rbp)
jl     1199 <main+0x79>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
jmp    1223 <main+0x103>
cmpl   $0x59,-0x8(%rbp)
jg     11be <main+0x9e>
cmpl   $0x50,-0x8(%rbp)
jl     11be <main+0x9e>
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
jmp    121e <main+0xfe>
cmpl   $0x4f,-0x8(%rbp)
jg     11e3 <main+0xc3>
cmpl   $0x46,-0x8(%rbp)
jl     11e3 <main+0xc3>
lea    0xe41(%rip),%rdi
call   1030 <printf@plt>
jmp    1219 <main+0xf9>
cmpl   $0x45,-0x8(%rbp)
jg     1208 <main+0xe8>
cmpl   $0x3c,-0x8(%rbp)
jl     1208 <main+0xe8>
lea    0xe1f(%rip),%rdi
call   1030 <printf@plt>
jmp    1214 <main+0xf4>
lea    0xe11(%rip),%rdi
call   1030 <printf@plt>
jmp    1219 <main+0xf9>
jmp    121e <main+0xfe>
jmp    1223 <main+0x103>
jmp    1228 <main+0x108>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea5(%rip),%r15
cmp    (%r15),%rax
jne    1159 <main+0x39>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xead(%rip),%r12
lea    0xe99(%rip),%r14
lea    0x4(%rsp),%rbx
lea    0xe98(%rip),%r13
lea    0xe8f(%rip),%rbp
jmp    1195 <main+0x75>
nopl   0x0(%rax)
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    (%r15),%rax
je     1148 <main+0x28>
mov    0x4(%rsp),%eax
mov    %r12,%rdi
cmp    $0x64,%eax
ja     1180 <main+0x60>
mov    %r13,%rdi
cmp    $0x59,%eax
ja     1180 <main+0x60>
mov    %rbp,%rdi
cmp    $0x4f,%eax
ja     1180 <main+0x60>
lea    0xe4f(%rip),%rdi
cmp    $0x45,%eax
ja     1180 <main+0x60>
lea    0xe41(%rip),%rdi
cmp    $0x3c,%eax
jae    1180 <main+0x60>
lea    0xe33(%rip),%rdi
jmp    1180 <main+0x60>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [17 x i8] c"Score is error!\0A\00"
@.str.2 = [3 x i8] c"A\0A\00"
@.str.3 = [3 x i8] c"B\0A\00"
@.str.4 = [3 x i8] c"C\0A\00"
@.str.5 = [3 x i8] c"D\0A\00"
@.str.6 = [3 x i8] c"E\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %53, %0
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %54
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 100
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10, %7
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %53
15: ; preds = %10
%16 = load i32, i32* %2
%17 = icmp sle i32 %16, 100
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i32, i32* %2
%20 = icmp sge i32 %19, 90
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %52
23: ; preds = %18, %15
%24 = load i32, i32* %2
%25 = icmp sle i32 %24, 89
br i1 %25, label %26, label %31
26: ; preds = %23
%27 = load i32, i32* %2
%28 = icmp sge i32 %27, 80
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %51
31: ; preds = %26, %23
%32 = load i32, i32* %2
%33 = icmp sle i32 %32, 79
br i1 %33, label %34, label %39
34: ; preds = %31
%35 = load i32, i32* %2
%36 = icmp sge i32 %35, 70
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %50
39: ; preds = %34, %31
%40 = load i32, i32* %2
%41 = icmp sle i32 %40, 69
br i1 %41, label %42, label %47
42: ; preds = %39
%43 = load i32, i32* %2
%44 = icmp sge i32 %43, 60
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %49
47: ; preds = %42, %39
%48 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %49
49: ; preds = %47, %45
br label %50
50: ; preds = %49, %37
br label %51
51: ; preds = %50, %29
br label %52
52: ; preds = %51, %21
br label %53
53: ; preds = %52, %13
br label %3
54: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@str = [2 x i8] c"E\00"
@str.7 = [2 x i8] c"D\00"
@str.8 = [2 x i8] c"C\00"
@str.9 = [2 x i8] c"B\00"
@str.10 = [2 x i8] c"A\00"
@str.11 = [16 x i8] c"Score is error!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %24, label %6
6: ; preds = %0, %18
%7 = load i32, i32* %1
%8 = icmp ugt i32 %7, 100
br i1 %8, label %18, label %9
9: ; preds = %6
%10 = icmp ugt i32 %7, 89
br i1 %10, label %18, label %11
11: ; preds = %9
%12 = icmp ugt i32 %7, 79
br i1 %12, label %18, label %13
13: ; preds = %11
%14 = icmp ugt i32 %7, 69
br i1 %14, label %18, label %15
15: ; preds = %13
%16 = icmp ugt i32 %7, 59
%17 = select i1 %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0)
br label %18
18: ; preds = %15, %13, %11, %9, %6
%19 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @str.11, i64 0, i64 0), %6 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.10, i64 0, i64 0), %9 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.9, i64 0, i64 0), %11 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.8, i64 0, i64 0), %13 ], [ %17, %15 ]
%20 = call i32 @puts(i8* dereferenceable(1) %19)
%21 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%22 = load i64, i64* @EOF
%23 = icmp eq i64 %21, %22
br i1 %23, label %24, label %6
24: ; preds = %18, %0
ret i32 0
}