#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_inf2(double *gold, double *gnew, double *d, double *gnorm2,
                      long int n) {
  long int i, n5;
  double gnorm, s, t;
  gnorm = ((double)0);
  s = ((double)0);
  n5 = n % 5;
  for (i = 0; i < n5; i++) {
    t = gnew[i];
    if (gnorm < fabs(t))
      gnorm = fabs(t);
    s += t * t;
    gold[i] = t;
    d[i] = -t;
  }
  for (; i < n;) {
    t = gnew[i];
    if (gnorm < fabs(t))
      gnorm = fabs(t);
    s += t * t;
    gold[i] = t;
    d[i] = -t;
    i++;
    t = gnew[i];
    if (gnorm < fabs(t))
      gnorm = fabs(t);
    s += t * t;
    gold[i] = t;
    d[i] = -t;
    i++;
    t = gnew[i];
    if (gnorm < fabs(t))
      gnorm = fabs(t);
    s += t * t;
    gold[i] = t;
    d[i] = -t;
    i++;
    t = gnew[i];
    if (gnorm < fabs(t))
      gnorm = fabs(t);
    s += t * t;
    gold[i] = t;
    d[i] = -t;
    i++;
    t = gnew[i];
    if (gnorm < fabs(t))
      gnorm = fabs(t);
    s += t * t;
    gold[i] = t;
    d[i] = -t;
    i++;
  }
  *gnorm2 = s;
  return (gnorm);
}


