#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 imprimir_matriz(int matriz[5000][5000]) {
  int i, j;
  for (i = 0; i < 5000; i++) {
    printf("%d - ", i + 1);
    for (j = 0; j < 5000; j++) {
      printf("%d ", matriz[i][j]);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<imprimir_matriz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1388,-0xc(%rbp)
jge    11a9 <imprimir_matriz+0x99>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x1388,-0x10(%rbp)
jge    118d <imprimir_matriz+0x7d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x4e20,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114b <imprimir_matriz+0x3b>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <imprimir_matriz+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimir_matriz>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,%r13
lea    0xecd(%rip),%r14
lea    0xecc(%rip),%r15
xor    %r12d,%r12d
nopl   (%rax)
add    $0x1,%r12
mov    %r14,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x0(%r13,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x1388,%rbx
jne    1160 <imprimir_matriz+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x4e20,%r13
cmp    $0x1388,%r12
jne    1140 <imprimir_matriz+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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