user: Translate the below assembly code into C programming language:

```asm
<kernel_dgemv_n_1_lib4>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %edi,0x30(%rsp)
  mov    %rsi,0x28(%rsp)
  mov    %rcx,0x40(%rsp)
  mov    %r8,0x38(%rsp)
  mov    %r9d,0x34(%rsp)
  test   %edi,%edi
  jle    L48
  xor    %eax,%eax
  mov    %edi,%ebp
  mov    %rdx,%rbx
  call   <_mm_setzero_pd@plt>
  mov    %eax,%r13d
  xor    %eax,%eax
  call   <_mm_setzero_pd@plt>
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <_mm_setzero_pd@plt>
  mov    %eax,%r14d
  xor    %eax,%eax
  call   <_mm_setzero_pd@plt>
  mov    %eax,%r15d
  cmp    $0x3,%ebp
  jle    L82
  lea    -0x4(%rbp),%eax
  mov    0x28(%rsp),%rbp
  mov    %r15d,%edx
  shr    $0x2,%eax
  add    $0x1,%eax
  mov    %rax,0x48(%rsp)
  shl    $0x5,%rax
  add    %rbx,%rax
  mov    %rax,0x20(%rsp)
  nopw   0x0(%rax,%rax,1)
L73:
  mov    %rbx,%rdi
  mov    %edx,0x1c(%rsp)
  call   <_mm_load_sd@plt>
  lea    0x8(%rbx),%rdi
  mov    %eax,0x18(%rsp)
  call   <_mm_load_sd@plt>
  mov    %rbp,%rdi
  mov    %eax,(%rsp)
  call   <_mm_load_sd@plt>
  lea    0x20(%rbp),%rdi
  mov    %eax,0x14(%rsp)
  call   <_mm_load_sd@plt>
  lea    0x10(%rbx),%rdi
  mov    %eax,0x10(%rsp)
  call   <_mm_load_sd@plt>
  lea    0x18(%rbx),%rdi
  add    $0x20,%rbx
  mov    %eax,0xc(%rsp)
  call   <_mm_load_sd@plt>
  lea    0x40(%rbp),%rdi
  mov    %eax,0x8(%rsp)
  call   <_mm_load_sd@plt>
  lea    0x60(%rbp),%rdi
  sub    $0xffffffffffffff80,%rbp
  mov    %eax,0x4(%rsp)
  call   <_mm_load_sd@plt>
  mov    0x18(%rsp),%esi
  mov    0x14(%rsp),%edi
  mov    %eax,%r15d
  call   <_mm_mul_sd@plt>
  mov    %r13d,%edi
  mov    %eax,%esi
  call   <_mm_add_sd@plt>
  mov    (%rsp),%esi
  mov    0x10(%rsp),%edi
  mov    %eax,%r13d
  call   <_mm_mul_sd@plt>
  mov    %r12d,%edi
  mov    %eax,%esi
  call   <_mm_add_sd@plt>
  mov    0xc(%rsp),%esi
  mov    0x4(%rsp),%edi
  mov    %eax,%r12d
  call   <_mm_mul_sd@plt>
  mov    %r14d,%edi
  mov    %eax,%esi
  call   <_mm_add_sd@plt>
  mov    0x8(%rsp),%esi
  mov    %r15d,%edi
  mov    %eax,%r14d
  call   <_mm_mul_sd@plt>
  mov    0x1c(%rsp),%edi
  mov    %eax,%esi
  call   <_mm_add_sd@plt>
  mov    %eax,%edx
  cmp    0x20(%rsp),%rbx
  jne    L73
  mov    %eax,%r15d
  mov    0x48(%rsp),%rax
  shl    $0x7,%rax
  add    %rax,0x28(%rsp)
L105:
  mov    %r14d,%esi
  mov    %r13d,%edi
  call   <_mm_add_pd@plt>
  mov    %r12d,%edi
  mov    %r15d,%esi
  mov    %eax,%ebp
  call   <_mm_add_pd@plt>
  mov    %eax,%r12d
  testb  $0x2,0x30(%rsp)
  jne    L62
L17:
  mov    %ebp,%edi
  mov    %r12d,%esi
  call   <_mm_add_pd@plt>
  mov    %eax,%ebp
  testb  $0x1,0x30(%rsp)
  jne    L83
  mov    0x34(%rsp),%eax
  mov    %ebp,%esi
  test   %eax,%eax
  je     L75
L77:
  cmpl   $0x1,0x34(%rsp)
  mov    0x40(%rsp),%rdi
  je     L66
  call   <_mm_load_sd@plt>
  mov    %ebp,%esi
  mov    %eax,%edi
  call   <_mm_sub_sd@plt>
  mov    %eax,%esi
L75:
  mov    0x38(%rsp),%rdi
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1100 <_mm_store_sd@plt>
  nopl   (%rax)
L62:
  mov    0x20(%rsp),%r15
  mov    %r15,%rdi
  call   <_mm_load_sd@plt>
  lea    0x8(%r15),%rdi
  mov    %r15,0x20(%rsp)
  mov    %eax,%ebx
  call   <_mm_load_sd@plt>
  mov    0x28(%rsp),%r13
  mov    %eax,%r14d
  mov    %r13,%rdi
  call   <_mm_load_sd@plt>
  lea    0x20(%r13),%rdi
  mov    %r13,0x28(%rsp)
  mov    %eax,%r15d
  call   <_mm_load_sd@plt>
  mov    %ebx,%esi
  mov    %r15d,%edi
  mov    %eax,%r13d
  call   <_mm_mul_sd@plt>
  mov    %ebp,%edi
  mov    %eax,%esi
  call   <_mm_add_sd@plt>
  mov    %r14d,%esi
  mov    %r13d,%edi
  mov    %eax,%ebp
  call   <_mm_mul_sd@plt>
  mov    %r12d,%edi
  mov    %eax,%esi
  call   <_mm_add_sd@plt>
  addq   $0x40,0x28(%rsp)
  addq   $0x10,0x20(%rsp)
  mov    %eax,%r12d
  jmp    L17
  nop
L48:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L83:
  mov    0x20(%rsp),%rdi
  call   <_mm_load_sd@plt>
  mov    0x28(%rsp),%rdi
  mov    %eax,%r12d
  call   <_mm_load_sd@plt>
  mov    %r12d,%esi
  mov    %eax,%edi
  call   <_mm_mul_sd@plt>
  mov    %ebp,%edi
  mov    %eax,%esi
  call   <_mm_add_sd@plt>
  mov    %eax,%ebp
  mov    0x34(%rsp),%eax
  mov    %ebp,%esi
  test   %eax,%eax
  jne    L77
  jmp    L75
  nop
L66:
  call   <_mm_load_sd@plt>
  mov    %ebp,%esi
  mov    %eax,%edi
  call   <_mm_add_sd@plt>
  mov    %eax,%esi
  jmp    L75
  nopl   (%rax)
L82:
  mov    %rbx,0x20(%rsp)
  jmp    L105
```

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);
  }
}
```