#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*/ imprime(int, int *);
int /*<<< orphan*/ preenche(int, int *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ quick(int *, int /*<<< orphan*/, int);
int main() {
  int vetor[100], tamanho = 100;
  preenche(tamanho, vetor);
  printf("Vetor sem ordenar:\n");
  imprime(tamanho, vetor);
  quick(vetor, 0, tamanho - 1);
  printf("Vetor ordenado:\n");
  imprime(tamanho, vetor);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x1a4(%rbp)
mov    -0x1a4(%rbp),%edi
lea    -0x1a0(%rbp),%rsi
call   1060 <preenche@plt>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1a4(%rbp),%edi
lea    -0x1a0(%rbp),%rsi
call   1040 <imprime@plt>
lea    -0x1a0(%rbp),%rdi
mov    -0x1a4(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1050 <quick@plt>
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1a4(%rbp),%edi
lea    -0x1a0(%rbp),%rsi
call   1040 <imprime@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x190,%rsp
mov    %rsp,%rbx
mov    $0x64,%edi
mov    %rbx,%rsi
call   1060 <preenche@plt>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x64,%edi
mov    %rbx,%rsi
call   1040 <imprime@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x63,%edx
call   1050 <quick@plt>
lea    0xe8c(%rip),%rdi
call   1030 <puts@plt>
mov    $0x64,%edi
mov    %rbx,%rsi
call   1040 <imprime@plt>
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Vetor sem ordenar:\0A\00"
@.str.1 = [17 x i8] c"Vetor ordenado:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %3
%4 = load i32, i32* %3
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%6 = call i32 @preenche(i32 %4, i32* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %3
%9 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%10 = call i32 @imprime(i32 %8, i32* %9)
%11 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
%14 = call i32 @quick(i32* %11, i32 0, i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%16 = load i32, i32* %3
%17 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%18 = call i32 @imprime(i32 %16, i32* %17)
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Vetor sem ordenar:\00"
@str.2 = [16 x i8] c"Vetor ordenado:\00"
define i32 @main() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%4 = call i32 @preenche(i32 100, i32* %3)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%6 = call i32 @imprime(i32 100, i32* %3)
%7 = call i32 @quick(i32* %3, i32 0, i32 99)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
%9 = call i32 @imprime(i32 100, i32* %3)
ret i32 0
}