void kernel_dgemm_diag_left_3_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, a_1, a_2, b_0, b_1, b_2, c_0, c_1, c_2;
  if (alg == -1) {
    a_0 = -A[0];
    a_1 = -A[1];
    a_2 = -A[2];
  } else {
    a_0 = A[0];
    a_1 = A[1];
    a_2 = A[2];
  }
  if (alg == 0) {
    for (k = 0; k < kmax - 3; k += 4) {
      b_0 = B[0 + bs * 0];
      b_1 = B[1 + bs * 0];
      b_2 = B[2 + bs * 0];
      c_0 = a_0 * b_0;
      c_1 = a_1 * b_1;
      c_2 = a_2 * b_2;
      D[0 + bs * 0] = c_0;
      D[1 + bs * 0] = c_1;
      D[2 + bs * 0] = c_2;
      b_0 = B[0 + bs * 1];
      b_1 = B[1 + bs * 1];
      b_2 = B[2 + bs * 1];
      c_0 = a_0 * b_0;
      c_1 = a_1 * b_1;
      c_2 = a_2 * b_2;
      D[0 + bs * 1] = c_0;
      D[1 + bs * 1] = c_1;
      D[2 + bs * 1] = c_2;
      b_0 = B[0 + bs * 2];
      b_1 = B[1 + bs * 2];
      b_2 = B[2 + bs * 2];
      c_0 = a_0 * b_0;
      c_1 = a_1 * b_1;
      c_2 = a_2 * b_2;
      D[0 + bs * 2] = c_0;
      D[1 + bs * 2] = c_1;
      D[2 + bs * 2] = c_2;
      b_0 = B[0 + bs * 3];
      b_1 = B[1 + bs * 3];
      b_2 = B[2 + bs * 3];
      c_0 = a_0 * b_0;
      c_1 = a_1 * b_1;
      c_2 = a_2 * b_2;
      D[0 + bs * 3] = c_0;
      D[1 + bs * 3] = c_1;
      D[2 + bs * 3] = c_2;
      B += 16;
      D += 16;
    }
    for (; k < kmax; k++) {
      b_0 = B[0 + bs * 0];
      b_1 = B[1 + bs * 0];
      b_2 = B[2 + bs * 0];
      c_0 = a_0 * b_0;
      c_1 = a_1 * b_1;
      c_2 = a_2 * b_2;
      D[0 + bs * 0] = c_0;
      D[1 + bs * 0] = c_1;
      D[2 + bs * 0] = c_2;
      B += 4;
      D += 4;
    }
  } else {
    for (k = 0; k < kmax - 3; k += 4) {
      b_0 = B[0 + bs * 0];
      b_1 = B[1 + bs * 0];
      b_2 = B[2 + bs * 0];
      c_0 = C[0 + bs * 0] + a_0 * b_0;
      c_1 = C[1 + bs * 0] + a_1 * b_1;
      c_2 = C[2 + bs * 0] + a_2 * b_2;
      D[0 + bs * 0] = c_0;
      D[1 + bs * 0] = c_1;
      D[2 + bs * 0] = c_2;
      b_0 = B[0 + bs * 1];
      b_1 = B[1 + bs * 1];
      b_2 = B[2 + bs * 1];
      c_0 = C[0 + bs * 1] + a_0 * b_0;
      c_1 = C[1 + bs * 1] + a_1 * b_1;
      c_2 = C[2 + bs * 1] + a_2 * b_2;
      D[0 + bs * 1] = c_0;
      D[1 + bs * 1] = c_1;
      D[2 + bs * 1] = c_2;
      b_0 = B[0 + bs * 2];
      b_1 = B[1 + bs * 2];
      b_2 = B[2 + bs * 2];
      c_0 = C[0 + bs * 2] + a_0 * b_0;
      c_1 = C[1 + bs * 2] + a_1 * b_1;
      c_2 = C[2 + bs * 2] + a_2 * b_2;
      D[0 + bs * 2] = c_0;
      D[1 + bs * 2] = c_1;
      D[2 + bs * 2] = c_2;
      b_0 = B[0 + bs * 3];
      b_1 = B[1 + bs * 3];
      b_2 = B[2 + bs * 3];
      c_0 = C[0 + bs * 3] + a_0 * b_0;
      c_1 = C[1 + bs * 3] + a_1 * b_1;
      c_2 = C[2 + bs * 3] + a_2 * b_2;
      D[0 + bs * 3] = c_0;
      D[1 + bs * 3] = c_1;
      D[2 + bs * 3] = c_2;
      B += 16;
      C += 16;
      D += 16;
    }
    for (; k < kmax; k++) {
      b_0 = B[0 + bs * 0];
      b_1 = B[1 + bs * 0];
      b_2 = B[2 + bs * 0];
      c_0 = C[0 + bs * 0] + a_0 * b_0;
      c_1 = C[1 + bs * 0] + a_1 * b_1;
      c_2 = C[2 + bs * 0] + a_2 * b_2;
      D[0 + bs * 0] = c_0;
      D[1 + bs * 0] = c_1;
      D[2 + bs * 0] = c_2;
      B += 4;
      C += 4;
      D += 4;
    }
  }
}


