#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 *, ...);
imprimeMatriz(double *S, int N, int r) {
  int i, j, I, J, despB;
  printf("Contenido de la matriz: \n");
  for (I = 0; I < N; I++) {
    for (i = 0; i < r; i++) {
      for (J = 0; J < N; J++) {
        despB = (I * N + J) * r * r;
        for (j = 0; j < r; j++) {
          printf("%f ", S[despB + i * r + j]);
        };
      };
      printf("\n ");
    };
  };
  printf(" \n\n");
}


x86 assembly (clang, -O0):
<imprimeMatriz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    120a <imprimeMatriz+0xfa>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11f7 <imprimeMatriz+0xe7>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11db <imprimeMatriz+0xcb>
mov    -0x24(%rbp),%eax
imul   -0x14(%rbp),%eax
add    -0x28(%rbp),%eax
imul   -0x18(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11c8 <imprimeMatriz+0xb8>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    -0x1c(%rbp),%edx
imul   -0x18(%rbp),%edx
add    %edx,%ecx
add    -0x20(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe67(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1185 <imprimeMatriz+0x75>
jmp    11cd <imprimeMatriz+0xbd>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    115d <imprimeMatriz+0x4d>
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114a <imprimeMatriz+0x3a>
jmp    11fc <imprimeMatriz+0xec>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1137 <imprimeMatriz+0x27>
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimeMatriz>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %edx,0xc(%rsp)
mov    %esi,%ebx
mov    %rdi,0x30(%rsp)
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
test   %ebx,%ebx
jle    1234 <imprimeMatriz+0x114>
mov    %ebx,%eax
mov    %ebx,%ecx
mov    %eax,%eax
mov    %rax,0x20(%rsp)
mov    0xc(%rsp),%eax
mov    %eax,%r14d
imul   %eax,%eax
mov    %eax,0x1c(%rsp)
imul   %eax,%ecx
mov    %ecx,0x10(%rsp)
lea    0xe8c(%rip),%rbx
movl   $0x0,0x8(%rsp)
xor    %ecx,%ecx
jmp    11a0 <imprimeMatriz+0x80>
mov    0x28(%rsp),%rcx
add    $0x1,%rcx
mov    0x8(%rsp),%eax
add    0x10(%rsp),%eax
mov    %eax,0x8(%rsp)
cmp    0x20(%rsp),%rcx
je     1234 <imprimeMatriz+0x114>
mov    %rcx,0x28(%rsp)
cmpl   $0x0,0xc(%rsp)
jle    1180 <imprimeMatriz+0x60>
xor    %ecx,%ecx
mov    0x8(%rsp),%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ecx,0x18(%rsp)
mov    %r12d,0x14(%rsp)
xor    %r13d,%r13d
nopl   0x0(%rax)
movslq %r12d,%rax
mov    0x30(%rsp),%rcx
lea    (%rcx,%rax,8),%rbp
xor    %r15d,%r15d
nop
movsd  0x0(%rbp,%r15,8),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%r15
cmp    %r15,%r14
jne    11e0 <imprimeMatriz+0xc0>
add    $0x1,%r13
add    0x1c(%rsp),%r12d
cmp    0x20(%rsp),%r13
jne    11d0 <imprimeMatriz+0xb0>
lea    0xdf3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%ecx
add    $0x1,%ecx
mov    0xc(%rsp),%eax
mov    0x14(%rsp),%r12d
add    %eax,%r12d
cmp    %eax,%ecx
jne    11c0 <imprimeMatriz+0xa0>
jmp    1180 <imprimeMatriz+0x60>
lea    0xde5(%rip),%rdi
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

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

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