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

/* Variables and functions */
int /*<<< orphan*/ imprime_direcciones(int *, int, int, int);
int /*<<< orphan*/ imprime_valores(int *, int, int, int);
main() {
  int i, long_arreglo, filas, cols;
  int arreglo[3] = {10, 20, -16};
  int matriz[2][2] = {{-1, -2}, {-4, -5}};
  long_arreglo = (sizeof(arreglo) / sizeof(arreglo[0]));
  filas = (sizeof(matriz) / sizeof(matriz[0]));
  cols = (sizeof(matriz[0]) / sizeof(matriz[0][0]));
  imprime_valores(arreglo, long_arreglo, 1, 1);
  imprime_direcciones(arreglo, long_arreglo, 1, 1);
  imprime_valores(arreglo, long_arreglo, 1, 0);
  imprime_direcciones(arreglo, long_arreglo, 1, 0);
  imprime_valores(matriz[0], cols, filas, 1);
  imprime_direcciones(matriz[0], cols, filas, 1);
  imprime_valores(matriz[0], cols, filas, 0);
  imprime_direcciones(matriz[0], cols, filas, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xec6(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%ecx
mov    %ecx,%edx
call   1040 <imprime_valores@plt>
lea    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%ecx
mov    %ecx,%edx
call   1030 <imprime_direcciones@plt>
lea    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1040 <imprime_valores@plt>
lea    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <imprime_direcciones@plt>
lea    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x1,%ecx
call   1040 <imprime_valores@plt>
lea    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x1,%ecx
call   1030 <imprime_direcciones@plt>
lea    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
xor    %ecx,%ecx
call   1040 <imprime_valores@plt>
lea    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
xor    %ecx,%ecx
call   1030 <imprime_direcciones@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xedd(%rip),%eax
mov    %eax,0x8(%rsp)
mov    0xeca(%rip),%rax
mov    %rax,(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1040 <imprime_valores@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1030 <imprime_direcciones@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1040 <imprime_valores@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <imprime_direcciones@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1040 <imprime_valores@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <imprime_direcciones@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1040 <imprime_valores@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1030 <imprime_direcciones@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arreglo = [3 x i32] [i32 10, i32 20, i32 -16]
@__const.main.matriz = [2 x [2 x i32]] [[2 x i32] [i32 -1, i32 -2], [2 x i32] [i32 -4, i32 -5]]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [3 x i32]
%7 = alloca [2 x [2 x i32]]
store i32 0, i32* %1
%8 = bitcast [3 x i32]* %6 to i8*
%9 = bitcast [2 x [2 x i32]]* %7 to i8*
store i32 3, i32* %3
store i32 2, i32* %4
store i32 2, i32* %5
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%11 = load i32, i32* %3
%12 = call i32 @imprime_valores(i32* %10, i32 %11, i32 1, i32 1)
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%14 = load i32, i32* %3
%15 = call i32 @imprime_direcciones(i32* %13, i32 %14, i32 1, i32 1)
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%17 = load i32, i32* %3
%18 = call i32 @imprime_valores(i32* %16, i32 %17, i32 1, i32 0)
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%20 = load i32, i32* %3
%21 = call i32 @imprime_direcciones(i32* %19, i32 %20, i32 1, i32 0)
%22 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %7, i64 0, i64 0
%23 = getelementptr inbounds [2 x i32], [2 x i32]* %22, i64 0, i64 0
%24 = load i32, i32* %5
%25 = load i32, i32* %4
%26 = call i32 @imprime_valores(i32* %23, i32 %24, i32 %25, i32 1)
%27 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %7, i64 0, i64 0
%28 = getelementptr inbounds [2 x i32], [2 x i32]* %27, i64 0, i64 0
%29 = load i32, i32* %5
%30 = load i32, i32* %4
%31 = call i32 @imprime_direcciones(i32* %28, i32 %29, i32 %30, i32 1)
%32 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %7, i64 0, i64 0
%33 = getelementptr inbounds [2 x i32], [2 x i32]* %32, i64 0, i64 0
%34 = load i32, i32* %5
%35 = load i32, i32* %4
%36 = call i32 @imprime_valores(i32* %33, i32 %34, i32 %35, i32 0)
%37 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %7, i64 0, i64 0
%38 = getelementptr inbounds [2 x i32], [2 x i32]* %37, i64 0, i64 0
%39 = load i32, i32* %5
%40 = load i32, i32* %4
%41 = call i32 @imprime_direcciones(i32* %38, i32 %39, i32 %40, i32 0)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arreglo = [3 x i32] [i32 10, i32 20, i32 -16]
@__const.main.matriz = [2 x [2 x i32]] [[2 x i32] [i32 -1, i32 -2], [2 x i32] [i32 -4, i32 -5]]
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [2 x [2 x i32]]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [2 x [2 x i32]]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%6 = call i32 @imprime_valores(i32* %5, i32 3, i32 1, i32 1)
%7 = call i32 @imprime_direcciones(i32* %5, i32 3, i32 1, i32 1)
%8 = call i32 @imprime_valores(i32* %5, i32 3, i32 1, i32 0)
%9 = call i32 @imprime_direcciones(i32* %5, i32 3, i32 1, i32 0)
%10 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0, i64 0
%11 = call i32 @imprime_valores(i32* %10, i32 2, i32 2, i32 1)
%12 = call i32 @imprime_direcciones(i32* %10, i32 2, i32 2, i32 1)
%13 = call i32 @imprime_valores(i32* %10, i32 2, i32 2, i32 0)
%14 = call i32 @imprime_direcciones(i32* %10, i32 2, i32 2, i32 0)
ret i32 0
}