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

```asm
<kernel_dgecp_3_0_lib4>:
  endbr64
  xor    %eax,%eax
  cmp    $0x1,%edi
  mov    %esi,%r8d
  mov    %edi,%r9d
  sete   %al
  mov    %rdx,%rsi
  lea    (%r8,%rax,1),%edi
  test   %edi,%edi
  jle    L70
  cmp    $0x3,%edi
  jle    L2
  lea    -0x4(%rdi),%eax
  shr    $0x2,%eax
  lea    0x1(%rax),%r10d
  mov    %rsi,%rax
  mov    %r10,%r8
  shl    $0x7,%r10
  lea    (%rcx,%r10,1),%rdx
  nopw   0x0(%rax,%rax,1)
L6:
  movsd  (%rax),%xmm0
  sub    $0xffffffffffffff80,%rcx
  sub    $0xffffffffffffff80,%rax
  movsd  %xmm0,-0x80(%rcx)
  movsd  -0x78(%rax),%xmm0
  movsd  %xmm0,-0x78(%rcx)
  movsd  -0x70(%rax),%xmm0
  movsd  %xmm0,-0x70(%rcx)
  movsd  -0x60(%rax),%xmm0
  movsd  %xmm0,-0x60(%rcx)
  movsd  -0x58(%rax),%xmm0
  movsd  %xmm0,-0x58(%rcx)
  movsd  -0x50(%rax),%xmm0
  movsd  %xmm0,-0x50(%rcx)
  movsd  -0x40(%rax),%xmm0
  movsd  %xmm0,-0x40(%rcx)
  movsd  -0x38(%rax),%xmm0
  movsd  %xmm0,-0x38(%rcx)
  movsd  -0x30(%rax),%xmm0
  movsd  %xmm0,-0x30(%rcx)
  movsd  -0x20(%rax),%xmm0
  movsd  %xmm0,-0x20(%rcx)
  movsd  -0x18(%rax),%xmm0
  movsd  %xmm0,-0x18(%rcx)
  movsd  -0x10(%rax),%xmm0
  movsd  %xmm0,-0x10(%rcx)
  cmp    %rdx,%rcx
  jne    L6
  lea    0x0(,%r8,4),%eax
  add    %r10,%rsi
  cmp    %edi,%eax
  jge    L64
L26:
  movsd  (%rsi),%xmm0
  lea    0x1(%rax),%ecx
  movsd  %xmm0,(%rdx)
  movsd  0x8(%rsi),%xmm0
  movsd  %xmm0,0x8(%rdx)
  movsd  0x10(%rsi),%xmm0
  movsd  %xmm0,0x10(%rdx)
  cmp    %ecx,%edi
  jle    L47
  movsd  0x20(%rsi),%xmm0
  lea    0x2(%rax),%ecx
  movsd  %xmm0,0x20(%rdx)
  movsd  0x28(%rsi),%xmm0
  movsd  %xmm0,0x28(%rdx)
  movsd  0x30(%rsi),%xmm0
  movsd  %xmm0,0x30(%rdx)
  cmp    %ecx,%edi
  jle    L47
  movsd  0x40(%rsi),%xmm0
  lea    0x3(%rax),%ecx
  movsd  %xmm0,0x40(%rdx)
  movsd  0x48(%rsi),%xmm0
  movsd  %xmm0,0x48(%rdx)
  movsd  0x50(%rsi),%xmm0
  movsd  %xmm0,0x50(%rdx)
  cmp    %ecx,%edi
  jle    L47
  movsd  0x60(%rsi),%xmm0
  movsd  %xmm0,0x60(%rdx)
  movsd  0x68(%rsi),%xmm0
  movsd  %xmm0,0x68(%rdx)
  movsd  0x70(%rsi),%xmm0
  movsd  %xmm0,0x70(%rdx)
L47:
  lea    -0x1(%rdi),%ecx
  sub    %eax,%ecx
  add    $0x1,%rcx
  shl    $0x5,%rcx
  cmp    %eax,%edi
  mov    $0x20,%eax
  cmovle %rax,%rcx
  add    %rcx,%rsi
  add    %rcx,%rdx
L64:
  cmp    $0x1,%r9d
  je     L56
L70:
  ret
  nopl   0x0(%rax,%rax,1)
L56:
  movsd  0x8(%rsi),%xmm0
  movsd  %xmm0,0x8(%rdx)
  movsd  0x10(%rsi),%xmm0
  movsd  %xmm0,0x10(%rdx)
  movsd  0x30(%rsi),%xmm0
  movsd  %xmm0,0x30(%rdx)
  ret
  nopw   0x0(%rax,%rax,1)
L2:
  mov    %rcx,%rdx
  xor    %eax,%eax
  jmp    L26
```

assistant: ```c
void kernel_dgecp_3_0_lib4(int tri, int kmax, double *A, double *B) {
  if (tri == 1) {
    kmax += 1;
  }
  if (kmax <= 0)
    return;
  const int bs = 4;
  int k;
  for (k = 0; k < kmax - 3; k += 4) {
    B[0 + bs * 0] = A[0 + bs * 0];
    B[1 + bs * 0] = A[1 + bs * 0];
    B[2 + bs * 0] = A[2 + bs * 0];
    B[0 + bs * 1] = A[0 + bs * 1];
    B[1 + bs * 1] = A[1 + bs * 1];
    B[2 + bs * 1] = A[2 + bs * 1];
    B[0 + bs * 2] = A[0 + bs * 2];
    B[1 + bs * 2] = A[1 + bs * 2];
    B[2 + bs * 2] = A[2 + bs * 2];
    B[0 + bs * 3] = A[0 + bs * 3];
    B[1 + bs * 3] = A[1 + bs * 3];
    B[2 + bs * 3] = A[2 + bs * 3];
    A += 16;
    B += 16;
  }
  for (; k < kmax; k++) {
    B[0 + bs * 0] = A[0 + bs * 0];
    B[1 + bs * 0] = A[1 + bs * 0];
    B[2 + bs * 0] = A[2 + bs * 0];
    A += 4;
    B += 4;
  }
  if (tri == 1) {
    B[1 + bs * 0] = A[1 + bs * 0];
    B[2 + bs * 0] = A[2 + bs * 0];
    B[2 + bs * 1] = A[2 + bs * 1];
  }
}
```