user: Please show me the C implementation that matches the assembly code listed below:

```asm
<kernel_dgemv_n_1_lib4>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %edi,-0x44(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %rcx,-0x60(%rbp)
  mov    %r8,-0x68(%rbp)
  mov    %r9d,-0x48(%rbp)
  cmpl   $0x0,-0x44(%rbp)
  jle    L87
  movl   $0x4,-0x2c(%rbp)
  mov    $0x0,%eax
  call   <_mm_setzero_pd@plt>
  mov    %eax,-0x3c(%rbp)
  mov    $0x0,%eax
  call   <_mm_setzero_pd@plt>
  mov    %eax,-0x38(%rbp)
  mov    $0x0,%eax
  call   <_mm_setzero_pd@plt>
  mov    %eax,-0x34(%rbp)
  mov    $0x0,%eax
  call   <_mm_setzero_pd@plt>
  mov    %eax,-0x30(%rbp)
  movl   $0x0,-0x40(%rbp)
  jmp    L92
L2:
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <_mm_load_sd@plt>
  mov    %eax,-0x28(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x8,%rax
  mov    %rax,%rdi
  call   <_mm_load_sd@plt>
  mov    %eax,-0x24(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <_mm_load_sd@plt>
  mov    %eax,-0x20(%rbp)
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <_mm_load_sd@plt>
  mov    %eax,-0x1c(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x10,%rax
  mov    %rax,%rdi
  call   <_mm_load_sd@plt>
  mov    %eax,-0x10(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x18,%rax
  mov    %rax,%rdi
  call   <_mm_load_sd@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <_mm_load_sd@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x2c(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <_mm_load_sd@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x28(%rbp),%edx
  mov    -0x20(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_mul_sd@plt>
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%edx
  mov    -0x3c(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_add_sd@plt>
  mov    %eax,-0x3c(%rbp)
  mov    -0x24(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_mul_sd@plt>
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%edx
  mov    -0x38(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_add_sd@plt>
  mov    %eax,-0x38(%rbp)
  mov    -0x10(%rbp),%edx
  mov    -0x8(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_mul_sd@plt>
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%edx
  mov    -0x34(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_add_sd@plt>
  mov    %eax,-0x34(%rbp)
  mov    -0xc(%rbp),%edx
  mov    -0x4(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_mul_sd@plt>
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%edx
  mov    -0x30(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_add_sd@plt>
  mov    %eax,-0x30(%rbp)
  mov    -0x2c(%rbp),%eax
  shl    $0x2,%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0x50(%rbp)
  addq   $0x20,-0x58(%rbp)
  addl   $0x4,-0x40(%rbp)
L92:
  mov    -0x44(%rbp),%eax
  sub    $0x3,%eax
  cmp    %eax,-0x40(%rbp)
  jl     L2
  mov    -0x34(%rbp),%edx
  mov    -0x3c(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_add_pd@plt>
  mov    %eax,-0x3c(%rbp)
  mov    -0x30(%rbp),%edx
  mov    -0x38(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_add_pd@plt>
  mov    %eax,-0x38(%rbp)
  mov    -0x44(%rbp),%eax
  cltd
  shr    $0x1e,%edx
  add    %edx,%eax
  and    $0x3,%eax
  sub    %edx,%eax
  cmp    $0x1,%eax
  jle    L67
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <_mm_load_sd@plt>
  mov    %eax,-0x28(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x8,%rax
  mov    %rax,%rdi
  call   <_mm_load_sd@plt>
  mov    %eax,-0x24(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <_mm_load_sd@plt>
  mov    %eax,-0x20(%rbp)
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <_mm_load_sd@plt>
  mov    %eax,-0x1c(%rbp)
  mov    -0x28(%rbp),%edx
  mov    -0x20(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_mul_sd@plt>
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%edx
  mov    -0x3c(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_add_sd@plt>
  mov    %eax,-0x3c(%rbp)
  mov    -0x24(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_mul_sd@plt>
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%edx
  mov    -0x38(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_add_sd@plt>
  mov    %eax,-0x38(%rbp)
  mov    -0x2c(%rbp),%eax
  add    %eax,%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0x50(%rbp)
  addq   $0x10,-0x58(%rbp)
L67:
  mov    -0x38(%rbp),%edx
  mov    -0x3c(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_add_pd@plt>
  mov    %eax,-0x3c(%rbp)
  mov    -0x44(%rbp),%eax
  cltd
  shr    $0x1f,%edx
  add    %edx,%eax
  and    $0x1,%eax
  sub    %edx,%eax
  cmp    $0x1,%eax
  jne    L96
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <_mm_load_sd@plt>
  mov    %eax,-0x28(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <_mm_load_sd@plt>
  mov    %eax,-0x20(%rbp)
  mov    -0x28(%rbp),%edx
  mov    -0x20(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_mul_sd@plt>
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%edx
  mov    -0x3c(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_add_sd@plt>
  mov    %eax,-0x3c(%rbp)
L96:
  cmpl   $0x0,-0x48(%rbp)
  jne    L51
  mov    -0x3c(%rbp),%edx
  mov    -0x68(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <_mm_store_sd@plt>
  jmp    L64
L51:
  cmpl   $0x1,-0x48(%rbp)
  jne    L54
  mov    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <_mm_load_sd@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x3c(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_add_sd@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%edx
  mov    -0x68(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <_mm_store_sd@plt>
  jmp    L64
L54:
  mov    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <_mm_load_sd@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x3c(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <_mm_sub_sd@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%edx
  mov    -0x68(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <_mm_store_sd@plt>
  jmp    L64
L87:
  nop
L64:
  leave
  ret
```

