#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 imprimeV(double *data) {
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 2; j++) {
      printf("vx[%d][%d] es: %f\n", i, j, data[i * 10000 + j]);
    }
  }
}


x86 assembly (clang, -O0):
<imprimeV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1187 <imprimeV+0x77>
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    1174 <imprimeV+0x64>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
imul   $0x2710,-0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <imprimeV+0x24>
jmp    1179 <imprimeV+0x69>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <imprimeV+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimeV>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
add    $0x8,%r14
xor    %ebx,%ebx
lea    0xedb(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
movsd  -0x8(%r14),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
xor    %edx,%edx
call   1030 <printf@plt>
movsd  (%r14),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
add    $0x1,%rbx
add    $0x13880,%r14
cmp    $0xa,%rbx
jne    1130 <imprimeV+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"vx[%d][%d] es: %f\0A\00"
define void @imprimeV(double* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %13, %2 ]
%4 = mul nuw nsw i64 %3, 10000
%5 = getelementptr inbounds double, double* %0, i64 %4
%6 = load double, double* %5
%7 = trunc i64 %3 to i32
%8 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, i32 0, double %6)
%9 = or i64 %4, 1
%10 = getelementptr inbounds double, double* %0, i64 %9
%11 = load double, double* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, i32 1, double %11)
%13 = add nuw nsw i64 %3, 1
%14 = icmp eq i64 %13, 10
br i1 %14, label %15, label %2
15: ; preds = %2
ret void
}