#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*/ bubble_sort(int *, int);
int /*<<< orphan*/ imprime_vetor(int *, int);
int /*<<< orphan*/ insertion_sort(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ quick_sort(int *, int);
int /*<<< orphan*/ selection_sort(int *, int);
int main() {
  int vetor1[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
  int vetor2[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
  int vetor3[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
  int vetor4[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
  printf("Vetores originais:\n");
  imprime_vetor(vetor1, 11);
  imprime_vetor(vetor2, 11);
  imprime_vetor(vetor3, 11);
  imprime_vetor(vetor4, 11);
  bubble_sort(vetor1, 11);
  selection_sort(vetor2, 11);
  insertion_sort(vetor3, 11);
  quick_sort(vetor4, 11);
  printf("Vetores ordenados:\n");
  imprime_vetor(vetor1, 11);
  imprime_vetor(vetor2, 11);
  imprime_vetor(vetor3, 11);
  imprime_vetor(vetor4, 11);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
lea    -0x30(%rbp),%rdi
lea    0xe7a(%rip),%rsi
mov    $0x2c,%edx
call   1060 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xe65(%rip),%rsi
mov    $0x2c,%edx
call   1060 <memcpy@plt>
lea    -0x90(%rbp),%rdi
lea    0xe4d(%rip),%rsi
mov    $0x2c,%edx
call   1060 <memcpy@plt>
lea    -0xc0(%rbp),%rdi
lea    0xe35(%rip),%rsi
mov    $0x2c,%edx
call   1060 <memcpy@plt>
lea    0xe50(%rip),%rdi
call   1050 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0xb,%esi
call   1040 <imprime_vetor@plt>
lea    -0x60(%rbp),%rdi
mov    $0xb,%esi
call   1040 <imprime_vetor@plt>
lea    -0x90(%rbp),%rdi
mov    $0xb,%esi
call   1040 <imprime_vetor@plt>
lea    -0xc0(%rbp),%rdi
mov    $0xb,%esi
call   1040 <imprime_vetor@plt>
lea    -0x30(%rbp),%rdi
mov    $0xb,%esi
call   1090 <bubble_sort@plt>
lea    -0x60(%rbp),%rdi
mov    $0xb,%esi
call   1030 <selection_sort@plt>
lea    -0x90(%rbp),%rdi
mov    $0xb,%esi
call   1080 <insertion_sort@plt>
lea    -0xc0(%rbp),%rdi
mov    $0xb,%esi
call   1070 <quick_sort@plt>
lea    0xddc(%rip),%rdi
call   1050 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0xb,%esi
call   1040 <imprime_vetor@plt>
lea    -0x60(%rbp),%rdi
mov    $0xb,%esi
call   1040 <imprime_vetor@plt>
lea    -0x90(%rbp),%rdi
mov    $0xb,%esi
call   1040 <imprime_vetor@plt>
lea    -0xc0(%rbp),%rdi
mov    $0xb,%esi
call   1040 <imprime_vetor@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xc8,%rsp
movups 0xea7(%rip),%xmm0
movups %xmm0,0xac(%rsp)
movaps 0xe8c(%rip),%xmm1
movaps %xmm1,0xa0(%rsp)
movaps 0xe6d(%rip),%xmm2
movaps %xmm2,0x90(%rsp)
movups %xmm0,0x7c(%rsp)
movaps %xmm1,0x70(%rsp)
movaps %xmm2,0x60(%rsp)
movups %xmm0,0x4c(%rsp)
movaps %xmm1,0x40(%rsp)
movaps %xmm2,0x30(%rsp)
movups %xmm0,0x1c(%rsp)
movaps %xmm1,0x10(%rsp)
movaps %xmm2,(%rsp)
lea    0xe5e(%rip),%rdi
call   1040 <puts@plt>
lea    0x90(%rsp),%r14
mov    %r14,%rdi
mov    $0xb,%esi
call   1050 <imprime_vetor@plt>
lea    0x60(%rsp),%r15
mov    %r15,%rdi
mov    $0xb,%esi
call   1050 <imprime_vetor@plt>
lea    0x30(%rsp),%r12
mov    %r12,%rdi
mov    $0xb,%esi
call   1050 <imprime_vetor@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xb,%esi
call   1050 <imprime_vetor@plt>
mov    %r14,%rdi
mov    $0xb,%esi
call   1080 <bubble_sort@plt>
mov    %r15,%rdi
mov    $0xb,%esi
call   1030 <selection_sort@plt>
mov    %r12,%rdi
mov    $0xb,%esi
call   1070 <insertion_sort@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1060 <quick_sort@plt>
lea    0xde8(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
mov    $0xb,%esi
call   1050 <imprime_vetor@plt>
mov    %r15,%rdi
mov    $0xb,%esi
call   1050 <imprime_vetor@plt>
mov    %r12,%rdi
mov    $0xb,%esi
call   1050 <imprime_vetor@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1050 <imprime_vetor@plt>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.vetor1 = [11 x i32] [i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0]
@__const.main.vetor2 = [11 x i32] [i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0]
@__const.main.vetor3 = [11 x i32] [i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0]
@__const.main.vetor4 = [11 x i32] [i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0]
@.str = [20 x i8] c"Vetores originais:\0A\00"
@.str.1 = [20 x i8] c"Vetores ordenados:\0A\00"
define i32 @main() {
%1 = alloca [11 x i32]
%2 = alloca [11 x i32]
%3 = alloca [11 x i32]
%4 = alloca [11 x i32]
%5 = bitcast [11 x i32]* %1 to i8*
%6 = bitcast [11 x i32]* %2 to i8*
%7 = bitcast [11 x i32]* %3 to i8*
%8 = bitcast [11 x i32]* %4 to i8*
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%11 = call i32 @imprime_vetor(i32* %10, i32 11)
%12 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 0
%13 = call i32 @imprime_vetor(i32* %12, i32 11)
%14 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 0
%15 = call i32 @imprime_vetor(i32* %14, i32 11)
%16 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 0
%17 = call i32 @imprime_vetor(i32* %16, i32 11)
%18 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%19 = call i32 @bubble_sort(i32* %18, i32 11)
%20 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 0
%21 = call i32 @selection_sort(i32* %20, i32 11)
%22 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 0
%23 = call i32 @insertion_sort(i32* %22, i32 11)
%24 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 0
%25 = call i32 @quick_sort(i32* %24, i32 11)
%26 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%27 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%28 = call i32 @imprime_vetor(i32* %27, i32 11)
%29 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 0
%30 = call i32 @imprime_vetor(i32* %29, i32 11)
%31 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 0
%32 = call i32 @imprime_vetor(i32* %31, i32 11)
%33 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 0
%34 = call i32 @imprime_vetor(i32* %33, i32 11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.vetor4 = [11 x i32] [i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0]
@str = [19 x i8] c"Vetores originais:\00"
@str.2 = [19 x i8] c"Vetores ordenados:\00"
define i32 @main() {
%1 = alloca [11 x i32]
%2 = alloca [11 x i32]
%3 = alloca [11 x i32]
%4 = alloca [11 x i32]
%5 = bitcast [11 x i32]* %1 to i8*
%6 = bitcast [11 x i32]* %2 to i8*
%7 = bitcast [11 x i32]* %3 to i8*
%8 = bitcast [11 x i32]* %4 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%10 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%11 = call i32 @imprime_vetor(i32* %10, i32 11)
%12 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 0
%13 = call i32 @imprime_vetor(i32* %12, i32 11)
%14 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 0
%15 = call i32 @imprime_vetor(i32* %14, i32 11)
%16 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 0
%17 = call i32 @imprime_vetor(i32* %16, i32 11)
%18 = call i32 @bubble_sort(i32* %10, i32 11)
%19 = call i32 @selection_sort(i32* %12, i32 11)
%20 = call i32 @insertion_sort(i32* %14, i32 11)
%21 = call i32 @quick_sort(i32* %16, i32 11)
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.2, i64 0, i64 0))
%23 = call i32 @imprime_vetor(i32* %10, i32 11)
%24 = call i32 @imprime_vetor(i32* %12, i32 11)
%25 = call i32 @imprime_vetor(i32* %14, i32 11)
%26 = call i32 @imprime_vetor(i32* %16, i32 11)
ret i32 0
}