void kernel_dtrsv_t_1_lib4(int kmax, int inverted_diag, double *A, int sda,
                           double *x) {
  if (kmax <= 0)
    return;
  __builtin_prefetch(A);
  const int lda = 4;
  const int bs = 4;
  int k;
  double *tA, *tx;
  tA = A;
  tx = x;
  double x_0, x_1, x_2, x_3, y_0 = 0;
  k = 1;
  if (kmax > 4) {
    x_1 = x[1];
    x_2 = x[2];
    x_3 = x[3];
    y_0 += A[1 + lda * 0] * x_1;
    y_0 += A[2 + lda * 0] * x_2;
    y_0 += A[3 + lda * 0] * x_3;
    k = 4;
    A += 4 + (sda - 1) * lda;
    x += 4;
    for (; k < kmax - 7; k += 8) {
      __builtin_prefetch(A + sda * bs);
      x_0 = x[0];
      x_1 = x[1];
      x_2 = x[2];
      x_3 = x[3];
      y_0 += A[0 + lda * 0] * x_0;
      y_0 += A[1 + lda * 0] * x_1;
      y_0 += A[2 + lda * 0] * x_2;
      y_0 += A[3 + lda * 0] * x_3;
      A += sda * bs;
      x += 4;
      __builtin_prefetch(A + sda * bs);
      x_0 = x[0];
      x_1 = x[1];
      x_2 = x[2];
      x_3 = x[3];
      y_0 += A[0 + lda * 0] * x_0;
      y_0 += A[1 + lda * 0] * x_1;
      y_0 += A[2 + lda * 0] * x_2;
      y_0 += A[3 + lda * 0] * x_3;
      A += sda * bs;
      x += 4;
    }
    for (; k < kmax - 3; k += 4) {
      __builtin_prefetch(A + sda * bs);
      x_0 = x[0];
      x_1 = x[1];
      x_2 = x[2];
      x_3 = x[3];
      y_0 += A[0 + lda * 0] * x_0;
      y_0 += A[1 + lda * 0] * x_1;
      y_0 += A[2 + lda * 0] * x_2;
      y_0 += A[3 + lda * 0] * x_3;
      A += sda * bs;
      x += 4;
    }
  } else {
    A += 1;
    x += 1;
  }
  for (; k < kmax; k++) {
    x_0 = x[0];
    y_0 += A[0 + lda * 0] * x_0;
    A += 1;
    x += 1;
  }
  A = tA;
  x = tx;
  if (inverted_diag) {
    y_0 = x[0] - y_0;
    y_0 *= A[0 + lda * 0];
    x[0] = y_0;
  } else {
    y_0 = x[0] - y_0;
    y_0 /= A[0 + lda * 0];
    x[0] = y_0;
  }
}


