#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 matriz_ponteiro(int **mtr, size_t linhas, size_t colunas) {
  for (int lin = 0; lin < linhas; lin++) {
    for (int col = 0; col < colunas; col++)
      printf("\t%d", mtr[lin][col]);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<matriz_ponteiro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1199 <matriz_ponteiro+0x89>
movl   $0x0,-0x20(%rbp)
movslq -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    117d <matriz_ponteiro+0x6d>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1140 <matriz_ponteiro+0x30>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <matriz_ponteiro+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matriz_ponteiro>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     118c <matriz_ponteiro+0x6c>
mov    %rdx,%r13
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xec0(%rip),%r12
xor    %ebx,%ebx
jmp    1163 <matriz_ponteiro+0x43>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %r14,%rbx
je     118c <matriz_ponteiro+0x6c>
test   %r13,%r13
je     1150 <matriz_ponteiro+0x30>
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rax
mov    (%rax,%rbp,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1170 <matriz_ponteiro+0x50>
jmp    1150 <matriz_ponteiro+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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