#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 imprime_matriz(double **A, long n) {
  printf("\n *************** MATRIZ INICIAL****************\n");
  long i, j;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++)
      printf("%f ", A[j][i]);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<imprime_matriz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    11ad <imprime_matriz+0x9d>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    118e <imprime_matriz+0x7e>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xebc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    114c <imprime_matriz+0x3c>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1136 <imprime_matriz+0x26>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprime_matriz>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xebe(%rip),%rdi
call   1040 <puts@plt>
test   %r12,%r12
jle    11a0 <imprime_matriz+0x70>
xor    %r13d,%r13d
lea    0xea6(%rip),%r15
nopw   0x0(%rax,%rax,1)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rax
movsd  (%rax,%r13,8),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1170 <imprime_matriz+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r13
cmp    %r12,%r13
jne    1160 <imprime_matriz+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%f \00"
@str = [49 x i8] c"\0A *************** MATRIZ INICIAL****************\00"
define void @imprime_matriz(double** nocapture %0, i64 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%4 = icmp sgt i64 %1, 0
br i1 %4, label %5, label %20
5: ; preds = %2, %16
%6 = phi i64 [ %18, %16 ], [ 0, %2 ]
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ %14, %7 ], [ 0, %5 ]
%9 = getelementptr inbounds double*, double** %0, i64 %8
%10 = load double*, double** %9
%11 = getelementptr inbounds double, double* %10, i64 %6
%12 = load double, double* %11
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %12)
%14 = add nuw nsw i64 %8, 1
%15 = icmp eq i64 %14, %1
br i1 %15, label %16, label %7
16: ; preds = %7
%17 = tail call i32 @putchar(i32 10)
%18 = add nuw nsw i64 %6, 1
%19 = icmp eq i64 %18, %1
br i1 %19, label %20, label %5
20: ; preds = %16, %2
ret void
}