#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 print_students(int a[3][4]) {
  int i, j;
  j = 0;
  for (i = 0; i < 3; i++) {
    printf("\nStudent %d:\n", i + 1);
    printf("ID:%d, Age:%d , Sex:%d , Dedree:%d", a[i][j], a[i][j + 1],
           a[i][j + 2], a[i][j + 3]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_students>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    11cc <print_students+0xbc>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rdi
shl    $0x4,%rdi
add    %rdi,%rax
mov    -0x10(%rbp),%edi
add    $0x3,%edi
movslq %edi,%rdi
mov    (%rax,%rdi,4),%r8d
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <print_students+0x1a>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_students>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xed1(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%esi
mov    0x4(%rbx),%edx
mov    0x8(%rbx),%ecx
mov    0xc(%rbx),%r8d
lea    0xebd(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%esi
mov    0x14(%rbx),%edx
mov    0x18(%rbx),%ecx
mov    0x1c(%rbx),%r8d
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rbx),%esi
mov    0x24(%rbx),%edx
mov    0x28(%rbx),%ecx
mov    0x2c(%rbx),%r8d
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"\0AStudent %d:\0A\00"
@.str.1 = [35 x i8] c"ID:%d, Age:%d , Sex:%d , Dedree:%d\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @print_students([4 x i32]* %0) {
%2 = alloca [4 x i32]*
%3 = alloca i32
%4 = alloca i32
store [4 x i32]* %0, [4 x i32]** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %48, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %51
8: ; preds = %5
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load [4 x i32]*, [4 x i32]** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 %14
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = load [4 x i32]*, [4 x i32]** %2
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [4 x i32], [4 x i32]* %20, i64 %22
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [4 x i32], [4 x i32]* %23, i64 0, i64 %26
%28 = load i32, i32* %27
%29 = load [4 x i32]*, [4 x i32]** %2
%30 = load i32, i32* %3
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [4 x i32], [4 x i32]* %29, i64 %31
%33 = load i32, i32* %4
%34 = add nsw i32 %33, 2
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [4 x i32], [4 x i32]* %32, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = load [4 x i32]*, [4 x i32]** %2
%39 = load i32, i32* %3
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [4 x i32], [4 x i32]* %38, i64 %40
%42 = load i32, i32* %4
%43 = add nsw i32 %42, 3
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [4 x i32], [4 x i32]* %41, i64 0, i64 %44
%46 = load i32, i32* %45
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %28, i32 %37, i32 %46)
br label %48
48: ; preds = %8
%49 = load i32, i32* %3
%50 = add nsw i32 %49, 1
store i32 %50, i32* %3
br label %5
51: ; preds = %5
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0AStudent %d:\0A\00"
@.str.1 = [35 x i8] c"ID:%d, Age:%d , Sex:%d , Dedree:%d\00"
define void @print_students([4 x i32]* nocapture %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 2
%8 = load i32, i32* %7
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 3
%10 = load i32, i32* %9
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %6, i32 %8, i32 %10)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 2)
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 1, i64 0
%14 = load i32, i32* %13
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 1, i64 1
%16 = load i32, i32* %15
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 1, i64 2
%18 = load i32, i32* %17
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 1, i64 3
%20 = load i32, i32* %19
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %16, i32 %18, i32 %20)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 3)
%23 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 2, i64 0
%24 = load i32, i32* %23
%25 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 2, i64 1
%26 = load i32, i32* %25
%27 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 2, i64 2
%28 = load i32, i32* %27
%29 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 2, i64 3
%30 = load i32, i32* %29
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %24, i32 %26, i32 %28, i32 %30)
%32 = tail call i32 @putchar(i32 10)
ret void
}