double cg_update_2(double *gold, double *gnew, double *d, long int n) {
  long int i, n5;
  double s, t;
  t = ((double)0);
  n5 = n % 5;
  if (d == 0) {
    for (i = 0; i < n5; i++) {
      s = gnew[i];
      t += s * s;
      gold[i] = s;
    }
    for (; i < n;) {
      s = gnew[i];
      t += s * s;
      gold[i] = s;
      i++;
      s = gnew[i];
      t += s * s;
      gold[i] = s;
      i++;
      s = gnew[i];
      t += s * s;
      gold[i] = s;
      i++;
      s = gnew[i];
      t += s * s;
      gold[i] = s;
      i++;
      s = gnew[i];
      t += s * s;
      gold[i] = s;
      i++;
    }
  } else if (gold != 0) {
    for (i = 0; i < n5; i++) {
      s = gnew[i];
      t += s * s;
      gold[i] = s;
      d[i] = -s;
    }
    for (; i < n;) {
      s = gnew[i];
      t += s * s;
      gold[i] = s;
      d[i] = -s;
      i++;
      s = gnew[i];
      t += s * s;
      gold[i] = s;
      d[i] = -s;
      i++;
      s = gnew[i];
      t += s * s;
      gold[i] = s;
      d[i] = -s;
      i++;
      s = gnew[i];
      t += s * s;
      gold[i] = s;
      d[i] = -s;
      i++;
      s = gnew[i];
      t += s * s;
      gold[i] = s;
      d[i] = -s;
      i++;
    }
  } else {
    for (i = 0; i < n5; i++) {
      s = gnew[i];
      t += s * s;
      d[i] = -s;
    }
    for (; i < n;) {
      s = gnew[i];
      t += s * s;
      d[i] = -s;
      i++;
      s = gnew[i];
      t += s * s;
      d[i] = -s;
      i++;
      s = gnew[i];
      t += s * s;
      d[i] = -s;
      i++;
      s = gnew[i];
      t += s * s;
      d[i] = -s;
      i++;
      s = gnew[i];
      t += s * s;
      d[i] = -s;
      i++;
    }
  }
  return (t);
}


