#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 **listar(int **m, int tam) {
  int i, j;
  for (i = 0; i < tam; i++) {
    printf(" ");
    for (j = 0; j < tam; j++) {
      printf("%d\t", m[i][j]);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<listar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    119e <listar+0x8e>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1182 <listar+0x72>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1147 <listar+0x37>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1126 <listar+0x16>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listar>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %esi,%esi
jle    117d <listar+0x5d>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec6(%rip),%r14
xor    %r13d,%r13d
nopl   (%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r15,%r13,8),%rax
mov    (%rax,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1150 <listar+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r13
cmp    %r12,%r13
jne    1140 <listar+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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