#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*/ Partition(double **, int, int, int, int *);
void QuickSort(double **data, int first, int last, int col) {
  if (first >= last)
    return;
  int ends[2];
  Partition(data, first, last, col, ends);
  QuickSort(data, first, ends[0], col);
  QuickSort(data, ends[1], last, col);
  return;
}


x86 assembly (clang, -O0):
<QuickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1146 <QuickSort+0x26>
jmp    1180 <QuickSort+0x60>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    -0x1c(%rbp),%r8
call   1040 <Partition@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <QuickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <QuickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuickSort>:
cmp    %edx,%esi
jge    1168 <QuickSort+0x48>
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%ebx
mov    %rdi,%r15
mov    %rsp,%r8
call   1040 <Partition@plt>
mov    (%rsp),%edx
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14d,%ecx
call   1030 <QuickSort@plt>
mov    0x4(%rsp),%esi
mov    %r15,%rdi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1030 <QuickSort@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @QuickSort(double** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca double**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [2 x i32]
store double** %0, double*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = icmp sge i32 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %4
br label %31
14: ; preds = %4
%15 = load double**, double*** %5
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%20 = call i32 @Partition(double** %15, i32 %16, i32 %17, i32 %18, i32* %19)
%21 = load double**, double*** %5
%22 = load i32, i32* %6
%23 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%24 = load i32, i32* %23
%25 = load i32, i32* %8
%26 = load double**, double*** %5
%27 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%28 = load i32, i32* %27
%29 = load i32, i32* %7
%30 = load i32, i32* %8
br label %31
31: ; preds = %14, %13
ret void
}

LLVM IR (-O2):
define void @QuickSort(double** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [2 x i32]
%6 = icmp slt i32 %1, %2
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = bitcast [2 x i32]* %5 to i8*
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%10 = call i32 @Partition(double** %0, i32 %1, i32 %2, i32 %3, i32* %9)
%11 = load i32, i32* %9
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%13 = load i32, i32* %12
br label %14
14: ; preds = %4, %7
ret void
}