#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);
int 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 j;
}


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    11bb <projectD+0x8b>
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>
movl   $0x0,-0x4(%rbp)
jmp    1401 <projectD+0x2d1>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    123b <projectD+0x10b>
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    11ca <projectD+0x9a>
movsd  -0x48(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1272 <projectD+0x142>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0x34(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0x4(%rbp)
jmp    1401 <projectD+0x2d1>
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    136c <projectD+0x23c>
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     1358 <projectD+0x228>
jmp    136c <projectD+0x23c>
jmp    135d <projectD+0x22d>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    12b8 <projectD+0x188>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    13fb <projectD+0x2cb>
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     13d1 <projectD+0x2a1>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    13e8 <projectD+0x2b8>
movsd  -0x58(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    13ed <projectD+0x2bd>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1373 <projectD+0x243>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<projectD>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r8d,%r13d
mov    %rdi,%rbx
mov    0x2e8d(%rip),%rax
movsd  (%rax),%xmm1
ucomisd %xmm0,%xmm1
jbe    1187 <projectD+0x47>
test   %r13d,%r13d
jle    1340 <projectD+0x200>
mov    %r13d,%edx
shl    $0x3,%rdx
xor    %r12d,%r12d
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
jmp    1343 <projectD+0x203>
mov    %rdx,%rbp
mov    %rsi,%r14
test   %r13d,%r13d
jle    11a9 <projectD+0x69>
mov    %rcx,%r15
mov    %r13d,%edx
cmp    $0x1,%r13d
jne    11ca <projectD+0x8a>
xorpd  %xmm5,%xmm5
xor    %eax,%eax
jmp    122b <projectD+0xeb>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    132e <projectD+0x1ee>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1030 <heap_build_2@plt>
jmp    1340 <projectD+0x200>
mov    %edx,%ecx
and    $0xfffffffe,%ecx
xorpd  %xmm5,%xmm5
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
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,%dl
je     1250 <projectD+0x110>
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    132e <projectD+0x1ee>
movapd %xmm0,(%rsp)
mov    %rdx,0x20(%rsp)
mov    %r13d,%edi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1030 <heap_build_2@plt>
test   %r13d,%r13d
jle    1340 <projectD+0x200>
mov    %r15,0x18(%rsp)
movapd (%rsp),%xmm2
xorpd  0xd73(%rip),%xmm2
mov    %r13d,%r15d
neg    %r15d
xorpd  %xmm1,%xmm1
mov    $0x1,%r12d
xorpd  %xmm3,%xmm3
mov    %r13d,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movapd %xmm1,0x30(%rsp)
movapd %xmm2,%xmm0
movsd  (%rbx),%xmm1
movsd  %xmm1,0x28(%rsp)
movsd  0x0(%rbp),%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm2,%xmm3
movapd %xmm3,0x40(%rsp)
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movapd %xmm2,(%rsp)
mov    %eax,%edi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1040 <heap_del_max_2@plt>
movapd 0x40(%rsp),%xmm3
movapd (%rsp),%xmm2
movapd %xmm2,%xmm0
divsd  %xmm3,%xmm0
ucomisd 0x28(%rsp),%xmm0
jae    1355 <projectD+0x215>
lea    (%r15,%r12,1),%ecx
add    $0x1,%ecx
mov    %r12d,%edx
add    $0x1,%edx
mov    %edx,%r12d
movapd %xmm0,%xmm1
cmp    $0x1,%ecx
jne    12b0 <projectD+0x170>
movapd %xmm0,%xmm7
mov    %r13d,%r12d
jmp    135a <projectD+0x21a>
shl    $0x3,%r13d
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r13d,%edx
call   1060 <memcpy@plt>
xor    %r12d,%r12d
mov    %r12d,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movaps 0x30(%rsp),%xmm7
test   %r13d,%r13d
mov    0x18(%rsp),%rbp
mov    0x20(%rsp),%rsi
jle    1343 <projectD+0x203>
cmp    $0x4,%r13d
jae    1376 <projectD+0x236>
xor    %eax,%eax
jmp    1440 <projectD+0x300>
lea    (%rbx,%rsi,8),%rax
lea    (%r14,%rsi,8),%rcx
cmp    %rbx,%rcx
seta   %dil
lea    0x0(,%rsi,8),%rcx
add    %rbp,%rcx
cmp    %r14,%rax
seta   %dl
cmp    %rbx,%rcx
seta   %cl
cmp    %rbp,%rax
seta   %r8b
xor    %eax,%eax
test   %dl,%dil
jne    1440 <projectD+0x300>
and    %r8b,%cl
jne    1440 <projectD+0x300>
mov    %esi,%eax
and    $0xfffffffc,%eax
movapd %xmm7,%xmm0
unpcklpd %xmm7,%xmm0
lea    0x0(,%rsi,8),%rcx
and    $0xffffffffffffffe0,%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movupd (%r14,%rdx,1),%xmm1
movupd 0x10(%r14,%rdx,1),%xmm2
movupd 0x0(%rbp,%rdx,1),%xmm3
movupd 0x10(%rbp,%rdx,1),%xmm4
mulpd  %xmm0,%xmm3
mulpd  %xmm0,%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    13e0 <projectD+0x2a0>
cmp    %rsi,%rax
je     1343 <projectD+0x203>
mov    %rax,%rcx
not    %rcx
test   $0x1,%sil
je     1476 <projectD+0x336>
movsd  (%r14,%rax,8),%xmm0
movsd  0x0(%rbp,%rax,8),%xmm1
mulsd  %xmm7,%xmm1
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
cmpnlesd %xmm1,%xmm0
andpd  %xmm2,%xmm0
movlpd %xmm0,(%rbx,%rax,8)
or     $0x1,%rax
add    %rsi,%rcx
je     1343 <projectD+0x203>
nop
movsd  (%r14,%rax,8),%xmm0
movsd  0x0(%rbp,%rax,8),%xmm1
mulsd  %xmm7,%xmm1
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
cmpnlesd %xmm1,%xmm0
andpd  %xmm2,%xmm0
movlpd %xmm0,(%rbx,%rax,8)
movsd  0x8(%r14,%rax,8),%xmm0
movsd  0x8(%rbp,%rax,8),%xmm1
mulsd  %xmm7,%xmm1
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
cmpnlesd %xmm1,%xmm0
andpd  %xmm2,%xmm0
movlpd %xmm0,0x8(%rbx,%rax,8)
add    $0x2,%rax
cmp    %rax,%rsi
jne    1480 <projectD+0x340>
jmp    1343 <projectD+0x203>

LLVM IR (-O0):
@DBL_EPSILON = global double 0.000000e+00
define i32 @projectD(double* %0, double* %1, double* %2, double* %3, double %4, i32 %5) {
%7 = alloca i32
%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 i32 0, i32* %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 i32 0, i32* %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 i32, i32* %15
store i32 %168, i32* %7
br label %169
169: ; preds = %167, %74, %39
%170 = load i32, i32* %7
ret i32 %170
}

LLVM IR (-O2):
@DBL_EPSILON = global double 0.000000e+00
define i32 @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 %182
19: ; preds = %18
%20 = zext i32 %5 to i64
%21 = shl nuw nsw i64 %20, 3
br label %182
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 %182
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 %182
65: ; preds = %54
%66 = tail call i32 @heap_build_2(i32 %5, double* %0, double* %2)
br i1 %10, label %67, label %182
67: ; preds = %65
%68 = fneg double %4
br label %71
69: ; preds = %71
%70 = icmp eq i32 %78, %5
br i1 %70, label %86, label %71
71: ; preds = %67, %69
%72 = phi double [ %84, %69 ], [ 0.000000e+00, %67 ]
%73 = phi double [ %81, %69 ], [ 0.000000e+00, %67 ]
%74 = phi double [ %82, %69 ], [ %68, %67 ]
%75 = phi i32 [ %78, %69 ], [ 0, %67 ]
%76 = phi i32 [ %83, %69 ], [ %5, %67 ]
%77 = load double, double* %0
%78 = add nuw nsw i32 %75, 1
%79 = load double, double* %2
%80 = fmul double %79, %79
%81 = fadd double %73, %80
%82 = tail call double @llvm.fmuladd.f64(double %77, double %80, double %74)
%83 = tail call i32 @heap_del_max_2(i32 %76, double* %0, double* %2)
%84 = fdiv double %82, %81
%85 = fcmp ult double %84, %77
br i1 %85, label %69, label %86
86: ; preds = %69, %71
%87 = phi double [ %72, %71 ], [ %84, %69 ]
%88 = phi i32 [ %78, %71 ], [ %5, %69 ]
br i1 %10, label %89, label %182
89: ; preds = %86
%90 = zext i32 %5 to i64
%91 = icmp ult i32 %5, 4
br i1 %91, label %139, label %92
92: ; preds = %89
%93 = getelementptr double, double* %0, i64 %13
%94 = getelementptr double, double* %1, i64 %13
%95 = getelementptr double, double* %3, i64 %13
%96 = icmp ugt double* %94, %0
%97 = icmp ugt double* %93, %1
%98 = and i1 %96, %97
%99 = icmp ugt double* %95, %0
%100 = icmp ugt double* %93, %3
%101 = and i1 %99, %100
%102 = or i1 %98, %101
br i1 %102, label %139, label %103
103: ; preds = %92
%104 = and i64 %13, 4294967292
%105 = insertelement <2 x double> poison, double %87, i64 0
%106 = shufflevector <2 x double> %105, <2 x double> poison, <2 x i32> zeroinitializer
%107 = insertelement <2 x double> poison, double %87, i64 0
%108 = shufflevector <2 x double> %107, <2 x double> poison, <2 x i32> zeroinitializer
br label %109
109: ; preds = %109, %103
%110 = phi i64 [ 0, %103 ], [ %135, %109 ]
%111 = getelementptr inbounds double, double* %1, i64 %110
%112 = bitcast double* %111 to <2 x double>*
%113 = load <2 x double>, <2 x double>* %112
%114 = getelementptr inbounds double, double* %111, i64 2
%115 = bitcast double* %114 to <2 x double>*
%116 = load <2 x double>, <2 x double>* %115
%117 = getelementptr inbounds double, double* %3, i64 %110
%118 = bitcast double* %117 to <2 x double>*
%119 = load <2 x double>, <2 x double>* %118
%120 = getelementptr inbounds double, double* %117, i64 2
%121 = bitcast double* %120 to <2 x double>*
%122 = load <2 x double>, <2 x double>* %121
%123 = fmul <2 x double> %106, %119
%124 = fmul <2 x double> %108, %122
%125 = fcmp ugt <2 x double> %113, %123
%126 = fcmp ugt <2 x double> %116, %124
%127 = fsub <2 x double> %113, %123
%128 = fsub <2 x double> %116, %124
%129 = select <2 x i1> %125, <2 x double> %127, <2 x double> zeroinitializer
%130 = select <2 x i1> %126, <2 x double> %128, <2 x double> zeroinitializer
%131 = getelementptr inbounds double, double* %0, i64 %110
%132 = bitcast double* %131 to <2 x double>*
store <2 x double> %129, <2 x double>* %132
%133 = getelementptr inbounds double, double* %131, i64 2
%134 = bitcast double* %133 to <2 x double>*
store <2 x double> %130, <2 x double>* %134
%135 = add nuw i64 %110, 4
%136 = icmp eq i64 %135, %104
br i1 %136, label %137, label %109
137: ; preds = %109
%138 = icmp eq i64 %104, %13
br i1 %138, label %182, label %139
139: ; preds = %92, %89, %137
%140 = phi i64 [ 0, %92 ], [ 0, %89 ], [ %104, %137 ]
%141 = xor i64 %140, -1
%142 = and i64 %13, 1
%143 = icmp eq i64 %142, 0
br i1 %143, label %155, label %144
144: ; preds = %139
%145 = getelementptr inbounds double, double* %1, i64 %140
%146 = load double, double* %145
%147 = getelementptr inbounds double, double* %3, i64 %140
%148 = load double, double* %147
%149 = fmul double %87, %148
%150 = fcmp ugt double %146, %149
%151 = fsub double %146, %149
%152 = select i1 %150, double %151, double 0.000000e+00
%153 = getelementptr inbounds double, double* %0, i64 %140
store double %152, double* %153
%154 = or i64 %140, 1
br label %155
155: ; preds = %144, %139
%156 = phi i64 [ %140, %139 ], [ %154, %144 ]
%157 = sub nsw i64 0, %13
%158 = icmp eq i64 %141, %157
br i1 %158, label %182, label %159
159: ; preds = %155, %159
%160 = phi i64 [ %180, %159 ], [ %156, %155 ]
%161 = getelementptr inbounds double, double* %1, i64 %160
%162 = load double, double* %161
%163 = getelementptr inbounds double, double* %3, i64 %160
%164 = load double, double* %163
%165 = fmul double %87, %164
%166 = fcmp ugt double %162, %165
%167 = fsub double %162, %165
%168 = select i1 %166, double %167, double 0.000000e+00
%169 = getelementptr inbounds double, double* %0, i64 %160
store double %168, double* %169
%170 = add nuw nsw i64 %160, 1
%171 = getelementptr inbounds double, double* %1, i64 %170
%172 = load double, double* %171
%173 = getelementptr inbounds double, double* %3, i64 %170
%174 = load double, double* %173
%175 = fmul double %87, %174
%176 = fcmp ugt double %172, %175
%177 = fsub double %172, %175
%178 = select i1 %176, double %177, double 0.000000e+00
%179 = getelementptr inbounds double, double* %0, i64 %170
store double %178, double* %179
%180 = add nuw nsw i64 %160, 2
%181 = icmp eq i64 %180, %90
br i1 %181, label %182, label %159
182: ; preds = %155, %159, %137, %65, %59, %19, %86, %18, %61
%183 = phi i32 [ 0, %61 ], [ 0, %18 ], [ %88, %86 ], [ 0, %19 ], [ 0, %59 ], [ 0, %65 ], [ %88, %137 ], [ %88, %159 ], [ %88, %155 ]
ret i32 %183
}