void tf_dp_weight(int n, double *y, double *w, double lam, double *beta) {
  int i;
  int k;
  int l;
  int r;
  int lo;
  int hi;
  double afirst;
  double alast;
  double bfirst;
  double blast;
  double alo;
  double blo;
  double ahi;
  double bhi;
  double *x;
  double *a;
  double *b;
  double *tm;
  double *tp;
  if (n == 0)
    return;
  if (n == 1 || lam == 0) {
    for (i = 0; i < n; i++)
      beta[i] = y[i];
    return;
  }
  x = (double *)malloc(2 * n * sizeof(double));
  a = (double *)malloc(2 * n * sizeof(double));
  b = (double *)malloc(2 * n * sizeof(double));
  tm = (double *)malloc((n - 1) * sizeof(double));
  tp = (double *)malloc((n - 1) * sizeof(double));
  tm[0] = -lam / w[0] + y[0];
  tp[0] = lam / w[0] + y[0];
  l = n - 1;
  r = n;
  x[l] = tm[0];
  x[r] = tp[0];
  a[l] = w[0];
  b[l] = -w[0] * y[0] + lam;
  a[r] = -w[0];
  b[r] = w[0] * y[0] + lam;
  afirst = w[1];
  bfirst = -w[1] * y[1] - lam;
  alast = -w[1];
  blast = w[1] * y[1] - lam;
  for (k = 1; k < n - 1; k++) {
    alo = afirst;
    blo = bfirst;
    for (lo = l; lo <= r; lo++) {
      if (alo * x[lo] + blo > -lam)
        break;
      alo += a[lo];
      blo += b[lo];
    }
    ahi = alast;
    bhi = blast;
    for (hi = r; hi >= lo; hi--) {
      if (-ahi * x[hi] - bhi < lam)
        break;
      ahi += a[hi];
      bhi += b[hi];
    }
    tm[k] = (-lam - blo) / alo;
    l = lo - 1;
    x[l] = tm[k];
    tp[k] = (lam + bhi) / (-ahi);
    r = hi + 1;
    x[r] = tp[k];
    a[l] = alo;
    b[l] = blo + lam;
    a[r] = ahi;
    b[r] = bhi + lam;
    afirst = w[k + 1];
    bfirst = -w[k + 1] * y[k + 1] - lam;
    alast = -w[k + 1];
    blast = w[k + 1] * y[k + 1] - lam;
  }
  alo = afirst;
  blo = bfirst;
  for (lo = l; lo <= r; lo++) {
    if (alo * x[lo] + blo > 0)
      break;
    alo += a[lo];
    blo += b[lo];
  }
  beta[n - 1] = -blo / alo;
  for (k = n - 2; k >= 0; k--) {
    if (beta[k + 1] > tp[k])
      beta[k] = tp[k];
    else if (beta[k + 1] < tm[k])
      beta[k] = tm[k];
    else
      beta[k] = beta[k + 1];
  }
  free(x);
  free(a);
  free(b);
  free(tm);
  free(tp);
}


