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

/* Variables and functions */
int /*<<< orphan*/ imprime_adress(int *, int, int);
int /*<<< orphan*/ imprime_valores(int *, int, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int arreglo[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int arreglo2[2][3] = {{1, 2, 3}, {4, 5, 6}};
  int len = 0;
  int len2 = 0;
  len = sizeof(arreglo) / sizeof(arreglo[0]);
  printf("Los valores del arreglo son: \n");
  imprime_valores(&arreglo[0], len, len2);
  printf("El adress del arreglo: \n");
  imprime_adress(&arreglo[0], len, len2);
  len = sizeof(arreglo2) / sizeof(arreglo2[0]);
  len2 = sizeof(arreglo2[0]) / sizeof(arreglo2[0][0]);
  printf("Los valores del arreglo multidimensional son: \n");
  imprime_valores(&arreglo2[0][0], len, len2);
  printf("El adress del arreglo multidimensional: \n");
  imprime_adress(&arreglo2[0][0], len, len2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
mov    0xecc(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xec9(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xec6(%rip),%rax
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
movl   $0xa,-0x54(%rbp)
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   1040 <imprime_valores@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   1050 <imprime_adress@plt>
movl   $0x2,-0x54(%rbp)
movl   $0x3,-0x58(%rbp)
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   1040 <imprime_valores@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   1050 <imprime_adress@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    0xee4(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xee0(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %edx,%edx
call   1040 <imprime_valores@plt>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %edx,%edx
call   1050 <imprime_adress@plt>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <imprime_valores@plt>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1050 <imprime_adress@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arreglo = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@__const.main.arreglo2 = [2 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6]]
@.str = [31 x i8] c"Los valores del arreglo son: \0A\00"
@.str.1 = [25 x i8] c"El adress del arreglo: \0A\00"
@.str.2 = [48 x i8] c"Los valores del arreglo multidimensional son: \0A\00"
@.str.3 = [42 x i8] c"El adress del arreglo multidimensional: \0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [2 x [3 x i32]]
%3 = alloca i32
%4 = alloca i32
%5 = bitcast [10 x i32]* %1 to i8*
%6 = bitcast [2 x [3 x i32]]* %2 to i8*
store i32 0, i32* %3
store i32 0, i32* %4
store i32 10, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @imprime_valores(i32* %8, i32 %9, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @imprime_adress(i32* %13, i32 %14, i32 %15)
store i32 2, i32* %3
store i32 3, i32* %4
%17 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%18 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %2, i64 0, i64 0
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %18, i64 0, i64 0
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = call i32 @imprime_valores(i32* %19, i32 %20, i32 %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
%24 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %2, i64 0, i64 0
%25 = getelementptr inbounds [3 x i32], [3 x i32]* %24, i64 0, i64 0
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = call i32 @imprime_adress(i32* %25, i32 %26, i32 %27)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arreglo = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@__const.main.arreglo2 = [2 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6]]
@str = [30 x i8] c"Los valores del arreglo son: \00"
@str.4 = [24 x i8] c"El adress del arreglo: \00"
@str.5 = [47 x i8] c"Los valores del arreglo multidimensional son: \00"
@str.6 = [41 x i8] c"El adress del arreglo multidimensional: \00"
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 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @imprime_valores(i32* %6, i32 10, i32 0)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.4, i64 0, i64 0))
%9 = call i32 @imprime_adress(i32* %6, i32 10, i32 0)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.5, i64 0, i64 0))
%11 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %2, i64 0, i64 0, i64 0
%12 = call i32 @imprime_valores(i32* %11, i32 2, i32 3)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.6, i64 0, i64 0))
%14 = call i32 @imprime_adress(i32* %11, i32 2, i32 3)
ret i32 0
}