#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*/ imprimelinha(int);
int /*<<< orphan*/ printf(char *, ...);
void imprimeMatriz(int **matriz, int linha, int coluna) {
  int i, j;
  imprimelinha(coluna);
  for (i = 0; i < linha; i++) {
    printf("|");
    for (j = 0; j < coluna; j++) {
      if (matriz[i][j] == 0) {
        printf(" %c ", ' ');
      } else {
        printf(" %c ", '*');
      }
    }
    printf("|\n");
  }
  imprimelinha(coluna);
  printf("\n");
}


x86 assembly (clang, -O0):
<imprimeMatriz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <imprimelinha@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11e2 <imprimeMatriz+0xc2>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11c6 <imprimeMatriz+0xa6>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    11a0 <imprimeMatriz+0x80>
lea    0xe73(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11b3 <imprimeMatriz+0x93>
lea    0xe5b(%rip),%rdi
mov    $0x2a,%esi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11b8 <imprimeMatriz+0x98>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1162 <imprimeMatriz+0x42>
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <imprimeMatriz+0x21>
mov    -0x10(%rbp),%edi
call   1030 <imprimelinha@plt>
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimeMatriz>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %edx,0x4(%rsp)
mov    %edx,%edi
call   1050 <imprimelinha@plt>
test   %ebp,%ebp
jle    11da <imprimeMatriz+0x9a>
mov    %ebp,%r12d
mov    0x4(%rsp),%ebp
lea    0xe93(%rip),%r13
xor    %r15d,%r15d
jmp    1195 <imprimeMatriz+0x55>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xe7e(%rip),%rdi
call   1040 <puts@plt>
add    $0x1,%r15
cmp    %r12,%r15
je     11da <imprimeMatriz+0x9a>
mov    $0x7c,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x4(%rsp)
jle    1180 <imprimeMatriz+0x40>
xor    %r14d,%r14d
jmp    11c3 <imprimeMatriz+0x83>
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%r14
cmp    %r14,%rbp
je     1180 <imprimeMatriz+0x40>
mov    (%rbx,%r15,8),%rax
cmpl   $0x0,(%rax,%r14,4)
mov    $0x20,%esi
je     11b0 <imprimeMatriz+0x70>
mov    $0x2a,%esi
jmp    11b0 <imprimeMatriz+0x70>
mov    0x4(%rsp),%edi
call   1050 <imprimelinha@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

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