#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 right;
typedef scalar_t__ left;

/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ memcpy(double *, double *, int);
double CSPL_Array_quickselect(long index, double *inval, long left,
                              long right) {
  double *incopy;
  unsigned long i, j;
  unsigned long k = index;
  double t, ans;
  {
    incopy = (double *)calloc((right) - (left) + 1, sizeof(double));
    memcpy((incopy), &(inval)[(left)], sizeof(double) * ((right) - (left) + 1));
  };
  while (right > left) {
    t = incopy[k];
    i = left;
    j = right;
    {
      double tmp = incopy[left];
      incopy[left] = incopy[k];
      incopy[k] = tmp;
    };
    if (incopy[right] > t) {
      double tmp = incopy[right];
      incopy[right] = incopy[left];
      incopy[left] = tmp;
    };
    while (i < j) {
      {
        double tmp = incopy[i];
        incopy[i] = incopy[j];
        incopy[j] = tmp;
      };
      i++;
      j--;
      while (incopy[i] < t)
        i++;
      while (incopy[j] > t)
        j--;
    }
    if (incopy[left] == t) {
      {
        double tmp = incopy[left];
        incopy[left] = incopy[j];
        incopy[j] = tmp;
      };
    } else {
      j++;
      {
        double tmp = incopy[j];
        incopy[j] = incopy[right];
        incopy[right] = tmp;
      };
    }
    if (j <= k)
      left = j + 1;
    if (k <= j)
      right = j - 1;
  }
  ans = incopy[k];
  free(incopy);
  return (ans);
}


