user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<kernel_sgemv_t_4_vs_lib4>:
  endbr64
  push   %r12
  mov    %edi,%r10d
  push   %rbp
  push   %rbx
  mov    0x20(%rsp),%rbp
  mov    0x28(%rsp),%ebx
  test   %edi,%edi
  jle    L63
  mov    %rsi,%r11
  mov    %rcx,%rdi
  cmp    $0x3,%r10d
  jle    L42
  shl    $0x2,%edx
  lea    -0x4(%r10),%esi
  pxor   %xmm6,%xmm6
  mov    %r11,%rax
  movslq %edx,%rcx
  shr    $0x2,%esi
  xor    %edx,%edx
  shl    $0x2,%rcx
  add    $0x1,%esi
  nopl   0x0(%rax)
L52:
  mov    %rdx,%r12
  movups (%rax),%xmm0
  movups 0x20(%rax),%xmm1
  add    $0x1,%rdx
  shl    $0x4,%r12
  movups 0x10(%rax),%xmm2
  movups 0x30(%rax),%xmm4
  add    %rcx,%rax
  movups (%rdi,%r12,1),%xmm3
  mulps  %xmm3,%xmm1
  mulps  %xmm3,%xmm0
  mulps  %xmm3,%xmm2
  mulps  %xmm3,%xmm4
  movaps %xmm1,%xmm5
  movaps %xmm0,%xmm3
  unpcklps %xmm2,%xmm3
  unpcklps %xmm4,%xmm5
  movaps %xmm4,%xmm8
  movlhps %xmm5,%xmm3
  movaps %xmm0,%xmm5
  shufps $0x55,%xmm4,%xmm8
  addps  %xmm6,%xmm3
  movaps %xmm2,%xmm6
  shufps $0x55,%xmm0,%xmm5
  shufps $0x55,%xmm2,%xmm6
  movaps %xmm6,%xmm7
  movaps %xmm1,%xmm6
  unpcklps %xmm7,%xmm5
  shufps $0x55,%xmm1,%xmm6
  unpcklps %xmm8,%xmm6
  movaps %xmm4,%xmm8
  movlhps %xmm6,%xmm5
  movaps %xmm2,%xmm6
  unpckhps %xmm4,%xmm8
  shufps $0xff,%xmm4,%xmm4
  unpckhps %xmm2,%xmm6
  addps  %xmm5,%xmm3
  movaps %xmm0,%xmm5
  shufps $0xff,%xmm2,%xmm2
  movaps %xmm6,%xmm7
  movaps %xmm1,%xmm6
  unpckhps %xmm0,%xmm5
  shufps $0xff,%xmm0,%xmm0
  unpckhps %xmm1,%xmm6
  unpcklps %xmm7,%xmm5
  unpcklps %xmm2,%xmm0
  shufps $0xff,%xmm1,%xmm1
  unpcklps %xmm8,%xmm6
  unpcklps %xmm4,%xmm1
  movlhps %xmm6,%xmm5
  movlhps %xmm1,%xmm0
  addps  %xmm5,%xmm3
  addps  %xmm0,%xmm3
  movaps %xmm3,%xmm6
  cmp    %edx,%esi
  ja     L52
  mov    %esi,%eax
  shl    $0x2,%esi
  imul   %rax,%rcx
  shl    $0x4,%rax
  add    %rax,%rdi
  add    %rcx,%r11
  cmp    %esi,%r10d
  jle    L94