x86 assembly (clang, -O0):
<cg_update_inf2>:
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,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%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    11fe <cg_update_inf2+0xfe>
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
movaps 0xe8d(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1196 <cg_update_inf2+0x96>
movsd  -0x50(%rbp),%xmm0
movaps 0xe73(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1142 <cg_update_inf2+0x42>
jmp    1203 <cg_update_inf2+0x103>
mov    -0x30(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1563 <cg_update_inf2+0x463>
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
movaps 0xdcc(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1257 <cg_update_inf2+0x157>
movsd  -0x50(%rbp),%xmm0
movaps 0xdb2(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
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,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
movaps 0xd23(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1300 <cg_update_inf2+0x200>
movsd  -0x50(%rbp),%xmm0
movaps 0xd09(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
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,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
movaps 0xc7a(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    13a9 <cg_update_inf2+0x2a9>
movsd  -0x50(%rbp),%xmm0
movaps 0xc60(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
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,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
movaps 0xbd1(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1452 <cg_update_inf2+0x352>
movsd  -0x50(%rbp),%xmm0
movaps 0xbb7(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
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,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
movaps 0xb28(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    14fb <cg_update_inf2+0x3fb>
movsd  -0x50(%rbp),%xmm0
movaps 0xb0e(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1203 <cg_update_inf2+0x103>
movsd  -0x48(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cg_update_inf2>:
mov    %rdx,%r9
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   %rax,%rax
jle    11ae <cg_update_inf2+0xae>
movsd  (%rsi),%xmm2
movapd 0xec5(%rip),%xmm0
andpd  %xmm2,%xmm0
xorpd  %xmm3,%xmm3
maxsd  %xmm3,%xmm0
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
movsd  %xmm2,(%rdi)
xorpd  0xeb1(%rip),%xmm2
movlpd %xmm2,(%r9)
cmp    $0x1,%rax
je     11b8 <cg_update_inf2+0xb8>
movsd  0x8(%rsi),%xmm3
movapd 0xe89(%rip),%xmm2
andpd  %xmm3,%xmm2
maxsd  %xmm0,%xmm2
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm0,%xmm1
movsd  %xmm3,0x8(%rdi)
xorpd  0xe78(%rip),%xmm3
movlpd %xmm3,0x8(%r9)
cmp    $0x2,%rax
jne    12da <cg_update_inf2+0x1da>
movapd %xmm2,%xmm0
jmp    11b8 <cg_update_inf2+0xb8>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
xorpd  %xmm1,%xmm1
cmp    %r8,%rax
jge    12d5 <cg_update_inf2+0x1d5>
movapd 0xe37(%rip),%xmm2
movapd 0xe3f(%rip),%xmm3
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rsi,%rax,8),%xmm4
movapd %xmm4,%xmm5
andpd  %xmm2,%xmm5
maxsd  %xmm0,%xmm5
movapd %xmm4,%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm4,(%rdi,%rax,8)
xorpd  %xmm3,%xmm4
movlpd %xmm4,(%r9,%rax,8)
movsd  0x8(%rsi,%rax,8),%xmm1
movapd %xmm1,%xmm4
andpd  %xmm2,%xmm4
maxsd  %xmm5,%xmm4
movapd %xmm1,%xmm5
mulsd  %xmm1,%xmm5
addsd  %xmm0,%xmm5
movsd  %xmm1,0x8(%rdi,%rax,8)
xorpd  %xmm3,%xmm1
movlpd %xmm1,0x8(%r9,%rax,8)
movsd  0x10(%rsi,%rax,8),%xmm0
movapd %xmm0,%xmm1
andpd  %xmm2,%xmm1
maxsd  %xmm4,%xmm1
movapd %xmm0,%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm5,%xmm4
movsd  %xmm0,0x10(%rdi,%rax,8)
xorpd  %xmm3,%xmm0
movlpd %xmm0,0x10(%r9,%rax,8)
movsd  0x18(%rsi,%rax,8),%xmm0
movapd %xmm0,%xmm5
andpd  %xmm2,%xmm5
maxsd  %xmm1,%xmm5
movapd %xmm0,%xmm6
mulsd  %xmm0,%xmm6
addsd  %xmm4,%xmm6
movsd  %xmm0,0x18(%rdi,%rax,8)
xorpd  %xmm3,%xmm0
movlpd %xmm0,0x18(%r9,%rax,8)
movsd  0x20(%rsi,%rax,8),%xmm4
movapd %xmm4,%xmm0
andpd  %xmm2,%xmm0
maxsd  %xmm5,%xmm0
movapd %xmm4,%xmm1
mulsd  %xmm4,%xmm1
addsd  %xmm6,%xmm1
movsd  %xmm4,0x20(%rdi,%rax,8)
xorpd  %xmm3,%xmm4
movlpd %xmm4,0x20(%r9,%rax,8)
add    $0x5,%rax
cmp    %r8,%rax
jl     11e0 <cg_update_inf2+0xe0>
movsd  %xmm1,(%rcx)
ret
movsd  0x10(%rsi),%xmm3
movapd 0xd19(%rip),%xmm0
andpd  %xmm3,%xmm0
maxsd  %xmm2,%xmm0
movapd %xmm3,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
movsd  %xmm3,0x10(%rdi)
xorpd  0xd08(%rip),%xmm3
movlpd %xmm3,0x10(%r9)
cmp    $0x3,%rax
je     11b8 <cg_update_inf2+0xb8>
movsd  0x18(%rsi),%xmm3
movapd 0xcdb(%rip),%xmm2
andpd  %xmm3,%xmm2
maxsd  %xmm0,%xmm2
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm0,%xmm1
movsd  %xmm3,0x18(%rdi)
xorpd  0xcca(%rip),%xmm3
movlpd %xmm3,0x18(%r9)
cmp    $0x4,%rax
je     11a8 <cg_update_inf2+0xa8>
movsd  0x20(%rsi),%xmm3
movapd 0xc9d(%rip),%xmm0
movapd %xmm3,%xmm4
andpd  %xmm0,%xmm4
maxsd  %xmm2,%xmm4
movapd %xmm3,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm3,0x20(%rdi)
movapd 0xc88(%rip),%xmm5
xorpd  %xmm5,%xmm3
movlpd %xmm3,0x20(%r9)
movsd  0x28(%rsi),%xmm1
movapd %xmm1,%xmm3
andpd  %xmm0,%xmm3
maxsd  %xmm4,%xmm3
movapd %xmm1,%xmm4
mulsd  %xmm1,%xmm4
addsd  %xmm2,%xmm4
movsd  %xmm1,0x28(%rdi)
xorpd  %xmm5,%xmm1
movlpd %xmm1,0x28(%r9)
movsd  0x30(%rsi),%xmm2
andpd  %xmm2,%xmm0
maxsd  %xmm3,%xmm0
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm4,%xmm1
movsd  %xmm2,0x30(%rdi)
xorpd  %xmm5,%xmm2
movlpd %xmm2,0x30(%r9)
jmp    11b8 <cg_update_inf2+0xb8>

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

LLVM IR (-O2):
define double @cg_update_inf2(double* nocapture writeonly %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, %21, %32, %43, %54, %5
%9 = phi i64 [ 0, %5 ], [ %6, %54 ], [ %6, %43 ], [ %6, %32 ], [ %6, %21 ], [ %6, %13 ]
%10 = phi double [ 0.000000e+00, %5 ], [ %17, %13 ], [ %26, %21 ], [ %37, %32 ], [ %48, %43 ], [ %77, %54 ]
%11 = phi double [ 0.000000e+00, %5 ], [ %18, %13 ], [ %27, %21 ], [ %38, %32 ], [ %49, %43 ], [ %78, %54 ]
%12 = icmp slt i64 %9, %4
br i1 %12, label %82, label %137
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 = tail call double @llvm.fmuladd.f64(double %14, double %14, double 0.000000e+00)
store double %14, double* %0
%19 = fneg double %14
store double %19, double* %2
%20 = icmp eq i64 %6, 1
br i1 %20, label %8, label %21
21: ; preds = %13
%22 = getelementptr inbounds double, double* %1, i64 1
%23 = load double, double* %22
%24 = tail call double @llvm.fabs.f64(double %23)
%25 = fcmp olt double %17, %24
%26 = select i1 %25, double %24, double %17
%27 = tail call double @llvm.fmuladd.f64(double %23, double %23, double %18)
%28 = getelementptr inbounds double, double* %0, i64 1
store double %23, double* %28
%29 = fneg double %23
%30 = getelementptr inbounds double, double* %2, i64 1
store double %29, double* %30
%31 = icmp eq i64 %6, 2
br i1 %31, label %8, label %32
32: ; preds = %21
%33 = getelementptr inbounds double, double* %1, i64 2
%34 = load double, double* %33
%35 = tail call double @llvm.fabs.f64(double %34)
%36 = fcmp olt double %26, %35
%37 = select i1 %36, double %35, double %26
%38 = tail call double @llvm.fmuladd.f64(double %34, double %34, double %27)
%39 = getelementptr inbounds double, double* %0, i64 2
store double %34, double* %39
%40 = fneg double %34
%41 = getelementptr inbounds double, double* %2, i64 2
store double %40, double* %41
%42 = icmp eq i64 %6, 3
br i1 %42, label %8, label %43
43: ; preds = %32
%44 = getelementptr inbounds double, double* %1, i64 3
%45 = load double, double* %44
%46 = tail call double @llvm.fabs.f64(double %45)
%47 = fcmp olt double %37, %46
%48 = select i1 %47, double %46, double %37
%49 = tail call double @llvm.fmuladd.f64(double %45, double %45, double %38)
%50 = getelementptr inbounds double, double* %0, i64 3
store double %45, double* %50
%51 = fneg double %45
%52 = getelementptr inbounds double, double* %2, i64 3
store double %51, double* %52
%53 = icmp eq i64 %6, 4
br i1 %53, label %8, label %54
54: ; preds = %43
%55 = getelementptr inbounds double, double* %1, i64 4
%56 = load double, double* %55
%57 = tail call double @llvm.fabs.f64(double %56)
%58 = fcmp olt double %48, %57
%59 = select i1 %58, double %57, double %48
%60 = tail call double @llvm.fmuladd.f64(double %56, double %56, double %49)
%61 = getelementptr inbounds double, double* %0, i64 4
store double %56, double* %61
%62 = fneg double %56
%63 = getelementptr inbounds double, double* %2, i64 4
store double %62, double* %63
%64 = getelementptr inbounds double, double* %1, i64 5
%65 = load double, double* %64
%66 = tail call double @llvm.fabs.f64(double %65)
%67 = fcmp olt double %59, %66
%68 = select i1 %67, double %66, double %59
%69 = tail call double @llvm.fmuladd.f64(double %65, double %65, double %60)
%70 = getelementptr inbounds double, double* %0, i64 5
store double %65, double* %70
%71 = fneg double %65
%72 = getelementptr inbounds double, double* %2, i64 5
store double %71, double* %72
%73 = getelementptr inbounds double, double* %1, i64 6
%74 = load double, double* %73
%75 = tail call double @llvm.fabs.f64(double %74)
%76 = fcmp olt double %68, %75
%77 = select i1 %76, double %75, double %68
%78 = tail call double @llvm.fmuladd.f64(double %74, double %74, double %69)
%79 = getelementptr inbounds double, double* %0, i64 6
store double %74, double* %79
%80 = fneg double %74
%81 = getelementptr inbounds double, double* %2, i64 6
store double %80, double* %81
br label %8
82: ; preds = %8, %82
%83 = phi double [ %131, %82 ], [ %11, %8 ]
%84 = phi double [ %130, %82 ], [ %10, %8 ]
%85 = phi i64 [ %135, %82 ], [ %9, %8 ]
%86 = getelementptr inbounds double, double* %1, i64 %85
%87 = load double, double* %86
%88 = tail call double @llvm.fabs.f64(double %87)
%89 = fcmp olt double %84, %88
%90 = select i1 %89, double %88, double %84
%91 = tail call double @llvm.fmuladd.f64(double %87, double %87, double %83)
%92 = getelementptr inbounds double, double* %0, i64 %85
store double %87, double* %92
%93 = fneg double %87
%94 = getelementptr inbounds double, double* %2, i64 %85
store double %93, double* %94
%95 = add nuw nsw i64 %85, 1
%96 = getelementptr inbounds double, double* %1, i64 %95
%97 = load double, double* %96
%98 = tail call double @llvm.fabs.f64(double %97)
%99 = fcmp olt double %90, %98
%100 = select i1 %99, double %98, double %90
%101 = tail call double @llvm.fmuladd.f64(double %97, double %97, double %91)
%102 = getelementptr inbounds double, double* %0, i64 %95
store double %97, double* %102
%103 = fneg double %97
%104 = getelementptr inbounds double, double* %2, i64 %95
store double %103, double* %104
%105 = add nuw nsw i64 %85, 2
%106 = getelementptr inbounds double, double* %1, i64 %105
%107 = load double, double* %106
%108 = tail call double @llvm.fabs.f64(double %107)
%109 = fcmp olt double %100, %108
%110 = select i1 %109, double %108, double %100
%111 = tail call double @llvm.fmuladd.f64(double %107, double %107, double %101)
%112 = getelementptr inbounds double, double* %0, i64 %105
store double %107, double* %112
%113 = fneg double %107
%114 = getelementptr inbounds double, double* %2, i64 %105
store double %113, double* %114
%115 = add nuw nsw i64 %85, 3
%116 = getelementptr inbounds double, double* %1, i64 %115
%117 = load double, double* %116
%118 = tail call double @llvm.fabs.f64(double %117)
%119 = fcmp olt double %110, %118
%120 = select i1 %119, double %118, double %110
%121 = tail call double @llvm.fmuladd.f64(double %117, double %117, double %111)
%122 = getelementptr inbounds double, double* %0, i64 %115
store double %117, double* %122
%123 = fneg double %117
%124 = getelementptr inbounds double, double* %2, i64 %115
store double %123, double* %124
%125 = add nuw nsw i64 %85, 4
%126 = getelementptr inbounds double, double* %1, i64 %125
%127 = load double, double* %126
%128 = tail call double @llvm.fabs.f64(double %127)
%129 = fcmp olt double %120, %128
%130 = select i1 %129, double %128, double %120
%131 = tail call double @llvm.fmuladd.f64(double %127, double %127, double %121)
%132 = getelementptr inbounds double, double* %0, i64 %125
store double %127, double* %132
%133 = fneg double %127
%134 = getelementptr inbounds double, double* %2, i64 %125
store double %133, double* %134
%135 = add nuw nsw i64 %85, 5
%136 = icmp slt i64 %135, %4
br i1 %136, label %82, label %137
137: ; preds = %82, %8
%138 = phi double [ %10, %8 ], [ %130, %82 ]
%139 = phi double [ %11, %8 ], [ %131, %82 ]
store double %139, double* %3
ret double %138
}