#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 imprimir_comodo(int mat[6][6], int sujeira[2][2], int carrinho[2]) {
  int i, j;
  for (i = 0; i < 6; i++) {
    for (j = 0; j < 6; j++) {
      if (i == carrinho[0] && j == carrinho[1]) {
        printf("%c ", 178);
      } else if ((i == sujeira[0][0] && j == sujeira[0][1])) {
        printf("* ");
      } else if (mat[i][j] == 1) {
        printf("0 ");
      } else {
        printf("  ");
      }
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<imprimir_comodo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x6,-0x1c(%rbp)
jge    1226 <imprimir_comodo+0x116>
movl   $0x0,-0x20(%rbp)
cmpl   $0x6,-0x20(%rbp)
jge    120a <imprimir_comodo+0xfa>
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    117d <imprimir_comodo+0x6d>
mov    -0x20(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    0x4(%rcx),%eax
jne    117d <imprimir_comodo+0x6d>
lea    0xe94(%rip),%rdi
mov    $0xb2,%esi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f7 <imprimir_comodo+0xe7>
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jne    11af <imprimir_comodo+0x9f>
mov    -0x20(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    0x4(%rcx),%eax
jne    11af <imprimir_comodo+0x9f>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f2 <imprimir_comodo+0xe2>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    11df <imprimir_comodo+0xcf>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ed <imprimir_comodo+0xdd>
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f2 <imprimir_comodo+0xe2>
jmp    11f7 <imprimir_comodo+0xe7>
jmp    11fc <imprimir_comodo+0xec>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    113c <imprimir_comodo+0x2c>
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <imprimir_comodo+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimir_comodo>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xecf(%rip),%r13
xor    %r12d,%r12d
jmp    1158 <imprimir_comodo+0x38>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12
add    $0x18,%r15
cmp    $0x6,%r12
je     11d0 <imprimir_comodo+0xb0>
xor    %ebp,%ebp
jmp    1174 <imprimir_comodo+0x54>
nopl   0x0(%rax)
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    $0x6,%rbp
je     1140 <imprimir_comodo+0x20>
mov    (%rbx),%eax
cmp    %rax,%r12
jne    11a0 <imprimir_comodo+0x80>
mov    0x4(%rbx),%eax
cmp    %rax,%rbp
jne    11a0 <imprimir_comodo+0x80>
lea    0xe76(%rip),%rdi
mov    $0xb2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    116a <imprimir_comodo+0x4a>
nopl   0x0(%rax,%rax,1)
mov    (%r14),%eax
cmp    %rax,%r12
jne    11c0 <imprimir_comodo+0xa0>
mov    0x4(%r14),%eax
cmp    %rax,%rbp
jne    11c0 <imprimir_comodo+0xa0>
lea    0xe4c(%rip),%rdi
jmp    1163 <imprimir_comodo+0x43>
nopw   0x0(%rax,%rax,1)
cmpl   $0x1,(%r15,%rbp,4)
jne    1160 <imprimir_comodo+0x40>
lea    0xe39(%rip),%rdi
jmp    1163 <imprimir_comodo+0x43>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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