#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 */
typedef int /*<<< orphan*/ c;
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ quick_sort_test(int *, int);
int main(int argc, char *argv[]) {
  int a[] = {2, 1, 7, 6, 5, 4, 8, 3};
  int len = sizeof(a) / sizeof(int);
  quick_sort_test(a, len);
  int b[] = {};
  len = sizeof(b) / sizeof(int);
  quick_sort_test(b, len);
  int c[] = {9, 8, 7, 6, 5, 4, 3, 2, 1};
  len = sizeof(c) / sizeof(int);
  quick_sort_test(c, len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <quick_sort_test@plt>
movl   $0x0,-0x34(%rbp)
lea    -0x38(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <quick_sort_test@plt>
lea    -0x60(%rbp),%rdi
lea    0xe8d(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
movl   $0x9,-0x34(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <quick_sort_test@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
lea    0x40(%rsp),%rdi
mov    $0x8,%esi
call   1030 <quick_sort_test@plt>
lea    0xc(%rsp),%rdi
xor    %esi,%esi
call   1030 <quick_sort_test@plt>
mov    0xef3(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x9,%esi
call   1030 <quick_sort_test@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [8 x i32] [i32 2, i32 1, i32 7, i32 6, i32 5, i32 4, i32 8, i32 3]
@__const.main.c = [9 x i32] [i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x i32]
%7 = alloca i32
%8 = alloca [0 x i32]
%9 = alloca [9 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [8 x i32]* %6 to i8*
store i32 8, i32* %7
%11 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 0
%12 = load i32, i32* %7
%13 = call i32 @quick_sort_test(i32* %11, i32 %12)
%14 = bitcast [0 x i32]* %8 to i8*
store i32 0, i32* %7
%15 = getelementptr inbounds [0 x i32], [0 x i32]* %8, i64 0, i64 0
%16 = load i32, i32* %7
%17 = call i32 @quick_sort_test(i32* %15, i32 %16)
%18 = bitcast [9 x i32]* %9 to i8*
store i32 9, i32* %7
%19 = getelementptr inbounds [9 x i32], [9 x i32]* %9, i64 0, i64 0
%20 = load i32, i32* %7
%21 = call i32 @quick_sort_test(i32* %19, i32 %20)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [8 x i32] [i32 2, i32 1, i32 7, i32 6, i32 5, i32 4, i32 8, i32 3]
@__const.main.c = [9 x i32] [i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [0 x i32]
%4 = alloca [8 x i32]
%5 = alloca [9 x i32]
%6 = bitcast [8 x i32]* %4 to i8*
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 0
%8 = call i32 @quick_sort_test(i32* %7, i32 8)
%9 = bitcast [0 x i32]* %3 to i8*
%10 = getelementptr inbounds [0 x i32], [0 x i32]* %3, i64 0, i64 0
%11 = call i32 @quick_sort_test(i32* %10, i32 0)
%12 = bitcast [9 x i32]* %5 to i8*
%13 = getelementptr inbounds [9 x i32], [9 x i32]* %5, i64 0, i64 0
%14 = call i32 @quick_sort_test(i32* %13, i32 9)
ret i32 0
}