x86 assembly (clang, -O0):
<CSPL_Array_quickselect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
sub    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %eax,%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x20(%rbp),%rax
sub    -0x18(%rbp),%rax
add    $0x1,%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1050 <memcpy@plt>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    140a <CSPL_Array_quickselect+0x2da>
mov    -0x28(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x58(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    125d <CSPL_Array_quickselect+0x12d>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x60(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1262 <CSPL_Array_quickselect+0x132>
mov    -0x30(%rbp),%rax
cmp    -0x38(%rbp),%rax
jae    1326 <CSPL_Array_quickselect+0x1f6>
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x38(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    12f3 <CSPL_Array_quickselect+0x1c3>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    12c6 <CSPL_Array_quickselect+0x196>
jmp    12f8 <CSPL_Array_quickselect+0x1c8>
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    1321 <CSPL_Array_quickselect+0x1f1>
mov    -0x38(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x38(%rbp)
jmp    12f8 <CSPL_Array_quickselect+0x1c8>
jmp    1262 <CSPL_Array_quickselect+0x132>
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd -0x48(%rbp),%xmm0
jne    1387 <CSPL_Array_quickselect+0x257>
jp     1387 <CSPL_Array_quickselect+0x257>
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    13d1 <CSPL_Array_quickselect+0x2a1>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x78(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
cmp    -0x40(%rbp),%rax
ja     13eb <CSPL_Array_quickselect+0x2bb>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x38(%rbp),%rax
ja     1405 <CSPL_Array_quickselect+0x2d5>
mov    -0x38(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1199 <CSPL_Array_quickselect+0x69>
mov    -0x28(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
movsd  -0x50(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CSPL_Array_quickselect>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%r15
mov    %r14d,%ebp
sub    %r12d,%ebp
lea    0x1(%rbp),%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
lea    0x0(,%r12,8),%rsi
add    %r13,%rsi
lea    0x8(,%rbp,8),%edx
mov    %rax,%rdi
call   1050 <memcpy@plt>
jmp    11af <CSPL_Array_quickselect+0x7f>
nopl   0x0(%rax)
movsd  0x8(%rbx,%rax,8),%xmm0
movsd  (%rbx,%r14,8),%xmm1
movsd  %xmm1,0x8(%rbx,%rax,8)
add    $0x1,%rax
movsd  %xmm0,(%rbx,%r14,8)
lea    0x1(%rax),%rcx
cmp    %r15,%rax
cmovbe %rcx,%r12
lea    -0x1(%rax),%rax
cmovae %rax,%r14
cmp    %r12,%r14
jle    1270 <CSPL_Array_quickselect+0x140>
movsd  (%rbx,%r15,8),%xmm0
movsd  (%rbx,%r12,8),%xmm1
movsd  %xmm0,(%rbx,%r12,8)
movsd  %xmm1,(%rbx,%r15,8)
movsd  (%rbx,%r14,8),%xmm1
ucomisd %xmm0,%xmm1
jbe    11ee <CSPL_Array_quickselect+0xbe>
movsd  (%rbx,%r12,8),%xmm2
movsd  %xmm2,(%rbx,%r14,8)
movsd  %xmm1,(%rbx,%r12,8)
mov    %r14,%rax
cmp    %r14,%r12
jae    1245 <CSPL_Array_quickselect+0x115>
movsd  (%rbx,%r12,8),%xmm1
movsd  (%rbx,%r14,8),%xmm2
mov    %r12,%rcx
mov    %r14,%rax
nopl   0x0(%rax,%rax,1)
movsd  %xmm2,(%rbx,%rcx,8)
movsd  %xmm1,(%rbx,%rax,8)
nopw   0x0(%rax,%rax,1)
movsd  0x8(%rbx,%rcx,8),%xmm1
add    $0x1,%rcx
ucomisd %xmm1,%xmm0
ja     1220 <CSPL_Array_quickselect+0xf0>
movsd  -0x8(%rbx,%rax,8),%xmm2
add    $0xffffffffffffffff,%rax
ucomisd %xmm0,%xmm2
ja     1230 <CSPL_Array_quickselect+0x100>
cmp    %rax,%rcx
jb     1210 <CSPL_Array_quickselect+0xe0>
movsd  (%rbx,%r12,8),%xmm1
ucomisd %xmm0,%xmm1
jne    1180 <CSPL_Array_quickselect+0x50>
jp     1180 <CSPL_Array_quickselect+0x50>
movsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%r12,8)
movsd  %xmm1,(%rbx,%rax,8)
jmp    119c <CSPL_Array_quickselect+0x6c>
movsd  (%rbx,%r15,8),%xmm0
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1030 <free@plt>
movsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @CSPL_Array_quickselect(i64 %0, double* %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca double*
%7 = alloca i64
%8 = alloca i64
%9 = alloca double*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
store i64 %0, i64* %5
store double* %1, double** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%20 = load i64, i64* %5
store i64 %20, i64* %12
%21 = load i64, i64* %8
%22 = load i64, i64* %7
%23 = sub nsw i64 %21, %22
%24 = add nsw i64 %23, 1
%25 = trunc i64 %24 to i32
%26 = call i64 @calloc(i32 %25, i32 8)
%27 = inttoptr i64 %26 to double*
store double* %27, double** %9
%28 = load double*, double** %9
%29 = load double*, double** %6
%30 = load i64, i64* %7
%31 = getelementptr inbounds double, double* %29, i64 %30
%32 = load i64, i64* %8
%33 = load i64, i64* %7
%34 = sub nsw i64 %32, %33
%35 = add nsw i64 %34, 1
%36 = mul i64 8, %35
%37 = trunc i64 %36 to i32
%38 = call i32 @memcpy(double* %28, double* %31, i32 %37)
br label %39
39: ; preds = %189, %4
%40 = load i64, i64* %8
%41 = load i64, i64* %7
%42 = icmp sgt i64 %40, %41
br i1 %42, label %43, label %190
43: ; preds = %39
%44 = load double*, double** %9
%45 = load i64, i64* %12
%46 = getelementptr inbounds double, double* %44, i64 %45
%47 = load double, double* %46
store double %47, double* %13
%48 = load i64, i64* %7
store i64 %48, i64* %10
%49 = load i64, i64* %8
store i64 %49, i64* %11
%50 = load double*, double** %9
%51 = load i64, i64* %7
%52 = getelementptr inbounds double, double* %50, i64 %51
%53 = load double, double* %52
store double %53, double* %15
%54 = load double*, double** %9
%55 = load i64, i64* %12
%56 = getelementptr inbounds double, double* %54, i64 %55
%57 = load double, double* %56
%58 = load double*, double** %9
%59 = load i64, i64* %7
%60 = getelementptr inbounds double, double* %58, i64 %59
store double %57, double* %60
%61 = load double, double* %15
%62 = load double*, double** %9
%63 = load i64, i64* %12
%64 = getelementptr inbounds double, double* %62, i64 %63
store double %61, double* %64
%65 = load double*, double** %9
%66 = load i64, i64* %8
%67 = getelementptr inbounds double, double* %65, i64 %66
%68 = load double, double* %67
%69 = load double, double* %13
%70 = fcmp ogt double %68, %69
br i1 %70, label %71, label %87
71: ; preds = %43
%72 = load double*, double** %9
%73 = load i64, i64* %8
%74 = getelementptr inbounds double, double* %72, i64 %73
%75 = load double, double* %74
store double %75, double* %16
%76 = load double*, double** %9
%77 = load i64, i64* %7
%78 = getelementptr inbounds double, double* %76, i64 %77
%79 = load double, double* %78
%80 = load double*, double** %9
%81 = load i64, i64* %8
%82 = getelementptr inbounds double, double* %80, i64 %81
store double %79, double* %82
%83 = load double, double* %16
%84 = load double*, double** %9
%85 = load i64, i64* %7
%86 = getelementptr inbounds double, double* %84, i64 %85
store double %83, double* %86
br label %87
87: ; preds = %71, %43
br label %88
88: ; preds = %133, %87
%89 = load i64, i64* %10
%90 = load i64, i64* %11
%91 = icmp ult i64 %89, %90
br i1 %91, label %92, label %134
92: ; preds = %88
%93 = load double*, double** %9
%94 = load i64, i64* %10
%95 = getelementptr inbounds double, double* %93, i64 %94
%96 = load double, double* %95
store double %96, double* %17
%97 = load double*, double** %9
%98 = load i64, i64* %11
%99 = getelementptr inbounds double, double* %97, i64 %98
%100 = load double, double* %99
%101 = load double*, double** %9
%102 = load i64, i64* %10
%103 = getelementptr inbounds double, double* %101, i64 %102
store double %100, double* %103
%104 = load double, double* %17
%105 = load double*, double** %9
%106 = load i64, i64* %11
%107 = getelementptr inbounds double, double* %105, i64 %106
store double %104, double* %107
%108 = load i64, i64* %10
%109 = add i64 %108, 1
store i64 %109, i64* %10
%110 = load i64, i64* %11
%111 = add i64 %110, -1
store i64 %111, i64* %11
br label %112
112: ; preds = %119, %92
%113 = load double*, double** %9
%114 = load i64, i64* %10
%115 = getelementptr inbounds double, double* %113, i64 %114
%116 = load double, double* %115
%117 = load double, double* %13
%118 = fcmp olt double %116, %117
br i1 %118, label %119, label %122
119: ; preds = %112
%120 = load i64, i64* %10
%121 = add i64 %120, 1
store i64 %121, i64* %10
br label %112
122: ; preds = %112
br label %123
123: ; preds = %130, %122
%124 = load double*, double** %9
%125 = load i64, i64* %11
%126 = getelementptr inbounds double, double* %124, i64 %125
%127 = load double, double* %126
%128 = load double, double* %13
%129 = fcmp ogt double %127, %128
br i1 %129, label %130, label %133
130: ; preds = %123
%131 = load i64, i64* %11
%132 = add i64 %131, -1
store i64 %132, i64* %11
br label %123
133: ; preds = %123
br label %88
134: ; preds = %88
%135 = load double*, double** %9
%136 = load i64, i64* %7
%137 = getelementptr inbounds double, double* %135, i64 %136
%138 = load double, double* %137
%139 = load double, double* %13
%140 = fcmp oeq double %138, %139
br i1 %140, label %141, label %157
141: ; preds = %134
%142 = load double*, double** %9
%143 = load i64, i64* %7
%144 = getelementptr inbounds double, double* %142, i64 %143
%145 = load double, double* %144
store double %145, double* %18
%146 = load double*, double** %9
%147 = load i64, i64* %11
%148 = getelementptr inbounds double, double* %146, i64 %147
%149 = load double, double* %148
%150 = load double*, double** %9
%151 = load i64, i64* %7
%152 = getelementptr inbounds double, double* %150, i64 %151
store double %149, double* %152
%153 = load double, double* %18
%154 = load double*, double** %9
%155 = load i64, i64* %11
%156 = getelementptr inbounds double, double* %154, i64 %155
store double %153, double* %156
br label %175
157: ; preds = %134
%158 = load i64, i64* %11
%159 = add i64 %158, 1
store i64 %159, i64* %11
%160 = load double*, double** %9
%161 = load i64, i64* %11
%162 = getelementptr inbounds double, double* %160, i64 %161
%163 = load double, double* %162
store double %163, double* %19
%164 = load double*, double** %9
%165 = load i64, i64* %8
%166 = getelementptr inbounds double, double* %164, i64 %165
%167 = load double, double* %166
%168 = load double*, double** %9
%169 = load i64, i64* %11
%170 = getelementptr inbounds double, double* %168, i64 %169
store double %167, double* %170
%171 = load double, double* %19
%172 = load double*, double** %9
%173 = load i64, i64* %8
%174 = getelementptr inbounds double, double* %172, i64 %173
store double %171, double* %174
br label %175
175: ; preds = %157, %141
%176 = load i64, i64* %11
%177 = load i64, i64* %12
%178 = icmp ule i64 %176, %177
br i1 %178, label %179, label %182
179: ; preds = %175
%180 = load i64, i64* %11
%181 = add i64 %180, 1
store i64 %181, i64* %7
br label %182
182: ; preds = %179, %175
%183 = load i64, i64* %12
%184 = load i64, i64* %11
%185 = icmp ule i64 %183, %184
br i1 %185, label %186, label %189
186: ; preds = %182
%187 = load i64, i64* %11
%188 = sub i64 %187, 1
store i64 %188, i64* %8
br label %189
189: ; preds = %186, %182
br label %39
190: ; preds = %39
%191 = load double*, double** %9
%192 = load i64, i64* %12
%193 = getelementptr inbounds double, double* %191, i64 %192
%194 = load double, double* %193
store double %194, double* %14
%195 = load double*, double** %9
%196 = call i32 @free(double* %195)
%197 = load double, double* %14
ret double %197
}

LLVM IR (-O2):
define double @CSPL_Array_quickselect(i64 %0, double* %1, i64 %2, i64 %3) {
%5 = sub nsw i64 %3, %2
%6 = trunc i64 %5 to i32
%7 = add i32 %6, 1
%8 = tail call i64 @calloc(i32 %7, i32 8)
%9 = inttoptr i64 %8 to double*
%10 = getelementptr inbounds double, double* %1, i64 %2
%11 = shl i32 %7, 3
%12 = tail call i32 @memcpy(double* %9, double* %10, i32 %11)
%13 = icmp sgt i64 %3, %2
br i1 %13, label %14, label %74
14: ; preds = %4
%15 = getelementptr inbounds double, double* %9, i64 %0
br label %16
16: ; preds = %14, %65
%17 = phi i64 [ %2, %14 ], [ %69, %65 ]
%18 = phi i64 [ %3, %14 ], [ %72, %65 ]
%19 = load double, double* %15
%20 = getelementptr inbounds double, double* %9, i64 %17
%21 = load double, double* %20
store double %19, double* %20
store double %21, double* %15
%22 = getelementptr inbounds double, double* %9, i64 %18
%23 = load double, double* %22
%24 = fcmp ogt double %23, %19
br i1 %24, label %25, label %27
25: ; preds = %16
%26 = load double, double* %20
store double %26, double* %22
store double %23, double* %20
br label %27
27: ; preds = %25, %16
%28 = icmp ult i64 %17, %18
br i1 %28, label %29, label %53
29: ; preds = %27
%30 = load double, double* %20
%31 = load double, double* %22
br label %34
32: ; preds = %47
%33 = icmp ult i64 %43, %49
br i1 %33, label %34, label %53
34: ; preds = %29, %32
%35 = phi double [ %51, %32 ], [ %31, %29 ]
%36 = phi double [ %45, %32 ], [ %30, %29 ]
%37 = phi i64 [ %43, %32 ], [ %17, %29 ]
%38 = phi i64 [ %49, %32 ], [ %18, %29 ]
%39 = getelementptr inbounds double, double* %9, i64 %37
%40 = getelementptr inbounds double, double* %9, i64 %38
store double %35, double* %39
store double %36, double* %40
br label %41
41: ; preds = %41, %34
%42 = phi i64 [ %37, %34 ], [ %43, %41 ]
%43 = add i64 %42, 1
%44 = getelementptr inbounds double, double* %9, i64 %43
%45 = load double, double* %44
%46 = fcmp olt double %45, %19
br i1 %46, label %41, label %47
47: ; preds = %41, %47
%48 = phi i64 [ %49, %47 ], [ %38, %41 ]
%49 = add i64 %48, -1
%50 = getelementptr inbounds double, double* %9, i64 %49
%51 = load double, double* %50
%52 = fcmp ogt double %51, %19
br i1 %52, label %47, label %32
53: ; preds = %32, %27
%54 = phi i64 [ %18, %27 ], [ %49, %32 ]
%55 = load double, double* %20
%56 = fcmp oeq double %55, %19
br i1 %56, label %57, label %60
57: ; preds = %53
%58 = getelementptr inbounds double, double* %9, i64 %54
%59 = load double, double* %58
store double %59, double* %20
store double %55, double* %58
br label %65
60: ; preds = %53
%61 = add i64 %54, 1
%62 = getelementptr inbounds double, double* %9, i64 %61
%63 = load double, double* %62
%64 = load double, double* %22
store double %64, double* %62
store double %63, double* %22
br label %65
65: ; preds = %60, %57
%66 = phi i64 [ %54, %57 ], [ %61, %60 ]
%67 = icmp ugt i64 %66, %0
%68 = add i64 %66, 1
%69 = select i1 %67, i64 %17, i64 %68
%70 = icmp ult i64 %66, %0
%71 = add i64 %66, -1
%72 = select i1 %70, i64 %18, i64 %71
%73 = icmp sgt i64 %72, %69
br i1 %73, label %16, label %74
74: ; preds = %65, %4
%75 = getelementptr inbounds double, double* %9, i64 %0
%76 = load double, double* %75
%77 = tail call i32 @free(double* %9)
ret double %76
}