#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 *);
void main() {
  int num;
  printf("Please enter the numerical grade: ");
  scanf("%d", &num);
  if ((num > 100) || (num < 0))
    printf("The number you entered is out of the range of 100-0.");
  else if (num < 60)
    printf("F");
  else if (num < 63)
    printf("D-");
  else if (num < 67)
    printf("D");
  else if (num < 70)
    printf("D+");
  else if (num < 73)
    printf("C-");
  else if (num < 77)
    printf("C");
  else if (num < 80)
    printf("C+");
  else if (num < 83)
    printf("B-");
  else if (num < 87)
    printf("B");
  else if (num < 90)
    printf("B+");
  else if (num < 93)
    printf("A-");
  else if (num < 101)
    printf("A");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x64,-0x4(%rbp)
jg     1158 <main+0x38>
cmpl   $0x0,-0x4(%rbp)
jge    1169 <main+0x49>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
jmp    12e4 <main+0x1c4>
cmpl   $0x3c,-0x4(%rbp)
jge    1184 <main+0x64>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
jmp    12df <main+0x1bf>
cmpl   $0x3f,-0x4(%rbp)
jge    119f <main+0x7f>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
jmp    12da <main+0x1ba>
cmpl   $0x43,-0x4(%rbp)
jge    11ba <main+0x9a>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
jmp    12d5 <main+0x1b5>
cmpl   $0x46,-0x4(%rbp)
jge    11d5 <main+0xb5>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    12d0 <main+0x1b0>
cmpl   $0x49,-0x4(%rbp)
jge    11f0 <main+0xd0>
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
jmp    12cb <main+0x1ab>
cmpl   $0x4d,-0x4(%rbp)
jge    120b <main+0xeb>
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
jmp    12c6 <main+0x1a6>
cmpl   $0x50,-0x4(%rbp)
jge    1226 <main+0x106>
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
jmp    12c1 <main+0x1a1>
cmpl   $0x53,-0x4(%rbp)
jge    1241 <main+0x121>
lea    0xe36(%rip),%rdi
call   1030 <printf@plt>
jmp    12bc <main+0x19c>
cmpl   $0x57,-0x4(%rbp)
jge    125c <main+0x13c>
lea    0xe1e(%rip),%rdi
call   1030 <printf@plt>
jmp    12b7 <main+0x197>
cmpl   $0x5a,-0x4(%rbp)
jge    1277 <main+0x157>
lea    0xe05(%rip),%rdi
call   1030 <printf@plt>
jmp    12b2 <main+0x192>
cmpl   $0x5d,-0x4(%rbp)
jge    1292 <main+0x172>
lea    0xded(%rip),%rdi
call   1030 <printf@plt>
jmp    12ad <main+0x18d>
cmpl   $0x65,-0x4(%rbp)
jge    12a8 <main+0x188>
lea    0xdd5(%rip),%rdi
call   1030 <printf@plt>
jmp    12ad <main+0x18d>
jmp    12b2 <main+0x192>
jmp    12b7 <main+0x197>
jmp    12bc <main+0x19c>
jmp    12c1 <main+0x1a1>
jmp    12c6 <main+0x1a6>
jmp    12cb <main+0x1ab>
jmp    12d0 <main+0x1b0>
jmp    12d5 <main+0x1b5>
jmp    12da <main+0x1ba>
jmp    12df <main+0x1bf>
jmp    12e4 <main+0x1c4>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x65,%eax
jb     1163 <main+0x33>
lea    0xec8(%rip),%rdi
jmp    11f8 <main+0xc8>
cmp    $0x3b,%eax
ja     116f <main+0x3f>
mov    $0x46,%edi
jmp    1187 <main+0x57>
cmp    $0x3e,%eax
ja     117d <main+0x4d>
lea    0xee0(%rip),%rdi
jmp    11f8 <main+0xc8>
cmp    $0x42,%eax
ja     118e <main+0x5e>
mov    $0x44,%edi
call   1030 <putchar@plt>
pop    %rax
ret
cmp    $0x45,%eax
ja     119c <main+0x6c>
lea    0xec4(%rip),%rdi
jmp    11f8 <main+0xc8>
cmp    $0x48,%eax
ja     11aa <main+0x7a>
lea    0xeb9(%rip),%rdi
jmp    11f8 <main+0xc8>
cmp    $0x4c,%eax
ja     11b6 <main+0x86>
mov    $0x43,%edi
jmp    1187 <main+0x57>
cmp    $0x4f,%eax
ja     11c4 <main+0x94>
lea    0xea2(%rip),%rdi
jmp    11f8 <main+0xc8>
cmp    $0x52,%eax
ja     11d2 <main+0xa2>
lea    0xe97(%rip),%rdi
jmp    11f8 <main+0xc8>
cmp    $0x56,%eax
ja     11de <main+0xae>
mov    $0x42,%edi
jmp    1187 <main+0x57>
cmp    $0x59,%eax
ja     11ec <main+0xbc>
lea    0xe80(%rip),%rdi
jmp    11f8 <main+0xc8>
cmp    $0x5c,%eax
ja     11ff <main+0xcf>
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
pop    %rax
ret
mov    $0x41,%edi
jmp    1187 <main+0x57>

LLVM IR (-O0):
@.str = [35 x i8] c"Please enter the numerical grade: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [53 x i8] c"The number you entered is out of the range of 100-0.\00"
@.str.3 = [2 x i8] c"F\00"
@.str.4 = [3 x i8] c"D-\00"
@.str.5 = [2 x i8] c"D\00"
@.str.6 = [3 x i8] c"D+\00"
@.str.7 = [3 x i8] c"C-\00"
@.str.8 = [2 x i8] c"C\00"
@.str.9 = [3 x i8] c"C+\00"
@.str.10 = [3 x i8] c"B-\00"
@.str.11 = [2 x i8] c"B\00"
@.str.12 = [3 x i8] c"B+\00"
@.str.13 = [3 x i8] c"A-\00"
@.str.14 = [2 x i8] c"A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 100
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6, %0
%10 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
br label %83
11: ; preds = %6
%12 = load i32, i32* %1
%13 = icmp slt i32 %12, 60
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %82
16: ; preds = %11
%17 = load i32, i32* %1
%18 = icmp slt i32 %17, 63
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %81
21: ; preds = %16
%22 = load i32, i32* %1
%23 = icmp slt i32 %22, 67
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %80
26: ; preds = %21
%27 = load i32, i32* %1
%28 = icmp slt i32 %27, 70
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %79
31: ; preds = %26
%32 = load i32, i32* %1
%33 = icmp slt i32 %32, 73
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %78
36: ; preds = %31
%37 = load i32, i32* %1
%38 = icmp slt i32 %37, 77
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %77
41: ; preds = %36
%42 = load i32, i32* %1
%43 = icmp slt i32 %42, 80
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
br label %76
46: ; preds = %41
%47 = load i32, i32* %1
%48 = icmp slt i32 %47, 83
br i1 %48, label %49, label %51
49: ; preds = %46
%50 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
br label %75
51: ; preds = %46
%52 = load i32, i32* %1
%53 = icmp slt i32 %52, 87
br i1 %53, label %54, label %56
54: ; preds = %51
%55 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %74
56: ; preds = %51
%57 = load i32, i32* %1
%58 = icmp slt i32 %57, 90
br i1 %58, label %59, label %61
59: ; preds = %56
%60 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
br label %73
61: ; preds = %56
%62 = load i32, i32* %1
%63 = icmp slt i32 %62, 93
br i1 %63, label %64, label %66
64: ; preds = %61
%65 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %72
66: ; preds = %61
%67 = load i32, i32* %1
%68 = icmp slt i32 %67, 101
br i1 %68, label %69, label %71
69: ; preds = %66
%70 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
br label %71
71: ; preds = %69, %66
br label %72
72: ; preds = %71, %64
br label %73
73: ; preds = %72, %59
br label %74
74: ; preds = %73, %54
br label %75
75: ; preds = %74, %49
br label %76
76: ; preds = %75, %44
br label %77
77: ; preds = %76, %39
br label %78
78: ; preds = %77, %34
br label %79
79: ; preds = %78, %29
br label %80
80: ; preds = %79, %24
br label %81
81: ; preds = %80, %19
br label %82
82: ; preds = %81, %14
br label %83
83: ; preds = %82, %9
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Please enter the numerical grade: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [53 x i8] c"The number you entered is out of the range of 100-0.\00"
@.str.4 = [3 x i8] c"D-\00"
@.str.6 = [3 x i8] c"D+\00"
@.str.7 = [3 x i8] c"C-\00"
@.str.9 = [3 x i8] c"C+\00"
@.str.10 = [3 x i8] c"B-\00"
@.str.12 = [3 x i8] c"B+\00"
@.str.13 = [3 x i8] c"A-\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 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 %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
br label %55
9: ; preds = %0
%10 = icmp ult i32 %5, 60
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = call i32 @putchar(i32 70)
br label %55
13: ; preds = %9
%14 = icmp ult i32 %5, 63
br i1 %14, label %15, label %17
15: ; preds = %13
%16 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %55
17: ; preds = %13
%18 = icmp ult i32 %5, 67
br i1 %18, label %19, label %21
19: ; preds = %17
%20 = call i32 @putchar(i32 68)
br label %55
21: ; preds = %17
%22 = icmp ult i32 %5, 70
br i1 %22, label %23, label %25
23: ; preds = %21
%24 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %55
25: ; preds = %21
%26 = icmp ult i32 %5, 73
br i1 %26, label %27, label %29
27: ; preds = %25
%28 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %55
29: ; preds = %25
%30 = icmp ult i32 %5, 77
br i1 %30, label %31, label %33
31: ; preds = %29
%32 = call i32 @putchar(i32 67)
br label %55
33: ; preds = %29
%34 = icmp ult i32 %5, 80
br i1 %34, label %35, label %37
35: ; preds = %33
%36 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
br label %55
37: ; preds = %33
%38 = icmp ult i32 %5, 83
br i1 %38, label %39, label %41
39: ; preds = %37
%40 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
br label %55
41: ; preds = %37
%42 = icmp ult i32 %5, 87
br i1 %42, label %43, label %45
43: ; preds = %41
%44 = call i32 @putchar(i32 66)
br label %55
45: ; preds = %41
%46 = icmp ult i32 %5, 90
br i1 %46, label %47, label %49
47: ; preds = %45
%48 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
br label %55
49: ; preds = %45
%50 = icmp ult i32 %5, 93
br i1 %50, label %51, label %53
51: ; preds = %49
%52 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %55
53: ; preds = %49
%54 = call i32 @putchar(i32 65)
br label %55
55: ; preds = %11, %19, %27, %35, %43, %51, %53, %47, %39, %31, %23, %15, %7
ret void
}