x86 assembly (clang, -O0):
<tf_dp_weight>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114e <tf_dp_weight+0x2e>
jmp    19eb <tf_dp_weight+0x8cb>
cmpl   $0x1,-0x4(%rbp)
je     1170 <tf_dp_weight+0x50>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b0 <tf_dp_weight+0x90>
jp     11b0 <tf_dp_weight+0x90>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11ab <tf_dp_weight+0x8b>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1177 <tf_dp_weight+0x57>
jmp    19eb <tf_dp_weight+0x8cb>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x88(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x90(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x98(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0xa0(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0xa8(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
divsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm0
mov    -0xa0(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
divsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm0
mov    -0xa8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0xa0(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x88(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xa8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x88(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x90(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x98(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x90(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x98(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
movsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
movsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    17fe <tf_dp_weight+0x6de>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     150e <tf_dp_weight+0x3ee>
movsd  -0x68(%rbp),%xmm0
mov    -0x88(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
ucomisd %xmm1,%xmm0
jbe    14cc <tf_dp_weight+0x3ac>
jmp    150e <tf_dp_weight+0x3ee>
mov    -0x90(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x98(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1473 <tf_dp_weight+0x353>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jl     15da <tf_dp_weight+0x4ba>
movsd  -0x78(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mov    -0x88(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x80(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1598 <tf_dp_weight+0x478>
jmp    15da <tf_dp_weight+0x4ba>
mov    -0x90(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x98(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x40(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x40(%rbp)
jmp    1528 <tf_dp_weight+0x408>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
subsd  -0x70(%rbp),%xmm0
divsd  -0x68(%rbp),%xmm0
mov    -0xa0(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0xa0(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x88(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x20(%rbp),%xmm0
addsd  -0x80(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
divsd  %xmm1,%xmm0
mov    -0xa8(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0xa8(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x88(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x90(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
mov    -0x98(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x78(%rbp),%xmm0
mov    -0x90(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
mov    -0x98(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1448 <tf_dp_weight+0x328>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     189a <tf_dp_weight+0x77a>
movsd  -0x68(%rbp),%xmm0
mov    -0x88(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1858 <tf_dp_weight+0x738>
jmp    189a <tf_dp_weight+0x77a>
mov    -0x90(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x98(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1818 <tf_dp_weight+0x6f8>
movsd  -0x70(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x68(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
jl     19af <tf_dp_weight+0x88f>
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xa8(%rbp),%rax
movslq -0x30(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jbe    192a <tf_dp_weight+0x80a>
mov    -0xa8(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    199c <tf_dp_weight+0x87c>
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0xa0(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    1978 <tf_dp_weight+0x858>
mov    -0xa0(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1997 <tf_dp_weight+0x877>
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    199c <tf_dp_weight+0x87c>
jmp    19a1 <tf_dp_weight+0x881>
mov    -0x30(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x30(%rbp)
jmp    18d6 <tf_dp_weight+0x7b6>
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):
<tf_dp_weight>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
test   %edi,%edi
je     1658 <tf_dp_weight+0x538>
mov    %rsi,%r15
mov    %edi,%r12d
cmp    $0x1,%edi
je     13dd <tf_dp_weight+0x2bd>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1155 <tf_dp_weight+0x35>
jnp    13dd <tf_dp_weight+0x2bd>
mov    %rcx,(%rsp)
lea    (%r12,%r12,1),%eax
movslq %eax,%rbp
shl    $0x3,%rbp
mov    %rbp,%rdi
movapd %xmm0,0x30(%rsp)
mov    %rdx,0x20(%rsp)
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1040 <malloc@plt>
mov    %rax,%r13
mov    %rbp,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbp
lea    -0x1(%r12),%r14d
movslq %r12d,%rcx
mov    %rcx,0x18(%rsp)
lea    -0x1(%rcx),%rax
mov    %rax,0x28(%rsp)
lea    -0x8(,%rcx,8),%rdi
ff
mov    %rdi,0x10(%rsp)
call   1040 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    0x10(%rsp),%rdi
call   1040 <malloc@plt>
mov    0x20(%rsp),%r11
movapd 0x30(%rsp),%xmm2
mov    0x8(%rsp),%r9
movapd 0xe20(%rip),%xmm8
movsd  (%r11),%xmm0
movsd  (%r15),%xmm1
movapd %xmm2,%xmm3
divsd  %xmm0,%xmm3
movapd %xmm1,%xmm4
subsd  %xmm3,%xmm4
movsd  %xmm4,(%r9)
addsd  %xmm1,%xmm3
movsd  %xmm3,(%rax)
mov    0x18(%rsp),%rcx
movsd  %xmm4,-0x8(%rbx,%rcx,8)
movsd  %xmm3,(%rbx,%rcx,8)
movsd  %xmm0,-0x8(%r13,%rcx,8)
movapd %xmm0,%xmm3
xorpd  %xmm8,%xmm3
mulsd  %xmm1,%xmm0
movapd %xmm2,%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,-0x8(%rbp,%rcx,8)
movlpd %xmm3,0x0(%r13,%rcx,8)
addsd  %xmm2,%xmm0
movsd  %xmm0,0x0(%rbp,%rcx,8)
movsd  0x8(%r11),%xmm0
movapd %xmm0,%xmm4
xorpd  %xmm8,%xmm4
movsd  0x8(%r15),%xmm3
movapd %xmm4,%xmm1
mulsd  %xmm3,%xmm1
subsd  %xmm2,%xmm1
cmp    $0x3,%r12d
jl     1480 <tf_dp_weight+0x360>
movapd %xmm2,%xmm5
xorpd  %xmm8,%xmm5
mulsd  %xmm0,%xmm3
addsd  %xmm5,%xmm3
mov    %r14d,%r8d
mov    $0x1,%r10d
movapd 0xd69(%rip),%xmm6
mov    %r12d,%edx
jmp    1332 <tf_dp_weight+0x212>
nop
add    $0xffffffff,%r14d
movapd %xmm5,%xmm7
subsd  %xmm1,%xmm7
divsd  %xmm0,%xmm7
movsd  %xmm7,(%r9,%r10,8)
movslq %r14d,%rcx
movsd  %xmm7,(%rbx,%rcx,8)
addsd  %xmm2,%xmm3
movslq %edx,%rsi
movsd  %xmm0,0x0(%r13,%rcx,8)
movsd  %xmm4,0x8(%r13,%rsi,8)
xorpd  %xmm8,%xmm4
addsd  %xmm2,%xmm1
movsd  %xmm1,0x0(%rbp,%rcx,8)
movsd  %xmm3,0x8(%rbp,%rsi,8)
divsd  %xmm4,%xmm3
movsd  %xmm3,(%rax,%r10,8)
add    $0x1,%edx
movsd  %xmm3,0x8(%rbx,%rsi,8)
movsd  0x8(%r11,%r10,8),%xmm0
movsd  0x8(%r15,%r10,8),%xmm3
lea    0x1(%r10),%rcx
movapd %xmm0,%xmm4
xorpd  %xmm8,%xmm4
mulsd  %xmm0,%xmm3
movapd %xmm5,%xmm1
subsd  %xmm3,%xmm1
addsd  %xmm5,%xmm3
mov    %rcx,%r10
cmp    %r8,%rcx
je     1489 <tf_dp_weight+0x369>
movslq %edx,%rsi
cmp    %edx,%r14d
jg     1381 <tf_dp_weight+0x261>
movslq %r14d,%rcx
lea    0x1(%rdx),%edi
add    $0xffffffffffffffff,%rcx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  0x8(%rbx,%rcx,8),%xmm7
mulsd  %xmm0,%xmm7
addsd  %xmm1,%xmm7
ucomisd %xmm5,%xmm7
ja     1381 <tf_dp_weight+0x261>
addsd  0x8(%r13,%rcx,8),%xmm0
addsd  0x8(%rbp,%rcx,8),%xmm1
add    $0x1,%r14d
add    $0x1,%rcx
cmp    %rsi,%rcx
jl     1350 <tf_dp_weight+0x230>
mov    %edi,%r14d
cmp    %r14d,%edx
jl     12a0 <tf_dp_weight+0x180>
movslq %r14d,%rdi
add    $0xffffffff,%r14d
add    $0x1,%rsi
cs nopw 0x0(%rax,%rax,1)
nop
movapd %xmm4,%xmm7
xorpd  %xmm6,%xmm7
mulsd  -0x8(%rbx,%rsi,8),%xmm7
subsd  %xmm3,%xmm7
ucomisd %xmm7,%xmm2
ja     12a4 <tf_dp_weight+0x184>
addsd  -0x8(%r13,%rsi,8),%xmm4
addsd  -0x8(%rbp,%rsi,8),%xmm3
add    $0xffffffff,%edx
add    $0xffffffffffffffff,%rsi
cmp    %rdi,%rsi
jg     13a0 <tf_dp_weight+0x280>
mov    %r14d,%edx
jmp    12a4 <tf_dp_weight+0x184>
test   %r12d,%r12d
jle    1658 <tf_dp_weight+0x538>
mov    %r12d,%eax
cmp    $0x4,%r12d
jb     1409 <tf_dp_weight+0x2e9>
lea    (%r15,%rax,8),%rdx
cmp    %rcx,%rdx
jbe    1586 <tf_dp_weight+0x466>
lea    (%rcx,%rax,8),%rdx
cmp    %r15,%rdx
jbe    1586 <tf_dp_weight+0x466>
xor    %edx,%edx
mov    %rdx,%rdi
not    %rdi
add    %rax,%rdi
mov    %rax,%rsi
and    $0x3,%rsi
je     1435 <tf_dp_weight+0x315>
nopl   (%rax)
movsd  (%r15,%rdx,8),%xmm0
movsd  %xmm0,(%rcx,%rdx,8)
add    $0x1,%rdx
add    $0xffffffffffffffff,%rsi
jne    1420 <tf_dp_weight+0x300>
cmp    $0x3,%rdi
jb     1658 <tf_dp_weight+0x538>
nop
movsd  (%r15,%rdx,8),%xmm0
movsd  %xmm0,(%rcx,%rdx,8)
movsd  0x8(%r15,%rdx,8),%xmm0
movsd  %xmm0,0x8(%rcx,%rdx,8)
movsd  0x10(%r15,%rdx,8),%xmm0
movsd  %xmm0,0x10(%rcx,%rdx,8)
movsd  0x18(%r15,%rdx,8),%xmm0
movsd  %xmm0,0x18(%rcx,%rdx,8)
add    $0x4,%rdx
cmp    %rdx,%rax
jne    1440 <tf_dp_weight+0x320>
jmp    1658 <tf_dp_weight+0x538>
mov    %r12d,%edx
mov    (%rsp),%rsi
jmp    1492 <tf_dp_weight+0x372>
cmp    %edx,%r14d
mov    (%rsp),%rsi
jg     14e7 <tf_dp_weight+0x3c7>
movslq %r14d,%rdi
lea    (%rbx,%rdi,8),%rcx
lea    0x0(,%rdi,8),%r8
add    %r13,%r8
lea    0x0(,%rdi,8),%r10
add    %rbp,%r10
sub    %edi,%edx
add    $0x1,%edx
xor    %edi,%edi
xorpd  %xmm2,%xmm2
nopw   0x0(%rax,%rax,1)
movsd  (%rcx,%rdi,8),%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm1,%xmm3
ucomisd %xmm2,%xmm3
ja     14e7 <tf_dp_weight+0x3c7>
addsd  (%r8,%rdi,8),%xmm0
addsd  (%r10,%rdi,8),%xmm1
add    $0x1,%rdi
cmp    %edi,%edx
jne    14c0 <tf_dp_weight+0x3a0>
xorpd  0xb11(%rip),%xmm1
divsd  %xmm0,%xmm1
mov    0x28(%rsp),%rcx
movsd  %xmm1,(%rsi,%rcx,8)
cmp    $0x2,%r12d
jl     154a <tf_dp_weight+0x42a>
add    $0xfffffffe,%r12d
add    $0x1,%r12
jmp    151d <tf_dp_weight+0x3fd>
nopl   (%rax)
movsd  %xmm1,-0x8(%rsi,%r12,8)
add    $0xffffffffffffffff,%r12
jle    154a <tf_dp_weight+0x42a>
movsd  (%rsi,%r12,8),%xmm0
movsd  -0x8(%rax,%r12,8),%xmm1
ucomisd %xmm1,%xmm0
ja     1510 <tf_dp_weight+0x3f0>
movsd  -0x8(%r9,%r12,8),%xmm1
ucomisd %xmm0,%xmm1
ja     1510 <tf_dp_weight+0x3f0>
movsd  %xmm0,-0x8(%rsi,%r12,8)
add    $0xffffffffffffffff,%r12
jg     151d <tf_dp_weight+0x3fd>
mov    %rbx,%rdi
mov    %r9,%rbx
mov    %rax,%r14
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>
mov    %eax,%edx
and    $0xfffffffc,%edx
lea    -0x4(%rdx),%rdi
mov    %rdi,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %esi,%ebx
and    $0x3,%ebx
cmp    $0xc,%rdi
jae    15a9 <tf_dp_weight+0x489>
xor    %edi,%edi
jmp    1614 <tf_dp_weight+0x4f4>
and    $0xfffffffffffffffc,%rsi
xor    %edi,%edi
nop
movups (%r15,%rdi,8),%xmm0
movups 0x10(%r15,%rdi,8),%xmm1
movups %xmm0,(%rcx,%rdi,8)
movups %xmm1,0x10(%rcx,%rdi,8)
movups 0x20(%r15,%rdi,8),%xmm0
movups 0x30(%r15,%rdi,8),%xmm1
movups %xmm0,0x20(%rcx,%rdi,8)
movups %xmm1,0x30(%rcx,%rdi,8)
movups 0x40(%r15,%rdi,8),%xmm0
movups 0x50(%r15,%rdi,8),%xmm1
movups %xmm0,0x40(%rcx,%rdi,8)
movups %xmm1,0x50(%rcx,%rdi,8)
movupd 0x60(%r15,%rdi,8),%xmm0
movupd 0x70(%r15,%rdi,8),%xmm1
movupd %xmm0,0x60(%rcx,%rdi,8)
movupd %xmm1,0x70(%rcx,%rdi,8)
add    $0x10,%rdi
add    $0xfffffffffffffffc,%rsi
jne    15b0 <tf_dp_weight+0x490>
test   %rbx,%rbx
je     164f <tf_dp_weight+0x52f>
lea    (%rcx,%rdi,8),%rsi
add    $0x10,%rsi
lea    (%r15,%rdi,8),%rdi
add    $0x10,%rdi
shl    $0x5,%rbx
xor    %ebp,%ebp
nop
movupd -0x10(%rdi,%rbp,1),%xmm0
movupd (%rdi,%rbp,1),%xmm1
movupd %xmm0,-0x10(%rsi,%rbp,1)
movupd %xmm1,(%rsi,%rbp,1)
add    $0x20,%rbp
cmp    %rbp,%rbx
jne    1630 <tf_dp_weight+0x510>
cmp    %rax,%rdx
jne    140b <tf_dp_weight+0x2eb>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @tf_dp_weight(i32 %0, double* %1, double* %2, double %3, double* %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double*
%11 = alloca i32
%12 = alloca i32
%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 i32 %0, i32* %6
store double* %1, double** %7
store double* %2, double** %8
store double %3, double* %9
store double* %4, double** %10
%30 = load i32, i32* %6
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %5
br label %518
33: ; preds = %5
%34 = load i32, i32* %6
%35 = icmp eq i32 %34, 1
br i1 %35, label %39, label %36
36: ; preds = %33
%37 = load double, double* %9
%38 = fcmp oeq double %37, 0.000000e+00
br i1 %38, label %39, label %58
39: ; preds = %36, %33
store i32 0, i32* %11
br label %40
40: ; preds = %54, %39
%41 = load i32, i32* %11
%42 = load i32, i32* %6
%43 = icmp slt i32 %41, %42
br i1 %43, label %44, label %57
44: ; preds = %40
%45 = load double*, double** %7
%46 = load i32, i32* %11
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double, double* %45, i64 %47
%49 = load double, double* %48
%50 = load double*, double** %10
%51 = load i32, i32* %11
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %50, i64 %52
store double %49, double* %53
br label %54
54: ; preds = %44
%55 = load i32, i32* %11
%56 = add nsw i32 %55, 1
store i32 %56, i32* %11
br label %40
57: ; preds = %40
br label %518
58: ; preds = %36
%59 = load i32, i32* %6
%60 = mul nsw i32 2, %59
%61 = sext i32 %60 to i64
%62 = mul i64 %61, 8
%63 = call i8* @malloc(i64 %62)
%64 = bitcast i8* %63 to double*
store double* %64, double** %25
%65 = load i32, i32* %6
%66 = mul nsw i32 2, %65
%67 = sext i32 %66 to i64
%68 = mul i64 %67, 8
%69 = call i8* @malloc(i64 %68)
%70 = bitcast i8* %69 to double*
store double* %70, double** %26
%71 = load i32, i32* %6
%72 = mul nsw i32 2, %71
%73 = sext i32 %72 to i64
%74 = mul i64 %73, 8
%75 = call i8* @malloc(i64 %74)
%76 = bitcast i8* %75 to double*
store double* %76, double** %27
%77 = load i32, i32* %6
%78 = sub nsw i32 %77, 1
%79 = sext i32 %78 to i64
%80 = mul i64 %79, 8
%81 = call i8* @malloc(i64 %80)
%82 = bitcast i8* %81 to double*
store double* %82, double** %28
%83 = load i32, i32* %6
%84 = sub nsw i32 %83, 1
%85 = sext i32 %84 to i64
%86 = mul i64 %85, 8
%87 = call i8* @malloc(i64 %86)
%88 = bitcast i8* %87 to double*
store double* %88, double** %29
%89 = load double, double* %9
%90 = fneg double %89
%91 = load double*, double** %8
%92 = getelementptr inbounds double, double* %91, i64 0
%93 = load double, double* %92
%94 = fdiv double %90, %93
%95 = load double*, double** %7
%96 = getelementptr inbounds double, double* %95, i64 0
%97 = load double, double* %96
%98 = fadd double %94, %97
%99 = load double*, double** %28
%100 = getelementptr inbounds double, double* %99, i64 0
store double %98, double* %100
%101 = load double, double* %9
%102 = load double*, double** %8
%103 = getelementptr inbounds double, double* %102, i64 0
%104 = load double, double* %103
%105 = fdiv double %101, %104
%106 = load double*, double** %7
%107 = getelementptr inbounds double, double* %106, i64 0
%108 = load double, double* %107
%109 = fadd double %105, %108
%110 = load double*, double** %29
%111 = getelementptr inbounds double, double* %110, i64 0
store double %109, double* %111
%112 = load i32, i32* %6
%113 = sub nsw i32 %112, 1
store i32 %113, i32* %13
%114 = load i32, i32* %6
store i32 %114, i32* %14
%115 = load double*, double** %28
%116 = getelementptr inbounds double, double* %115, i64 0
%117 = load double, double* %116
%118 = load double*, double** %25
%119 = load i32, i32* %13
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds double, double* %118, i64 %120
store double %117, double* %121
%122 = load double*, double** %29
%123 = getelementptr inbounds double, double* %122, i64 0
%124 = load double, double* %123
%125 = load double*, double** %25
%126 = load i32, i32* %14
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds double, double* %125, i64 %127
store double %124, double* %128
%129 = load double*, double** %8
%130 = getelementptr inbounds double, double* %129, i64 0
%131 = load double, double* %130
%132 = load double*, double** %26
%133 = load i32, i32* %13
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds double, double* %132, i64 %134
store double %131, double* %135
%136 = load double*, double** %8
%137 = getelementptr inbounds double, double* %136, i64 0
%138 = load double, double* %137
%139 = fneg double %138
%140 = load double*, double** %7
%141 = getelementptr inbounds double, double* %140, i64 0
%142 = load double, double* %141
%143 = load double, double* %9
%144 = call double @llvm.fmuladd.f64(double %139, double %142, double %143)
%145 = load double*, double** %27
%146 = load i32, i32* %13
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds double, double* %145, i64 %147
store double %144, double* %148
%149 = load double*, double** %8
%150 = getelementptr inbounds double, double* %149, i64 0
%151 = load double, double* %150
%152 = fneg double %151
%153 = load double*, double** %26
%154 = load i32, i32* %14
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds double, double* %153, i64 %155
store double %152, double* %156
%157 = load double*, double** %8
%158 = getelementptr inbounds double, double* %157, i64 0
%159 = load double, double* %158
%160 = load double*, double** %7
%161 = getelementptr inbounds double, double* %160, i64 0
%162 = load double, double* %161
%163 = load double, double* %9
%164 = call double @llvm.fmuladd.f64(double %159, double %162, double %163)
%165 = load double*, double** %27
%166 = load i32, i32* %14
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds double, double* %165, i64 %167
store double %164, double* %168
%169 = load double*, double** %8
%170 = getelementptr inbounds double, double* %169, i64 1
%171 = load double, double* %170
store double %171, double* %17
%172 = load double*, double** %8
%173 = getelementptr inbounds double, double* %172, i64 1
%174 = load double, double* %173
%175 = fneg double %174
%176 = load double*, double** %7
%177 = getelementptr inbounds double, double* %176, i64 1
%178 = load double, double* %177
%179 = load double, double* %9
%180 = fneg double %179
%181 = call double @llvm.fmuladd.f64(double %175, double %178, double %180)
store double %181, double* %19
%182 = load double*, double** %8
%183 = getelementptr inbounds double, double* %182, i64 1
%184 = load double, double* %183
%185 = fneg double %184
store double %185, double* %18
%186 = load double*, double** %8
%187 = getelementptr inbounds double, double* %186, i64 1
%188 = load double, double* %187
%189 = load double*, double** %7
%190 = getelementptr inbounds double, double* %189, i64 1
%191 = load double, double* %190
%192 = load double, double* %9
%193 = fneg double %192
%194 = call double @llvm.fmuladd.f64(double %188, double %191, double %193)
store double %194, double* %20
store i32 1, i32* %12
br label %195
195: ; preds = %390, %58
%196 = load i32, i32* %12
%197 = load i32, i32* %6
%198 = sub nsw i32 %197, 1
%199 = icmp slt i32 %196, %198
br i1 %199, label %200, label %393
200: ; preds = %195
%201 = load double, double* %17
store double %201, double* %21
%202 = load double, double* %19
store double %202, double* %22
%203 = load i32, i32* %13
store i32 %203, i32* %15
br label %204
204: ; preds = %236, %200
%205 = load i32, i32* %15
%206 = load i32, i32* %14
%207 = icmp sle i32 %205, %206
br i1 %207, label %208, label %239
208: ; preds = %204
%209 = load double, double* %21
%210 = load double*, double** %25
%211 = load i32, i32* %15
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds double, double* %210, i64 %212
%214 = load double, double* %213
%215 = load double, double* %22
%216 = call double @llvm.fmuladd.f64(double %209, double %214, double %215)
%217 = load double, double* %9
%218 = fneg double %217
%219 = fcmp ogt double %216, %218
br i1 %219, label %220, label %221
220: ; preds = %208
br label %239
221: ; preds = %208
%222 = load double*, double** %26
%223 = load i32, i32* %15
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds double, double* %222, i64 %224
%226 = load double, double* %225
%227 = load double, double* %21
%228 = fadd double %227, %226
store double %228, double* %21
%229 = load double*, double** %27
%230 = load i32, i32* %15
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds double, double* %229, i64 %231
%233 = load double, double* %232
%234 = load double, double* %22
%235 = fadd double %234, %233
store double %235, double* %22
br label %236
236: ; preds = %221
%237 = load i32, i32* %15
%238 = add nsw i32 %237, 1
store i32 %238, i32* %15
br label %204
239: ; preds = %220, %204
%240 = load double, double* %18
store double %240, double* %23
%241 = load double, double* %20
store double %241, double* %24
%242 = load i32, i32* %14
store i32 %242, i32* %16
br label %243
243: ; preds = %276, %239
%244 = load i32, i32* %16
%245 = load i32, i32* %15
%246 = icmp sge i32 %244, %245
br i1 %246, label %247, label %279
247: ; preds = %243
%248 = load double, double* %23
%249 = fneg double %248
%250 = load double*, double** %25
%251 = load i32, i32* %16
%252 = sext i32 %251 to i64
%253 = getelementptr inbounds double, double* %250, i64 %252
%254 = load double, double* %253
%255 = load double, double* %24
%256 = fneg double %255
%257 = call double @llvm.fmuladd.f64(double %249, double %254, double %256)
%258 = load double, double* %9
%259 = fcmp olt double %257, %258
br i1 %259, label %260, label %261
260: ; preds = %247
br label %279
261: ; preds = %247
%262 = load double*, double** %26
%263 = load i32, i32* %16
%264 = sext i32 %263 to i64
%265 = getelementptr inbounds double, double* %262, i64 %264
%266 = load double, double* %265
%267 = load double, double* %23
%268 = fadd double %267, %266
store double %268, double* %23
%269 = load double*, double** %27
%270 = load i32, i32* %16
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds double, double* %269, i64 %271
%273 = load double, double* %272
%274 = load double, double* %24
%275 = fadd double %274, %273
store double %275, double* %24
br label %276
276: ; preds = %261
%277 = load i32, i32* %16
%278 = add nsw i32 %277, -1
store i32 %278, i32* %16
br label %243
279: ; preds = %260, %243
%280 = load double, double* %9
%281 = fneg double %280
%282 = load double, double* %22
%283 = fsub double %281, %282
%284 = load double, double* %21
%285 = fdiv double %283, %284
%286 = load double*, double** %28
%287 = load i32, i32* %12
%288 = sext i32 %287 to i64
%289 = getelementptr inbounds double, double* %286, i64 %288
store double %285, double* %289
%290 = load i32, i32* %15
%291 = sub nsw i32 %290, 1
store i32 %291, i32* %13
%292 = load double*, double** %28
%293 = load i32, i32* %12
%294 = sext i32 %293 to i64
%295 = getelementptr inbounds double, double* %292, i64 %294
%296 = load double, double* %295
%297 = load double*, double** %25
%298 = load i32, i32* %13
%299 = sext i32 %298 to i64
%300 = getelementptr inbounds double, double* %297, i64 %299
store double %296, double* %300
%301 = load double, double* %9
%302 = load double, double* %24
%303 = fadd double %301, %302
%304 = load double, double* %23
%305 = fneg double %304
%306 = fdiv double %303, %305
%307 = load double*, double** %29
%308 = load i32, i32* %12
%309 = sext i32 %308 to i64
%310 = getelementptr inbounds double, double* %307, i64 %309
store double %306, double* %310
%311 = load i32, i32* %16
%312 = add nsw i32 %311, 1
store i32 %312, i32* %14
%313 = load double*, double** %29
%314 = load i32, i32* %12
%315 = sext i32 %314 to i64
%316 = getelementptr inbounds double, double* %313, i64 %315
%317 = load double, double* %316
%318 = load double*, double** %25
%319 = load i32, i32* %14
%320 = sext i32 %319 to i64
%321 = getelementptr inbounds double, double* %318, i64 %320
store double %317, double* %321
%322 = load double, double* %21
%323 = load double*, double** %26
%324 = load i32, i32* %13
%325 = sext i32 %324 to i64
%326 = getelementptr inbounds double, double* %323, i64 %325
store double %322, double* %326
%327 = load double, double* %22
%328 = load double, double* %9
%329 = fadd double %327, %328
%330 = load double*, double** %27
%331 = load i32, i32* %13
%332 = sext i32 %331 to i64
%333 = getelementptr inbounds double, double* %330, i64 %332
store double %329, double* %333
%334 = load double, double* %23
%335 = load double*, double** %26
%336 = load i32, i32* %14
%337 = sext i32 %336 to i64
%338 = getelementptr inbounds double, double* %335, i64 %337
store double %334, double* %338
%339 = load double, double* %24
%340 = load double, double* %9
%341 = fadd double %339, %340
%342 = load double*, double** %27
%343 = load i32, i32* %14
%344 = sext i32 %343 to i64
%345 = getelementptr inbounds double, double* %342, i64 %344
store double %341, double* %345
%346 = load double*, double** %8
%347 = load i32, i32* %12
%348 = add nsw i32 %347, 1
%349 = sext i32 %348 to i64
%350 = getelementptr inbounds double, double* %346, i64 %349
%351 = load double, double* %350
store double %351, double* %17
%352 = load double*, double** %8
%353 = load i32, i32* %12
%354 = add nsw i32 %353, 1
%355 = sext i32 %354 to i64
%356 = getelementptr inbounds double, double* %352, i64 %355
%357 = load double, double* %356
%358 = fneg double %357
%359 = load double*, double** %7
%360 = load i32, i32* %12
%361 = add nsw i32 %360, 1
%362 = sext i32 %361 to i64
%363 = getelementptr inbounds double, double* %359, i64 %362
%364 = load double, double* %363
%365 = load double, double* %9
%366 = fneg double %365
%367 = call double @llvm.fmuladd.f64(double %358, double %364, double %366)
store double %367, double* %19
%368 = load double*, double** %8
%369 = load i32, i32* %12
%370 = add nsw i32 %369, 1
%371 = sext i32 %370 to i64
%372 = getelementptr inbounds double, double* %368, i64 %371
%373 = load double, double* %372
%374 = fneg double %373
store double %374, double* %18
%375 = load double*, double** %8
%376 = load i32, i32* %12
%377 = add nsw i32 %376, 1
%378 = sext i32 %377 to i64
%379 = getelementptr inbounds double, double* %375, i64 %378
%380 = load double, double* %379
%381 = load double*, double** %7
%382 = load i32, i32* %12
%383 = add nsw i32 %382, 1
%384 = sext i32 %383 to i64
%385 = getelementptr inbounds double, double* %381, i64 %384
%386 = load double, double* %385
%387 = load double, double* %9
%388 = fneg double %387
%389 = call double @llvm.fmuladd.f64(double %380, double %386, double %388)
store double %389, double* %20
br label %390
390: ; preds = %279
%391 = load i32, i32* %12
%392 = add nsw i32 %391, 1
store i32 %392, i32* %12
br label %195
393: ; preds = %195
%394 = load double, double* %17
store double %394, double* %21
%395 = load double, double* %19
store double %395, double* %22
%396 = load i32, i32* %13
store i32 %396, i32* %15
br label %397
397: ; preds = %427, %393
%398 = load i32, i32* %15
%399 = load i32, i32* %14
%400 = icmp sle i32 %398, %399
br i1 %400, label %401, label %430
401: ; preds = %397
%402 = load double, double* %21
%403 = load double*, double** %25
%404 = load i32, i32* %15
%405 = sext i32 %404 to i64
%406 = getelementptr inbounds double, double* %403, i64 %405
%407 = load double, double* %406
%408 = load double, double* %22
%409 = call double @llvm.fmuladd.f64(double %402, double %407, double %408)
%410 = fcmp ogt double %409, 0.000000e+00
br i1 %410, label %411, label %412
411: ; preds = %401
br label %430
412: ; preds = %401
%413 = load double*, double** %26
%414 = load i32, i32* %15
%415 = sext i32 %414 to i64
%416 = getelementptr inbounds double, double* %413, i64 %415
%417 = load double, double* %416
%418 = load double, double* %21
%419 = fadd double %418, %417
store double %419, double* %21
%420 = load double*, double** %27
%421 = load i32, i32* %15
%422 = sext i32 %421 to i64
%423 = getelementptr inbounds double, double* %420, i64 %422
%424 = load double, double* %423
%425 = load double, double* %22
%426 = fadd double %425, %424
store double %426, double* %22
br label %427
427: ; preds = %412
%428 = load i32, i32* %15
%429 = add nsw i32 %428, 1
store i32 %429, i32* %15
br label %397
430: ; preds = %411, %397
%431 = load double, double* %22
%432 = fneg double %431
%433 = load double, double* %21
%434 = fdiv double %432, %433
%435 = load double*, double** %10
%436 = load i32, i32* %6
%437 = sub nsw i32 %436, 1
%438 = sext i32 %437 to i64
%439 = getelementptr inbounds double, double* %435, i64 %438
store double %434, double* %439
%440 = load i32, i32* %6
%441 = sub nsw i32 %440, 2
store i32 %441, i32* %12
br label %442
442: ; preds = %504, %430
%443 = load i32, i32* %12
%444 = icmp sge i32 %443, 0
br i1 %444, label %445, label %507
445: ; preds = %442
%446 = load double*, double** %10
%447 = load i32, i32* %12
%448 = add nsw i32 %447, 1
%449 = sext i32 %448 to i64
%450 = getelementptr inbounds double, double* %446, i64 %449
%451 = load double, double* %450
%452 = load double*, double** %29
%453 = load i32, i32* %12
%454 = sext i32 %453 to i64
%455 = getelementptr inbounds double, double* %452, i64 %454
%456 = load double, double* %455
%457 = fcmp ogt double %451, %456
br i1 %457, label %458, label %468
458: ; preds = %445
%459 = load double*, double** %29
%460 = load i32, i32* %12
%461 = sext i32 %460 to i64
%462 = getelementptr inbounds double, double* %459, i64 %461
%463 = load double, double* %462
%464 = load double*, double** %10
%465 = load i32, i32* %12
%466 = sext i32 %465 to i64
%467 = getelementptr inbounds double, double* %464, i64 %466
store double %463, double* %467
br label %503
468: ; preds = %445
%469 = load double*, double** %10
%470 = load i32, i32* %12
%471 = add nsw i32 %470, 1
%472 = sext i32 %471 to i64
%473 = getelementptr inbounds double, double* %469, i64 %472
%474 = load double, double* %473
%475 = load double*, double** %28
%476 = load i32, i32* %12
%477 = sext i32 %476 to i64
%478 = getelementptr inbounds double, double* %475, i64 %477
%479 = load double, double* %478
%480 = fcmp olt double %474, %479
br i1 %480, label %481, label %491
481: ; preds = %468
%482 = load double*, double** %28
%483 = load i32, i32* %12
%484 = sext i32 %483 to i64
%485 = getelementptr inbounds double, double* %482, i64 %484
%486 = load double, double* %485
%487 = load double*, double** %10
%488 = load i32, i32* %12
%489 = sext i32 %488 to i64
%490 = getelementptr inbounds double, double* %487, i64 %489
store double %486, double* %490
br label %502
491: ; preds = %468
%492 = load double*, double** %10
%493 = load i32, i32* %12
%494 = add nsw i32 %493, 1
%495 = sext i32 %494 to i64
%496 = getelementptr inbounds double, double* %492, i64 %495
%497 = load double, double* %496
%498 = load double*, double** %10
%499 = load i32, i32* %12
%500 = sext i32 %499 to i64
%501 = getelementptr inbounds double, double* %498, i64 %500
store double %497, double* %501
br label %502
502: ; preds = %491, %481
br label %503
503: ; preds = %502, %458
br label %504
504: ; preds = %503
%505 = load i32, i32* %12
%506 = add nsw i32 %505, -1
store i32 %506, i32* %12
br label %442
507: ; preds = %442
%508 = load double*, double** %25
%509 = bitcast double* %508 to i8*
%510 = load double*, double** %26
%511 = bitcast double* %510 to i8*
%512 = load double*, double** %27
%513 = bitcast double* %512 to i8*
%514 = load double*, double** %28
%515 = bitcast double* %514 to i8*
%516 = load double*, double** %29
%517 = bitcast double* %516 to i8*
br label %518
518: ; preds = %507, %57, %32
ret void
}

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