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


x86 assembly (clang, -O0):
<escribe_matriz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1199 <escribe_matriz+0x89>
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    117d <escribe_matriz+0x6d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe9a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <escribe_matriz+0x32>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <escribe_matriz+0x21>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escribe_matriz>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rax
movsd  (%rax),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rax
movsd  0x8(%rax),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rax
movsd  0x10(%rax),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rax
movsd  0x18(%rax),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rax
movsd  0x20(%rax),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rax
movsd  0x28(%rax),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rax
movsd  0x30(%rax),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rax
movsd  0x38(%rax),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rax
movsd  0x40(%rax),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rax
movsd  0x48(%rax),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0xa,%rbx
jne    1140 <escribe_matriz+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

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