#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 */
double DBL_EPSILON;
int /*<<< orphan*/ heap_build_2(int, double *, double *);
int heap_del_max_2(int, double *, double *);
int /*<<< orphan*/ memcpy(void *, void *, int);
double projectD(double xPtr[], double bPtr[], double dPtr[], double dOrg[],
                double tau, int n) {
  int i, j;
  double csdb, csd2, b, d, bd, alpha = 0, soft = 0;
  if (tau < DBL_EPSILON) {
    for (i = 0; i < n; i++)
      xPtr[i] = 0;
    return 0;
  }
  for (csdb = 0, i = 0; i < n; i++) {
    d = dPtr[i];
    b = xPtr[i];
    csdb += (d * b);
    xPtr[i] = b / d;
  }
  if (csdb <= tau) {
    memcpy((void *)xPtr, (void *)bPtr, n * sizeof(double));
    return 0;
  }
  heap_build_2(n, xPtr, dPtr);
  csdb = -tau;
  csd2 = 0;
  for (i = n, j = 0; j < n; soft = alpha) {
    bd = xPtr[0];
    j++;
    d = dPtr[0];
    d *= d;
    csd2 += d;
    csdb += bd * d;
    i = heap_del_max_2(i, xPtr, dPtr);
    alpha = csdb / csd2;
    if (alpha >= bd)
      break;
  }
  for (i = 0; i < n; i++) {
    b = bPtr[i];
    alpha = dOrg[i] * soft;
    if (b <= alpha)
      xPtr[i] = 0;
    else
      xPtr[i] = b - alpha;
  }
  return soft;
}


