#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);
void printFailOr2ndFirst(int marks[], int size) {
  int ii = 0;
  int failCount = 0;
  int ordiCount = 0;
  int secondCount = 0;
  int firstCount = 0;
  while (ii < size) {
    if (marks[ii] < 40)
      failCount++;
    else if ((marks[ii] >= 40) && (marks[ii] < 50))
      ordiCount++;
    else if ((marks[ii] >= 50) && (marks[ii] < 60))
      secondCount++;
    else if (marks[ii] >= 60)
      firstCount++;
    ii++;
  }
  printf("No of fail Students           = %d\n", failCount);
  printf("No of ordinary class Students = %d\n", ordiCount);
  printf("No of second class Students   = %d\n", secondCount);
  printf("No of first class Students    = %d\n", firstCount);
}


x86 assembly (clang, -O0):
<printFailOr2ndFirst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    120a <printFailOr2ndFirst+0xfa>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x28,(%rax,%rcx,4)
jge    116e <printFailOr2ndFirst+0x5e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11fc <printFailOr2ndFirst+0xec>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x28,(%rax,%rcx,4)
jl     11a0 <printFailOr2ndFirst+0x90>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x32,(%rax,%rcx,4)
jge    11a0 <printFailOr2ndFirst+0x90>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11f7 <printFailOr2ndFirst+0xe7>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x32,(%rax,%rcx,4)
jl     11d2 <printFailOr2ndFirst+0xc2>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x3c,(%rax,%rcx,4)
jge    11d2 <printFailOr2ndFirst+0xc2>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11f2 <printFailOr2ndFirst+0xe2>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x3c,(%rax,%rcx,4)
jl     11ed <printFailOr2ndFirst+0xdd>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11f2 <printFailOr2ndFirst+0xe2>
jmp    11f7 <printFailOr2ndFirst+0xe7>
jmp    11fc <printFailOr2ndFirst+0xec>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <printFailOr2ndFirst+0x32>
mov    -0x14(%rbp),%esi
lea    0xdec(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe01(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe16(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printFailOr2ndFirst>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1160 <printFailOr2ndFirst+0x50>
mov    %esi,%eax
xor    %ecx,%ecx
xor    %r14d,%r14d
xor    %ebp,%ebp
xor    %ebx,%ebx
xor    %esi,%esi
jmp    113c <printFailOr2ndFirst+0x2c>
nopw   0x0(%rax,%rax,1)
add    $0x1,%esi
add    $0x1,%rcx
cmp    %rcx,%rax
je     1169 <printFailOr2ndFirst+0x59>
mov    (%rdi,%rcx,4),%edx
cmp    $0x27,%edx
jle    1130 <printFailOr2ndFirst+0x20>
cmp    $0x31,%edx
ja     1150 <printFailOr2ndFirst+0x40>
add    $0x1,%ebx
jmp    1133 <printFailOr2ndFirst+0x23>
xchg   %ax,%ax
cmp    $0x3b,%edx
ja     115a <printFailOr2ndFirst+0x4a>
add    $0x1,%ebp
jmp    1133 <printFailOr2ndFirst+0x23>
add    $0x1,%r14d
jmp    1133 <printFailOr2ndFirst+0x23>
xor    %esi,%esi
xor    %ebx,%ebx
xor    %ebp,%ebp
xor    %r14d,%r14d
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"No of fail Students = %d\0A\00"
@.str.1 = [36 x i8] c"No of ordinary class Students = %d\0A\00"
@.str.2 = [36 x i8] c"No of second class Students = %d\0A\00"
@.str.3 = [36 x i8] c"No of first class Students = %d\0A\00"
define void @printFailOr2ndFirst(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %3
store i32 %1, 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
br label %10
10: ; preds = %71, %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %74
14: ; preds = %10
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = icmp slt i32 %19, 40
br i1 %20, label %21, label %24
21: ; preds = %14
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %71
24: ; preds = %14
%25 = load i32*, i32** %3
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
%29 = load i32, i32* %28
%30 = icmp sge i32 %29, 40
br i1 %30, label %31, label %41
31: ; preds = %24
%32 = load i32*, i32** %3
%33 = load i32, i32* %5
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32, i32* %32, i64 %34
%36 = load i32, i32* %35
%37 = icmp slt i32 %36, 50
br i1 %37, label %38, label %41
38: ; preds = %31
%39 = load i32, i32* %7
%40 = add nsw i32 %39, 1
store i32 %40, i32* %7
br label %70
41: ; preds = %31, %24
%42 = load i32*, i32** %3
%43 = load i32, i32* %5
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i32, i32* %42, i64 %44
%46 = load i32, i32* %45
%47 = icmp sge i32 %46, 50
br i1 %47, label %48, label %58
48: ; preds = %41
%49 = load i32*, i32** %3
%50 = load i32, i32* %5
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i32, i32* %49, i64 %51
%53 = load i32, i32* %52
%54 = icmp slt i32 %53, 60
br i1 %54, label %55, label %58
55: ; preds = %48
%56 = load i32, i32* %8
%57 = add nsw i32 %56, 1
store i32 %57, i32* %8
br label %69
58: ; preds = %48, %41
%59 = load i32*, i32** %3
%60 = load i32, i32* %5
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i32, i32* %59, i64 %61
%63 = load i32, i32* %62
%64 = icmp sge i32 %63, 60
br i1 %64, label %65, label %68
65: ; preds = %58
%66 = load i32, i32* %9
%67 = add nsw i32 %66, 1
store i32 %67, i32* %9
br label %68
68: ; preds = %65, %58
br label %69
69: ; preds = %68, %55
br label %70
70: ; preds = %69, %38
br label %71
71: ; preds = %70, %21
%72 = load i32, i32* %5
%73 = add nsw i32 %72, 1
store i32 %73, i32* %5
br label %10
74: ; preds = %10
%75 = load i32, i32* %6
%76 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %75)
%77 = load i32, i32* %7
%78 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %77)
%79 = load i32, i32* %8
%80 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %79)
%81 = load i32, i32* %9
%82 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i32 %81)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"No of fail Students = %d\0A\00"
@.str.1 = [36 x i8] c"No of ordinary class Students = %d\0A\00"
@.str.2 = [36 x i8] c"No of second class Students = %d\0A\00"
@.str.3 = [36 x i8] c"No of first class Students = %d\0A\00"
define void @printFailOr2ndFirst(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %34
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %27
%7 = phi i64 [ 0, %4 ], [ %32, %27 ]
%8 = phi i32 [ 0, %4 ], [ %31, %27 ]
%9 = phi i32 [ 0, %4 ], [ %30, %27 ]
%10 = phi i32 [ 0, %4 ], [ %29, %27 ]
%11 = phi i32 [ 0, %4 ], [ %28, %27 ]
%12 = getelementptr inbounds i32, i32* %0, i64 %7
%13 = load i32, i32* %12
%14 = icmp slt i32 %13, 40
br i1 %14, label %15, label %17
15: ; preds = %6
%16 = add nsw i32 %11, 1
br label %27
17: ; preds = %6
%18 = icmp ult i32 %13, 50
br i1 %18, label %19, label %21
19: ; preds = %17
%20 = add nsw i32 %10, 1
br label %27
21: ; preds = %17
%22 = icmp ult i32 %13, 60
br i1 %22, label %23, label %25
23: ; preds = %21
%24 = add nsw i32 %9, 1
br label %27
25: ; preds = %21
%26 = add nsw i32 %8, 1
br label %27
27: ; preds = %25, %19, %23, %15
%28 = phi i32 [ %16, %15 ], [ %11, %19 ], [ %11, %23 ], [ %11, %25 ]
%29 = phi i32 [ %10, %15 ], [ %20, %19 ], [ %10, %23 ], [ %10, %25 ]
%30 = phi i32 [ %9, %15 ], [ %9, %19 ], [ %24, %23 ], [ %9, %25 ]
%31 = phi i32 [ %8, %15 ], [ %8, %19 ], [ %8, %23 ], [ %26, %25 ]
%32 = add nuw nsw i64 %7, 1
%33 = icmp eq i64 %32, %5
br i1 %33, label %34, label %6
34: ; preds = %27, %2
%35 = phi i32 [ 0, %2 ], [ %28, %27 ]
%36 = phi i32 [ 0, %2 ], [ %29, %27 ]
%37 = phi i32 [ 0, %2 ], [ %30, %27 ]
%38 = phi i32 [ 0, %2 ], [ %31, %27 ]
%39 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %35)
%40 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %36)
%41 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %37)
%42 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i32 %38)
ret void
}