#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*/ dtrsl_(double *, int, int, double *, int, int *);
double sqrt(double);
int bmv_(int m, double *sy, double *wt, int col, double *v, double *p,
         int *info) {
  int sy_offset, wt_offset;
  int i, k, icol;
  double sum;
  wt_offset = 1 + m;
  wt -= wt_offset;
  sy_offset = 1 + m;
  sy -= sy_offset;
  --p;
  --v;
  if (col == 0) {
    return 0;
  }
  p[col + 1] = v[col + 1];
  for (i = 2; i <= col; ++i) {
    icol = col + i;
    sum = 0.0;
    for (k = 1; k < i; ++k) {
      sum += sy[i + k * m] * v[k] / sy[k + k * m];
    }
    p[icol] = v[icol] + sum;
  }
  dtrsl_(&wt[wt_offset], m, col, &p[col + 1], 1, info);
  if (*info != 0) {
    return 0;
  }
  for (i = 1; i <= col; ++i) {
    p[i] = v[i] / sqrt(sy[i + i * m]);
  }
  dtrsl_(&wt[wt_offset], m, col, &p[col + 1], 0, info);
  if (*info != 0) {
    return 0;
  }
  for (i = 1; i <= col; ++i) {
    p[i] = -p[i] / sqrt(sy[i + i * m]);
  }
  for (i = 1; i <= col; ++i) {
    sum = 0.0;
    for (k = i + 1; k <= col; ++k) {
      sum += sy[k + i * m] * p[col + k] / sy[i + i * m];
    }
    p[i] += sum;
  }
  return 0;
}


