#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*/ arry_double;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ quickSort(double *, int /*<<< orphan*/, int);
int quickSort_test() {
  double arry_double[100] = {'\0'};
  int i = 0;
  arry_double[0] = 5.5;
  arry_double[1] = 2.2;
  arry_double[2] = 1.1;
  arry_double[3] = 3.3;
  arry_double[4] = 3.4;
  arry_double[5] = 2.7;
  arry_double[6] = 9.6;
  arry_double[7] = 8.2;
  arry_double[8] = 10.9;
  arry_double[9] = 1.0;
  quickSort(arry_double, 0, sizeof(arry_double) / sizeof(double) - 1);
  for (i = 0; i < sizeof(arry_double) / sizeof(double); i++) {
    printf("%2f\n", arry_double[i]);
  }
}


x86 assembly (clang, -O0):
<quickSort_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
lea    -0x330(%rbp),%rdi
xor    %esi,%esi
mov    $0x320,%edx
call   1040 <memset@plt>
movl   $0x0,-0x334(%rbp)
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,-0x330(%rbp)
ff
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x328(%rbp)
ff
movsd  0xeb8(%rip),%xmm0
movsd  %xmm0,-0x320(%rbp)
ff
movsd  0xea0(%rip),%xmm0
movsd  %xmm0,-0x318(%rbp)
ff
movsd  0xe88(%rip),%xmm0
movsd  %xmm0,-0x310(%rbp)
ff
movsd  0xe70(%rip),%xmm0
movsd  %xmm0,-0x308(%rbp)
ff
movsd  0xe58(%rip),%xmm0
movsd  %xmm0,-0x300(%rbp)
ff
movsd  0xe40(%rip),%xmm0
movsd  %xmm0,-0x2f8(%rbp)
ff
movsd  0xe28(%rip),%xmm0
movsd  %xmm0,-0x2f0(%rbp)
ff
movsd  0xe10(%rip),%xmm0
movsd  %xmm0,-0x2e8(%rbp)
ff
lea    -0x330(%rbp),%rdi
xor    %esi,%esi
mov    $0x63,%edx
call   1050 <quickSort@plt>
movl   $0x0,-0x334(%rbp)
movslq -0x334(%rbp),%rax
cmp    $0x64,%rax
jae    1256 <quickSort_test+0x126>
movslq -0x334(%rbp),%rax
movsd  -0x330(%rbp,%rax,8),%xmm0
ff ff
lea    0xe13(%rip),%rdi
call   1030 <printf@plt>
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
jmp    1215 <quickSort_test+0xe5>
mov    -0x4(%rbp),%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort_test>:
push   %r14
push   %rbx
sub    $0x328,%rsp
lea    0x50(%rsp),%rdi
xor    %ebx,%ebx
mov    $0x2d0,%edx
xor    %esi,%esi
call   1040 <memset@plt>
movaps 0xeac(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x63,%edx
call   1050 <quickSort@plt>
lea    0xeb2(%rip),%r14
xchg   %ax,%ax
movsd  (%rsp,%rbx,8),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    11a0 <quickSort_test+0x70>
add    $0x328,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%2f\0A\00"
define i32 @quickSort_test() {
%1 = alloca i32
%2 = alloca [100 x double]
%3 = alloca i32
%4 = bitcast [100 x double]* %2 to i8*
store i32 0, i32* %3
%5 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 0
store double 5.500000e+00, double* %5
%6 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 1
store double 2.200000e+00, double* %6
%7 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 2
store double 1.100000e+00, double* %7
%8 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 3
store double 3.300000e+00, double* %8
%9 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 4
store double 3.400000e+00, double* %9
%10 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 5
store double 2.700000e+00, double* %10
%11 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 6
store double 0x4023333333333333, double* %11
%12 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 7
store double 0x4020666666666666, double* %12
%13 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 8
store double 1.090000e+01, double* %13
%14 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 9
store double 1.000000e+00, double* %14
%15 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 0
%16 = call i32 @quickSort(double* %15, i32 0, i32 99)
store i32 0, i32* %3
br label %17
17: ; preds = %27, %0
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = icmp ult i64 %19, 100
br i1 %20, label %21, label %30
21: ; preds = %17
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [100 x double], [100 x double]* %2, i64 0, i64 %23
%25 = load double, double* %24
%26 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %25)
br label %27
27: ; preds = %21
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %17
30: ; preds = %17
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
@.str = [5 x i8] c"%2f\0A\00"
define i32 @quickSort_test() {
%1 = alloca [100 x double]
%2 = bitcast [100 x double]* %1 to i8*
%3 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 10
%4 = bitcast double* %3 to i8*
%5 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 0
%6 = bitcast [100 x double]* %1 to <2 x double>*
store <2 x double> <double 5.500000e+00, double 2.200000e+00>, <2 x double>* %6
%7 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 2
%8 = bitcast double* %7 to <2 x double>*
store <2 x double> <double 1.100000e+00, double 3.300000e+00>, <2 x double>* %8
%9 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 4
%10 = bitcast double* %9 to <2 x double>*
store <2 x double> <double 3.400000e+00, double 2.700000e+00>, <2 x double>* %10
%11 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 6
%12 = bitcast double* %11 to <2 x double>*
store <2 x double> <double 0x4023333333333333, double 0x4020666666666666>, <2 x double>* %12
%13 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 8
%14 = bitcast double* %13 to <2 x double>*
store <2 x double> <double 1.090000e+01, double 1.000000e+00>, <2 x double>* %14
%15 = call i32 @quickSort(double* %5, i32 0, i32 99)
br label %16
16: ; preds = %0, %16
%17 = phi i64 [ 0, %0 ], [ %21, %16 ]
%18 = getelementptr inbounds [100 x double], [100 x double]* %1, i64 0, i64 %17
%19 = load double, double* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %19)
%21 = add nuw nsw i64 %17, 1
%22 = icmp eq i64 %21, 100
br i1 %22, label %23, label %16
23: ; preds = %16
ret i32 undef
}