#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 main() {
  int len = 0, n, a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0;
  printf("Enter the List of Marks (-1 to finish) \n");
  scanf("%d", &n);
  while (n >= 0 && len < 100) {
    if (n > 80)
      a++;
    if (n > 60)
      b++;
    if (n > 40)
      c++;
    if (n < 40)
      d++;
    if (n > 80 && n <= 100)
      e++;
    if (n > 60 && n <= 80)
      f++;
    if (n > 40 && n <= 60)
      g++;
    if (n <= 40)
      h++;
    printf("Got That!!.. Next \n");
    scanf("%d", &n);
    len++;
  }
  if (len > 0) {
    printf("No of Students: %d \n", len);
    printf(" A= %d \n B= %d \n C= %d \n D= %d \n "
           "E= %d \n F= %d \n G= %d \n H= %d \n",
           a, b, c, d, e, f, g, h);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x2d(%rbp)
jl     11a5 <main+0x85>
cmpl   $0x64,-0x8(%rbp)
setl   %al
mov    %al,-0x2d(%rbp)
mov    -0x2d(%rbp),%al
test   $0x1,%al
jne    11b5 <main+0x95>
jmp    1297 <main+0x177>
cmpl   $0x50,-0xc(%rbp)
jle    11c8 <main+0xa8>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x3c,-0xc(%rbp)
jle    11db <main+0xbb>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x28,-0xc(%rbp)
jle    11ee <main+0xce>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x28,-0xc(%rbp)
jge    1201 <main+0xe1>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x50,-0xc(%rbp)
jle    121e <main+0xfe>
cmpl   $0x64,-0xc(%rbp)
jg     121e <main+0xfe>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x3c,-0xc(%rbp)
jle    123b <main+0x11b>
cmpl   $0x50,-0xc(%rbp)
jg     123b <main+0x11b>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x28,-0xc(%rbp)
jle    1258 <main+0x138>
cmpl   $0x3c,-0xc(%rbp)
jg     1258 <main+0x138>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x28,-0xc(%rbp)
jg     126b <main+0x14b>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xda9(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118c <main+0x6c>
cmpl   $0x0,-0x8(%rbp)
jle    12e9 <main+0x1c9>
mov    -0x8(%rbp),%esi
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
mov    -0x24(%rbp),%r11d
mov    -0x28(%rbp),%r10d
mov    -0x2c(%rbp),%eax
lea    0xd80(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xf14(%rip),%rdi
call   1030 <puts@plt>
lea    0xeaf(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
js     125c <main+0x12c>
xor    %ecx,%ecx
mov    %rcx,0x20(%rsp)
xor    %ecx,%ecx
mov    %rcx,0x10(%rsp)
xor    %ecx,%ecx
mov    %rcx,0x18(%rsp)
xor    %r14d,%r14d
xor    %r15d,%r15d
xor    %r12d,%r12d
xor    %ebp,%ebp
xor    %ebx,%ebx
xor    %r13d,%r13d
nopl   0x0(%rax)
cmp    $0x29,%eax
sbb    $0xffffffff,%r12d
mov    %eax,%ecx
sub    $0x29,%ecx
mov    0x20(%rsp),%rdx
adc    $0x0,%edx
mov    %rdx,0x20(%rsp)
cmp    $0x51,%eax
sbb    $0xffffffff,%ebx
cmp    $0x3d,%eax
sbb    $0xffffffff,%ebp
cmp    $0x28,%eax
adc    $0x0,%r15d
lea    -0x51(%rax),%edx
cmp    $0x14,%edx
adc    $0x0,%r14d
add    $0xffffffc3,%eax
cmp    $0x14,%eax
mov    0x18(%rsp),%rax
adc    $0x0,%eax
mov    %rax,0x18(%rsp)
cmp    $0x14,%ecx
mov    0x10(%rsp),%rax
adc    $0x0,%eax
mov    %rax,0x10(%rsp)
lea    0xe91(%rip),%rdi
call   1030 <puts@plt>
lea    0xe04(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
lea    0x1(%r13),%esi
mov    0xc(%rsp),%eax
test   %eax,%eax
js     121f <main+0xef>
cmp    $0x63,%r13d
mov    %esi,%r13d
jb     1190 <main+0x60>
lea    0xddd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
sub    $0x8,%rsp
lea    0xde0(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
xor    %eax,%eax
push   0x28(%rsp)
push   0x20(%rsp)
push   0x30(%rsp)
call   1040 <printf@plt>
add    $0x20,%rsp
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Enter the List of Marks (-1 to finish) \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Got That!!.. Next \0A\00"
@.str.3 = [21 x i8] c"No of Students: %d \0A\00"
@.str.4 = [65 x i8] c" A= %d \0A B= %d \0A C= %d \0A D= %d \0A E= %d \0A F= %d \0A G= %d \0A H= %d \0A\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
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %14
14: ; preds = %79, %0
%15 = load i32, i32* %3
%16 = icmp sge i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp slt i32 %18, 100
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br i1 %21, label %22, label %84
22: ; preds = %20
%23 = load i32, i32* %3
%24 = icmp sgt i32 %23, 80
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %28
28: ; preds = %25, %22
%29 = load i32, i32* %3
%30 = icmp sgt i32 %29, 60
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %34
34: ; preds = %31, %28
%35 = load i32, i32* %3
%36 = icmp sgt i32 %35, 40
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %6
br label %40
40: ; preds = %37, %34
%41 = load i32, i32* %3
%42 = icmp slt i32 %41, 40
br i1 %42, label %43, label %46
43: ; preds = %40
%44 = load i32, i32* %7
%45 = add nsw i32 %44, 1
store i32 %45, i32* %7
br label %46
46: ; preds = %43, %40
%47 = load i32, i32* %3
%48 = icmp sgt i32 %47, 80
br i1 %48, label %49, label %55
49: ; preds = %46
%50 = load i32, i32* %3
%51 = icmp sle i32 %50, 100
br i1 %51, label %52, label %55
52: ; preds = %49
%53 = load i32, i32* %8
%54 = add nsw i32 %53, 1
store i32 %54, i32* %8
br label %55
55: ; preds = %52, %49, %46
%56 = load i32, i32* %3
%57 = icmp sgt i32 %56, 60
br i1 %57, label %58, label %64
58: ; preds = %55
%59 = load i32, i32* %3
%60 = icmp sle i32 %59, 80
br i1 %60, label %61, label %64
61: ; preds = %58
%62 = load i32, i32* %9
%63 = add nsw i32 %62, 1
store i32 %63, i32* %9
br label %64
64: ; preds = %61, %58, %55
%65 = load i32, i32* %3
%66 = icmp sgt i32 %65, 40
br i1 %66, label %67, label %73
67: ; preds = %64
%68 = load i32, i32* %3
%69 = icmp sle i32 %68, 60
br i1 %69, label %70, label %73
70: ; preds = %67
%71 = load i32, i32* %10
%72 = add nsw i32 %71, 1
store i32 %72, i32* %10
br label %73
73: ; preds = %70, %67, %64
%74 = load i32, i32* %3
%75 = icmp sle i32 %74, 40
br i1 %75, label %76, label %79
76: ; preds = %73
%77 = load i32, i32* %11
%78 = add nsw i32 %77, 1
store i32 %78, i32* %11
br label %79
79: ; preds = %76, %73
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%81 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%82 = load i32, i32* %2
%83 = add nsw i32 %82, 1
store i32 %83, i32* %2
br label %14
84: ; preds = %20
%85 = load i32, i32* %2
%86 = icmp sgt i32 %85, 0
br i1 %86, label %87, label %99
87: ; preds = %84
%88 = load i32, i32* %2
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %88)
%90 = load i32, i32* %4
%91 = load i32, i32* %5
%92 = load i32, i32* %6
%93 = load i32, i32* %7
%94 = load i32, i32* %8
%95 = load i32, i32* %9
%96 = load i32, i32* %10
%97 = load i32, i32* %11
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.4, i64 0, i64 0), i32 %90, i32 %91, i32 %92, i32 %93, i32 %94, i32 %95, i32 %96, i32 %97)
br label %99
99: ; preds = %87, %84
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [21 x i8] c"No of Students: %d \0A\00"
@.str.4 = [65 x i8] c" A= %d \0A B= %d \0A C= %d \0A D= %d \0A E= %d \0A F= %d \0A G= %d \0A H= %d \0A\00"
@str = [40 x i8] c"Enter the List of Marks (-1 to finish) \00"
@str.5 = [19 x i8] c"Got That!!.. Next \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 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, -1
br i1 %6, label %7, label %55
7: ; preds = %0, %7
%8 = phi i32 [ %48, %7 ], [ %5, %0 ]
%9 = phi i32 [ %44, %7 ], [ 0, %0 ]
%10 = phi i32 [ %41, %7 ], [ 0, %0 ]
%11 = phi i32 [ %37, %7 ], [ 0, %0 ]
%12 = phi i32 [ %33, %7 ], [ 0, %0 ]
%13 = phi i32 [ %29, %7 ], [ 0, %0 ]
%14 = phi i32 [ %26, %7 ], [ 0, %0 ]
%15 = phi i32 [ %23, %7 ], [ 0, %0 ]
%16 = phi i32 [ %20, %7 ], [ 0, %0 ]
%17 = phi i32 [ %47, %7 ], [ 0, %0 ]
%18 = icmp ugt i32 %8, 80
%19 = zext i1 %18 to i32
%20 = add nuw nsw i32 %16, %19
%21 = icmp ugt i32 %8, 60
%22 = zext i1 %21 to i32
%23 = add nuw nsw i32 %15, %22
%24 = icmp ugt i32 %8, 40
%25 = zext i1 %24 to i32
%26 = add nuw nsw i32 %14, %25
%27 = icmp ult i32 %8, 40
%28 = zext i1 %27 to i32
%29 = add nuw nsw i32 %13, %28
%30 = add nsw i32 %8, -81
%31 = icmp ult i32 %30, 20
%32 = zext i1 %31 to i32
%33 = add nuw nsw i32 %12, %32
%34 = add nsw i32 %8, -61
%35 = icmp ult i32 %34, 20
%36 = zext i1 %35 to i32
%37 = add nuw nsw i32 %11, %36
%38 = add nsw i32 %8, -41
%39 = icmp ult i32 %38, 20
%40 = zext i1 %39 to i32
%41 = add nuw nsw i32 %10, %40
%42 = icmp ult i32 %8, 41
%43 = zext i1 %42 to i32
%44 = add nuw nsw i32 %9, %43
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0))
%46 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%47 = add nuw nsw i32 %17, 1
%48 = load i32, i32* %1
%49 = icmp sgt i32 %48, -1
%50 = icmp ult i32 %17, 99
%51 = select i1 %49, i1 %50, i1 false
br i1 %51, label %7, label %52
52: ; preds = %7
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %47)
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.4, i64 0, i64 0), i32 %20, i32 %23, i32 %26, i32 %29, i32 %33, i32 %37, i32 %41, i32 %44)
br label %55
55: ; preds = %0, %52
ret i32 0
}