void kernel_dgemm_dtrsm_nt_4x4_lib4_new(int kadd, double *Ap, double *Bp,
                                        int ksub, double *Am, double *Bm,
                                        int alg, double *C, double *D,
                                        double *E, int use_inv_diag_E,
                                        double *inv_diag_E) {
  int ki_add = kadd / 4;
  int kl_add = kadd % 4;
  int ki_sub = ksub / 4;
  __asm__ volatile(
      "                                \n\t"
      "                                \n\t"
      "movq          %3, %%rax         \n\t"
      "movq          %4, %%rbx         \n\t"
      "                                \n\t"
      "                                \n\t"
      "xorpd     %%xmm3,  %%xmm3       \n\t"
      "movaps    %%xmm3,  %%xmm4       \n\t"
      "movaps    %%xmm3,  %%xmm5       \n\t"
      "movaps    %%xmm3,  %%xmm6       \n\t"
      "movaps    %%xmm3,  %%xmm7       \n\t"
      "movaps    %%xmm3,  %%xmm8       \n\t"
      "movaps    %%xmm3,  %%xmm9       \n\t"
      "movaps    %%xmm3, %%xmm10       \n\t"
      "movaps    %%xmm3, %%xmm11       \n\t"
      "movaps    %%xmm3, %%xmm12       \n\t"
      "movaps    %%xmm3, %%xmm13       \n\t"
      "movaps    %%xmm3, %%xmm14       \n\t"
      "movaps    %%xmm3, %%xmm15       \n\t"
      "                                \n\t"
      "                                \n\t"
      "movl      %0, %%esi             \n\t"
      "movl      %1, %%ecx             \n\t"
      "addl      %%esi, %%ecx          \n\t"
      "testl     %%ecx, %%ecx          \n\t"
      "je        .DCONSIDERSUB_1         \n\t"
      "                                \n\t"
      "                                \n\t"
      "movaps        0(%%rax), %%xmm0  \n\t"
      "movaps       16(%%rax), %%xmm1  \n\t"
      "movaps        0(%%rbx), %%xmm2  \n\t"
      "                                \n\t"
      "                                \n\t"
      "testl  %%esi, %%esi             \n\t"
      "je     .DCONSIDERADD_1            \n\t"
      "                                \n\t"
      "                                \n\t"
      ".DLOOPADD_1:                      \n\t"
      "                                \n\t"
      "addpd   %%xmm6, %%xmm10         \n\t"
      "movaps       16(%%rbx), %%xmm6  \n\t"
      "addpd   %%xmm3, %%xmm14         \n\t"
      "movaps  %%xmm2, %%xmm3          \n\t"
      "pshufd   $0x4e, %%xmm2, %%xmm7  \n\t"
      "mulpd   %%xmm0, %%xmm2          \n\t"
      "mulpd   %%xmm1, %%xmm3          \n\t"
      "                                \n\t"
      "addpd   %%xmm4, %%xmm11         \n\t"
      "addpd   %%xmm5, %%xmm15         \n\t"
      "movaps  %%xmm7, %%xmm5          \n\t"
      "mulpd   %%xmm0, %%xmm7          \n\t"
      "mulpd   %%xmm1, %%xmm5          \n\t"
      "                                \n\t"
      "addpd   %%xmm2, %%xmm8          \n\t"
      "movaps       32(%%rbx), %%xmm2  \n\t"
      "addpd   %%xmm3, %%xmm12         \n\t"
      "movaps  %%xmm6, %%xmm3          \n\t"
      "pshufd   $0x4e, %%xmm6, %%xmm4  \n\t"
      "mulpd   %%xmm0, %%xmm6          \n\t"
      "mulpd   %%xmm1, %%xmm3          \n\t"
      "                                \n\t"
      "addpd   %%xmm7, %%xmm9          \n\t"
      "addpd   %%xmm5, %%xmm13         \n\t"
      "movaps  %%xmm4, %%xmm5          \n\t"
      "mulpd   %%xmm0, %%xmm4          \n\t"
      "movaps       32(%%rax), %%xmm0  \n\t"
      "mulpd   %%xmm1, %%xmm5          \n\t"
      "movaps       48(%%rax), %%xmm1  \n\t"
      "                                \n\t"
      "                                \n\t"
      "addpd   %%xmm6, %%xmm10         \n\t"
      "movaps       48(%%rbx), %%xmm6  \n\t"
      "addpd   %%xmm3, %%xmm14         \n\t"
      "movaps  %%xmm2, %%xmm3          \n\t"
      "pshufd   $0x4e, %%xmm2, %%xmm7  \n\t"
      "mulpd   %%xmm0, %%xmm2          \n\t"
      "mulpd   %%xmm1, %%xmm3          \n\t"
      "                                \n\t"
      "addpd   %%xmm4, %%xmm11         \n\t"
      "addpd   %%xmm5, %%xmm15         \n\t"
      "movaps  %%xmm7, %%xmm5          \n\t"
      "mulpd   %%xmm0, %%xmm7          \n\t"
      "mulpd   %%xmm1, %%xmm5          \n\t"
      "                                \n\t"
      "addpd   %%xmm2, %%xmm8          \n\t"
      "movaps       64(%%rbx), %%xmm2  \n\t"
      "addpd   %%xmm3, %%xmm12         \n\t"
      "movaps  %%xmm6, %%xmm3          \n\t"
      "pshufd   $0x4e, %%xmm6, %%xmm4  \n\t"
      "mulpd   %%xmm0, %%xmm6          \n\t"
      "mulpd   %%xmm1, %%xmm3          \n\t"
      "                                \n\t"
      "addpd   %%xmm7, %%xmm9          \n\t"
      "addpd   %%xmm5, %%xmm13         \n\t"
      "movaps  %%xmm4, %%xmm5          \n\t"
      "mulpd   %%xmm0, %%xmm4          \n\t"
      "movaps       64(%%rax), %%xmm0  \n\t"
      "mulpd   %%xmm1, %%xmm5          \n\t"
      "movaps       80(%%rax), %%xmm1  \n\t"
      "                                \n\t"
      "                                \n\t"
      "addpd   %%xmm6, %%xmm10         \n\t"
      "movaps       80(%%rbx), %%xmm6  \n\t"
      "addpd   %%xmm3, %%xmm14         \n\t"
      "movaps  %%xmm2, %%xmm3          \n\t"
      "pshufd   $0x4e, %%xmm2, %%xmm7  \n\t"
      "mulpd   %%xmm0, %%xmm2          \n\t"
      "mulpd   %%xmm1, %%xmm3          \n\t"
      "                                \n\t"
      "addpd   %%xmm4, %%xmm11         \n\t"
      "addpd   %%xmm5, %%xmm15         \n\t"
      "movaps  %%xmm7, %%xmm5          \n\t"
      "mulpd   %%xmm0, %%xmm7          \n\t"
      "mulpd   %%xmm1, %%xmm5          \n\t"
      "                                \n\t"
      "addpd   %%xmm2, %%xmm8          \n\t"
      "movaps       96(%%rbx), %%xmm2  \n\t"
      "addpd   %%xmm3, %%xmm12         \n\t"
      "movaps  %%xmm6, %%xmm3          \n\t"
      "pshufd   $0x4e, %%xmm6, %%xmm4  \n\t"
      "mulpd   %%xmm0, %%xmm6          \n\t"
      "mulpd   %%xmm1, %%xmm3          \n\t"
      "                                \n\t"
      "addpd   %%xmm7, %%xmm9          \n\t"
      "addpd   %%xmm5, %%xmm13         \n\t"
      "movaps  %%xmm4, %%xmm5          \n\t"
      "mulpd   %%xmm0, %%xmm4          \n\t"
      "movaps       96(%%rax), %%xmm0  \n\t"
      "mulpd   %%xmm1, %%xmm5          \n\t"
      "movaps      112(%%rax), %%xmm1  \n\t"
      "                                \n\t"
      "                                \n\t"
      "addpd   %%xmm6, %%xmm10         \n\t"
      "movaps      112(%%rbx), %%xmm6  \n\t"
      "addpd   %%xmm3, %%xmm14         \n\t"
      "movaps  %%xmm2, %%xmm3          \n\t"
      "pshufd   $0x4e, %%xmm2, %%xmm7  \n\t"
      "mulpd   %%xmm0, %%xmm2          \n\t"
      "mulpd   %%xmm1, %%xmm3          \n\t"
      "                                \n\t"
      "addq      $128, %%rax           \n\t"
      "                                \n\t"
      "addpd   %%xmm4, %%xmm11         \n\t"
      "addpd   %%xmm5, %%xmm15         \n\t"
      "movaps  %%xmm7, %%xmm5          \n\t"
      "mulpd   %%xmm0, %%xmm7          \n\t"
      "mulpd   %%xmm1, %%xmm5          \n\t"
      "                                \n\t"
      "addq      $128, %%rbx           \n\t"
      "                                \n\t"
      "addpd   %%xmm2, %%xmm8          \n\t"
      "movaps         (%%rbx), %%xmm2  \n\t"
      "addpd   %%xmm3, %%xmm12         \n\t"
      "movaps  %%xmm6, %%xmm3          \n\t"
      "pshufd   $0x4e, %%xmm6, %%xmm4  \n\t"
      "mulpd   %%xmm0, %%xmm6          \n\t"
      "mulpd   %%xmm1, %%xmm3          \n\t"
      "                                \n\t"
      "                                \n\t"
      "addpd   %%xmm7, %%xmm9          \n\t"
      "decl    %%esi                   \n\t"
      "addpd   %%xmm5, %%xmm13         \n\t"
      "movaps  %%xmm4, %%xmm5          \n\t"
      "mulpd   %%xmm0, %%xmm4          \n\t"
      "movaps         (%%rax), %%xmm0  \n\t"
      "mulpd   %%xmm1, %%xmm5          \n\t"
      "movaps       16(%%rax), %%xmm1  \n\t"
      "                                \n\t"
      "                                \n\t"
      "jne    .DLOOPADD_1                \n\t"
      "                                \n\t"
      "                                \n\t"
      "                                \n\t"
      ".DCONSIDERADD_1:                  \n\t"
      "                                \n\t"
      "movl      %1, %%esi             \n\t"
      "testl  %%esi, %%esi             \n\t"
      "je     .DCONSIDERSUB_1            \n\t"
      "                                \n\t"
      "                                \n\t"
      "                                \n\t"
      ".DLOOPLEFT_1:                     \n\t"
      "                                \n\t"
      "addpd   %%xmm6, %%xmm10         \n\t"
      "movaps       16(%%rbx), %%xmm6  \n\t"
      "addpd   %%xmm3, %%xmm14         \n\t"
      "movaps  %%xmm2, %%xmm3          \n\t"
      "pshufd   $0x4e, %%xmm2, %%xmm7  \n\t"
      "mulpd   %%xmm0, %%xmm2          \n\t"
      "mulpd   %%xmm1, %%xmm3          \n\t"
      "                                \n\t"
      "addpd   %%xmm4, %%xmm11         \n\t"
      "addpd   %%xmm5, %%xmm15         \n\t"
      "movaps  %%xmm7, %%xmm5          \n\t"
      "mulpd   %%xmm0, %%xmm7          \n\t"
      "mulpd   %%xmm1, %%xmm5          \n\t"
      "                                \n\t"
      "addpd   %%xmm2, %%xmm8          \n\t"
      "movaps       32(%%rbx), %%xmm2  \n\t"
      "addpd   %%xmm3, %%xmm12         \n\t"
      "movaps  %%xmm6, %%xmm3          \n\t"
      "pshufd   $0x4e, %%xmm6, %%xmm4  \n\t"
      "mulpd   %%xmm0, %%xmm6          \n\t"
      "mulpd   %%xmm1, %%xmm3          \n\t"
      "                                \n\t"
      "addpd   %%xmm7, %%xmm9          \n\t"
      "addpd   %%xmm5, %%xmm13         \n\t"
      "movaps  %%xmm4, %%xmm5          \n\t"
      "mulpd   %%xmm0, %%xmm4          \n\t"
      "movaps       32(%%rax), %%xmm0  \n\t"
      "mulpd   %%xmm1, %%xmm5          \n\t"
      "movaps       48(%%rax), %%xmm1  \n\t"
      "                                \n\t"
      "addq          $32, %%rax        \n\t"
      "addq          $32, %%rbx        \n\t"
      "                                \n\t"
      "                                \n\t"
      "decl    %%esi                   \n\t"
      "jne    .DLOOPLEFT_1               \n\t"
      "                                \n\t"
      "                                \n\t"
      "                                \n\t"
      ".DCONSIDERSUB_1:                  \n\t"
      "                                \n\t"
      "                                \n\t"
      "addpd   %%xmm6, %%xmm10         \n\t"
      "addpd   %%xmm3, %%xmm14         \n\t"
      "addpd   %%xmm4, %%xmm11         \n\t"
      "addpd   %%xmm5, %%xmm15         \n\t"
      "                                \n\t"
      "                                \n\t"
      ".DCONSIDERSUB_NOCLEAN_1:          \n\t"
      "                                \n\t"
      "                                \n\t"
      "xorpd     %%xmm3,  %%xmm3       \n\t"
      "movaps    %%xmm3,  %%xmm4       \n\t"
      "movaps    %%xmm3,  %%xmm5       \n\t"
      "movaps    %%xmm3,  %%xmm6       \n\t"
      "                                \n\t"
      "                                \n\t"
      "movl   %2, %%esi                \n\t"
      "testl  %%esi, %%esi             \n\t"
      "je     .DPOSTACC_1                \n\t"
      "                                \n\t"
      "                                \n\t"
      "movq   %9,  %%rax               \n\t"
      "movq   %10, %%rbx               \n\t"
      "                                \n\t"
      "movaps        0(%%rax), %%xmm0  \n\t"
      "movaps       16(%%rax), %%xmm1  \n\t"
      "movaps        0(%%rbx), %%xmm2  \n\t"
      "                                \n\t"
      "                                \n\t"
      ".DLOOPSUB_1:                      \n\t"
      "                                \n\t"
      "subpd   %%xmm6, %%xmm10         \n\t"
      "movaps       16(%%rbx), %%xmm6  \n\t"
      "subpd   %%xmm3, %%xmm14         \n\t"
      "movaps  %%xmm2, %%xmm3          \n\t"
      "pshufd   $0x4e, %%xmm2, %%xmm7  \n\t"
      "mulpd   %%xmm0, %%xmm2          \n\t"
      "mulpd   %%xmm1, %%xmm3          \n\t"
      "                                \n\t"
      "subpd   %%xmm4, %%xmm11         \n\t"
      "subpd   %%xmm5, %%xmm15         \n\t"
      "movaps  %%xmm7, %%xmm5          \n\t"
      "mulpd   %%xmm0, %%xmm7          \n\t"
      "mulpd   %%xmm1, %%xmm5          \n\t"
      "                                \n\t"
      "subpd   %%xmm2, %%xmm8          \n\t"
      "movaps       32(%%rbx), %%xmm2  \n\t"
      "subpd   %%xmm3, %%xmm12         \n\t"
      "movaps  %%xmm6, %%xmm3          \n\t"
      "pshufd   $0x4e, %%xmm6, %%xmm4  \n\t"
      "mulpd   %%xmm0, %%xmm6          \n\t"
      "mulpd   %%xmm1, %%xmm3          \n\t"
      "                                \n\t"
      "subpd   %%xmm7, %%xmm9          \n\t"
      "subpd   %%xmm5, %%xmm13         \n\t"
      "movaps  %%xmm4, %%xmm5          \n\t"
      "mulpd   %%xmm0, %%xmm4          \n\t"
      "movaps       32(%%rax), %%xmm0  \n\t"
      "mulpd   %%xmm1, %%xmm5          \n\t"
      "movaps       48(%%rax), %%xmm1  \n\t"
      "                                \n\t"
      "                                \n\t"
      "subpd   %%xmm6, %%xmm10         \n\t"
      "movaps       48(%%rbx), %%xmm6  \n\t"
      "subpd   %%xmm3, %%xmm14         \n\t"
      "movaps  %%xmm2, %%xmm3          \n\t"
      "pshufd   $0x4e, %%xmm2, %%xmm7  \n\t"
      "mulpd   %%xmm0, %%xmm2          \n\t"
      "mulpd   %%xmm1, %%xmm3          \n\t"
      "                                \n\t"
      "subpd   %%xmm4, %%xmm11         \n\t"
      "subpd   %%xmm5, %%xmm15         \n\t"
      "movaps  %%xmm7, %%xmm5          \n\t"
      "mulpd   %%xmm0, %%xmm7          \n\t"
      "mulpd   %%xmm1, %%xmm5          \n\t"
      "                                \n\t"
      "subpd   %%xmm2, %%xmm8          \n\t"
      "movaps       64(%%rbx), %%xmm2  \n\t"
      "subpd   %%xmm3, %%xmm12         \n\t"
      "movaps  %%xmm6, %%xmm3          \n\t"
      "pshufd   $0x4e, %%xmm6, %%xmm4  \n\t"
      "mulpd   %%xmm0, %%xmm6          \n\t"
      "mulpd   %%xmm1, %%xmm3          \n\t"
      "                                \n\t"
      "subpd   %%xmm7, %%xmm9          \n\t"
      "subpd   %%xmm5, %%xmm13         \n\t"
      "movaps  %%xmm4, %%xmm5          \n\t"
      "mulpd   %%xmm0, %%xmm4          \n\t"
      "movaps       64(%%rax), %%xmm0  \n\t"
      "mulpd   %%xmm1, %%xmm5          \n\t"
      "movaps       80(%%rax), %%xmm1  \n\t"
      "                                \n\t"
      "                                \n\t"
      "subpd   %%xmm6, %%xmm10         \n\t"
      "movaps       80(%%rbx), %%xmm6  \n\t"
      "subpd   %%xmm3, %%xmm14         \n\t"
      "movaps  %%xmm2, %%xmm3          \n\t"
      "pshufd   $0x4e, %%xmm2, %%xmm7  \n\t"
      "mulpd   %%xmm0, %%xmm2          \n\t"
      "mulpd   %%xmm1, %%xmm3          \n\t"
      "                                \n\t"
      "subpd   %%xmm4, %%xmm11         \n\t"
      "subpd   %%xmm5, %%xmm15         \n\t"
      "movaps  %%xmm7, %%xmm5          \n\t"
      "mulpd   %%xmm0, %%xmm7          \n\t"
      "mulpd   %%xmm1, %%xmm5          \n\t"
      "                                \n\t"
      "subpd   %%xmm2, %%xmm8          \n\t"
      "movaps       96(%%rbx), %%xmm2  \n\t"
      "subpd   %%xmm3, %%xmm12         \n\t"
      "movaps  %%xmm6, %%xmm3          \n\t"
      "pshufd   $0x4e, %%xmm6, %%xmm4  \n\t"
      "mulpd   %%xmm0, %%xmm6          \n\t"
      "mulpd   %%xmm1, %%xmm3          \n\t"
      "                                \n\t"
      "subpd   %%xmm7, %%xmm9          \n\t"
      "subpd   %%xmm5, %%xmm13         \n\t"
      "movaps  %%xmm4, %%xmm5          \n\t"
      "mulpd   %%xmm0, %%xmm4          \n\t"
      "movaps       96(%%rax), %%xmm0  \n\t"
      "mulpd   %%xmm1, %%xmm5          \n\t"
      "movaps      112(%%rax), %%xmm1  \n\t"
      "                                \n\t"
      "                                \n\t"
      "subpd   %%xmm6, %%xmm10         \n\t"
      "movaps      112(%%rbx), %%xmm6  \n\t"
      "subpd   %%xmm3, %%xmm14         \n\t"
      "movaps  %%xmm2, %%xmm3          \n\t"
      "pshufd   $0x4e, %%xmm2, %%xmm7  \n\t"
      "mulpd   %%xmm0, %%xmm2          \n\t"
      "mulpd   %%xmm1, %%xmm3          \n\t"
      "                                \n\t"
      "addq      $128, %%rax           \n\t"
      "                                \n\t"
      "subpd   %%xmm4, %%xmm11         \n\t"
      "subpd   %%xmm5, %%xmm15         \n\t"
      "movaps  %%xmm7, %%xmm5          \n\t"
      "mulpd   %%xmm0, %%xmm7          \n\t"
      "mulpd   %%xmm1, %%xmm5          \n\t"
      "                                \n\t"
      "addq      $128, %%rbx           \n\t"
      "                                \n\t"
      "subpd   %%xmm2, %%xmm8          \n\t"
      "movaps         (%%rbx), %%xmm2  \n\t"
      "subpd   %%xmm3, %%xmm12         \n\t"
      "movaps  %%xmm6, %%xmm3          \n\t"
      "pshufd   $0x4e, %%xmm6, %%xmm4  \n\t"
      "mulpd   %%xmm0, %%xmm6          \n\t"
      "mulpd   %%xmm1, %%xmm3          \n\t"
      "                                \n\t"
      "                                \n\t"
      "subpd   %%xmm7, %%xmm9          \n\t"
      "decl    %%esi                   \n\t"
      "subpd   %%xmm5, %%xmm13         \n\t"
      "movaps  %%xmm4, %%xmm5          \n\t"
      "mulpd   %%xmm0, %%xmm4          \n\t"
      "movaps         (%%rax), %%xmm0  \n\t"
      "mulpd   %%xmm1, %%xmm5          \n\t"
      "movaps       16(%%rax), %%xmm1  \n\t"
      "                                \n\t"
      "                                \n\t"
      "jne    .DLOOPSUB_1                \n\t"
      "                                \n\t"
      "                                \n\t"
      "subpd   %%xmm6, %%xmm10         \n\t"
      "subpd   %%xmm3, %%xmm14         \n\t"
      "subpd   %%xmm4, %%xmm11         \n\t"
      "subpd   %%xmm5, %%xmm15         \n\t"
      "                                \n\t"
      "                                \n\t"
      ".DPOSTACC_1:                      \n\t"
      "                                \n\t"
      "                                \n\t"
      "                                \n\t"
      "movaps   %%xmm8,  %%xmm0        \n\t"
      "movsd    %%xmm9,  %%xmm8        \n\t"
      "movsd    %%xmm0,  %%xmm9        \n\t"
      "                                \n\t"
      "movaps  %%xmm10,  %%xmm0        \n\t"
      "movsd   %%xmm11, %%xmm10        \n\t"
      "movsd    %%xmm0, %%xmm11        \n\t"
      "                                \n\t"
      "movaps  %%xmm12,  %%xmm0        \n\t"
      "movsd   %%xmm13, %%xmm12        \n\t"
      "movsd    %%xmm0, %%xmm13        \n\t"
      "                                \n\t"
      "movaps  %%xmm14,  %%xmm0        \n\t"
      "movsd   %%xmm15, %%xmm14        \n\t"
      "movsd    %%xmm0, %%xmm15        \n\t"
      "                                \n\t"
      "                                \n\t"
      "                                \n\t"
      "movl      %8, %%esi             \n\t"
      "testl  %%esi, %%esi             \n\t"
      "je     .DSOLVE_1                  \n\t"
      "                                \n\t"
      "                                \n\t"
      "movq   %5, %%rax                \n\t"
      "                                \n\t"
      "                                \n\t"
      "movaps  (%%rax),   %%xmm0       \n\t"
      "movaps  32(%%rax), %%xmm1       \n\t"
      "movaps  64(%%rax), %%xmm2       \n\t"
      "movaps  96(%%rax), %%xmm3       \n\t"
      "movaps  16(%%rax), %%xmm4       \n\t"
      "movaps  48(%%rax), %%xmm5       \n\t"
      "movaps  80(%%rax), %%xmm6       \n\t"
      "movaps 112(%%rax), %%xmm7       \n\t"
      "                                \n\t"
      "                                \n\t"
      "addpd  %%xmm0, %%xmm9           \n\t"
      "addpd  %%xmm1, %%xmm8           \n\t"
      "addpd  %%xmm2, %%xmm11          \n\t"
      "addpd  %%xmm3, %%xmm10          \n\t"
      "addpd  %%xmm4, %%xmm13          \n\t"
      "addpd  %%xmm5, %%xmm12          \n\t"
      "addpd  %%xmm6, %%xmm15          \n\t"
      "addpd  %%xmm7, %%xmm14          \n\t"
      "                                \n\t"
      "                                \n\t"
      ".DSOLVE_1:                        \n\t"
      "                                \n\t"
      "                                \n\t"
      "                                \n\t"
      "movl   %11, %%ecx               \n\t"
      "testl     %%ecx, %%ecx          \n\t"
      "je        .DNO_INV_E_1          \n\t"
      "                                \n\t"
      "                                \n\t"
      "                                \n\t"
      "movq   %7, %%rax                \n\t"
      "movq   %12, %%r8                \n\t"
      "movq   %6, %%rbx                \n\t"
      "                                \n\t"
      "                                \n\t"
      "                                \n\t"
      "                                \n\t"
      "movddup (%%r8), %%xmm0          \n\t"
      "                                \n\t"
      "mulpd   %%xmm0, %%xmm9          \n\t"
      "mulpd   %%xmm0, %%xmm13         \n\t"
      "                                \n\t"
      "movaps	%%xmm9,  (%%rbx)         \n\t"
      "movaps	%%xmm13, 16(%%rbx)       \n\t"
      "                                \n\t"
      "                                \n\t"
      "movddup 8(%%rax), %%xmm0        \n\t"
      "movddup 8(%%r8), %%xmm1         \n\t"
      "                                \n\t"
      "movaps  %%xmm0,  %%xmm4         \n\t"
      "mulpd   %%xmm9, %%xmm0          \n\t"
      "mulpd   %%xmm13, %%xmm4         \n\t"
      "subpd   %%xmm0, %%xmm8          \n\t"
      "subpd   %%xmm4, %%xmm12         \n\t"
      "                                \n\t"
      "mulpd   %%xmm1, %%xmm8          \n\t"
      "mulpd   %%xmm1, %%xmm12         \n\t"
      "                                \n\t"
      "movaps	%%xmm8,  32(%%rbx)       \n\t"
      "movaps	%%xmm12, 48(%%rbx)       \n\t"
      "                                \n\t"
      "                                \n\t"
      "                                \n\t"
      "movddup 16(%%rax), %%xmm0       \n\t"
      "movddup 48(%%rax), %%xmm1       \n\t"
      "movddup 16(%%r8), %%xmm2        \n\t"
      "                                \n\t"
      "movaps  %%xmm0,  %%xmm4         \n\t"
      "mulpd   %%xmm9, %%xmm0          \n\t"
      "mulpd   %%xmm13, %%xmm4         \n\t"
      "subpd   %%xmm0, %%xmm11         \n\t"
      "subpd   %%xmm4, %%xmm15         \n\t"
      "                                \n\t"
      "movaps  %%xmm1,  %%xmm4         \n\t"
      "mulpd   %%xmm8, %%xmm1          \n\t"
      "mulpd   %%xmm12, %%xmm4         \n\t"
      "subpd   %%xmm1, %%xmm11         \n\t"
      "subpd   %%xmm4, %%xmm15         \n\t"
      "                                \n\t"
      "mulpd   %%xmm2, %%xmm11         \n\t"
      "mulpd   %%xmm2, %%xmm15         \n\t"
      "                                \n\t"
      "movaps	%%xmm11, 64(%%rbx)       \n\t"
      "movaps	%%xmm15, 80(%%rbx)       \n\t"
      "                                \n\t"
      "                                \n\t"
      "                                \n\t"
      "cmpl      $4,  %%edx            \n\t"
      "jl      .END1_1                   \n\t"
      "                                \n\t"
      "movddup 24(%%rax), %%xmm0       \n\t"
      "movddup 56(%%rax), %%xmm1       \n\t"
      "movddup 88(%%rax), %%xmm2       \n\t"
      "movddup 24(%%r8), %%xmm3        \n\t"
      "                                \n\t"
      "movaps  %%xmm0,  %%xmm4         \n\t"
      "mulpd   %%xmm9, %%xmm0          \n\t"
      "mulpd   %%xmm13, %%xmm4         \n\t"
      "subpd   %%xmm0, %%xmm10         \n\t"
      "subpd   %%xmm4, %%xmm14         \n\t"
      "                                \n\t"
      "cmpl      $4,  %%ecx            \n\t"
      "                                \n\t"
      "movaps  %%xmm1,  %%xmm4         \n\t"
      "mulpd   %%xmm8, %%xmm1          \n\t"
      "mulpd   %%xmm12, %%xmm4         \n\t"
      "subpd   %%xmm1, %%xmm10         \n\t"
      "subpd   %%xmm4, %%xmm14         \n\t"
      "                                \n\t"
      "movaps  %%xmm2,  %%xmm4         \n\t"
      "mulpd   %%xmm11, %%xmm2         \n\t"
      "mulpd   %%xmm15, %%xmm4         \n\t"
      "subpd   %%xmm2, %%xmm10         \n\t"
      "subpd   %%xmm4, %%xmm14         \n\t"
      "                                \n\t"
      "mulpd   %%xmm3, %%xmm10         \n\t"
      "mulpd   %%xmm3, %%xmm14         \n\t"
      "                                \n\t"
      "movaps	%%xmm10, 96(%%rbx)       \n\t"
      "movaps	%%xmm14, 112(%%rbx)      \n\t"
      "                                \n\t"
      "                                \n\t"
      "                                \n\t"
      "jmp .END1_1                     \n\t"
      "                                \n\t"
      ".DNO_INV_E_1:                   \n\t"
      "                                \n\t"
      "movsd   .DONE_1(%%rip), %%xmm6  \n\t"
      "                                \n\t"
      "movq   %7, %%rax                \n\t"
      "movq   %6, %%rbx                \n\t"
      "                                \n\t"
      "                                \n\t"
      "movddup (%%rax), %%xmm0         \n\t"
      "movsd   %%xmm6, %%xmm5          \n\t"
      "divsd   %%xmm0, %%xmm5          \n\t"
      "movddup %%xmm5, %%xmm0          \n\t"
      "                                \n\t"
      "mulpd   %%xmm0, %%xmm9          \n\t"
      "mulpd   %%xmm0, %%xmm13         \n\t"
      "                                \n\t"
      "movaps	%%xmm9,  (%%rbx)         \n\t"
      "movaps	%%xmm13, 16(%%rbx)       \n\t"
      "                                \n\t"
      "                                \n\t"
      "movddup 8(%%rax), %%xmm0        \n\t"
      "movsd   %%xmm6, %%xmm5          \n\t"
      "divsd   %%xmm0, %%xmm5          \n\t"
      "movddup 40(%%rax), %%xmm1       \n\t"
      "movddup %%xmm5, %%xmm0          \n\t"
      "                                \n\t"
      "movaps  %%xmm0,  %%xmm4         \n\t"
      "mulpd   %%xmm9, %%xmm0          \n\t"
      "mulpd   %%xmm13, %%xmm4         \n\t"
      "subpd   %%xmm0, %%xmm8          \n\t"
      "subpd   %%xmm4, %%xmm12         \n\t"
      "                                \n\t"
      "mulpd   %%xmm1, %%xmm8          \n\t"
      "mulpd   %%xmm1, %%xmm12         \n\t"
      "                                \n\t"
      "movaps	%%xmm8,  32(%%rbx)       \n\t"
      "movaps	%%xmm12, 48(%%rbx)       \n\t"
      "                                \n\t"
      "                                \n\t"
      "                                \n\t"
      "movddup 16(%%rax), %%xmm0       \n\t"
      "movsd   %%xmm6, %%xmm5          \n\t"
      "divsd   %%xmm0, %%xmm5          \n\t"
      "movddup 48(%%rax), %%xmm1       \n\t"
      "movddup 80(%%rax), %%xmm2       \n\t"
      "movddup %%xmm5, %%xmm0          \n\t"
      "                                \n\t"
      "movaps  %%xmm0,  %%xmm4         \n\t"
      "mulpd   %%xmm9, %%xmm0          \n\t"
      "mulpd   %%xmm13, %%xmm4         \n\t"
      "subpd   %%xmm0, %%xmm11         \n\t"
      "subpd   %%xmm4, %%xmm15         \n\t"
      "                                \n\t"
      "movaps  %%xmm1,  %%xmm4         \n\t"
      "mulpd   %%xmm8, %%xmm1          \n\t"
      "mulpd   %%xmm12, %%xmm4         \n\t"
      "subpd   %%xmm1, %%xmm11         \n\t"
      "subpd   %%xmm4, %%xmm15         \n\t"
      "                                \n\t"
      "mulpd   %%xmm2, %%xmm11         \n\t"
      "mulpd   %%xmm2, %%xmm15         \n\t"
      "                                \n\t"
      "movaps	%%xmm11, 64(%%rbx)       \n\t"
      "movaps	%%xmm15, 80(%%rbx)       \n\t"
      "                                \n\t"
      "                                \n\t"
      "                                \n\t"
      "cmpl      $4,  %%edx            \n\t"
      "jl      .END1_1                   \n\t"
      "                                \n\t"
      "movddup 24(%%rax), %%xmm0       \n\t"
      "movsd   %%xmm6, %%xmm5          \n\t"
      "divsd   %%xmm0, %%xmm5          \n\t"
      "movddup 56(%%rax), %%xmm1       \n\t"
      "movddup 88(%%rax), %%xmm2       \n\t"
      "movddup 120(%%rax), %%xmm3       \n\t"
      "movddup %%xmm5, %%xmm0          \n\t"
      "                                \n\t"
      "movaps  %%xmm0,  %%xmm4         \n\t"
      "mulpd   %%xmm9, %%xmm0          \n\t"
      "mulpd   %%xmm13, %%xmm4         \n\t"
      "subpd   %%xmm0, %%xmm10         \n\t"
      "subpd   %%xmm4, %%xmm14         \n\t"
      "                                \n\t"
      "cmpl      $4,  %%ecx            \n\t"
      "                                \n\t"
      "movaps  %%xmm1,  %%xmm4         \n\t"
      "mulpd   %%xmm8, %%xmm1          \n\t"
      "mulpd   %%xmm12, %%xmm4         \n\t"
      "subpd   %%xmm1, %%xmm10         \n\t"
      "subpd   %%xmm4, %%xmm14         \n\t"
      "                                \n\t"
      "movaps  %%xmm2,  %%xmm4         \n\t"
      "mulpd   %%xmm11, %%xmm2         \n\t"
      "mulpd   %%xmm15, %%xmm4         \n\t"
      "subpd   %%xmm2, %%xmm10         \n\t"
      "subpd   %%xmm4, %%xmm14         \n\t"
      "                                \n\t"
      "mulpd   %%xmm3, %%xmm10         \n\t"
      "mulpd   %%xmm3, %%xmm14         \n\t"
      "                                \n\t"
      "movaps	%%xmm10, 96(%%rbx)       \n\t"
      "movaps	%%xmm14, 112(%%rbx)      \n\t"
      "                                \n\t"
      "                                \n\t"
      "                                \n\t"
      "                                \n\t"
      "jmp    .END1_1                    \n\t"
      ".align 16                       \n\t"
      ".DONE_1:                          \n\t"
      ".long  0                        \n\t"
      ".long  1072693248               \n\t"
      ".long  0                        \n\t"
      ".long  0                        \n\t"
      "                                \n\t"
      "                                \n\t"
      "                                \n\t"
      ".END1_1:                        \n\t"
      "                                \n\t"
      "                                \n\t"
      :
      : "m"(ki_add), "m"(kl_add), "m"(ki_sub), "m"(Ap), "m"(Bp), "m"(C), "m"(D),
        "m"(E), "m"(alg), "m"(Am), "m"(Bm), "m"(use_inv_diag_E), "m"(inv_diag_E)
      : "rax", "rbx", "rcx", "rdx", "rsi", "xmm0", "xmm1", "xmm2", "xmm3",
        "xmm4", "xmm5", "xmm6", "xmm7", "xmm8", "xmm9", "xmm10", "xmm11",
        "xmm12", "xmm13", "xmm14", "xmm15", "memory");
}


