#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*/ printf(char *);
int /*<<< orphan*/ test_Qselect();
int /*<<< orphan*/ test_bubbleSort();
int /*<<< orphan*/ test_heapSort();
int /*<<< orphan*/ test_insertionSort();
int /*<<< orphan*/ test_mergeSort();
int /*<<< orphan*/ test_mergeSortNonRecursive();
int /*<<< orphan*/ test_quickSort();
int /*<<< orphan*/ test_selectionSort();
int /*<<< orphan*/ test_shellSort();
int main(void) {
  printf("///////////////////////\n");
  printf("// SORTING TEST\n");
  printf("///////////////////////\n\n");
  test_shellSort();
  printf("===============\n\n");
  test_bubbleSort();
  printf("===============\n\n");
  test_selectionSort();
  printf("===============\n\n");
  test_insertionSort();
  printf("===============\n\n");
  test_heapSort();
  printf("===============\n\n");
  test_mergeSort();
  printf("===============\n\n");
  test_quickSort();
  printf("===============\n\n");
  test_Qselect();
  printf("===============\n\n");
  test_mergeSortNonRecursive();
  printf("===============\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe4a(%rip),%rdi
call   1040 <printf@plt>
lea    0xe57(%rip),%rdi
call   1040 <printf@plt>
lea    0xe5c(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <test_shellSort@plt>
lea    0xe63(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <test_bubbleSort@plt>
lea    0xe50(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1090 <test_selectionSort@plt>
lea    0xe3d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <test_insertionSort@plt>
lea    0xe2a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <test_heapSort@plt>
lea    0xe17(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   10c0 <test_mergeSort@plt>
lea    0xe04(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   10a0 <test_quickSort@plt>
lea    0xdf1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   10b0 <test_Qselect@plt>
lea    0xdde(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <test_mergeSortNonRecursive@plt>
lea    0xdcb(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xe58(%rip),%rdi
call   1040 <puts@plt>
lea    0xe64(%rip),%rdi
call   1040 <puts@plt>
lea    0xe68(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <test_shellSort@plt>
lea    0xe6e(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <test_bubbleSort@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1090 <test_selectionSort@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <test_insertionSort@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1080 <test_heapSort@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10c0 <test_mergeSort@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10a0 <test_quickSort@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10b0 <test_Qselect@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <test_mergeSortNonRecursive@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"///////////////////////\0A\00"
@.str.1 = [17 x i8] c"// SORTING TEST\0A\00"
@.str.2 = [26 x i8] c"///////////////////////\0A\0A\00"
@.str.3 = [18 x i8] c"===============\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (...) @test_shellSort()
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 (...) @test_bubbleSort()
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (...) @test_selectionSort()
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (...) @test_insertionSort()
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (...) @test_heapSort()
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 (...) @test_mergeSort()
%16 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 (...) @test_quickSort()
%18 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%19 = call i32 (...) @test_Qselect()
%20 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%21 = call i32 (...) @test_mergeSortNonRecursive()
%22 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"///////////////////////\00"
@str.4 = [16 x i8] c"// SORTING TEST\00"
@str.5 = [25 x i8] c"///////////////////////\0A\00"
@str.14 = [17 x i8] c"===============\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 (...) @test_shellSort()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.14, i64 0, i64 0))
%6 = tail call i32 (...) @test_bubbleSort()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.14, i64 0, i64 0))
%8 = tail call i32 (...) @test_selectionSort()
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.14, i64 0, i64 0))
%10 = tail call i32 (...) @test_insertionSort()
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.14, i64 0, i64 0))
%12 = tail call i32 (...) @test_heapSort()
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.14, i64 0, i64 0))
%14 = tail call i32 (...) @test_mergeSort()
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.14, i64 0, i64 0))
%16 = tail call i32 (...) @test_quickSort()
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.14, i64 0, i64 0))
%18 = tail call i32 (...) @test_Qselect()
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.14, i64 0, i64 0))
%20 = tail call i32 (...) @test_mergeSortNonRecursive()
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.14, i64 0, i64 0))
ret i32 0
}