assistant: ```c
void kernel_dgemv_n_1_lib4(int kmax, double *A, double *x, double *y, double *z, int alg) {
  if (kmax <= 0)
    return;
  const int lda = 4;
  int k;
  __m128d ax_temp, a_00, a_01, a_02, a_03, x_0, x_1, x_2, x_3, y_0, y_0_b, y_0_c, y_0_d, z_0;
  y_0 = _mm_setzero_pd();
  y_0_b = _mm_setzero_pd();
  y_0_c = _mm_setzero_pd();
  y_0_d = _mm_setzero_pd();
  k = 0;
  for (; k < kmax - 3; k += 4) {
    x_0 = _mm_load_sd(&x[0]);
    x_1 = _mm_load_sd(&x[1]);
    a_00 = _mm_load_sd(&A[0 + lda * 0]);
    a_01 = _mm_load_sd(&A[0 + lda * 1]);
    x_2 = _mm_load_sd(&x[2]);
    x_3 = _mm_load_sd(&x[3]);
    a_02 = _mm_load_sd(&A[0 + lda * 2]);
    a_03 = _mm_load_sd(&A[0 + lda * 3]);
    ax_temp = _mm_mul_sd(a_00, x_0);
    y_0 = _mm_add_sd(y_0, ax_temp);
    ax_temp = _mm_mul_sd(a_01, x_1);
    y_0_b = _mm_add_sd(y_0_b, ax_temp);
    ax_temp = _mm_mul_sd(a_02, x_2);
    y_0_c = _mm_add_sd(y_0_c, ax_temp);
    ax_temp = _mm_mul_sd(a_03, x_3);
    y_0_d = _mm_add_sd(y_0_d, ax_temp);
    A += 4 * lda;
    x += 4;
  }
  y_0 = _mm_add_pd(y_0, y_0_c);
  y_0_b = _mm_add_pd(y_0_b, y_0_d);
  if (kmax % 4 >= 2) {
    x_0 = _mm_load_sd(&x[0]);
    x_1 = _mm_load_sd(&x[1]);
    a_00 = _mm_load_sd(&A[0 + lda * 0]);
    a_01 = _mm_load_sd(&A[0 + lda * 1]);
    ax_temp = _mm_mul_sd(a_00, x_0);
    y_0 = _mm_add_sd(y_0, ax_temp);
    ax_temp = _mm_mul_sd(a_01, x_1);
    y_0_b = _mm_add_sd(y_0_b, ax_temp);
    A += 2 * lda;
    x += 2;
  }
  y_0 = _mm_add_pd(y_0, y_0_b);
  if (kmax % 2 == 1) {
    x_0 = _mm_load_sd(&x[0]);
    a_00 = _mm_load_sd(&A[0 + lda * 0]);
    ax_temp = _mm_mul_sd(a_00, x_0);
    y_0 = _mm_add_sd(y_0, ax_temp);
  }
  if (alg == 0) {
    _mm_store_sd(&z[0], y_0);
  } else if (alg == 1) {
    z_0 = _mm_load_sd(&y[0]);
    z_0 = _mm_add_sd(z_0, y_0);
    _mm_store_sd(&z[0], z_0);
  } else {
    z_0 = _mm_load_sd(&y[0]);
    z_0 = _mm_sub_sd(z_0, y_0);
    _mm_store_sd(&z[0], z_0);
  }
}
```