#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 fabs(double);
double cg_update_ykyk(double *gold, double *gnew, double *Ykyk, double *Ykgk,
                      long int n) {
  long int i, n5;
  double t, gnorm, yk, ykyk, ykgk;
  gnorm = ((double)0);
  ykyk = ((double)0);
  ykgk = ((double)0);
  n5 = n % 5;
  for (i = 0; i < n5; i++) {
    t = gnew[i];
    if (gnorm < fabs(t))
      gnorm = fabs(t);
    yk = t - gold[i];
    gold[i] = t;
    ykgk += yk * t;
    ykyk += yk * yk;
  }
  for (; i < n;) {
    t = gnew[i];
    if (gnorm < fabs(t))
      gnorm = fabs(t);
    yk = t - gold[i];
    gold[i] = t;
    ykgk += yk * t;
    ykyk += yk * yk;
    i++;
    t = gnew[i];
    if (gnorm < fabs(t))
      gnorm = fabs(t);
    yk = t - gold[i];
    gold[i] = t;
    ykgk += yk * t;
    ykyk += yk * yk;
    i++;
    t = gnew[i];
    if (gnorm < fabs(t))
      gnorm = fabs(t);
    yk = t - gold[i];
    gold[i] = t;
    ykgk += yk * t;
    ykyk += yk * yk;
    i++;
    t = gnew[i];
    if (gnorm < fabs(t))
      gnorm = fabs(t);
    yk = t - gold[i];
    gold[i] = t;
    ykgk += yk * t;
    ykyk += yk * yk;
    i++;
    t = gnew[i];
    if (gnorm < fabs(t))
      gnorm = fabs(t);
    yk = t - gold[i];
    gold[i] = t;
    ykgk += yk * t;
    ykyk += yk * yk;
    i++;
  }
  *Ykyk = ykyk;
  *Ykgk = ykgk;
  return (gnorm);
}


