user: 请将以下的汇编代码转换成C语言代码:

```asm
<kernel_dgemv_n_4_vs_lib4>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %edi,%r10d
  mov    %esi,%edi
  mov    0x18(%rsp),%ebp
  test   %esi,%esi
  jle    L86
  mov    %rdx,%rax
  mov    %rcx,%rsi
  cmp    $0x3,%edi
  jle    L108
  lea    -0x4(%rdi),%ebx
  shr    $0x2,%ebx
  lea    0x1(%rbx),%r11d
  mov    %r11d,%r11d
  mov    %r11,%rcx
  shl    $0x7,%rcx
  add    %rdx,%rcx
  mov    %rsi,%rdx
  pxor   %xmm8,%xmm8
  movapd %xmm8,%xmm6
  movapd %xmm8,%xmm5
  movapd %xmm8,%xmm4
L4:
  movsd  (%rdx),%xmm2
  movsd  0x8(%rdx),%xmm1
  movsd  0x10(%rdx),%xmm0
  movsd  0x18(%rdx),%xmm3
  movapd %xmm2,%xmm7
  mulsd  (%rax),%xmm7
  addsd  %xmm4,%xmm7
  movapd %xmm2,%xmm4
  mulsd  0x8(%rax),%xmm4
  addsd  %xmm5,%xmm4
  movapd %xmm2,%xmm5
  mulsd  0x10(%rax),%xmm5
  addsd  %xmm6,%xmm5
  mulsd  0x18(%rax),%xmm2
  addsd  %xmm8,%xmm2
  movapd %xmm1,%xmm6
  mulsd  0x20(%rax),%xmm6
  addsd  %xmm7,%xmm6
  movapd %xmm1,%xmm7
  mulsd  0x28(%rax),%xmm7
  addsd  %xmm4,%xmm7
  movapd %xmm1,%xmm4
  mulsd  0x30(%rax),%xmm4
  addsd  %xmm5,%xmm4
  mulsd  0x38(%rax),%xmm1
  addsd  %xmm2,%xmm1
  movapd %xmm0,%xmm5
  mulsd  0x40(%rax),%xmm5
  addsd  %xmm6,%xmm5
  movapd %xmm0,%xmm6
  mulsd  0x48(%rax),%xmm6
  addsd  %xmm7,%xmm6
  movapd %xmm0,%xmm2
  mulsd  0x50(%rax),%xmm2
  addsd  %xmm4,%xmm2
  mulsd  0x58(%rax),%xmm0
  addsd  %xmm1,%xmm0
  movapd %xmm3,%xmm4
  mulsd  0x60(%rax),%xmm4
  addsd  %xmm5,%xmm4
  movapd %xmm3,%xmm5
  mulsd  0x68(%rax),%xmm5
  addsd  %xmm6,%xmm5
  movapd %xmm3,%xmm6
  mulsd  0x70(%rax),%xmm6
  addsd  %xmm2,%xmm6
  mulsd  0x78(%rax),%xmm3
  addsd  %xmm0,%xmm3
  movapd %xmm3,%xmm8
  sub    $0xffffffffffffff80,%rax
  add    $0x20,%rdx
  cmp    %rcx,%rax
  jne    L4
  shl    $0x5,%r11
  add    %r11,%rsi
  lea    0x4(,%rbx,4),%eax
  cmp    %eax,%edi
  jle    L0
L106:
  movsd  (%rsi),%xmm0
  movapd %xmm0,%xmm1
  mulsd  (%rcx),%xmm1
  addsd  %xmm1,%xmm4
  movapd %xmm0,%xmm1
  mulsd  0x8(%rcx),%xmm1
  addsd  %xmm1,%xmm5
  movapd %xmm0,%xmm1
  mulsd  0x10(%rcx),%xmm1
  addsd  %xmm1,%xmm6
  mulsd  0x18(%rcx),%xmm0
  addsd  %xmm0,%xmm8
  add    $0x20,%rcx
  add    $0x8,%rsi
  add    $0x1,%eax
  cmp    %eax,%edi
  jg     L106
L0:
  test   %ebp,%ebp
  je     L11
  cmp    $0x1,%ebp
  je     L22
  movsd  (%r8),%xmm0
  subsd  %xmm4,%xmm0
  movapd %xmm0,%xmm4
  movsd  0x8(%r8),%xmm0
  subsd  %xmm5,%xmm0
  movapd %xmm0,%xmm5
  movsd  0x10(%r8),%xmm0
  subsd  %xmm6,%xmm0
  movapd %xmm0,%xmm6
  movsd  0x18(%r8),%xmm0
  subsd  %xmm8,%xmm0
  movapd %xmm0,%xmm8
L11:
  cmp    $0x3,%r10d
  jle    L91
  movsd  %xmm4,(%r9)
  movsd  %xmm5,0x8(%r9)
  movsd  %xmm6,0x10(%r9)
  movsd  %xmm8,0x18(%r9)
L86:
  pop    %rbx
  pop    %rbp
  ret
L108:
  mov    %rdx,%rcx
  pxor   %xmm8,%xmm8
  movapd %xmm8,%xmm6
  movapd %xmm8,%xmm5
  movapd %xmm8,%xmm4
  mov    $0x0,%eax
  jmp    L106
L22:
  addsd  (%r8),%xmm4
  addsd  0x8(%r8),%xmm5
  addsd  0x10(%r8),%xmm6
  addsd  0x18(%r8),%xmm8
  jmp    L11
L91:
  movsd  %xmm4,(%r9)
  cmp    $0x1,%r10d
  jle    L86
  movsd  %xmm5,0x8(%r9)
  cmp    $0x3,%r10d
  jne    L86
  movsd  %xmm6,0x10(%r9)
  jmp    L86
```

