#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 sample_quad(double, double, double, double, double, double, double,
                   double, double);
double sample_quad_rw(double, double, double, double, double, double, double,
                      double, double);
void update_sparse(double *X, double *C, double *b, size_t n, size_t *I,
                   size_t *J, size_t n_idx) {
  size_t i;
  size_t k, l;
  double xkl, xkl_new;
  for (i = 0; i < n_idx; i++) {
    k = I[i];
    l = J[i];
    if (k != l) {
      if ((C[n * k + l] + C[n * l + k]) > 0) {
        xkl = X[n * k + l];
        xkl_new =
            sample_quad(X[n * k + l], X[n * k + k], X[n * l + l], C[n * k + l],
                        C[n * l + k], C[n * k + k], C[n * l + l], b[k], b[l]);
        X[n * k + l] = xkl_new;
        X[n * k + k] += (xkl - xkl_new);
        X[n * l + k] = xkl_new;
        X[n * l + l] += (xkl - xkl_new);
        xkl = X[n * k + l];
        xkl_new = sample_quad_rw(X[n * k + l], X[n * k + k], X[n * l + l],
                                 C[n * k + l], C[n * l + k], C[n * k + k],
                                 C[n * l + l], b[k], b[l]);
        X[n * k + l] = xkl_new;
        X[n * k + k] += (xkl - xkl_new);
        X[n * l + k] = xkl_new;
        X[n * l + l] += (xkl - xkl_new);
      }
    }
  }
}


