user: Converte this assembly snippet into its equivalent C code:

```asm
<corner_dtrma_3_lib4>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,-0x18(%rbp)
  movl   $0x4,-0x4(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  je     L18
  cmpl   $0x3,-0x14(%rbp)
  jne    L34
L18:
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x28(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x28(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0x20(%rbp),%rax
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,(%rdx)
  mov    -0x28(%rbp),%rax
  lea    0x10(%rax),%rdx
  mov    -0x20(%rbp),%rax
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,(%rdx)
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x4(%rbp),%eax
  add    $0x2,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  add    $0x2,%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L20
L34:
  cmpl   $0x1,-0x14(%rbp)
  jne    L22
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x28(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x18(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x4(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0x28(%rbp)
  mov    -0x20(%rbp),%rax
  movsd  0x8(%rax),%xmm0
  mov    -0x28(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x28(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0x20(%rbp),%rax
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,(%rdx)
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x4(%rbp),%eax
  add    $0x2,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L20
L22:
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x28(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x28(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0x20(%rbp),%rax
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,(%rdx)
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x18(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x4(%rbp),%eax
  add    $0x2,%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0x28(%rbp)
  mov    -0x20(%rbp),%rax
  movsd  0x10(%rax),%xmm0
  mov    -0x28(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x4(%rbp),%eax
  add    $0x2,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  nop
L20:
  pop    %rbp
  ret
```

assistant: ```c
void corner_dtrma_3_lib4(int kna, double *A, double *C, int sdc) {
  const int bs = 4;
  if (kna == 0 || kna == 3) {
    C[0 + bs * 0] = A[0 + bs * 0];
    C[1 + bs * 0] = A[1 + bs * 0];
    C[2 + bs * 0] = A[2 + bs * 0];
    C[1 + bs * 1] = A[1 + bs * 1];
    C[2 + bs * 1] = A[2 + bs * 1];
    C[2 + bs * 2] = A[2 + bs * 2];
    return;
  } else if (kna == 1) {
    C[0 + bs * 0] = A[0 + bs * 0];
    C += 1 + bs * (sdc - 1);
    C[0 + bs * 0] = A[1 + bs * 0];
    C[1 + bs * 0] = A[2 + bs * 0];
    C[0 + bs * 1] = A[1 + bs * 1];
    C[1 + bs * 1] = A[2 + bs * 1];
    C[1 + bs * 2] = A[2 + bs * 2];
    return;
  } else {
    C[0 + bs * 0] = A[0 + bs * 0];
    C[1 + bs * 0] = A[1 + bs * 0];
    C[1 + bs * 1] = A[1 + bs * 1];
    C += 2 + bs * (sdc - 1);
    C[0 + bs * 0] = A[2 + bs * 0];
    C[0 + bs * 1] = A[2 + bs * 1];
    C[0 + bs * 2] = A[2 + bs * 2];
    return;
  }
}
```