void kernel_dgemm_diag_left_1_lib4(int kmax, double *A, double *B, double *C,
                                   double *D, int alg) {
  if (kmax <= 0)
    return;
  const int bs = 4;
  int k;
  double a_0, b_0, c_0;
  if (alg == -1) {
    a_0 = A[0];
  } else {
    a_0 = A[0];
  }
  if (alg == 0) {
    for (k = 0; k < kmax - 3; k += 4) {
      b_0 = B[0 + bs * 0];
      c_0 = a_0 * b_0;
      D[0 + bs * 0] = c_0;
      b_0 = B[0 + bs * 1];
      c_0 = a_0 * b_0;
      D[0 + bs * 1] = c_0;
      b_0 = B[0 + bs * 2];
      c_0 = a_0 * b_0;
      D[0 + bs * 2] = c_0;
      b_0 = B[0 + bs * 3];
      c_0 = a_0 * b_0;
      D[0 + bs * 3] = c_0;
      B += 16;
      D += 16;
    }
    for (; k < kmax; k++) {
      b_0 = B[0 + bs * 0];
      c_0 = a_0 * b_0;
      D[0 + bs * 0] = c_0;
      B += 4;
      D += 4;
    }
  } else {
    for (k = 0; k < kmax - 3; k += 4) {
      b_0 = B[0 + bs * 0];
      c_0 = C[0 + bs * 0] + a_0 * b_0;
      D[0 + bs * 0] = c_0;
      b_0 = B[0 + bs * 1];
      c_0 = C[0 + bs * 1] + a_0 * b_0;
      D[0 + bs * 1] = c_0;
      b_0 = B[0 + bs * 2];
      c_0 = C[0 + bs * 2] + a_0 * b_0;
      D[0 + bs * 2] = c_0;
      b_0 = B[0 + bs * 3];
      c_0 = C[0 + bs * 3] + a_0 * b_0;
      D[0 + bs * 3] = c_0;
      B += 16;
      C += 16;
      D += 16;
    }
    for (; k < kmax; k++) {
      b_0 = B[0 + bs * 0];
      c_0 = C[0 + bs * 0] + a_0 * b_0;
      D[0 + bs * 0] = c_0;
      B += 4;
      C += 4;
      D += 4;
    }
  }
}


