#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*/ escreve(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ quick(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand(time(NULL));
  int vet[] = {1, 3, 4, 2};
  escreve(vet, 0, 4 - 1);
  quick(vet, 0, 4 - 1);
  printf("\nPRONTO ");
  escreve(vet, 0, 4 - 1);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    0xe8a(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe87(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1030 <escreve@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1070 <quick@plt>
lea    0xe64(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1030 <escreve@plt>
lea    0xe51(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
movaps 0xe86(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1040 <escreve@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1080 <quick@plt>
lea    0xe6a(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1040 <escreve@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.vet = [4 x i32] [i32 1, i32 3, i32 4, i32 2]
@.str = [9 x i8] c"\0APRONTO \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = bitcast [4 x i32]* %2 to i8*
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = call i32 @escreve(i32* %6, i32 0, i32 3)
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%9 = call i32 @quick(i32* %8, i32 0, i32 3)
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%12 = call i32 @escreve(i32* %11, i32 0, i32 3)
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.vet = [4 x i32] [i32 1, i32 3, i32 4, i32 2]
@.str = [9 x i8] c"\0APRONTO \00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = bitcast [4 x i32]* %1 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%6 = call i32 @escreve(i32* %5, i32 0, i32 3)
%7 = call i32 @quick(i32* %5, i32 0, i32 3)
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @escreve(i32* %5, i32 0, i32 3)
%10 = call i32 @putchar(i32 10)
ret i32 0
}