x86 assembly (clang, -O0):
<projectD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movsd  %xmm0,-0x30(%rbp)
mov    %r8d,-0x34(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x30(%rbp),%xmm1
mov    0x2e78(%rip),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    11bc <projectD+0x8c>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    11af <projectD+0x7f>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1185 <projectD+0x55>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1407 <projectD+0x2d7>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    123c <projectD+0x10c>
mov    -0x20(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11cb <projectD+0x9b>
movsd  -0x48(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1274 <projectD+0x144>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0x34(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1050 <memcpy@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1407 <projectD+0x2d7>
mov    -0x34(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <heap_build_2@plt>
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    136e <projectD+0x23e>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x38(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <heap_del_max_2@plt>
mov    %eax,-0x38(%rbp)
movsd  -0x48(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
ucomisd -0x68(%rbp),%xmm0
jb     135a <projectD+0x22a>
jmp    136e <projectD+0x23e>
jmp    135f <projectD+0x22f>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    12ba <projectD+0x18a>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    13fd <projectD+0x2cd>
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     13d3 <projectD+0x2a3>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    13ea <projectD+0x2ba>
movsd  -0x58(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    13ef <projectD+0x2bf>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1375 <projectD+0x245>
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<projectD>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r8d,%r13d
mov    %rdi,%rbx
mov    0x2e8d(%rip),%rax
movsd  (%rax),%xmm1
ucomisd %xmm0,%xmm1
jbe    1188 <projectD+0x48>
xorpd  %xmm0,%xmm0
test   %r13d,%r13d
jle    1336 <projectD+0x1f6>
mov    %r13d,%edx
shl    $0x3,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
jmp    1332 <projectD+0x1f2>
mov    %rdx,%rbp
mov    %rsi,%r14
test   %r13d,%r13d
jle    11aa <projectD+0x6a>
mov    %rcx,%r15
mov    %r13d,%r12d
cmp    $0x1,%r13d
jne    11cb <projectD+0x8b>
xorpd  %xmm5,%xmm5
xor    %eax,%eax
jmp    122b <projectD+0xeb>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    1320 <projectD+0x1e0>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1030 <heap_build_2@plt>
jmp    1332 <projectD+0x1f2>
mov    %r12d,%ecx
and    $0xfffffffe,%ecx
xorpd  %xmm5,%xmm5
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movsd  0x0(%rbp,%rax,8),%xmm1
movsd  (%rbx,%rax,8),%xmm2
movsd  0x8(%rbx,%rax,8),%xmm3
movapd %xmm1,%xmm4
mulsd  %xmm2,%xmm4
addsd  %xmm5,%xmm4
divsd  %xmm1,%xmm2
movsd  %xmm2,(%rbx,%rax,8)
movsd  0x8(%rbp,%rax,8),%xmm1
movapd %xmm1,%xmm5
mulsd  %xmm3,%xmm5
addsd  %xmm4,%xmm5
divsd  %xmm1,%xmm3
movsd  %xmm3,0x8(%rbx,%rax,8)
add    $0x2,%rax
cmp    %rax,%rcx
jne    11e0 <projectD+0xa0>
test   $0x1,%r12b
je     1251 <projectD+0x111>
movsd  0x0(%rbp,%rax,8),%xmm1
movsd  (%rbx,%rax,8),%xmm2
movapd %xmm1,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm3,%xmm5
divsd  %xmm1,%xmm2
movsd  %xmm2,(%rbx,%rax,8)
ucomisd %xmm5,%xmm0
jae    1320 <projectD+0x1e0>
movapd %xmm0,0x10(%rsp)
mov    %r13d,%edi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1030 <heap_build_2@plt>
test   %r13d,%r13d
jle    1332 <projectD+0x1f2>
mov    %r12,0x8(%rsp)
movapd 0x10(%rsp),%xmm1
xorpd  0xd75(%rip),%xmm1
xorpd  %xmm2,%xmm2
mov    %r13d,%r12d
xorpd  %xmm3,%xmm3
mov    %r13d,%eax
nopl   0x0(%rax)
movapd %xmm2,0x30(%rsp)
movsd  (%rbx),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x0(%rbp),%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm2,%xmm3
movsd  %xmm3,0x28(%rsp)
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm2,0x10(%rsp)
mov    %eax,%edi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1040 <heap_del_max_2@plt>
movsd  0x28(%rsp),%xmm3
movapd 0x10(%rsp),%xmm1
movaps 0x30(%rsp),%xmm0
movapd %xmm1,%xmm2
divsd  %xmm3,%xmm2
ucomisd 0x20(%rsp),%xmm2
jae    1309 <projectD+0x1c9>
movapd %xmm2,%xmm0
add    $0xffffffff,%r12d
jne    12a0 <projectD+0x160>
test   %r13d,%r13d
jle    1336 <projectD+0x1f6>
cmp    $0x4,%r13d
jae    1345 <projectD+0x205>
xor    %eax,%eax
mov    0x8(%rsp),%rbp
jmp    1401 <projectD+0x2c1>
shl    $0x3,%r13d
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r13d,%edx
call   1060 <memcpy@plt>
xorpd  %xmm0,%xmm0
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x8(%rsp),%rbp
lea    (%rbx,%rbp,8),%rax
lea    (%r14,%rbp,8),%rcx
cmp    %rbx,%rcx
seta   %dil
lea    (%r15,%rbp,8),%rcx
cmp    %r14,%rax
seta   %dl
cmp    %rbx,%rcx
seta   %cl
cmp    %r15,%rax
seta   %sil
xor    %eax,%eax
test   %dl,%dil
jne    1401 <projectD+0x2c1>
and    %sil,%cl
jne    1401 <projectD+0x2c1>
mov    %ebp,%eax
and    $0xfffffffc,%eax
movapd %xmm0,%xmm7
unpcklpd %xmm0,%xmm7
lea    0x0(,%rbp,8),%rcx
and    $0xffffffffffffffe0,%rcx
xor    %edx,%edx
nop
movupd (%r14,%rdx,1),%xmm1
movupd 0x10(%r14,%rdx,1),%xmm2
movupd (%r15,%rdx,1),%xmm3
movupd 0x10(%r15,%rdx,1),%xmm4
mulpd  %xmm7,%xmm3
mulpd  %xmm7,%xmm4
movapd %xmm1,%xmm5
cmpnlepd %xmm3,%xmm5
movapd %xmm2,%xmm6
cmpnlepd %xmm4,%xmm6
subpd  %xmm3,%xmm1
andpd  %xmm5,%xmm1
subpd  %xmm4,%xmm2
andpd  %xmm6,%xmm2
movupd %xmm1,(%rbx,%rdx,1)
movupd %xmm2,0x10(%rbx,%rdx,1)
add    $0x20,%rdx
cmp    %rdx,%rcx
jne    13a0 <projectD+0x260>
cmp    %rbp,%rax
je     1336 <projectD+0x1f6>
mov    %rax,%rcx
not    %rcx
test   $0x1,%bpl
je     1437 <projectD+0x2f7>
movsd  (%r14,%rax,8),%xmm3
movsd  (%r15,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm3,%xmm2
subsd  %xmm1,%xmm2
cmpnlesd %xmm1,%xmm3
andpd  %xmm2,%xmm3
movlpd %xmm3,(%rbx,%rax,8)
or     $0x1,%rax
add    %rbp,%rcx
je     1336 <projectD+0x1f6>
movsd  (%r14,%rax,8),%xmm3
movsd  (%r15,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm3,%xmm2
subsd  %xmm1,%xmm2
cmpnlesd %xmm1,%xmm3
andpd  %xmm2,%xmm3
movlpd %xmm3,(%rbx,%rax,8)
movsd  0x8(%r14,%rax,8),%xmm3
movsd  0x8(%r15,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm3,%xmm2
subsd  %xmm1,%xmm2
cmpnlesd %xmm1,%xmm3
andpd  %xmm2,%xmm3
movlpd %xmm3,0x8(%rbx,%rax,8)
add    $0x2,%rax
cmp    %rax,%rbp
jne    1440 <projectD+0x300>
jmp    1336 <projectD+0x1f6>

LLVM IR (-O0):
@DBL_EPSILON = global double 0.000000e+00
define double @projectD(double* %0, double* %1, double* %2, double* %3, double %4, i32 %5) {
%7 = alloca double
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
store double* %0, double** %8
store double* %1, double** %9
store double* %2, double** %10
store double* %3, double** %11
store double %4, double* %12
store i32 %5, i32* %13
store double 0.000000e+00, double* %21
store double 0.000000e+00, double* %22
%23 = load double, double* %12
%24 = load double, double* @DBL_EPSILON
%25 = fcmp olt double %23, %24
br i1 %25, label %26, label %40
26: ; preds = %6
store i32 0, i32* %14
br label %27
27: ; preds = %36, %26
%28 = load i32, i32* %14
%29 = load i32, i32* %13
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %39
31: ; preds = %27
%32 = load double*, double** %8
%33 = load i32, i32* %14
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %32, i64 %34
store double 0.000000e+00, double* %35
br label %36
36: ; preds = %31
%37 = load i32, i32* %14
%38 = add nsw i32 %37, 1
store i32 %38, i32* %14
br label %27
39: ; preds = %27
store double 0.000000e+00, double* %7
br label %169
40: ; preds = %6
store double 0.000000e+00, double* %16
store i32 0, i32* %14
br label %41
41: ; preds = %67, %40
%42 = load i32, i32* %14
%43 = load i32, i32* %13
%44 = icmp slt i32 %42, %43
br i1 %44, label %45, label %70
45: ; preds = %41
%46 = load double*, double** %10
%47 = load i32, i32* %14
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double, double* %46, i64 %48
%50 = load double, double* %49
store double %50, double* %19
%51 = load double*, double** %8
%52 = load i32, i32* %14
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds double, double* %51, i64 %53
%55 = load double, double* %54
store double %55, double* %18
%56 = load double, double* %19
%57 = load double, double* %18
%58 = load double, double* %16
%59 = call double @llvm.fmuladd.f64(double %56, double %57, double %58)
store double %59, double* %16
%60 = load double, double* %18
%61 = load double, double* %19
%62 = fdiv double %60, %61
%63 = load double*, double** %8
%64 = load i32, i32* %14
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds double, double* %63, i64 %65
store double %62, double* %66
br label %67
67: ; preds = %45
%68 = load i32, i32* %14
%69 = add nsw i32 %68, 1
store i32 %69, i32* %14
br label %41
70: ; preds = %41
%71 = load double, double* %16
%72 = load double, double* %12
%73 = fcmp ole double %71, %72
br i1 %73, label %74, label %84
74: ; preds = %70
%75 = load double*, double** %8
%76 = bitcast double* %75 to i8*
%77 = load double*, double** %9
%78 = bitcast double* %77 to i8*
%79 = load i32, i32* %13
%80 = sext i32 %79 to i64
%81 = mul i64 %80, 8
%82 = trunc i64 %81 to i32
%83 = call i32 @memcpy(i8* %76, i8* %78, i32 %82)
store double 0.000000e+00, double* %7
br label %169
84: ; preds = %70
%85 = load i32, i32* %13
%86 = load double*, double** %8
%87 = load double*, double** %10
%88 = call i32 @heap_build_2(i32 %85, double* %86, double* %87)
%89 = load double, double* %12
%90 = fneg double %89
store double %90, double* %16
store double 0.000000e+00, double* %17
%91 = load i32, i32* %13
store i32 %91, i32* %14
store i32 0, i32* %15
br label %92
92: ; preds = %127, %84
%93 = load i32, i32* %15
%94 = load i32, i32* %13
%95 = icmp slt i32 %93, %94
br i1 %95, label %96, label %129
96: ; preds = %92
%97 = load double*, double** %8
%98 = getelementptr inbounds double, double* %97, i64 0
%99 = load double, double* %98
store double %99, double* %20
%100 = load i32, i32* %15
%101 = add nsw i32 %100, 1
store i32 %101, i32* %15
%102 = load double*, double** %10
%103 = getelementptr inbounds double, double* %102, i64 0
%104 = load double, double* %103
store double %104, double* %19
%105 = load double, double* %19
%106 = load double, double* %19
%107 = fmul double %106, %105
store double %107, double* %19
%108 = load double, double* %19
%109 = load double, double* %17
%110 = fadd double %109, %108
store double %110, double* %17
%111 = load double, double* %20
%112 = load double, double* %19
%113 = load double, double* %16
%114 = call double @llvm.fmuladd.f64(double %111, double %112, double %113)
store double %114, double* %16
%115 = load i32, i32* %14
%116 = load double*, double** %8
%117 = load double*, double** %10
%118 = call i32 @heap_del_max_2(i32 %115, double* %116, double* %117)
store i32 %118, i32* %14
%119 = load double, double* %16
%120 = load double, double* %17
%121 = fdiv double %119, %120
store double %121, double* %21
%122 = load double, double* %21
%123 = load double, double* %20
%124 = fcmp oge double %122, %123
br i1 %124, label %125, label %126
125: ; preds = %96
br label %129
126: ; preds = %96
br label %127
127: ; preds = %126
%128 = load double, double* %21
store double %128, double* %22
br label %92
129: ; preds = %125, %92
store i32 0, i32* %14
br label %130
130: ; preds = %164, %129
%131 = load i32, i32* %14
%132 = load i32, i32* %13
%133 = icmp slt i32 %131, %132
br i1 %133, label %134, label %167
134: ; preds = %130
%135 = load double*, double** %9
%136 = load i32, i32* %14
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds double, double* %135, i64 %137
%139 = load double, double* %138
store double %139, double* %18
%140 = load double*, double** %11
%141 = load i32, i32* %14
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds double, double* %140, i64 %142
%144 = load double, double* %143
%145 = load double, double* %22
%146 = fmul double %144, %145
store double %146, double* %21
%147 = load double, double* %18
%148 = load double, double* %21
%149 = fcmp ole double %147, %148
br i1 %149, label %150, label %155
150: ; preds = %134
%151 = load double*, double** %8
%152 = load i32, i32* %14
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds double, double* %151, i64 %153
store double 0.000000e+00, double* %154
br label %163
155: ; preds = %134
%156 = load double, double* %18
%157 = load double, double* %21
%158 = fsub double %156, %157
%159 = load double*, double** %8
%160 = load i32, i32* %14
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds double, double* %159, i64 %161
store double %158, double* %162
br label %163
163: ; preds = %155, %150
br label %164
164: ; preds = %163
%165 = load i32, i32* %14
%166 = add nsw i32 %165, 1
store i32 %166, i32* %14
br label %130
167: ; preds = %130
%168 = load double, double* %22
store double %168, double* %7
br label %169
169: ; preds = %167, %74, %39
%170 = load double, double* %7
ret double %170
}

LLVM IR (-O2):
@DBL_EPSILON = global double 0.000000e+00
define double @projectD(double* %0, double* %1, double* %2, double* nocapture %3, double %4, i32 %5) {
%7 = bitcast double* %0 to i8*
%8 = load double, double* @DBL_EPSILON
%9 = fcmp ogt double %8, %4
%10 = icmp sgt i32 %5, 0
br i1 %9, label %18, label %11
11: ; preds = %6
br i1 %10, label %12, label %57
12: ; preds = %11
%13 = zext i32 %5 to i64
%14 = and i64 %13, 1
%15 = icmp eq i32 %5, 1
br i1 %15, label %42, label %16
16: ; preds = %12
%17 = and i64 %13, 4294967294
br label %22
18: ; preds = %6
br i1 %10, label %19, label %181
19: ; preds = %18
%20 = zext i32 %5 to i64
%21 = shl nuw nsw i64 %20, 3
br label %181
22: ; preds = %22, %16
%23 = phi i64 [ 0, %16 ], [ %39, %22 ]
%24 = phi double [ 0.000000e+00, %16 ], [ %37, %22 ]
%25 = phi i64 [ 0, %16 ], [ %40, %22 ]
%26 = getelementptr inbounds double, double* %2, i64 %23
%27 = load double, double* %26
%28 = getelementptr inbounds double, double* %0, i64 %23
%29 = load double, double* %28
%30 = tail call double @llvm.fmuladd.f64(double %27, double %29, double %24)
%31 = fdiv double %29, %27
store double %31, double* %28
%32 = or i64 %23, 1
%33 = getelementptr inbounds double, double* %2, i64 %32
%34 = load double, double* %33
%35 = getelementptr inbounds double, double* %0, i64 %32
%36 = load double, double* %35
%37 = tail call double @llvm.fmuladd.f64(double %34, double %36, double %30)
%38 = fdiv double %36, %34
store double %38, double* %35
%39 = add nuw nsw i64 %23, 2
%40 = add i64 %25, 2
%41 = icmp eq i64 %40, %17
br i1 %41, label %42, label %22
42: ; preds = %22, %12
%43 = phi double [ undef, %12 ], [ %37, %22 ]
%44 = phi i64 [ 0, %12 ], [ %39, %22 ]
%45 = phi double [ 0.000000e+00, %12 ], [ %37, %22 ]
%46 = icmp eq i64 %14, 0
br i1 %46, label %54, label %47
47: ; preds = %42
%48 = getelementptr inbounds double, double* %2, i64 %44
%49 = load double, double* %48
%50 = getelementptr inbounds double, double* %0, i64 %44
%51 = load double, double* %50
%52 = tail call double @llvm.fmuladd.f64(double %49, double %51, double %45)
%53 = fdiv double %51, %49
store double %53, double* %50
br label %54
54: ; preds = %42, %47
%55 = phi double [ %43, %42 ], [ %52, %47 ]
%56 = fcmp ugt double %55, %4
br i1 %56, label %65, label %61
57: ; preds = %11
%58 = fcmp ult double %4, 0.000000e+00
br i1 %58, label %59, label %61
59: ; preds = %57
%60 = tail call i32 @heap_build_2(i32 %5, double* %0, double* %2)
br label %181
61: ; preds = %57, %54
%62 = bitcast double* %1 to i8*
%63 = shl i32 %5, 3
%64 = tail call i32 @memcpy(i8* %7, i8* %62, i32 %63)
br label %181
65: ; preds = %54
%66 = tail call i32 @heap_build_2(i32 %5, double* %0, double* %2)
br i1 %10, label %67, label %181
67: ; preds = %65
%68 = fneg double %4
br label %71
69: ; preds = %71
%70 = icmp eq i32 %85, %5
br i1 %70, label %86, label %71
71: ; preds = %67, %69
%72 = phi double [ %83, %69 ], [ 0.000000e+00, %67 ]
%73 = phi double [ %80, %69 ], [ 0.000000e+00, %67 ]
%74 = phi double [ %81, %69 ], [ %68, %67 ]
%75 = phi i32 [ %85, %69 ], [ 0, %67 ]
%76 = phi i32 [ %82, %69 ], [ %5, %67 ]
%77 = load double, double* %0
%78 = load double, double* %2
%79 = fmul double %78, %78
%80 = fadd double %73, %79
%81 = tail call double @llvm.fmuladd.f64(double %77, double %79, double %74)
%82 = tail call i32 @heap_del_max_2(i32 %76, double* %0, double* %2)
%83 = fdiv double %81, %80
%84 = fcmp ult double %83, %77
%85 = add nuw nsw i32 %75, 1
br i1 %84, label %69, label %86
86: ; preds = %69, %71
%87 = phi double [ %83, %69 ], [ %72, %71 ]
br i1 %10, label %88, label %181
88: ; preds = %86
%89 = zext i32 %5 to i64
%90 = icmp ult i32 %5, 4
br i1 %90, label %138, label %91
91: ; preds = %88
%92 = getelementptr double, double* %0, i64 %13
%93 = getelementptr double, double* %1, i64 %13
%94 = getelementptr double, double* %3, i64 %13
%95 = icmp ugt double* %93, %0
%96 = icmp ugt double* %92, %1
%97 = and i1 %95, %96
%98 = icmp ugt double* %94, %0
%99 = icmp ugt double* %92, %3
%100 = and i1 %98, %99
%101 = or i1 %97, %100
br i1 %101, label %138, label %102
102: ; preds = %91
%103 = and i64 %13, 4294967292
%104 = insertelement <2 x double> poison, double %87, i64 0
%105 = shufflevector <2 x double> %104, <2 x double> poison, <2 x i32> zeroinitializer
%106 = insertelement <2 x double> poison, double %87, i64 0
%107 = shufflevector <2 x double> %106, <2 x double> poison, <2 x i32> zeroinitializer
br label %108
108: ; preds = %108, %102
%109 = phi i64 [ 0, %102 ], [ %134, %108 ]
%110 = getelementptr inbounds double, double* %1, i64 %109
%111 = bitcast double* %110 to <2 x double>*
%112 = load <2 x double>, <2 x double>* %111
%113 = getelementptr inbounds double, double* %110, i64 2
%114 = bitcast double* %113 to <2 x double>*
%115 = load <2 x double>, <2 x double>* %114
%116 = getelementptr inbounds double, double* %3, i64 %109
%117 = bitcast double* %116 to <2 x double>*
%118 = load <2 x double>, <2 x double>* %117
%119 = getelementptr inbounds double, double* %116, i64 2
%120 = bitcast double* %119 to <2 x double>*
%121 = load <2 x double>, <2 x double>* %120
%122 = fmul <2 x double> %105, %118
%123 = fmul <2 x double> %107, %121
%124 = fcmp ugt <2 x double> %112, %122
%125 = fcmp ugt <2 x double> %115, %123
%126 = fsub <2 x double> %112, %122
%127 = fsub <2 x double> %115, %123
%128 = select <2 x i1> %124, <2 x double> %126, <2 x double> zeroinitializer
%129 = select <2 x i1> %125, <2 x double> %127, <2 x double> zeroinitializer
%130 = getelementptr inbounds double, double* %0, i64 %109
%131 = bitcast double* %130 to <2 x double>*
store <2 x double> %128, <2 x double>* %131
%132 = getelementptr inbounds double, double* %130, i64 2
%133 = bitcast double* %132 to <2 x double>*
store <2 x double> %129, <2 x double>* %133
%134 = add nuw i64 %109, 4
%135 = icmp eq i64 %134, %103
br i1 %135, label %136, label %108
136: ; preds = %108
%137 = icmp eq i64 %103, %13
br i1 %137, label %181, label %138
138: ; preds = %91, %88, %136
%139 = phi i64 [ 0, %91 ], [ 0, %88 ], [ %103, %136 ]
%140 = xor i64 %139, -1
%141 = and i64 %13, 1
%142 = icmp eq i64 %141, 0
br i1 %142, label %154, label %143
143: ; preds = %138
%144 = getelementptr inbounds double, double* %1, i64 %139
%145 = load double, double* %144
%146 = getelementptr inbounds double, double* %3, i64 %139
%147 = load double, double* %146
%148 = fmul double %87, %147
%149 = fcmp ugt double %145, %148
%150 = fsub double %145, %148
%151 = select i1 %149, double %150, double 0.000000e+00
%152 = getelementptr inbounds double, double* %0, i64 %139
store double %151, double* %152
%153 = or i64 %139, 1
br label %154
154: ; preds = %143, %138
%155 = phi i64 [ %139, %138 ], [ %153, %143 ]
%156 = sub nsw i64 0, %13
%157 = icmp eq i64 %140, %156
br i1 %157, label %181, label %158
158: ; preds = %154, %158
%159 = phi i64 [ %179, %158 ], [ %155, %154 ]
%160 = getelementptr inbounds double, double* %1, i64 %159
%161 = load double, double* %160
%162 = getelementptr inbounds double, double* %3, i64 %159
%163 = load double, double* %162
%164 = fmul double %87, %163
%165 = fcmp ugt double %161, %164
%166 = fsub double %161, %164
%167 = select i1 %165, double %166, double 0.000000e+00
%168 = getelementptr inbounds double, double* %0, i64 %159
store double %167, double* %168
%169 = add nuw nsw i64 %159, 1
%170 = getelementptr inbounds double, double* %1, i64 %169
%171 = load double, double* %170
%172 = getelementptr inbounds double, double* %3, i64 %169
%173 = load double, double* %172
%174 = fmul double %87, %173
%175 = fcmp ugt double %171, %174
%176 = fsub double %171, %174
%177 = select i1 %175, double %176, double 0.000000e+00
%178 = getelementptr inbounds double, double* %0, i64 %169
store double %177, double* %178
%179 = add nuw nsw i64 %159, 2
%180 = icmp eq i64 %179, %89
br i1 %180, label %181, label %158
181: ; preds = %154, %158, %136, %65, %59, %19, %86, %18, %61
%182 = phi double [ 0.000000e+00, %61 ], [ 0.000000e+00, %18 ], [ %87, %86 ], [ 0.000000e+00, %19 ], [ 0.000000e+00, %59 ], [ 0.000000e+00, %65 ], [ %87, %136 ], [ %87, %158 ], [ %87, %154 ]
ret double %182
}