#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);
int /*<<< orphan*/ free(double *);
double l2norm(double *, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ mmult(double *, double *, double *, int, int, int);
int /*<<< orphan*/ msub(double *, double *, double *, int, int);
int /*<<< orphan*/ qrupdate(double *, int, double *, double *);
double sqrt(double);
void bfgs_factored(double *H, int N, double *xi, double *xf, double *jac,
                   double *jacf) {
  int i, j, supd, ct;
  double sn, yn, fd, yt, jacm, alpha, temp3;
  double *sk, *yk, *temp, *temp2, *t, *u;
  sk = (double *)malloc(sizeof(double) * N);
  yk = (double *)malloc(sizeof(double) * N);
  temp = (double *)malloc(sizeof(double) * 1);
  temp2 = (double *)malloc(sizeof(double) * 1);
  t = (double *)malloc(sizeof(double) * N);
  u = (double *)malloc(sizeof(double) * N);
  msub(xf, xi, sk, 1, N);
  msub(jacf, jac, yk, 1, N);
  sn = l2norm(sk, N);
  yn = l2norm(yk, N);
  fd = sqrt((double)1e-15);
  mmult(yk, sk, temp, 1, N, 1);
  if (temp[0] >= fd * sn * yn) {
    for (i = 0; i < N; ++i) {
      t[i] = 0.0;
      for (j = i; j < N; ++j) {
        ct = j * N;
        t[i] += H[ct + i] * sk[j];
      }
    }
    mmult(t, t, temp2, 1, N, 1);
    alpha = sqrt(temp[0] / temp2[0]);
    supd = 1;
    for (i = 0; i < N; ++i) {
      temp3 = 0.0;
      for (j = 0; j < i + 1; ++j) {
        ct = i * N;
        temp3 += H[ct + j] * t[j];
      }
      yt = fabs(yk[i] - temp3);
      if (jac[i] > jacf[i]) {
        jacm = jac[i];
      } else {
        jacm = jacf[i];
      }
      if (yt >= fd * jacm) {
        supd = 0;
      }
      u[i] = yk[i] - alpha * temp3;
    }
    if (supd == 0) {
      temp3 = 1.0 / sqrt(temp[0] * temp2[0]);
      for (i = 0; i < N; ++i) {
        t[i] *= temp3;
      }
      for (i = 1; i < N; ++i) {
        ct = i * N;
        for (j = 0; j < i; ++j) {
          H[j * N + i] = H[ct + j];
        }
      }
      qrupdate(H, N, t, u);
      for (i = 1; i < N; ++i) {
        ct = i * N;
        for (j = 0; j < i; ++j) {
          H[ct + j] = H[j * N + i];
        }
      }
    }
  }
  free(sk);
  free(yk);
  free(temp);
  free(temp2);
  free(t);
  free(u);
}


x86 assembly (clang, -O0):
<bfgs_factored>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x80(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x88(%rbp)
mov    $0x8,%edi
call   1080 <malloc@plt>
mov    %rax,-0x90(%rbp)
mov    $0x8,%edi
call   1080 <malloc@plt>
mov    %rax,-0x98(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0xa0(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0xa8(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x80(%rbp),%rdx
mov    -0xc(%rbp),%r8d
mov    $0x1,%ecx
call   1070 <msub@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x88(%rbp),%rdx
mov    -0xc(%rbp),%r8d
mov    $0x1,%ecx
call   1070 <msub@plt>
mov    -0x80(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <l2norm@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <l2norm@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  0xd93(%rip),%xmm0
call   1090 <sqrt@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x80(%rbp),%rsi
mov    -0x90(%rbp),%rdx
mov    -0xc(%rbp),%r8d
mov    $0x1,%r9d
mov    %r9d,%ecx
call   1060 <mmult@plt>
mov    -0x90(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x58(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jb     169a <bfgs_factored+0x52a>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    135e <bfgs_factored+0x1ee>
mov    -0xa0(%rbp),%rax
movslq -0x34(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    134b <bfgs_factored+0x1db>
mov    -0x38(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x80(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0xa0(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    12eb <bfgs_factored+0x17b>
jmp    1350 <bfgs_factored+0x1e0>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12c6 <bfgs_factored+0x156>
mov    -0xa0(%rbp),%rdi
mov    -0xa0(%rbp),%rsi
mov    -0x98(%rbp),%rdx
mov    -0xc(%rbp),%r8d
mov    $0x1,%r9d
mov    %r9d,%ecx
call   1060 <mmult@plt>
mov    -0x90(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x98(%rbp),%rax
divsd  (%rax),%xmm0
call   1090 <sqrt@plt>
movsd  %xmm0,-0x70(%rbp)
movl   $0x1,-0x3c(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1510 <bfgs_factored+0x3a0>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    142b <bfgs_factored+0x2bb>
mov    -0x34(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xa0(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    13ce <bfgs_factored+0x25e>
mov    -0x88(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x78(%rbp),%xmm0
movaps 0xbc9(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jbe    1487 <bfgs_factored+0x317>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1499 <bfgs_factored+0x329>
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jb     14b9 <bfgs_factored+0x349>
movl   $0x0,-0x3c(%rbp)
mov    -0x88(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x70(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0xa8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    13b3 <bfgs_factored+0x243>
cmpl   $0x0,-0x3c(%rbp)
jne    1695 <bfgs_factored+0x525>
mov    -0x90(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x98(%rbp),%rax
mulsd  (%rax),%xmm0
call   1090 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xac8(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1584 <bfgs_factored+0x414>
movsd  -0x78(%rbp),%xmm0
mov    -0xa0(%rbp),%rax
movslq -0x34(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1550 <bfgs_factored+0x3e0>
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    15fd <bfgs_factored+0x48d>
mov    -0x34(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x40(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    15ea <bfgs_factored+0x47a>
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    15a8 <bfgs_factored+0x438>
jmp    15ef <bfgs_factored+0x47f>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    158b <bfgs_factored+0x41b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xa0(%rbp),%rdx
mov    -0xa8(%rbp),%rcx
call   1050 <qrupdate@plt>
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1690 <bfgs_factored+0x520>
mov    -0x34(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x40(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    167d <bfgs_factored+0x50d>
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    163b <bfgs_factored+0x4cb>
jmp    1682 <bfgs_factored+0x512>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    161e <bfgs_factored+0x4ae>
jmp    1695 <bfgs_factored+0x525>
jmp    169a <bfgs_factored+0x52a>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
mov    -0x88(%rbp),%rdi
call   1030 <free@plt>
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
mov    -0xa0(%rbp),%rdi
call   1030 <free@plt>
mov    -0xa8(%rbp),%rdi
call   1030 <free@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bfgs_factored>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9,%r14
mov    %r8,0x40(%rsp)
mov    %rcx,0x30(%rsp)
mov    %rdx,0x18(%rsp)
mov    %esi,%r13d
mov    %rdi,(%rsp)
lea    0x0(,%r13,8),%ebx
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,0x28(%rsp)
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,%r12
mov    $0x8,%edi
call   1080 <malloc@plt>
mov    %rax,%r15
mov    $0x8,%edi
call   1080 <malloc@plt>
mov    %rax,0x20(%rsp)
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,%rbp
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    0x30(%rsp),%rdi
mov    0x18(%rsp),%rsi
mov    0x28(%rsp),%rbx
mov    %rbx,%rdx
mov    $0x1,%ecx
mov    %r13d,%r8d
call   1070 <msub@plt>
mov    %r14,0x30(%rsp)
mov    %r14,%rdi
mov    0x40(%rsp),%r14
mov    %r14,%rsi
mov    %r12,%rdx
mov    $0x1,%ecx
mov    %r13d,%r8d
call   1070 <msub@plt>
mov    %rbx,%rdi
mov    %r13d,%esi
call   1040 <l2norm@plt>
movsd  %xmm0,0x8(%rsp)
mov    %r12,%rdi
mov    %r13d,%esi
call   1040 <l2norm@plt>
movsd  %xmm0,0x38(%rsp)
mov    %r12,0x18(%rsp)
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    $0x1,%ecx
mov    %r13d,%r8d
mov    $0x1,%r9d
call   1060 <mmult@plt>
movsd  0x8(%rsp),%xmm1
mulsd  0xd89(%rip),%xmm1
mov    %r15,0x8(%rsp)
movsd  (%r15),%xmm0
mulsd  0x38(%rsp),%xmm1
ucomisd %xmm1,%xmm0
jb     16b0 <bfgs_factored+0x540>
mov    %r13d,%r12d
test   %r13d,%r13d
jle    1313 <bfgs_factored+0x1a3>
lea    0x0(,%r12,8),%rax
lea    0x8(,%r12,8),%r8
xor    %edx,%edx
mov    %r12,%rsi
mov    0x28(%rsp),%rdi
mov    (%rsp),%r9
nopw   0x0(%rax,%rax,1)
movq   $0x0,0x0(%rbp,%rdx,8)
xorpd  %xmm0,%xmm0
xor    %ecx,%ecx
mov    %r9,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%rbx),%xmm1
mulsd  (%rdi,%rcx,8),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x0(%rbp,%rdx,8)
add    %rax,%rbx
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    12e0 <bfgs_factored+0x170>
add    $0x1,%rdx
add    %r8,%r9
add    $0x8,%rdi
add    $0xffffffffffffffff,%rsi
cmp    %r12,%rdx
jne    12c0 <bfgs_factored+0x150>
mov    %rbp,%rdi
mov    %rbp,%rsi
mov    0x20(%rsp),%rbx
mov    %rbx,%rdx
mov    $0x1,%ecx
mov    %r13d,%r8d
mov    $0x1,%r9d
call   1060 <mmult@plt>
mov    0x8(%rsp),%rax
movsd  (%rax),%xmm0
divsd  (%rbx),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1359 <bfgs_factored+0x1e9>
sqrtsd %xmm0,%xmm0
test   %r13d,%r13d
jg     1367 <bfgs_factored+0x1f7>
jmp    16b0 <bfgs_factored+0x540>
call   1090 <sqrt@plt>
test   %r13d,%r13d
jle    16b0 <bfgs_factored+0x540>
mov    %r13,%r15
xorpd  0xc9e(%rip),%xmm0
mov    (%rsp),%r11
lea    0x18(%r11),%rax
lea    0x0(,%r12,8),%r9
mov    $0x1,%r10d
mov    $0x1,%r13d
xor    %r8d,%r8d
movapd 0xc87(%rip),%xmm1
movsd  0xc5f(%rip),%xmm2
xor    %ebx,%ebx
jmp    140e <bfgs_factored+0x29e>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x18(%rsp),%rcx
movsd  (%rcx,%rbx,8),%xmm4
movapd %xmm4,%xmm5
subsd  %xmm3,%xmm5
movsd  (%r14,%rbx,8),%xmm6
mov    0x30(%rsp),%rcx
maxsd  (%rcx,%rbx,8),%xmm6
mulsd  %xmm0,%xmm3
addsd  %xmm4,%xmm3
mov    0x10(%rsp),%rcx
movsd  %xmm3,(%rcx,%rbx,8)
lea    0x1(%rbx),%rcx
andpd  %xmm1,%xmm5
mulsd  %xmm2,%xmm6
ucomisd %xmm6,%xmm5
cmovae %r8d,%r10d
add    $0x1,%r13
add    %r9,%rax
add    %r9,%r11
mov    %rcx,%rbx
cmp    %r12,%rcx
je     14bc <bfgs_factored+0x34c>
cmp    $0x3,%rbx
jae    1420 <bfgs_factored+0x2b0>
xorpd  %xmm3,%xmm3
xor    %edx,%edx
jmp    1478 <bfgs_factored+0x308>
nopl   0x0(%rax)
mov    %r13,%rsi
and    $0xfffffffffffffffc,%rsi
xorpd  %xmm3,%xmm3
xor    %edx,%edx
nopl   (%rax)
movsd  -0x18(%rax,%rdx,8),%xmm4
movsd  -0x10(%rax,%rdx,8),%xmm5
mulsd  0x0(%rbp,%rdx,8),%xmm4
mulsd  0x8(%rbp,%rdx,8),%xmm5
addsd  %xmm3,%xmm4
movsd  -0x8(%rax,%rdx,8),%xmm6
mulsd  0x10(%rbp,%rdx,8),%xmm6
addsd  %xmm4,%xmm5
movsd  (%rax,%rdx,8),%xmm3
mulsd  0x18(%rbp,%rdx,8),%xmm3
addsd  %xmm5,%xmm6
addsd  %xmm6,%xmm3
add    $0x4,%rdx
cmp    %rdx,%rsi
jne    1430 <bfgs_factored+0x2c0>
test   $0x3,%r13b
je     13b0 <bfgs_factored+0x240>
mov    %r13d,%esi
and    $0x3,%esi
lea    0x0(,%rdx,8),%rdi
add    %rbp,%rdi
lea    (%r11,%rdx,8),%rdx
xor    %ecx,%ecx
nopl   0x0(%rax)
movsd  (%rdx,%rcx,8),%xmm4
mulsd  (%rdi,%rcx,8),%xmm4
addsd  %xmm4,%xmm3
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    14a0 <bfgs_factored+0x330>
jmp    13b0 <bfgs_factored+0x240>
test   %r10d,%r10d
jne    16b0 <bfgs_factored+0x540>
mov    0x8(%rsp),%rax
movsd  (%rax),%xmm0
mov    0x20(%rsp),%rax
mulsd  (%rax),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     14e7 <bfgs_factored+0x377>
sqrtsd %xmm0,%xmm0
jmp    14ec <bfgs_factored+0x37c>
call   1090 <sqrt@plt>
mov    %r15,%r14
test   %r14d,%r14d
jle    169c <bfgs_factored+0x52c>
movsd  0xb08(%rip),%xmm1
divsd  %xmm0,%xmm1
cmp    $0x4,%r14d
jae    1511 <bfgs_factored+0x3a1>
xor    %eax,%eax
jmp    15c0 <bfgs_factored+0x450>
mov    %r12d,%eax
and    $0xfffffffc,%eax
movapd %xmm1,%xmm0
unpcklpd %xmm1,%xmm0
lea    -0x4(%rax),%rcx
mov    %rcx,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     158c <bfgs_factored+0x41c>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %ecx,%ecx
nopl   0x0(%rax)
movupd 0x0(%rbp,%rcx,8),%xmm2
movupd 0x10(%rbp,%rcx,8),%xmm3
movupd 0x20(%rbp,%rcx,8),%xmm4
movupd 0x30(%rbp,%rcx,8),%xmm5
mulpd  %xmm0,%xmm2
mulpd  %xmm0,%xmm3
movupd %xmm2,0x0(%rbp,%rcx,8)
movupd %xmm3,0x10(%rbp,%rcx,8)
mulpd  %xmm0,%xmm4
mulpd  %xmm0,%xmm5
movupd %xmm4,0x20(%rbp,%rcx,8)
movupd %xmm5,0x30(%rbp,%rcx,8)
add    $0x8,%rcx
add    $0xfffffffffffffffe,%rsi
jne    1540 <bfgs_factored+0x3d0>
jmp    158e <bfgs_factored+0x41e>
xor    %ecx,%ecx
test   $0x1,%dl
je     15b3 <bfgs_factored+0x443>
movupd 0x0(%rbp,%rcx,8),%xmm2
movupd 0x10(%rbp,%rcx,8),%xmm3
mulpd  %xmm0,%xmm2
mulpd  %xmm0,%xmm3
movupd %xmm2,0x0(%rbp,%rcx,8)
movupd %xmm3,0x10(%rbp,%rcx,8)
cmp    %r12,%rax
je     15d9 <bfgs_factored+0x469>
nopl   0x0(%rax,%rax,1)
movsd  0x0(%rbp,%rax,8),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x0(%rbp,%rax,8)
add    $0x1,%rax
cmp    %rax,%r12
jne    15c0 <bfgs_factored+0x450>
cmp    $0x1,%r14d
jle    169c <bfgs_factored+0x52c>
mov    (%rsp),%rdx
lea    (%rdx,%r12,8),%rax
add    $0x8,%rax
lea    0x0(,%r12,8),%rcx
lea    0x8(%rdx),%r8
mov    %r12,%rsi
shl    $0x4,%rsi
mov    $0x1,%r10d
xor    %r9d,%r9d
jmp    1628 <bfgs_factored+0x4b8>
nopl   (%rax)
add    $0x1,%r10
add    $0x1,%r9
add    %rcx,%rax
add    $0x8,%r8
cmp    %r12,%r10
je     16f8 <bfgs_factored+0x588>
test   %r9,%r9
je     1670 <bfgs_factored+0x500>
mov    %r10,%rdi
and    $0xfffffffffffffffe,%rdi
mov    %r8,%rbx
xor    %edx,%edx
nopl   0x0(%rax)
movsd  -0x8(%rax,%rdx,8),%xmm0
movsd  %xmm0,(%rbx)
movsd  (%rax,%rdx,8),%xmm0
movsd  %xmm0,(%rbx,%rcx,1)
add    $0x2,%rdx
add    %rsi,%rbx
cmp    %rdx,%rdi
jne    1640 <bfgs_factored+0x4d0>
test   $0x1,%r10b
je     1610 <bfgs_factored+0x4a0>
jmp    1678 <bfgs_factored+0x508>
nopl   0x0(%rax,%rax,1)
xor    %edx,%edx
test   $0x1,%r10b
je     1610 <bfgs_factored+0x4a0>
mov    %r10,%rdi
imul   %r12,%rdi
add    %rdx,%rdi
mov    (%rsp),%rbx
movsd  (%rbx,%rdi,8),%xmm0
imul   %r12,%rdx
add    %r10,%rdx
movsd  %xmm0,(%rbx,%rdx,8)
jmp    1610 <bfgs_factored+0x4a0>
mov    (%rsp),%rdi
mov    %r14d,%esi
mov    %rbp,%rdx
mov    0x10(%rsp),%rcx
call   1050 <qrupdate@plt>
mov    0x28(%rsp),%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>
mov    (%rsp),%rdi
mov    %r14d,%esi
mov    %rbp,%rdx
mov    0x10(%rsp),%rcx
call   1050 <qrupdate@plt>
cmp    $0x2,%r14d
jl     16b0 <bfgs_factored+0x540>
mov    (%rsp),%rcx
lea    (%rcx,%r12,8),%rax
add    $0x8,%rax
mov    %r12,%r11
shl    $0x4,%r11
lea    0x0(,%r12,8),%r8
lea    0x8(%rcx),%rsi
mov    $0x1,%r10d
xor    %r9d,%r9d
mov    %rax,%rdx
mov    (%rsp),%r14
jmp    176c <bfgs_factored+0x5fc>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r10
add    $0x1,%r9
add    $0x8,%rdx
add    %r8,%rax
add    $0x8,%rsi
cmp    %r12,%r10
je     16b0 <bfgs_factored+0x540>
test   %r9,%r9
je     17b0 <bfgs_factored+0x640>
mov    %r10,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %ecx,%ecx
xor    %ebx,%ebx
nopl   0x0(%rax)
movsd  (%rsi,%rcx,1),%xmm0
movsd  %xmm0,-0x8(%rax,%rbx,8)
movsd  (%rdx,%rcx,1),%xmm0
movsd  %xmm0,(%rax,%rbx,8)
add    $0x2,%rbx
add    %r11,%rcx
cmp    %rbx,%rdi
jne    1780 <bfgs_factored+0x610>
test   $0x1,%r10b
je     1750 <bfgs_factored+0x5e0>
jmp    17b8 <bfgs_factored+0x648>
nopl   0x0(%rax)
xor    %ebx,%ebx
test   $0x1,%r10b
je     1750 <bfgs_factored+0x5e0>
mov    %r10,%rcx
imul   %r12,%rcx
mov    %rbx,%rdi
imul   %r12,%rdi
add    %r10,%rdi
movsd  (%r14,%rdi,8),%xmm0
add    %rbx,%rcx
movsd  %xmm0,(%r14,%rcx,8)
jmp    1750 <bfgs_factored+0x5e0>

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

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