user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<kernel_dgemv_n_8_lib4>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  mov    0x20(%rsp),%r12d
  test   %edi,%edi
  jle    L93
  shl    $0x2,%edx
  mov    %rsi,%rdi
  mov    %rcx,%rbp
  movslq %edx,%rdx
  lea    (%rsi,%rdx,8),%r11
  cmp    $0x3,%ebx
  jle    L91
  lea    -0x4(%rbx),%r10d
  pxor   %xmm12,%xmm12
  mov    %rsi,%rax
  mov    %r11,%rdx
  shr    $0x2,%r10d
  movapd %xmm12,%xmm15
  movapd %xmm12,%xmm11
  xor    %esi,%esi
  add    $0x1,%r10d
  movapd %xmm12,%xmm10
  movapd %xmm12,%xmm8
  movapd %xmm12,%xmm5
  movapd %xmm12,%xmm13
  movapd %xmm12,%xmm14
  nopl   0x0(%rax)
L31:
  movupd (%rax),%xmm1
  movupd (%rcx),%xmm0
  add    $0x1,%esi
  sub    $0xffffffffffffff80,%rdx
  movupd 0x10(%rcx),%xmm2
  movupd 0x40(%rax),%xmm7
  add    $0x20,%rcx
  sub    $0xffffffffffffff80,%rax
  movhpd -0x60(%rax),%xmm1
  mulpd  %xmm0,%xmm1
  movhpd -0x20(%rax),%xmm7
  mulpd  %xmm2,%xmm7
  movapd %xmm1,%xmm3
  unpckhpd %xmm1,%xmm1
  addsd  %xmm14,%xmm3
  movlpd %xmm7,-0x8(%rsp)
  unpckhpd %xmm7,%xmm7
  addsd  %xmm1,%xmm3
  movupd -0x60(%rax),%xmm1
  movlpd -0x78(%rax),%xmm1
  mulpd  %xmm0,%xmm1
  movapd %xmm3,%xmm14
  movupd -0x20(%rax),%xmm3
  movlpd -0x38(%rax),%xmm3
  movapd %xmm3,%xmm6
  mulpd  %xmm2,%xmm6
  movapd %xmm1,%xmm3
  unpckhpd %xmm1,%xmm1
  addsd  %xmm13,%xmm3
  addsd  %xmm1,%xmm3
  movupd -0x70(%rax),%xmm1
  movaps %xmm6,-0x20(%rsp)
  movlpd %xmm6,-0x10(%rsp)
  movupd -0x40(%rdx),%xmm6
  movhpd -0x50(%rax),%xmm1
  mulpd  %xmm0,%xmm1
  movapd %xmm3,%xmm13
  movupd -0x30(%rax),%xmm3
  movhpd -0x20(%rdx),%xmm6
  mulpd  %xmm2,%xmm6
  movhpd -0x10(%rax),%xmm3
  movapd %xmm3,%xmm4
  mulpd  %xmm2,%xmm4
  movapd %xmm1,%xmm3
  unpckhpd %xmm1,%xmm1
  addsd  %xmm5,%xmm3
  addsd  %xmm1,%xmm3
  movupd -0x50(%rax),%xmm1
  movlpd -0x68(%rax),%xmm1
  movaps %xmm4,-0x40(%rsp)
  movlpd %xmm4,-0x28(%rsp)
  mulpd  %xmm0,%xmm1
  movsd  %xmm3,-0x30(%rsp)
  movupd -0x10(%rax),%xmm3
  movlpd -0x28(%rax),%xmm3
  movapd %xmm3,%xmm9
  mulpd  %xmm2,%xmm9
  movapd %xmm1,%xmm3
  unpckhpd %xmm1,%xmm1
  addsd  %xmm8,%xmm3
  movapd %xmm3,%xmm8
  movlpd %xmm9,-0x48(%rsp)
  unpckhpd %xmm9,%xmm9
  addsd  %xmm1,%xmm8
  movupd -0x80(%rdx),%xmm1
  movhpd -0x60(%rdx),%xmm1
  mulpd  %xmm0,%xmm1
  movsd  %xmm8,-0x50(%rsp)
  movapd %xmm1,%xmm3
  unpckhpd %xmm1,%xmm1
  addsd  %xmm10,%xmm3
  movapd %xmm6,%xmm10
  unpckhpd %xmm6,%xmm6
  addsd  %xmm1,%xmm3
  movupd -0x60(%rdx),%xmm1
  movsd  %xmm3,-0x58(%rsp)
  movlpd -0x78(%rdx),%xmm1
  movupd -0x70(%rdx),%xmm5
  addsd  -0x10(%rsp),%xmm13
  addsd  -0x8(%rsp),%xmm14
  movhpd -0x50(%rdx),%xmm5
  movapd %xmm1,%xmm4
  movupd -0x20(%rdx),%xmm1
  movlpd -0x38(%rdx),%xmm1
  mulpd  %xmm0,%xmm5
  addsd  -0x58(%rsp),%xmm10
  mulpd  %xmm0,%xmm4
  addsd  %xmm7,%xmm14
  movsd  -0x38(%rsp),%xmm7
  mulpd  %xmm2,%xmm1
  addsd  %xmm6,%xmm10
  movapd %xmm5,%xmm8
  unpckhpd %xmm5,%xmm5
  addsd  %xmm15,%xmm8
  movapd %xmm4,%xmm3
  unpckhpd %xmm4,%xmm4
  addsd  %xmm11,%xmm3
  movapd %xmm8,%xmm15
  movsd  -0x50(%rsp),%xmm8
  addsd  -0x48(%rsp),%xmm8
  addsd  %xmm5,%xmm15
  movupd -0x50(%rdx),%xmm5
  movlpd -0x68(%rdx),%xmm5
  addsd  %xmm4,%xmm3
  movupd -0x30(%rdx),%xmm4
  mulpd  %xmm0,%xmm5
  movupd -0x10(%rdx),%xmm0
  movlpd -0x28(%rdx),%xmm0
  addsd  %xmm9,%xmm8
  movhpd -0x10(%rdx),%xmm4
  addsd  %xmm1,%xmm3
  unpckhpd %xmm1,%xmm1
  mulpd  %xmm2,%xmm4
  mulpd  %xmm2,%xmm0
  addsd  %xmm1,%xmm3
  movapd %xmm5,%xmm2
  unpckhpd %xmm5,%xmm5
  addsd  %xmm12,%xmm2
  movlpd %xmm4,-0x60(%rsp)
  addsd  -0x60(%rsp),%xmm15
  unpckhpd %xmm4,%xmm4
  movapd %xmm3,%xmm11
  addsd  %xmm5,%xmm2
  movsd  -0x18(%rsp),%xmm5
  addsd  %xmm4,%xmm15
  addsd  %xmm5,%xmm13
  movsd  -0x30(%rsp),%xmm5
  addsd  -0x28(%rsp),%xmm5
  addsd  %xmm0,%xmm2
  unpckhpd %xmm0,%xmm0
  addsd  %xmm7,%xmm5
  addsd  %xmm0,%xmm2
  movapd %xmm2,%xmm12
  cmp    %esi,%r10d
  ja     L31
  mov    %r10d,%eax
  shl    $0x2,%r10d
  movsd  %xmm3,-0x60(%rsp)
  movapd %xmm2,%xmm9
  mov    %rax,%rdx
  shl    $0x5,%rax
  shl    $0x7,%rdx
  add    %rax,%rbp
  add    %rdx,%rdi
  add    %rdx,%r11
  cmp    %r10d,%ebx
  jle    L42
