#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;
  }
  if (score >= 60) {
    if (score >= 70) {
      if (score >= 80) {
        if (score >= 90)
          puts("A");
        else
          puts("B");
      } else
        puts("C");
    } else
      puts("D");
  } else
    puts("NO pass!");
  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    11f6 <main+0xd6>
cmpl   $0x3c,-0x8(%rbp)
jl     11e3 <main+0xc3>
cmpl   $0x46,-0x8(%rbp)
jl     11d2 <main+0xb2>
cmpl   $0x50,-0x8(%rbp)
jl     11c1 <main+0xa1>
cmpl   $0x5a,-0x8(%rbp)
jl     11b0 <main+0x90>
lea    0xe7b(%rip),%rdi
call   1030 <puts@plt>
jmp    11bc <main+0x9c>
lea    0xe6c(%rip),%rdi
call   1030 <puts@plt>
jmp    11cd <main+0xad>
lea    0xe5d(%rip),%rdi
call   1030 <puts@plt>
jmp    11de <main+0xbe>
lea    0xe4e(%rip),%rdi
call   1030 <puts@plt>
jmp    11ef <main+0xcf>
lea    0xe3f(%rip),%rdi
call   1030 <puts@plt>
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
jb     1181 <main+0x61>
cmp    $0x46,%eax
jb     118a <main+0x6a>
cmp    $0x50,%eax
jb     1193 <main+0x73>
cmp    $0x5a,%eax
lea    0xead(%rip),%rax
lea    0xea8(%rip),%rdi
cmovae %rax,%rdi
jmp    119a <main+0x7a>
lea    0xea1(%rip),%rdi
jmp    119a <main+0x7a>
lea    0xe96(%rip),%rdi
jmp    119a <main+0x7a>
lea    0xe8b(%rip),%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 = [12 x i8] c"input error\00"
@.str.3 = [2 x i8] c"A\00"
@.str.4 = [2 x i8] c"B\00"
@.str.5 = [2 x i8] c"C\00"
@.str.6 = [2 x i8] c"D\00"
@.str.7 = [9 x i8] c"NO pass!\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 ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %1
br label %38
12: ; preds = %7
%13 = load i32, i32* %2
%14 = icmp sge i32 %13, 60
br i1 %14, label %15, label %35
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp sge i32 %16, 70
br i1 %17, label %18, label %32
18: ; preds = %15
%19 = load i32, i32* %2
%20 = icmp sge i32 %19, 80
br i1 %20, label %21, label %29
21: ; preds = %18
%22 = load i32, i32* %2
%23 = icmp sge i32 %22, 90
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %28
26: ; preds = %21
%27 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %28
28: ; preds = %26, %24
br label %31
29: ; preds = %18
%30 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %31
31: ; preds = %29, %28
br label %34
32: ; preds = %15
%33 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %34
34: ; preds = %32, %31
br label %37
35: ; preds = %12
%36 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %37
37: ; preds = %35, %34
store i32 0, i32* %1
br label %38
38: ; preds = %37, %10
%39 = load i32, i32* %1
ret i32 %39
}

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