L107:
  mov    %r10d,%edx
  mov    $0x1,%eax
  sub    %esi,%edx
  cmp    %r10d,%esi
  cmovl  %edx,%eax
  sub    $0x1,%edx
  cmp    $0x2,%edx
  jbe    L74
  cmp    %r10d,%esi
  jge    L74
  movups (%rdi),%xmm3
  movups (%r11),%xmm0
  mov    %eax,%ecx
  movups 0x20(%r11),%xmm1
  movups 0x10(%r11),%xmm2
  and    $0xfffffffc,%ecx
  movups 0x30(%r11),%xmm4
  mulps  %xmm3,%xmm0
  mov    %ecx,%esi
  mulps  %xmm3,%xmm1
  shl    $0x2,%rsi
  mulps  %xmm3,%xmm2
  lea    (%r11,%rsi,1),%rdx
  add    %rdi,%rsi
  mulps  %xmm3,%xmm4
  movaps %xmm0,%xmm3
  movaps %xmm1,%xmm5
  unpcklps %xmm2,%xmm3
  unpcklps %xmm4,%xmm5
  movaps %xmm4,%xmm8
  movlhps %xmm5,%xmm3
  movaps %xmm0,%xmm5
  shufps $0x55,%xmm4,%xmm8
  addps  %xmm6,%xmm3
  movaps %xmm2,%xmm6
  shufps $0x55,%xmm0,%xmm5
  shufps $0x55,%xmm2,%xmm6
  movaps %xmm6,%xmm7
  movaps %xmm1,%xmm6
  unpcklps %xmm7,%xmm5
  shufps $0x55,%xmm1,%xmm6
  unpcklps %xmm8,%xmm6
  movaps %xmm4,%xmm8
  movlhps %xmm6,%xmm5
  movaps %xmm2,%xmm6
  unpckhps %xmm4,%xmm8
  shufps $0xff,%xmm4,%xmm4
  unpckhps %xmm2,%xmm6
  addps  %xmm5,%xmm3
  movaps %xmm0,%xmm5
  shufps $0xff,%xmm2,%xmm2
  movaps %xmm6,%xmm7
  movaps %xmm1,%xmm6
  unpckhps %xmm0,%xmm5
  shufps $0xff,%xmm0,%xmm0
  unpckhps %xmm1,%xmm6
  unpcklps %xmm7,%xmm5
  unpcklps %xmm2,%xmm0
  shufps $0xff,%xmm1,%xmm1
  unpcklps %xmm8,%xmm6
  unpcklps %xmm4,%xmm1
  movlhps %xmm6,%xmm5
  movlhps %xmm1,%xmm0
  addps  %xmm5,%xmm3
  addps  %xmm0,%xmm3
  movaps %xmm3,%xmm6
  cmp    %eax,%ecx
  je     L94
L134:
  sub    %ecx,%eax
  cmp    $0x1,%eax
  je     L132
  lea    0x0(,%rcx,4),%r10
  movq   (%rdi,%rcx,4),%xmm2
  mov    %eax,%edi
  movq   (%r11,%rcx,4),%xmm0
  movq   0x20(%r11,%r10,1),%xmm1
  movq   0x10(%r11,%r10,1),%xmm3
  and    $0xfffffffe,%edi
  movq   0x30(%r11,%r10,1),%xmm4
  mulps  %xmm2,%xmm0
  mov    %edi,%ecx
  mulps  %xmm2,%xmm1
  shl    $0x2,%rcx
  mulps  %xmm2,%xmm3
  add    %rcx,%rdx
  add    %rcx,%rsi
  mulps  %xmm2,%xmm4
  movaps %xmm0,%xmm2
  shufps $0xe5,%xmm0,%xmm0
  movaps %xmm1,%xmm5
  shufps $0xe5,%xmm1,%xmm1
  unpcklps %xmm3,%xmm2
  shufps $0xe5,%xmm3,%xmm3
  unpcklps %xmm3,%xmm0
  unpcklps %xmm4,%xmm5
  shufps $0xe5,%xmm4,%xmm4
  unpcklps %xmm4,%xmm1
  movlhps %xmm5,%xmm2
  movlhps %xmm1,%xmm0
  addps  %xmm6,%xmm2
  addps  %xmm0,%xmm2
  movaps %xmm2,%xmm6
  cmp    %edi,%eax
  je     L94
L132:
  movss  0x30(%rdx),%xmm0
  movss  0x20(%rdx),%xmm1
  movss  0x10(%rdx),%xmm2
  unpcklps %xmm0,%xmm1
  movss  (%rdx),%xmm0
  unpcklps %xmm2,%xmm0
  movlhps %xmm1,%xmm0
  movss  (%rsi),%xmm1
  shufps $0x0,%xmm1,%xmm1
  mulps  %xmm1,%xmm0
  addps  %xmm0,%xmm6
L94:
  test   %r8d,%r8d
  je     L161
  movups (%r9),%xmm0
  cmp    $0x1,%r8d
  je     L18
  subps  %xmm6,%xmm0
  movaps %xmm0,%xmm6
L161:
  movaps %xmm6,%xmm0
  unpckhps %xmm6,%xmm0
  movaps %xmm0,%xmm1
  movaps %xmm6,%xmm0
  shufps $0x55,%xmm6,%xmm0
  cmp    $0x3,%ebx
  jg     L108
  movss  %xmm6,0x0(%rbp)
  cmp    $0x1,%ebx
  jle    L63
  movss  %xmm0,0x4(%rbp)
  cmp    $0x3,%ebx
  je     L20
L63:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L108:
  movups %xmm6,0x0(%rbp)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L20:
  movss  %xmm1,0x8(%rbp)
  jmp    L63
L74:
  mov    %rdi,%rsi
  mov    %r11,%rdx
  xor    %ecx,%ecx
  jmp    L134
  nopl   0x0(%rax)
L18:
  addps  %xmm0,%xmm6
  jmp    L161
  nopl   (%rax)
L42:
  pxor   %xmm6,%xmm6
  xor    %esi,%esi
  jmp    L107
```

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