#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 */
int /*<<< orphan*/ dcopy_(int, double *, double *);
double ddot_(int, double *, double *);
int matupd_(int n, int m, double *ws, double *wy, double *sy, double *ss,
            double *d, double *r, int *itail, int iupdat, int *col, int *head,
            double *theta, double rr, double dr, double stp, double dtd) {
  int ws_offset, wy_offset, sy_offset, ss_offset, i1, i2;
  int j, pointr;
  --r;
  --d;
  ss_offset = 1 + m;
  ss -= ss_offset;
  sy_offset = 1 + m;
  sy -= sy_offset;
  wy_offset = 1 + n;
  wy -= wy_offset;
  ws_offset = 1 + n;
  ws -= ws_offset;
  if (iupdat <= m) {
    *col = iupdat;
    *itail = (*head + iupdat - 2) % m + 1;
  } else {
    *itail = *itail % m + 1;
    *head = *head % m + 1;
  }
  dcopy_(n, &d[1], &ws[*itail * n + 1]);
  dcopy_(n, &r[1], &wy[*itail * n + 1]);
  *theta = rr / dr;
  if (iupdat > m) {
    i1 = *col - 1;
    for (j = 1; j <= i1; ++j) {
      dcopy_(j, &ss[(j + 1) * m + 2], &ss[j * m + 1]);
      i2 = *col - j;
      dcopy_(i2, &sy[j + 1 + (j + 1) * m], &sy[j + j * m]);
    }
  }
  pointr = *head;
  i1 = *col - 1;
  for (j = 1; j <= i1; ++j) {
    sy[*col + j * m] = ddot_(n, &d[1], &wy[pointr * n + 1]);
    ss[j + *col * m] = ddot_(n, &ws[pointr * n + 1], &d[1]);
    pointr = pointr % m + 1;
  }
  if (stp == 1.) {
    ss[*col + *col * m] = dtd;
  } else {
    ss[*col + *col * m] = stp * stp * dtd;
  }
  sy[*col + *col * m] = dr;
  return 0;
}


