#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*/ imprimirDirecciones(int *, int *);
int /*<<< orphan*/ imprimirValores(int *, int *);
int /*<<< orphan*/ printf(char *);
int main() {
  int arreglo[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int arreglo2[][4] = {
      {1, 2, 3, 4}, {4, 5, 6, 7}, {4, 5, 6, 7}, {4, 5, 6, 7}, {4, 5, 6, 7}};
  int dimension[2] = {0};
  int n, m;
  dimension[0] = sizeof(arreglo) / sizeof(arreglo[0]);
  n = sizeof(arreglo2) / sizeof(arreglo2[0]);
  m = sizeof(arreglo2[0]) / sizeof(arreglo2[0][0]);
  printf("\n\n");
  imprimirValores(&arreglo[0], &dimension[0]);
  imprimirDirecciones(&arreglo[0], &dimension[0]);
  dimension[1] = m;
  dimension[0] = n;
  imprimirValores(&arreglo2[0][0], &dimension[0]);
  imprimirDirecciones(&arreglo2[0][0], &dimension[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe93(%rip),%rsi
mov    $0x28,%edx
call   1070 <memcpy@plt>
lea    -0x80(%rbp),%rdi
lea    0xeae(%rip),%rsi
mov    $0x50,%edx
call   1070 <memcpy@plt>
lea    -0x88(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
movl   $0xa,-0x88(%rbp)
movl   $0x5,-0x8c(%rbp)
movl   $0x4,-0x90(%rbp)
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x88(%rbp),%rsi
call   1060 <imprimirValores@plt>
lea    -0x30(%rbp),%rdi
lea    -0x88(%rbp),%rsi
call   1030 <imprimirDirecciones@plt>
mov    -0x90(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x8c(%rbp),%eax
mov    %eax,-0x88(%rbp)
lea    -0x80(%rbp),%rdi
lea    -0x88(%rbp),%rsi
call   1060 <imprimirValores@plt>
lea    -0x80(%rbp),%rdi
lea    -0x88(%rbp),%rsi
call   1030 <imprimirDirecciones@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x98,%rsp
mov    0xedf(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xec3(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea7(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xf0b(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xeec(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xed0(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe98(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movq   $0xa,0x8(%rsp)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%r14
lea    0x8(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <imprimirValores@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <imprimirDirecciones@plt>
movabs $0x400000005,%rax
mov    %rax,0x8(%rsp)
lea    0x40(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <imprimirValores@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <imprimirDirecciones@plt>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r14
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 = [5 x [4 x i32]] [[4 x i32] [i32 1, i32 2, i32 3, i32 4], [4 x i32] [i32 4, i32 5, i32 6, i32 7], [4 x i32] [i32 4, i32 5, i32 6, i32 7], [4 x i32] [i32 4, i32 5, i32 6, i32 7], [4 x i32] [i32 4, i32 5, i32 6, i32 7]]
@.str = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [5 x [4 x i32]]
%4 = alloca [2 x i32]
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [10 x i32]* %2 to i8*
%8 = bitcast [5 x [4 x i32]]* %3 to i8*
%9 = bitcast [2 x i32]* %4 to i8*
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 10, i32* %10
store i32 5, i32* %5
store i32 4, i32* %6
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%14 = call i32 @imprimirValores(i32* %12, i32* %13)
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%17 = call i32 @imprimirDirecciones(i32* %15, i32* %16)
%18 = load i32, i32* %6
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %18, i32* %19
%20 = load i32, i32* %5
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 %20, i32* %21
%22 = getelementptr inbounds [5 x [4 x i32]], [5 x [4 x i32]]* %3, i64 0, i64 0
%23 = getelementptr inbounds [4 x i32], [4 x i32]* %22, i64 0, i64 0
%24 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%25 = call i32 @imprimirValores(i32* %23, i32* %24)
%26 = getelementptr inbounds [5 x [4 x i32]], [5 x [4 x i32]]* %3, i64 0, i64 0
%27 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 0
%28 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%29 = call i32 @imprimirDirecciones(i32* %27, i32* %28)
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 = [5 x [4 x i32]] [[4 x i32] [i32 1, i32 2, i32 3, i32 4], [4 x i32] [i32 4, i32 5, i32 6, i32 7], [4 x i32] [i32 4, i32 5, i32 6, i32 7], [4 x i32] [i32 4, i32 5, i32 6, i32 7], [4 x i32] [i32 4, i32 5, i32 6, i32 7]]
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [5 x [4 x i32]]
%3 = alloca i64
%4 = bitcast i64* %3 to [2 x i32]*
%5 = bitcast [10 x i32]* %1 to i8*
%6 = bitcast [5 x [4 x i32]]* %2 to i8*
%7 = bitcast i64* %3 to i8*
store i64 10, i64* %3
%8 = bitcast i64* %3 to i32*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%11 = call i32 @imprimirValores(i32* %10, i32* %8)
%12 = call i32 @imprimirDirecciones(i32* %10, i32* %8)
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 4, i32* %13
store i32 5, i32* %8
%14 = getelementptr inbounds [5 x [4 x i32]], [5 x [4 x i32]]* %2, i64 0, i64 0, i64 0
%15 = call i32 @imprimirValores(i32* %14, i32* %8)
%16 = call i32 @imprimirDirecciones(i32* %14, i32* %8)
ret i32 0
}