#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 *, ...);
int montagem(int matriz[9][9]) {
  int linha, coluna;
  for (linha = 0; linha <= 8; linha++) {
    if (linha == 3 || linha == 6) {
      printf("- - - - - - - - - - -\n");
    }
    for (coluna = 0; coluna <= 8; coluna++) {
      if (coluna == 8) {
        printf("%d", matriz[linha][coluna]);
      } else {
        printf("%d ", matriz[linha][coluna]);
      }
      if (coluna == 2 || coluna == 5) {
        printf("| ");
      }
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<montagem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jg     1208 <montagem+0xf8>
cmpl   $0x3,-0xc(%rbp)
je     1141 <montagem+0x31>
cmpl   $0x6,-0xc(%rbp)
jne    114f <montagem+0x3f>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jg     11ec <montagem+0xdc>
cmpl   $0x8,-0x10(%rbp)
jne    1193 <montagem+0x83>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b7 <montagem+0xa7>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x2,-0x10(%rbp)
je     11cb <montagem+0xbb>
cmpl   $0x5,-0x10(%rbp)
jne    11d9 <montagem+0xc9>
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11de <montagem+0xce>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <montagem+0x46>
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <montagem+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<montagem>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x20,%rbx
lea    0xec1(%rip),%r14
lea    0xeb3(%rip),%r15
lea    0xeb0(%rip),%r12
lea    0xea2(%rip),%r13
xor    %ebp,%ebp
jmp    1218 <montagem+0xe8>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
call   1040 <puts@plt>
mov    -0x20(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x1c(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x18(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x14(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x10(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0xc(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x8(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x4(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
add    $0x24,%rbx
cmp    $0x9,%rbp
je     122f <montagem+0xff>
cmp    $0x6,%ebp
je     1170 <montagem+0x40>
cmp    $0x3,%ebp
je     1170 <montagem+0x40>
jmp    1178 <montagem+0x48>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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