L25:
  mov    %ebx,%edx
  mov    $0x1,%eax
  sub    %r10d,%edx
  cmp    %ebx,%r10d
  cmovl  %edx,%eax
  cmp    $0x1,%edx
  je     L95
  cmp    %ebx,%r10d
  jge    L95
  movupd (%rdi),%xmm1
  movupd 0x20(%rdi),%xmm6
  mov    %eax,%edx
  movupd 0x0(%rbp),%xmm2
  movupd 0x10(%rdi),%xmm0
  shr    %edx
  movhpd 0x10(%rdi),%xmm1
  movhpd 0x30(%rdi),%xmm6
  movlpd 0x8(%rdi),%xmm0
  movupd 0x30(%rdi),%xmm3
  movapd %xmm1,%xmm4
  movlpd 0x28(%rdi),%xmm3
  unpckhpd %xmm6,%xmm1
  mulpd  %xmm2,%xmm1
  unpcklpd %xmm6,%xmm4
  movupd 0x20(%r11),%xmm6
  mulpd  %xmm2,%xmm4
  movhpd 0x30(%r11),%xmm6
  movapd %xmm4,%xmm7
  unpckhpd %xmm4,%xmm4
  addsd  %xmm14,%xmm7
  addsd  %xmm7,%xmm4
  movapd %xmm4,%xmm14
  movapd %xmm0,%xmm4
  unpckhpd %xmm3,%xmm0
  mulpd  %xmm2,%xmm0
  unpcklpd %xmm3,%xmm4
  movupd 0x30(%r11),%xmm3
  movlpd 0x28(%r11),%xmm3
  mulpd  %xmm2,%xmm4
  movapd %xmm4,%xmm7
  unpckhpd %xmm4,%xmm4
  addsd  %xmm13,%xmm7
  addsd  %xmm7,%xmm4
  movapd %xmm4,%xmm13
  movapd %xmm1,%xmm4
  unpckhpd %xmm1,%xmm1
  addsd  %xmm5,%xmm4
  movapd %xmm1,%xmm5
  movapd %xmm0,%xmm1
  addsd  %xmm8,%xmm1
  unpckhpd %xmm0,%xmm0
  addsd  %xmm4,%xmm5
  addsd  %xmm1,%xmm0
  movupd (%r11),%xmm1
  movhpd 0x10(%r11),%xmm1
  movapd %xmm1,%xmm4
  movapd %xmm0,%xmm11
  movapd %xmm0,%xmm8
  movupd 0x10(%r11),%xmm0
  unpcklpd %xmm6,%xmm4
  movlpd 0x8(%r11),%xmm0
  unpckhpd %xmm6,%xmm1
  mulpd  %xmm2,%xmm4
  mulpd  %xmm2,%xmm1
  movapd %xmm4,%xmm7
  unpckhpd %xmm4,%xmm4
  addsd  %xmm10,%xmm7
  addsd  %xmm7,%xmm4
  movsd  -0x60(%rsp),%xmm7
  movapd %xmm4,%xmm10
  movapd %xmm0,%xmm4
  unpckhpd %xmm3,%xmm0
  mulpd  %xmm2,%xmm0
  unpcklpd %xmm3,%xmm4
  mulpd  %xmm2,%xmm4
  addsd  %xmm4,%xmm7
  unpckhpd %xmm4,%xmm4
  addsd  %xmm7,%xmm4
  movapd %xmm4,%xmm12
  movsd  %xmm4,-0x60(%rsp)
  movapd %xmm1,%xmm4
  unpckhpd %xmm1,%xmm1
  addsd  %xmm15,%xmm4
  addsd  %xmm4,%xmm1
  movapd %xmm1,%xmm15
  movapd %xmm0,%xmm1
  unpckhpd %xmm0,%xmm0
  addsd  %xmm9,%xmm1
  addsd  %xmm1,%xmm0
  movapd %xmm0,%xmm9
  cmp    $0x1,%edx
  je     L60
  movupd 0x40(%rdi),%xmm1
  movupd 0x60(%rdi),%xmm6
  movupd 0x10(%rbp),%xmm2
  movupd 0x50(%rdi),%xmm0
  movhpd 0x50(%rdi),%xmm1
  movhpd 0x70(%rdi),%xmm6
  movlpd 0x48(%rdi),%xmm0
  movupd 0x70(%rdi),%xmm3
  movapd %xmm1,%xmm4
  movlpd 0x68(%rdi),%xmm3
  unpckhpd %xmm6,%xmm1
  mulpd  %xmm2,%xmm1
  unpcklpd %xmm6,%xmm4
  movupd 0x60(%r11),%xmm6
  mulpd  %xmm2,%xmm4
  movhpd 0x70(%r11),%xmm6
  movapd %xmm4,%xmm7
  unpckhpd %xmm4,%xmm4
  addsd  %xmm14,%xmm7
  addsd  %xmm7,%xmm4
  movapd %xmm4,%xmm14
  movapd %xmm0,%xmm4
  unpckhpd %xmm3,%xmm0
  mulpd  %xmm2,%xmm0
  unpcklpd %xmm3,%xmm4
  movupd 0x70(%r11),%xmm3
  movlpd 0x68(%r11),%xmm3
  mulpd  %xmm2,%xmm4
  movapd %xmm4,%xmm7
  unpckhpd %xmm4,%xmm4
  addsd  %xmm13,%xmm7
  addsd  %xmm7,%xmm4
  movapd %xmm4,%xmm13
  movapd %xmm1,%xmm4
  unpckhpd %xmm1,%xmm1
  addsd  %xmm5,%xmm4
  movapd %xmm1,%xmm5
  movapd %xmm0,%xmm1
  addsd  %xmm11,%xmm1
  unpckhpd %xmm0,%xmm0
  addsd  %xmm4,%xmm5
  addsd  %xmm1,%xmm0
  movupd 0x40(%r11),%xmm1
  movhpd 0x50(%r11),%xmm1
  movapd %xmm1,%xmm4
  movapd %xmm0,%xmm8
  movupd 0x50(%r11),%xmm0
  movlpd 0x48(%r11),%xmm0
  unpcklpd %xmm6,%xmm4
  unpckhpd %xmm6,%xmm1
  mulpd  %xmm2,%xmm4
  mulpd  %xmm2,%xmm1
  movapd %xmm4,%xmm7
  unpckhpd %xmm4,%xmm4
  addsd  %xmm10,%xmm7
  addsd  %xmm7,%xmm4
  movapd %xmm4,%xmm10
  movapd %xmm0,%xmm4
  unpckhpd %xmm3,%xmm0
  mulpd  %xmm2,%xmm0
  unpcklpd %xmm3,%xmm4
  mulpd  %xmm2,%xmm4
  movapd %xmm4,%xmm7
  unpckhpd %xmm4,%xmm4
  addsd  %xmm12,%xmm7
  addsd  %xmm7,%xmm4
  movsd  %xmm4,-0x60(%rsp)
  movapd %xmm1,%xmm4
  unpckhpd %xmm1,%xmm1
  addsd  %xmm15,%xmm4
  addsd  %xmm4,%xmm1
  movapd %xmm1,%xmm15
  movapd %xmm0,%xmm1
  unpckhpd %xmm0,%xmm0
  addsd  %xmm9,%xmm1
  addsd  %xmm1,%xmm0
  movapd %xmm0,%xmm9
