#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 */
typedef int /*<<< orphan*/ lista;

/* Variables and functions */
int i;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ quicksort(int *, int);
main() {
  static int lista[] = {10, 3, 7, 5, 12, 1, 27, 3, 8, 13};
  int n_elementos = sizeof(lista) / sizeof(int);
  register i;
  quicksort(lista, n_elementos);
  printf("Lista ordenada:\n");
  for (i = 0; i < n_elementos; i++)
    printf("%6d", lista[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0x2f00(%rip),%rdi
call   1030 <quicksort@plt>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1190 <main+0x70>
movslq -0xc(%rbp),%rcx
lea    0x2ecf(%rip),%rax
mov    (%rax,%rcx,4),%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115a <main+0x3a>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0x2f08(%rip),%rdi
mov    $0xa,%esi
call   1050 <quicksort@plt>
lea    0xeab(%rip),%rdi
call   1040 <puts@plt>
mov    0x2eec(%rip),%esi
lea    0xe95(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2ed9(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2ecd(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2ec1(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2eb5(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2ea9(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2e9d(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2e91(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2e85(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2e79(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@main.lista = internal global [10 x i32] [i32 10, i32 3, i32 7, i32 5, i32 12, i32 1, i32 27, i32 3, i32 8, i32 13]
@.str = [17 x i8] c"Lista ordenada:\0A\00"
@.str.1 = [4 x i8] c"%6d\00"
@.str.2 = [2 x i8] c"\0A\00"
@i = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @quicksort(i32* getelementptr inbounds ([10 x i32], [10 x i32]* @main.lista, i64 0, i64 0), i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %7
7: ; preds = %17, %0
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [10 x i32], [10 x i32]* @main.lista, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %11
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %7
20: ; preds = %7
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@main.lista = internal global [10 x i32] [i32 10, i32 3, i32 7, i32 5, i32 12, i32 1, i32 27, i32 3, i32 8, i32 13]
@.str.1 = [4 x i8] c"%6d\00"
@i = global i32 0
@str = [16 x i8] c"Lista ordenada:\00"
define i32 @main() {
%1 = tail call i32 @quicksort(i32* getelementptr inbounds ([10 x i32], [10 x i32]* @main.lista, i64 0, i64 0), i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @main.lista, i64 0, i64 0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = load i32, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @main.lista, i64 0, i64 1)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @main.lista, i64 0, i64 2)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @main.lista, i64 0, i64 3)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load i32, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @main.lista, i64 0, i64 4)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i32, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @main.lista, i64 0, i64 5)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load i32, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @main.lista, i64 0, i64 6)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = load i32, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @main.lista, i64 0, i64 7)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = load i32, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @main.lista, i64 0, i64 8)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = load i32, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @main.lista, i64 0, i64 9)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = tail call i32 @putchar(i32 10)
ret i32 0
}