void display(char roll[], char name[], char sub1[], int marks1, int mm1,
             char grade1, char sub2[], int marks2, int mm2, char grade2,
             char sub3[], int marks3, int mm3, char grade3, char sub4[],
             int marks4, int mm4, char grade4, char sub5[], int marks5, int mm5,
             char grade5, double per, int div, int num, int den) {
  char division[][7] = {"FAIL", "FIRST", "SECOND", "THIRD"};
  printf("\n\n\t\tIndian Institute of Technology Mandi\n");
  printf("\t\tAcademic Session : (Aug-Dec) 2016\n");
  dashes();
  printf("Name of the Student : %s\n", name);
  printf("Roll number         : %s\n", roll);
  dashes();
  printf("Sr. No. | Subject Code | Maximum | Marks Obtained | Grade\n");
  dashes();
  printf("  [1]        %s         %d           %d           %c\n", sub1, mm1,
         marks1, grade1);
  printf("  [2]        %s         %d           %d           %c\n", sub2, mm2,
         marks2, grade2);
  printf("  [3]        %s         %d           %d           %c\n", sub3, mm3,
         marks3, grade3);
  printf("  [4]        %s         %d           %d           %c\n", sub4, mm4,
         marks4, grade4);
  printf("  [5]        %s         %d           %d           %c\n", sub5, mm5,
         marks5, grade5);
  dashes();
  printf("\t\t    Total  %d   Total  %d\n", den, num);
  printf("\tPercentage  %d%c. ", (int)per, '%');
  if (div == 0)
    printf("Student has FAILED\n");
  else
    printf("Student passed with %s division\n", division[div]);
  dashes();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %r9b,%al
mov    0xa0(%rbp),%r9d
mov    0x98(%rbp),%r9d
mov    0x90(%rbp),%r9d
mov    0x88(%rbp),%r9b
mov    0x80(%rbp),%r9d
mov    0x78(%rbp),%r9d
mov    0x70(%rbp),%r9
mov    0x68(%rbp),%r9b
mov    0x60(%rbp),%r9d
mov    0x58(%rbp),%r9d
mov    0x50(%rbp),%r9
mov    0x48(%rbp),%r9b
mov    0x40(%rbp),%r9d
mov    0x38(%rbp),%r9d
mov    0x30(%rbp),%r9
mov    0x28(%rbp),%r9b
mov    0x20(%rbp),%r9d
mov    0x18(%rbp),%r9d
mov    0x10(%rbp),%r9
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %al,-0x21(%rbp)
movsd  %xmm0,-0x30(%rbp)
mov    0xe58(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe55(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe52(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe50(%rip),%eax
mov    %eax,-0x38(%rbp)
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <dashes@plt>
mov    -0x10(%rbp),%rsi
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <dashes@plt>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <dashes@plt>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%ecx
movsbl -0x21(%rbp),%r8d
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x10(%rbp),%rsi
mov    0x20(%rbp),%edx
mov    0x18(%rbp),%ecx
movsbl 0x28(%rbp),%r8d
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x30(%rbp),%rsi
mov    0x40(%rbp),%edx
mov    0x38(%rbp),%ecx
movsbl 0x48(%rbp),%r8d
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x50(%rbp),%rsi
mov    0x60(%rbp),%edx
mov    0x58(%rbp),%ecx
movsbl 0x68(%rbp),%r8d
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x70(%rbp),%rsi
mov    0x80(%rbp),%edx
mov    0x78(%rbp),%ecx
movsbl 0x88(%rbp),%r8d
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <dashes@plt>
mov    0xa0(%rbp),%esi
mov    0x98(%rbp),%edx
lea    0xf09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvttsd2si -0x30(%rbp),%esi
lea    0xf13(%rip),%rdi
mov    $0x25,%edx
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,0x90(%rbp)
jne    131e <display+0x1fe>
lea    0xf07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    133e <display+0x21e>
movslq 0x90(%rbp),%rax
lea    -0x50(%rbp),%rsi
imul   $0x7,%rax,%rax
add    %rax,%rsi
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <dashes@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
movsd  %xmm0,0x18(%rsp)
mov    %r9d,0xc(%rsp)
mov    %r8d,%r15d
mov    %ecx,0x8(%rsp)
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r13
movsbl 0xf8(%rsp),%eax
mov    %eax,0x14(%rsp)
movups 0xea0(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xe88(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movsbl 0xd8(%rsp),%eax
mov    %eax,0x10(%rsp)
movsbl 0xb8(%rsp),%ebx
movsbl 0x98(%rsp),%ebp
lea    0x1010(%rip),%rdi
call   1030 <puts@plt>
lea    0x102d(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <dashes@plt>
lea    0xe5d(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe66(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <dashes@plt>
lea    0x1015(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <dashes@plt>
lea    0xe55(%rip),%rdi
mov    %r12,%rsi
mov    %r15d,%edx
mov    0x8(%rsp),%ecx
mov    0xc(%rsp),%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe6e(%rip),%rdi
mov    0x80(%rsp),%rsi
mov    0x90(%rsp),%edx
mov    0x88(%rsp),%ecx
mov    %ebp,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe7d(%rip),%rdi
mov    0xa0(%rsp),%rsi
mov    0xb0(%rsp),%edx
mov    0xa8(%rsp),%ecx
mov    %ebx,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8c(%rip),%rdi
mov    0xc0(%rsp),%rsi
mov    0xd0(%rsp),%edx
mov    0xc8(%rsp),%ecx
mov    0x10(%rsp),%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe99(%rip),%rdi
mov    0xe0(%rsp),%rsi
mov    0xf0(%rsp),%edx
mov    0xe8(%rsp),%ecx
mov    0x14(%rsp),%r8d
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <dashes@plt>
lea    0xe9f(%rip),%rdi
mov    0x110(%rsp),%esi
mov    0x108(%rsp),%edx
xor    %eax,%eax
call   1040 <printf@plt>
cvttsd2si 0x18(%rsp),%esi
lea    0xe9a(%rip),%rdi
mov    $0x25,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x100(%rsp),%eax
test   %eax,%eax
je     131d <display+0x1ed>
cltq
lea    0x0(,%rax,8),%rcx
sub    %rax,%rcx
lea    (%rsp,%rcx,1),%rsi
add    $0x20,%rsi
lea    0xe7b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1329 <display+0x1f9>
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <dashes@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.display.division = [4 x [7 x i8]] [[7 x i8] c"FAIL\00\00\00", [7 x i8] c"FIRST\00\00", [7 x i8] c"SECOND\00", [7 x i8] c"THIRD\00\00"]
@.str = [42 x i8] c"\0A\0A\09\09Indian Institute of Technology Mandi\0A\00"
@.str.1 = [37 x i8] c"\09\09Academic Session : (Aug-Dec) 2016\0A\00"
@.str.2 = [26 x i8] c"Name of the Student : %s\0A\00"
@.str.3 = [26 x i8] c"Roll number : %s\0A\00"
@.str.4 = [59 x i8] c"Sr. No. | Subject Code | Maximum | Marks Obtained | Grade\0A\00"
@.str.5 = [54 x i8] c" [1] %s %d %d %c\0A\00"
@.str.6 = [54 x i8] c" [2] %s %d %d %c\0A\00"
@.str.7 = [54 x i8] c" [3] %s %d %d %c\0A\00"
@.str.8 = [54 x i8] c" [4] %s %d %d %c\0A\00"
@.str.9 = [54 x i8] c" [5] %s %d %d %c\0A\00"
@.str.10 = [29 x i8] c"\09\09 Total %d Total %d\0A\00"
@.str.11 = [20 x i8] c"\09Percentage %d%c. \00"
@.str.12 = [20 x i8] c"Student has FAILED\0A\00"
@.str.13 = [33 x i8] c"Student passed with %s division\0A\00"
define void @display(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4, i8 signext %5, i8* %6, i32 %7, i32 %8, i8 signext %9, i8* %10, i32 %11, i32 %12, i8 signext %13, i8* %14, i32 %15, i32 %16, i8 signext %17, i8* %18, i32 %19, i32 %20, i8 signext %21, double %22, i32 %23, i32 %24, i32 %25) {
%27 = alloca i8*
%28 = alloca i8*
%29 = alloca i8*
%30 = alloca i32
%31 = alloca i32
%32 = alloca i8
%33 = alloca i8*
%34 = alloca i32
%35 = alloca i32
%36 = alloca i8
%37 = alloca i8*
%38 = alloca i32
%39 = alloca i32
%40 = alloca i8
%41 = alloca i8*
%42 = alloca i32
%43 = alloca i32
%44 = alloca i8
%45 = alloca i8*
%46 = alloca i32
%47 = alloca i32
%48 = alloca i8
%49 = alloca double
%50 = alloca i32
%51 = alloca i32
%52 = alloca i32
%53 = alloca [4 x [7 x i8]]
store i8* %0, i8** %27
store i8* %1, i8** %28
store i8* %2, i8** %29
store i32 %3, i32* %30
store i32 %4, i32* %31
store i8 %5, i8* %32
store i8* %6, i8** %33
store i32 %7, i32* %34
store i32 %8, i32* %35
store i8 %9, i8* %36
store i8* %10, i8** %37
store i32 %11, i32* %38
store i32 %12, i32* %39
store i8 %13, i8* %40
store i8* %14, i8** %41
store i32 %15, i32* %42
store i32 %16, i32* %43
store i8 %17, i8* %44
store i8* %18, i8** %45
store i32 %19, i32* %46
store i32 %20, i32* %47
store i8 %21, i8* %48
store double %22, double* %49
store i32 %23, i32* %50
store i32 %24, i32* %51
store i32 %25, i32* %52
%54 = bitcast [4 x [7 x i8]]* %53 to i8*
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%57 = call i32 (...) @dashes()
%58 = load i8*, i8** %28
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %58)
%60 = load i8*, i8** %27
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %60)
%62 = call i32 (...) @dashes()
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0))
%64 = call i32 (...) @dashes()
%65 = load i8*, i8** %29
%66 = load i32, i32* %31
%67 = load i32, i32* %30
%68 = load i8, i8* %32
%69 = sext i8 %68 to i32
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0), i8* %65, i32 %66, i32 %67, i32 %69)
%71 = load i8*, i8** %33
%72 = load i32, i32* %35
%73 = load i32, i32* %34
%74 = load i8, i8* %36
%75 = sext i8 %74 to i32
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0), i8* %71, i32 %72, i32 %73, i32 %75)
%77 = load i8*, i8** %37
%78 = load i32, i32* %39
%79 = load i32, i32* %38
%80 = load i8, i8* %40
%81 = sext i8 %80 to i32
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0), i8* %77, i32 %78, i32 %79, i32 %81)
%83 = load i8*, i8** %41
%84 = load i32, i32* %43
%85 = load i32, i32* %42
%86 = load i8, i8* %44
%87 = sext i8 %86 to i32
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.8, i64 0, i64 0), i8* %83, i32 %84, i32 %85, i32 %87)
%89 = load i8*, i8** %45
%90 = load i32, i32* %47
%91 = load i32, i32* %46
%92 = load i8, i8* %48
%93 = sext i8 %92 to i32
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.9, i64 0, i64 0), i8* %89, i32 %90, i32 %91, i32 %93)
%95 = call i32 (...) @dashes()
%96 = load i32, i32* %52
%97 = load i32, i32* %51
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0), i32 %96, i32 %97)
%99 = load double, double* %49
%100 = fptosi double %99 to i32
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i32 %100, i32 37)
%102 = load i32, i32* %50
%103 = icmp eq i32 %102, 0
br i1 %103, label %104, label %106
104: ; preds = %26
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0))
br label %112
106: ; preds = %26
%107 = load i32, i32* %50
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [4 x [7 x i8]], [4 x [7 x i8]]* %53, i64 0, i64 %108
%110 = getelementptr inbounds [7 x i8], [7 x i8]* %109, i64 0, i64 0
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0), i8* %110)
br label %112
112: ; preds = %106, %104
%113 = call i32 (...) @dashes()
ret void
}