L60:
  mov    %eax,%edx
  and    $0xfffffffe,%edx
  mov    %edx,%esi
  mov    %rsi,%rcx
  lea    0x0(%rbp,%rsi,8),%rbp
  shl    $0x5,%rcx
  add    %rcx,%rdi
  add    %rcx,%r11
  cmp    %eax,%edx
  je     L42
L95:
  movsd  0x0(%rbp),%xmm0
  movsd  (%rdi),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  %xmm1,%xmm14
  movsd  0x8(%rdi),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  %xmm1,%xmm13
  movsd  0x10(%rdi),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  %xmm1,%xmm5
  movsd  0x18(%rdi),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  %xmm8,%xmm1
  movapd %xmm1,%xmm8
  movsd  (%r11),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  %xmm1,%xmm10
  movsd  0x8(%r11),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  -0x60(%rsp),%xmm1
  movsd  %xmm1,-0x60(%rsp)
  movsd  0x10(%r11),%xmm1
  mulsd  %xmm0,%xmm1
  mulsd  0x18(%r11),%xmm0
  addsd  %xmm1,%xmm15
  addsd  %xmm9,%xmm0
  movapd %xmm0,%xmm9
L42:
  test   %r12d,%r12d
  je     L9
  movsd  (%r8),%xmm0
  cmp    $0x1,%r12d
  je     L76
  subsd  %xmm14,%xmm0
  movsd  %xmm0,(%r9)
  movsd  0x8(%r8),%xmm0
  subsd  %xmm13,%xmm0
  movsd  %xmm0,0x8(%r9)
  movsd  0x10(%r8),%xmm0
  subsd  %xmm5,%xmm0
  movsd  %xmm0,0x10(%r9)
  movsd  0x18(%r8),%xmm0
  subsd  %xmm8,%xmm0
  movsd  %xmm0,0x18(%r9)
  movsd  0x20(%r8),%xmm0
  subsd  %xmm10,%xmm0
  movsd  %xmm0,0x20(%r9)
  movsd  0x28(%r8),%xmm0
  subsd  -0x60(%rsp),%xmm0
  movsd  %xmm0,0x28(%r9)
  movsd  0x30(%r8),%xmm0
  subsd  %xmm15,%xmm0
  movsd  %xmm0,0x30(%r9)
  movsd  0x38(%r8),%xmm0
  subsd  %xmm9,%xmm0
  movsd  %xmm0,0x38(%r9)
