#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 *, int *);
int main() {
  int points, grade = 0;
  printf("Enter points: \n");
  scanf("%d", &points);
  if (points >= 0 && points <= 50)
    grade = 5;
  else if (points > 50 && points <= 60)
    grade = 6;
  else if (points > 60 && points <= 70)
    grade = 7;
  else if (points > 70 && points <= 80)
    grade = 8;
  else if (points > 80 && points <= 90)
    grade = 9;
  else if (points > 90 && points <= 100)
    grade = 10;
  else
    printf("Invalid value for points!\n");
  printf("Grade %d\n", grade);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jl     1174 <main+0x54>
cmpl   $0x32,-0x8(%rbp)
jg     1174 <main+0x54>
movl   $0x5,-0xc(%rbp)
jmp    123b <main+0x11b>
cmpl   $0x32,-0x8(%rbp)
jle    1194 <main+0x74>
cmpl   $0x3c,-0x8(%rbp)
jg     1194 <main+0x74>
movl   $0x6,-0xc(%rbp)
jmp    1236 <main+0x116>
cmpl   $0x3c,-0x8(%rbp)
jle    11b4 <main+0x94>
cmpl   $0x46,-0x8(%rbp)
jg     11b4 <main+0x94>
movl   $0x7,-0xc(%rbp)
jmp    1231 <main+0x111>
cmpl   $0x46,-0x8(%rbp)
jle    11d4 <main+0xb4>
cmpl   $0x50,-0x8(%rbp)
jg     11d4 <main+0xb4>
movl   $0x8,-0xc(%rbp)
jmp    122c <main+0x10c>
cmpl   $0x50,-0x8(%rbp)
jle    11f4 <main+0xd4>
cmpl   $0x5a,-0x8(%rbp)
jg     11f4 <main+0xd4>
movl   $0x9,-0xc(%rbp)
jmp    1227 <main+0x107>
cmpl   $0x5a,-0x8(%rbp)
jle    1214 <main+0xf4>
cmpl   $0x64,-0x8(%rbp)
jg     1214 <main+0xf4>
movl   $0xa,-0xc(%rbp)
jmp    1222 <main+0x102>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1227 <main+0x107>
jmp    122c <main+0x10c>
jmp    1231 <main+0x111>
jmp    1236 <main+0x116>
jmp    123b <main+0x11b>
mov    -0xc(%rbp),%esi
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
mov    $0x5,%esi
cmp    $0x33,%eax
jb     11ab <main+0x7b>
lea    -0x33(%rax),%ecx
mov    $0x6,%esi
cmp    $0xa,%ecx
jb     11ab <main+0x7b>
lea    -0x3d(%rax),%ecx
mov    $0x7,%esi
cmp    $0xa,%ecx
jb     11ab <main+0x7b>
lea    -0x47(%rax),%ecx
mov    $0x8,%esi
cmp    $0xa,%ecx
jb     11ab <main+0x7b>
lea    -0x51(%rax),%ecx
mov    $0x9,%esi
cmp    $0xa,%ecx
jb     11ab <main+0x7b>
add    $0xffffffa5,%eax
mov    $0xa,%esi
cmp    $0xa,%eax
jb     11ab <main+0x7b>
lea    0xe78(%rip),%rdi
call   1030 <puts@plt>
xor    %esi,%esi
lea    0xe51(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [10 x i8] c"Grade %d\0A\00"
@str = [15 x i8] c"Enter points: \00"
@str.4 = [26 x i8] c"Invalid value for points!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 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 ult i32 %5, 51
br i1 %6, label %24, label %7
7: ; preds = %0
%8 = add i32 %5, -51
%9 = icmp ult i32 %8, 10
br i1 %9, label %24, label %10
10: ; preds = %7
%11 = add i32 %5, -61
%12 = icmp ult i32 %11, 10
br i1 %12, label %24, label %13
13: ; preds = %10
%14 = add i32 %5, -71
%15 = icmp ult i32 %14, 10
br i1 %15, label %24, label %16
16: ; preds = %13
%17 = add i32 %5, -81
%18 = icmp ult i32 %17, 10
br i1 %18, label %24, label %19
19: ; preds = %16
%20 = add i32 %5, -91
%21 = icmp ult i32 %20, 10
br i1 %21, label %24, label %22
22: ; preds = %19
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.4, i64 0, i64 0))
br label %24
24: ; preds = %19, %16, %13, %10, %7, %0, %22
%25 = phi i32 [ 0, %22 ], [ 5, %0 ], [ 6, %7 ], [ 7, %10 ], [ 8, %13 ], [ 9, %16 ], [ 10, %19 ]
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %25)
ret i32 0
}