#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 */
typedef int /*<<< orphan*/ matrix;
typedef int /*<<< orphan*/ arreglo;

/* Variables and functions */
int /*<<< orphan*/ imprime_direccion(void *, int, int);
int /*<<< orphan*/ imprime_valores(void *, int, int);
int main() {
  int arreglo[10] = {-10, -9, -8, -7, -6, -5, -4, -3, -2, -1};
  int matrix[2][3] = {{-1, -2, -3}, {-4, -5, -6}};
  void *apuntador;
  apuntador = &arreglo;
  imprime_valores(apuntador, (sizeof(arreglo) / sizeof(arreglo[0])), 1);
  imprime_direccion(apuntador, (sizeof(arreglo) / sizeof(arreglo[0])), 1);
  apuntador = &matrix;
  imprime_valores(apuntador, (sizeof(matrix) / sizeof(matrix[0])),
                  (sizeof(matrix[0]) / sizeof(matrix[0][0])));
  imprime_direccion(apuntador, (sizeof(matrix) / sizeof(matrix[0])),
                    (sizeof(matrix[0]) / sizeof(matrix[0][0])));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
mov    0xed5(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xed2(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xecf(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
call   1030 <imprime_valores@plt>
mov    -0x58(%rbp),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
call   1050 <imprime_direccion@plt>
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <imprime_valores@plt>
mov    -0x58(%rbp),%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1050 <imprime_direccion@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xef0(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x1,%edx
call   1030 <imprime_valores@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x1,%edx
call   1040 <imprime_direccion@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <imprime_valores@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <imprime_direccion@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arreglo = [10 x i32] [i32 -10, i32 -9, i32 -8, i32 -7, i32 -6, i32 -5, i32 -4, i32 -3, i32 -2, i32 -1]
@__const.main.matrix = [2 x [3 x i32]] [[3 x i32] [i32 -1, i32 -2, i32 -3], [3 x i32] [i32 -4, i32 -5, i32 -6]]
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [2 x [3 x i32]]
%4 = alloca i8*
store i32 0, i32* %1
%5 = bitcast [10 x i32]* %2 to i8*
%6 = bitcast [2 x [3 x i32]]* %3 to i8*
%7 = bitcast [10 x i32]* %2 to i8*
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @imprime_valores(i8* %8, i32 10, i32 1)
%10 = load i8*, i8** %4
%11 = call i32 @imprime_direccion(i8* %10, i32 10, i32 1)
%12 = bitcast [2 x [3 x i32]]* %3 to i8*
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = call i32 @imprime_valores(i8* %13, i32 2, i32 3)
%15 = load i8*, i8** %4
%16 = call i32 @imprime_direccion(i8* %15, i32 2, i32 3)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arreglo = [10 x i32] [i32 -10, i32 -9, i32 -8, i32 -7, i32 -6, i32 -5, i32 -4, i32 -3, i32 -2, i32 -1]
@__const.main.matrix = [2 x [3 x i32]] [[3 x i32] [i32 -1, i32 -2, i32 -3], [3 x i32] [i32 -4, i32 -5, i32 -6]]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [2 x [3 x i32]]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [2 x [3 x i32]]* %2 to i8*
%5 = call i32 @imprime_valores(i8* %3, i32 10, i32 1)
%6 = call i32 @imprime_direccion(i8* %3, i32 10, i32 1)
%7 = call i32 @imprime_valores(i8* %4, i32 2, i32 3)
%8 = call i32 @imprime_direccion(i8* %4, i32 2, i32 3)
ret i32 0
}