L93:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L9:
  movsd  -0x60(%rsp),%xmm2
  movsd  %xmm14,(%r9)
  pop    %rbx
  movsd  %xmm13,0x8(%r9)
  pop    %rbp
  pop    %r12
  movsd  %xmm5,0x10(%r9)
  movsd  %xmm8,0x18(%r9)
  movsd  %xmm10,0x20(%r9)
  movsd  %xmm2,0x28(%r9)
  movsd  %xmm15,0x30(%r9)
  movsd  %xmm9,0x38(%r9)
  ret
  nopw   0x0(%rax,%rax,1)
L76:
  addsd  %xmm14,%xmm0
  movsd  %xmm0,(%r9)
  addsd  0x8(%r8),%xmm13
  movsd  %xmm13,0x8(%r9)
  addsd  0x10(%r8),%xmm5
  movsd  %xmm5,0x10(%r9)
  movsd  0x18(%r8),%xmm0
  addsd  %xmm8,%xmm0
  movsd  %xmm0,0x18(%r9)
  addsd  0x20(%r8),%xmm10
  movsd  -0x60(%rsp),%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  movsd  %xmm10,0x20(%r9)
  addsd  0x28(%r8),%xmm0
  movsd  %xmm0,0x28(%r9)
  addsd  0x30(%r8),%xmm15
  movsd  %xmm15,0x30(%r9)
  movsd  0x38(%r8),%xmm0
  addsd  %xmm9,%xmm0
  movsd  %xmm0,0x38(%r9)
  ret
  nopl   0x0(%rax,%rax,1)
