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

```asm
<kernel_dgemv_t_4_lib4>:
  endbr64
  push   %rbp
  push   %rbx
  mov    0x18(%rsp),%ebp
  test   %edi,%edi
  jle    L5
  mov    %edi,%r10d
  mov    %rcx,%rbx
  cmp    $0x3,%edi
  jle    L101
  shl    $0x2,%edx
  lea    -0x4(%r10),%r11d
  pxor   %xmm8,%xmm8
  mov    %rsi,%rax
  movslq %edx,%rdi
  shr    $0x2,%r11d
  mov    %rcx,%rdx
  movapd %xmm8,%xmm9
  shl    $0x3,%rdi
  add    $0x1,%r11d
  xor    %ecx,%ecx
  nopl   0x0(%rax)
L50:
  movupd (%rdx),%xmm5
  movupd (%rax),%xmm4
  add    $0x1,%ecx
  add    $0x20,%rdx
  movupd 0x20(%rax),%xmm10
  movupd 0x40(%rax),%xmm2
  mulpd  %xmm5,%xmm4
  movupd 0x60(%rax),%xmm6
  movupd -0x10(%rdx),%xmm0
  mulpd  %xmm5,%xmm10
  movupd 0x10(%rax),%xmm3
  movupd 0x30(%rax),%xmm7
  mulpd  %xmm5,%xmm2
  movupd 0x50(%rax),%xmm1
  mulpd  %xmm5,%xmm6
  movupd 0x70(%rax),%xmm5
  add    %rdi,%rax
  mulpd  %xmm0,%xmm3
  mulpd  %xmm0,%xmm7
  mulpd  %xmm0,%xmm1
  mulpd  %xmm0,%xmm5
  movapd %xmm4,%xmm0
  unpckhpd %xmm10,%xmm4
  unpcklpd %xmm10,%xmm0
  addpd  %xmm9,%xmm0
  addpd  %xmm4,%xmm0
  movapd %xmm3,%xmm4
  unpckhpd %xmm7,%xmm3
  unpcklpd %xmm7,%xmm4
  addpd  %xmm4,%xmm0
  addpd  %xmm3,%xmm0
  movapd %xmm0,%xmm9
  movapd %xmm2,%xmm0
  unpckhpd %xmm6,%xmm2
  unpcklpd %xmm6,%xmm0
  addpd  %xmm8,%xmm0
  addpd  %xmm2,%xmm0
  movapd %xmm1,%xmm2
  unpckhpd %xmm5,%xmm1
  unpcklpd %xmm5,%xmm2
  addpd  %xmm2,%xmm0
  addpd  %xmm1,%xmm0
  movapd %xmm0,%xmm8
  cmp    %r11d,%ecx
  jb     L50
  mov    %r11d,%eax
  shl    $0x2,%r11d
  imul   %rax,%rdi
  shl    $0x5,%rax
  add    %rax,%rbx
  add    %rdi,%rsi
  cmp    %r11d,%r10d
  jle    L7
L20:
  mov    %r10d,%edx
  mov    $0x1,%eax
  sub    %r11d,%edx
  cmp    %r10d,%r11d
  cmovl  %edx,%eax
  cmp    $0x1,%edx
  je     L45
  cmp    %r10d,%r11d
  jge    L45
  movupd (%rbx),%xmm2
  movupd (%rsi),%xmm1
  mov    %eax,%edx
  movupd 0x20(%rsi),%xmm3
  movupd 0x40(%rsi),%xmm0
  shr    %edx
  mulpd  %xmm2,%xmm1
  movupd 0x60(%rsi),%xmm7
  mulpd  %xmm2,%xmm3
  mulpd  %xmm2,%xmm0
  mulpd  %xmm7,%xmm2
  movapd %xmm1,%xmm4
  unpcklpd %xmm3,%xmm4
  unpckhpd %xmm3,%xmm1
  addpd  %xmm9,%xmm4
  addpd  %xmm1,%xmm4
  movapd %xmm0,%xmm1
  unpckhpd %xmm2,%xmm0
  unpcklpd %xmm2,%xmm1
  addpd  %xmm8,%xmm1
  movapd %xmm4,%xmm7
  movapd %xmm4,%xmm9
  unpckhpd %xmm7,%xmm7
  addpd  %xmm0,%xmm1
  movapd %xmm7,%xmm3
  movapd %xmm1,%xmm6
  movapd %xmm1,%xmm8
  movapd %xmm1,%xmm5
  unpckhpd %xmm6,%xmm6
  movapd %xmm6,%xmm2
  cmp    $0x1,%edx
  je     L19
  movupd 0x10(%rbx),%xmm6
  movupd 0x10(%rsi),%xmm1
  movupd 0x30(%rsi),%xmm0
  mulpd  %xmm6,%xmm1
  mulpd  %xmm6,%xmm0
  addsd  %xmm1,%xmm4
  unpckhpd %xmm1,%xmm1
  addsd  %xmm0,%xmm3
  unpckhpd %xmm0,%xmm0
  addsd  %xmm1,%xmm4
  movupd 0x50(%rsi),%xmm1
  addsd  %xmm0,%xmm3
  movupd 0x70(%rsi),%xmm0
  mulpd  %xmm6,%xmm1
  mulpd  %xmm6,%xmm0
  movapd %xmm4,%xmm9
  unpcklpd %xmm3,%xmm9
  movapd %xmm1,%xmm8
  unpckhpd %xmm1,%xmm1
  movapd %xmm0,%xmm3
  addsd  %xmm5,%xmm8
  unpckhpd %xmm0,%xmm0
  addsd  %xmm2,%xmm3
  addsd  %xmm1,%xmm8
  movapd %xmm3,%xmm1
  addsd  %xmm0,%xmm1
  unpcklpd %xmm1,%xmm8
L19:
  mov    %eax,%ecx
  and    $0xfffffffe,%ecx
  mov    %ecx,%edx
  shl    $0x3,%rdx
  add    %rdx,%rsi
  add    %rdx,%rbx
  cmp    %eax,%ecx
  je     L7
L45:
  movsd  (%rbx),%xmm1
  movsd  (%rsi),%xmm0
  unpcklpd %xmm1,%xmm1
  movhpd 0x20(%rsi),%xmm0
  mulpd  %xmm1,%xmm0
  addpd  %xmm0,%xmm9
  movsd  0x40(%rsi),%xmm0
  movhpd 0x60(%rsi),%xmm0
  mulpd  %xmm1,%xmm0
  addpd  %xmm0,%xmm8
L7:
  movapd %xmm8,%xmm7
  movapd %xmm9,%xmm6
  movapd %xmm8,%xmm2
  unpckhpd %xmm7,%xmm7
  unpckhpd %xmm6,%xmm6
  movapd %xmm7,%xmm1
  movapd %xmm6,%xmm3
  test   %ebp,%ebp
  je     L89
  movsd  (%r8),%xmm0
  cmp    $0x1,%ebp
  je     L38
  subsd  %xmm9,%xmm0
  movsd  %xmm0,(%r9)
  movsd  0x8(%r8),%xmm0
  subsd  %xmm6,%xmm0
  movsd  %xmm0,0x8(%r9)
  movsd  0x10(%r8),%xmm0
  subsd  %xmm8,%xmm0
  movsd  %xmm0,0x10(%r9)
  movsd  0x18(%r8),%xmm0
  subsd  %xmm7,%xmm0
  movsd  %xmm0,0x18(%r9)
L5:
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L89:
  pop    %rbx
  movups %xmm9,(%r8)
  pop    %rbp
  movups %xmm8,0x10(%r8)
  ret
  nopl   0x0(%rax)
L38:
  addsd  %xmm9,%xmm0
  pop    %rbx
  pop    %rbp
  movsd  %xmm0,(%r9)
  addsd  0x8(%r8),%xmm3
  movsd  %xmm3,0x8(%r9)
  addsd  0x10(%r8),%xmm2
  movsd  %xmm2,0x10(%r9)
  addsd  0x18(%r8),%xmm1
  movsd  %xmm1,0x18(%r9)
  ret
  nopl   0x0(%rax)
L101:
  pxor   %xmm8,%xmm8
  xor    %r11d,%r11d
  movapd %xmm8,%xmm9
  jmp    L20
```

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