#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, int, double);
void imprime_matriz(double **matriz) {
  int i, j;
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 10; j++) {
      printf("mat[%d,%d] = %lf\n", i, j, matriz[i][j]);
    }
  }
}


x86 assembly (clang, -O0):
<imprime_matriz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1186 <imprime_matriz+0x76>
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    1173 <imprime_matriz+0x63>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <imprime_matriz+0x24>
jmp    1178 <imprime_matriz+0x68>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <imprime_matriz+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprime_matriz>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xedf(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rax
movsd  (%rax),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    (%r14,%rbx,8),%rax
movsd  0x8(%rax),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    (%r14,%rbx,8),%rax
movsd  0x10(%rax),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
mov    (%r14,%rbx,8),%rax
movsd  0x18(%rax),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
mov    (%r14,%rbx,8),%rax
movsd  0x20(%rax),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
mov    (%r14,%rbx,8),%rax
movsd  0x28(%rax),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x5,%edx
call   1030 <printf@plt>
mov    (%r14,%rbx,8),%rax
movsd  0x30(%rax),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x6,%edx
call   1030 <printf@plt>
mov    (%r14,%rbx,8),%rax
movsd  0x38(%rax),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x7,%edx
call   1030 <printf@plt>
mov    (%r14,%rbx,8),%rax
movsd  0x40(%rax),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x8,%edx
call   1030 <printf@plt>
mov    (%r14,%rbx,8),%rax
movsd  0x48(%rax),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x9,%edx
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0xa,%rbx
jne    1130 <imprime_matriz+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

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