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

```asm
<kernel_dgecp_2_3_lib4>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %rdx,-0x20(%rbp)
  mov    %ecx,-0x24(%rbp)
  mov    %r8,-0x30(%rbp)
  cmpl   $0x1,-0x14(%rbp)
  jne    L43
  addl   $0x1,-0x18(%rbp)
L43:
  cmpl   $0x0,-0x18(%rbp)
  jle    L15
  movl   $0x4,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  imul   -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L48
L0:
  mov    -0x20(%rbp),%rax
  movsd  0x18(%rax),%xmm0
  mov    -0x30(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0x8(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%rdx)
  mov    -0xc(%rbp),%eax
  add    $0x3,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0xc(%rbp),%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%eax
  add    %eax,%eax
  add    $0x3,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0xc(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0xc(%rbp),%eax
  add    %eax,%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0xc(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rcx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0xc(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rcx),%xmm0
  movsd  %xmm0,(%rax)
  subq   $0xffffffffffffff80,-0x20(%rbp)
  subq   $0xffffffffffffff80,-0x8(%rbp)
  subq   $0xffffffffffffff80,-0x30(%rbp)
  addl   $0x4,-0x10(%rbp)
L48:
  mov    -0x18(%rbp),%eax
  sub    $0x3,%eax
  cmp    %eax,-0x10(%rbp)
  jl     L0
  jmp    L47
L46:
  mov    -0x20(%rbp),%rax
  movsd  0x18(%rax),%xmm0
  mov    -0x30(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0x8(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%rdx)
  addq   $0x20,-0x20(%rbp)
  addq   $0x20,-0x8(%rbp)
  addq   $0x20,-0x30(%rbp)
  addl   $0x1,-0x10(%rbp)
L47:
  mov    -0x10(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L46
  cmpl   $0x1,-0x14(%rbp)
  jne    L60
  mov    -0x30(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0x8(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%rdx)
  jmp    L60
L15:
  nop
L60:
  pop    %rbp
  ret
```

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