#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*/ imprimirFilaDeMatriz(int **, int);
int /*<<< orphan*/ printf(char *, ...);
void imprimirTodaLaMatriz(int control[1000][5], int registros) {
  if (registros > 0) {
    printf("%15s", "ID");
    printf("%15s", "Edad");
    printf("%15s", "Pacientes");
    printf("%15s", "Horario");
    printf("%15s\n", "Piso");
    for (int i = 0; i < registros; i++) {
      imprimirFilaDeMatriz(control, i);
    }
  } else {
    printf("Matriz vacia\n");
  }
}


x86 assembly (clang, -O0):
<imprimirTodaLaMatriz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    11d4 <imprimirTodaLaMatriz+0xb4>
lea    0xec0(%rip),%rdi
lea    0xebe(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeab(%rip),%rdi
lea    0xeac(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe96(%rip),%rdi
lea    0xe9c(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe81(%rip),%rdi
lea    0xe91(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8b(%rip),%rdi
lea    0xe8a(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11cf <imprimirTodaLaMatriz+0xaf>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1040 <imprimirFilaDeMatriz@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a9 <imprimirTodaLaMatriz+0x89>
jmp    11e2 <imprimirTodaLaMatriz+0xc2>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimirTodaLaMatriz>:
test   %esi,%esi
jle    11cc <imprimirTodaLaMatriz+0x9c>
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xeb5(%rip),%r15
lea    0xeb3(%rip),%rsi
xor    %ebp,%ebp
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea3(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe97(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe90(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe87(%rip),%rdi
lea    0xe86(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
call   1050 <imprimirFilaDeMatriz@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    11b0 <imprimirTodaLaMatriz+0x80>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe57(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%15s\00"
@.str.1 = [3 x i8] c"ID\00"
@.str.2 = [5 x i8] c"Edad\00"
@.str.3 = [10 x i8] c"Pacientes\00"
@.str.4 = [8 x i8] c"Horario\00"
@.str.5 = [6 x i8] c"%15s\0A\00"
@.str.6 = [5 x i8] c"Piso\00"
@.str.7 = [14 x i8] c"Matriz vacia\0A\00"
define void @imprimirTodaLaMatriz([5 x i32]* %0, i32 %1) {
%3 = alloca [5 x i32]*
%4 = alloca i32
%5 = alloca i32
store [5 x i32]* %0, [5 x i32]** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %27
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %5
br label %14
14: ; preds = %23, %8
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %26
18: ; preds = %14
%19 = load [5 x i32]*, [5 x i32]** %3
%20 = bitcast [5 x i32]* %19 to i32**
%21 = load i32, i32* %5
%22 = call i32 @imprimirFilaDeMatriz(i32** %20, i32 %21)
br label %23
23: ; preds = %18
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %14
26: ; preds = %14
br label %29
27: ; preds = %2
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
br label %29
29: ; preds = %27, %26
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%15s\00"
@.str.1 = [3 x i8] c"ID\00"
@.str.2 = [5 x i8] c"Edad\00"
@.str.3 = [10 x i8] c"Pacientes\00"
@.str.4 = [8 x i8] c"Horario\00"
@.str.5 = [6 x i8] c"%15s\0A\00"
@.str.6 = [5 x i8] c"Piso\00"
@str = [13 x i8] c"Matriz vacia\00"
define void @imprimirTodaLaMatriz([5 x i32]* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%10 = bitcast [5 x i32]* %0 to i32**
br label %11
11: ; preds = %4, %11
%12 = phi i32 [ 0, %4 ], [ %14, %11 ]
%13 = tail call i32 @imprimirFilaDeMatriz(i32** %10, i32 %12)
%14 = add nuw nsw i32 %12, 1
%15 = icmp eq i32 %14, %1
br i1 %15, label %18, label %11
16: ; preds = %2
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %18
18: ; preds = %11, %16
ret void
}