void kernel_dtrsv_t_1_lib4_new(int kmax, double *A, int sda, int use_inv_diag_A,
                               double *inv_diag_A, 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 (use_inv_diag_A) {
    y_0 = x[0] - y_0;
    y_0 *= inv_diag_A[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_new>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1128 <kernel_dtrsv_t_1_lib4_new+0x28>
jmp    163c <kernel_dtrsv_t_1_lib4_new+0x53c>
mov    -0x10(%rbp),%rax
prefetcht0 (%rax)
movl   $0x4,-0x2c(%rbp)
movl   $0x4,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x1,-0x34(%rbp)
cmpl   $0x4,-0x4(%rbp)
jle    153c <kernel_dtrsv_t_1_lib4_new+0x43c>
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x4,-0x34(%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    -0x28(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x28(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x7,%ecx
cmp    %ecx,%eax
jge    1422 <kernel_dtrsv_t_1_lib4_new+0x322>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
prefetcht0 (%rax)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%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    -0x28(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
prefetcht0 (%rax)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%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    -0x28(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x28(%rbp)
mov    -0x34(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x34(%rbp)
jmp    1221 <kernel_dtrsv_t_1_lib4_new+0x121>
jmp    1427 <kernel_dtrsv_t_1_lib4_new+0x327>
mov    -0x34(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jge    1537 <kernel_dtrsv_t_1_lib4_new+0x437>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
prefetcht0 (%rax)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%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    -0x28(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x28(%rbp)
mov    -0x34(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x34(%rbp)
jmp    1427 <kernel_dtrsv_t_1_lib4_new+0x327>
jmp    1554 <kernel_dtrsv_t_1_lib4_new+0x454>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x28(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
jmp    1559 <kernel_dtrsv_t_1_lib4_new+0x459>
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    15b7 <kernel_dtrsv_t_1_lib4_new+0x4b7>
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x28(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1559 <kernel_dtrsv_t_1_lib4_new+0x459>
mov    -0x40(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1607 <kernel_dtrsv_t_1_lib4_new+0x507>
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    163c <kernel_dtrsv_t_1_lib4_new+0x53c>
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x70(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_dtrsv_t_1_lib4_new>:
test   %edi,%edi
jle    1369 <kernel_dtrsv_t_1_lib4_new+0x269>
push   %rbp
push   %r15
push   %r14
push   %rbx
prefetcht0 (%rsi)
cmp    $0x5,%edi
jb     122f <kernel_dtrsv_t_1_lib4_new+0x12f>
movsd  0x8(%rsi),%xmm0
movsd  0x10(%rsi),%xmm1
mulsd  0x8(%r9),%xmm0
xorpd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
mulsd  0x10(%r9),%xmm1
addsd  %xmm2,%xmm1
movsd  0x18(%rsi),%xmm0
mulsd  0x18(%r9),%xmm0
addsd  %xmm1,%xmm0
shl    $0x2,%edx
movslq %edx,%r11
lea    0x20(%r9),%rax
cmp    $0xc,%edi
jb     1243 <kernel_dtrsv_t_1_lib4_new+0x143>
lea    -0x7(%rdi),%r14d
lea    -0xc(%rdi),%r10d
and    $0xfffffff8,%r10d
mov    %r11,%rbx
shl    $0x4,%rbx
lea    0x0(,%r11,8),%rdx
lea    (%rdx,%rdx,2),%r15
mov    $0x4,%ebp
mov    %rsi,%rdx
cs nopw 0x0(%rax,%rax,1)
nop
prefetcht0 (%rdx,%rbx,1)
movsd  (%rdx,%r11,8),%xmm1
movsd  0x8(%rdx,%r11,8),%xmm2
mulsd  (%rax),%xmm1
addsd  %xmm0,%xmm1
mulsd  0x8(%rax),%xmm2
addsd  %xmm1,%xmm2
movsd  0x10(%rdx,%r11,8),%xmm0
mulsd  0x10(%rax),%xmm0
addsd  %xmm2,%xmm0
movsd  0x18(%rdx,%r11,8),%xmm1
mulsd  0x18(%rax),%xmm1
addsd  %xmm0,%xmm1
prefetcht0 (%rdx,%r15,1)
movsd  (%rdx,%rbx,1),%xmm0
movsd  0x8(%rdx,%rbx,1),%xmm2
mulsd  0x20(%rax),%xmm0
addsd  %xmm1,%xmm0
mulsd  0x28(%rax),%xmm2
addsd  %xmm0,%xmm2
movsd  0x10(%rdx,%rbx,1),%xmm1
mulsd  0x30(%rax),%xmm1
movsd  0x18(%rdx,%rbx,1),%xmm0
add    %rbx,%rdx
addsd  %xmm2,%xmm1
mulsd  0x38(%rax),%xmm0
addsd  %xmm1,%xmm0
add    $0x8,%ebp
add    $0x40,%rax
cmp    %r14d,%ebp
jl     1190 <kernel_dtrsv_t_1_lib4_new+0x90>
add    $0xc,%r10d
lea    (%rdx,%r11,8),%rdx
jmp    124d <kernel_dtrsv_t_1_lib4_new+0x14d>
lea    0x8(%rsi),%rdx
lea    0x8(%r9),%rax
xorpd  %xmm0,%xmm0
mov    $0x1,%r10d
jmp    12ab <kernel_dtrsv_t_1_lib4_new+0x1ab>
lea    (%rsi,%r11,8),%rdx
mov    $0x4,%r10d
lea    -0x3(%rdi),%ebx
cmp    %ebx,%r10d
jge    12ab <kernel_dtrsv_t_1_lib4_new+0x1ab>
shl    $0x3,%r11
nopl   0x0(%rax)
prefetcht0 (%rdx,%r11,1)
movsd  (%rdx),%xmm1
movsd  0x8(%rdx),%xmm2
mulsd  (%rax),%xmm1
addsd  %xmm0,%xmm1
mulsd  0x8(%rax),%xmm2
addsd  %xmm1,%xmm2
movsd  0x10(%rdx),%xmm1
mulsd  0x10(%rax),%xmm1
movsd  0x18(%rdx),%xmm0
add    %r11,%rdx
addsd  %xmm2,%xmm1
mulsd  0x18(%rax),%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rax
add    $0x4,%r10d
cmp    %ebx,%r10d
jl     1260 <kernel_dtrsv_t_1_lib4_new+0x160>
cmp    %edi,%r10d
jge    1346 <kernel_dtrsv_t_1_lib4_new+0x246>
mov    %edi,%ebx
sub    %r10d,%ebx
mov    %r10d,%r11d
not    %r11d
add    %edi,%r11d
and    $0x3,%ebx
je     12ee <kernel_dtrsv_t_1_lib4_new+0x1ee>
neg    %ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
movsd  (%rdx),%xmm1
mulsd  (%rax),%xmm1
addsd  %xmm1,%xmm0
add    $0x8,%rdx
add    $0x8,%rax
add    $0xffffffff,%ebp
cmp    %ebp,%ebx
jne    12d0 <kernel_dtrsv_t_1_lib4_new+0x1d0>
sub    %ebp,%r10d
cmp    $0x3,%r11d
jb     1346 <kernel_dtrsv_t_1_lib4_new+0x246>
sub    %r10d,%edi
xor    %ebp,%ebp
nopl   0x0(%rax)
movsd  (%rdx,%rbp,8),%xmm1
movsd  0x8(%rdx,%rbp,8),%xmm2
mulsd  (%rax,%rbp,8),%xmm1
mulsd  0x8(%rax,%rbp,8),%xmm2
addsd  %xmm0,%xmm1
movsd  0x10(%rdx,%rbp,8),%xmm3
mulsd  0x10(%rax,%rbp,8),%xmm3
addsd  %xmm1,%xmm2
movsd  0x18(%rdx,%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_new+0x200>
movsd  (%r9),%xmm1
subsd  %xmm0,%xmm1
test   %ecx,%ecx
je     135a <kernel_dtrsv_t_1_lib4_new+0x25a>
mulsd  (%r8),%xmm1
jmp    135e <kernel_dtrsv_t_1_lib4_new+0x25e>
divsd  (%rsi),%xmm1
movsd  %xmm1,(%r9)
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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