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

/* Variables and functions */
int /*<<< orphan*/ direccion(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ valores(int *, int);
int main() {
  int len_a1, len_a2, fila, col;
  int arreglo_mult[2][3] = {{-1, -2, -3}, {-4, -5, -6}};
  int arreglo[10] = {-1, -2, -3, -4, -5, -6, -7, -8, -9, -10};
  len_a1 = sizeof(arreglo) / sizeof(arreglo[0]);
  fila = sizeof(arreglo_mult) / sizeof(arreglo_mult[0]);
  col = sizeof(arreglo_mult[0]) / sizeof(arreglo_mult[0][0]);
  len_a2 = fila * col;
  printf("Arreglo 1 dimension \n");
  valores(&arreglo[0], len_a1);
  direccion(&arreglo[0], len_a1);
  printf("Arreglo 2 dimensiones \n");
  valores(&arreglo_mult[0][0], len_a2);
  direccion(&arreglo_mult[0][0], len_a2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xea5(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
movl   $0xa,-0x8(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <valores@plt>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1060 <direccion@plt>
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <valores@plt>
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1060 <direccion@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    0xed4(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0xeed(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <valores@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <direccion@plt>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <valores@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1050 <direccion@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arreglo_mult = [2 x [3 x i32]] [[3 x i32] [i32 -1, i32 -2, i32 -3], [3 x i32] [i32 -4, i32 -5, i32 -6]]
@__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]
@.str = [22 x i8] c"Arreglo 1 dimension \0A\00"
@.str.1 = [24 x i8] c"Arreglo 2 dimensiones \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [2 x [3 x i32]]
%7 = alloca [10 x i32]
store i32 0, i32* %1
%8 = bitcast [2 x [3 x i32]]* %6 to i8*
%9 = bitcast [10 x i32]* %7 to i8*
store i32 10, i32* %2
store i32 2, i32* %4
store i32 3, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = mul nsw i32 %10, %11
store i32 %12, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 0
%15 = load i32, i32* %2
%16 = call i32 @valores(i32* %14, i32 %15)
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 0
%18 = load i32, i32* %2
%19 = call i32 @direccion(i32* %17, i32 %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%21 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %6, i64 0, i64 0
%22 = getelementptr inbounds [3 x i32], [3 x i32]* %21, i64 0, i64 0
%23 = load i32, i32* %3
%24 = call i32 @valores(i32* %22, i32 %23)
%25 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %6, i64 0, i64 0
%26 = getelementptr inbounds [3 x i32], [3 x i32]* %25, i64 0, i64 0
%27 = load i32, i32* %3
%28 = call i32 @direccion(i32* %26, i32 %27)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arreglo_mult = [2 x [3 x i32]] [[3 x i32] [i32 -1, i32 -2, i32 -3], [3 x i32] [i32 -4, i32 -5, i32 -6]]
@__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]
@str = [21 x i8] c"Arreglo 1 dimension \00"
@str.2 = [23 x i8] c"Arreglo 2 dimensiones \00"
define i32 @main() {
%1 = alloca [2 x [3 x i32]]
%2 = alloca [10 x i32]
%3 = bitcast [2 x [3 x i32]]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = call i32 @valores(i32* %6, i32 10)
%8 = call i32 @direccion(i32* %6, i32 10)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.2, i64 0, i64 0))
%10 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 0, i64 0
%11 = call i32 @valores(i32* %10, i32 6)
%12 = call i32 @direccion(i32* %10, i32 6)
ret i32 0
}