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


x86 assembly (clang, -O0):
<imprimirMatriz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11fd <imprimirMatriz+0xed>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11e1 <imprimirMatriz+0xd1>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
shl    $0x9,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x64,(%rax,%rcx,4)
jl     118b <imprimirMatriz+0x7b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
shl    $0x9,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11af <imprimirMatriz+0x9f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
shl    $0x9,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11ce <imprimirMatriz+0xbe>
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d3 <imprimirMatriz+0xc3>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <imprimirMatriz+0x29>
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <imprimirMatriz+0x16>
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimirMatriz>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    11ae <imprimirMatriz+0x8e>
mov    %rdi,%rbx
lea    -0x1(%rsi),%r14d
mov    %esi,%r15d
lea    0xec0(%rip),%r12
lea    0xebc(%rip),%r13
xor    %eax,%eax
jmp    116e <imprimirMatriz+0x4e>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rsp),%rax
add    $0x1,%rax
add    $0x200,%rbx
cmp    %r15,%rax
je     11ae <imprimirMatriz+0x8e>
mov    %rax,(%rsp)
xor    %ebp,%ebp
jmp    1189 <imprimirMatriz+0x69>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%r15
je     1150 <imprimirMatriz+0x30>
mov    (%rbx,%rbp,4),%esi
cmp    $0x64,%esi
mov    %r13,%rdi
cmovge %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %r14,%rbp
jae    1180 <imprimirMatriz+0x60>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1180 <imprimirMatriz+0x60>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"% 3d\00"
define void @imprimirMatriz([128 x i32]* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %27
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = zext i32 %5 to i64
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %23, %4
%9 = phi i64 [ 0, %4 ], [ %25, %23 ]
br label %10
10: ; preds = %8, %20
%11 = phi i64 [ 0, %8 ], [ %21, %20 ]
%12 = getelementptr inbounds [128 x i32], [128 x i32]* %0, i64 %9, i64 %11
%13 = load i32, i32* %12
%14 = icmp sgt i32 %13, 99
%15 = select i1 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %15, i32 %13)
%17 = icmp ult i64 %11, %6
br i1 %17, label %18, label %20
18: ; preds = %10
%19 = tail call i32 @putchar(i32 32)
br label %20
20: ; preds = %10, %18
%21 = add nuw nsw i64 %11, 1
%22 = icmp eq i64 %21, %7
br i1 %22, label %23, label %10
23: ; preds = %20
%24 = tail call i32 @putchar(i32 10)
%25 = add nuw nsw i64 %9, 1
%26 = icmp eq i64 %25, %7
br i1 %26, label %27, label %8
27: ; preds = %23, %2
%28 = tail call i32 @putchar(i32 10)
ret void
}