void cp_partition(double *a, double *b, double *c, int *indarr, int ibeg,
                  int iend, double val, int *midind) {
  double ta, tb, tc;
  int lower, upper, tind;
  if (ibeg < iend) {
    ta = a[ibeg - 1];
    tb = b[ibeg - 1];
    tc = c[ibeg - 1];
    tind = indarr[ibeg - 1];
    a[ibeg - 1] = val;
    upper = ibeg;
    lower = iend;
    while (upper != lower) {
      while ((upper < lower) && (val < a[lower - 1])) {
        lower--;
      }
      if (upper != lower) {
        a[upper - 1] = a[lower - 1];
        b[upper - 1] = b[lower - 1];
        c[upper - 1] = c[lower - 1];
        indarr[upper - 1] = indarr[lower - 1];
      }
      while ((upper < lower) && (val >= a[upper - 1])) {
        upper++;
      }
      if (upper != lower) {
        a[lower - 1] = a[upper - 1];
        b[lower - 1] = b[upper - 1];
        c[lower - 1] = c[upper - 1];
        indarr[lower - 1] = indarr[upper - 1];
      }
    }
    *midind = upper;
    if (ta > val)
      *midind = upper - 1;
    a[upper - 1] = ta;
    b[upper - 1] = tb;
    c[upper - 1] = tc;
    indarr[upper - 1] = tind;
  } else if (ibeg == iend) {
    if (a[ibeg - 1] < val)
      *midind = ibeg;
    else
      *midind = ibeg - 1;
  } else {
    *midind = ibeg - 1;
  }
  return;
}


