#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 printTable(int **table, int length) {
  printf("Tabela [%d:%d]\n", length, length);
  for (int i = 0; i < length; i++) {
    printf("[");
    for (int j = i; j > 0; j--)
      printf("      ");
    for (int j = i; j < length - 1; j++)
      printf("%4d, ", table[i][j - i]);
    printf("%4d]\n", table[i][length - 1 - i]);
  }
}


x86 assembly (clang, -O0):
<printTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1202 <printTable+0xf2>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1180 <printTable+0x70>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    115a <printTable+0x4a>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11cb <printTable+0xbb>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x18(%rbp),%ecx
sub    -0x10(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1186 <printTable+0x76>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
sub    -0x10(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113a <printTable+0x2a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTable>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xec6(%rip),%rdi
mov    %esi,%edx
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
jle    1210 <printTable+0xf0>
lea    -0x1(%rbx),%r15d
mov    %ebx,%eax
mov    %rax,0x10(%rsp)
mov    $0x1,%ebx
lea    0xeae(%rip),%r12
mov    %r15,%r13
xor    %ebp,%ebp
mov    %r15,0x8(%rsp)
jmp    11a6 <printTable+0x86>
xchg   %ax,%ax
mov    (%r14,%rbp,8),%rax
mov    0x8(%rsp),%r15
mov    %r15,%rcx
sub    %rbp,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe94(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
mov    0x4(%rsp),%ebx
add    $0x1,%ebx
add    $0xffffffffffffffff,%r13
cmp    0x10(%rsp),%rbp
je     1210 <printTable+0xf0>
mov    $0x5b,%edi
call   1030 <putchar@plt>
mov    %ebx,0x4(%rsp)
test   %rbp,%rbp
je     11d2 <printTable+0xb2>
nopl   0x0(%rax)
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
jg     11c0 <printTable+0xa0>
cmp    %r15,%rbp
lea    0xe3b(%rip),%rbx
jae    1170 <printTable+0x50>
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbp,8),%rax
mov    (%rax,%r15,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r15
cmp    %r15,%r13
jne    11f0 <printTable+0xd0>
jmp    1170 <printTable+0x50>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"Tabela [%d:%d]\0A\00"
@.str.2 = [7 x i8] c" \00"
@.str.3 = [6 x i8] c"%4d, \00"
@.str.4 = [6 x i8] c"%4d]\0A\00"
define void @printTable(i32** nocapture %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %1)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = add nsw i32 %1, -1
%7 = zext i32 %6 to i64
%8 = zext i32 %1 to i64
%9 = zext i32 %6 to i64
br label %11
10: ; preds = %26, %2
ret void
11: ; preds = %5, %26
%12 = phi i64 [ 0, %5 ], [ %33, %26 ]
%13 = tail call i32 @putchar(i32 91)
%14 = icmp eq i64 %12, 0
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = trunc i64 %12 to i32
br label %21
17: ; preds = %21, %11
%18 = icmp ult i64 %12, %7
br i1 %18, label %19, label %26
19: ; preds = %17
%20 = getelementptr inbounds i32*, i32** %0, i64 %12
br label %35
21: ; preds = %15, %21
%22 = phi i32 [ %24, %21 ], [ %16, %15 ]
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%24 = add nsw i32 %22, -1
%25 = icmp sgt i32 %22, 1
br i1 %25, label %21, label %17
26: ; preds = %35, %17
%27 = getelementptr inbounds i32*, i32** %0, i64 %12
%28 = load i32*, i32** %27
%29 = sub nsw i64 %7, %12
%30 = getelementptr inbounds i32, i32* %28, i64 %29
%31 = load i32, i32* %30
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %31)
%33 = add nuw nsw i64 %12, 1
%34 = icmp eq i64 %33, %8
br i1 %34, label %10, label %11
35: ; preds = %19, %35
%36 = phi i64 [ %12, %19 ], [ %42, %35 ]
%37 = load i32*, i32** %20
%38 = sub nuw nsw i64 %36, %12
%39 = getelementptr inbounds i32, i32* %37, i64 %38
%40 = load i32, i32* %39
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %40)
%42 = add nuw nsw i64 %36, 1
%43 = icmp eq i64 %42, %9
br i1 %43, label %26, label %35
}