#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 EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int rawGrade;
  for (;;) {
    puts("Input your raw grade:");
    scanf("%d", &rawGrade);
    if (rawGrade >= 95)
      puts("CONGRATULATIONS! Your grade is 4.0");
    else if (rawGrade >= 90)
      puts("3.5");
    else if (rawGrade >= 85)
      puts("3.0");
    else if (rawGrade >= 80)
      puts("2.5");
    else if (rawGrade >= 75)
      puts("2.0");
    else if (rawGrade >= 70)
      puts("1.5");
    else if (rawGrade >= 65)
      puts("1.0");
    else if (rawGrade >= 0)
      puts("SORRY. YOU got 0.0. See you next term!");
    else
      break;
  }
  return EXIT_SUCCESS;
}


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    0xed4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x5f,-0x8(%rbp)
jl     1166 <main+0x46>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
jmp    124b <main+0x12b>
cmpl   $0x5a,-0x8(%rbp)
jl     1181 <main+0x61>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
jmp    1246 <main+0x126>
cmpl   $0x55,-0x8(%rbp)
jl     119c <main+0x7c>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
jmp    1241 <main+0x121>
cmpl   $0x50,-0x8(%rbp)
jl     11b7 <main+0x97>
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
jmp    123c <main+0x11c>
cmpl   $0x4b,-0x8(%rbp)
jl     11d2 <main+0xb2>
lea    0xe80(%rip),%rdi
call   1030 <puts@plt>
jmp    1237 <main+0x117>
cmpl   $0x46,-0x8(%rbp)
jl     11ed <main+0xcd>
lea    0xe69(%rip),%rdi
call   1030 <puts@plt>
jmp    1232 <main+0x112>
cmpl   $0x41,-0x8(%rbp)
jl     1208 <main+0xe8>
lea    0xe52(%rip),%rdi
call   1030 <puts@plt>
jmp    122d <main+0x10d>
cmpl   $0x0,-0x8(%rbp)
jl     1223 <main+0x103>
lea    0xe3b(%rip),%rdi
call   1030 <puts@plt>
jmp    1228 <main+0x108>
jmp    1250 <main+0x130>
jmp    122d <main+0x10d>
jmp    1232 <main+0x112>
jmp    1237 <main+0x117>
jmp    123c <main+0x11c>
jmp    1241 <main+0x121>
jmp    1246 <main+0x126>
jmp    124b <main+0x12b>
jmp    112f <main+0xf>
mov    0x2d89(%rip),%rax
mov    (%rax),%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),%r14
lea    0xedd(%rip),%r15
lea    0x4(%rsp),%r12
lea    0xed4(%rip),%rbx
lea    0xef0(%rip),%r13
lea    0xeed(%rip),%rbp
jmp    1165 <main+0x45>
cs nopw 0x0(%rax,%rax,1)
nop
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %rbx,%rdi
cmp    $0x5e,%eax
jg     1160 <main+0x40>
mov    %r13,%rdi
cmp    $0x59,%eax
jg     1160 <main+0x40>
mov    %rbp,%rdi
cmp    $0x54,%eax
jg     1160 <main+0x40>
lea    0xea9(%rip),%rdi
cmp    $0x4f,%eax
jg     1160 <main+0x40>
lea    0xea1(%rip),%rdi
cmp    $0x4a,%eax
jg     1160 <main+0x40>
lea    0xe99(%rip),%rdi
cmp    $0x45,%eax
jg     1160 <main+0x40>
lea    0xe91(%rip),%rdi
cmp    $0x40,%eax
jg     1160 <main+0x40>
lea    0xe89(%rip),%rdi
test   %eax,%eax
jns    1160 <main+0x40>
mov    0x2e0a(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Input your raw grade:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [35 x i8] c"CONGRATULATIONS! Your grade is 4.0\00"
@.str.3 = [4 x i8] c"3.5\00"
@.str.4 = [4 x i8] c"3.0\00"
@.str.5 = [4 x i8] c"2.5\00"
@.str.6 = [4 x i8] c"2.0\00"
@.str.7 = [4 x i8] c"1.5\00"
@.str.8 = [4 x i8] c"1.0\00"
@.str.9 = [39 x i8] c"SORRY. YOU got 0.0. See you next term!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %53, %0
%4 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 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, 95
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = call i32 @puts(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
br label %53
10: ; preds = %3
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 90
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %52
15: ; preds = %10
%16 = load i32, i32* %2
%17 = icmp sge i32 %16, 85
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %51
20: ; preds = %15
%21 = load i32, i32* %2
%22 = icmp sge i32 %21, 80
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %50
25: ; preds = %20
%26 = load i32, i32* %2
%27 = icmp sge i32 %26, 75
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %49
30: ; preds = %25
%31 = load i32, i32* %2
%32 = icmp sge i32 %31, 70
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %48
35: ; preds = %30
%36 = load i32, i32* %2
%37 = icmp sge i32 %36, 65
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %47
40: ; preds = %35
%41 = load i32, i32* %2
%42 = icmp sge i32 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %40
%44 = call i32 @puts(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0))
br label %46
45: ; preds = %40
br label %54
46: ; preds = %43
br label %47
47: ; preds = %46, %38
br label %48
48: ; preds = %47, %33
br label %49
49: ; preds = %48, %28
br label %50
50: ; preds = %49, %23
br label %51
51: ; preds = %50, %18
br label %52
52: ; preds = %51, %13
br label %53
53: ; preds = %52, %8
br label %3
54: ; preds = %45
%55 = load i32, i32* @EXIT_SUCCESS
ret i32 %55
}

LLVM IR (-O2):
@.str = [22 x i8] c"Input your raw grade:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [35 x i8] c"CONGRATULATIONS! Your grade is 4.0\00"
@.str.3 = [4 x i8] c"3.5\00"
@.str.4 = [4 x i8] c"3.0\00"
@.str.5 = [4 x i8] c"2.5\00"
@.str.6 = [4 x i8] c"2.0\00"
@.str.7 = [4 x i8] c"1.5\00"
@.str.8 = [4 x i8] c"1.0\00"
@.str.9 = [39 x i8] c"SORRY. YOU got 0.0. See you next term!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %22, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 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* %1)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 94
br i1 %7, label %22, label %8
8: ; preds = %3
%9 = icmp sgt i32 %6, 89
br i1 %9, label %22, label %10
10: ; preds = %8
%11 = icmp sgt i32 %6, 84
br i1 %11, label %22, label %12
12: ; preds = %10
%13 = icmp sgt i32 %6, 79
br i1 %13, label %22, label %14
14: ; preds = %12
%15 = icmp sgt i32 %6, 74
br i1 %15, label %22, label %16
16: ; preds = %14
%17 = icmp sgt i32 %6, 69
br i1 %17, label %22, label %18
18: ; preds = %16
%19 = icmp sgt i32 %6, 64
br i1 %19, label %22, label %20
20: ; preds = %18
%21 = icmp sgt i32 %6, -1
br i1 %21, label %22, label %25
22: ; preds = %20, %18, %16, %14, %12, %10, %8, %3
%23 = phi i8* [ getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %8 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), %10 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), %12 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), %14 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), %16 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), %18 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), %20 ]
%24 = call i32 @puts(i8* dereferenceable(1) %23)
br label %3
25: ; preds = %20
%26 = load i32, i32* @EXIT_SUCCESS
ret i32 %26
}