x86 assembly (clang, -O0):
<bmv_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%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    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%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    -0x30(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    11b6 <bmv_+0x96>
movl   $0x0,-0x4(%rbp)
jmp    14cf <bmv_+0x3af>
mov    -0x28(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x2,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1293 <bmv_+0x173>
mov    -0x1c(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x44(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x1,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    1266 <bmv_+0x146>
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
mov    -0x40(%rbp),%edx
imul   -0x8(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x40(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%ecx
mov    -0x40(%rbp),%edx
imul   -0x8(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
divsd  (%rax,%rcx,8),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1205 <bmv_+0xe5>
mov    -0x28(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x50(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11e1 <bmv_+0xc1>
mov    -0x18(%rbp),%rdi
movslq -0x38(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x30(%rbp),%rcx
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rcx
mov    0x10(%rbp),%r9
mov    $0x1,%r8d
call   1030 <dtrsl_@plt>
mov    0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     12e3 <bmv_+0x1c3>
movl   $0x0,-0x4(%rbp)
jmp    14cf <bmv_+0x3af>
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     134c <bmv_+0x22c>
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
mov    -0x3c(%rbp),%edx
imul   -0x8(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
divsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12ea <bmv_+0x1ca>
mov    -0x18(%rbp),%rdi
movslq -0x38(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x30(%rbp),%rcx
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rcx
mov    0x10(%rbp),%r9
xor    %r8d,%r8d
call   1030 <dtrsl_@plt>
mov    0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     1399 <bmv_+0x279>
movl   $0x0,-0x4(%rbp)
jmp    14cf <bmv_+0x3af>
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1419 <bmv_+0x2f9>
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
mov    -0x3c(%rbp),%edx
imul   -0x8(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
divsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    13a0 <bmv_+0x280>
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     14c8 <bmv_+0x3a8>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     14a3 <bmv_+0x383>
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%ecx
mov    -0x3c(%rbp),%edx
imul   -0x8(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
mov    -0x3c(%rbp),%edx
imul   -0x8(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
divsd  (%rax,%rcx,8),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    143d <bmv_+0x31d>
movsd  -0x50(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1420 <bmv_+0x300>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmv_>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rsi,0x30(%rsp)
mov    %rcx,(%rsp)
test   %ecx,%ecx
je     1278 <bmv_+0x158>
mov    %r8,%r12
mov    %edi,%r14d
mov    %rdx,0x58(%rsp)
mov    %edi,%eax
not    %eax
movslq %eax,%rcx
mov    0x30(%rsp),%rax
mov    %rcx,0x48(%rsp)
lea    (%rax,%rcx,8),%r13
mov    %r9,0x8(%rsp)
lea    -0x8(%r9),%rcx
mov    (%rsp),%rdx
lea    0x1(%rdx),%eax
mov    %eax,0x20(%rsp)
cltq
movsd  -0x8(%r8,%rax,8),%xmm0
lea    (%rcx,%rax,8),%rsi
mov    %rsi,0x50(%rsp)
mov    %rcx,0x18(%rsp)
movsd  %xmm0,(%rcx,%rax,8)
cmp    $0x2,%edx
jl     1245 <bmv_+0x125>
movslq %r14d,%r15
mov    %edx,%r8d
mov    0x20(%rsp),%r9d
mov    0x48(%rsp),%rax
lea    (%r15,%rax,1),%rcx
mov    0x30(%rsp),%rax
lea    (%rax,%rcx,8),%r10
add    $0x10,%r10
shl    $0x3,%r15
mov    $0x2,%r11d
mov    $0x8,%ebp
nopl   0x0(%rax,%rax,1)
xorpd  %xmm0,%xmm0
mov    $0x1,%ecx
xor    %eax,%eax
mov    %r10,%rsi
mov    %r14d,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movslq %ebx,%rbx
lea    (%rcx,%rbx,1),%rdi
movsd  (%rsi),%xmm1
mulsd  (%r12,%rax,1),%xmm1
divsd  0x0(%r13,%rdi,8),%xmm1
addsd  %xmm1,%xmm0
add    $0x1,%rcx
add    %r14d,%ebx
add    %r15,%rsi
add    $0x8,%rax
cmp    %rax,%rbp
jne    11f0 <bmv_+0xd0>
lea    (%r11,%r8,1),%rcx
addsd  -0x8(%r12,%rcx,8),%xmm0
mov    0x18(%rsp),%rax
movsd  %xmm0,(%rax,%rcx,8)
add    $0x1,%r11
add    $0x8,%r10
add    $0x8,%rbp
cmp    %r9,%r11
jne    11d0 <bmv_+0xb0>
mov    0x58(%rsp),%rbp
mov    %rbp,%rdi
mov    %r14d,%esi
mov    0x50(%rsp),%r15
mov    %r15,%rcx
mov    $0x1,%r8d
mov    0xa0(%rsp),%rbx
mov    %rbx,%r9
call   1030 <dtrsl_@plt>
cmpl   $0x0,(%rbx)
mov    0x8(%rsp),%rcx
je     1289 <bmv_+0x169>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rsp),%rdx
test   %edx,%edx
jle    12f4 <bmv_+0x1d4>
mov    0x20(%rsp),%edx
mov    %edx,%eax
mov    %rax,0x10(%rsp)
add    $0xffffffffffffffff,%rax
mov    %rax,0x40(%rsp)
mov    $0x1,%r15d
cmp    $0x2,%edx
jne    130d <bmv_+0x1ed>
testb  $0x1,0x40(%rsp)
mov    0xa0(%rsp),%rbx
je     141b <bmv_+0x2fb>
movsd  -0x8(%r12,%r15,8),%xmm2
mov    %r15d,%eax
imul   %r14d,%eax
cltq
add    %r15,%rax
movsd  0x0(%r13,%rax,8),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     13fb <bmv_+0x2db>
sqrtsd %xmm0,%xmm0
jmp    140c <bmv_+0x2ec>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %r15,%rcx
xor    %r8d,%r8d
mov    %rbx,%r9
call   1030 <dtrsl_@plt>
jmp    1278 <bmv_+0x158>
lea    (%r14,%r14,1),%ebp
mov    0x40(%rsp),%rax
and    $0xfffffffffffffffe,%rax
neg    %rax
mov    %rax,0x60(%rsp)
mov    $0x1,%r15d
xorpd  %xmm1,%xmm1
mov    %ebp,0x20(%rsp)
mov    %r14d,%ebx
jmp    1386 <bmv_+0x266>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  %xmm2,0x38(%rsp)
call   1040 <sqrt@plt>
movsd  0x38(%rsp),%xmm2
xorpd  %xmm1,%xmm1
mov    0x8(%rsp),%rcx
divsd  %xmm0,%xmm2
movsd  %xmm2,(%rcx,%r15,8)
mov    0x20(%rsp),%eax
add    %eax,%ebx
add    %eax,%ebp
mov    0x60(%rsp),%rax
add    %r15,%rax
add    $0x2,%rax
add    $0x2,%r15
cmp    $0x1,%rax
je     12b0 <bmv_+0x190>
movslq %ebx,%rax
movsd  -0x8(%r12,%r15,8),%xmm2
add    %r15,%rax
movsd  0x0(%r13,%rax,8),%xmm0
ucomisd %xmm1,%xmm0
jb     13b0 <bmv_+0x290>
sqrtsd %xmm0,%xmm0
jmp    13ca <bmv_+0x2aa>
cs nopw 0x0(%rax,%rax,1)
movsd  %xmm2,0x38(%rsp)
call   1040 <sqrt@plt>
movsd  0x38(%rsp),%xmm2
xorpd  %xmm1,%xmm1
mov    0x8(%rsp),%rcx
divsd  %xmm0,%xmm2
movslq %ebp,%rax
movsd  %xmm2,-0x8(%rcx,%r15,8)
movsd  (%r12,%r15,8),%xmm2
add    %r15,%rax
movsd  0x8(%r13,%rax,8),%xmm0
ucomisd %xmm1,%xmm0
jb     1340 <bmv_+0x220>
sqrtsd %xmm0,%xmm0
jmp    135a <bmv_+0x23a>
movsd  %xmm2,0x20(%rsp)
call   1040 <sqrt@plt>
movsd  0x20(%rsp),%xmm2
divsd  %xmm0,%xmm2
mov    0x18(%rsp),%rax
movsd  %xmm2,(%rax,%r15,8)
mov    0x58(%rsp),%rdi
mov    %r14d,%esi
mov    (%rsp),%rdx
mov    0x50(%rsp),%rcx
xor    %r8d,%r8d
mov    %rbx,%r9
call   1030 <dtrsl_@plt>
cmpl   $0x0,(%rbx)
mov    0x8(%rsp),%rcx
mov    0x10(%rsp),%rax
jne    1278 <bmv_+0x158>
cmpl   $0x0,(%rsp)
jle    1278 <bmv_+0x158>
lea    -0x1(%rax),%rbx
mov    $0x1,%r15d
xor    %ebp,%ebp
movapd 0xb98(%rip),%xmm1
xorpd  %xmm2,%xmm2
mov    %r14d,%r12d
jmp    14bf <bmv_+0x39f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movapd %xmm3,0x20(%rsp)
call   1040 <sqrt@plt>
movapd 0x20(%rsp),%xmm3
xorpd  %xmm2,%xmm2
movapd 0xb63(%rip),%xmm1
mov    0x8(%rsp),%rcx
xorpd  %xmm1,%xmm3
divsd  %xmm0,%xmm3
movsd  %xmm3,(%rcx,%rbp,8)
add    $0x1,%r15
add    %r14d,%r12d
add    $0x1,%rbp
cmp    %rbp,%rbx
je     14dd <bmv_+0x3bd>
movslq %r12d,%rax
add    %r15,%rax
movsd  (%rcx,%rbp,8),%xmm3
movsd  0x0(%r13,%rax,8),%xmm0
ucomisd %xmm2,%xmm0
jb     1480 <bmv_+0x360>
sqrtsd %xmm0,%xmm0
jmp    14a2 <bmv_+0x382>
cmpl   $0x0,(%rsp)
mov    0x10(%rsp),%rbx
jle    1278 <bmv_+0x158>
mov    (%rsp),%rax
mov    %eax,%r11d
movslq %r14d,%r8
lea    -0x2(%rax),%r9d
lea    (%rcx,%r11,8),%rsi
mov    0x48(%rsp),%rcx
add    %r8,%rcx
mov    0x30(%rsp),%rax
lea    (%rax,%rcx,8),%rdi
add    $0x8,%rdi
lea    0x0(,%r8,8),%r10
mov    $0x2,%r12d
mov    $0x1,%r15d
xor    %ecx,%ecx
xorpd  %xmm0,%xmm0
jmp    1552 <bmv_+0x432>
nop
mov    0x18(%rsp),%rdx
addsd  (%rdx,%rax,8),%xmm2
movsd  %xmm2,(%rdx,%rax,8)
add    $0x1,%r12d
add    $0x1,%ecx
add    %r10,%rdi
cmp    %rbx,%r15
je     1278 <bmv_+0x158>
mov    %r15,%rax
add    $0x1,%r15
xorpd  %xmm2,%xmm2
cmp    %r11,%rax
jae    1530 <bmv_+0x410>
mov    %ecx,%ebx
not    %ebx
add    (%rsp),%ebx
movslq %r12d,%rbp
mov    %eax,%edx
imul   %r14d,%edx
movslq %edx,%rdx
add    %rax,%rdx
movsd  0x0(%r13,%rdx,8),%xmm1
xorpd  %xmm3,%xmm3
test   $0x1,%bl
jne    1590 <bmv_+0x470>
jmp    15bf <bmv_+0x49f>
nopw   0x0(%rax,%rax,1)
mov    %rax,%rdx
imul   %r8,%rdx
add    %rbp,%rdx
movsd  0x0(%r13,%rdx,8),%xmm2
lea    (%r11,%rbp,1),%rdx
mov    0x18(%rsp),%rbx
mulsd  (%rbx,%rdx,8),%xmm2
divsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
add    $0x1,%rbp
movapd %xmm2,%xmm3
mov    0x10(%rsp),%rbx
cmp    %ecx,%r9d
je     1530 <bmv_+0x410>
nopl   (%rax)
movsd  -0x8(%rdi,%rbp,8),%xmm4
movsd  (%rdi,%rbp,8),%xmm2
mulsd  -0x8(%rsi,%rbp,8),%xmm4
divsd  %xmm1,%xmm4
addsd  %xmm3,%xmm4
mulsd  (%rsi,%rbp,8),%xmm2
divsd  %xmm1,%xmm2
addsd  %xmm4,%xmm2
add    $0x2,%rbp
movapd %xmm2,%xmm3
cmp    %ebp,%ebx
jne    15d0 <bmv_+0x4b0>
jmp    1530 <bmv_+0x410>

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

LLVM IR (-O2):
define i32 @bmv_(i32 %0, double* nocapture %1, double* %2, i32 %3, double* nocapture %4, double* %5, i32* %6) {
%8 = xor i32 %0, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds double, double* %1, i64 %9
%11 = getelementptr inbounds double, double* %5, i64 -1
%12 = getelementptr inbounds double, double* %4, i64 -1
%13 = icmp eq i32 %3, 0
br i1 %13, label %210, label %14
14: ; preds = %7
%15 = add i32 %3, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %12, i64 %16
%18 = load double, double* %17
%19 = getelementptr inbounds double, double* %11, i64 %16
store double %18, double* %19
%20 = icmp slt i32 %3, 2
br i1 %20, label %55, label %21
21: ; preds = %14
%22 = sext i32 %0 to i64
%23 = zext i32 %3 to i64
%24 = zext i32 %15 to i64
br label %25
25: ; preds = %21, %47
%26 = phi i64 [ 2, %21 ], [ %53, %47 ]
br label %27
27: ; preds = %25, %27
%28 = phi i64 [ 1, %25 ], [ %45, %27 ]
%29 = phi double [ 0.000000e+00, %25 ], [ %44, %27 ]
%30 = trunc i64 %28 to i32
%31 = mul nsw i64 %28, %22
%32 = mul nsw i32 %30, %0
%33 = add nsw i64 %31, %26
%34 = getelementptr inbounds double, double* %10, i64 %33
%35 = load double, double* %34
%36 = getelementptr inbounds double, double* %12, i64 %28
%37 = load double, double* %36
%38 = fmul double %35, %37
%39 = sext i32 %32 to i64
%40 = add nsw i64 %28, %39
%41 = getelementptr inbounds double, double* %10, i64 %40
%42 = load double, double* %41
%43 = fdiv double %38, %42
%44 = fadd double %29, %43
%45 = add nuw nsw i64 %28, 1
%46 = icmp eq i64 %45, %26
br i1 %46, label %47, label %27
47: ; preds = %27
%48 = add nuw nsw i64 %26, %23
%49 = getelementptr inbounds double, double* %12, i64 %48
%50 = load double, double* %49
%51 = fadd double %44, %50
%52 = getelementptr inbounds double, double* %11, i64 %48
store double %51, double* %52
%53 = add nuw nsw i64 %26, 1
%54 = icmp eq i64 %53, %24
br i1 %54, label %55, label %25
55: ; preds = %47, %14
%56 = tail call i32 @dtrsl_(double* %2, i32 %0, i32 %3, double* %19, i32 1, i32* %6)
%57 = load i32, i32* %6
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %210
59: ; preds = %55
%60 = icmp slt i32 %3, 1
br i1 %60, label %117, label %61
61: ; preds = %59
%62 = zext i32 %15 to i64
%63 = add nsw i64 %62, -1
%64 = and i64 %63, 1
%65 = icmp eq i32 %15, 2
br i1 %65, label %97, label %66
66: ; preds = %61
%67 = and i64 %63, -2
br label %68
68: ; preds = %68, %66
%69 = phi i64 [ 1, %66 ], [ %94, %68 ]
%70 = phi i64 [ 0, %66 ], [ %95, %68 ]
%71 = trunc i64 %69 to i32
%72 = getelementptr inbounds double, double* %12, i64 %69
%73 = load double, double* %72
%74 = mul nsw i32 %71, %0
%75 = sext i32 %74 to i64
%76 = add nsw i64 %69, %75
%77 = getelementptr inbounds double, double* %10, i64 %76
%78 = load double, double* %77
%79 = tail call double @sqrt(double %78)
%80 = fdiv double %73, %79
%81 = getelementptr inbounds double, double* %11, i64 %69
store double %80, double* %81
%82 = add nuw nsw i64 %69, 1
%83 = trunc i64 %82 to i32
%84 = getelementptr inbounds double, double* %4, i64 %69
%85 = load double, double* %84
%86 = mul nsw i32 %83, %0
%87 = sext i32 %86 to i64
%88 = add nsw i64 %82, %87
%89 = getelementptr inbounds double, double* %10, i64 %88
%90 = load double, double* %89
%91 = tail call double @sqrt(double %90)
%92 = fdiv double %85, %91
%93 = getelementptr inbounds double, double* %5, i64 %69
store double %92, double* %93
%94 = add nuw nsw i64 %69, 2
%95 = add i64 %70, 2
%96 = icmp eq i64 %95, %67
br i1 %96, label %97, label %68
97: ; preds = %68, %61
%98 = phi i64 [ 1, %61 ], [ %94, %68 ]
%99 = icmp eq i64 %64, 0
br i1 %99, label %112, label %100
100: ; preds = %97
%101 = trunc i64 %98 to i32
%102 = getelementptr inbounds double, double* %12, i64 %98
%103 = load double, double* %102
%104 = mul nsw i32 %101, %0
%105 = sext i32 %104 to i64
%106 = add nsw i64 %98, %105
%107 = getelementptr inbounds double, double* %10, i64 %106
%108 = load double, double* %107
%109 = tail call double @sqrt(double %108)
%110 = fdiv double %103, %109
%111 = getelementptr inbounds double, double* %11, i64 %98
store double %110, double* %111
br label %112
112: ; preds = %97, %100
%113 = tail call i32 @dtrsl_(double* %2, i32 %0, i32 %3, double* %19, i32 0, i32* %6)
%114 = load i32, i32* %6
%115 = icmp ne i32 %114, 0
%116 = or i1 %115, %60
br i1 %116, label %210, label %119
117: ; preds = %59
%118 = tail call i32 @dtrsl_(double* %2, i32 %0, i32 %3, double* %19, i32 0, i32* %6)
br label %210
119: ; preds = %112
%120 = zext i32 %15 to i64
br label %127
121: ; preds = %127
br i1 %60, label %210, label %122
122: ; preds = %121
%123 = zext i32 %3 to i64
%124 = sext i32 %0 to i64
%125 = zext i32 %15 to i64
%126 = add i32 %3, -2
br label %142
127: ; preds = %119, %127
%128 = phi i64 [ 1, %119 ], [ %140, %127 ]
%129 = trunc i64 %128 to i32
%130 = getelementptr inbounds double, double* %11, i64 %128
%131 = load double, double* %130
%132 = fneg double %131
%133 = mul nsw i32 %129, %0
%134 = sext i32 %133 to i64
%135 = add nsw i64 %128, %134
%136 = getelementptr inbounds double, double* %10, i64 %135
%137 = load double, double* %136
%138 = tail call double @sqrt(double %137)
%139 = fdiv double %132, %138
store double %139, double* %130
%140 = add nuw nsw i64 %128, 1
%141 = icmp eq i64 %140, %120
br i1 %141, label %121, label %127
142: ; preds = %122, %202
%143 = phi i32 [ 0, %122 ], [ %209, %202 ]
%144 = phi i64 [ 1, %122 ], [ %146, %202 ]
%145 = phi i32 [ 2, %122 ], [ %207, %202 ]
%146 = add nuw nsw i64 %144, 1
%147 = icmp ult i64 %144, %123
br i1 %147, label %148, label %202
148: ; preds = %142
%149 = xor i32 %143, -1
%150 = add i32 %149, %3
%151 = sext i32 %145 to i64
%152 = trunc i64 %144 to i32
%153 = mul nsw i64 %144, %124
%154 = mul nsw i32 %152, %0
%155 = sext i32 %154 to i64
%156 = add nsw i64 %144, %155
%157 = getelementptr inbounds double, double* %10, i64 %156
%158 = load double, double* %157
%159 = and i32 %150, 1
%160 = icmp eq i32 %159, 0
br i1 %160, label %172, label %161
161: ; preds = %148
%162 = add nsw i64 %153, %151
%163 = getelementptr inbounds double, double* %10, i64 %162
%164 = load double, double* %163
%165 = add nsw i64 %151, %123
%166 = getelementptr inbounds double, double* %11, i64 %165
%167 = load double, double* %166
%168 = fmul double %164, %167
%169 = fdiv double %168, %158
%170 = fadd double %169, 0.000000e+00
%171 = add nsw i64 %151, 1
br label %172
172: ; preds = %161, %148
%173 = phi double [ undef, %148 ], [ %170, %161 ]
%174 = phi i64 [ %151, %148 ], [ %171, %161 ]
%175 = phi double [ 0.000000e+00, %148 ], [ %170, %161 ]
%176 = icmp eq i32 %126, %143
br i1 %176, label %202, label %177
177: ; preds = %172, %177
%178 = phi i64 [ %199, %177 ], [ %174, %172 ]
%179 = phi double [ %198, %177 ], [ %175, %172 ]
%180 = add nsw i64 %178, %153
%181 = getelementptr inbounds double, double* %10, i64 %180
%182 = load double, double* %181
%183 = add nsw i64 %178, %123
%184 = getelementptr inbounds double, double* %11, i64 %183
%185 = load double, double* %184
%186 = fmul double %182, %185
%187 = fdiv double %186, %158
%188 = fadd double %179, %187
%189 = add nsw i64 %178, 1
%190 = add nsw i64 %189, %153
%191 = getelementptr inbounds double, double* %10, i64 %190
%192 = load double, double* %191
%193 = add nsw i64 %189, %123
%194 = getelementptr inbounds double, double* %11, i64 %193
%195 = load double, double* %194
%196 = fmul double %192, %195
%197 = fdiv double %196, %158
%198 = fadd double %188, %197
%199 = add nsw i64 %178, 2
%200 = trunc i64 %199 to i32
%201 = icmp eq i32 %15, %200
br i1 %201, label %202, label %177
202: ; preds = %172, %177, %142
%203 = phi double [ 0.000000e+00, %142 ], [ %173, %172 ], [ %198, %177 ]
%204 = getelementptr inbounds double, double* %11, i64 %144
%205 = load double, double* %204
%206 = fadd double %203, %205
store double %206, double* %204
%207 = add nuw i32 %145, 1
%208 = icmp eq i64 %146, %125
%209 = add i32 %143, 1
br i1 %208, label %210, label %142
210: ; preds = %202, %112, %117, %121, %55, %7
ret i32 0
}