#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 desenhar(char v[3][3]) {
  int i;
  printf("\n\n");
  for (i = 0; i <= 2; i++) {
    printf("\t\t\t\t\t");
    printf("%c | %c | %c", v[i][0], v[i][1], v[i][2]);
    if (i < 2)
      printf("\n\t\t\t\t\t----------\n");
  }
  printf("\n\n\n\n");
}


x86 assembly (clang, -O0):
<desenhar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xf04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jg     11ba <desenhar+0xaa>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x3,%rcx,%rcx
add    %rcx,%rax
movsbl (%rax),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x3,%rcx,%rcx
add    %rcx,%rax
movsbl 0x1(%rax),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x3,%rcx,%rcx
add    %rcx,%rax
movsbl 0x2(%rax),%ecx
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x2,-0xc(%rbp)
jge    11a7 <desenhar+0x97>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ac <desenhar+0x9c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <desenhar+0x21>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<desenhar>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec2(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl (%rbx),%esi
movsbl 0x1(%rbx),%edx
movsbl 0x2(%rbx),%ecx
lea    0xeac(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeac(%rip),%r12
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x3(%rbx),%esi
movsbl 0x4(%rbx),%edx
movsbl 0x5(%rbx),%ecx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x6(%rbx),%esi
movsbl 0x7(%rbx),%edx
movsbl 0x8(%rbx),%ecx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe51(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str.1 = [6 x i8] c"\09\09\09\09\09\00"
@.str.2 = [13 x i8] c"%c | %c | %c\00"
@str = [2 x i8] c"\0A\00"
@str.5 = [4 x i8] c"\0A\0A\0A\00"
@str.6 = [17 x i8] c"\0A\09\09\09\09\09----------\00"
define void @desenhar([3 x i8]* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %0, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %0, i64 0, i64 1
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %0, i64 0, i64 2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %9, i32 %12)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.6, i64 0, i64 0))
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%16 = getelementptr inbounds [3 x i8], [3 x i8]* %0, i64 1, i64 0
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = getelementptr inbounds [3 x i8], [3 x i8]* %0, i64 1, i64 1
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = getelementptr inbounds [3 x i8], [3 x i8]* %0, i64 1, i64 2
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %18, i32 %21, i32 %24)
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.6, i64 0, i64 0))
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%28 = getelementptr inbounds [3 x i8], [3 x i8]* %0, i64 2, i64 0
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = getelementptr inbounds [3 x i8], [3 x i8]* %0, i64 2, i64 1
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = getelementptr inbounds [3 x i8], [3 x i8]* %0, i64 2, i64 2
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %30, i32 %33, i32 %36)
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.5, i64 0, i64 0))
ret void
}