user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<kernel_dgetrf_nn_4x4_lib4>:
  endbr64
  push   %r15
  mov    %r9,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    0x38(%rsp),%r14
  mov    %r8d,-0x18(%rsp)
  test   %edi,%edi
  jle    L5
  mov    %edi,%r10d
  mov    %rsi,%rbx
  mov    %rdx,%r13
  cmp    $0x3,%edi
  jle    L79
  lea    -0x4(%rdi),%eax
  shl    $0x2,%ecx
  mov    %r9,-0x8(%rsp)
  pxor   %xmm7,%xmm7
  shr    $0x2,%eax
  movslq %ecx,%rcx
  mov    %r13,-0x10(%rsp)
  mov    %rdx,%rbp
  add    $0x1,%eax
  movq   %xmm7,%rdx
  movq   %xmm7,%rdi
  mov    %r10d,%r13d
  mov    %eax,-0x14(%rsp)
  movapd %xmm7,%xmm14
  movapd %xmm7,%xmm13
  lea    0x0(,%rcx,8),%r11
  mov    %rax,-0x20(%rsp)
  shl    $0x7,%rax
  movq   %xmm7,%rcx
  movapd %xmm7,%xmm15
  lea    (%rsi,%rax,1),%r12
  movapd %xmm7,%xmm10
  movsd  %xmm7,-0x50(%rsp)
  movq   %xmm7,%rsi
  movsd  %xmm7,-0x48(%rsp)
  movapd %xmm7,%xmm0
  mov    %r12,%r15
  mov    %r11,%r14
  movsd  %xmm7,-0x40(%rsp)
  movapd %xmm7,%xmm11
  movsd  %xmm7,-0x38(%rsp)
  movsd  %xmm7,-0x30(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L24:
  movsd  (%rbx),%xmm4
  movsd  0x0(%rbp),%xmm8
  sub    $0xffffffffffffff80,%rbx
  movsd  -0x78(%rbx),%xmm3
  movsd  -0x70(%rbx),%xmm2
  movapd %xmm4,%xmm9
  movsd  -0x68(%rbx),%xmm1
  movsd  0x20(%rbp),%xmm6
  mulsd  %xmm8,%xmm9
  movsd  0x40(%rbp),%xmm5
  movsd  0x60(%rbp),%xmm12
  subsd  %xmm9,%xmm11
  movapd %xmm3,%xmm9
  mulsd  %xmm8,%xmm9
  subsd  %xmm9,%xmm14
  movapd %xmm2,%xmm9
  mulsd  %xmm8,%xmm9
  mulsd  %xmm1,%xmm8
  subsd  %xmm9,%xmm15
  movsd  -0x50(%rsp),%xmm9
  subsd  %xmm8,%xmm9
  movapd %xmm4,%xmm8
  mulsd  %xmm6,%xmm8
  movq   %xmm9,%r8
  movsd  -0x48(%rsp),%xmm9
  subsd  %xmm8,%xmm0
  movapd %xmm3,%xmm8
  mulsd  %xmm6,%xmm8
  subsd  %xmm8,%xmm9
  movapd %xmm2,%xmm8
  mulsd  %xmm6,%xmm8
  mulsd  %xmm1,%xmm6
  movq   %xmm9,%rax
  movq   %rdi,%xmm9
  subsd  %xmm8,%xmm13
  movq   %rsi,%xmm8
  subsd  %xmm6,%xmm9
  movapd %xmm4,%xmm6
  mulsd  %xmm5,%xmm6
  mulsd  %xmm12,%xmm4
  movq   %xmm9,%rdi
  movq   %rcx,%xmm9
  subsd  %xmm6,%xmm10
  movapd %xmm3,%xmm6
  mulsd  %xmm5,%xmm6
  mulsd  %xmm12,%xmm3
  subsd  %xmm6,%xmm8
  movapd %xmm2,%xmm6
  mulsd  %xmm5,%xmm6
  mulsd  %xmm1,%xmm5
  mulsd  %xmm12,%xmm1
  movq   %xmm8,%rsi
  mulsd  %xmm12,%xmm2
  movsd  0x68(%rbp),%xmm12
  subsd  %xmm6,%xmm9
  movq   %rdx,%xmm6
  subsd  %xmm5,%xmm6
  movsd  -0x40(%rsp),%xmm5
  subsd  %xmm1,%xmm7
  movsd  -0x48(%rbx),%xmm1
  subsd  %xmm4,%xmm5
  movsd  -0x38(%rsp),%xmm4
  movq   %xmm9,%rcx
  movq   %xmm6,%rdx
  movsd  0x28(%rbp),%xmm6
  subsd  %xmm3,%xmm4
  movapd %xmm7,%xmm9
  movsd  0x8(%rbp),%xmm7
  movsd  -0x30(%rsp),%xmm3
  movq   %xmm5,%r11
  movsd  0x48(%rbp),%xmm5
  subsd  %xmm2,%xmm3
  movsd  -0x50(%rbx),%xmm2
  movq   %xmm4,%r10
  movsd  -0x60(%rbx),%xmm4
  movapd %xmm4,%xmm8
  movq   %xmm3,%r9
  movsd  -0x58(%rbx),%xmm3
  mulsd  %xmm7,%xmm8
  subsd  %xmm8,%xmm11
  movapd %xmm11,%xmm8
  movapd %xmm3,%xmm11
  mulsd  %xmm7,%xmm11
  subsd  %xmm11,%xmm14
  movapd %xmm2,%xmm11
  mulsd  %xmm7,%xmm11
  mulsd  %xmm1,%xmm7
  subsd  %xmm11,%xmm15
  movq   %r8,%xmm11
  subsd  %xmm7,%xmm11
  movapd %xmm4,%xmm7
  mulsd  %xmm6,%xmm7
  movq   %xmm11,%r8
  movq   %rax,%xmm11
  subsd  %xmm7,%xmm0
  movapd %xmm3,%xmm7
  mulsd  %xmm6,%xmm7
  subsd  %xmm7,%xmm11
  movapd %xmm2,%xmm7
  mulsd  %xmm6,%xmm7
  mulsd  %xmm1,%xmm6
  movq   %xmm11,%rax
  subsd  %xmm7,%xmm13
  movq   %rdi,%xmm7
  subsd  %xmm6,%xmm7
  movapd %xmm4,%xmm6
  mulsd  %xmm5,%xmm6
  mulsd  %xmm12,%xmm4
  movq   %xmm7,%rdi
  movq   %rsi,%xmm7
  subsd  %xmm6,%xmm10
  movapd %xmm3,%xmm6
  mulsd  %xmm5,%xmm6
  mulsd  %xmm12,%xmm3
  movq   %xmm10,%r12
  movsd  0x70(%rbp),%xmm10
  subsd  %xmm6,%xmm7
  movapd %xmm2,%xmm6
  mulsd  %xmm5,%xmm6
  mulsd  %xmm1,%xmm5
  mulsd  %xmm12,%xmm2
  movq   %xmm7,%rsi
  movq   %rcx,%xmm7
  mulsd  %xmm12,%xmm1
  movq   %r8,%xmm12
  subsd  %xmm6,%xmm7
  movsd  0x30(%rbp),%xmm6
  movq   %xmm7,%rcx
  movq   %rdx,%xmm7
  subsd  %xmm1,%xmm9
  movsd  -0x28(%rbx),%xmm1
  subsd  %xmm5,%xmm7
  movq   %r11,%xmm5
  subsd  %xmm4,%xmm5
  movq   %r10,%xmm4
  subsd  %xmm3,%xmm4
  movq   %r9,%xmm3
  movq   %xmm7,%rdx
  movsd  0x10(%rbp),%xmm7
  subsd  %xmm2,%xmm3
  movsd  -0x30(%rbx),%xmm2
  movq   %xmm5,%r11
  movsd  0x50(%rbp),%xmm5
  movq   %xmm4,%r10
  movsd  -0x40(%rbx),%xmm4
  movq   %xmm3,%r9
  movsd  -0x38(%rbx),%xmm3
  movapd %xmm4,%xmm11
  mulsd  %xmm7,%xmm11
  subsd  %xmm11,%xmm8
  movapd %xmm3,%xmm11
  mulsd  %xmm7,%xmm11
  subsd  %xmm11,%xmm14
  movapd %xmm2,%xmm11
  mulsd  %xmm7,%xmm11
  mulsd  %xmm1,%xmm7
  subsd  %xmm11,%xmm15
  movapd %xmm8,%xmm11
  subsd  %xmm7,%xmm12
  movapd %xmm4,%xmm7
  mulsd  %xmm6,%xmm7
  movq   %xmm12,%r8
  movq   %rax,%xmm12
  subsd  %xmm7,%xmm0
  movapd %xmm3,%xmm7
  mulsd  %xmm6,%xmm7
  subsd  %xmm7,%xmm12
  movapd %xmm2,%xmm7
  mulsd  %xmm6,%xmm7
  mulsd  %xmm1,%xmm6
  movq   %xmm12,%rax
  subsd  %xmm7,%xmm13
  movq   %rdi,%xmm7
  subsd  %xmm6,%xmm7
  movapd %xmm4,%xmm6
  mulsd  %xmm5,%xmm6
  mulsd  %xmm10,%xmm4
  movq   %xmm7,%rdi
  movq   %r12,%xmm7
  subsd  %xmm6,%xmm7
  movapd %xmm3,%xmm6
  mulsd  %xmm5,%xmm6
  mulsd  %xmm10,%xmm3
  movq   %xmm7,%r12
  movq   %rsi,%xmm7
  subsd  %xmm6,%xmm7
  movapd %xmm2,%xmm6
  mulsd  %xmm5,%xmm6
  mulsd  %xmm1,%xmm5
  mulsd  %xmm10,%xmm2
  movq   %xmm7,%rsi
  movq   %rcx,%xmm7
  mulsd  %xmm10,%xmm1
  subsd  %xmm6,%xmm7
  movq   %rdx,%xmm6
  subsd  %xmm5,%xmm6
  movq   %r11,%xmm5
  subsd  %xmm4,%xmm5
  movq   %r10,%xmm4
  subsd  %xmm3,%xmm4
  movq   %r9,%xmm3
  subsd  %xmm1,%xmm9
  subsd  %xmm2,%xmm3
  movq   %xmm7,%rcx
  movq   %xmm6,%rdx
  movq   %xmm5,%r11
  movq   %xmm4,%r10
  movsd  -0x20(%rbx),%xmm4
  movsd  %xmm9,-0x28(%rsp)
  movq   %xmm3,%r9
  movsd  -0x18(%rbx),%xmm3
  movsd  -0x10(%rbx),%xmm2
  movsd  0x18(%rbp),%xmm10
  movapd %xmm4,%xmm12
  movsd  -0x8(%rbx),%xmm1
  movsd  0x38(%rbp),%xmm7
  movapd %xmm2,%xmm8
  movsd  0x58(%rbp),%xmm5
  mulsd  %xmm10,%xmm12
  movsd  0x78(%rbp),%xmm6
  add    %r14,%rbp
  mulsd  %xmm7,%xmm8
  subsd  %xmm12,%xmm11
  movapd %xmm3,%xmm12
  mulsd  %xmm10,%xmm12
  subsd  %xmm8,%xmm13
  subsd  %xmm12,%xmm14
  movapd %xmm2,%xmm12
  mulsd  %xmm10,%xmm12
  mulsd  %xmm1,%xmm10
  subsd  %xmm12,%xmm15
  movq   %r8,%xmm12
  subsd  %xmm10,%xmm12
  movapd %xmm4,%xmm10
  mulsd  %xmm7,%xmm10
  movsd  %xmm12,-0x50(%rsp)
  movq   %rsi,%xmm12
  subsd  %xmm10,%xmm0
  movapd %xmm3,%xmm10
  mulsd  %xmm7,%xmm10
  mulsd  %xmm1,%xmm7
  movapd %xmm10,%xmm9
  movq   %rax,%xmm10
  subsd  %xmm9,%xmm10
  movsd  %xmm10,-0x48(%rsp)
  movq   %rdi,%xmm10
  subsd  %xmm7,%xmm10
  movapd %xmm4,%xmm7
  mulsd  %xmm5,%xmm7
  mulsd  %xmm6,%xmm4
  movq   %xmm10,%rdi
  movq   %r12,%xmm10
  subsd  %xmm7,%xmm10
  movapd %xmm3,%xmm7
  mulsd  %xmm5,%xmm7
  mulsd  %xmm6,%xmm3
  subsd  %xmm7,%xmm12
  movapd %xmm2,%xmm7
  mulsd  %xmm5,%xmm7
  mulsd  %xmm1,%xmm5
  mulsd  %xmm6,%xmm2
  movq   %xmm12,%rsi
  movq   %rcx,%xmm12
  mulsd  %xmm6,%xmm1
  subsd  %xmm7,%xmm12
  movsd  -0x28(%rsp),%xmm7
  movq   %xmm12,%rcx
  movq   %rdx,%xmm12
  subsd  %xmm1,%xmm7
  subsd  %xmm5,%xmm12
  movq   %r11,%xmm5
  subsd  %xmm4,%xmm5
  movq   %r10,%xmm4
  subsd  %xmm3,%xmm4
  movq   %r9,%xmm3
  subsd  %xmm2,%xmm3
  movq   %xmm12,%rdx
  movsd  %xmm5,-0x40(%rsp)
  movsd  %xmm4,-0x38(%rsp)
  movsd  %xmm3,-0x30(%rsp)
  cmp    %r15,%rbx
  jne    L24
  mov    -0x20(%rsp),%rax
  mov    %r14,%r11
  mov    %r13d,%r10d
  mov    -0x10(%rsp),%r13
  mov    %r15,%r12
  movq   %xmm14,%r9
  movq   %xmm15,%r8
  mov    -0x8(%rsp),%r15
  imul   %r11,%rax
  mov    0x38(%rsp),%r14
  movapd %xmm4,%xmm15
  movapd %xmm3,%xmm14
  add    %rax,%r13
  mov    -0x14(%rsp),%eax
  shl    $0x2,%eax
  cmp    %eax,%r10d
  jle    L16
  movapd %xmm13,%xmm14
  movq   %xmm7,%r11
  movq   %xmm3,%rbx
  movq   %r8,%xmm13
  movq   %r9,%xmm7
L37:
  movsd  (%r12),%xmm4
  movsd  0x0(%r13),%xmm8
  add    $0x1,%eax
  add    $0x20,%r12
  movsd  0x20(%r13),%xmm6
  movsd  0x40(%r13),%xmm5
  add    $0x8,%r13
  movapd %xmm4,%xmm12
  movsd  -0x18(%r12),%xmm3
  movsd  -0x10(%r12),%xmm2
  mulsd  %xmm8,%xmm12
  movsd  -0x8(%r12),%xmm1
  movsd  0x58(%r13),%xmm9
  subsd  %xmm12,%xmm11
  movapd %xmm3,%xmm12
  mulsd  %xmm8,%xmm12
  subsd  %xmm12,%xmm7
  movapd %xmm2,%xmm12
  mulsd  %xmm8,%xmm12
  mulsd  %xmm1,%xmm8
  subsd  %xmm12,%xmm13
  movsd  -0x50(%rsp),%xmm12
  subsd  %xmm8,%xmm12
  movapd %xmm4,%xmm8
  mulsd  %xmm6,%xmm8
  movsd  %xmm12,-0x50(%rsp)
  movsd  -0x48(%rsp),%xmm12
  subsd  %xmm8,%xmm0
  movapd %xmm3,%xmm8
  mulsd  %xmm6,%xmm8
  subsd  %xmm8,%xmm12
  movapd %xmm2,%xmm8
  mulsd  %xmm6,%xmm8
  mulsd  %xmm1,%xmm6
  movsd  %xmm12,-0x48(%rsp)
  movq   %rdi,%xmm12
  subsd  %xmm8,%xmm14
  subsd  %xmm6,%xmm12
  movapd %xmm4,%xmm6
  mulsd  %xmm5,%xmm6
  mulsd  %xmm9,%xmm4
  movq   %xmm12,%rdi
  movq   %rsi,%xmm12
  subsd  %xmm6,%xmm10
  movapd %xmm3,%xmm6
  mulsd  %xmm5,%xmm6
  mulsd  %xmm9,%xmm3
  subsd  %xmm6,%xmm12
  movapd %xmm2,%xmm6
  mulsd  %xmm5,%xmm6
  subsd  %xmm3,%xmm15
  mulsd  %xmm1,%xmm5
  mulsd  %xmm9,%xmm2
  movq   %xmm12,%rsi
  movq   %rcx,%xmm12
  mulsd  %xmm9,%xmm1
  subsd  %xmm6,%xmm12
  movq   %rdx,%xmm6
  subsd  %xmm5,%xmm6
  movsd  -0x40(%rsp),%xmm5
  subsd  %xmm4,%xmm5
  movq   %rbx,%xmm4
  movq   %xmm12,%rcx
  subsd  %xmm2,%xmm4
  movq   %r11,%xmm2
  movq   %xmm6,%rdx
  subsd  %xmm1,%xmm2
  movsd  %xmm5,-0x40(%rsp)
  movq   %xmm4,%rbx
  movq   %xmm2,%r11
  cmp    %eax,%r10d
  jg     L37
  movq   %xmm7,%r9
  movq   %xmm13,%r8
  movapd %xmm2,%xmm7
  movapd %xmm14,%xmm13
  movapd %xmm4,%xmm14
L16:
  mov    -0x18(%rsp),%eax
  test   %eax,%eax
  je     L21
  movq   %r9,%xmm2
  addsd  0x8(%r15),%xmm2
  movsd  -0x40(%rsp),%xmm1
  addsd  0x60(%r15),%xmm1
  addsd  (%r15),%xmm11
  addsd  0x20(%r15),%xmm0
  addsd  0x30(%r15),%xmm13
  movq   %xmm2,%r9
  movq   %r8,%xmm2
  addsd  0x10(%r15),%xmm2
  addsd  0x40(%r15),%xmm10
  addsd  0x68(%r15),%xmm15
  movsd  %xmm1,-0x40(%rsp)
  addsd  0x70(%r15),%xmm14
  addsd  0x78(%r15),%xmm7
  movq   %xmm2,%r8
  movsd  -0x50(%rsp),%xmm2
  addsd  0x18(%r15),%xmm2
  movsd  %xmm2,-0x50(%rsp)
  movsd  -0x48(%rsp),%xmm2
  addsd  0x28(%r15),%xmm2
  movsd  %xmm2,-0x48(%rsp)
  movq   %rdi,%xmm2
  addsd  0x38(%r15),%xmm2
  movq   %xmm2,%rdi
  movq   %rsi,%xmm2
  addsd  0x48(%r15),%xmm2
  movq   %xmm2,%rsi
  movq   %rcx,%xmm2
  addsd  0x50(%r15),%xmm2
  movq   %xmm2,%rcx
  movq   %rdx,%xmm2
  addsd  0x58(%r15),%xmm2
  movq   %xmm2,%rdx
L21:
  movq   %r9,%xmm8
  mov    0x40(%rsp),%rax
  movq   %r8,%xmm6
  movsd  D3(%rip),%xmm4
  movsd  -0x50(%rsp),%xmm5
  movsd  -0x48(%rsp),%xmm3
  movapd %xmm0,%xmm9
  movapd %xmm13,%xmm2
  movapd %xmm4,%xmm1
  divsd  %xmm11,%xmm1
  mulsd  %xmm1,%xmm8
  movsd  %xmm1,(%rax)
  mulsd  %xmm1,%xmm6
  movsd  %xmm11,(%r14)
  movapd %xmm10,%xmm11
  mulsd  %xmm1,%xmm5
  movapd %xmm0,%xmm1
  mulsd  %xmm8,%xmm1
  movsd  %xmm8,0x8(%r14)
  movsd  %xmm6,0x10(%r14)
  mulsd  %xmm5,%xmm9
  movsd  %xmm5,0x18(%r14)
  mulsd  %xmm5,%xmm11
  subsd  %xmm1,%xmm3
  movapd %xmm0,%xmm1
  mulsd  %xmm6,%xmm1
  subsd  %xmm1,%xmm2
  movq   %rdi,%xmm1
  subsd  %xmm9,%xmm1
  movapd %xmm4,%xmm9
  divsd  %xmm3,%xmm9
  movsd  %xmm9,0x8(%rax)
  mulsd  %xmm9,%xmm2
  movsd  %xmm3,0x28(%r14)
  mulsd  %xmm9,%xmm1
  movapd %xmm10,%xmm3
  movq   %rcx,%xmm9
  mulsd  %xmm8,%xmm3
  movsd  %xmm0,0x20(%r14)
  movq   %rsi,%xmm0
  movsd  %xmm2,0x30(%r14)
  movsd  %xmm1,0x38(%r14)
  subsd  %xmm3,%xmm0
  movapd %xmm10,%xmm3
  mulsd  %xmm6,%xmm3
  subsd  %xmm3,%xmm9
  movq   %rdx,%xmm3
  subsd  %xmm11,%xmm3
  movapd %xmm2,%xmm11
  mulsd  %xmm0,%xmm11
  subsd  %xmm11,%xmm9
  movapd %xmm1,%xmm11
  mulsd  %xmm0,%xmm11
  subsd  %xmm11,%xmm3
  movapd %xmm4,%xmm11
  divsd  %xmm9,%xmm11
  movsd  %xmm11,0x10(%rax)
  mulsd  %xmm11,%xmm3
  movsd  %xmm0,0x48(%r14)
  movsd  -0x40(%rsp),%xmm0
  movsd  %xmm10,0x40(%r14)
  mulsd  %xmm0,%xmm8
  movsd  %xmm9,0x50(%r14)
  mulsd  %xmm0,%xmm6
  mulsd  %xmm0,%xmm5
  movsd  %xmm3,0x58(%r14)
  subsd  %xmm8,%xmm15
  subsd  %xmm6,%xmm14
  movapd %xmm0,%xmm6
  movapd %xmm7,%xmm0
  subsd  %xmm5,%xmm0
  mulsd  %xmm15,%xmm2
  mulsd  %xmm15,%xmm1
  movapd %xmm14,%xmm5
  subsd  %xmm2,%xmm5
  subsd  %xmm1,%xmm0
  mulsd  %xmm5,%xmm3
  subsd  %xmm3,%xmm0
  divsd  %xmm0,%xmm4
  movsd  %xmm4,0x18(%rax)
  movsd  %xmm6,0x60(%r14)
  movsd  %xmm15,0x68(%r14)
  movsd  %xmm5,0x70(%r14)
  movsd  %xmm0,0x78(%r14)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L5:
  pxor   %xmm7,%xmm7
  movq   %xmm7,%rdx
  movq   %xmm7,%rdi
  movsd  %xmm7,-0x50(%rsp)
  movapd %xmm7,%xmm14
  movq   %xmm7,%rcx
  movapd %xmm7,%xmm13
  movq   %xmm7,%r8
  movsd  %xmm7,-0x48(%rsp)
  movapd %xmm7,%xmm15
  movq   %xmm7,%rsi
  movq   %xmm7,%r9
  movsd  %xmm7,-0x40(%rsp)
  movapd %xmm7,%xmm10
  movapd %xmm7,%xmm0
  movapd %xmm7,%xmm11
  jmp    L16
  cs nopw 0x0(%rax,%rax,1)
L79:
  pxor   %xmm7,%xmm7
  mov    %rsi,%r12
  xor    %eax,%eax
  movq   %xmm7,%rdx
  movq   %xmm7,%rdi
  movsd  %xmm7,-0x50(%rsp)
  movapd %xmm7,%xmm14
  movq   %xmm7,%rcx
  movapd %xmm7,%xmm13
  movapd %xmm7,%xmm15
  movsd  %xmm7,-0x48(%rsp)
  movq   %xmm7,%rsi
  movsd  %xmm7,-0x40(%rsp)
  movapd %xmm7,%xmm10
  movapd %xmm7,%xmm0
  movapd %xmm7,%xmm11
  movq   %xmm7,%rbx
  movq   %xmm7,%r11
  jmp    L37
```

tool_calls: name: disassemble_data
arguments: tag: D3
type_infered: f64

tool: D3: 1

assistant: ```c
void kernel_dgetrf_nn_4x4_lib4(int kmax, double *A, double *B, int sdb, int alg, double *C, double *D, double *inv_diag_D) {
  const int bs = 4;
  int k;
  double tmp, a_0, a_1, a_2, a_3, b_0, b_1, b_2, b_3, d_00 = 0, d_01 = 0, d_02 = 0, d_03 = 0, d_10 = 0, d_11 = 0, d_12 = 0, d_13 = 0, d_20 = 0, d_21 = 0, d_22 = 0, d_23 = 0, d_30 = 0, d_31 = 0, d_32 = 0, d_33 = 0;
  if (kmax <= 0)
    goto add;
  for (k = 0; k < kmax - 3; k += 4) {
    a_0 = A[0 + bs * 0];
    a_1 = A[1 + bs * 0];
    a_2 = A[2 + bs * 0];
    a_3 = A[3 + bs * 0];
    b_0 = B[0 + bs * 0];
    b_1 = B[0 + bs * 1];
    b_2 = B[0 + bs * 2];
    b_3 = B[0 + bs * 3];
    d_00 -= a_0 * b_0;
    d_10 -= a_1 * b_0;
    d_20 -= a_2 * b_0;
    d_30 -= a_3 * b_0;
    d_01 -= a_0 * b_1;
    d_11 -= a_1 * b_1;
    d_21 -= a_2 * b_1;
    d_31 -= a_3 * b_1;
    d_02 -= a_0 * b_2;
    d_12 -= a_1 * b_2;
    d_22 -= a_2 * b_2;
    d_32 -= a_3 * b_2;
    d_03 -= a_0 * b_3;
    d_13 -= a_1 * b_3;
    d_23 -= a_2 * b_3;
    d_33 -= a_3 * b_3;
    a_0 = A[0 + bs * 1];
    a_1 = A[1 + bs * 1];
    a_2 = A[2 + bs * 1];
    a_3 = A[3 + bs * 1];
    b_0 = B[1 + bs * 0];
    b_1 = B[1 + bs * 1];
    b_2 = B[1 + bs * 2];
    b_3 = B[1 + bs * 3];
    d_00 -= a_0 * b_0;
    d_10 -= a_1 * b_0;
    d_20 -= a_2 * b_0;
    d_30 -= a_3 * b_0;
    d_01 -= a_0 * b_1;
    d_11 -= a_1 * b_1;
    d_21 -= a_2 * b_1;
    d_31 -= a_3 * b_1;
    d_02 -= a_0 * b_2;
    d_12 -= a_1 * b_2;
    d_22 -= a_2 * b_2;
    d_32 -= a_3 * b_2;
    d_03 -= a_0 * b_3;
    d_13 -= a_1 * b_3;
    d_23 -= a_2 * b_3;
    d_33 -= a_3 * b_3;
    a_0 = A[0 + bs * 2];
    a_1 = A[1 + bs * 2];
    a_2 = A[2 + bs * 2];
    a_3 = A[3 + bs * 2];
    b_0 = B[2 + bs * 0];
    b_1 = B[2 + bs * 1];
    b_2 = B[2 + bs * 2];
    b_3 = B[2 + bs * 3];
    d_00 -= a_0 * b_0;
    d_10 -= a_1 * b_0;
    d_20 -= a_2 * b_0;
    d_30 -= a_3 * b_0;
    d_01 -= a_0 * b_1;
    d_11 -= a_1 * b_1;
    d_21 -= a_2 * b_1;
    d_31 -= a_3 * b_1;
    d_02 -= a_0 * b_2;
    d_12 -= a_1 * b_2;
    d_22 -= a_2 * b_2;
    d_32 -= a_3 * b_2;
    d_03 -= a_0 * b_3;
    d_13 -= a_1 * b_3;
    d_23 -= a_2 * b_3;
    d_33 -= a_3 * b_3;
    a_0 = A[0 + bs * 3];
    a_1 = A[1 + bs * 3];
    a_2 = A[2 + bs * 3];
    a_3 = A[3 + bs * 3];
    b_0 = B[3 + bs * 0];
    b_1 = B[3 + bs * 1];
    b_2 = B[3 + bs * 2];
    b_3 = B[3 + bs * 3];
    d_00 -= a_0 * b_0;
    d_10 -= a_1 * b_0;
    d_20 -= a_2 * b_0;
    d_30 -= a_3 * b_0;
    d_01 -= a_0 * b_1;
    d_11 -= a_1 * b_1;
    d_21 -= a_2 * b_1;
    d_31 -= a_3 * b_1;
    d_02 -= a_0 * b_2;
    d_12 -= a_1 * b_2;
    d_22 -= a_2 * b_2;
    d_32 -= a_3 * b_2;
    d_03 -= a_0 * b_3;
    d_13 -= a_1 * b_3;
    d_23 -= a_2 * b_3;
    d_33 -= a_3 * b_3;
    A += 16;
    B += 4 * sdb;
  }
  for (; k < kmax; k++) {
    a_0 = A[0 + bs * 0];
    a_1 = A[1 + bs * 0];
    a_2 = A[2 + bs * 0];
    a_3 = A[3 + bs * 0];
    b_0 = B[0 + bs * 0];
    b_1 = B[0 + bs * 1];
    b_2 = B[0 + bs * 2];
    b_3 = B[0 + bs * 3];
    d_00 -= a_0 * b_0;
    d_10 -= a_1 * b_0;
    d_20 -= a_2 * b_0;
    d_30 -= a_3 * b_0;
    d_01 -= a_0 * b_1;
    d_11 -= a_1 * b_1;
    d_21 -= a_2 * b_1;
    d_31 -= a_3 * b_1;
    d_02 -= a_0 * b_2;
    d_12 -= a_1 * b_2;
    d_22 -= a_2 * b_2;
    d_32 -= a_3 * b_2;
    d_03 -= a_0 * b_3;
    d_13 -= a_1 * b_3;
    d_23 -= a_2 * b_3;
    d_33 -= a_3 * b_3;
    A += 4;
    B += 1;
  }
add:
  if (alg != 0) {
    d_00 += C[0 + bs * 0];
    d_10 += C[1 + bs * 0];
    d_20 += C[2 + bs * 0];
    d_30 += C[3 + bs * 0];
    d_01 += C[0 + bs * 1];
    d_11 += C[1 + bs * 1];
    d_21 += C[2 + bs * 1];
    d_31 += C[3 + bs * 1];
    d_02 += C[0 + bs * 2];
    d_12 += C[1 + bs * 2];
    d_22 += C[2 + bs * 2];
    d_32 += C[3 + bs * 2];
    d_03 += C[0 + bs * 3];
    d_13 += C[1 + bs * 3];
    d_23 += C[2 + bs * 3];
    d_33 += C[3 + bs * 3];
  }
  tmp = 1.0 / d_00;
  d_10 *= tmp;
  d_20 *= tmp;
  d_30 *= tmp;
  inv_diag_D[0] = tmp;
  D[0 + bs * 0] = d_00;
  D[1 + bs * 0] = d_10;
  D[2 + bs * 0] = d_20;
  D[3 + bs * 0] = d_30;
  d_11 -= d_10 * d_01;
  d_21 -= d_20 * d_01;
  d_31 -= d_30 * d_01;
  tmp = 1.0 / d_11;
  d_21 *= tmp;
  d_31 *= tmp;
  inv_diag_D[1] = tmp;
  D[0 + bs * 1] = d_01;
  D[1 + bs * 1] = d_11;
  D[2 + bs * 1] = d_21;
  D[3 + bs * 1] = d_31;
  d_12 -= d_10 * d_02;
  d_22 -= d_20 * d_02;
  d_32 -= d_30 * d_02;
  d_22 -= d_21 * d_12;
  d_32 -= d_31 * d_12;
  tmp = 1.0 / d_22;
  d_32 *= tmp;
  inv_diag_D[2] = tmp;
  D[0 + bs * 2] = d_02;
  D[1 + bs * 2] = d_12;
  D[2 + bs * 2] = d_22;
  D[3 + bs * 2] = d_32;
  d_13 -= d_10 * d_03;
  d_23 -= d_20 * d_03;
  d_33 -= d_30 * d_03;
  d_23 -= d_21 * d_13;
  d_33 -= d_31 * d_13;
  d_33 -= d_32 * d_23;
  tmp = 1.0 / d_33;
  inv_diag_D[3] = tmp;
  D[0 + bs * 3] = d_03;
  D[1 + bs * 3] = d_13;
  D[2 + bs * 3] = d_23;
  D[3 + bs * 3] = d_33;
  return;
}
```