int main(void) {
  int i;
  int *pInt;
  int *pArrayInt;
  short int *pShortInt;
  char *pChar;
  float *pFloat;
  printf("Prueba de tipos + datos con metadatos\n");
  pInt = myMalloc(sizeof(int), 2);
  *pInt = 1400000;
  mostrar(pInt);
  pShortInt = myMalloc(sizeof(short int), 3);
  *pShortInt = 55;
  mostrar(pShortInt);
  pArrayInt = myMalloc(sizeof(int) * 4, 5);
  pArrayInt[0] = 10;
  pArrayInt[1] = 20;
  pArrayInt[2] = 30;
  pArrayInt[3] = 40;
  pArrayInt = myRealloc(pArrayInt, sizeof(int) * 8);
  pArrayInt[4] = 50;
  pArrayInt[5] = 60;
  pArrayInt[6] = 70;
  pArrayInt[7] = 80;
  mostrar(pArrayInt);
  myFree(pArrayInt);
  pFloat = myMalloc(sizeof(float), 4);
  *pFloat = 3.14;
  mostrar(pFloat);
  pChar = myMalloc(sizeof(char), 1);
  *pChar = 'X';
  mostrar(pChar);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x4,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1040 <myMalloc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x155cc0,(%rax)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1070 <mostrar@plt>
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x0,%al
call   1040 <myMalloc@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movw   $0x37,(%rax)
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1070 <mostrar@plt>
mov    $0x10,%edi
mov    $0x5,%esi
mov    $0x0,%al
call   1040 <myMalloc@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x14,0x4(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1e,0x8(%rax)
mov    -0x18(%rbp),%rax
movl   $0x28,0xc(%rax)
mov    -0x18(%rbp),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1060 <myRealloc@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x32,0x10(%rax)
mov    -0x18(%rbp),%rax
movl   $0x3c,0x14(%rax)
mov    -0x18(%rbp),%rax
movl   $0x46,0x18(%rax)
mov    -0x18(%rbp),%rax
movl   $0x50,0x1c(%rax)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1070 <mostrar@plt>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1050 <myFree@plt>
mov    $0x4,%edi
mov    $0x4,%esi
mov    $0x0,%al
call   1040 <myMalloc@plt>
cltq
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movss  0xd7f(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1070 <mostrar@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <myMalloc@plt>
cltq
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x58,(%rax)
mov    -0x28(%rbp),%rdi
mov    $0x0,%al
call   1070 <mostrar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <myMalloc@plt>
movslq %eax,%rdi
movl   $0x155cc0,(%rdi)
xor    %eax,%eax
call   1070 <mostrar@plt>
mov    $0x2,%edi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <myMalloc@plt>
movslq %eax,%rdi
movw   $0x37,(%rdi)
xor    %eax,%eax
call   1070 <mostrar@plt>
mov    $0x10,%edi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <myMalloc@plt>
movslq %eax,%rdi
movaps 0xe47(%rip),%xmm0
movups %xmm0,(%rdi)
mov    $0x20,%esi
xor    %eax,%eax
call   1060 <myRealloc@plt>
movslq %eax,%rbx
movaps 0xe3e(%rip),%xmm0
movups %xmm0,0x10(%rbx)
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <mostrar@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <myFree@plt>
mov    $0x4,%edi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <myMalloc@plt>
movslq %eax,%rdi
movl   $0x4048f5c3,(%rdi)
xor    %eax,%eax
call   1070 <mostrar@plt>
mov    $0x1,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <myMalloc@plt>
movslq %eax,%rdi
movb   $0x58,(%rdi)
xor    %eax,%eax
call   1070 <mostrar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Prueba de tipos + datos con metadatos\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i16*
%6 = alloca i8*
%7 = alloca float*
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i64, i32, ...) bitcast (i32 (...)* @myMalloc to i32 (i64, i32, ...)*)(i64 4, i32 2)
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %3
%12 = load i32*, i32** %3
store i32 1400000, i32* %12
%13 = load i32*, i32** %3
%14 = call i32 (i32*, ...) bitcast (i32 (...)* @mostrar to i32 (i32*, ...)*)(i32* %13)
%15 = call i32 (i64, i32, ...) bitcast (i32 (...)* @myMalloc to i32 (i64, i32, ...)*)(i64 2, i32 3)
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i16*
store i16* %17, i16** %5
%18 = load i16*, i16** %5
store i16 55, i16* %18
%19 = load i16*, i16** %5
%20 = call i32 (i16*, ...) bitcast (i32 (...)* @mostrar to i32 (i16*, ...)*)(i16* %19)
%21 = call i32 (i64, i32, ...) bitcast (i32 (...)* @myMalloc to i32 (i64, i32, ...)*)(i64 16, i32 5)
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to i32*
store i32* %23, i32** %4
%24 = load i32*, i32** %4
%25 = getelementptr inbounds i32, i32* %24, i64 0
store i32 10, i32* %25
%26 = load i32*, i32** %4
%27 = getelementptr inbounds i32, i32* %26, i64 1
store i32 20, i32* %27
%28 = load i32*, i32** %4
%29 = getelementptr inbounds i32, i32* %28, i64 2
store i32 30, i32* %29
%30 = load i32*, i32** %4
%31 = getelementptr inbounds i32, i32* %30, i64 3
store i32 40, i32* %31
%32 = load i32*, i32** %4
%33 = call i32 (i32*, i64, ...) bitcast (i32 (...)* @myRealloc to i32 (i32*, i64, ...)*)(i32* %32, i64 32)
%34 = sext i32 %33 to i64
%35 = inttoptr i64 %34 to i32*
store i32* %35, i32** %4
%36 = load i32*, i32** %4
%37 = getelementptr inbounds i32, i32* %36, i64 4
store i32 50, i32* %37
%38 = load i32*, i32** %4
%39 = getelementptr inbounds i32, i32* %38, i64 5
store i32 60, i32* %39
%40 = load i32*, i32** %4
%41 = getelementptr inbounds i32, i32* %40, i64 6
store i32 70, i32* %41
%42 = load i32*, i32** %4
%43 = getelementptr inbounds i32, i32* %42, i64 7
store i32 80, i32* %43
%44 = load i32*, i32** %4
%45 = call i32 (i32*, ...) bitcast (i32 (...)* @mostrar to i32 (i32*, ...)*)(i32* %44)
%46 = load i32*, i32** %4
%47 = call i32 (i32*, ...) bitcast (i32 (...)* @myFree to i32 (i32*, ...)*)(i32* %46)
%48 = call i32 (i64, i32, ...) bitcast (i32 (...)* @myMalloc to i32 (i64, i32, ...)*)(i64 4, i32 4)
%49 = sext i32 %48 to i64
%50 = inttoptr i64 %49 to float*
store float* %50, float** %7
%51 = load float*, float** %7
store float 0x40091EB860000000, float* %51
%52 = load float*, float** %7
%53 = call i32 (float*, ...) bitcast (i32 (...)* @mostrar to i32 (float*, ...)*)(float* %52)
%54 = call i32 (i64, i32, ...) bitcast (i32 (...)* @myMalloc to i32 (i64, i32, ...)*)(i64 1, i32 1)
%55 = sext i32 %54 to i64
%56 = inttoptr i64 %55 to i8*
store i8* %56, i8** %6
%57 = load i8*, i8** %6
store i8 88, i8* %57
%58 = load i8*, i8** %6
%59 = call i32 (i8*, ...) bitcast (i32 (...)* @mostrar to i32 (i8*, ...)*)(i8* %58)
ret i32 0
}

LLVM IR (-O2):
@str = [38 x i8] c"Prueba de tipos + datos con metadatos\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i64, i32, ...) bitcast (i32 (...)* @myMalloc to i32 (i64, i32, ...)*)(i64 4, i32 2)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
store i32 1400000, i32* %4
%5 = tail call i32 (i32*, ...) bitcast (i32 (...)* @mostrar to i32 (i32*, ...)*)(i32* %4)
%6 = tail call i32 (i64, i32, ...) bitcast (i32 (...)* @myMalloc to i32 (i64, i32, ...)*)(i64 2, i32 3)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i16*
store i16 55, i16* %8
%9 = tail call i32 (i16*, ...) bitcast (i32 (...)* @mostrar to i32 (i16*, ...)*)(i16* %8)
%10 = tail call i32 (i64, i32, ...) bitcast (i32 (...)* @myMalloc to i32 (i64, i32, ...)*)(i64 16, i32 5)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = inttoptr i64 %11 to <4 x i32>*
store <4 x i32> <i32 10, i32 20, i32 30, i32 40>, <4 x i32>* %13
%14 = tail call i32 (i32*, i64, ...) bitcast (i32 (...)* @myRealloc to i32 (i32*, i64, ...)*)(i32* %12, i64 32)
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = getelementptr inbounds i32, i32* %16, i64 4
%18 = bitcast i32* %17 to <4 x i32>*
store <4 x i32> <i32 50, i32 60, i32 70, i32 80>, <4 x i32>* %18
%19 = tail call i32 (i32*, ...) bitcast (i32 (...)* @mostrar to i32 (i32*, ...)*)(i32* %16)
%20 = tail call i32 (i32*, ...) bitcast (i32 (...)* @myFree to i32 (i32*, ...)*)(i32* %16)
%21 = tail call i32 (i64, i32, ...) bitcast (i32 (...)* @myMalloc to i32 (i64, i32, ...)*)(i64 4, i32 4)
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to float*
store float 0x40091EB860000000, float* %23
%24 = tail call i32 (float*, ...) bitcast (i32 (...)* @mostrar to i32 (float*, ...)*)(float* %23)
%25 = tail call i32 (i64, i32, ...) bitcast (i32 (...)* @myMalloc to i32 (i64, i32, ...)*)(i64 1, i32 1)
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i8*
store i8 88, i8* %27
%28 = tail call i32 (i8*, ...) bitcast (i32 (...)* @mostrar to i32 (i8*, ...)*)(i8* %27)
ret i32 0
}