x86 assembly (clang, -O0):
<kernel_dgemm_dtrsm_nt_4x4_lib4_new>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3c(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,-0x40(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x44(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rbx
xorpd  %xmm3,%xmm3
movaps %xmm3,%xmm4
movaps %xmm3,%xmm5
movaps %xmm3,%xmm6
movaps %xmm3,%xmm7
movaps %xmm3,%xmm8
movaps %xmm3,%xmm9
movaps %xmm3,%xmm10
movaps %xmm3,%xmm11
movaps %xmm3,%xmm12
movaps %xmm3,%xmm13
movaps %xmm3,%xmm14
movaps %xmm3,%xmm15
mov    -0x3c(%rbp),%esi
mov    -0x40(%rbp),%ecx
add    %esi,%ecx
test   %ecx,%ecx
je     1409 <.DCONSIDERSUB_1>
movaps (%rax),%xmm0
movaps 0x10(%rax),%xmm1
movaps (%rbx),%xmm2
test   %esi,%esi
je     1380 <.DCONSIDERADD_1>

x86 assembly (clang, -O2):
<kernel_dgemm_dtrsm_nt_4x4_lib4_new>:
push   %rbx
mov    %rsi,-0x8(%rsp)
mov    %rdx,-0x10(%rsp)
mov    %r8,-0x18(%rsp)
mov    %r9,-0x20(%rsp)
lea    0x3(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
mov    %eax,%edx
sar    $0x2,%edx
mov    %edx,-0x24(%rsp)
and    $0xfffffffc,%eax
sub    %eax,%edi
lea    0x3(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
mov    %edi,-0x28(%rsp)
sar    $0x2,%eax
mov    %eax,-0x2c(%rsp)
mov    -0x8(%rsp),%rax
mov    -0x10(%rsp),%rbx
xorpd  %xmm3,%xmm3
movaps %xmm3,%xmm4
movaps %xmm3,%xmm5
movaps %xmm3,%xmm6
movaps %xmm3,%xmm7
movaps %xmm3,%xmm8
movaps %xmm3,%xmm9
movaps %xmm3,%xmm10
movaps %xmm3,%xmm11
movaps %xmm3,%xmm12
movaps %xmm3,%xmm13
movaps %xmm3,%xmm14
movaps %xmm3,%xmm15
mov    -0x24(%rsp),%esi
mov    -0x28(%rsp),%ecx
add    %esi,%ecx
test   %ecx,%ecx
je     13e9 <.DCONSIDERSUB_1>
movaps (%rax),%xmm0
movaps 0x10(%rax),%xmm1
movaps (%rbx),%xmm2
test   %esi,%esi
je     1367 <.DCONSIDERADD_1>

LLVM IR (-O0):
define void @kernel_dgemm_dtrsm_nt_4x4_lib4_new(i32 %0, double* %1, double* %2, i32 %3, double* %4, double* %5, i32 %6, double* %7, double* %8, double* %9, i32 %10, double* %11) {
%13 = alloca i32
%14 = alloca double*
%15 = alloca double*
%16 = alloca i32
%17 = alloca double*
%18 = alloca double*
%19 = alloca i32
%20 = alloca double*
%21 = alloca double*
%22 = alloca double*
%23 = alloca i32
%24 = alloca double*
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
store i32 %0, i32* %13
store double* %1, double** %14
store double* %2, double** %15
store i32 %3, i32* %16
store double* %4, double** %17
store double* %5, double** %18
store i32 %6, i32* %19
store double* %7, double** %20
store double* %8, double** %21
store double* %9, double** %22
store i32 %10, i32* %23
store double* %11, double** %24
%28 = load i32, i32* %13
%29 = sdiv i32 %28, 4
store i32 %29, i32* %25
%30 = load i32, i32* %13
%31 = srem i32 %30, 4
store i32 %31, i32* %26
%32 = load i32, i32* %16
%33 = sdiv i32 %32, 4
store i32 %33, i32* %27
ret void
}

LLVM IR (-O2):
define void @kernel_dgemm_dtrsm_nt_4x4_lib4_new(i32 %0, double* %1, double* %2, i32 %3, double* %4, double* %5, i32 %6, double* %7, double* %8, double* %9, i32 %10, double* %11) {
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca i32
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca i32
%22 = alloca double*
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
store double* %1, double** %13
store double* %2, double** %14
store double* %4, double** %15
store double* %5, double** %16
store i32 %6, i32* %17
store double* %7, double** %18
store double* %8, double** %19
store double* %9, double** %20
store i32 %10, i32* %21
store double* %11, double** %22
%26 = bitcast i32* %23 to i8*
%27 = sdiv i32 %0, 4
store i32 %27, i32* %23
%28 = bitcast i32* %24 to i8*
%29 = srem i32 %0, 4
store i32 %29, i32* %24
%30 = bitcast i32* %25 to i8*
%31 = sdiv i32 %3, 4
store i32 %31, i32* %25
ret void
}