x86 assembly (clang, -O0):
<kernel_dtrsv_t_1_lib4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1124 <kernel_dtrsv_t_1_lib4+0x24>
jmp    1638 <kernel_dtrsv_t_1_lib4+0x538>
mov    -0x10(%rbp),%rax
prefetcht0 (%rax)
movl   $0x4,-0x24(%rbp)
movl   $0x4,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x1,-0x2c(%rbp)
cmpl   $0x4,-0x4(%rbp)
jle    1538 <kernel_dtrsv_t_1_lib4+0x438>
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x4,-0x2c(%rbp)
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x2,%ecx
add    $0x4,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x20(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x7,%ecx
cmp    %ecx,%eax
jge    141e <kernel_dtrsv_t_1_lib4+0x31e>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
prefetcht0 (%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
prefetcht0 (%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x20(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x2c(%rbp)
jmp    121d <kernel_dtrsv_t_1_lib4+0x11d>
jmp    1423 <kernel_dtrsv_t_1_lib4+0x323>
mov    -0x2c(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jge    1533 <kernel_dtrsv_t_1_lib4+0x433>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
prefetcht0 (%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x20(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x2c(%rbp)
jmp    1423 <kernel_dtrsv_t_1_lib4+0x323>
jmp    1550 <kernel_dtrsv_t_1_lib4+0x450>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
jmp    1555 <kernel_dtrsv_t_1_lib4+0x455>
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    15b3 <kernel_dtrsv_t_1_lib4+0x4b3>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1555 <kernel_dtrsv_t_1_lib4+0x455>
mov    -0x38(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1603 <kernel_dtrsv_t_1_lib4+0x503>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1638 <kernel_dtrsv_t_1_lib4+0x538>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x68(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_dtrsv_t_1_lib4>:
test   %edi,%edi
jle    136a <kernel_dtrsv_t_1_lib4+0x26a>
push   %rbp
push   %r14
push   %rbx
prefetcht0 (%rdx)
cmp    $0x5,%edi
jb     122f <kernel_dtrsv_t_1_lib4+0x12f>
movsd  0x8(%rdx),%xmm0
movsd  0x10(%rdx),%xmm1
mulsd  0x8(%r8),%xmm0
xorpd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
mulsd  0x10(%r8),%xmm1
addsd  %xmm2,%xmm1
movsd  0x18(%rdx),%xmm0
mulsd  0x18(%r8),%xmm0
addsd  %xmm1,%xmm0
shl    $0x2,%ecx
movslq %ecx,%r10
lea    0x20(%r8),%rax
cmp    $0xc,%edi
jb     1243 <kernel_dtrsv_t_1_lib4+0x143>
lea    -0x7(%rdi),%r11d
lea    -0xc(%rdi),%r9d
and    $0xfffffff8,%r9d
mov    %r10,%rcx
shl    $0x4,%rcx
lea    0x0(,%r10,8),%rbx
lea    (%rbx,%rbx,2),%r14
mov    $0x4,%ebp
mov    %rdx,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
prefetcht0 (%rbx,%rcx,1)
movsd  (%rbx,%r10,8),%xmm1
movsd  0x8(%rbx,%r10,8),%xmm2
mulsd  (%rax),%xmm1
addsd  %xmm0,%xmm1
mulsd  0x8(%rax),%xmm2
addsd  %xmm1,%xmm2
movsd  0x10(%rbx,%r10,8),%xmm0
mulsd  0x10(%rax),%xmm0
addsd  %xmm2,%xmm0
movsd  0x18(%rbx,%r10,8),%xmm1
mulsd  0x18(%rax),%xmm1
addsd  %xmm0,%xmm1
prefetcht0 (%rbx,%r14,1)
movsd  (%rbx,%rcx,1),%xmm0
movsd  0x8(%rbx,%rcx,1),%xmm2
mulsd  0x20(%rax),%xmm0
addsd  %xmm1,%xmm0
mulsd  0x28(%rax),%xmm2
addsd  %xmm0,%xmm2
movsd  0x10(%rbx,%rcx,1),%xmm1
mulsd  0x30(%rax),%xmm1
movsd  0x18(%rbx,%rcx,1),%xmm0
add    %rcx,%rbx
addsd  %xmm2,%xmm1
mulsd  0x38(%rax),%xmm0
addsd  %xmm1,%xmm0
add    $0x8,%ebp
add    $0x40,%rax
cmp    %r11d,%ebp
jl     1190 <kernel_dtrsv_t_1_lib4+0x90>
add    $0xc,%r9d
lea    (%rbx,%r10,8),%rcx
jmp    124d <kernel_dtrsv_t_1_lib4+0x14d>
lea    0x8(%rdx),%rcx
lea    0x8(%r8),%rax
xorpd  %xmm0,%xmm0
mov    $0x1,%r9d
jmp    12ab <kernel_dtrsv_t_1_lib4+0x1ab>
lea    (%rdx,%r10,8),%rcx
mov    $0x4,%r9d
lea    -0x3(%rdi),%ebp
cmp    %ebp,%r9d
jge    12ab <kernel_dtrsv_t_1_lib4+0x1ab>
shl    $0x3,%r10
nopl   0x0(%rax)
prefetcht0 (%rcx,%r10,1)
movsd  (%rcx),%xmm1
movsd  0x8(%rcx),%xmm2
mulsd  (%rax),%xmm1
addsd  %xmm0,%xmm1
mulsd  0x8(%rax),%xmm2
addsd  %xmm1,%xmm2
movsd  0x10(%rcx),%xmm1
mulsd  0x10(%rax),%xmm1
movsd  0x18(%rcx),%xmm0
add    %r10,%rcx
addsd  %xmm2,%xmm1
mulsd  0x18(%rax),%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rax
add    $0x4,%r9d
cmp    %ebp,%r9d
jl     1260 <kernel_dtrsv_t_1_lib4+0x160>
cmp    %edi,%r9d
jge    1346 <kernel_dtrsv_t_1_lib4+0x246>
mov    %edi,%ebx
sub    %r9d,%ebx
mov    %r9d,%r10d
not    %r10d
add    %edi,%r10d
and    $0x3,%ebx
je     12ee <kernel_dtrsv_t_1_lib4+0x1ee>
neg    %ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
movsd  (%rcx),%xmm1
mulsd  (%rax),%xmm1
addsd  %xmm1,%xmm0
add    $0x8,%rcx
add    $0x8,%rax
add    $0xffffffff,%ebp
cmp    %ebp,%ebx
jne    12d0 <kernel_dtrsv_t_1_lib4+0x1d0>
sub    %ebp,%r9d
cmp    $0x3,%r10d
jb     1346 <kernel_dtrsv_t_1_lib4+0x246>
sub    %r9d,%edi
xor    %ebp,%ebp
nopl   0x0(%rax)
movsd  (%rcx,%rbp,8),%xmm1
movsd  0x8(%rcx,%rbp,8),%xmm2
mulsd  (%rax,%rbp,8),%xmm1
mulsd  0x8(%rax,%rbp,8),%xmm2
addsd  %xmm0,%xmm1
movsd  0x10(%rcx,%rbp,8),%xmm3
mulsd  0x10(%rax,%rbp,8),%xmm3
addsd  %xmm1,%xmm2
movsd  0x18(%rcx,%rbp,8),%xmm0
mulsd  0x18(%rax,%rbp,8),%xmm0
addsd  %xmm2,%xmm3
addsd  %xmm3,%xmm0
add    $0x4,%rbp
cmp    %ebp,%edi
jne    1300 <kernel_dtrsv_t_1_lib4+0x200>
movsd  (%r8),%xmm1
subsd  %xmm0,%xmm1
movsd  (%rdx),%xmm0
test   %esi,%esi
je     135d <kernel_dtrsv_t_1_lib4+0x25d>
mulsd  %xmm0,%xmm1
jmp    1361 <kernel_dtrsv_t_1_lib4+0x261>
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r8)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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