void kernel_dtrsv_t_1_lib4(int kmax, int inverted_diag, double *A, int sda,
                           double *x) {
  if (kmax <= 0)
    return;
  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) {
      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;
      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) {
      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    15ec <kernel_dtrsv_t_1_lib4+0x4ec>
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    14ec <kernel_dtrsv_t_1_lib4+0x3ec>
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    13e9 <kernel_dtrsv_t_1_lib4+0x2e9>
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    -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    1216 <kernel_dtrsv_t_1_lib4+0x116>
jmp    13ee <kernel_dtrsv_t_1_lib4+0x2ee>
mov    -0x2c(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jge    14e7 <kernel_dtrsv_t_1_lib4+0x3e7>
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    13ee <kernel_dtrsv_t_1_lib4+0x2ee>
jmp    1504 <kernel_dtrsv_t_1_lib4+0x404>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
jmp    1509 <kernel_dtrsv_t_1_lib4+0x409>
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1567 <kernel_dtrsv_t_1_lib4+0x467>
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    1509 <kernel_dtrsv_t_1_lib4+0x409>
mov    -0x38(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     15b7 <kernel_dtrsv_t_1_lib4+0x4b7>
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    15ec <kernel_dtrsv_t_1_lib4+0x4ec>
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    135c <kernel_dtrsv_t_1_lib4+0x25c>
push   %rbp
push   %r15
push   %r14
push   %rbx
cmp    $0x5,%edi
jb     1288 <kernel_dtrsv_t_1_lib4+0x188>
movsd  0x8(%rdx),%xmm0
mulsd  0x8(%r8),%xmm0
movsd  0x10(%rdx),%xmm1
xorpd  %xmm2,%xmm2
mulsd  0x10(%r8),%xmm1
addsd  %xmm0,%xmm2
movsd  0x18(%rdx),%xmm0
mulsd  0x18(%r8),%xmm0
addsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
shl    $0x2,%ecx
movslq %ecx,%r10
lea    (%rdx,%r10,8),%rbx
lea    0x20(%r8),%rax
mov    $0x4,%r9d
cmp    $0xc,%edi
jb     1229 <kernel_dtrsv_t_1_lib4+0x129>
lea    -0x7(%rdi),%r11d
lea    -0xc(%rdi),%r9d
and    $0xfffffff8,%r9d
mov    %r10,%r14
shl    $0x4,%r14
lea    0x0(,%r10,8),%r15
mov    $0x4,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rcx
movsd  (%rbx),%xmm1
movsd  0x8(%rbx),%xmm2
mulsd  (%rax),%xmm1
addsd  %xmm0,%xmm1
mulsd  0x8(%rax),%xmm2
addsd  %xmm1,%xmm2
movsd  0x10(%rbx),%xmm0
mulsd  0x10(%rax),%xmm0
addsd  %xmm2,%xmm0
movsd  0x18(%rbx),%xmm1
mulsd  0x18(%rax),%xmm1
addsd  %xmm0,%xmm1
lea    (%rbx,%r15,1),%rbx
movsd  (%rcx,%r15,1),%xmm0
movsd  0x8(%rcx,%r15,1),%xmm2
mulsd  0x20(%rax),%xmm0
addsd  %xmm1,%xmm0
mulsd  0x28(%rax),%xmm2
addsd  %xmm0,%xmm2
movsd  0x10(%rcx,%r15,1),%xmm1
mulsd  0x30(%rax),%xmm1
addsd  %xmm2,%xmm1
movsd  0x18(%rcx,%r15,1),%xmm0
mulsd  0x38(%rax),%xmm0
addsd  %xmm1,%xmm0
add    $0x8,%ebp
add    $0x40,%rax
add    %r15,%rbx
cmp    %r11d,%ebp
jl     1190 <kernel_dtrsv_t_1_lib4+0x90>
add    %r14,%rcx
add    $0xc,%r9d
mov    %rcx,%rbx
lea    -0x3(%rdi),%ecx
cmp    %ecx,%r9d
jge    129a <kernel_dtrsv_t_1_lib4+0x19a>
shl    $0x3,%r10
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%rbx),%xmm1
movsd  0x8(%rbx),%xmm2
mulsd  (%rax),%xmm1
addsd  %xmm0,%xmm1
mulsd  0x8(%rax),%xmm2
addsd  %xmm1,%xmm2
movsd  0x10(%rbx),%xmm1
mulsd  0x10(%rax),%xmm1
addsd  %xmm2,%xmm1
movsd  0x18(%rbx),%xmm0
mulsd  0x18(%rax),%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rax
add    $0x4,%r9d
add    %r10,%rbx
cmp    %ecx,%r9d
jl     1240 <kernel_dtrsv_t_1_lib4+0x140>
jmp    129a <kernel_dtrsv_t_1_lib4+0x19a>
lea    0x8(%rdx),%rbx
lea    0x8(%r8),%rax
xorpd  %xmm0,%xmm0
mov    $0x1,%r9d
cmp    %edi,%r9d
jge    1336 <kernel_dtrsv_t_1_lib4+0x236>
mov    %edi,%ebp
sub    %r9d,%ebp
mov    %r9d,%r10d
not    %r10d
add    %edi,%r10d
and    $0x3,%ebp
je     12de <kernel_dtrsv_t_1_lib4+0x1de>
neg    %ebp
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
movsd  (%rbx),%xmm1
mulsd  (%rax),%xmm1
addsd  %xmm1,%xmm0
add    $0x8,%rbx
add    $0x8,%rax
add    $0xffffffff,%ecx
cmp    %ecx,%ebp
jne    12c0 <kernel_dtrsv_t_1_lib4+0x1c0>
sub    %ecx,%r9d
cmp    $0x3,%r10d
jb     1336 <kernel_dtrsv_t_1_lib4+0x236>
sub    %r9d,%edi
xor    %ecx,%ecx
nopl   0x0(%rax)
movsd  (%rbx,%rcx,8),%xmm1
movsd  0x8(%rbx,%rcx,8),%xmm2
mulsd  (%rax,%rcx,8),%xmm1
mulsd  0x8(%rax,%rcx,8),%xmm2
addsd  %xmm0,%xmm1
movsd  0x10(%rbx,%rcx,8),%xmm3
mulsd  0x10(%rax,%rcx,8),%xmm3
addsd  %xmm1,%xmm2
movsd  0x18(%rbx,%rcx,8),%xmm0
mulsd  0x18(%rax,%rcx,8),%xmm0
addsd  %xmm2,%xmm3
addsd  %xmm3,%xmm0
add    $0x4,%rcx
cmp    %ecx,%edi
jne    12f0 <kernel_dtrsv_t_1_lib4+0x1f0>
movsd  (%r8),%xmm1
subsd  %xmm0,%xmm1
movsd  (%rdx),%xmm0
test   %esi,%esi
je     134d <kernel_dtrsv_t_1_lib4+0x24d>
mulsd  %xmm0,%xmm1
jmp    1351 <kernel_dtrsv_t_1_lib4+0x251>
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r8)
pop    %rbx
pop    %r14
pop    %r15
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 %275
24: ; preds = %5
store i32 4, i32* %11
store i32 4, i32* %12
%25 = load double*, double** %8
store double* %25, double** %14
%26 = load double*, double** %10
store double* %26, double** %15
store double 0.000000e+00, double* %20
store i32 1, i32* %13
%27 = load i32, i32* %6
%28 = icmp sgt i32 %27, 4
br i1 %28, label %29, label %215
29: ; preds = %24
%30 = load double*, double** %10
%31 = getelementptr inbounds double, double* %30, i64 1
%32 = load double, double* %31
store double %32, double* %17
%33 = load double*, double** %10
%34 = getelementptr inbounds double, double* %33, i64 2
%35 = load double, double* %34
store double %35, double* %18
%36 = load double*, double** %10
%37 = getelementptr inbounds double, double* %36, i64 3
%38 = load double, double* %37
store double %38, double* %19
%39 = load double*, double** %8
%40 = getelementptr inbounds double, double* %39, i64 1
%41 = load double, double* %40
%42 = load double, double* %17
%43 = load double, double* %20
%44 = call double @llvm.fmuladd.f64(double %41, double %42, double %43)
store double %44, double* %20
%45 = load double*, double** %8
%46 = getelementptr inbounds double, double* %45, i64 2
%47 = load double, double* %46
%48 = load double, double* %18
%49 = load double, double* %20
%50 = call double @llvm.fmuladd.f64(double %47, double %48, double %49)
store double %50, double* %20
%51 = load double*, double** %8
%52 = getelementptr inbounds double, double* %51, i64 3
%53 = load double, double* %52
%54 = load double, double* %19
%55 = load double, double* %20
%56 = call double @llvm.fmuladd.f64(double %53, double %54, double %55)
store double %56, double* %20
store i32 4, i32* %13
%57 = load i32, i32* %9
%58 = sub nsw i32 %57, 1
%59 = mul nsw i32 %58, 4
%60 = add nsw i32 4, %59
%61 = load double*, double** %8
%62 = sext i32 %60 to i64
%63 = getelementptr inbounds double, double* %61, i64 %62
store double* %63, double** %8
%64 = load double*, double** %10
%65 = getelementptr inbounds double, double* %64, i64 4
store double* %65, double** %10
br label %66
66: ; preds = %158, %29
%67 = load i32, i32* %13
%68 = load i32, i32* %6
%69 = sub nsw i32 %68, 7
%70 = icmp slt i32 %67, %69
br i1 %70, label %71, label %161
71: ; preds = %66
%72 = load double*, double** %10
%73 = getelementptr inbounds double, double* %72, i64 0
%74 = load double, double* %73
store double %74, double* %16
%75 = load double*, double** %10
%76 = getelementptr inbounds double, double* %75, i64 1
%77 = load double, double* %76
store double %77, double* %17
%78 = load double*, double** %10
%79 = getelementptr inbounds double, double* %78, i64 2
%80 = load double, double* %79
store double %80, double* %18
%81 = load double*, double** %10
%82 = getelementptr inbounds double, double* %81, i64 3
%83 = load double, double* %82
store double %83, double* %19
%84 = load double*, double** %8
%85 = getelementptr inbounds double, double* %84, i64 0
%86 = load double, double* %85
%87 = load double, double* %16
%88 = load double, double* %20
%89 = call double @llvm.fmuladd.f64(double %86, double %87, double %88)
store double %89, double* %20
%90 = load double*, double** %8
%91 = getelementptr inbounds double, double* %90, i64 1
%92 = load double, double* %91
%93 = load double, double* %17
%94 = load double, double* %20
%95 = call double @llvm.fmuladd.f64(double %92, double %93, double %94)
store double %95, double* %20
%96 = load double*, double** %8
%97 = getelementptr inbounds double, double* %96, i64 2
%98 = load double, double* %97
%99 = load double, double* %18
%100 = load double, double* %20
%101 = call double @llvm.fmuladd.f64(double %98, double %99, double %100)
store double %101, double* %20
%102 = load double*, double** %8
%103 = getelementptr inbounds double, double* %102, i64 3
%104 = load double, double* %103
%105 = load double, double* %19
%106 = load double, double* %20
%107 = call double @llvm.fmuladd.f64(double %104, double %105, double %106)
store double %107, double* %20
%108 = load i32, i32* %9
%109 = mul nsw i32 %108, 4
%110 = load double*, double** %8
%111 = sext i32 %109 to i64
%112 = getelementptr inbounds double, double* %110, i64 %111
store double* %112, double** %8
%113 = load double*, double** %10
%114 = getelementptr inbounds double, double* %113, i64 4
store double* %114, double** %10
%115 = load double*, double** %10
%116 = getelementptr inbounds double, double* %115, i64 0
%117 = load double, double* %116
store double %117, double* %16
%118 = load double*, double** %10
%119 = getelementptr inbounds double, double* %118, i64 1
%120 = load double, double* %119
store double %120, double* %17
%121 = load double*, double** %10
%122 = getelementptr inbounds double, double* %121, i64 2
%123 = load double, double* %122
store double %123, double* %18
%124 = load double*, double** %10
%125 = getelementptr inbounds double, double* %124, i64 3
%126 = load double, double* %125
store double %126, double* %19
%127 = load double*, double** %8
%128 = getelementptr inbounds double, double* %127, i64 0
%129 = load double, double* %128
%130 = load double, double* %16
%131 = load double, double* %20
%132 = call double @llvm.fmuladd.f64(double %129, double %130, double %131)
store double %132, double* %20
%133 = load double*, double** %8
%134 = getelementptr inbounds double, double* %133, i64 1
%135 = load double, double* %134
%136 = load double, double* %17
%137 = load double, double* %20
%138 = call double @llvm.fmuladd.f64(double %135, double %136, double %137)
store double %138, double* %20
%139 = load double*, double** %8
%140 = getelementptr inbounds double, double* %139, i64 2
%141 = load double, double* %140
%142 = load double, double* %18
%143 = load double, double* %20
%144 = call double @llvm.fmuladd.f64(double %141, double %142, double %143)
store double %144, double* %20
%145 = load double*, double** %8
%146 = getelementptr inbounds double, double* %145, i64 3
%147 = load double, double* %146
%148 = load double, double* %19
%149 = load double, double* %20
%150 = call double @llvm.fmuladd.f64(double %147, double %148, double %149)
store double %150, double* %20
%151 = load i32, i32* %9
%152 = mul nsw i32 %151, 4
%153 = load double*, double** %8
%154 = sext i32 %152 to i64
%155 = getelementptr inbounds double, double* %153, i64 %154
store double* %155, double** %8
%156 = load double*, double** %10
%157 = getelementptr inbounds double, double* %156, i64 4
store double* %157, double** %10
br label %158
158: ; preds = %71
%159 = load i32, i32* %13
%160 = add nsw i32 %159, 8
store i32 %160, i32* %13
br label %66
161: ; preds = %66
br label %162
162: ; preds = %211, %161
%163 = load i32, i32* %13
%164 = load i32, i32* %6
%165 = sub nsw i32 %164, 3
%166 = icmp slt i32 %163, %165
br i1 %166, label %167, label %214
167: ; preds = %162
%168 = load double*, double** %10
%169 = getelementptr inbounds double, double* %168, i64 0
%170 = load double, double* %169
store double %170, double* %16
%171 = load double*, double** %10
%172 = getelementptr inbounds double, double* %171, i64 1
%173 = load double, double* %172
store double %173, double* %17
%174 = load double*, double** %10
%175 = getelementptr inbounds double, double* %174, i64 2
%176 = load double, double* %175
store double %176, double* %18
%177 = load double*, double** %10
%178 = getelementptr inbounds double, double* %177, i64 3
%179 = load double, double* %178
store double %179, double* %19
%180 = load double*, double** %8
%181 = getelementptr inbounds double, double* %180, i64 0
%182 = load double, double* %181
%183 = load double, double* %16
%184 = load double, double* %20
%185 = call double @llvm.fmuladd.f64(double %182, double %183, double %184)
store double %185, double* %20
%186 = load double*, double** %8
%187 = getelementptr inbounds double, double* %186, i64 1
%188 = load double, double* %187
%189 = load double, double* %17
%190 = load double, double* %20
%191 = call double @llvm.fmuladd.f64(double %188, double %189, double %190)
store double %191, double* %20
%192 = load double*, double** %8
%193 = getelementptr inbounds double, double* %192, i64 2
%194 = load double, double* %193
%195 = load double, double* %18
%196 = load double, double* %20
%197 = call double @llvm.fmuladd.f64(double %194, double %195, double %196)
store double %197, double* %20
%198 = load double*, double** %8
%199 = getelementptr inbounds double, double* %198, i64 3
%200 = load double, double* %199
%201 = load double, double* %19
%202 = load double, double* %20
%203 = call double @llvm.fmuladd.f64(double %200, double %201, double %202)
store double %203, double* %20
%204 = load i32, i32* %9
%205 = mul nsw i32 %204, 4
%206 = load double*, double** %8
%207 = sext i32 %205 to i64
%208 = getelementptr inbounds double, double* %206, i64 %207
store double* %208, double** %8
%209 = load double*, double** %10
%210 = getelementptr inbounds double, double* %209, i64 4
store double* %210, double** %10
br label %211
211: ; preds = %167
%212 = load i32, i32* %13
%213 = add nsw i32 %212, 4
store i32 %213, i32* %13
br label %162
214: ; preds = %162
br label %220
215: ; preds = %24
%216 = load double*, double** %8
%217 = getelementptr inbounds double, double* %216, i64 1
store double* %217, double** %8
%218 = load double*, double** %10
%219 = getelementptr inbounds double, double* %218, i64 1
store double* %219, double** %10
br label %220
220: ; preds = %215, %214
br label %221
221: ; preds = %239, %220
%222 = load i32, i32* %13
%223 = load i32, i32* %6
%224 = icmp slt i32 %222, %223
br i1 %224, label %225, label %242
225: ; preds = %221
%226 = load double*, double** %10
%227 = getelementptr inbounds double, double* %226, i64 0
%228 = load double, double* %227
store double %228, double* %16
%229 = load double*, double** %8
%230 = getelementptr inbounds double, double* %229, i64 0
%231 = load double, double* %230
%232 = load double, double* %16
%233 = load double, double* %20
%234 = call double @llvm.fmuladd.f64(double %231, double %232, double %233)
store double %234, double* %20
%235 = load double*, double** %8
%236 = getelementptr inbounds double, double* %235, i64 1
store double* %236, double** %8
%237 = load double*, double** %10
%238 = getelementptr inbounds double, double* %237, i64 1
store double* %238, double** %10
br label %239
239: ; preds = %225
%240 = load i32, i32* %13
%241 = add nsw i32 %240, 1
store i32 %241, i32* %13
br label %221
242: ; preds = %221
%243 = load double*, double** %14
store double* %243, double** %8
%244 = load double*, double** %15
store double* %244, double** %10
%245 = load i32, i32* %7
%246 = icmp ne i32 %245, 0
br i1 %246, label %247, label %261
247: ; preds = %242
%248 = load double*, double** %10
%249 = getelementptr inbounds double, double* %248, i64 0
%250 = load double, double* %249
%251 = load double, double* %20
%252 = fsub double %250, %251
store double %252, double* %20
%253 = load double*, double** %8
%254 = getelementptr inbounds double, double* %253, i64 0
%255 = load double, double* %254
%256 = load double, double* %20
%257 = fmul double %256, %255
store double %257, double* %20
%258 = load double, double* %20
%259 = load double*, double** %10
%260 = getelementptr inbounds double, double* %259, i64 0
store double %258, double* %260
br label %275
261: ; preds = %242
%262 = load double*, double** %10
%263 = getelementptr inbounds double, double* %262, i64 0
%264 = load double, double* %263
%265 = load double, double* %20
%266 = fsub double %264, %265
store double %266, double* %20
%267 = load double*, double** %8
%268 = getelementptr inbounds double, double* %267, i64 0
%269 = load double, double* %268
%270 = load double, double* %20
%271 = fdiv double %270, %269
store double %271, double* %20
%272 = load double, double* %20
%273 = load double*, double** %10
%274 = getelementptr inbounds double, double* %273, i64 0
store double %272, double* %274
br label %275
275: ; preds = %23, %261, %247
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 %193, label %7
7: ; preds = %5
%8 = icmp ugt i32 %0, 4
br i1 %8, label %9, label %118
9: ; preds = %7
%10 = getelementptr inbounds double, double* %4, i64 1
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %4, i64 2
%13 = load double, double* %12
%14 = getelementptr inbounds double, double* %4, i64 3
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %2, i64 1
%17 = load double, double* %16
%18 = tail call double @llvm.fmuladd.f64(double %17, double %11, double 0.000000e+00)
%19 = getelementptr inbounds double, double* %2, i64 2
%20 = load double, double* %19
%21 = tail call double @llvm.fmuladd.f64(double %20, double %13, double %18)
%22 = getelementptr inbounds double, double* %2, i64 3
%23 = load double, double* %22
%24 = tail call double @llvm.fmuladd.f64(double %23, double %15, double %21)
%25 = shl i32 %3, 2
%26 = sext i32 %25 to i64
%27 = add nsw i32 %0, -7
%28 = getelementptr inbounds double, double* %2, i64 %26
%29 = getelementptr inbounds double, double* %4, i64 4
%30 = icmp ugt i32 %0, 11
br i1 %30, label %31, label %36
31: ; preds = %9
%32 = add nsw i32 %0, -12
%33 = and i32 %32, -8
br label %43
34: ; preds = %43
%35 = add i32 %33, 12
br label %36
36: ; preds = %34, %9
%37 = phi i32 [ 4, %9 ], [ %35, %34 ]
%38 = phi double [ %24, %9 ], [ %86, %34 ]
%39 = phi double* [ %28, %9 ], [ %88, %34 ]
%40 = phi double* [ %29, %9 ], [ %89, %34 ]
%41 = add nsw i32 %0, -3
%42 = icmp slt i32 %37, %41
br i1 %42, label %91, label %121
43: ; preds = %31, %43
%44 = phi double* [ %89, %43 ], [ %29, %31 ]
%45 = phi double* [ %88, %43 ], [ %28, %31 ]
%46 = phi double [ %86, %43 ], [ %24, %31 ]
%47 = phi double* [ %68, %43 ], [ %4, %31 ]
%48 = phi i32 [ %87, %43 ], [ 4, %31 ]
%49 = load double, double* %44
%50 = getelementptr inbounds double, double* %47, i64 5
%51 = load double, double* %50
%52 = getelementptr inbounds double, double* %47, i64 6
%53 = load double, double* %52
%54 = getelementptr inbounds double, double* %47, i64 7
%55 = load double, double* %54
%56 = load double, double* %45
%57 = tail call double @llvm.fmuladd.f64(double %56, double %49, double %46)
%58 = getelementptr inbounds double, double* %45, i64 1
%59 = load double, double* %58
%60 = tail call double @llvm.fmuladd.f64(double %59, double %51, double %57)
%61 = getelementptr inbounds double, double* %45, i64 2
%62 = load double, double* %61
%63 = tail call double @llvm.fmuladd.f64(double %62, double %53, double %60)
%64 = getelementptr inbounds double, double* %45, i64 3
%65 = load double, double* %64
%66 = tail call double @llvm.fmuladd.f64(double %65, double %55, double %63)
%67 = getelementptr inbounds double, double* %45, i64 %26
%68 = getelementptr inbounds double, double* %47, i64 8
%69 = load double, double* %68
%70 = getelementptr inbounds double, double* %47, i64 9
%71 = load double, double* %70
%72 = getelementptr inbounds double, double* %47, i64 10
%73 = load double, double* %72
%74 = getelementptr inbounds double, double* %47, i64 11
%75 = load double, double* %74
%76 = load double, double* %67
%77 = tail call double @llvm.fmuladd.f64(double %76, double %69, double %66)
%78 = getelementptr inbounds double, double* %67, i64 1
%79 = load double, double* %78
%80 = tail call double @llvm.fmuladd.f64(double %79, double %71, double %77)
%81 = getelementptr inbounds double, double* %67, i64 2
%82 = load double, double* %81
%83 = tail call double @llvm.fmuladd.f64(double %82, double %73, double %80)
%84 = getelementptr inbounds double, double* %67, i64 3
%85 = load double, double* %84
%86 = tail call double @llvm.fmuladd.f64(double %85, double %75, double %83)
%87 = add nuw nsw i32 %48, 8
%88 = getelementptr inbounds double, double* %67, i64 %26
%89 = getelementptr inbounds double, double* %47, i64 12
%90 = icmp slt i32 %87, %27
br i1 %90, label %43, label %34
91: ; preds = %36, %91
%92 = phi double [ %113, %91 ], [ %38, %36 ]
%93 = phi double* [ %114, %91 ], [ %39, %36 ]
%94 = phi double* [ %115, %91 ], [ %40, %36 ]
%95 = phi i32 [ %116, %91 ], [ %37, %36 ]
%96 = load double, double* %94
%97 = getelementptr inbounds double, double* %94, i64 1
%98 = load double, double* %97
%99 = getelementptr inbounds double, double* %94, i64 2
%100 = load double, double* %99
%101 = getelementptr inbounds double, double* %94, i64 3
%102 = load double, double* %101
%103 = load double, double* %93
%104 = tail call double @llvm.fmuladd.f64(double %103, double %96, double %92)
%105 = getelementptr inbounds double, double* %93, i64 1
%106 = load double, double* %105
%107 = tail call double @llvm.fmuladd.f64(double %106, double %98, double %104)
%108 = getelementptr inbounds double, double* %93, i64 2
%109 = load double, double* %108
%110 = tail call double @llvm.fmuladd.f64(double %109, double %100, double %107)
%111 = getelementptr inbounds double, double* %93, i64 3
%112 = load double, double* %111
%113 = tail call double @llvm.fmuladd.f64(double %112, double %102, double %110)
%114 = getelementptr inbounds double, double* %93, i64 %26
%115 = getelementptr inbounds double, double* %94, i64 4
%116 = add nuw nsw i32 %95, 4
%117 = icmp slt i32 %116, %41
br i1 %117, label %91, label %121
118: ; preds = %7
%119 = getelementptr inbounds double, double* %2, i64 1
%120 = getelementptr inbounds double, double* %4, i64 1
br label %121
121: ; preds = %91, %36, %118
%122 = phi i32 [ 1, %118 ], [ %37, %36 ], [ %116, %91 ]
%123 = phi double* [ %120, %118 ], [ %40, %36 ], [ %115, %91 ]
%124 = phi double* [ %119, %118 ], [ %39, %36 ], [ %114, %91 ]
%125 = phi double [ 0.000000e+00, %118 ], [ %38, %36 ], [ %113, %91 ]
%126 = icmp slt i32 %122, %0
br i1 %126, label %127, label %181
127: ; preds = %121
%128 = sub i32 %0, %122
%129 = xor i32 %122, -1
%130 = add i32 %129, %0
%131 = and i32 %128, 3
%132 = icmp eq i32 %131, 0
br i1 %132, label %147, label %133
133: ; preds = %127, %133
%134 = phi double [ %141, %133 ], [ %125, %127 ]
%135 = phi double* [ %142, %133 ], [ %124, %127 ]
%136 = phi double* [ %143, %133 ], [ %123, %127 ]
%137 = phi i32 [ %144, %133 ], [ %122, %127 ]
%138 = phi i32 [ %145, %133 ], [ 0, %127 ]
%139 = load double, double* %136
%140 = load double, double* %135
%141 = tail call double @llvm.fmuladd.f64(double %140, double %139, double %134)
%142 = getelementptr inbounds double, double* %135, i64 1
%143 = getelementptr inbounds double, double* %136, i64 1
%144 = add nsw i32 %137, 1
%145 = add i32 %138, 1
%146 = icmp eq i32 %145, %131
br i1 %146, label %147, label %133
147: ; preds = %133, %127
%148 = phi double [ undef, %127 ], [ %141, %133 ]
%149 = phi double [ %125, %127 ], [ %141, %133 ]
%150 = phi double* [ %124, %127 ], [ %142, %133 ]
%151 = phi double* [ %123, %127 ], [ %143, %133 ]
%152 = phi i32 [ %122, %127 ], [ %144, %133 ]
%153 = icmp ult i32 %130, 3
br i1 %153, label %181, label %154
154: ; preds = %147, %154
%155 = phi double [ %176, %154 ], [ %149, %147 ]
%156 = phi double* [ %177, %154 ], [ %150, %147 ]
%157 = phi double* [ %178, %154 ], [ %151, %147 ]
%158 = phi i32 [ %179, %154 ], [ %152, %147 ]
%159 = load double, double* %157
%160 = load double, double* %156
%161 = tail call double @llvm.fmuladd.f64(double %160, double %159, double %155)
%162 = getelementptr inbounds double, double* %156, i64 1
%163 = getelementptr inbounds double, double* %157, i64 1
%164 = load double, double* %163
%165 = load double, double* %162
%166 = tail call double @llvm.fmuladd.f64(double %165, double %164, double %161)
%167 = getelementptr inbounds double, double* %156, i64 2
%168 = getelementptr inbounds double, double* %157, i64 2
%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* %156, i64 3
%173 = getelementptr inbounds double, double* %157, i64 3
%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* %156, i64 4
%178 = getelementptr inbounds double, double* %157, i64 4
%179 = add nsw i32 %158, 4
%180 = icmp eq i32 %179, %0
br i1 %180, label %181, label %154
181: ; preds = %147, %154, %121
%182 = phi double [ %125, %121 ], [ %148, %147 ], [ %176, %154 ]
%183 = icmp eq i32 %1, 0
%184 = load double, double* %4
%185 = fsub double %184, %182
%186 = load double, double* %2
br i1 %183, label %189, label %187
187: ; preds = %181
%188 = fmul double %185, %186
br label %191
189: ; preds = %181
%190 = fdiv double %185, %186
br label %191
191: ; preds = %189, %187
%192 = phi double [ %190, %189 ], [ %188, %187 ]
store double %192, double* %4
br label %193
193: ; preds = %5, %191
ret void
}