x86 assembly (clang, -O0):
<cg_update_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x20(%rbp),%rax
mov    $0x5,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x30(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1339 <cg_update_2+0x239>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
jge    11a0 <cg_update_2+0xa0>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1141 <cg_update_2+0x41>
jmp    11a5 <cg_update_2+0xa5>
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    1334 <cg_update_2+0x234>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    11a5 <cg_update_2+0xa5>
jmp    18c9 <cg_update_2+0x7c9>
cmpq   $0x0,-0x8(%rbp)
je     163a <cg_update_2+0x53a>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
jge    13d4 <cg_update_2+0x2d4>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    134c <cg_update_2+0x24c>
jmp    13d9 <cg_update_2+0x2d9>
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    1635 <cg_update_2+0x535>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    13d9 <cg_update_2+0x2d9>
jmp    18c4 <cg_update_2+0x7c4>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
jge    16b8 <cg_update_2+0x5b8>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1642 <cg_update_2+0x542>
jmp    16bd <cg_update_2+0x5bd>
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    18bf <cg_update_2+0x7bf>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    16bd <cg_update_2+0x5bd>
jmp    18c4 <cg_update_2+0x7c4>
jmp    18c9 <cg_update_2+0x7c9>
movsd  -0x40(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cg_update_2>:
mov    %rcx,%r8
mov    %rdx,%rcx
movabs $0x6666666666666667,%rdx
66 66 66
mov    %r8,%rax
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    %rdx
add    %rax,%rdx
lea    (%rdx,%rdx,4),%rdx
mov    %r8,%rax
sub    %rdx,%rax
test   %rcx,%rcx
je     1267 <cg_update_2+0x167>
test   %rdi,%rdi
je     1325 <cg_update_2+0x225>
test   %rax,%rax
jle    142b <cg_update_2+0x32b>
movsd  (%rsi),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
xorpd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm1,(%rdi)
xorpd  0xe98(%rip),%xmm1
movlpd %xmm1,(%rcx)
cmp    $0x1,%rax
je     1431 <cg_update_2+0x331>
movsd  0x8(%rsi),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
movsd  %xmm1,0x8(%rdi)
xorpd  0xe6c(%rip),%xmm1
movlpd %xmm1,0x8(%rcx)
cmp    $0x2,%rax
je     1431 <cg_update_2+0x331>
movsd  0x10(%rsi),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
movsd  %xmm1,0x10(%rdi)
xorpd  0xe3f(%rip),%xmm1
movlpd %xmm1,0x10(%rcx)
cmp    $0x3,%rax
je     1431 <cg_update_2+0x331>
movsd  0x18(%rsi),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
movsd  %xmm1,0x18(%rdi)
xorpd  0xe12(%rip),%xmm1
movlpd %xmm1,0x18(%rcx)
cmp    $0x4,%rax
je     1431 <cg_update_2+0x331>
movsd  0x20(%rsi),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm1,0x20(%rdi)
movapd 0xde5(%rip),%xmm3
xorpd  %xmm3,%xmm1
movlpd %xmm1,0x20(%rcx)
movsd  0x28(%rsi),%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm0,0x28(%rdi)
xorpd  %xmm3,%xmm0
movlpd %xmm0,0x28(%rcx)
movsd  0x30(%rsi),%xmm2
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm2,0x30(%rdi)
xorpd  %xmm3,%xmm2
movlpd %xmm2,0x30(%rcx)
jmp    1431 <cg_update_2+0x331>
test   %rax,%rax
jle    1509 <cg_update_2+0x409>
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
cmp    $0x1,%rax
je     158a <cg_update_2+0x48a>
movsd  0x8(%rsi),%xmm1
movsd  %xmm1,0x8(%rdi)
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
cmp    $0x2,%rax
je     158a <cg_update_2+0x48a>
movsd  0x10(%rsi),%xmm1
movsd  %xmm1,0x10(%rdi)
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
cmp    $0x3,%rax
je     158a <cg_update_2+0x48a>
movsd  0x18(%rsi),%xmm1
movsd  %xmm1,0x18(%rdi)
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
cmp    $0x4,%rax
je     158a <cg_update_2+0x48a>
movsd  0x20(%rsi),%xmm1
movsd  %xmm1,0x20(%rdi)
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x28(%rsi),%xmm0
movsd  %xmm0,0x28(%rdi)
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  0x30(%rsi),%xmm0
movsd  %xmm0,0x30(%rdi)
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
jmp    158a <cg_update_2+0x48a>
test   %rax,%rax
jle    1594 <cg_update_2+0x494>
movsd  (%rsi),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
xorpd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
xorpd  0xcb6(%rip),%xmm1
movlpd %xmm1,(%rcx)
cmp    $0x1,%rax
je     159a <cg_update_2+0x49a>
movsd  0x8(%rsi),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
xorpd  0xc8f(%rip),%xmm1
movlpd %xmm1,0x8(%rcx)
cmp    $0x2,%rax
je     159a <cg_update_2+0x49a>
movsd  0x10(%rsi),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
xorpd  0xc67(%rip),%xmm1
movlpd %xmm1,0x10(%rcx)
cmp    $0x3,%rax
je     159a <cg_update_2+0x49a>
movsd  0x18(%rsi),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
xorpd  0xc3f(%rip),%xmm1
movlpd %xmm1,0x18(%rcx)
cmp    $0x4,%rax
je     159a <cg_update_2+0x49a>
movsd  0x20(%rsi),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movapd 0xc17(%rip),%xmm3
xorpd  %xmm3,%xmm1
movlpd %xmm1,0x20(%rcx)
movsd  0x28(%rsi),%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
xorpd  %xmm3,%xmm0
movlpd %xmm0,0x28(%rcx)
movsd  0x30(%rsi),%xmm2
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm3,%xmm2
movlpd %xmm2,0x30(%rcx)
jmp    159a <cg_update_2+0x49a>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
cmp    %r8,%rax
jge    1647 <cg_update_2+0x547>
movapd 0xbbe(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%rsi,%rax,8),%xmm2
movapd %xmm2,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm0,%xmm3
movsd  %xmm2,(%rdi,%rax,8)
xorpd  %xmm1,%xmm2
movlpd %xmm2,(%rcx,%rax,8)
movsd  0x8(%rsi,%rax,8),%xmm0
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm3,%xmm2
movsd  %xmm0,0x8(%rdi,%rax,8)
xorpd  %xmm1,%xmm0
movlpd %xmm0,0x8(%rcx,%rax,8)
movsd  0x10(%rsi,%rax,8),%xmm0
movapd %xmm0,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm0,0x10(%rdi,%rax,8)
xorpd  %xmm1,%xmm0
movlpd %xmm0,0x10(%rcx,%rax,8)
movsd  0x18(%rsi,%rax,8),%xmm0
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm3,%xmm2
movsd  %xmm0,0x18(%rdi,%rax,8)
xorpd  %xmm1,%xmm0
movlpd %xmm0,0x18(%rcx,%rax,8)
movsd  0x20(%rsi,%rax,8),%xmm3
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm3,0x20(%rdi,%rax,8)
xorpd  %xmm1,%xmm3
movlpd %xmm3,0x20(%rcx,%rax,8)
add    $0x5,%rax
cmp    %r8,%rax
jl     1450 <cg_update_2+0x350>
jmp    1647 <cg_update_2+0x547>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
jmp    158a <cg_update_2+0x48a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rsi,%rax,8),%xmm1
movsd  %xmm1,(%rdi,%rax,8)
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x8(%rsi,%rax,8),%xmm0
movsd  %xmm0,0x8(%rdi,%rax,8)
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0x10(%rsi,%rax,8),%xmm1
movsd  %xmm1,0x10(%rdi,%rax,8)
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x18(%rsi,%rax,8),%xmm0
movsd  %xmm0,0x18(%rdi,%rax,8)
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  0x20(%rsi,%rax,8),%xmm0
movsd  %xmm0,0x20(%rdi,%rax,8)
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
add    $0x5,%rax
cmp    %r8,%rax
jl     1520 <cg_update_2+0x420>
jmp    1647 <cg_update_2+0x547>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
cmp    %r8,%rax
jge    1647 <cg_update_2+0x547>
movapd 0xa55(%rip),%xmm1
nopl   0x0(%rax,%rax,1)
movsd  (%rsi,%rax,8),%xmm2
movapd %xmm2,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm0,%xmm3
xorpd  %xmm1,%xmm2
movlpd %xmm2,(%rcx,%rax,8)
movsd  0x8(%rsi,%rax,8),%xmm0
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm3,%xmm2
xorpd  %xmm1,%xmm0
movlpd %xmm0,0x8(%rcx,%rax,8)
movsd  0x10(%rsi,%rax,8),%xmm0
movapd %xmm0,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
xorpd  %xmm1,%xmm0
movlpd %xmm0,0x10(%rcx,%rax,8)
movsd  0x18(%rsi,%rax,8),%xmm0
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm3,%xmm2
xorpd  %xmm1,%xmm0
movlpd %xmm0,0x18(%rcx,%rax,8)
movsd  0x20(%rsi,%rax,8),%xmm3
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm3
movlpd %xmm3,0x20(%rcx,%rax,8)
add    $0x5,%rax
cmp    %r8,%rax
jl     15b0 <cg_update_2+0x4b0>
ret

LLVM IR (-O0):
define double @cg_update_2(double* %0, double* %1, double* %2, i64 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca double
%12 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store i64 %3, i64* %8
store double 0.000000e+00, double* %12
%13 = load i64, i64* %8
%14 = srem i64 %13, 5
store i64 %14, i64* %10
%15 = load double*, double** %7
%16 = icmp eq double* %15, null
br i1 %16, label %17, label %115
17: ; preds = %4
store i64 0, i64* %9
br label %18
18: ; preds = %35, %17
%19 = load i64, i64* %9
%20 = load i64, i64* %10
%21 = icmp slt i64 %19, %20
br i1 %21, label %22, label %38
22: ; preds = %18
%23 = load double*, double** %6
%24 = load i64, i64* %9
%25 = getelementptr inbounds double, double* %23, i64 %24
%26 = load double, double* %25
store double %26, double* %11
%27 = load double, double* %11
%28 = load double, double* %11
%29 = load double, double* %12
%30 = call double @llvm.fmuladd.f64(double %27, double %28, double %29)
store double %30, double* %12
%31 = load double, double* %11
%32 = load double*, double** %5
%33 = load i64, i64* %9
%34 = getelementptr inbounds double, double* %32, i64 %33
store double %31, double* %34
br label %35
35: ; preds = %22
%36 = load i64, i64* %9
%37 = add nsw i64 %36, 1
store i64 %37, i64* %9
br label %18
38: ; preds = %18
br label %39
39: ; preds = %43, %38
%40 = load i64, i64* %9
%41 = load i64, i64* %8
%42 = icmp slt i64 %40, %41
br i1 %42, label %43, label %114
43: ; preds = %39
%44 = load double*, double** %6
%45 = load i64, i64* %9
%46 = getelementptr inbounds double, double* %44, i64 %45
%47 = load double, double* %46
store double %47, double* %11
%48 = load double, double* %11
%49 = load double, double* %11
%50 = load double, double* %12
%51 = call double @llvm.fmuladd.f64(double %48, double %49, double %50)
store double %51, double* %12
%52 = load double, double* %11
%53 = load double*, double** %5
%54 = load i64, i64* %9
%55 = getelementptr inbounds double, double* %53, i64 %54
store double %52, double* %55
%56 = load i64, i64* %9
%57 = add nsw i64 %56, 1
store i64 %57, i64* %9
%58 = load double*, double** %6
%59 = load i64, i64* %9
%60 = getelementptr inbounds double, double* %58, i64 %59
%61 = load double, double* %60
store double %61, double* %11
%62 = load double, double* %11
%63 = load double, double* %11
%64 = load double, double* %12
%65 = call double @llvm.fmuladd.f64(double %62, double %63, double %64)
store double %65, double* %12
%66 = load double, double* %11
%67 = load double*, double** %5
%68 = load i64, i64* %9
%69 = getelementptr inbounds double, double* %67, i64 %68
store double %66, double* %69
%70 = load i64, i64* %9
%71 = add nsw i64 %70, 1
store i64 %71, i64* %9
%72 = load double*, double** %6
%73 = load i64, i64* %9
%74 = getelementptr inbounds double, double* %72, i64 %73
%75 = load double, double* %74
store double %75, double* %11
%76 = load double, double* %11
%77 = load double, double* %11
%78 = load double, double* %12
%79 = call double @llvm.fmuladd.f64(double %76, double %77, double %78)
store double %79, double* %12
%80 = load double, double* %11
%81 = load double*, double** %5
%82 = load i64, i64* %9
%83 = getelementptr inbounds double, double* %81, i64 %82
store double %80, double* %83
%84 = load i64, i64* %9
%85 = add nsw i64 %84, 1
store i64 %85, i64* %9
%86 = load double*, double** %6
%87 = load i64, i64* %9
%88 = getelementptr inbounds double, double* %86, i64 %87
%89 = load double, double* %88
store double %89, double* %11
%90 = load double, double* %11
%91 = load double, double* %11
%92 = load double, double* %12
%93 = call double @llvm.fmuladd.f64(double %90, double %91, double %92)
store double %93, double* %12
%94 = load double, double* %11
%95 = load double*, double** %5
%96 = load i64, i64* %9
%97 = getelementptr inbounds double, double* %95, i64 %96
store double %94, double* %97
%98 = load i64, i64* %9
%99 = add nsw i64 %98, 1
store i64 %99, i64* %9
%100 = load double*, double** %6
%101 = load i64, i64* %9
%102 = getelementptr inbounds double, double* %100, i64 %101
%103 = load double, double* %102
store double %103, double* %11
%104 = load double, double* %11
%105 = load double, double* %11
%106 = load double, double* %12
%107 = call double @llvm.fmuladd.f64(double %104, double %105, double %106)
store double %107, double* %12
%108 = load double, double* %11
%109 = load double*, double** %5
%110 = load i64, i64* %9
%111 = getelementptr inbounds double, double* %109, i64 %110
store double %108, double* %111
%112 = load i64, i64* %9
%113 = add nsw i64 %112, 1
store i64 %113, i64* %9
br label %39
114: ; preds = %39
br label %351
115: ; preds = %4
%116 = load double*, double** %5
%117 = icmp ne double* %116, null
br i1 %117, label %118, label %246
118: ; preds = %115
store i64 0, i64* %9
br label %119
119: ; preds = %141, %118
%120 = load i64, i64* %9
%121 = load i64, i64* %10
%122 = icmp slt i64 %120, %121
br i1 %122, label %123, label %144
123: ; preds = %119
%124 = load double*, double** %6
%125 = load i64, i64* %9
%126 = getelementptr inbounds double, double* %124, i64 %125
%127 = load double, double* %126
store double %127, double* %11
%128 = load double, double* %11
%129 = load double, double* %11
%130 = load double, double* %12
%131 = call double @llvm.fmuladd.f64(double %128, double %129, double %130)
store double %131, double* %12
%132 = load double, double* %11
%133 = load double*, double** %5
%134 = load i64, i64* %9
%135 = getelementptr inbounds double, double* %133, i64 %134
store double %132, double* %135
%136 = load double, double* %11
%137 = fneg double %136
%138 = load double*, double** %7
%139 = load i64, i64* %9
%140 = getelementptr inbounds double, double* %138, i64 %139
store double %137, double* %140
br label %141
141: ; preds = %123
%142 = load i64, i64* %9
%143 = add nsw i64 %142, 1
store i64 %143, i64* %9
br label %119
144: ; preds = %119
br label %145
145: ; preds = %149, %144
%146 = load i64, i64* %9
%147 = load i64, i64* %8
%148 = icmp slt i64 %146, %147
br i1 %148, label %149, label %245
149: ; preds = %145
%150 = load double*, double** %6
%151 = load i64, i64* %9
%152 = getelementptr inbounds double, double* %150, i64 %151
%153 = load double, double* %152
store double %153, double* %11
%154 = load double, double* %11
%155 = load double, double* %11
%156 = load double, double* %12
%157 = call double @llvm.fmuladd.f64(double %154, double %155, double %156)
store double %157, double* %12
%158 = load double, double* %11
%159 = load double*, double** %5
%160 = load i64, i64* %9
%161 = getelementptr inbounds double, double* %159, i64 %160
store double %158, double* %161
%162 = load double, double* %11
%163 = fneg double %162
%164 = load double*, double** %7
%165 = load i64, i64* %9
%166 = getelementptr inbounds double, double* %164, i64 %165
store double %163, double* %166
%167 = load i64, i64* %9
%168 = add nsw i64 %167, 1
store i64 %168, i64* %9
%169 = load double*, double** %6
%170 = load i64, i64* %9
%171 = getelementptr inbounds double, double* %169, i64 %170
%172 = load double, double* %171
store double %172, double* %11
%173 = load double, double* %11
%174 = load double, double* %11
%175 = load double, double* %12
%176 = call double @llvm.fmuladd.f64(double %173, double %174, double %175)
store double %176, double* %12
%177 = load double, double* %11
%178 = load double*, double** %5
%179 = load i64, i64* %9
%180 = getelementptr inbounds double, double* %178, i64 %179
store double %177, double* %180
%181 = load double, double* %11
%182 = fneg double %181
%183 = load double*, double** %7
%184 = load i64, i64* %9
%185 = getelementptr inbounds double, double* %183, i64 %184
store double %182, double* %185
%186 = load i64, i64* %9
%187 = add nsw i64 %186, 1
store i64 %187, i64* %9
%188 = load double*, double** %6
%189 = load i64, i64* %9
%190 = getelementptr inbounds double, double* %188, i64 %189
%191 = load double, double* %190
store double %191, double* %11
%192 = load double, double* %11
%193 = load double, double* %11
%194 = load double, double* %12
%195 = call double @llvm.fmuladd.f64(double %192, double %193, double %194)
store double %195, double* %12
%196 = load double, double* %11
%197 = load double*, double** %5
%198 = load i64, i64* %9
%199 = getelementptr inbounds double, double* %197, i64 %198
store double %196, double* %199
%200 = load double, double* %11
%201 = fneg double %200
%202 = load double*, double** %7
%203 = load i64, i64* %9
%204 = getelementptr inbounds double, double* %202, i64 %203
store double %201, double* %204
%205 = load i64, i64* %9
%206 = add nsw i64 %205, 1
store i64 %206, i64* %9
%207 = load double*, double** %6
%208 = load i64, i64* %9
%209 = getelementptr inbounds double, double* %207, i64 %208
%210 = load double, double* %209
store double %210, double* %11
%211 = load double, double* %11
%212 = load double, double* %11
%213 = load double, double* %12
%214 = call double @llvm.fmuladd.f64(double %211, double %212, double %213)
store double %214, double* %12
%215 = load double, double* %11
%216 = load double*, double** %5
%217 = load i64, i64* %9
%218 = getelementptr inbounds double, double* %216, i64 %217
store double %215, double* %218
%219 = load double, double* %11
%220 = fneg double %219
%221 = load double*, double** %7
%222 = load i64, i64* %9
%223 = getelementptr inbounds double, double* %221, i64 %222
store double %220, double* %223
%224 = load i64, i64* %9
%225 = add nsw i64 %224, 1
store i64 %225, i64* %9
%226 = load double*, double** %6
%227 = load i64, i64* %9
%228 = getelementptr inbounds double, double* %226, i64 %227
%229 = load double, double* %228
store double %229, double* %11
%230 = load double, double* %11
%231 = load double, double* %11
%232 = load double, double* %12
%233 = call double @llvm.fmuladd.f64(double %230, double %231, double %232)
store double %233, double* %12
%234 = load double, double* %11
%235 = load double*, double** %5
%236 = load i64, i64* %9
%237 = getelementptr inbounds double, double* %235, i64 %236
store double %234, double* %237
%238 = load double, double* %11
%239 = fneg double %238
%240 = load double*, double** %7
%241 = load i64, i64* %9
%242 = getelementptr inbounds double, double* %240, i64 %241
store double %239, double* %242
%243 = load i64, i64* %9
%244 = add nsw i64 %243, 1
store i64 %244, i64* %9
br label %145
245: ; preds = %145
br label %350
246: ; preds = %115
store i64 0, i64* %9
br label %247
247: ; preds = %265, %246
%248 = load i64, i64* %9
%249 = load i64, i64* %10
%250 = icmp slt i64 %248, %249
br i1 %250, label %251, label %268
251: ; preds = %247
%252 = load double*, double** %6
%253 = load i64, i64* %9
%254 = getelementptr inbounds double, double* %252, i64 %253
%255 = load double, double* %254
store double %255, double* %11
%256 = load double, double* %11
%257 = load double, double* %11
%258 = load double, double* %12
%259 = call double @llvm.fmuladd.f64(double %256, double %257, double %258)
store double %259, double* %12
%260 = load double, double* %11
%261 = fneg double %260
%262 = load double*, double** %7
%263 = load i64, i64* %9
%264 = getelementptr inbounds double, double* %262, i64 %263
store double %261, double* %264
br label %265
265: ; preds = %251
%266 = load i64, i64* %9
%267 = add nsw i64 %266, 1
store i64 %267, i64* %9
br label %247
268: ; preds = %247
br label %269
269: ; preds = %273, %268
%270 = load i64, i64* %9
%271 = load i64, i64* %8
%272 = icmp slt i64 %270, %271
br i1 %272, label %273, label %349
273: ; preds = %269
%274 = load double*, double** %6
%275 = load i64, i64* %9
%276 = getelementptr inbounds double, double* %274, i64 %275
%277 = load double, double* %276
store double %277, double* %11
%278 = load double, double* %11
%279 = load double, double* %11
%280 = load double, double* %12
%281 = call double @llvm.fmuladd.f64(double %278, double %279, double %280)
store double %281, double* %12
%282 = load double, double* %11
%283 = fneg double %282
%284 = load double*, double** %7
%285 = load i64, i64* %9
%286 = getelementptr inbounds double, double* %284, i64 %285
store double %283, double* %286
%287 = load i64, i64* %9
%288 = add nsw i64 %287, 1
store i64 %288, i64* %9
%289 = load double*, double** %6
%290 = load i64, i64* %9
%291 = getelementptr inbounds double, double* %289, i64 %290
%292 = load double, double* %291
store double %292, double* %11
%293 = load double, double* %11
%294 = load double, double* %11
%295 = load double, double* %12
%296 = call double @llvm.fmuladd.f64(double %293, double %294, double %295)
store double %296, double* %12
%297 = load double, double* %11
%298 = fneg double %297
%299 = load double*, double** %7
%300 = load i64, i64* %9
%301 = getelementptr inbounds double, double* %299, i64 %300
store double %298, double* %301
%302 = load i64, i64* %9
%303 = add nsw i64 %302, 1
store i64 %303, i64* %9
%304 = load double*, double** %6
%305 = load i64, i64* %9
%306 = getelementptr inbounds double, double* %304, i64 %305
%307 = load double, double* %306
store double %307, double* %11
%308 = load double, double* %11
%309 = load double, double* %11
%310 = load double, double* %12
%311 = call double @llvm.fmuladd.f64(double %308, double %309, double %310)
store double %311, double* %12
%312 = load double, double* %11
%313 = fneg double %312
%314 = load double*, double** %7
%315 = load i64, i64* %9
%316 = getelementptr inbounds double, double* %314, i64 %315
store double %313, double* %316
%317 = load i64, i64* %9
%318 = add nsw i64 %317, 1
store i64 %318, i64* %9
%319 = load double*, double** %6
%320 = load i64, i64* %9
%321 = getelementptr inbounds double, double* %319, i64 %320
%322 = load double, double* %321
store double %322, double* %11
%323 = load double, double* %11
%324 = load double, double* %11
%325 = load double, double* %12
%326 = call double @llvm.fmuladd.f64(double %323, double %324, double %325)
store double %326, double* %12
%327 = load double, double* %11
%328 = fneg double %327
%329 = load double*, double** %7
%330 = load i64, i64* %9
%331 = getelementptr inbounds double, double* %329, i64 %330
store double %328, double* %331
%332 = load i64, i64* %9
%333 = add nsw i64 %332, 1
store i64 %333, i64* %9
%334 = load double*, double** %6
%335 = load i64, i64* %9
%336 = getelementptr inbounds double, double* %334, i64 %335
%337 = load double, double* %336
store double %337, double* %11
%338 = load double, double* %11
%339 = load double, double* %11
%340 = load double, double* %12
%341 = call double @llvm.fmuladd.f64(double %338, double %339, double %340)
store double %341, double* %12
%342 = load double, double* %11
%343 = fneg double %342
%344 = load double*, double** %7
%345 = load i64, i64* %9
%346 = getelementptr inbounds double, double* %344, i64 %345
store double %343, double* %346
%347 = load i64, i64* %9
%348 = add nsw i64 %347, 1
store i64 %348, i64* %9
br label %269
349: ; preds = %269
br label %350
350: ; preds = %349, %245
br label %351
351: ; preds = %350, %114
%352 = load double, double* %12
ret double %352
}

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