#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 *, ...);
void printStudentTable(int array[7][2]) {
  int count = 0;
  printf("\n|Student Id | Student Age|\n");
  for (count = 0; count < 7; ++count) {
    printf("|________________________|\n");
    printf("|   %5d |      %2d      |\n", array[count][0], array[count][1]);
  }
  printf("|________________________|\n\n");
}


x86 assembly (clang, -O0):
<printStudentTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jge    1183 <printStudentTable+0x73>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    0x4(%rax,%rcx,8),%edx
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <printStudentTable+0x28>
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStudentTable>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xf18(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
mov    (%rbx),%esi
mov    0x4(%rbx),%edx
lea    0xeb1(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    0x8(%rbx),%esi
mov    0xc(%rbx),%edx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    0x10(%rbx),%esi
mov    0x14(%rbx),%edx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    0x18(%rbx),%esi
mov    0x1c(%rbx),%edx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    0x20(%rbx),%esi
mov    0x24(%rbx),%edx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    0x28(%rbx),%esi
mov    0x2c(%rbx),%edx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    0x30(%rbx),%esi
mov    0x34(%rbx),%edx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe47(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"\0A|Student Id | Student Age|\0A\00"
@.str.1 = [28 x i8] c"|________________________|\0A\00"
@.str.2 = [27 x i8] c"| %5d | %2d |\0A\00"
@.str.3 = [29 x i8] c"|________________________|\0A\0A\00"
define void @printStudentTable([2 x i32]* %0) {
%2 = alloca [2 x i32]*
%3 = alloca i32
store [2 x i32]* %0, [2 x i32]** %2
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %5
5: ; preds = %23, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 7
br i1 %7, label %8, label %26
8: ; preds = %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%10 = load [2 x i32]*, [2 x i32]** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 %12
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
%15 = load i32, i32* %14
%16 = load [2 x i32]*, [2 x i32]** %2
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %16, i64 %18
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0, i64 1
%21 = load i32, i32* %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %15, i32 %21)
br label %23
23: ; preds = %8
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %5
26: ; preds = %5
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.2 = [27 x i8] c"| %5d | %2d |\0A\00"
@str = [28 x i8] c"\0A|Student Id | Student Age|\00"
@str.4 = [28 x i8] c"|________________________|\0A\00"
@str.5 = [27 x i8] c"|________________________|\00"
define void @printStudentTable([2 x i32]* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 0, i64 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 0, i64 1
%7 = load i32, i32* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 1, i64 0
%11 = load i32, i32* %10
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 1, i64 1
%13 = load i32, i32* %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %11, i32 %13)
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 2, i64 0
%17 = load i32, i32* %16
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 2, i64 1
%19 = load i32, i32* %18
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %17, i32 %19)
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
%22 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 3, i64 0
%23 = load i32, i32* %22
%24 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 3, i64 1
%25 = load i32, i32* %24
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %23, i32 %25)
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
%28 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 4, i64 0
%29 = load i32, i32* %28
%30 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 4, i64 1
%31 = load i32, i32* %30
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %29, i32 %31)
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
%34 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 5, i64 0
%35 = load i32, i32* %34
%36 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 5, i64 1
%37 = load i32, i32* %36
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %35, i32 %37)
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
%40 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 6, i64 0
%41 = load i32, i32* %40
%42 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 6, i64 1
%43 = load i32, i32* %42
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %41, i32 %43)
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.4, i64 0, i64 0))
ret void
}