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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     1229 <main+0x109>
cmpl   $0x64,-0x8(%rbp)
jle    1178 <main+0x58>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
jmp    1224 <main+0x104>
cmpl   $0x5a,-0x8(%rbp)
jle    1193 <main+0x73>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
jmp    121f <main+0xff>
cmpl   $0x50,-0x8(%rbp)
jle    11ae <main+0x8e>
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
jmp    121a <main+0xfa>
cmpl   $0x46,-0x8(%rbp)
jle    11c9 <main+0xa9>
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
jmp    1215 <main+0xf5>
cmpl   $0x3c,-0x8(%rbp)
jle    11e4 <main+0xc4>
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
jmp    1210 <main+0xf0>
cmpl   $0x0,-0x8(%rbp)
jle    11ff <main+0xdf>
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
jmp    120b <main+0xeb>
lea    0xdfd(%rip),%rdi
call   1030 <printf@plt>
jmp    1210 <main+0xf0>
jmp    1215 <main+0xf5>
jmp    121a <main+0xfa>
jmp    121f <main+0xff>
jmp    1224 <main+0x104>
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
mov    0x2eb6(%rip),%r15
mov    (%r15),%rbx
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmp    %rax,%rbx
jne    115c <main+0x3c>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xeaa(%rip),%r12
lea    0xe96(%rip),%r14
lea    0x4(%rsp),%rbx
lea    0xe95(%rip),%r13
jmp    1198 <main+0x78>
nopl   0x0(%rax,%rax,1)
call   1030 <puts@plt>
mov    (%r15),%rbp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    %rax,%rbp
je     114b <main+0x2b>
mov    0x4(%rsp),%eax
mov    %r12,%rdi
cmp    $0x64,%eax
jg     1180 <main+0x60>
mov    %r13,%rdi
cmp    $0x5a,%eax
jg     1180 <main+0x60>
lea    0xe56(%rip),%rdi
cmp    $0x50,%eax
jg     1180 <main+0x60>
lea    0xe48(%rip),%rdi
cmp    $0x46,%eax
jg     1180 <main+0x60>
lea    0xe3a(%rip),%rdi
cmp    $0x3c,%eax
jg     1180 <main+0x60>
lea    0xe2c(%rip),%rdi
test   %eax,%eax
jg     1180 <main+0x60>
mov    %r12,%rdi
jmp    1180 <main+0x60>

LLVM IR (-O0):
@EOF = global i64 0
@.str = [3 x i8] c"%d\00"
@.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 = %44, %0
%4 = load i64, i64* @EOF
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %45
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 100
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %44
12: ; preds = %7
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 90
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %43
17: ; preds = %12
%18 = load i32, i32* %2
%19 = icmp sgt i32 %18, 80
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %42
22: ; preds = %17
%23 = load i32, i32* %2
%24 = icmp sgt i32 %23, 70
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %41
27: ; preds = %22
%28 = load i32, i32* %2
%29 = icmp sgt i32 %28, 60
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %40
32: ; preds = %27
%33 = load i32, i32* %2
%34 = icmp sgt i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %39
37: ; preds = %32
%38 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %39
39: ; preds = %37, %35
br label %40
40: ; preds = %39, %30
br label %41
41: ; preds = %40, %25
br label %42
42: ; preds = %41, %20
br label %43
43: ; preds = %42, %15
br label %44
44: ; preds = %43, %10
br label %3
45: ; preds = %3
ret i32 0
}

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