#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*/ bubbleSort(int *, int const);
int /*<<< orphan*/ cocktailShakerSort(int *, int const);
int /*<<< orphan*/ combSort(int *, int const);
int /*<<< orphan*/ fill_random(int *, int const);
int /*<<< orphan*/ gnomeSort(int *, int const);
int /*<<< orphan*/ heapSort(int *, int const);
int /*<<< orphan*/ insertionSort(int *, int /*<<< orphan*/, int const);
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(int *, int *, int);
int /*<<< orphan*/ mergeSort(int *, int /*<<< orphan*/, int const);
int /*<<< orphan*/ parallelMergeSort(int *, int /*<<< orphan*/, int const,
                                     int const);
int /*<<< orphan*/ print_time();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ quickSort(int *, int /*<<< orphan*/, int const);
int /*<<< orphan*/ radixSort(int *, int const);
int /*<<< orphan*/ selectionSort(int *, int const);
int /*<<< orphan*/ stoogeSort(int *, int /*<<< orphan*/, int const);
int /*<<< orphan*/ validate_raising_sort(int *, int const);
int main(int argc, char **argv) {
  const int LENGTH = 1000;
  const int THREADS = 8;
  int *array = (int *)malloc(sizeof(int) * LENGTH);
  int *array2 = (int *)malloc(sizeof(int) * LENGTH);
  fill_random(array, LENGTH);
  printf("Quicksort\n");
  memcpy(array2, array, sizeof(int) * LENGTH);
  print_time();
  quickSort(array2, 0, LENGTH - 1);
  print_time();
  validate_raising_sort(array2, LENGTH);
  printf("Mergesort\n");
  memcpy(array2, array, sizeof(int) * LENGTH);
  print_time();
  mergeSort(array2, 0, LENGTH);
  print_time();
  validate_raising_sort(array2, LENGTH);
  printf("Parallel Mergesort:\n");
  memcpy(array2, array, sizeof(int) * LENGTH);
  print_time();
  parallelMergeSort(array2, 0, LENGTH, THREADS);
  print_time();
  validate_raising_sort(array2, LENGTH);
  printf("heapSort:\n");
  memcpy(array2, array, sizeof(int) * LENGTH);
  print_time();
  heapSort(array2, LENGTH);
  print_time();
  validate_raising_sort(array2, LENGTH);
  printf("radixSort:\n");
  memcpy(array2, array, sizeof(int) * LENGTH);
  print_time();
  radixSort(array2, LENGTH);
  print_time();
  validate_raising_sort(array2, LENGTH);
  printf("BubbleSort:\n");
  memcpy(array2, array, sizeof(int) * LENGTH);
  print_time();
  bubbleSort(array2, LENGTH);
  print_time();
  validate_raising_sort(array2, LENGTH);
  printf("insertionSort:\n");
  memcpy(array2, array, sizeof(int) * LENGTH);
  print_time();
  insertionSort(array2, 0, LENGTH);
  print_time();
  validate_raising_sort(array2, LENGTH);
  printf("selectionSort:\n");
  memcpy(array2, array, sizeof(int) * LENGTH);
  print_time();
  selectionSort(array2, LENGTH);
  print_time();
  validate_raising_sort(array2, LENGTH);
  printf("gnomeSort:\n");
  memcpy(array2, array, sizeof(int) * LENGTH);
  print_time();
  gnomeSort(array2, LENGTH);
  print_time();
  validate_raising_sort(array2, LENGTH);
  printf("combSort:\n");
  memcpy(array2, array, sizeof(int) * LENGTH);
  print_time();
  combSort(array2, LENGTH);
  print_time();
  validate_raising_sort(array2, LENGTH);
  printf("cocktailShakerSort:\n");
  memcpy(array2, array, sizeof(int) * LENGTH);
  print_time();
  cocktailShakerSort(array2, LENGTH);
  print_time();
  validate_raising_sort(array2, LENGTH);
  printf("stoogeSort:\n");
  memcpy(array2, array, sizeof(int) * LENGTH);
  print_time();
  stoogeSort(array2, 0, LENGTH - 1);
  print_time();
  validate_raising_sort(array2, LENGTH);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3e8,-0x14(%rbp)
movl   $0x8,-0x18(%rbp)
mov    $0xfa0,%edi
call   10f0 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0xfa0,%edi
call   10f0 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <fill_random@plt>
lea    0xd92(%rip),%rdi
call   1070 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e7,%edx
call   1110 <quickSort@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xd53(%rip),%rdi
call   1070 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   10d0 <mergeSort@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xd14(%rip),%rdi
call   1070 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
mov    $0x8,%ecx
call   1080 <parallelMergeSort@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xcda(%rip),%rdi
call   1070 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   1060 <heapSort@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xc9d(%rip),%rdi
call   1070 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   10b0 <radixSort@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xc61(%rip),%rdi
call   1070 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   10a0 <bubbleSort@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xc26(%rip),%rdi
call   1070 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1100 <insertionSort@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xbec(%rip),%rdi
call   1070 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   1090 <selectionSort@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xbb4(%rip),%rdi
call   1070 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   10e0 <gnomeSort@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xb78(%rip),%rdi
call   1070 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <combSort@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xb3b(%rip),%rdi
call   1070 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <cocktailShakerSort@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xb08(%rip),%rdi
call   1070 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e7,%edx
call   1140 <stoogeSort@plt>
mov    $0x0,%al
call   1120 <print_time@plt>
mov    -0x28(%rbp),%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xfa0,%edi
call   10f0 <malloc@plt>
mov    %rax,%r14
mov    $0xfa0,%edi
call   10f0 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x3e8,%esi
call   1050 <fill_random@plt>
lea    0xdae(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3e7,%edx
call   1110 <quickSort@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xd72(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   10d0 <mergeSort@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xd36(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
mov    $0x8,%ecx
call   1080 <parallelMergeSort@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xcff(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1070 <heapSort@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xcc5(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   10b0 <radixSort@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xc8c(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   10a0 <bubbleSort@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xc54(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1100 <insertionSort@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xc1d(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1090 <selectionSort@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xbe8(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   10e0 <gnomeSort@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xbaf(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1060 <combSort@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xb75(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <cocktailShakerSort@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
lea    0xb45(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfa0,%edx
call   10c0 <memcpy@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3e7,%edx
call   1140 <stoogeSort@plt>
xor    %eax,%eax
call   1120 <print_time@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1130 <validate_raising_sort@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Quicksort\0A\00"
@.str.1 = [11 x i8] c"Mergesort\0A\00"
@.str.2 = [21 x i8] c"Parallel Mergesort:\0A\00"
@.str.3 = [11 x i8] c"heapSort:\0A\00"
@.str.4 = [12 x i8] c"radixSort:\0A\00"
@.str.5 = [13 x i8] c"BubbleSort:\0A\00"
@.str.6 = [16 x i8] c"insertionSort:\0A\00"
@.str.7 = [16 x i8] c"selectionSort:\0A\00"
@.str.8 = [12 x i8] c"gnomeSort:\0A\00"
@.str.9 = [11 x i8] c"combSort:\0A\00"
@.str.10 = [21 x i8] c"cocktailShakerSort:\0A\00"
@.str.11 = [13 x i8] c"stoogeSort:\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 1000, i32* %5
store i32 8, i32* %6
%9 = call i64 @malloc(i32 4000)
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %7
%11 = call i64 @malloc(i32 4000)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %8
%13 = load i32*, i32** %7
%14 = call i32 @fill_random(i32* %13, i32 1000)
%15 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%16 = load i32*, i32** %8
%17 = load i32*, i32** %7
%18 = call i32 @memcpy(i32* %16, i32* %17, i32 4000)
%19 = call i32 (...) @print_time()
%20 = load i32*, i32** %8
%21 = call i32 @quickSort(i32* %20, i32 0, i32 999)
%22 = call i32 (...) @print_time()
%23 = load i32*, i32** %8
%24 = call i32 @validate_raising_sort(i32* %23, i32 1000)
%25 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%26 = load i32*, i32** %8
%27 = load i32*, i32** %7
%28 = call i32 @memcpy(i32* %26, i32* %27, i32 4000)
%29 = call i32 (...) @print_time()
%30 = load i32*, i32** %8
%31 = call i32 @mergeSort(i32* %30, i32 0, i32 1000)
%32 = call i32 (...) @print_time()
%33 = load i32*, i32** %8
%34 = call i32 @validate_raising_sort(i32* %33, i32 1000)
%35 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%36 = load i32*, i32** %8
%37 = load i32*, i32** %7
%38 = call i32 @memcpy(i32* %36, i32* %37, i32 4000)
%39 = call i32 (...) @print_time()
%40 = load i32*, i32** %8
%41 = call i32 @parallelMergeSort(i32* %40, i32 0, i32 1000, i32 8)
%42 = call i32 (...) @print_time()
%43 = load i32*, i32** %8
%44 = call i32 @validate_raising_sort(i32* %43, i32 1000)
%45 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%46 = load i32*, i32** %8
%47 = load i32*, i32** %7
%48 = call i32 @memcpy(i32* %46, i32* %47, i32 4000)
%49 = call i32 (...) @print_time()
%50 = load i32*, i32** %8
%51 = call i32 @heapSort(i32* %50, i32 1000)
%52 = call i32 (...) @print_time()
%53 = load i32*, i32** %8
%54 = call i32 @validate_raising_sort(i32* %53, i32 1000)
%55 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%56 = load i32*, i32** %8
%57 = load i32*, i32** %7
%58 = call i32 @memcpy(i32* %56, i32* %57, i32 4000)
%59 = call i32 (...) @print_time()
%60 = load i32*, i32** %8
%61 = call i32 @radixSort(i32* %60, i32 1000)
%62 = call i32 (...) @print_time()
%63 = load i32*, i32** %8
%64 = call i32 @validate_raising_sort(i32* %63, i32 1000)
%65 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%66 = load i32*, i32** %8
%67 = load i32*, i32** %7
%68 = call i32 @memcpy(i32* %66, i32* %67, i32 4000)
%69 = call i32 (...) @print_time()
%70 = load i32*, i32** %8
%71 = call i32 @bubbleSort(i32* %70, i32 1000)
%72 = call i32 (...) @print_time()
%73 = load i32*, i32** %8
%74 = call i32 @validate_raising_sort(i32* %73, i32 1000)
%75 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%76 = load i32*, i32** %8
%77 = load i32*, i32** %7
%78 = call i32 @memcpy(i32* %76, i32* %77, i32 4000)
%79 = call i32 (...) @print_time()
%80 = load i32*, i32** %8
%81 = call i32 @insertionSort(i32* %80, i32 0, i32 1000)
%82 = call i32 (...) @print_time()
%83 = load i32*, i32** %8
%84 = call i32 @validate_raising_sort(i32* %83, i32 1000)
%85 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%86 = load i32*, i32** %8
%87 = load i32*, i32** %7
%88 = call i32 @memcpy(i32* %86, i32* %87, i32 4000)
%89 = call i32 (...) @print_time()
%90 = load i32*, i32** %8
%91 = call i32 @selectionSort(i32* %90, i32 1000)
%92 = call i32 (...) @print_time()
%93 = load i32*, i32** %8
%94 = call i32 @validate_raising_sort(i32* %93, i32 1000)
%95 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%96 = load i32*, i32** %8
%97 = load i32*, i32** %7
%98 = call i32 @memcpy(i32* %96, i32* %97, i32 4000)
%99 = call i32 (...) @print_time()
%100 = load i32*, i32** %8
%101 = call i32 @gnomeSort(i32* %100, i32 1000)
%102 = call i32 (...) @print_time()
%103 = load i32*, i32** %8
%104 = call i32 @validate_raising_sort(i32* %103, i32 1000)
%105 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
%106 = load i32*, i32** %8
%107 = load i32*, i32** %7
%108 = call i32 @memcpy(i32* %106, i32* %107, i32 4000)
%109 = call i32 (...) @print_time()
%110 = load i32*, i32** %8
%111 = call i32 @combSort(i32* %110, i32 1000)
%112 = call i32 (...) @print_time()
%113 = load i32*, i32** %8
%114 = call i32 @validate_raising_sort(i32* %113, i32 1000)
%115 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0))
%116 = load i32*, i32** %8
%117 = load i32*, i32** %7
%118 = call i32 @memcpy(i32* %116, i32* %117, i32 4000)
%119 = call i32 (...) @print_time()
%120 = load i32*, i32** %8
%121 = call i32 @cocktailShakerSort(i32* %120, i32 1000)
%122 = call i32 (...) @print_time()
%123 = load i32*, i32** %8
%124 = call i32 @validate_raising_sort(i32* %123, i32 1000)
%125 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0))
%126 = load i32*, i32** %8
%127 = load i32*, i32** %7
%128 = call i32 @memcpy(i32* %126, i32* %127, i32 4000)
%129 = call i32 (...) @print_time()
%130 = load i32*, i32** %8
%131 = call i32 @stoogeSort(i32* %130, i32 0, i32 999)
%132 = call i32 (...) @print_time()
%133 = load i32*, i32** %8
%134 = call i32 @validate_raising_sort(i32* %133, i32 1000)
ret i32 0
}

LLVM IR (-O2):
@str = [10 x i8] c"Quicksort\00"
@str.12 = [10 x i8] c"Mergesort\00"
@str.13 = [20 x i8] c"Parallel Mergesort:\00"
@str.14 = [10 x i8] c"heapSort:\00"
@str.15 = [11 x i8] c"radixSort:\00"
@str.16 = [12 x i8] c"BubbleSort:\00"
@str.17 = [15 x i8] c"insertionSort:\00"
@str.18 = [15 x i8] c"selectionSort:\00"
@str.19 = [11 x i8] c"gnomeSort:\00"
@str.20 = [10 x i8] c"combSort:\00"
@str.21 = [20 x i8] c"cocktailShakerSort:\00"
@str.22 = [12 x i8] c"stoogeSort:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 4000)
%4 = inttoptr i64 %3 to i32*
%5 = tail call i64 @malloc(i32 4000)
%6 = inttoptr i64 %5 to i32*
%7 = tail call i32 @fill_random(i32* %4, i32 1000)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @memcpy(i32* %6, i32* %4, i32 4000)
%10 = tail call i32 (...) @print_time()
%11 = tail call i32 @quickSort(i32* %6, i32 0, i32 999)
%12 = tail call i32 (...) @print_time()
%13 = tail call i32 @validate_raising_sort(i32* %6, i32 1000)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.12, i64 0, i64 0))
%15 = tail call i32 @memcpy(i32* %6, i32* %4, i32 4000)
%16 = tail call i32 (...) @print_time()
%17 = tail call i32 @mergeSort(i32* %6, i32 0, i32 1000)
%18 = tail call i32 (...) @print_time()
%19 = tail call i32 @validate_raising_sort(i32* %6, i32 1000)
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.13, i64 0, i64 0))
%21 = tail call i32 @memcpy(i32* %6, i32* %4, i32 4000)
%22 = tail call i32 (...) @print_time()
%23 = tail call i32 @parallelMergeSort(i32* %6, i32 0, i32 1000, i32 8)
%24 = tail call i32 (...) @print_time()
%25 = tail call i32 @validate_raising_sort(i32* %6, i32 1000)
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.14, i64 0, i64 0))
%27 = tail call i32 @memcpy(i32* %6, i32* %4, i32 4000)
%28 = tail call i32 (...) @print_time()
%29 = tail call i32 @heapSort(i32* %6, i32 1000)
%30 = tail call i32 (...) @print_time()
%31 = tail call i32 @validate_raising_sort(i32* %6, i32 1000)
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.15, i64 0, i64 0))
%33 = tail call i32 @memcpy(i32* %6, i32* %4, i32 4000)
%34 = tail call i32 (...) @print_time()
%35 = tail call i32 @radixSort(i32* %6, i32 1000)
%36 = tail call i32 (...) @print_time()
%37 = tail call i32 @validate_raising_sort(i32* %6, i32 1000)
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.16, i64 0, i64 0))
%39 = tail call i32 @memcpy(i32* %6, i32* %4, i32 4000)
%40 = tail call i32 (...) @print_time()
%41 = tail call i32 @bubbleSort(i32* %6, i32 1000)
%42 = tail call i32 (...) @print_time()
%43 = tail call i32 @validate_raising_sort(i32* %6, i32 1000)
%44 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.17, i64 0, i64 0))
%45 = tail call i32 @memcpy(i32* %6, i32* %4, i32 4000)
%46 = tail call i32 (...) @print_time()
%47 = tail call i32 @insertionSort(i32* %6, i32 0, i32 1000)
%48 = tail call i32 (...) @print_time()
%49 = tail call i32 @validate_raising_sort(i32* %6, i32 1000)
%50 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.18, i64 0, i64 0))
%51 = tail call i32 @memcpy(i32* %6, i32* %4, i32 4000)
%52 = tail call i32 (...) @print_time()
%53 = tail call i32 @selectionSort(i32* %6, i32 1000)
%54 = tail call i32 (...) @print_time()
%55 = tail call i32 @validate_raising_sort(i32* %6, i32 1000)
%56 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.19, i64 0, i64 0))
%57 = tail call i32 @memcpy(i32* %6, i32* %4, i32 4000)
%58 = tail call i32 (...) @print_time()
%59 = tail call i32 @gnomeSort(i32* %6, i32 1000)
%60 = tail call i32 (...) @print_time()
%61 = tail call i32 @validate_raising_sort(i32* %6, i32 1000)
%62 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.20, i64 0, i64 0))
%63 = tail call i32 @memcpy(i32* %6, i32* %4, i32 4000)
%64 = tail call i32 (...) @print_time()
%65 = tail call i32 @combSort(i32* %6, i32 1000)
%66 = tail call i32 (...) @print_time()
%67 = tail call i32 @validate_raising_sort(i32* %6, i32 1000)
%68 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.21, i64 0, i64 0))
%69 = tail call i32 @memcpy(i32* %6, i32* %4, i32 4000)
%70 = tail call i32 (...) @print_time()
%71 = tail call i32 @cocktailShakerSort(i32* %6, i32 1000)
%72 = tail call i32 (...) @print_time()
%73 = tail call i32 @validate_raising_sort(i32* %6, i32 1000)
%74 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.22, i64 0, i64 0))
%75 = tail call i32 @memcpy(i32* %6, i32* %4, i32 4000)
%76 = tail call i32 (...) @print_time()
%77 = tail call i32 @stoogeSort(i32* %6, i32 0, i32 999)
%78 = tail call i32 (...) @print_time()
%79 = tail call i32 @validate_raising_sort(i32* %6, i32 1000)
ret i32 0
}