#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*/ PrintSubTitles(char *);
int /*<<< orphan*/ printf(char *, int, int);
void PrintArrayValues(int *puntero, int renglones, int columnas) {
  int total = renglones * columnas;
  PrintSubTitles(" Valores de cada posición ");
  for (int i = 0; i < total; i++) {
    i += 1;
    printf("p[%d]: %d\n", i, *(puntero + i));
  }
}


x86 assembly (clang, -O0):
<PrintArrayValues>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <PrintSubTitles@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    118c <PrintArrayValues+0x6c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114f <PrintArrayValues+0x2f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintArrayValues>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r14
imul   %edx,%ebp
lea    0xeca(%rip),%rdi
call   1030 <PrintSubTitles@plt>
test   %ebp,%ebp
jle    1168 <PrintArrayValues+0x48>
xor    %ebx,%ebx
lea    0xed4(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    0x4(%r14,%rbx,4),%edx
lea    0x1(%rbx),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
add    $0x2,%rbx
cmp    %ebx,%ebp
jg     1150 <PrintArrayValues+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [28 x i8] c" Valores de cada posici\C3\B3n \00"
@.str.1 = [11 x i8] c"p[%d]: %d\0A\00"
define void @PrintArrayValues(i32* nocapture %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
%5 = tail call i32 @PrintSubTitles(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = icmp sgt i32 %4, 0
br i1 %6, label %8, label %7
7: ; preds = %8, %3
ret void
8: ; preds = %3, %8
%9 = phi i64 [ %15, %8 ], [ 0, %3 ]
%10 = or i64 %9, 1
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = trunc i64 %10 to i32
%14 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %12)
%15 = add nuw i64 %9, 2
%16 = trunc i64 %15 to i32
%17 = icmp sgt i32 %4, %16
br i1 %17, label %8, label %7
}