x86 assembly (clang, -O0):
<kernel_dgemm_diag_left_1_lib4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     112a <kernel_dgemm_diag_left_1_lib4+0x2a>
jmp    1473 <kernel_dgemm_diag_left_1_lib4+0x373>
movl   $0x4,-0x30(%rbp)
cmpl   $0xffffffff,-0x2c(%rbp)
jne    114d <kernel_dgemm_diag_left_1_lib4+0x4d>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    115a <kernel_dgemm_diag_left_1_lib4+0x5a>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    12b5 <kernel_dgemm_diag_left_1_lib4+0x1b5>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jge    1250 <kernel_dgemm_diag_left_1_lib4+0x150>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x18(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x40(%rax)
mov    -0x18(%rbp),%rax
movsd  0x60(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x60(%rax)
mov    -0x18(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x28(%rbp)
mov    -0x34(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x34(%rbp)
jmp    116b <kernel_dgemm_diag_left_1_lib4+0x6b>
jmp    1255 <kernel_dgemm_diag_left_1_lib4+0x155>
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12b0 <kernel_dgemm_diag_left_1_lib4+0x1b0>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x28(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1255 <kernel_dgemm_diag_left_1_lib4+0x155>
jmp    1473 <kernel_dgemm_diag_left_1_lib4+0x373>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jge    13f2 <kernel_dgemm_diag_left_1_lib4+0x2f2>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x20(%rax),%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x18(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x40(%rax),%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x40(%rax)
mov    -0x18(%rbp),%rax
movsd  0x60(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x60(%rax),%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x60(%rax)
mov    -0x18(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x28(%rbp)
mov    -0x34(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x34(%rbp)
jmp    12bc <kernel_dgemm_diag_left_1_lib4+0x1bc>
jmp    13f7 <kernel_dgemm_diag_left_1_lib4+0x2f7>
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    146e <kernel_dgemm_diag_left_1_lib4+0x36e>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x28(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    13f7 <kernel_dgemm_diag_left_1_lib4+0x2f7>
jmp    1473 <kernel_dgemm_diag_left_1_lib4+0x373>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_dgemm_diag_left_1_lib4>:
test   %edi,%edi
jle    135b <kernel_dgemm_diag_left_1_lib4+0x25b>
movsd  (%rsi),%xmm0
lea    -0x3(%rdi),%eax
test   %r9d,%r9d
je     1267 <kernel_dgemm_diag_left_1_lib4+0x167>
xor    %r10d,%r10d
cmp    $0x4,%edi
jb     1197 <kernel_dgemm_diag_left_1_lib4+0x97>
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%rdx),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rcx),%xmm1
movsd  %xmm1,(%r8)
movsd  0x20(%rdx),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x20(%rcx),%xmm1
movsd  %xmm1,0x20(%r8)
movsd  0x40(%rdx),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x40(%rcx),%xmm1
movsd  %xmm1,0x40(%r8)
movsd  0x60(%rdx),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x60(%rcx),%xmm1
movsd  %xmm1,0x60(%r8)
sub    $0xffffffffffffff80,%rdx
sub    $0xffffffffffffff80,%rcx
sub    $0xffffffffffffff80,%r8
add    $0x4,%esi
cmp    %eax,%esi
jl     1130 <kernel_dgemm_diag_left_1_lib4+0x30>
mov    %edi,%r10d
and    $0xfffffffc,%r10d
cmp    %edi,%r10d
jge    135b <kernel_dgemm_diag_left_1_lib4+0x25b>
mov    %r10d,%r9d
not    %r9d
add    %edi,%r9d
mov    %edi,%eax
and    $0x3,%eax
je     11e7 <kernel_dgemm_diag_left_1_lib4+0xe7>
neg    %eax
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rdx),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rcx),%xmm1
movsd  %xmm1,(%r8)
add    $0x20,%rdx
add    $0x20,%rcx
add    $0x20,%r8
add    $0xffffffff,%esi
cmp    %esi,%eax
jne    11c0 <kernel_dgemm_diag_left_1_lib4+0xc0>
sub    %esi,%r10d
cmp    $0x3,%r9d
jb     135b <kernel_dgemm_diag_left_1_lib4+0x25b>
sub    %r10d,%edi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movsd  (%rdx,%rax,1),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rcx,%rax,1),%xmm1
movsd  %xmm1,(%r8,%rax,1)
movsd  0x20(%rdx,%rax,1),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x20(%rcx,%rax,1),%xmm1
movsd  %xmm1,0x20(%r8,%rax,1)
movsd  0x40(%rdx,%rax,1),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x40(%rcx,%rax,1),%xmm1
movsd  %xmm1,0x40(%r8,%rax,1)
movsd  0x60(%rdx,%rax,1),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x60(%rcx,%rax,1),%xmm1
movsd  %xmm1,0x60(%r8,%rax,1)
sub    $0xffffffffffffff80,%rax
add    $0xfffffffc,%edi
jne    1200 <kernel_dgemm_diag_left_1_lib4+0x100>
jmp    135b <kernel_dgemm_diag_left_1_lib4+0x25b>
xor    %ecx,%ecx
cmp    $0x4,%edi
jb     12be <kernel_dgemm_diag_left_1_lib4+0x1be>
xor    %ecx,%ecx
movsd  (%rdx),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r8)
movsd  0x20(%rdx),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%r8)
movsd  0x40(%rdx),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x40(%r8)
movsd  0x60(%rdx),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x60(%r8)
sub    $0xffffffffffffff80,%rdx
sub    $0xffffffffffffff80,%r8
add    $0x4,%ecx
cmp    %eax,%ecx
jl     1270 <kernel_dgemm_diag_left_1_lib4+0x170>
mov    %edi,%ecx
and    $0xfffffffc,%ecx
cmp    %edi,%ecx
jge    135b <kernel_dgemm_diag_left_1_lib4+0x25b>
mov    %ecx,%r9d
not    %r9d
add    %edi,%r9d
mov    %edi,%esi
and    $0x3,%esi
je     12fe <kernel_dgemm_diag_left_1_lib4+0x1fe>
neg    %esi
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movsd  (%rdx),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r8)
add    $0x20,%rdx
add    $0x20,%r8
add    $0xffffffff,%eax
cmp    %eax,%esi
jne    12e0 <kernel_dgemm_diag_left_1_lib4+0x1e0>
sub    %eax,%ecx
cmp    $0x3,%r9d
jb     135b <kernel_dgemm_diag_left_1_lib4+0x25b>
sub    %ecx,%edi
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movsd  (%rdx,%rax,1),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r8,%rax,1)
movsd  0x20(%rdx,%rax,1),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%r8,%rax,1)
movsd  0x40(%rdx,%rax,1),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x40(%r8,%rax,1)
movsd  0x60(%rdx,%rax,1),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x60(%r8,%rax,1)
sub    $0xffffffffffffff80,%rax
add    $0xfffffffc,%edi
jne    1310 <kernel_dgemm_diag_left_1_lib4+0x210>
ret

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

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