x86 assembly (clang, -O0):
<kernel_dgemm_diag_left_3_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_3_lib4+0x2a>
jmp    18f6 <kernel_dgemm_diag_left_3_lib4+0x7f6>
movl   $0x4,-0x30(%rbp)
cmpl   $0xffffffff,-0x2c(%rbp)
jne    11ae <kernel_dgemm_diag_left_3_lib4+0xae>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    11d7 <kernel_dgemm_diag_left_3_lib4+0xd7>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    14e0 <kernel_dgemm_diag_left_3_lib4+0x3e0>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jge    1425 <kernel_dgemm_diag_left_3_lib4+0x325>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x78(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x80(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x18(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  -0x78(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x28(%rax)
movsd  -0x80(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x30(%rax)
mov    -0x18(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x48(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x50(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x40(%rax)
movsd  -0x78(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x48(%rax)
movsd  -0x80(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x50(%rax)
mov    -0x18(%rbp),%rax
movsd  0x60(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x68(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x70(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x60(%rax)
movsd  -0x78(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x68(%rax)
movsd  -0x80(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x70(%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    11e8 <kernel_dgemm_diag_left_3_lib4+0xe8>
jmp    142a <kernel_dgemm_diag_left_3_lib4+0x32a>
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    14db <kernel_dgemm_diag_left_3_lib4+0x3db>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x78(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x80(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x10(%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    142a <kernel_dgemm_diag_left_3_lib4+0x32a>
jmp    18f6 <kernel_dgemm_diag_left_3_lib4+0x7f6>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jge    17fd <kernel_dgemm_diag_left_3_lib4+0x6fd>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x78(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x80(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x18(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x20(%rax),%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x28(%rax),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x30(%rax),%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  -0x78(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x28(%rax)
movsd  -0x80(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x30(%rax)
mov    -0x18(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x48(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x50(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x40(%rax),%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x48(%rax),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x50(%rax),%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x40(%rax)
movsd  -0x78(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x48(%rax)
movsd  -0x80(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x50(%rax)
mov    -0x18(%rbp),%rax
movsd  0x60(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x68(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x70(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x60(%rax),%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x68(%rax),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x70(%rax),%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x60(%rax)
movsd  -0x78(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x68(%rax)
movsd  -0x80(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x70(%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    14e7 <kernel_dgemm_diag_left_3_lib4+0x3e7>
jmp    1802 <kernel_dgemm_diag_left_3_lib4+0x702>
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    18f1 <kernel_dgemm_diag_left_3_lib4+0x7f1>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x78(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x80(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x10(%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    1802 <kernel_dgemm_diag_left_3_lib4+0x702>
jmp    18f6 <kernel_dgemm_diag_left_3_lib4+0x7f6>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_dgemm_diag_left_3_lib4>:
test   %edi,%edi
jle    142a <kernel_dgemm_diag_left_3_lib4+0x32a>
movsd  (%rsi),%xmm0
cmp    $0xffffffff,%r9d
je     1270 <kernel_dgemm_diag_left_3_lib4+0x170>
movsd  0x10(%rsi),%xmm1
movhpd 0x8(%rsi),%xmm0
test   %r9d,%r9d
jne    128a <kernel_dgemm_diag_left_3_lib4+0x18a>
xor    %eax,%eax
cmp    $0x4,%edi
jb     11ce <kernel_dgemm_diag_left_3_lib4+0xce>
lea    -0x3(%rdi),%eax
xor    %ecx,%ecx
nopl   0x0(%rax)
movupd (%rdx),%xmm2
mulpd  %xmm0,%xmm2
movsd  0x10(%rdx),%xmm3
mulsd  %xmm1,%xmm3
movupd %xmm2,(%r8)
movsd  %xmm3,0x10(%r8)
movupd 0x20(%rdx),%xmm2
mulpd  %xmm0,%xmm2
movsd  0x30(%rdx),%xmm3
mulsd  %xmm1,%xmm3
movupd %xmm2,0x20(%r8)
movsd  %xmm3,0x30(%r8)
movupd 0x40(%rdx),%xmm2
mulpd  %xmm0,%xmm2
movsd  0x50(%rdx),%xmm3
mulsd  %xmm1,%xmm3
movupd %xmm2,0x40(%r8)
movsd  %xmm3,0x50(%r8)
movupd 0x60(%rdx),%xmm2
mulpd  %xmm0,%xmm2
movsd  0x70(%rdx),%xmm3
mulsd  %xmm1,%xmm3
movupd %xmm2,0x60(%r8)
movsd  %xmm3,0x70(%r8)
sub    $0xffffffffffffff80,%rdx
sub    $0xffffffffffffff80,%r8
add    $0x4,%ecx
cmp    %eax,%ecx
jl     1140 <kernel_dgemm_diag_left_3_lib4+0x40>
mov    %edi,%eax
and    $0xfffffffc,%eax
cmp    %edi,%eax
jge    142a <kernel_dgemm_diag_left_3_lib4+0x32a>
mov    %eax,%ecx
not    %ecx
test   $0x1,%dil
je     1207 <kernel_dgemm_diag_left_3_lib4+0x107>
movupd (%rdx),%xmm2
mulpd  %xmm0,%xmm2
movsd  0x10(%rdx),%xmm3
mulsd  %xmm1,%xmm3
movupd %xmm2,(%r8)
movsd  %xmm3,0x10(%r8)
add    $0x20,%rdx
add    $0x20,%r8
or     $0x1,%eax
add    %edi,%ecx
je     142a <kernel_dgemm_diag_left_3_lib4+0x32a>
sub    %eax,%edi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movupd (%rdx,%rax,1),%xmm2
mulpd  %xmm0,%xmm2
movsd  0x10(%rdx,%rax,1),%xmm3
mulsd  %xmm1,%xmm3
movupd %xmm2,(%r8,%rax,1)
movsd  %xmm3,0x10(%r8,%rax,1)
movupd 0x20(%rdx,%rax,1),%xmm2
mulpd  %xmm0,%xmm2
movsd  0x30(%rdx,%rax,1),%xmm3
mulsd  %xmm1,%xmm3
movupd %xmm2,0x20(%r8,%rax,1)
movsd  %xmm3,0x30(%r8,%rax,1)
add    $0x40,%rax
add    $0xfffffffe,%edi
jne    1220 <kernel_dgemm_diag_left_3_lib4+0x120>
jmp    142a <kernel_dgemm_diag_left_3_lib4+0x32a>
movhpd 0x8(%rsi),%xmm0
movapd 0xd83(%rip),%xmm2
xorpd  %xmm2,%xmm0
movsd  0x10(%rsi),%xmm1
xorpd  %xmm2,%xmm1
xor    %eax,%eax
cmp    $0x4,%edi
jb     1369 <kernel_dgemm_diag_left_3_lib4+0x269>
lea    -0x3(%rdi),%eax
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
movupd (%rdx),%xmm2
movupd (%rcx),%xmm3
mulpd  %xmm0,%xmm2
addpd  %xmm3,%xmm2
movsd  0x10(%rdx),%xmm3
mulsd  %xmm1,%xmm3
addsd  0x10(%rcx),%xmm3
movupd %xmm2,(%r8)
movsd  %xmm3,0x10(%r8)
movupd 0x20(%rdx),%xmm2
movupd 0x20(%rcx),%xmm3
mulpd  %xmm0,%xmm2
movsd  0x30(%rdx),%xmm4
mulsd  %xmm1,%xmm4
addsd  0x30(%rcx),%xmm4
addpd  %xmm3,%xmm2
movupd %xmm2,0x20(%r8)
movsd  %xmm4,0x30(%r8)
movupd 0x40(%rdx),%xmm2
movupd 0x40(%rcx),%xmm3
mulpd  %xmm0,%xmm2
addpd  %xmm3,%xmm2
movsd  0x50(%rdx),%xmm3
mulsd  %xmm1,%xmm3
addsd  0x50(%rcx),%xmm3
movupd %xmm2,0x40(%r8)
movsd  %xmm3,0x50(%r8)
movupd 0x60(%rdx),%xmm2
movupd 0x60(%rcx),%xmm3
mulpd  %xmm0,%xmm2
movsd  0x70(%rdx),%xmm4
mulsd  %xmm1,%xmm4
addsd  0x70(%rcx),%xmm4
addpd  %xmm3,%xmm2
movupd %xmm2,0x60(%r8)
movsd  %xmm4,0x70(%r8)
sub    $0xffffffffffffff80,%rdx
sub    $0xffffffffffffff80,%rcx
sub    $0xffffffffffffff80,%r8
add    $0x4,%esi
cmp    %eax,%esi
jl     12a0 <kernel_dgemm_diag_left_3_lib4+0x1a0>
mov    %edi,%eax
and    $0xfffffffc,%eax
cmp    %edi,%eax
jge    142a <kernel_dgemm_diag_left_3_lib4+0x32a>
mov    %eax,%esi
not    %esi
test   $0x1,%dil
je     13b3 <kernel_dgemm_diag_left_3_lib4+0x2b3>
movupd (%rdx),%xmm2
movupd (%rcx),%xmm3
mulpd  %xmm0,%xmm2
addpd  %xmm3,%xmm2
movsd  0x10(%rdx),%xmm3
mulsd  %xmm1,%xmm3
addsd  0x10(%rcx),%xmm3
movupd %xmm2,(%r8)
movsd  %xmm3,0x10(%r8)
add    $0x20,%rdx
add    $0x20,%rcx
add    $0x20,%r8
or     $0x1,%eax
add    %edi,%esi
je     142a <kernel_dgemm_diag_left_3_lib4+0x32a>
sub    %eax,%edi
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movupd (%rdx,%rax,1),%xmm2
movupd (%rcx,%rax,1),%xmm3
mulpd  %xmm0,%xmm2
addpd  %xmm3,%xmm2
movsd  0x10(%rdx,%rax,1),%xmm3
mulsd  %xmm1,%xmm3
addsd  0x10(%rcx,%rax,1),%xmm3
movupd %xmm2,(%r8,%rax,1)
movsd  %xmm3,0x10(%r8,%rax,1)
movupd 0x20(%rdx,%rax,1),%xmm2
movupd 0x20(%rcx,%rax,1),%xmm3
mulpd  %xmm0,%xmm2
addpd  %xmm3,%xmm2
movsd  0x30(%rdx,%rax,1),%xmm3
mulsd  %xmm1,%xmm3
addsd  0x30(%rcx,%rax,1),%xmm3
movupd %xmm2,0x20(%r8,%rax,1)
movsd  %xmm3,0x30(%r8,%rax,1)
add    $0x40,%rax
add    $0xfffffffe,%edi
jne    13c0 <kernel_dgemm_diag_left_3_lib4+0x2c0>
ret

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

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