L91:
  pxor   %xmm2,%xmm2
  xor    %r10d,%r10d
  movapd %xmm2,%xmm14
  movapd %xmm2,%xmm9
  movapd %xmm2,%xmm15
  movsd  %xmm2,-0x60(%rsp)
  movapd %xmm2,%xmm10
  movapd %xmm2,%xmm8
  movapd %xmm2,%xmm5
  movapd %xmm2,%xmm13
  jmp    L25
```

assistant: ```c
void kernel_dgemv_n_8_lib4(int kmax, double *A0, int sda, double *x, double *y, double *z, int alg) {
  if (kmax <= 0)
    return;
  double *A1 = A0 + 4 * sda;
  const int lda = 4;
  int k;
  double x_0, x_1, x_2, x_3, y_0 = 0, y_1 = 0, y_2 = 0, y_3 = 0, y_4 = 0, y_5 = 0, y_6 = 0, y_7 = 0;
  k = 0;
  for (; k < kmax - 3; k += 4) {
    x_0 = x[0];
    x_1 = x[1];
    x_2 = x[2];
    x_3 = x[3];
    y_0 += A0[0 + lda * 0] * x_0;
    y_1 += A0[1 + lda * 0] * x_0;
    y_2 += A0[2 + lda * 0] * x_0;
    y_3 += A0[3 + lda * 0] * x_0;
    y_4 += A1[0 + lda * 0] * x_0;
    y_5 += A1[1 + lda * 0] * x_0;
    y_6 += A1[2 + lda * 0] * x_0;
    y_7 += A1[3 + lda * 0] * x_0;
    y_0 += A0[0 + lda * 1] * x_1;
    y_1 += A0[1 + lda * 1] * x_1;
    y_2 += A0[2 + lda * 1] * x_1;
    y_3 += A0[3 + lda * 1] * x_1;
    y_4 += A1[0 + lda * 1] * x_1;
    y_5 += A1[1 + lda * 1] * x_1;
    y_6 += A1[2 + lda * 1] * x_1;
    y_7 += A1[3 + lda * 1] * x_1;
    y_0 += A0[0 + lda * 2] * x_2;
    y_1 += A0[1 + lda * 2] * x_2;
    y_2 += A0[2 + lda * 2] * x_2;
    y_3 += A0[3 + lda * 2] * x_2;
    y_4 += A1[0 + lda * 2] * x_2;
    y_5 += A1[1 + lda * 2] * x_2;
    y_6 += A1[2 + lda * 2] * x_2;
    y_7 += A1[3 + lda * 2] * x_2;
    y_0 += A0[0 + lda * 3] * x_3;
    y_1 += A0[1 + lda * 3] * x_3;
    y_2 += A0[2 + lda * 3] * x_3;
    y_3 += A0[3 + lda * 3] * x_3;
    y_4 += A1[0 + lda * 3] * x_3;
    y_5 += A1[1 + lda * 3] * x_3;
    y_6 += A1[2 + lda * 3] * x_3;
    y_7 += A1[3 + lda * 3] * x_3;
    A0 += 4 * lda;
    A1 += 4 * lda;
    x += 4;
  }
  for (; k < kmax; k++) {
    x_0 = x[0];
    y_0 += A0[0 + lda * 0] * x_0;
    y_1 += A0[1 + lda * 0] * x_0;
    y_2 += A0[2 + lda * 0] * x_0;
    y_3 += A0[3 + lda * 0] * x_0;
    y_4 += A1[0 + lda * 0] * x_0;
    y_5 += A1[1 + lda * 0] * x_0;
    y_6 += A1[2 + lda * 0] * x_0;
    y_7 += A1[3 + lda * 0] * x_0;
    A0 += 1 * lda;
    A1 += 1 * lda;
    x += 1;
  }
  if (alg == 0) {
    z[0] = y_0;
    z[1] = y_1;
    z[2] = y_2;
    z[3] = y_3;
    z[4] = y_4;
    z[5] = y_5;
    z[6] = y_6;
    z[7] = y_7;
  } else if (alg == 1) {
    z[0] = y[0] + y_0;
    z[1] = y[1] + y_1;
    z[2] = y[2] + y_2;
    z[3] = y[3] + y_3;
    z[4] = y[4] + y_4;
    z[5] = y[5] + y_5;
    z[6] = y[6] + y_6;
    z[7] = y[7] + y_7;
  } else {
    z[0] = y[0] - y_0;
    z[1] = y[1] - y_1;
    z[2] = y[2] - y_2;
    z[3] = y[3] - y_3;
    z[4] = y[4] - y_4;
    z[5] = y[5] - y_5;
    z[6] = y[6] - y_6;
    z[7] = y[7] - y_7;
  }
}
```