x86 assembly (clang, -O0):
<cp_partition>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
movsd  %xmm0,-0x30(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    1415 <cp_partition+0x315>
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x54(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x4c(%rbp),%eax
je     1393 <cp_partition+0x293>
jmp    11bd <cp_partition+0xbd>
mov    -0x50(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4c(%rbp),%ecx
mov    %al,-0x55(%rbp)
jge    11ef <cp_partition+0xef>
movsd  -0x30(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x55(%rbp)
mov    -0x55(%rbp),%al
test   $0x1,%al
jne    11ff <cp_partition+0xff>
jmp    120d <cp_partition+0x10d>
mov    -0x4c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4c(%rbp)
jmp    11bd <cp_partition+0xbd>
mov    -0x50(%rbp),%eax
cmp    -0x4c(%rbp),%eax
je     12a5 <cp_partition+0x1a5>
mov    -0x8(%rbp),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x20(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
jmp    12aa <cp_partition+0x1aa>
mov    -0x50(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4c(%rbp),%ecx
mov    %al,-0x56(%rbp)
jge    12d8 <cp_partition+0x1d8>
movsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
ucomisd (%rax,%rcx,8),%xmm0
setae  %al
mov    %al,-0x56(%rbp)
mov    -0x56(%rbp),%al
test   $0x1,%al
jne    12e8 <cp_partition+0x1e8>
jmp    12f6 <cp_partition+0x1f6>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    12aa <cp_partition+0x1aa>
mov    -0x50(%rbp),%eax
cmp    -0x4c(%rbp),%eax
je     138e <cp_partition+0x28e>
mov    -0x8(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x20(%rbp),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
jmp    11ac <cp_partition+0xac>
mov    -0x50(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x38(%rbp),%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    13b8 <cp_partition+0x2b8>
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x54(%rbp),%edx
mov    -0x20(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1472 <cp_partition+0x372>
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jne    1461 <cp_partition+0x361>
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1450 <cp_partition+0x350>
mov    -0x24(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    145c <cp_partition+0x35c>
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    146d <cp_partition+0x36d>
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1472 <cp_partition+0x372>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cp_partition>:
push   %rbp
push   %r15
push   %r14
push   %rbx
mov    0x28(%rsp),%r10
cmp    %r9d,%r8d
jge    1220 <cp_partition+0x120>
movslq %r8d,%rax
movsd  -0x8(%rdi,%rax,8),%xmm1
movsd  -0x8(%rsi,%rax,8),%xmm2
movsd  -0x8(%rdx,%rax,8),%xmm3
mov    -0x4(%rcx,%rax,4),%r11d
movsd  %xmm0,-0x8(%rdi,%rax,8)
lea    -0x8(%rdi),%r14
movslq %r9d,%rbx
movslq %r8d,%rax
cmp    %eax,%ebx
mov    %r8d,%ebp
cmovl  %ebx,%ebp
lea    0x1(%rbx),%r9d
nopw   0x0(%rax,%rax,1)
cmp    %rax,%rbx
jle    1170 <cp_partition+0x70>
movsd  -0x8(%rdi,%rbx,8),%xmm4
add    $0xffffffffffffffff,%rbx
add    $0xffffffff,%r9d
ucomisd %xmm0,%xmm4
ja     1150 <cp_partition+0x50>
jmp    1173 <cp_partition+0x73>
nopl   0x0(%rax,%rax,1)
mov    %ebp,%r9d
movslq %r9d,%r15
cmp    %r9d,%r8d
je     11ab <cp_partition+0xab>
movsd  -0x8(%rdi,%r15,8),%xmm4
movsd  %xmm4,-0x8(%rdi,%rax,8)
movsd  -0x8(%rsi,%r15,8),%xmm4
movsd  %xmm4,-0x8(%rsi,%rax,8)
movsd  -0x8(%rdx,%r15,8),%xmm4
movsd  %xmm4,-0x8(%rdx,%rax,8)
mov    -0x4(%rcx,%r15,4),%ebx
mov    %ebx,-0x4(%rcx,%rax,4)
cmp    %r9d,%r8d
jge    11e3 <cp_partition+0xe3>
lea    (%r14,%rax,8),%rbp
mov    %r15,%rbx
sub    %rax,%rbx
xor    %eax,%eax
nopl   0x0(%rax)
ucomisd 0x0(%rbp,%rax,8),%xmm0
jb     11e0 <cp_partition+0xe0>
add    $0x1,%rax
cmp    %rax,%rbx
jne    11c0 <cp_partition+0xc0>
jmp    1238 <cp_partition+0x138>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    %eax,%r8d
cmp    %r9d,%r8d
je     1238 <cp_partition+0x138>
movslq %r8d,%rax
movsd  -0x8(%rdi,%rax,8),%xmm4
movsd  %xmm4,-0x8(%rdi,%r15,8)
movsd  -0x8(%rsi,%rax,8),%xmm4
movsd  %xmm4,-0x8(%rsi,%r15,8)
movsd  -0x8(%rdx,%rax,8),%xmm4
movsd  %xmm4,-0x8(%rdx,%r15,8)
mov    -0x4(%rcx,%rax,4),%eax
mov    %eax,-0x4(%rcx,%r15,4)
jmp    1138 <cp_partition+0x38>
lea    -0x1(%r8),%eax
cmp    %r9d,%r8d
jne    1263 <cp_partition+0x163>
movslq %eax,%rcx
ucomisd (%rdi,%rcx,8),%xmm0
jbe    1263 <cp_partition+0x163>
mov    %r8d,(%r10)
jmp    1266 <cp_partition+0x166>
lea    -0x1(%r9),%eax
ucomisd %xmm0,%xmm1
cmovbe %r9d,%eax
mov    %eax,(%r10)
movsd  %xmm1,-0x8(%rdi,%r15,8)
movsd  %xmm2,-0x8(%rsi,%r15,8)
movsd  %xmm3,-0x8(%rdx,%r15,8)
mov    %r11d,-0x4(%rcx,%r15,4)
jmp    1266 <cp_partition+0x166>
mov    %eax,(%r10)
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @cp_partition(double* %0, double* %1, double* %2, i32* %3, i32 %4, i32 %5, double %6, i32* %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
%15 = alloca double
%16 = alloca i32*
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
store double* %0, double** %9
store double* %1, double** %10
store double* %2, double** %11
store i32* %3, i32** %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store double %6, double* %15
store i32* %7, i32** %16
%23 = load i32, i32* %13
%24 = load i32, i32* %14
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %235
26: ; preds = %8
%27 = load double*, double** %9
%28 = load i32, i32* %13
%29 = sub nsw i32 %28, 1
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double, double* %27, i64 %30
%32 = load double, double* %31
store double %32, double* %17
%33 = load double*, double** %10
%34 = load i32, i32* %13
%35 = sub nsw i32 %34, 1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %33, i64 %36
%38 = load double, double* %37
store double %38, double* %18
%39 = load double*, double** %11
%40 = load i32, i32* %13
%41 = sub nsw i32 %40, 1
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %39, i64 %42
%44 = load double, double* %43
store double %44, double* %19
%45 = load i32*, i32** %12
%46 = load i32, i32* %13
%47 = sub nsw i32 %46, 1
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32, i32* %45, i64 %48
%50 = load i32, i32* %49
store i32 %50, i32* %22
%51 = load double, double* %15
%52 = load double*, double** %9
%53 = load i32, i32* %13
%54 = sub nsw i32 %53, 1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds double, double* %52, i64 %55
store double %51, double* %56
%57 = load i32, i32* %13
store i32 %57, i32* %21
%58 = load i32, i32* %14
store i32 %58, i32* %20
br label %59
59: ; preds = %199, %26
%60 = load i32, i32* %21
%61 = load i32, i32* %20
%62 = icmp ne i32 %60, %61
br i1 %62, label %63, label %200
63: ; preds = %59
br label %64
64: ; preds = %79, %63
%65 = load i32, i32* %21
%66 = load i32, i32* %20
%67 = icmp slt i32 %65, %66
br i1 %67, label %68, label %77
68: ; preds = %64
%69 = load double, double* %15
%70 = load double*, double** %9
%71 = load i32, i32* %20
%72 = sub nsw i32 %71, 1
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds double, double* %70, i64 %73
%75 = load double, double* %74
%76 = fcmp olt double %69, %75
br label %77
77: ; preds = %68, %64
%78 = phi i1 [ false, %64 ], [ %76, %68 ]
br i1 %78, label %79, label %82
79: ; preds = %77
%80 = load i32, i32* %20
%81 = add nsw i32 %80, -1
store i32 %81, i32* %20
br label %64
82: ; preds = %77
%83 = load i32, i32* %21
%84 = load i32, i32* %20
%85 = icmp ne i32 %83, %84
br i1 %85, label %86, label %131
86: ; preds = %82
%87 = load double*, double** %9
%88 = load i32, i32* %20
%89 = sub nsw i32 %88, 1
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds double, double* %87, i64 %90
%92 = load double, double* %91
%93 = load double*, double** %9
%94 = load i32, i32* %21
%95 = sub nsw i32 %94, 1
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %93, i64 %96
store double %92, double* %97
%98 = load double*, double** %10
%99 = load i32, i32* %20
%100 = sub nsw i32 %99, 1
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds double, double* %98, i64 %101
%103 = load double, double* %102
%104 = load double*, double** %10
%105 = load i32, i32* %21
%106 = sub nsw i32 %105, 1
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds double, double* %104, i64 %107
store double %103, double* %108
%109 = load double*, double** %11
%110 = load i32, i32* %20
%111 = sub nsw i32 %110, 1
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds double, double* %109, i64 %112
%114 = load double, double* %113
%115 = load double*, double** %11
%116 = load i32, i32* %21
%117 = sub nsw i32 %116, 1
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds double, double* %115, i64 %118
store double %114, double* %119
%120 = load i32*, i32** %12
%121 = load i32, i32* %20
%122 = sub nsw i32 %121, 1
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds i32, i32* %120, i64 %123
%125 = load i32, i32* %124
%126 = load i32*, i32** %12
%127 = load i32, i32* %21
%128 = sub nsw i32 %127, 1
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds i32, i32* %126, i64 %129
store i32 %125, i32* %130
br label %131
131: ; preds = %86, %82
br label %132
132: ; preds = %147, %131
%133 = load i32, i32* %21
%134 = load i32, i32* %20
%135 = icmp slt i32 %133, %134
br i1 %135, label %136, label %145
136: ; preds = %132
%137 = load double, double* %15
%138 = load double*, double** %9
%139 = load i32, i32* %21
%140 = sub nsw i32 %139, 1
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds double, double* %138, i64 %141
%143 = load double, double* %142
%144 = fcmp oge double %137, %143
br label %145
145: ; preds = %136, %132
%146 = phi i1 [ false, %132 ], [ %144, %136 ]
br i1 %146, label %147, label %150
147: ; preds = %145
%148 = load i32, i32* %21
%149 = add nsw i32 %148, 1
store i32 %149, i32* %21
br label %132
150: ; preds = %145
%151 = load i32, i32* %21
%152 = load i32, i32* %20
%153 = icmp ne i32 %151, %152
br i1 %153, label %154, label %199
154: ; preds = %150
%155 = load double*, double** %9
%156 = load i32, i32* %21
%157 = sub nsw i32 %156, 1
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds double, double* %155, i64 %158
%160 = load double, double* %159
%161 = load double*, double** %9
%162 = load i32, i32* %20
%163 = sub nsw i32 %162, 1
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds double, double* %161, i64 %164
store double %160, double* %165
%166 = load double*, double** %10
%167 = load i32, i32* %21
%168 = sub nsw i32 %167, 1
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds double, double* %166, i64 %169
%171 = load double, double* %170
%172 = load double*, double** %10
%173 = load i32, i32* %20
%174 = sub nsw i32 %173, 1
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds double, double* %172, i64 %175
store double %171, double* %176
%177 = load double*, double** %11
%178 = load i32, i32* %21
%179 = sub nsw i32 %178, 1
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds double, double* %177, i64 %180
%182 = load double, double* %181
%183 = load double*, double** %11
%184 = load i32, i32* %20
%185 = sub nsw i32 %184, 1
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds double, double* %183, i64 %186
store double %182, double* %187
%188 = load i32*, i32** %12
%189 = load i32, i32* %21
%190 = sub nsw i32 %189, 1
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds i32, i32* %188, i64 %191
%193 = load i32, i32* %192
%194 = load i32*, i32** %12
%195 = load i32, i32* %20
%196 = sub nsw i32 %195, 1
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds i32, i32* %194, i64 %197
store i32 %193, i32* %198
br label %199
199: ; preds = %154, %150
br label %59
200: ; preds = %59
%201 = load i32, i32* %21
%202 = load i32*, i32** %16
store i32 %201, i32* %202
%203 = load double, double* %17
%204 = load double, double* %15
%205 = fcmp ogt double %203, %204
br i1 %205, label %206, label %210
206: ; preds = %200
%207 = load i32, i32* %21
%208 = sub nsw i32 %207, 1
%209 = load i32*, i32** %16
store i32 %208, i32* %209
br label %210
210: ; preds = %206, %200
%211 = load double, double* %17
%212 = load double*, double** %9
%213 = load i32, i32* %21
%214 = sub nsw i32 %213, 1
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds double, double* %212, i64 %215
store double %211, double* %216
%217 = load double, double* %18
%218 = load double*, double** %10
%219 = load i32, i32* %21
%220 = sub nsw i32 %219, 1
%221 = sext i32 %220 to i64
%222 = getelementptr inbounds double, double* %218, i64 %221
store double %217, double* %222
%223 = load double, double* %19
%224 = load double*, double** %11
%225 = load i32, i32* %21
%226 = sub nsw i32 %225, 1
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds double, double* %224, i64 %227
store double %223, double* %228
%229 = load i32, i32* %22
%230 = load i32*, i32** %12
%231 = load i32, i32* %21
%232 = sub nsw i32 %231, 1
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds i32, i32* %230, i64 %233
store i32 %229, i32* %234
br label %261
235: ; preds = %8
%236 = load i32, i32* %13
%237 = load i32, i32* %14
%238 = icmp eq i32 %236, %237
br i1 %238, label %239, label %256
239: ; preds = %235
%240 = load double*, double** %9
%241 = load i32, i32* %13
%242 = sub nsw i32 %241, 1
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds double, double* %240, i64 %243
%245 = load double, double* %244
%246 = load double, double* %15
%247 = fcmp olt double %245, %246
br i1 %247, label %248, label %251
248: ; preds = %239
%249 = load i32, i32* %13
%250 = load i32*, i32** %16
store i32 %249, i32* %250
br label %255
251: ; preds = %239
%252 = load i32, i32* %13
%253 = sub nsw i32 %252, 1
%254 = load i32*, i32** %16
store i32 %253, i32* %254
br label %255
255: ; preds = %251, %248
br label %260
256: ; preds = %235
%257 = load i32, i32* %13
%258 = sub nsw i32 %257, 1
%259 = load i32*, i32** %16
store i32 %258, i32* %259
br label %260
260: ; preds = %256, %255
br label %261
261: ; preds = %260, %210
ret void
}

LLVM IR (-O2):
define void @cp_partition(double* nocapture %0, double* nocapture %1, double* nocapture %2, i32* nocapture %3, i32 %4, i32 %5, double %6, i32* nocapture writeonly %7) {
%9 = icmp slt i32 %4, %5
br i1 %9, label %10, label %101
10: ; preds = %8
%11 = add nsw i32 %4, -1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double, double* %0, i64 %12
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %1, i64 %12
%16 = load double, double* %15
%17 = getelementptr inbounds double, double* %2, i64 %12
%18 = load double, double* %17
%19 = getelementptr inbounds i32, i32* %3, i64 %12
%20 = load i32, i32* %19
store double %6, double* %13
br label %21
21: ; preds = %75, %10
%22 = phi i32 [ %5, %10 ], [ %38, %75 ]
%23 = phi i32 [ %4, %10 ], [ %73, %75 ]
%24 = sext i32 %22 to i64
%25 = sext i32 %23 to i64
%26 = call i32 @llvm.smin.i32(i32 %22, i32 %23)
br label %27
27: ; preds = %21, %30
%28 = phi i64 [ %24, %21 ], [ %31, %30 ]
%29 = icmp sgt i64 %28, %25
br i1 %29, label %30, label %37
30: ; preds = %27
%31 = add nsw i64 %28, -1
%32 = getelementptr inbounds double, double* %0, i64 %31
%33 = load double, double* %32
%34 = fcmp ogt double %33, %6
br i1 %34, label %27, label %35
35: ; preds = %30
%36 = trunc i64 %28 to i32
br label %37
37: ; preds = %27, %35
%38 = phi i32 [ %36, %35 ], [ %26, %27 ]
%39 = icmp eq i32 %23, %38
br i1 %39, label %57, label %40
40: ; preds = %37
%41 = add nsw i32 %38, -1
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %0, i64 %42
%44 = load double, double* %43
%45 = add nsw i32 %23, -1
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %0, i64 %46
store double %44, double* %47
%48 = getelementptr inbounds double, double* %1, i64 %42
%49 = load double, double* %48
%50 = getelementptr inbounds double, double* %1, i64 %46
store double %49, double* %50
%51 = getelementptr inbounds double, double* %2, i64 %42
%52 = load double, double* %51
%53 = getelementptr inbounds double, double* %2, i64 %46
store double %52, double* %53
%54 = getelementptr inbounds i32, i32* %3, i64 %42
%55 = load i32, i32* %54
%56 = getelementptr inbounds i32, i32* %3, i64 %46
store i32 %55, i32* %56
br label %57
57: ; preds = %40, %37
%58 = icmp slt i32 %23, %38
br i1 %58, label %59, label %72
59: ; preds = %57
%60 = sext i32 %38 to i64
br label %61
61: ; preds = %59, %67
%62 = phi i64 [ %25, %59 ], [ %68, %67 ]
%63 = add nsw i64 %62, -1
%64 = getelementptr inbounds double, double* %0, i64 %63
%65 = load double, double* %64
%66 = fcmp ugt double %65, %6
br i1 %66, label %70, label %67
67: ; preds = %61
%68 = add nsw i64 %62, 1
%69 = icmp eq i64 %68, %60
br i1 %69, label %92, label %61
70: ; preds = %61
%71 = trunc i64 %62 to i32
br label %72
72: ; preds = %70, %57
%73 = phi i32 [ %23, %57 ], [ %71, %70 ]
%74 = icmp eq i32 %73, %38
br i1 %74, label %92, label %75
75: ; preds = %72
%76 = add nsw i32 %73, -1
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %0, i64 %77
%79 = load double, double* %78
%80 = add nsw i32 %38, -1
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds double, double* %0, i64 %81
store double %79, double* %82
%83 = getelementptr inbounds double, double* %1, i64 %77
%84 = load double, double* %83
%85 = getelementptr inbounds double, double* %1, i64 %81
store double %84, double* %85
%86 = getelementptr inbounds double, double* %2, i64 %77
%87 = load double, double* %86
%88 = getelementptr inbounds double, double* %2, i64 %81
store double %87, double* %88
%89 = getelementptr inbounds i32, i32* %3, i64 %77
%90 = load i32, i32* %89
%91 = getelementptr inbounds i32, i32* %3, i64 %81
store i32 %90, i32* %91
br label %21
92: ; preds = %72, %67
%93 = fcmp ogt double %14, %6
%94 = add nsw i32 %38, -1
%95 = select i1 %93, i32 %94, i32 %38
store i32 %95, i32* %7
%96 = sext i32 %94 to i64
%97 = getelementptr inbounds double, double* %0, i64 %96
store double %14, double* %97
%98 = getelementptr inbounds double, double* %1, i64 %96
store double %16, double* %98
%99 = getelementptr inbounds double, double* %2, i64 %96
store double %18, double* %99
%100 = getelementptr inbounds i32, i32* %3, i64 %96
store i32 %20, i32* %100
br label %112
101: ; preds = %8
%102 = icmp eq i32 %4, %5
%103 = add nsw i32 %4, -1
br i1 %102, label %104, label %111
104: ; preds = %101
%105 = sext i32 %103 to i64
%106 = getelementptr inbounds double, double* %0, i64 %105
%107 = load double, double* %106
%108 = fcmp olt double %107, %6
br i1 %108, label %109, label %110
109: ; preds = %104
store i32 %4, i32* %7
br label %112
110: ; preds = %104
store i32 %103, i32* %7
br label %112
111: ; preds = %101
store i32 %103, i32* %7
br label %112
112: ; preds = %111, %110, %109, %92
ret void
}