#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*/ print_int(int *, int const);
int /*<<< orphan*/ quicksort(int *, int const);
int main(void) {
  int lista[] = {10, 5, 7, 2, 9, 8, 1, 3, 4, 6};
  const int tam = 10;
  int l1[] = {5, 4, 3, 2, 1};
  const int tam2 = 5;
  print_int(lista, tam);
  quicksort(lista, tam);
  print_int(lista, tam);
  print_int(l1, tam2);
  quicksort(l1, tam2);
  print_int(l1, tam2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0xa,-0x34(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x40(%rbp)
movl   $0x5,-0x54(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <print_int@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <quicksort@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <print_int@plt>
lea    -0x50(%rbp),%rdi
mov    $0x5,%esi
call   1050 <print_int@plt>
lea    -0x50(%rbp),%rdi
mov    $0x5,%esi
call   1030 <quicksort@plt>
lea    -0x50(%rbp),%rdi
mov    $0x5,%esi
call   1050 <print_int@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xef1(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <print_int@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <quicksort@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <print_int@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <print_int@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <quicksort@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <print_int@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.lista = [10 x i32] [i32 10, i32 5, i32 7, i32 2, i32 9, i32 8, i32 1, i32 3, i32 4, i32 6]
@__const.main.l1 = [5 x i32] [i32 5, i32 4, i32 3, i32 2, i32 1]
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca [5 x i32]
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [10 x i32]* %2 to i8*
store i32 10, i32* %3
%7 = bitcast [5 x i32]* %4 to i8*
store i32 5, i32* %5
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%9 = call i32 @print_int(i32* %8, i32 10)
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%11 = call i32 @quicksort(i32* %10, i32 10)
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%13 = call i32 @print_int(i32* %12, i32 10)
%14 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%15 = call i32 @print_int(i32* %14, i32 5)
%16 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%17 = call i32 @quicksort(i32* %16, i32 5)
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%19 = call i32 @print_int(i32* %18, i32 5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.lista = [10 x i32] [i32 10, i32 5, i32 7, i32 2, i32 9, i32 8, i32 1, i32 3, i32 4, i32 6]
@__const.main.l1 = [5 x i32] [i32 5, i32 4, i32 3, i32 2, i32 1]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @print_int(i32* %5, i32 10)
%7 = call i32 @quicksort(i32* %5, i32 10)
%8 = call i32 @print_int(i32* %5, i32 10)
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%10 = call i32 @print_int(i32* %9, i32 5)
%11 = call i32 @quicksort(i32* %9, i32 5)
%12 = call i32 @print_int(i32* %9, i32 5)
ret i32 0
}