x86 assembly (clang, -O0):
<update_sparse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    0x10(%rbp),%rax
jae    149c <update_sparse+0x37c>
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x48(%rbp),%rax
je     1486 <update_sparse+0x366>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x40(%rbp),%rcx
add    -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x48(%rbp),%rcx
add    -0x40(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1481 <update_sparse+0x361>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x40(%rbp),%rcx
add    -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x40(%rbp),%rcx
add    -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x40(%rbp),%rcx
add    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x48(%rbp),%rcx
add    -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x40(%rbp),%rcx
add    -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x48(%rbp),%rcx
add    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm4
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x40(%rbp),%rcx
add    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm5
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x48(%rbp),%rcx
add    -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm6
mov    -0x18(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm7
mov    -0x18(%rbp),%rax
mov    -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm8
movsd  %xmm8,(%rsp)
call   1030 <sample_quad@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x40(%rbp),%rcx
add    -0x48(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x40(%rbp),%rcx
add    -0x40(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x58(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x48(%rbp),%rcx
add    -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x48(%rbp),%rcx
add    -0x48(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x40(%rbp),%rcx
add    -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x40(%rbp),%rcx
add    -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x40(%rbp),%rcx
add    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x48(%rbp),%rcx
add    -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x40(%rbp),%rcx
add    -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x48(%rbp),%rcx
add    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm4
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x40(%rbp),%rcx
add    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm5
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x48(%rbp),%rcx
add    -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm6
mov    -0x18(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm7
mov    -0x18(%rbp),%rax
mov    -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm8
movsd  %xmm8,(%rsp)
call   1040 <sample_quad_rw@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x40(%rbp),%rcx
add    -0x48(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x40(%rbp),%rcx
add    -0x40(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x58(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x48(%rbp),%rcx
add    -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x48(%rbp),%rcx
add    -0x48(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1486 <update_sparse+0x366>
jmp    148b <update_sparse+0x36b>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    114c <update_sparse+0x2c>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_sparse>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rdx,0x18(%rsp)
mov    0x80(%rsp),%rax
test   %rax,%rax
je     1306 <update_sparse+0x1e6>
mov    %rdi,%rbp
xor    %r14d,%r14d
xorpd  %xmm1,%xmm1
mov    %r9,0x40(%rsp)
mov    %r8,0x38(%rsp)
mov    %rcx,0x30(%rsp)
mov    %rsi,0x8(%rsp)
jmp    117d <update_sparse+0x5d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r14
cmp    %r14,%rax
je     1306 <update_sparse+0x1e6>
mov    (%r8,%r14,8),%rbx
mov    (%r9,%r14,8),%r12
cmp    %r12,%rbx
je     1170 <update_sparse+0x50>
mov    %rbx,%r15
imul   %rcx,%r15
lea    (%r15,%r12,1),%rdi
movsd  (%rsi,%rdi,8),%xmm3
mov    %r12,%r13
imul   %rcx,%r13
lea    (%rbx,%r13,1),%rdx
movsd  (%rsi,%rdx,8),%xmm4
movapd %xmm3,%xmm0
addsd  %xmm4,%xmm0
ucomisd %xmm1,%xmm0
jbe    1170 <update_sparse+0x50>
movsd  0x0(%rbp,%rdi,8),%xmm0
movsd  %xmm0,0x10(%rsp)
add    %rbx,%r15
movsd  0x0(%rbp,%r15,8),%xmm1
add    %r12,%r13
movsd  0x0(%rbp,%r13,8),%xmm2
movsd  (%rsi,%r15,8),%xmm5
movsd  (%rsi,%r13,8),%xmm6
mov    0x18(%rsp),%rax
movsd  (%rax,%rbx,8),%xmm7
movsd  (%rax,%r12,8),%xmm8
movsd  %xmm8,(%rsp)
mov    %rdx,0x28(%rsp)
mov    %rdi,0x20(%rsp)
call   1030 <sample_quad@plt>
mov    0x20(%rsp),%rdx
movsd  %xmm0,0x0(%rbp,%rdx,8)
movsd  0x10(%rsp),%xmm2
subsd  %xmm0,%xmm2
movsd  0x0(%rbp,%r15,8),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x0(%rbp,%r15,8)
mov    0x28(%rsp),%rcx
movsd  %xmm0,0x0(%rbp,%rcx,8)
addsd  0x0(%rbp,%r13,8),%xmm2
movsd  %xmm2,0x0(%rbp,%r13,8)
movsd  0x0(%rbp,%rdx,8),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x0(%rbp,%r15,8),%xmm1
mov    0x8(%rsp),%rax
movsd  (%rax,%rdx,8),%xmm3
mov    0x8(%rsp),%rax
movsd  (%rax,%rcx,8),%xmm4
mov    0x8(%rsp),%rax
movsd  (%rax,%r15,8),%xmm5
mov    0x8(%rsp),%rax
movsd  (%rax,%r13,8),%xmm6
mov    0x18(%rsp),%rax
movsd  (%rax,%rbx,8),%xmm7
movsd  (%rax,%r12,8),%xmm8
movsd  %xmm8,(%rsp)
call   1040 <sample_quad_rw@plt>
mov    0x80(%rsp),%rax
mov    0x8(%rsp),%rsi
mov    0x30(%rsp),%rcx
mov    0x38(%rsp),%r8
mov    0x40(%rsp),%r9
mov    0x20(%rsp),%rdx
movsd  %xmm0,0x0(%rbp,%rdx,8)
movsd  0x10(%rsp),%xmm2
subsd  %xmm0,%xmm2
movsd  0x0(%rbp,%r15,8),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x0(%rbp,%r15,8)
xorpd  %xmm1,%xmm1
mov    0x28(%rsp),%rdx
movsd  %xmm0,0x0(%rbp,%rdx,8)
addsd  0x0(%rbp,%r13,8),%xmm2
movsd  %xmm2,0x0(%rbp,%r13,8)
jmp    1170 <update_sparse+0x50>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @update_sparse(double* nocapture %0, double* nocapture %1, double* nocapture %2, i64 %3, i64* nocapture %4, i64* nocapture %5, i64 %6) {
%8 = icmp eq i64 %6, 0
br i1 %8, label %68, label %9
9: ; preds = %7, %65
%10 = phi i64 [ %66, %65 ], [ 0, %7 ]
%11 = getelementptr inbounds i64, i64* %4, i64 %10
%12 = load i64, i64* %11
%13 = getelementptr inbounds i64, i64* %5, i64 %10
%14 = load i64, i64* %13
%15 = icmp eq i64 %12, %14
br i1 %15, label %65, label %16
16: ; preds = %9
%17 = mul i64 %12, %3
%18 = add i64 %17, %14
%19 = getelementptr inbounds double, double* %1, i64 %18
%20 = load double, double* %19
%21 = mul i64 %14, %3
%22 = add i64 %21, %12
%23 = getelementptr inbounds double, double* %1, i64 %22
%24 = load double, double* %23
%25 = fadd double %20, %24
%26 = fcmp ogt double %25, 0.000000e+00
br i1 %26, label %27, label %65
27: ; preds = %16
%28 = getelementptr inbounds double, double* %0, i64 %18
%29 = load double, double* %28
%30 = add i64 %17, %12
%31 = getelementptr inbounds double, double* %0, i64 %30
%32 = load double, double* %31
%33 = add i64 %21, %14
%34 = getelementptr inbounds double, double* %0, i64 %33
%35 = load double, double* %34
%36 = getelementptr inbounds double, double* %1, i64 %30
%37 = load double, double* %36
%38 = getelementptr inbounds double, double* %1, i64 %33
%39 = load double, double* %38
%40 = getelementptr inbounds double, double* %2, i64 %12
%41 = load double, double* %40
%42 = getelementptr inbounds double, double* %2, i64 %14
%43 = load double, double* %42
%44 = tail call double @sample_quad(double %29, double %32, double %35, double %20, double %24, double %37, double %39, double %41, double %43)
store double %44, double* %28
%45 = fsub double %29, %44
%46 = load double, double* %31
%47 = fadd double %45, %46
store double %47, double* %31
%48 = getelementptr inbounds double, double* %0, i64 %22
store double %44, double* %48
%49 = load double, double* %34
%50 = fadd double %45, %49
store double %50, double* %34
%51 = load double, double* %28
%52 = load double, double* %31
%53 = load double, double* %19
%54 = load double, double* %23
%55 = load double, double* %36
%56 = load double, double* %38
%57 = load double, double* %40
%58 = load double, double* %42
%59 = tail call double @sample_quad_rw(double %51, double %52, double %50, double %53, double %54, double %55, double %56, double %57, double %58)
store double %59, double* %28
%60 = fsub double %51, %59
%61 = load double, double* %31
%62 = fadd double %60, %61
store double %62, double* %31
store double %59, double* %48
%63 = load double, double* %34
%64 = fadd double %60, %63
store double %64, double* %34
br label %65
65: ; preds = %9, %27, %16
%66 = add nuw i64 %10, 1
%67 = icmp eq i64 %66, %6
br i1 %67, label %68, label %9
68: ; preds = %65, %7
ret void
}