#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 */

/* Variables and functions */
int /*<<< orphan*/ escribir(int *, int);
int /*<<< orphan*/ leer(int *, int);
int /*<<< orphan*/ leerMatriz(int **, int, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int vector[5];
  printf("Uso de Vectores...!");
  escribir(vector, 5);
  leer(vector, 5);
  printf("Uso de Matrices...!\n\n\n");
  int matriz[2][2];
  matriz[0][0] = 0;
  matriz[0][1] = 1;
  matriz[1][0] = 2;
  matriz[1][1] = 3;
  leerMatriz(matriz, 2, 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <escribir@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1050 <leer@plt>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x30(%rbp)
movl   $0x1,-0x2c(%rbp)
movl   $0x2,-0x28(%rbp)
movl   $0x3,-0x24(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x2,%edx
mov    %edx,%esi
call   1060 <leerMatriz@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <escribir@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1060 <leer@plt>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
movaps 0xe6d(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   1070 <leerMatriz@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Uso de Vectores...!\00"
@.str.1 = [23 x i8] c"Uso de Matrices...!\0A\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca [2 x [2 x i32]]
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = call i32 @escribir(i32* %5, i32 5)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = call i32 @leer(i32* %7, i32 5)
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%10 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 0
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
store i32 0, i32* %11
%12 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 0
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 1
store i32 1, i32* %13
%14 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 1
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %14, i64 0, i64 0
store i32 2, i32* %15
%16 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 1
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %16, i64 0, i64 1
store i32 3, i32* %17
%18 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 0
%19 = bitcast [2 x i32]* %18 to i32**
%20 = call i32 @leerMatriz(i32** %19, i32 2, i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Uso de Vectores...!\00"
@str = [22 x i8] c"Uso de Matrices...!\0A\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca <4 x i32>
%3 = bitcast [5 x i32]* %1 to i8*
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = call i32 @escribir(i32* %5, i32 5)
%7 = call i32 @leer(i32* %5, i32 5)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%9 = bitcast <4 x i32>* %2 to i8*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %2
%10 = bitcast <4 x i32>* %2 to i32**
%11 = call i32 @leerMatriz(i32** %10, i32 2, i32 2)
ret i32 0
}