#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 const);
void desplegarArreglo(const int calificaciones[][4], int alumnos,
                      int examenes) {
  int i, j;
  for (i = 0; i < alumnos; i++) {
    printf("calificaicones estudaintes[%d]", i);
    for (j = 0; j < examenes; j++) {
      printf("calificaiones: %-5d", calificaciones[i][j]);
    }
  }
}


x86 assembly (clang, -O0):
<desplegarArreglo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    119a <desplegarArreglo+0x8a>
mov    -0x14(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1187 <desplegarArreglo+0x77>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114b <desplegarArreglo+0x3b>
jmp    118c <desplegarArreglo+0x7c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <desplegarArreglo+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<desplegarArreglo>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,0x4(%rsp)
test   %esi,%esi
jle    1187 <desplegarArreglo+0x77>
mov    %rdi,%rbx
mov    %esi,%r13d
mov    0x4(%rsp),%r15d
xor    %r12d,%r12d
lea    0xee7(%rip),%rbp
jmp    114d <desplegarArreglo+0x3d>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12
add    $0x10,%rbx
cmp    %r13,%r12
je     1187 <desplegarArreglo+0x77>
lea    0xeac(%rip),%rdi
mov    %r12d,%esi
call   1030 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1140 <desplegarArreglo+0x30>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx,%r14,4),%esi
mov    %rbp,%rdi
call   1030 <printf@plt>
add    $0x1,%r14
cmp    %r14,%r15
jne    1170 <desplegarArreglo+0x60>
jmp    1140 <desplegarArreglo+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [31 x i8] c"calificaicones estudaintes[%d]\00"
@.str.1 = [20 x i8] c"calificaiones: %-5d\00"
define void @desplegarArreglo([4 x i32]* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %23
5: ; preds = %3
%6 = icmp sgt i32 %2, 0
%7 = zext i32 %1 to i64
%8 = zext i32 %2 to i64
br label %9
9: ; preds = %5, %20
%10 = phi i64 [ 0, %5 ], [ %21, %20 ]
%11 = trunc i64 %10 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %11)
br i1 %6, label %13, label %20
13: ; preds = %9, %13
%14 = phi i64 [ %18, %13 ], [ 0, %9 ]
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 %10, i64 %14
%16 = load i32, i32* %15
%17 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = add nuw nsw i64 %14, 1
%19 = icmp eq i64 %18, %8
br i1 %19, label %20, label %13
20: ; preds = %13, %9
%21 = add nuw nsw i64 %10, 1
%22 = icmp eq i64 %21, %7
br i1 %22, label %23, label %9
23: ; preds = %20, %3
ret void
}