x86 assembly (clang, -O0):
<cg_update_ykyk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x28(%rbp),%rax
mov    $0x5,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x38(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x38(%rbp),%rax
jge    1210 <cg_update_ykyk+0x110>
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
movaps 0xe85(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    119e <cg_update_ykyk+0x9e>
movsd  -0x40(%rbp),%xmm0
movaps 0xe6b(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    114a <cg_update_ykyk+0x4a>
jmp    1215 <cg_update_ykyk+0x115>
mov    -0x30(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    15a7 <cg_update_ykyk+0x4a7>
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
movaps 0xdba(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1269 <cg_update_ykyk+0x169>
movsd  -0x40(%rbp),%xmm0
movaps 0xda0(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
movaps 0xd07(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    131c <cg_update_ykyk+0x21c>
movsd  -0x40(%rbp),%xmm0
movaps 0xced(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
movaps 0xc54(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    13cf <cg_update_ykyk+0x2cf>
movsd  -0x40(%rbp),%xmm0
movaps 0xc3a(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
movaps 0xba1(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1482 <cg_update_ykyk+0x382>
movsd  -0x40(%rbp),%xmm0
movaps 0xb87(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
movaps 0xaee(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1535 <cg_update_ykyk+0x435>
movsd  -0x40(%rbp),%xmm0
movaps 0xad4(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1215 <cg_update_ykyk+0x115>
movsd  -0x58(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x60(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cg_update_ykyk>:
mov    %r8,%r9
mov    %rdx,%r8
movabs $0x6666666666666667,%rdx
66 66 66
mov    %r9,%rax
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    %rdx
add    %rax,%rdx
lea    (%rdx,%rdx,4),%rdx
mov    %r9,%rax
sub    %rdx,%rax
test   %rax,%rax
jle    11bf <cg_update_ykyk+0xbf>
movsd  (%rsi),%xmm1
movapd 0xebe(%rip),%xmm0
andpd  %xmm1,%xmm0
xorpd  %xmm2,%xmm2
movapd %xmm1,%xmm3
subsd  (%rdi),%xmm3
maxsd  %xmm2,%xmm0
movsd  %xmm1,(%rdi)
movapd %xmm3,%xmm2
unpcklpd %xmm3,%xmm2
unpcklpd %xmm1,%xmm3
mulpd  %xmm2,%xmm3
xorpd  %xmm1,%xmm1
addpd  %xmm3,%xmm1
cmp    $0x1,%rax
je     11c9 <cg_update_ykyk+0xc9>
movsd  0x8(%rsi),%xmm3
movapd 0xe7b(%rip),%xmm2
andpd  %xmm3,%xmm2
maxsd  %xmm0,%xmm2
movapd %xmm3,%xmm0
subsd  0x8(%rdi),%xmm0
movsd  %xmm3,0x8(%rdi)
movapd %xmm0,%xmm4
unpcklpd %xmm0,%xmm4
unpcklpd %xmm3,%xmm0
mulpd  %xmm4,%xmm0
addpd  %xmm0,%xmm1
cmp    $0x2,%rax
jne    12fa <cg_update_ykyk+0x1fa>
movapd %xmm2,%xmm0
jmp    11c9 <cg_update_ykyk+0xc9>
xorpd  %xmm1,%xmm1
xorpd  %xmm0,%xmm0
xor    %eax,%eax
cmp    %r9,%rax
jge    12f0 <cg_update_ykyk+0x1f0>
movapd 0xe26(%rip),%xmm2
nopw   0x0(%rax,%rax,1)
movsd  (%rsi,%rax,8),%xmm3
movapd %xmm3,%xmm4
subsd  (%rdi,%rax,8),%xmm4
movsd  %xmm3,(%rdi,%rax,8)
movapd %xmm4,%xmm5
unpcklpd %xmm3,%xmm4
andpd  %xmm2,%xmm3
maxsd  %xmm0,%xmm3
unpcklpd %xmm5,%xmm5
mulpd  %xmm5,%xmm4
movsd  0x8(%rsi,%rax,8),%xmm5
movapd %xmm5,%xmm0
subsd  0x8(%rdi,%rax,8),%xmm0
addpd  %xmm1,%xmm4
movsd  %xmm5,0x8(%rdi,%rax,8)
movapd %xmm0,%xmm1
unpcklpd %xmm5,%xmm0
andpd  %xmm2,%xmm5
maxsd  %xmm3,%xmm5
unpcklpd %xmm1,%xmm1
mulpd  %xmm1,%xmm0
addpd  %xmm4,%xmm0
movsd  0x10(%rsi,%rax,8),%xmm1
movapd %xmm1,%xmm4
subsd  0x10(%rdi,%rax,8),%xmm4
movsd  %xmm1,0x10(%rdi,%rax,8)
movapd %xmm4,%xmm3
unpcklpd %xmm1,%xmm4
andpd  %xmm2,%xmm1
maxsd  %xmm5,%xmm1
unpcklpd %xmm3,%xmm3
mulpd  %xmm3,%xmm4
movsd  0x18(%rsi,%rax,8),%xmm5
movapd %xmm5,%xmm3
subsd  0x18(%rdi,%rax,8),%xmm3
addpd  %xmm0,%xmm4
movsd  %xmm5,0x18(%rdi,%rax,8)
movapd %xmm3,%xmm0
unpcklpd %xmm5,%xmm3
andpd  %xmm2,%xmm5
maxsd  %xmm1,%xmm5
unpcklpd %xmm0,%xmm0
mulpd  %xmm0,%xmm3
addpd  %xmm4,%xmm3
movsd  0x20(%rsi,%rax,8),%xmm0
movapd %xmm0,%xmm4
subsd  0x20(%rdi,%rax,8),%xmm4
movsd  %xmm0,0x20(%rdi,%rax,8)
movapd %xmm4,%xmm1
unpcklpd %xmm0,%xmm4
andpd  %xmm2,%xmm0
maxsd  %xmm5,%xmm0
unpcklpd %xmm1,%xmm1
mulpd  %xmm1,%xmm4
movapd %xmm4,%xmm1
addpd  %xmm3,%xmm1
add    $0x5,%rax
cmp    %r9,%rax
jl     11e0 <cg_update_ykyk+0xe0>
addpd  %xmm3,%xmm4
movapd %xmm4,%xmm1
movlpd %xmm1,(%r8)
movhpd %xmm1,(%rcx)
ret
movsd  0x10(%rsi),%xmm3
movapd 0xcf9(%rip),%xmm0
andpd  %xmm3,%xmm0
maxsd  %xmm2,%xmm0
movapd %xmm3,%xmm2
subsd  0x10(%rdi),%xmm2
movsd  %xmm3,0x10(%rdi)
movapd %xmm2,%xmm4
unpcklpd %xmm2,%xmm4
unpcklpd %xmm3,%xmm2
mulpd  %xmm4,%xmm2
addpd  %xmm2,%xmm1
cmp    $0x3,%rax
je     11c9 <cg_update_ykyk+0xc9>
movsd  0x18(%rsi),%xmm3
movapd 0xcb8(%rip),%xmm2
andpd  %xmm3,%xmm2
maxsd  %xmm0,%xmm2
movapd %xmm3,%xmm0
subsd  0x18(%rdi),%xmm0
movsd  %xmm3,0x18(%rdi)
movapd %xmm0,%xmm4
unpcklpd %xmm0,%xmm4
unpcklpd %xmm3,%xmm0
mulpd  %xmm4,%xmm0
addpd  %xmm0,%xmm1
cmp    $0x4,%rax
je     11b9 <cg_update_ykyk+0xb9>
movsd  0x20(%rsi),%xmm3
movapd %xmm3,%xmm4
subsd  0x20(%rdi),%xmm4
movapd 0xc6e(%rip),%xmm0
movsd  %xmm3,0x20(%rdi)
movapd %xmm4,%xmm5
unpcklpd %xmm3,%xmm4
andpd  %xmm0,%xmm3
maxsd  %xmm2,%xmm3
unpcklpd %xmm5,%xmm5
mulpd  %xmm5,%xmm4
addpd  %xmm1,%xmm4
movsd  0x28(%rsi),%xmm1
movapd %xmm1,%xmm2
subsd  0x28(%rdi),%xmm2
movsd  %xmm1,0x28(%rdi)
movapd %xmm2,%xmm5
unpcklpd %xmm1,%xmm2
andpd  %xmm0,%xmm1
maxsd  %xmm3,%xmm1
unpcklpd %xmm5,%xmm5
mulpd  %xmm5,%xmm2
addpd  %xmm4,%xmm2
movsd  0x30(%rsi),%xmm3
andpd  %xmm3,%xmm0
maxsd  %xmm1,%xmm0
movapd %xmm3,%xmm1
subsd  0x30(%rdi),%xmm1
movsd  %xmm3,0x30(%rdi)
movapd %xmm1,%xmm4
unpcklpd %xmm1,%xmm4
unpcklpd %xmm3,%xmm1
mulpd  %xmm4,%xmm1
addpd  %xmm2,%xmm1
jmp    11c9 <cg_update_ykyk+0xc9>

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

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