assistant: ```c
void kernel_dgemv_n_4_vs_lib4(int km, int kmax, double *A, double *x, double *y, double *z, int alg) {
  if (kmax <= 0)
    return;
  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;
  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 += A[0 + lda * 0] * x_0;
    y_1 += A[1 + lda * 0] * x_0;
    y_2 += A[2 + lda * 0] * x_0;
    y_3 += A[3 + lda * 0] * x_0;
    y_0 += A[0 + lda * 1] * x_1;
    y_1 += A[1 + lda * 1] * x_1;
    y_2 += A[2 + lda * 1] * x_1;
    y_3 += A[3 + lda * 1] * x_1;
    y_0 += A[0 + lda * 2] * x_2;
    y_1 += A[1 + lda * 2] * x_2;
    y_2 += A[2 + lda * 2] * x_2;
    y_3 += A[3 + lda * 2] * x_2;
    y_0 += A[0 + lda * 3] * x_3;
    y_1 += A[1 + lda * 3] * x_3;
    y_2 += A[2 + lda * 3] * x_3;
    y_3 += A[3 + lda * 3] * x_3;
    A += 4 * lda;
    x += 4;
  }
  for (; k < kmax; k++) {
    x_0 = x[0];
    y_0 += A[0 + lda * 0] * x_0;
    y_1 += A[1 + lda * 0] * x_0;
    y_2 += A[2 + lda * 0] * x_0;
    y_3 += A[3 + lda * 0] * x_0;
    A += 1 * lda;
    x += 1;
  }
  if (alg == 0) {
    goto store;
  } else if (alg == 1) {
    y_0 += y[0];
    y_1 += y[1];
    y_2 += y[2];
    y_3 += y[3];
    goto store;
  } else {
    y_0 = y[0] - y_0;
    y_1 = y[1] - y_1;
    y_2 = y[2] - y_2;
    y_3 = y[3] - y_3;
    goto store;
  }
store:
  if (km >= 4) {
    z[0] = y_0;
    z[1] = y_1;
    z[2] = y_2;
    z[3] = y_3;
  } else {
    z[0] = y_0;
    if (km >= 2) {
      z[1] = y_1;
      if (km > 2) {
        z[2] = y_2;
      }
    }
  }
}
```