x86 assembly (clang, -O0):
<matupd_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movsd  %xmm0,-0x30(%rbp)
movsd  %xmm1,-0x38(%rbp)
movsd  %xmm2,-0x40(%rbp)
movsd  %xmm3,-0x48(%rbp)
mov    0x18(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,0x18(%rbp)
mov    0x10(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    0x28(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1244 <matupd_+0x124>
mov    0x28(%rbp),%ecx
mov    0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    0x38(%rbp),%rax
mov    (%rax),%eax
add    0x28(%rbp),%eax
sub    $0x2,%eax
cltd
idivl  -0x8(%rbp)
add    $0x1,%edx
mov    0x20(%rbp),%rax
mov    %edx,(%rax)
jmp    126a <matupd_+0x14a>
mov    0x20(%rbp),%rax
mov    (%rax),%eax
cltd
idivl  -0x8(%rbp)
add    $0x1,%edx
mov    0x20(%rbp),%rax
mov    %edx,(%rax)
mov    0x38(%rbp),%rax
mov    (%rax),%eax
cltd
idivl  -0x8(%rbp)
add    $0x1,%edx
mov    0x38(%rbp),%rax
mov    %edx,(%rax)
mov    -0x4(%rbp),%edi
mov    0x10(%rbp),%rsi
add    $0x8,%rsi
mov    -0x10(%rbp),%rdx
mov    0x20(%rbp),%rax
mov    (%rax),%eax
imul   -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
call   1030 <dcopy_@plt>
mov    -0x4(%rbp),%edi
mov    0x18(%rbp),%rsi
add    $0x8,%rsi
mov    -0x18(%rbp),%rdx
mov    0x20(%rbp),%rax
mov    (%rax),%eax
imul   -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
call   1030 <dcopy_@plt>
movsd  -0x30(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
mov    0x40(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x28(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1393 <matupd_+0x273>
mov    0x30(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x5c(%rbp)
movl   $0x1,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x5c(%rbp),%eax
jg     138e <matupd_+0x26e>
mov    -0x64(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x64(%rbp),%eax
add    $0x1,%eax
imul   -0x8(%rbp),%eax
add    $0x2,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x28(%rbp),%rdx
mov    -0x64(%rbp),%eax
imul   -0x8(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
call   1030 <dcopy_@plt>
mov    0x30(%rbp),%rax
mov    (%rax),%eax
sub    -0x64(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x60(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    -0x64(%rbp),%ecx
add    $0x1,%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x20(%rbp),%rdx
mov    -0x64(%rbp),%eax
mov    -0x64(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
call   1030 <dcopy_@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    12ef <matupd_+0x1cf>
jmp    1393 <matupd_+0x273>
mov    0x38(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x68(%rbp)
mov    0x30(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x5c(%rbp)
movl   $0x1,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x5c(%rbp),%eax
jg     145a <matupd_+0x33a>
mov    -0x4(%rbp),%edi
mov    0x10(%rbp),%rsi
add    $0x8,%rsi
mov    -0x18(%rbp),%rdx
mov    -0x68(%rbp),%eax
imul   -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
call   1040 <ddot_@plt>
mov    -0x20(%rbp),%rax
mov    0x30(%rbp),%rcx
mov    (%rcx),%ecx
mov    -0x64(%rbp),%edx
imul   -0x8(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x68(%rbp),%eax
imul   -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    0x10(%rbp),%rdx
add    $0x8,%rdx
call   1040 <ddot_@plt>
mov    -0x28(%rbp),%rax
mov    -0x64(%rbp),%ecx
mov    0x30(%rbp),%rdx
mov    (%rdx),%edx
imul   -0x8(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%eax
cltd
idivl  -0x8(%rbp)
add    $0x1,%edx
mov    %edx,-0x68(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    13af <matupd_+0x28f>
movsd  -0x40(%rbp),%xmm0
movsd  0xb99(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    149f <matupd_+0x37f>
jp     149f <matupd_+0x37f>
movsd  -0x48(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    0x30(%rbp),%rcx
mov    (%rcx),%ecx
mov    0x30(%rbp),%rdx
mov    (%rdx),%edx
imul   -0x8(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    14cc <matupd_+0x3ac>
movsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    0x30(%rbp),%rcx
mov    (%rcx),%ecx
mov    0x30(%rbp),%rdx
mov    (%rdx),%edx
imul   -0x8(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mov    0x30(%rbp),%rcx
mov    (%rcx),%ecx
mov    0x30(%rbp),%rdx
mov    (%rdx),%edx
imul   -0x8(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matupd_>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
movsd  %xmm3,0x40(%rsp)
movaps %xmm2,0x60(%rsp)
movsd  %xmm1,0x28(%rsp)
movsd  %xmm0,(%rsp)
mov    %esi,%ebp
mov    %edi,%ebx
mov    0xd8(%rsp),%r10
mov    0xd0(%rsp),%rsi
mov    0xc8(%rsp),%r15d
mov    0xc0(%rsp),%r12
mov    0xb8(%rsp),%r13
mov    %ebp,%eax
not    %eax
movslq %eax,%r14
mov    %edi,%eax
not    %eax
cltq
lea    (%rcx,%rax,8),%rcx
lea    (%rdx,%rax,8),%rdi
cmp    %ebp,%r15d
mov    %rcx,0x30(%rsp)
jle    11af <matupd_+0x8f>
mov    (%r12),%eax
cltd
idiv   %ebp
add    $0x1,%edx
mov    %edx,(%r12)
mov    (%r10),%eax
cltd
idiv   %ebp
add    $0x1,%edx
mov    %edx,(%r10)
mov    (%r12),%edx
jmp    11c5 <matupd_+0xa5>
mov    %r15d,(%rsi)
mov    (%r10),%eax
add    %r15d,%eax
add    $0xfffffffe,%eax
cltd
idiv   %ebp
add    $0x1,%edx
mov    %edx,(%r12)
mov    %r9,0x38(%rsp)
lea    (%r9,%r14,8),%rax
mov    %rax,0x10(%rsp)
lea    (%r8,%r14,8),%rax
mov    %rax,0x18(%rsp)
imul   %ebx,%edx
movslq %edx,%rax
mov    %rdi,0x58(%rsp)
lea    (%rdi,%rax,8),%rdx
add    $0x8,%rdx
mov    %ebx,%edi
mov    0xb0(%rsp),%rsi
call   1030 <dcopy_@plt>
movslq (%r12),%rax
movslq %ebx,%rcx
imul   %rax,%rcx
mov    0x30(%rsp),%rax
lea    (%rax,%rcx,8),%rdx
add    $0x8,%rdx
mov    %ebx,0x24(%rsp)
mov    %ebx,%edi
mov    %r13,%rsi
call   1030 <dcopy_@plt>
movsd  (%rsp),%xmm0
divsd  0x28(%rsp),%xmm0
mov    0xe0(%rsp),%rax
movsd  %xmm0,(%rax)
cmp    %ebp,%r15d
mov    %rbp,0x8(%rsp)
jle    1322 <matupd_+0x202>
mov    0x8(%rsp),%r13
mov    0xd0(%rsp),%rax
mov    (%rax),%esi
cmp    $0x2,%esi
jl     13f5 <matupd_+0x2d5>
mov    %r13,%rdx
movslq %edx,%rdi
lea    (%rdi,%r14,1),%rax
mov    0x38(%rsp),%rcx
lea    (%rcx,%rax,8),%r15
add    $0x8,%r15
add    %r13d,%r13d
lea    (%r14,%rdi,2),%rax
shl    $0x3,%rdi
mov    %rdi,0x48(%rsp)
lea    (%rcx,%rax,8),%rbx
add    $0x10,%rbx
mov    $0x1,%ebp
mov    $0xffffffff,%r12d
mov    %edx,%r14d
mov    %rsi,0x50(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movslq %r14d,%r14
movslq %r13d,%r13
lea    0x1(%rbp),%rax
mov    %rax,(%rsp)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <dcopy_@plt>
mov    0xd0(%rsp),%rax
mov    (%rax),%edi
add    %r12d,%edi
mov    %rbp,%rax
add    %r13,%rax
mov    0x18(%rsp),%rcx
lea    (%rcx,%rax,8),%rsi
add    $0x8,%rsi
add    %r14,%rbp
lea    (%rcx,%rbp,8),%rdx
call   1030 <dcopy_@plt>
mov    0x50(%rsp),%rsi
add    $0xffffffff,%r12d
mov    0x8(%rsp),%rax
add    %eax,%r14d
mov    0x48(%rsp),%rcx
add    %rcx,%r15
add    %eax,%r13d
add    %rcx,%rbx
mov    (%rsp),%rax
mov    %rax,%rbp
cmp    %rax,%rsi
jne    12b0 <matupd_+0x190>
mov    0x8(%rsp),%r13
mov    0xd0(%rsp),%rax
mov    (%rax),%esi
cmp    $0x2,%esi
jl     13f5 <matupd_+0x2d5>
mov    0xd8(%rsp),%rcx
mov    (%rcx),%ebx
mov    $0x1,%ebp
mov    %esi,%ecx
mov    %esi,(%rsp)
mov    %r13d,%r12d
mov    0x24(%rsp),%r13d
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%eax
imul   %r13d,%eax
movslq %eax,%r14
mov    0x30(%rsp),%rax
lea    (%rax,%r14,8),%rdx
add    $0x8,%rdx
mov    %r13d,%edi
mov    0xb0(%rsp),%rsi
call   1040 <ddot_@plt>
mov    0xd0(%rsp),%r15
mov    (%r15),%eax
add    %r12d,%eax
cltq
mov    0x18(%rsp),%rcx
movsd  %xmm0,(%rcx,%rax,8)
mov    0x58(%rsp),%rax
lea    (%rax,%r14,8),%rsi
add    $0x8,%rsi
mov    %r13d,%edi
mov    0xb0(%rsp),%rdx
call   1040 <ddot_@plt>
mov    0x10(%rsp),%rcx
mov    (%r15),%esi
mov    %esi,%eax
mov    0x8(%rsp),%rdi
imul   %edi,%eax
cltq
add    %rbp,%rax
movsd  %xmm0,(%rcx,%rax,8)
mov    %ebx,%eax
cltd
idiv   %edi
mov    %edx,%ebx
add    $0x1,%ebx
add    $0x1,%rbp
add    %edi,%r12d
cmp    %ebp,(%rsp)
jne    1360 <matupd_+0x240>
jmp    13fa <matupd_+0x2da>
mov    0x10(%rsp),%rcx
movapd 0x60(%rsp),%xmm2
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
movsd  0xbf0(%rip),%xmm1
cmpeqsd %xmm1,%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
mulsd  0x40(%rsp),%xmm2
mov    0x8(%rsp),%rax
imul   %esi,%eax
add    %esi,%eax
cltq
movsd  %xmm2,(%rcx,%rax,8)
movsd  0x28(%rsp),%xmm0
mov    0x18(%rsp),%rcx
movsd  %xmm0,(%rcx,%rax,8)
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @matupd_(i32 %0, i32 %1, double* %2, double* %3, double* %4, double* %5, double* %6, double* %7, i32* nocapture %8, i32 %9, i32* nocapture %10, i32* nocapture %11, double* nocapture writeonly %12, double %13, double %14, double %15, double %16) {
%18 = xor i32 %1, -1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double, double* %5, i64 %19
%21 = getelementptr inbounds double, double* %4, i64 %19
%22 = xor i32 %0, -1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %3, i64 %23
%25 = getelementptr inbounds double, double* %2, i64 %23
%26 = icmp sgt i32 %9, %1
br i1 %26, label %33, label %27
27: ; preds = %17
store i32 %9, i32* %10
%28 = load i32, i32* %11
%29 = add i32 %9, -2
%30 = add i32 %29, %28
%31 = srem i32 %30, %1
%32 = add nsw i32 %31, 1
store i32 %32, i32* %8
br label %41
33: ; preds = %17
%34 = load i32, i32* %8
%35 = srem i32 %34, %1
%36 = add nsw i32 %35, 1
store i32 %36, i32* %8
%37 = load i32, i32* %11
%38 = srem i32 %37, %1
%39 = add nsw i32 %38, 1
store i32 %39, i32* %11
%40 = load i32, i32* %8
br label %41
41: ; preds = %33, %27
%42 = phi i32 [ %40, %33 ], [ %32, %27 ]
%43 = mul nsw i32 %42, %0
%44 = add nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %25, i64 %45
%47 = tail call i32 @dcopy_(i32 %0, double* %6, double* %46)
%48 = load i32, i32* %8
%49 = mul nsw i32 %48, %0
%50 = add nsw i32 %49, 1
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %24, i64 %51
%53 = tail call i32 @dcopy_(i32 %0, double* %7, double* %52)
%54 = fdiv double %13, %14
store double %54, double* %12
br i1 %26, label %55, label %85
55: ; preds = %41
%56 = load i32, i32* %10
%57 = icmp sgt i32 %56, 1
br i1 %57, label %58, label %114
58: ; preds = %55
%59 = sext i32 %1 to i64
%60 = zext i32 %56 to i64
br label %61
61: ; preds = %58, %61
%62 = phi i64 [ 1, %58 ], [ %64, %61 ]
%63 = trunc i64 %62 to i32
%64 = add nuw nsw i64 %62, 1
%65 = trunc i64 %64 to i32
%66 = mul nsw i64 %64, %59
%67 = mul nsw i32 %65, %1
%68 = add nsw i64 %66, 2
%69 = getelementptr inbounds double, double* %20, i64 %68
%70 = mul nsw i64 %62, %59
%71 = mul nsw i32 %63, %1
%72 = add nsw i64 %70, 1
%73 = getelementptr inbounds double, double* %20, i64 %72
%74 = tail call i32 @dcopy_(i32 %63, double* %69, double* %73)
%75 = load i32, i32* %10
%76 = sub nsw i32 %75, %63
%77 = sext i32 %67 to i64
%78 = add nsw i64 %64, %77
%79 = getelementptr inbounds double, double* %21, i64 %78
%80 = sext i32 %71 to i64
%81 = add nsw i64 %62, %80
%82 = getelementptr inbounds double, double* %21, i64 %81
%83 = tail call i32 @dcopy_(i32 %76, double* %79, double* %82)
%84 = icmp eq i64 %64, %60
br i1 %84, label %85, label %61
85: ; preds = %61, %41
%86 = load i32, i32* %10
%87 = icmp sgt i32 %86, 1
br i1 %87, label %88, label %114
88: ; preds = %85
%89 = load i32, i32* %11
br label %90
90: ; preds = %88, %90
%91 = phi i32 [ %111, %90 ], [ %89, %88 ]
%92 = phi i32 [ %112, %90 ], [ 1, %88 ]
%93 = mul nsw i32 %91, %0
%94 = add nsw i32 %93, 1
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds double, double* %24, i64 %95
%97 = tail call double @ddot_(i32 %0, double* %6, double* %96)
%98 = load i32, i32* %10
%99 = mul nsw i32 %92, %1
%100 = add nsw i32 %98, %99
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds double, double* %21, i64 %101
store double %97, double* %102
%103 = getelementptr inbounds double, double* %25, i64 %95
%104 = tail call double @ddot_(i32 %0, double* %103, double* %6)
%105 = load i32, i32* %10
%106 = mul nsw i32 %105, %1
%107 = add nsw i32 %106, %92
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %20, i64 %108
store double %104, double* %109
%110 = srem i32 %91, %1
%111 = add nsw i32 %110, 1
%112 = add nuw nsw i32 %92, 1
%113 = icmp eq i32 %112, %86
br i1 %113, label %114, label %90
114: ; preds = %90, %55, %85
%115 = phi i32 [ %86, %85 ], [ %56, %55 ], [ %105, %90 ]
%116 = fcmp oeq double %15, 1.000000e+00
%117 = fmul double %15, %15
%118 = select i1 %116, double 1.000000e+00, double %117
%119 = fmul double %118, %16
%120 = mul nsw i32 %115, %1
%121 = add nsw i32 %120, %115
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds double, double* %20, i64 %122
store double %119, double* %123
%124 = getelementptr inbounds double, double* %21, i64 %122
store double %14, double* %124
ret i32 0
}