#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*/ PrintVet(int *, int /*<<< orphan*/, int);
int atoi(char const *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ quickSort(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char const *argv[]) {
  srand(time(NULL));
  int n = 10;
  if (argc > 1)
    n = atoi(argv[1]);
  int vet[] = {3, 0, 1, 8, 7, 2, 5, 4, 9, 6};
  PrintVet(vet, 0, n);
  quickSort(vet, 0, n);
  printf("PRONTO\n");
  PrintVet(vet, 0, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movl   $0xa,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11b7 <main+0x47>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x14(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xe3e(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %esi,%esi
call   1040 <PrintVet@plt>
lea    -0x40(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %esi,%esi
call   1080 <quickSort@plt>
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %esi,%esi
call   1040 <PrintVet@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0xa,%ebx
cmp    $0x2,%ebp
jl     1190 <main+0x30>
mov    0x8(%r14),%rdi
call   1080 <atoi@plt>
mov    %eax,%ebx
mov    0xe89(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xe6d(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe51(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1040 <PrintVet@plt>
mov    %rbp,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1070 <quickSort@plt>
lea    0xe53(%rip),%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1040 <PrintVet@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.vet = [10 x i32] [i32 3, i32 0, i32 1, i32 8, i32 7, i32 2, i32 5, i32 4, i32 9, i32 6]
@.str = [8 x i8] c"PRONTO\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [10 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @time(i32* null)
%9 = call i32 @srand(i32 %8)
store i32 10, i32* %6
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
store i32 %16, i32* %6
br label %17
17: ; preds = %12, %2
%18 = bitcast [10 x i32]* %7 to i8*
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 0
%20 = load i32, i32* %6
%21 = call i32 @PrintVet(i32* %19, i32 0, i32 %20)
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 0
%23 = load i32, i32* %6
%24 = call i32 @quickSort(i32* %22, i32 0, i32 %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 0
%27 = load i32, i32* %6
%28 = call i32 @PrintVet(i32* %26, i32 0, i32 %27)
ret i32 0
}

LLVM IR (-O2):
@__const.main.vet = [10 x i32] [i32 3, i32 0, i32 1, i32 8, i32 7, i32 2, i32 5, i32 4, i32 9, i32 6]
@str = [7 x i8] c"PRONTO\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x i32]
%4 = tail call i32 @time(i32* null)
%5 = tail call i32 @srand(i32 %4)
%6 = icmp sgt i32 %0, 1
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
br label %11
11: ; preds = %7, %2
%12 = phi i32 [ %10, %7 ], [ 10, %2 ]
%13 = bitcast [10 x i32]* %3 to i8*
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%15 = call i32 @PrintVet(i32* %14, i32 0, i32 %12)
%16 = call i32 @quickSort(i32* %14, i32 0, i32 %12)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%18 = call i32 @PrintVet(i32* %14, i32 0, i32 %12)
ret i32 0
}