#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 IMPRIME_PARENTIZACAO(int **s, int i, int j) {
  if (i == j)
    printf("Ai");
  else {
    printf("(");
    IMPRIME_PARENTIZACAO(s, i, s[i][j]);
    IMPRIME_PARENTIZACAO(s, s[i][j] + 1, j);
    printf(")");
  }
}


x86 assembly (clang, -O0):
<IMPRIME_PARENTIZACAO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    114f <IMPRIME_PARENTIZACAO+0x2f>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
jmp    11a8 <IMPRIME_PARENTIZACAO+0x88>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
call   1040 <IMPRIME_PARENTIZACAO@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <IMPRIME_PARENTIZACAO@plt>
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IMPRIME_PARENTIZACAO>:
cmp    %edx,%esi
jne    1140 <IMPRIME_PARENTIZACAO+0x10>
lea    0xec5(%rip),%rdi
jmp    1040 <printf@plt>
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x28,%edi
call   1030 <putchar@plt>
movslq %ebp,%r15
mov    (%rbx,%r15,8),%rax
movslq %r14d,%r12
mov    (%rax,%r12,4),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <IMPRIME_PARENTIZACAO@plt>
mov    (%rbx,%r15,8),%rax
mov    (%rax,%r12,4),%esi
add    $0x1,%esi
mov    %rbx,%rdi
mov    %r14d,%edx
call   1050 <IMPRIME_PARENTIZACAO@plt>
mov    $0x29,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

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