#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 /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ quicksort(int *, int);
int main(int argc, const char *argv[]) {
  int lista[] = {100, 56, 0, 1, -45, 2, 46, 5, 9, 6, 67, 23, 5};
  int size = sizeof(lista) / sizeof(int);
  printf("Lista Desordenada \n");
  for (int i = 0; i < size; i++) {
    printf("%d", lista[i]);
    if (i < size - 1)
      printf(",");
  }
  printf("\n");
  quicksort(lista, size);
  printf("Lista Ordenada \n");
  for (int i = 0; i < size; i++) {
    printf("%d", lista[i]);
    if (i < size - 1)
      printf(",");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x34,%edx
call   1050 <memcpy@plt>
movl   $0xd,-0x54(%rbp)
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x54(%rbp),%eax
jge    11cb <main+0x9b>
movslq -0x58(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x58(%rbp),%eax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11b8 <main+0x88>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11bd <main+0x8d>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1177 <main+0x47>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
call   1030 <quicksort@plt>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x54(%rbp),%eax
jge    124e <main+0x11e>
movslq -0x5c(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%esi
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x5c(%rbp),%eax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    123b <main+0x10b>
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1240 <main+0x110>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    11fa <main+0xca>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeae(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe92(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xebe(%rip),%rdi
call   1040 <puts@plt>
lea    0xeaf(%rip),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x38,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0xffffffd3,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x2e,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x43,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x17,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
mov    $0xd,%esi
call   1050 <quicksort@plt>
lea    0xd6f(%rip),%rdi
call   1040 <puts@plt>
mov    (%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x28(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x2c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x30(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.lista = [13 x i32] [i32 100, i32 56, i32 0, i32 1, i32 -45, i32 2, i32 46, i32 5, i32 9, i32 6, i32 67, i32 23, i32 5]
@.str = [20 x i8] c"Lista Desordenada \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c",\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [17 x i8] c"Lista Ordenada \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [13 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [13 x i32]* %6 to i8*
store i32 13, i32* %7
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %8
br label %12
12: ; preds = %29, %2
%13 = load i32, i32* %8
%14 = load i32, i32* %7
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %32
16: ; preds = %12
%17 = load i32, i32* %8
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [13 x i32], [13 x i32]* %6, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %8
%23 = load i32, i32* %7
%24 = sub nsw i32 %23, 1
%25 = icmp slt i32 %22, %24
br i1 %25, label %26, label %28
26: ; preds = %16
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %28
28: ; preds = %26, %16
br label %29
29: ; preds = %28
%30 = load i32, i32* %8
%31 = add nsw i32 %30, 1
store i32 %31, i32* %8
br label %12
32: ; preds = %12
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%34 = getelementptr inbounds [13 x i32], [13 x i32]* %6, i64 0, i64 0
%35 = load i32, i32* %7
%36 = call i32 @quicksort(i32* %34, i32 %35)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %9
br label %38
38: ; preds = %55, %32
%39 = load i32, i32* %9
%40 = load i32, i32* %7
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %58
42: ; preds = %38
%43 = load i32, i32* %9
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [13 x i32], [13 x i32]* %6, i64 0, i64 %44
%46 = load i32, i32* %45
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %46)
%48 = load i32, i32* %9
%49 = load i32, i32* %7
%50 = sub nsw i32 %49, 1
%51 = icmp slt i32 %48, %50
br i1 %51, label %52, label %54
52: ; preds = %42
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %54
54: ; preds = %52, %42
br label %55
55: ; preds = %54
%56 = load i32, i32* %9
%57 = add nsw i32 %56, 1
store i32 %57, i32* %9
br label %38
58: ; preds = %38
ret i32 0
}

LLVM IR (-O2):
@__const.main.lista = [13 x i32] [i32 100, i32 56, i32 0, i32 1, i32 -45, i32 2, i32 46, i32 5, i32 9, i32 6, i32 67, i32 23, i32 5]
@.str.1 = [3 x i8] c"%d\00"
@str = [19 x i8] c"Lista Desordenada \00"
@str.5 = [16 x i8] c"Lista Ordenada \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [13 x i32]
%4 = bitcast [13 x i32]* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds [13 x i32], [13 x i32]* %3, i64 0, i64 0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 100)
%8 = tail call i32 @putchar(i32 44)
%9 = getelementptr inbounds [13 x i32], [13 x i32]* %3, i64 0, i64 1
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 56)
%11 = tail call i32 @putchar(i32 44)
%12 = getelementptr inbounds [13 x i32], [13 x i32]* %3, i64 0, i64 2
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0)
%14 = tail call i32 @putchar(i32 44)
%15 = getelementptr inbounds [13 x i32], [13 x i32]* %3, i64 0, i64 3
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 1)
%17 = tail call i32 @putchar(i32 44)
%18 = getelementptr inbounds [13 x i32], [13 x i32]* %3, i64 0, i64 4
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 -45)
%20 = tail call i32 @putchar(i32 44)
%21 = getelementptr inbounds [13 x i32], [13 x i32]* %3, i64 0, i64 5
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%23 = tail call i32 @putchar(i32 44)
%24 = getelementptr inbounds [13 x i32], [13 x i32]* %3, i64 0, i64 6
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 46)
%26 = tail call i32 @putchar(i32 44)
%27 = getelementptr inbounds [13 x i32], [13 x i32]* %3, i64 0, i64 7
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 5)
%29 = tail call i32 @putchar(i32 44)
%30 = getelementptr inbounds [13 x i32], [13 x i32]* %3, i64 0, i64 8
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 9)
%32 = tail call i32 @putchar(i32 44)
%33 = getelementptr inbounds [13 x i32], [13 x i32]* %3, i64 0, i64 9
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 6)
%35 = tail call i32 @putchar(i32 44)
%36 = getelementptr inbounds [13 x i32], [13 x i32]* %3, i64 0, i64 10
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 67)
%38 = tail call i32 @putchar(i32 44)
%39 = getelementptr inbounds [13 x i32], [13 x i32]* %3, i64 0, i64 11
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 23)
%41 = tail call i32 @putchar(i32 44)
%42 = getelementptr inbounds [13 x i32], [13 x i32]* %3, i64 0, i64 12
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 5)
%44 = tail call i32 @putchar(i32 10)
%45 = call i32 @quicksort(i32* %6, i32 13)
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0))
%47 = load i32, i32* %6
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %47)
%49 = call i32 @putchar(i32 44)
%50 = load i32, i32* %9
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %50)
%52 = call i32 @putchar(i32 44)
%53 = load i32, i32* %12
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %53)
%55 = call i32 @putchar(i32 44)
%56 = load i32, i32* %15
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %56)
%58 = call i32 @putchar(i32 44)
%59 = load i32, i32* %18
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %59)
%61 = call i32 @putchar(i32 44)
%62 = load i32, i32* %21
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %62)
%64 = call i32 @putchar(i32 44)
%65 = load i32, i32* %24
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %65)
%67 = call i32 @putchar(i32 44)
%68 = load i32, i32* %27
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %68)
%70 = call i32 @putchar(i32 44)
%71 = load i32, i32* %30
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %71)
%73 = call i32 @putchar(i32 44)
%74 = load i32, i32* %33
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %74)
%76 = call i32 @putchar(i32 44)
%77 = load i32, i32* %36
%78 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %77)
%79 = call i32 @putchar(i32 44)
%80 = load i32, i32* %39
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %80)
%82 = call i32 @putchar(i32 44)
%83 = load i32, i32* %42
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %83)
ret i32 0
}