#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 *, char);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int marks;
  char gr = 't';
  puts("Enter Marks of the student: ");
  scanf("%d", &marks);
  gr = (marks - 80) >= 0   ? 'A'
       : (marks - 70) >= 0 ? 'B'
       : (marks - 50) >= 0 ? 'C'
       : (marks - 30) >= 0 ? 'D'
                           : 'F';
  printf("Your Grade is: %c", gr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x74,-0x9(%rbp)
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
sub    $0x50,%eax
cmp    $0x0,%eax
jl     117b <main+0x4b>
mov    $0x41,%eax
mov    %eax,-0x10(%rbp)
jmp    11d8 <main+0xa8>
mov    -0x8(%rbp),%eax
sub    $0x46,%eax
cmp    $0x0,%eax
jl     1197 <main+0x67>
mov    $0x42,%eax
mov    %eax,-0x14(%rbp)
jmp    11d2 <main+0xa2>
mov    -0x8(%rbp),%eax
sub    $0x32,%eax
cmp    $0x0,%eax
jl     11b3 <main+0x83>
mov    $0x43,%eax
mov    %eax,-0x18(%rbp)
jmp    11cc <main+0x9c>
mov    -0x8(%rbp),%edx
sub    $0x1e,%edx
mov    $0x46,%eax
mov    $0x44,%ecx
cmp    $0x0,%edx
cmovge %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,-0x9(%rbp)
lea    0xe3b(%rip),%rdi
movsbl -0x9(%rbp),%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%ecx
mov    $0x41,%al
cmp    $0x4f,%ecx
jg     1171 <main+0x41>
mov    $0x42,%al
cmp    $0x45,%ecx
jg     1171 <main+0x41>
mov    $0x43,%al
cmp    $0x31,%ecx
jg     1171 <main+0x41>
cmp    $0x1e,%ecx
setl   %al
add    %al,%al
or     $0x44,%al
movzbl %al,%esi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Enter Marks of the student: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"Your Grade is: %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i8 116, i8* %3
%4 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 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 = sub nsw i32 %6, 80
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
br label %30
10: ; preds = %0
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 70
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
br label %28
15: ; preds = %10
%16 = load i32, i32* %2
%17 = sub nsw i32 %16, 50
%18 = icmp sge i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %15
br label %26
20: ; preds = %15
%21 = load i32, i32* %2
%22 = sub nsw i32 %21, 30
%23 = icmp sge i32 %22, 0
%24 = zext i1 %23 to i64
%25 = select i1 %23, i32 68, i32 70
br label %26
26: ; preds = %20, %19
%27 = phi i32 [ 67, %19 ], [ %25, %20 ]
br label %28
28: ; preds = %26, %14
%29 = phi i32 [ 66, %14 ], [ %27, %26 ]
br label %30
30: ; preds = %28, %9
%31 = phi i32 [ 65, %9 ], [ %29, %28 ]
%32 = trunc i32 %31 to i8
store i8 %32, i8* %3
%33 = load i8, i8* %3
%34 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8 signext %33)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Enter Marks of the student: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"Your Grade is: %c\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 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 sgt i32 %5, 79
br i1 %6, label %14, label %7
7: ; preds = %0
%8 = icmp sgt i32 %5, 69
br i1 %8, label %14, label %9
9: ; preds = %7
%10 = icmp sgt i32 %5, 49
br i1 %10, label %14, label %11
11: ; preds = %9
%12 = icmp sgt i32 %5, 29
%13 = select i1 %12, i8 68, i8 70
br label %14
14: ; preds = %7, %9, %11, %0
%15 = phi i8 [ 65, %0 ], [ 66, %7 ], [ %13, %11 ], [ 67, %9 ]
%16 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8 signext %15)
ret i32 0
}