#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 *, int *, int *, int *);
int main(void) {
  int e, n, f, ed, c, tot, per;
  printf("Enter the marks of subjects: English, Nepali, Foit, Education, C "
         "programming respectively\n");
  scanf("%d %d %d %d %d", &e, &n, &f, &ed, &c);
  if (e >= 35 && n >= 35 && f >= 35 && ed >= 35 && c >= 35) {
    tot = e + n + f + ed + c;
    per = tot / 5;
    printf("\nCongrats, You are passed in ");
    if (per >= 80)
      printf("Distinction with percentage %d", per);
    else if (per >= 60)
      printf("1st Division with percentage %d", per);
    else if (per >= 45)
      printf("2nd Division with percentage %d", per);
    else
      printf("3rd Division with percentage %d", per);
  } else
    printf("\nSorry, You are failed !");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf17(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
lea    -0x18(%rbp),%r9
call   1040 <scanf@plt>
cmpl   $0x23,-0x8(%rbp)
jl     123d <main+0x11d>
cmpl   $0x23,-0xc(%rbp)
jl     123d <main+0x11d>
cmpl   $0x23,-0x10(%rbp)
jl     123d <main+0x11d>
cmpl   $0x23,-0x14(%rbp)
jl     123d <main+0x11d>
cmpl   $0x23,-0x18(%rbp)
jl     123d <main+0x11d>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x50,-0x20(%rbp)
jl     11dd <main+0xbd>
mov    -0x20(%rbp),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1238 <main+0x118>
cmpl   $0x3c,-0x20(%rbp)
jl     11fd <main+0xdd>
mov    -0x20(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1233 <main+0x113>
cmpl   $0x2d,-0x20(%rbp)
jl     121d <main+0xfd>
mov    -0x20(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    122e <main+0x10e>
mov    -0x20(%rbp),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1233 <main+0x113>
jmp    1238 <main+0x118>
jmp    124b <main+0x12b>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xf87(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb6(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
lea    0x4(%rsp),%r9
call   1050 <scanf@plt>
mov    0x14(%rsp),%eax
cmp    $0x23,%eax
jl     11ca <main+0x9a>
mov    0x10(%rsp),%ebx
cmp    $0x23,%ebx
jl     11ca <main+0x9a>
mov    0xc(%rsp),%ecx
cmp    $0x23,%ecx
jl     11ca <main+0x9a>
mov    0x8(%rsp),%edx
cmp    $0x23,%edx
jl     11ca <main+0x9a>
mov    0x4(%rsp),%esi
cmp    $0x23,%esi
jl     11ca <main+0x9a>
add    %eax,%ebx
add    %ecx,%ebx
add    %edx,%ebx
add    %esi,%ebx
mov    $0xcccccccd,%r14d
imul   %rbx,%r14
shr    $0x22,%r14
lea    0xe5d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x190,%ebx
jb     11da <main+0xaa>
lea    0xe65(%rip),%rdi
jmp    1203 <main+0xd3>
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    120d <main+0xdd>
cmp    $0x12c,%ebx
jb     11eb <main+0xbb>
lea    0xe63(%rip),%rdi
jmp    1203 <main+0xd3>
cmp    $0xe1,%ebx
jb     11fc <main+0xcc>
lea    0xe72(%rip),%rdi
jmp    1203 <main+0xd3>
lea    0xe89(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [91 x i8] c"Enter the marks of subjects: English, Nepali, Foit, Education, C programming respectively\0A\00"
@.str.1 = [15 x i8] c"%d %d %d %d %d\00"
@.str.2 = [30 x i8] c"\0ACongrats, You are passed in \00"
@.str.3 = [31 x i8] c"Distinction with percentage %d\00"
@.str.4 = [32 x i8] c"1st Division with percentage %d\00"
@.str.5 = [32 x i8] c"2nd Division with percentage %d\00"
@.str.6 = [32 x i8] c"3rd Division with percentage %d\00"
@.str.7 = [25 x i8] c"\0ASorry, You are failed !\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5, i32* %6)
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 35
br i1 %12, label %13, label %61
13: ; preds = %0
%14 = load i32, i32* %3
%15 = icmp sge i32 %14, 35
br i1 %15, label %16, label %61
16: ; preds = %13
%17 = load i32, i32* %4
%18 = icmp sge i32 %17, 35
br i1 %18, label %19, label %61
19: ; preds = %16
%20 = load i32, i32* %5
%21 = icmp sge i32 %20, 35
br i1 %21, label %22, label %61
22: ; preds = %19
%23 = load i32, i32* %6
%24 = icmp sge i32 %23, 35
br i1 %24, label %25, label %61
25: ; preds = %22
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = add nsw i32 %26, %27
%29 = load i32, i32* %4
%30 = add nsw i32 %28, %29
%31 = load i32, i32* %5
%32 = add nsw i32 %30, %31
%33 = load i32, i32* %6
%34 = add nsw i32 %32, %33
store i32 %34, i32* %7
%35 = load i32, i32* %7
%36 = sdiv i32 %35, 5
store i32 %36, i32* %8
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%38 = load i32, i32* %8
%39 = icmp sge i32 %38, 80
br i1 %39, label %40, label %43
40: ; preds = %25
%41 = load i32, i32* %8
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %41)
br label %60
43: ; preds = %25
%44 = load i32, i32* %8
%45 = icmp sge i32 %44, 60
br i1 %45, label %46, label %49
46: ; preds = %43
%47 = load i32, i32* %8
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %47)
br label %59
49: ; preds = %43
%50 = load i32, i32* %8
%51 = icmp sge i32 %50, 45
br i1 %51, label %52, label %55
52: ; preds = %49
%53 = load i32, i32* %8
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i32 %53)
br label %58
55: ; preds = %49
%56 = load i32, i32* %8
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i32 %56)
br label %58
58: ; preds = %55, %52
br label %59
59: ; preds = %58, %46
br label %60
60: ; preds = %59, %40
br label %63
61: ; preds = %22, %19, %16, %13, %0
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
br label %63
63: ; preds = %61, %60
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"%d %d %d %d %d\00"
@.str.2 = [30 x i8] c"\0ACongrats, You are passed in \00"
@.str.3 = [31 x i8] c"Distinction with percentage %d\00"
@.str.4 = [32 x i8] c"1st Division with percentage %d\00"
@.str.5 = [32 x i8] c"2nd Division with percentage %d\00"
@.str.6 = [32 x i8] c"3rd Division with percentage %d\00"
@.str.7 = [25 x i8] c"\0ASorry, You are failed !\00"
@str = [90 x i8] c"Enter the marks of subjects: English, Nepali, Foit, Education, C programming respectively\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([90 x i8], [90 x i8]* @str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4, i32* %5)
%13 = load i32, i32* %1
%14 = icmp sgt i32 %13, 34
%15 = load i32, i32* %2
%16 = icmp sgt i32 %15, 34
%17 = select i1 %14, i1 %16, i1 false
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 34
%20 = select i1 %17, i1 %19, i1 false
%21 = load i32, i32* %4
%22 = icmp sgt i32 %21, 34
%23 = select i1 %20, i1 %22, i1 false
%24 = load i32, i32* %5
%25 = icmp sgt i32 %24, 34
%26 = select i1 %23, i1 %25, i1 false
br i1 %26, label %27, label %47
27: ; preds = %0
%28 = add nuw nsw i32 %15, %13
%29 = add nuw nsw i32 %28, %18
%30 = add nuw nsw i32 %29, %21
%31 = add nuw nsw i32 %30, %24
%32 = udiv i32 %31, 5
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%34 = icmp ugt i32 %31, 399
br i1 %34, label %35, label %37
35: ; preds = %27
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %32)
br label %49
37: ; preds = %27
%38 = icmp ugt i32 %31, 299
br i1 %38, label %39, label %41
39: ; preds = %37
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %32)
br label %49
41: ; preds = %37
%42 = icmp ugt i32 %31, 224
br i1 %42, label %43, label %45
43: ; preds = %41
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i32 %32)
br label %49
45: ; preds = %41
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i32 %32)
br label %49
47: ; preds = %0
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
br label %49
49: ; preds = %35, %43, %45, %39, %47
ret i32 0
}