#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 *, float *);
int main() {
  float mark;
  printf("Enter student's mark: ");
  scanf("%f", &mark);
  if (mark >= 90 && mark <= 100)
    printf("Grade: O\n");
  else if (mark >= 80 && mark < 90)
    printf("Grade: E\n");
  else if (mark >= 70 && mark < 80)
    printf("Grade: A\n");
  else if (mark >= 60 && mark < 70)
    printf("Grade: B\n");
  else if (mark >= 50 && mark < 60)
    printf("Grade: C\n");
  else if (mark >= 0 && mark < 50)
    printf("Grade: F\n");
  else
    printf("Invalid mark entered\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xea8(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1184 <main+0x64>
movss  0xe9b(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1184 <main+0x64>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
jmp    12c1 <main+0x1a1>
movss  -0x8(%rbp),%xmm0
movss  0xe77(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     11bd <main+0x9d>
movss  0xe5e(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11bd <main+0x9d>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
jmp    12bc <main+0x19c>
movss  -0x8(%rbp),%xmm0
movss  0xe42(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     11f6 <main+0xd6>
movss  0xe2d(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11f6 <main+0xd6>
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
jmp    12b7 <main+0x197>
movss  -0x8(%rbp),%xmm0
movss  0xe0d(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     122f <main+0x10f>
movss  0xdf8(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    122f <main+0x10f>
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
jmp    12b2 <main+0x192>
movss  -0x8(%rbp),%xmm0
movss  0xdd8(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1268 <main+0x148>
movss  0xdc3(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1268 <main+0x148>
lea    0xdfc(%rip),%rdi
call   1030 <printf@plt>
jmp    12ad <main+0x18d>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     129c <main+0x17c>
movss  0xd93(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    129c <main+0x17c>
lea    0xdd2(%rip),%rdi
call   1030 <printf@plt>
jmp    12a8 <main+0x188>
lea    0xdcb(%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>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeeb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
ucomiss 0xea5(%rip),%xmm0
jb     1176 <main+0x46>
movss  0xe9f(%rip),%xmm1
ucomiss %xmm0,%xmm1
jb     1176 <main+0x46>
lea    0xf03(%rip),%rdi
jmp    121c <main+0xec>
ucomiss 0xe8b(%rip),%xmm0
jb     1198 <main+0x68>
movss  0xe79(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1198 <main+0x68>
lea    0xed8(%rip),%rdi
jmp    121c <main+0xec>
ucomiss 0xe6d(%rip),%xmm0
jb     11b7 <main+0x87>
movss  0xe5f(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    11b7 <main+0x87>
lea    0xead(%rip),%rdi
jmp    121c <main+0xec>
ucomiss 0xe52(%rip),%xmm0
jb     11d6 <main+0xa6>
movss  0xe44(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    11d6 <main+0xa6>
lea    0xe85(%rip),%rdi
jmp    121c <main+0xec>
ucomiss 0xe37(%rip),%xmm0
jb     11f5 <main+0xc5>
movss  0xe29(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    11f5 <main+0xc5>
lea    0xe5d(%rip),%rdi
jmp    121c <main+0xec>
movss  0xe17(%rip),%xmm1
ucomiss %xmm0,%xmm1
lea    0xe40(%rip),%rdi
lea    0xe24(%rip),%rax
cmovbe %rax,%rdi
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
cmovb  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Enter student's mark: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [10 x i8] c"Grade: O\0A\00"
@.str.3 = [10 x i8] c"Grade: E\0A\00"
@.str.4 = [10 x i8] c"Grade: A\0A\00"
@.str.5 = [10 x i8] c"Grade: B\0A\00"
@.str.6 = [10 x i8] c"Grade: C\0A\00"
@.str.7 = [10 x i8] c"Grade: F\0A\00"
@.str.8 = [22 x i8] c"Invalid mark entered\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 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), float* %2)
%5 = load float, float* %2
%6 = fcmp oge float %5, 9.000000e+01
br i1 %6, label %7, label %12
7: ; preds = %0
%8 = load float, float* %2
%9 = fcmp ole float %8, 1.000000e+02
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %59
12: ; preds = %7, %0
%13 = load float, float* %2
%14 = fcmp oge float %13, 8.000000e+01
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = load float, float* %2
%17 = fcmp olt float %16, 9.000000e+01
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %58
20: ; preds = %15, %12
%21 = load float, float* %2
%22 = fcmp oge float %21, 7.000000e+01
br i1 %22, label %23, label %28
23: ; preds = %20
%24 = load float, float* %2
%25 = fcmp olt float %24, 8.000000e+01
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
br label %57
28: ; preds = %23, %20
%29 = load float, float* %2
%30 = fcmp oge float %29, 6.000000e+01
br i1 %30, label %31, label %36
31: ; preds = %28
%32 = load float, float* %2
%33 = fcmp olt float %32, 7.000000e+01
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %56
36: ; preds = %31, %28
%37 = load float, float* %2
%38 = fcmp oge float %37, 5.000000e+01
br i1 %38, label %39, label %44
39: ; preds = %36
%40 = load float, float* %2
%41 = fcmp olt float %40, 6.000000e+01
br i1 %41, label %42, label %44
42: ; preds = %39
%43 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
br label %55
44: ; preds = %39, %36
%45 = load float, float* %2
%46 = fcmp oge float %45, 0.000000e+00
br i1 %46, label %47, label %52
47: ; preds = %44
%48 = load float, float* %2
%49 = fcmp olt float %48, 5.000000e+01
br i1 %49, label %50, label %52
50: ; preds = %47
%51 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %54
52: ; preds = %47, %44
%53 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
br label %54
54: ; preds = %52, %50
br label %55
55: ; preds = %54, %42
br label %56
56: ; preds = %55, %34
br label %57
57: ; preds = %56, %26
br label %58
58: ; preds = %57, %18
br label %59
59: ; preds = %58, %10
%60 = load i32, i32* %1
ret i32 %60
}

LLVM IR (-O2):
@.str = [23 x i8] c"Enter student's mark: \00"
@.str.1 = [3 x i8] c"%f\00"
@str = [21 x i8] c"Invalid mark entered\00"
@str.9 = [9 x i8] c"Grade: F\00"
@str.10 = [9 x i8] c"Grade: C\00"
@str.11 = [9 x i8] c"Grade: B\00"
@str.12 = [9 x i8] c"Grade: A\00"
@str.13 = [9 x i8] c"Grade: E\00"
@str.14 = [9 x i8] c"Grade: O\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 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), float* %1)
%5 = load float, float* %1
%6 = fcmp oge float %5, 9.000000e+01
%7 = fcmp ole float %5, 1.000000e+02
%8 = and i1 %6, %7
br i1 %8, label %30, label %9
9: ; preds = %0
%10 = fcmp oge float %5, 8.000000e+01
%11 = fcmp olt float %5, 9.000000e+01
%12 = and i1 %10, %11
br i1 %12, label %30, label %13
13: ; preds = %9
%14 = fcmp oge float %5, 7.000000e+01
%15 = fcmp olt float %5, 8.000000e+01
%16 = and i1 %14, %15
br i1 %16, label %30, label %17
17: ; preds = %13
%18 = fcmp oge float %5, 6.000000e+01
%19 = fcmp olt float %5, 7.000000e+01
%20 = and i1 %18, %19
br i1 %20, label %30, label %21
21: ; preds = %17
%22 = fcmp oge float %5, 5.000000e+01
%23 = fcmp olt float %5, 6.000000e+01
%24 = and i1 %22, %23
br i1 %24, label %30, label %25
25: ; preds = %21
%26 = fcmp oge float %5, 0.000000e+00
%27 = fcmp olt float %5, 5.000000e+01
%28 = and i1 %26, %27
%29 = select i1 %28, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0)
br label %30
30: ; preds = %25, %21, %17, %13, %9, %0
%31 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.14, i64 0, i64 0), %0 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.13, i64 0, i64 0), %9 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.12, i64 0, i64 0), %13 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.11, i64 0, i64 0), %17 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.10, i64 0, i64 0), %21 ], [ %29, %25 ]
%32 = call i32 @puts(i8* dereferenceable(1) %31)
ret i32 0
}