#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 */
scalar_t__ malloc(int);
int /*<<< orphan*/ printArray(int *, int);
int /*<<< orphan*/ shuffleArray(int *, int);
int main() {
  int cantidad = 15;
  int startNumber = 0;
  int *vector = (int *)malloc(sizeof(int) * cantidad);
  int *pri = vector;
  for (int i = 0; i < cantidad; i++) {
    *pri = ++(startNumber);
    pri++;
  }
  pri = vector;
  shuffleArray(pri, cantidad);
  pri = vector;
  printArray(pri, cantidad);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xf,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11a4 <main+0x74>
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    116f <main+0x3f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <shuffleArray@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <printArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3c,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movaps 0xebb(%rip),%xmm0
movups %xmm0,(%rax)
movaps 0xec1(%rip),%xmm0
movups %xmm0,0x10(%rax)
movaps 0xec6(%rip),%xmm0
movups %xmm0,0x20(%rax)
movabs $0xe0000000d,%rax
mov    %rax,0x30(%rbx)
movl   $0xf,0x38(%rbx)
mov    %rbx,%rdi
mov    $0xf,%esi
call   1030 <shuffleArray@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
call   1050 <printArray@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32 0, i32* %1
store i32 15, i32* %2
store i32 0, i32* %3
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = mul i64 4, %8
%10 = trunc i64 %9 to i32
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %4
%13 = load i32*, i32** %4
store i32* %13, i32** %5
store i32 0, i32* %6
br label %14
14: ; preds = %24, %0
%15 = load i32, i32* %6
%16 = load i32, i32* %2
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %27
18: ; preds = %14
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
%21 = load i32*, i32** %5
store i32 %20, i32* %21
%22 = load i32*, i32** %5
%23 = getelementptr inbounds i32, i32* %22, i32 1
store i32* %23, i32** %5
br label %24
24: ; preds = %18
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
br label %14
27: ; preds = %14
%28 = load i32*, i32** %4
store i32* %28, i32** %5
%29 = load i32*, i32** %5
%30 = load i32, i32* %2
%31 = call i32 @shuffleArray(i32* %29, i32 %30)
%32 = load i32*, i32** %4
store i32* %32, i32** %5
%33 = load i32*, i32** %5
%34 = load i32, i32* %2
%35 = call i32 @printArray(i32* %33, i32 %34)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 60)
%2 = inttoptr i64 %1 to i32*
%3 = inttoptr i64 %1 to <4 x i32>*
store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* %3
%4 = getelementptr inbounds i32, i32* %2, i64 4
%5 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> <i32 5, i32 6, i32 7, i32 8>, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %2, i64 8
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> <i32 9, i32 10, i32 11, i32 12>, <4 x i32>* %7
%8 = getelementptr inbounds i32, i32* %2, i64 12
store i32 13, i32* %8
%9 = getelementptr inbounds i32, i32* %2, i64 13
store i32 14, i32* %9
%10 = getelementptr inbounds i32, i32* %2, i64 14
store i32 15, i32* %10
%11 = tail call i32 @shuffleArray(i32* %2, i32 15)
%12 = tail call i32 @printArray(i32* %2, i32 15)
ret i32 0
}