#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 mostra_caminho(float **mat) {
  int i, j, linha = 10, coluna = 10;
  for (i = 0; i < linha; i++) {
    for (j = 0; j < coluna; j++) {
      if (mat[i][j] == 2) {
        printf("0");
      } else {
        printf("1");
      }
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<mostra_caminho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xa,-0x14(%rbp)
movl   $0xa,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11c6 <mostra_caminho+0xb6>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11ac <mostra_caminho+0x9c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  0xe93(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    118d <mostra_caminho+0x7d>
jp     118d <mostra_caminho+0x7d>
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
jmp    1199 <mostra_caminho+0x89>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
jmp    119e <mostra_caminho+0x8e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <mostra_caminho+0x34>
lea    0xe55(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <mostra_caminho+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mostra_caminho>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rax
movss  (%rax),%xmm0
movss  0xed0(%rip),%xmm1
cmpeqss %xmm1,%xmm0
movd   %xmm0,%edi
add    $0x31,%edi
call   1030 <putchar@plt>
mov    (%r14,%rbx,8),%rax
movss  0x4(%rax),%xmm0
cmpeqss 0xead(%rip),%xmm0
movd   %xmm0,%edi
add    $0x31,%edi
call   1030 <putchar@plt>
mov    (%r14,%rbx,8),%rax
movss  0x8(%rax),%xmm0
cmpeqss 0xe8f(%rip),%xmm0
movd   %xmm0,%edi
add    $0x31,%edi
call   1030 <putchar@plt>
mov    (%r14,%rbx,8),%rax
movss  0xc(%rax),%xmm0
cmpeqss 0xe71(%rip),%xmm0
movd   %xmm0,%edi
add    $0x31,%edi
call   1030 <putchar@plt>
mov    (%r14,%rbx,8),%rax
movss  0x10(%rax),%xmm0
cmpeqss 0xe53(%rip),%xmm0
movd   %xmm0,%edi
add    $0x31,%edi
call   1030 <putchar@plt>
mov    (%r14,%rbx,8),%rax
movss  0x14(%rax),%xmm0
cmpeqss 0xe35(%rip),%xmm0
movd   %xmm0,%edi
add    $0x31,%edi
call   1030 <putchar@plt>
mov    (%r14,%rbx,8),%rax
movss  0x18(%rax),%xmm0
cmpeqss 0xe17(%rip),%xmm0
movd   %xmm0,%edi
add    $0x31,%edi
call   1030 <putchar@plt>
mov    (%r14,%rbx,8),%rax
movss  0x1c(%rax),%xmm0
cmpeqss 0xdf9(%rip),%xmm0
movd   %xmm0,%edi
add    $0x31,%edi
call   1030 <putchar@plt>
mov    (%r14,%rbx,8),%rax
movss  0x20(%rax),%xmm0
cmpeqss 0xddb(%rip),%xmm0
movd   %xmm0,%edi
add    $0x31,%edi
call   1030 <putchar@plt>
mov    (%r14,%rbx,8),%rax
movss  0x24(%rax),%xmm0
cmpeqss 0xdbd(%rip),%xmm0
movd   %xmm0,%edi
add    $0x31,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0xa,%rbx
jne    1120 <mostra_caminho+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @mostra_caminho(float** nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %65, %2 ]
%4 = getelementptr inbounds float*, float** %0, i64 %3
%5 = load float*, float** %4
%6 = load float, float* %5
%7 = fcmp oeq float %6, 2.000000e+00
%8 = select i1 %7, i32 48, i32 49
%9 = tail call i32 @putchar(i32 %8)
%10 = load float*, float** %4
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = fcmp oeq float %12, 2.000000e+00
%14 = select i1 %13, i32 48, i32 49
%15 = tail call i32 @putchar(i32 %14)
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 2
%18 = load float, float* %17
%19 = fcmp oeq float %18, 2.000000e+00
%20 = select i1 %19, i32 48, i32 49
%21 = tail call i32 @putchar(i32 %20)
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 3
%24 = load float, float* %23
%25 = fcmp oeq float %24, 2.000000e+00
%26 = select i1 %25, i32 48, i32 49
%27 = tail call i32 @putchar(i32 %26)
%28 = load float*, float** %4
%29 = getelementptr inbounds float, float* %28, i64 4
%30 = load float, float* %29
%31 = fcmp oeq float %30, 2.000000e+00
%32 = select i1 %31, i32 48, i32 49
%33 = tail call i32 @putchar(i32 %32)
%34 = load float*, float** %4
%35 = getelementptr inbounds float, float* %34, i64 5
%36 = load float, float* %35
%37 = fcmp oeq float %36, 2.000000e+00
%38 = select i1 %37, i32 48, i32 49
%39 = tail call i32 @putchar(i32 %38)
%40 = load float*, float** %4
%41 = getelementptr inbounds float, float* %40, i64 6
%42 = load float, float* %41
%43 = fcmp oeq float %42, 2.000000e+00
%44 = select i1 %43, i32 48, i32 49
%45 = tail call i32 @putchar(i32 %44)
%46 = load float*, float** %4
%47 = getelementptr inbounds float, float* %46, i64 7
%48 = load float, float* %47
%49 = fcmp oeq float %48, 2.000000e+00
%50 = select i1 %49, i32 48, i32 49
%51 = tail call i32 @putchar(i32 %50)
%52 = load float*, float** %4
%53 = getelementptr inbounds float, float* %52, i64 8
%54 = load float, float* %53
%55 = fcmp oeq float %54, 2.000000e+00
%56 = select i1 %55, i32 48, i32 49
%57 = tail call i32 @putchar(i32 %56)
%58 = load float*, float** %4
%59 = getelementptr inbounds float, float* %58, i64 9
%60 = load float, float* %59
%61 = fcmp oeq float %60, 2.000000e+00
%62 = select i1 %61, i32 48, i32 49
%63 = tail call i32 @putchar(i32 %62)
%64 = tail call i32 @putchar(i32 10)
%65 = add nuw nsw i64 %3, 1
%66 = icmp eq i64 %65, 10
br i1 %66, label %67, label %2
67: ; preds = %2
ret void
}