#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*/ QSpartition(char *, int *, int *);
void QSsort(char *string, int left, int right) {
  int i, j;
  i = left;
  j = right;
  QSpartition(string, &i, &j);
  if (left < j)
    QSsort(string, left, j);
  if (i < right)
    QSsort(string, i, right);
}


x86 assembly (clang, -O0):
<QSsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <QSpartition@plt>
mov    -0xc(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    116a <QSsort+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <QSsort@plt>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1185 <QSsort+0x65>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <QSsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QSsort>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,0xc(%rsp)
mov    %edx,0x8(%rsp)
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1030 <QSpartition@plt>
mov    0x8(%rsp),%edx
cmp    %ebp,%edx
jle    1158 <QSsort+0x38>
mov    %r14,%rdi
mov    %ebp,%esi
call   1040 <QSsort@plt>
mov    0xc(%rsp),%esi
cmp    %ebx,%esi
jge    116a <QSsort+0x4a>
mov    %r14,%rdi
mov    %ebx,%edx
call   1040 <QSsort@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @QSsort(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
store i32 %9, i32* %7
%10 = load i32, i32* %6
store i32 %10, i32* %8
%11 = load i8*, i8** %4
%12 = call i32 @QSpartition(i8* %11, i32* %7, i32* %8)
%13 = load i32, i32* %5
%14 = load i32, i32* %8
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %20
16: ; preds = %3
%17 = load i8*, i8** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %8
br label %20
20: ; preds = %16, %3
%21 = load i32, i32* %7
%22 = load i32, i32* %6
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = load i8*, i8** %4
%26 = load i32, i32* %7
%27 = load i32, i32* %6
br label %28
28: ; preds = %24, %20
ret void
}

LLVM IR (-O2):
define void @QSsort(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
store i32 %1, i32* %4
store i32 %2, i32* %5
%8 = call i32 @QSpartition(i8* %0, i32* %4, i32* %5)
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, %1
br i1 %10, label %11, label %12
11: ; preds = %3
br label %12
12: ; preds = %11, %3
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, %2
br i1 %14, label %15, label %16
15: ; preds = %12
br label %16
16: ; preds = %15, %12
ret void
}