#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*/ array2;
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ printAdd(int *, int, int);
int /*<<< orphan*/ printVal(int *, int, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int array[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int array2[2][3] = {{1, 2, 3}, {4, 5, 6}};
  int length = 0;
  int width = 0;
  length = sizeof(array) / sizeof(array[0]);
  printf("--------------Imprimiendo Valores de Array---------\n\n");
  printVal(&array[0], length, width);
  printf("--------------Imprimiendo Address de Array---------\n\n");
  printAdd(&array[0], length, width);
  length = sizeof(array2) / sizeof(array2[0]);
  width = sizeof(array2[0]) / sizeof(array2[0][0]);
  printf(
      "-------------Imprimiendo Valores Arreglo Multi------------------\n\n");
  printVal(&array2[0][0], length, width);
  printf(
      "-------------Imprimiendo Address Arreglo Multi------------------\n\n");
  printAdd(&array2[0][0], length, width);
}


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   1040 <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   1050 <printVal@plt>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   1060 <printAdd@plt>
movl   $0x2,-0x54(%rbp)
movl   $0x3,-0x58(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   1050 <printVal@plt>
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   1060 <printAdd@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 <printVal@plt>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %edx,%edx
call   1050 <printAdd@plt>
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <printVal@plt>
lea    0xf21(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1050 <printAdd@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array = [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.array2 = [2 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6]]
@.str = [54 x i8] c"--------------Imprimiendo Valores de Array---------\0A\0A\00"
@.str.1 = [54 x i8] c"--------------Imprimiendo Address de Array---------\0A\0A\00"
@.str.2 = [67 x i8] c"-------------Imprimiendo Valores Arreglo Multi------------------\0A\0A\00"
@.str.3 = [67 x i8] c"-------------Imprimiendo Address Arreglo Multi------------------\0A\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 ([54 x i8], [54 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 @printVal(i32* %8, i32 %9, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 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 @printAdd(i32* %13, i32 %14, i32 %15)
store i32 2, i32* %3
store i32 3, i32* %4
%17 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 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 @printVal(i32* %19, i32 %20, i32 %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 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 @printAdd(i32* %25, i32 %26, i32 %27)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [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.array2 = [2 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6]]
@str = [53 x i8] c"--------------Imprimiendo Valores de Array---------\0A\00"
@str.4 = [53 x i8] c"--------------Imprimiendo Address de Array---------\0A\00"
@str.5 = [66 x i8] c"-------------Imprimiendo Valores Arreglo Multi------------------\0A\00"
@str.6 = [66 x i8] c"-------------Imprimiendo Address Arreglo Multi------------------\0A\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 ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @printVal(i32* %6, i32 10, i32 0)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.4, i64 0, i64 0))
%9 = call i32 @printAdd(i32* %6, i32 10, i32 0)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 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 @printVal(i32* %11, i32 2, i32 3)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.6, i64 0, i64 0))
%14 = call i32 @printAdd(i32* %11, i32 2, i32 3)
ret i32 0
}