LLVM IR (-O2):
@__const.display.division = [4 x [7 x i8]] [[7 x i8] c"FAIL\00\00\00", [7 x i8] c"FIRST\00\00", [7 x i8] c"SECOND\00", [7 x i8] c"THIRD\00\00"]
@.str.2 = [26 x i8] c"Name of the Student : %s\0A\00"
@.str.3 = [26 x i8] c"Roll number : %s\0A\00"
@.str.5 = [54 x i8] c" [1] %s %d %d %c\0A\00"
@.str.6 = [54 x i8] c" [2] %s %d %d %c\0A\00"
@.str.7 = [54 x i8] c" [3] %s %d %d %c\0A\00"
@.str.8 = [54 x i8] c" [4] %s %d %d %c\0A\00"
@.str.9 = [54 x i8] c" [5] %s %d %d %c\0A\00"
@.str.10 = [29 x i8] c"\09\09 Total %d Total %d\0A\00"
@.str.11 = [20 x i8] c"\09Percentage %d%c. \00"
@.str.13 = [33 x i8] c"Student passed with %s division\0A\00"
@str = [41 x i8] c"\0A\0A\09\09Indian Institute of Technology Mandi\00"
@str.14 = [36 x i8] c"\09\09Academic Session : (Aug-Dec) 2016\00"
@str.15 = [58 x i8] c"Sr. No. | Subject Code | Maximum | Marks Obtained | Grade\00"
@str.16 = [19 x i8] c"Student has FAILED\00"
define void @display(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4, i8 signext %5, i8* %6, i32 %7, i32 %8, i8 signext %9, i8* %10, i32 %11, i32 %12, i8 signext %13, i8* %14, i32 %15, i32 %16, i8 signext %17, i8* %18, i32 %19, i32 %20, i8 signext %21, double %22, i32 %23, i32 %24, i32 %25) {
%27 = alloca [4 x [7 x i8]]
%28 = getelementptr inbounds [4 x [7 x i8]], [4 x [7 x i8]]* %27, i64 0, i64 0, i64 0
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.14, i64 0, i64 0))
%31 = tail call i32 (...) @dashes()
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%34 = tail call i32 (...) @dashes()
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.15, i64 0, i64 0))
%36 = tail call i32 (...) @dashes()
%37 = sext i8 %5 to i32
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0), i8* %2, i32 %4, i32 %3, i32 %37)
%39 = sext i8 %9 to i32
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0), i8* %6, i32 %8, i32 %7, i32 %39)
%41 = sext i8 %13 to i32
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0), i8* %10, i32 %12, i32 %11, i32 %41)
%43 = sext i8 %17 to i32
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.8, i64 0, i64 0), i8* %14, i32 %16, i32 %15, i32 %43)
%45 = sext i8 %21 to i32
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.9, i64 0, i64 0), i8* %18, i32 %20, i32 %19, i32 %45)
%47 = tail call i32 (...) @dashes()
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0), i32 %25, i32 %24)
%49 = fptosi double %22 to i32
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i32 %49, i32 37)
%51 = icmp eq i32 %23, 0
br i1 %51, label %52, label %54
52: ; preds = %26
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.16, i64 0, i64 0))
br label %58
54: ; preds = %26
%55 = sext i32 %23 to i64
%56 = getelementptr inbounds [4 x [7 x i8]], [4 x [7 x i8]]* %27, i64 0, i64 %55, i64 0
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0), i8* %56)
br label %58
58: ; preds = %54, %52
%59 = call i32 (...) @dashes()
ret void
}