#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 */
unsigned long long partition(unsigned long long *, unsigned long long *,
                             unsigned long long *, unsigned long long,
                             unsigned long long);
void quickSort(unsigned long long int *a, unsigned long long int *b,
               unsigned long long int *c, unsigned long long int left,
               unsigned long long int right) {
  unsigned long long int q = 0;
  if (left < right) {
    q = partition(a, b, c, left, right);
    quickSort(a, b, c, left, q);
    quickSort(a, b, c, q + 1, right);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    11a5 <quickSort+0x85>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <partition@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x30(%rbp),%rcx
add    $0x1,%rcx
mov    -0x28(%rbp),%r8
call   1040 <quickSort@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    %r8,%rcx
jae    1177 <quickSort+0x57>
mov    %r8,%r14
mov    %rcx,%rbx
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r13
nop
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    %r14,%r8
call   1030 <partition@plt>
mov    %rax,%rbp
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    %rax,%r8
call   1040 <quickSort@plt>
add    $0x1,%rbp
mov    %rbp,%rbx
cmp    %r14,%rbp
jb     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quickSort(i64* %0, i64* %1, i64* %2, i64 %3, i64 %4) {
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i64*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store i64* %0, i64** %6
store i64* %1, i64** %7
store i64* %2, i64** %8
store i64 %3, i64* %9
store i64 %4, i64* %10
store i64 0, i64* %11
%12 = load i64, i64* %9
%13 = load i64, i64* %10
%14 = icmp ult i64 %12, %13
br i1 %14, label %15, label %33
15: ; preds = %5
%16 = load i64*, i64** %6
%17 = load i64*, i64** %7
%18 = load i64*, i64** %8
%19 = load i64, i64* %9
%20 = load i64, i64* %10
%21 = call i64 @partition(i64* %16, i64* %17, i64* %18, i64 %19, i64 %20)
store i64 %21, i64* %11
%22 = load i64*, i64** %6
%23 = load i64*, i64** %7
%24 = load i64*, i64** %8
%25 = load i64, i64* %9
%26 = load i64, i64* %11
%27 = load i64*, i64** %6
%28 = load i64*, i64** %7
%29 = load i64*, i64** %8
%30 = load i64, i64* %11
%31 = add i64 %30, 1
%32 = load i64, i64* %10
br label %33
33: ; preds = %15, %5
ret void
}

LLVM IR (-O2):
define void @quickSort(i64* %0, i64* %1, i64* %2, i64 %3, i64 %4) {
%6 = icmp ult i64 %3, %4
br i1 %6, label %7, label %12
7: ; preds = %5, %7
%8 = phi i64 [ %10, %7 ], [ %3, %5 ]
%9 = tail call i64 @partition(i64* %0, i64* %1, i64* %2, i64 %8, i64 %4)
tail call void @quickSort(i64* %0, i64* %1, i64* %2, i64 %8, i64 %9)
%10 = add i64 %9, 1
%11 = icmp ult i64 %10, %4
br i1 %11, label %7, label %12
12: ; preds = %7, %5
ret void
}