user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<kernel_dgetr_3_lib4>:
  endbr64
  xor    %eax,%eax
  cmp    $0x1,%edi
  push   %r12
  mov    %edx,%r10d
  sete   %al
  push   %rbp
  lea    (%rsi,%rax,1),%r11d
  push   %rbx
  xor    %ebx,%ebx
  cmp    %edx,%r11d
  jl     L17
  test   %edx,%edx
  jle    L138
  lea    -0x1(%rdx),%esi
  movslq %edx,%rdx
  mov    %rdx,%rax
  lea    0x40(%r8,%rdx,8),%rdx
  shl    $0x5,%rax
  lea    -0x8(%rcx,%rax,1),%rax
  cmp    %rax,%r8
  setae  %al
  cmp    %rdx,%rcx
  setae  %dl
  or     %dl,%al
  je     L74
  cmp    $0x1,%esi
  jbe    L74
  mov    %esi,%ebx
  mov    %rcx,%rax
  mov    %r8,%rdx
  shr    %ebx
  sub    $0x1,%ebx
  shl    $0x6,%rbx
  lea    0x40(%rcx,%rbx,1),%rbx
  nopl   0x0(%rax)
L116:
  movupd (%rax),%xmm0
  movupd 0x10(%rax),%xmm5
  add    $0x40,%rax
  add    $0x10,%rdx
  movupd -0x20(%rax),%xmm2
  movupd -0x10(%rax),%xmm4
  movapd %xmm0,%xmm1
  unpckhpd %xmm5,%xmm0
  unpcklpd %xmm5,%xmm1
  movapd %xmm2,%xmm3
  unpckhpd %xmm4,%xmm2
  unpcklpd %xmm4,%xmm3
  movapd %xmm1,%xmm6
  unpcklpd %xmm2,%xmm0
  unpcklpd %xmm3,%xmm6
  unpckhpd %xmm3,%xmm1
  movups %xmm0,0x10(%rdx)
  movups %xmm6,-0x10(%rdx)
  movups %xmm1,0x30(%rdx)
  cmp    %rbx,%rax
  jne    L116
  and    $0xfffffffe,%esi
  mov    %r10d,%ebx
  mov    %esi,%edx
  add    $0x1,%esi
  mov    %rdx,%rax
  lea    (%r8,%rdx,8),%rdx
  shl    $0x5,%rax
  add    %rcx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%rdx)
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,0x20(%rdx)
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,0x40(%rdx)
  cmp    %esi,%r10d
  jle    L114
  movsd  0x20(%rax),%xmm0
  movsd  %xmm0,0x8(%rdx)
  movsd  0x28(%rax),%xmm0
  movsd  %xmm0,0x28(%rdx)
  movsd  0x30(%rax),%xmm0
  movsd  %xmm0,0x48(%rdx)
L114:
  lea    -0x4(,%r9,4),%edx
  mov    %rbx,%rax
  movslq %edx,%rdx
  shl    $0x5,%rax
  add    %rbx,%rdx
  add    %rcx,%rax
  mov    %r10d,%ebx
  lea    (%r8,%rdx,8),%r8
L93:
  lea    -0x3(%r11),%edx
  cmp    %edx,%ebx
  jge    L99
  lea    -0x4(%r11),%ebp
  lea    0x0(,%r9,4),%esi
  mov    %r8,%rdx
  sub    %ebx,%ebp
  movslq %esi,%rsi
  shr    $0x2,%ebp
  shl    $0x3,%rsi
  lea    0x1(%rbp),%r12d
  mov    %r12,%rcx
  shl    $0x7,%rcx
  add    %rax,%rcx
  nopl   0x0(%rax,%rax,1)
L195:
  movsd  (%rax),%xmm0
  sub    $0xffffffffffffff80,%rax
  movsd  %xmm0,(%rdx)
  movsd  -0x78(%rax),%xmm0
  movsd  %xmm0,0x20(%rdx)
  movsd  -0x70(%rax),%xmm0
  movsd  %xmm0,0x40(%rdx)
  movsd  -0x60(%rax),%xmm0
  movsd  %xmm0,0x8(%rdx)
  movsd  -0x58(%rax),%xmm0
  movsd  %xmm0,0x28(%rdx)
  movsd  -0x50(%rax),%xmm0
  movsd  %xmm0,0x48(%rdx)
  movsd  -0x40(%rax),%xmm0
  movsd  %xmm0,0x10(%rdx)
  movsd  -0x38(%rax),%xmm0
  movsd  %xmm0,0x30(%rdx)
  movsd  -0x30(%rax),%xmm0
  movsd  %xmm0,0x50(%rdx)
  movsd  -0x20(%rax),%xmm0
  movsd  %xmm0,0x18(%rdx)
  movsd  -0x18(%rax),%xmm0
  movsd  %xmm0,0x38(%rdx)
  movsd  -0x10(%rax),%xmm0
  movsd  %xmm0,0x58(%rdx)
  add    %rsi,%rdx
  cmp    %rcx,%rax
  jne    L195
  imul   %r12,%rsi
  lea    0x4(%rbx,%rbp,4),%ebx
  add    %rsi,%r8
L17:
  cmp    %ebx,%r11d
  jle    L143
  mov    %r11d,%eax
  sub    %ebx,%eax
  mov    %rax,%rdx
  lea    -0x1(%rax),%esi
  lea    0x40(%r8,%rax,8),%rax
  shl    $0x5,%rdx
  lea    -0x8(%rcx,%rdx,1),%rdx
  cmp    %rdx,%r8
  setae  %dl
  cmp    %rax,%rcx
  setae  %al
  or     %al,%dl
  je     L192
  cmp    $0x1,%esi
  jbe    L192
  mov    %esi,%ebp
  mov    %rcx,%rax
  mov    %r8,%rdx
  shr    %ebp
  sub    $0x1,%ebp
  shl    $0x6,%rbp
  lea    0x40(%rcx,%rbp,1),%rbp
  cs nopw 0x0(%rax,%rax,1)
L96:
  movupd (%rax),%xmm0
  movupd 0x10(%rax),%xmm5
  add    $0x40,%rax
  add    $0x10,%rdx
  movupd -0x20(%rax),%xmm2
  movupd -0x10(%rax),%xmm4
  movapd %xmm0,%xmm1
  unpckhpd %xmm5,%xmm0
  unpcklpd %xmm5,%xmm1
  movapd %xmm2,%xmm3
  unpckhpd %xmm4,%xmm2
  unpcklpd %xmm4,%xmm3
  movapd %xmm1,%xmm6
  unpcklpd %xmm2,%xmm0
  unpcklpd %xmm3,%xmm6
  unpckhpd %xmm3,%xmm1
  movups %xmm0,0x10(%rdx)
  movups %xmm6,-0x10(%rdx)
  movups %xmm1,0x30(%rdx)
  cmp    %rax,%rbp
  jne    L96
  mov    %esi,%ebp
  and    $0xfffffffe,%ebp
  mov    %ebp,%edx
  lea    0x1(%rbx,%rbp,1),%ebx
  mov    %rdx,%rax
  lea    (%r8,%rdx,8),%rdx
  shl    $0x5,%rax
  add    %rcx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%rdx)
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,0x20(%rdx)
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,0x40(%rdx)
  cmp    %ebx,%r11d
  jle    L196
  movsd  0x20(%rax),%xmm0
  movsd  %xmm0,0x8(%rdx)
  movsd  0x28(%rax),%xmm0
  movsd  %xmm0,0x28(%rdx)
  movsd  0x30(%rax),%xmm0
  movsd  %xmm0,0x48(%rdx)
L196:
  mov    %esi,%esi
  add    $0x1,%rsi
  lea    (%r8,%rsi,8),%r8
  shl    $0x5,%rsi
  add    %rsi,%rcx
L143:
  cmp    $0x1,%edi
  je     L1
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L138:
  mov    %rcx,%rax
  xor    %ebx,%ebx
  jmp    L93
  nopw   0x0(%rax,%rax,1)
L1:
  movsd  0x8(%rcx),%xmm0
  sub    %r11d,%r10d
  and    $0x3,%r10d
  movsd  %xmm0,0x20(%r8)
  movsd  0x10(%rcx),%xmm0
  movsd  %xmm0,0x40(%r8)
  movsd  0x30(%rcx),%xmm0
  cmp    $0x1,%r10d
  je     L182
  pop    %rbx
  movsd  %xmm0,0x48(%r8)
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L192:
  lea    -0x1(%r11),%eax
  mov    %rcx,%rdx
  sub    %ebx,%eax
  lea    0x8(%r8,%rax,8),%rbx
  mov    %r8,%rax
  nopl   0x0(%rax)
L110:
  movsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    $0x20,%rdx
  movsd  %xmm0,-0x8(%rax)
  movsd  -0x18(%rdx),%xmm0
  movsd  %xmm0,0x18(%rax)
  movsd  -0x10(%rdx),%xmm0
  movsd  %xmm0,0x38(%rax)
  cmp    %rax,%rbx
  jne    L110
  jmp    L196
  nop
L182:
  lea    0x5(,%r9,4),%eax
  pop    %rbx
  pop    %rbp
  cltq
  pop    %r12
  movsd  %xmm0,(%r8,%rax,8)
  ret
L74:
  mov    %r10d,%ebx
  mov    %r8,%rdx
  mov    %rcx,%rax
  mov    %rbx,%rsi
  shl    $0x5,%rsi
  add    %rcx,%rsi
  nopl   0x0(%rax,%rax,1)
L28:
  movsd  (%rax),%xmm0
  add    $0x20,%rax
  add    $0x8,%rdx
  movsd  %xmm0,-0x8(%rdx)
  movsd  -0x18(%rax),%xmm0
  movsd  %xmm0,0x18(%rdx)
  movsd  -0x10(%rax),%xmm0
  movsd  %xmm0,0x38(%rdx)
  cmp    %rax,%rsi
  jne    L28
  jmp    L114
L99:
  mov    %rax,%rcx
  jmp    L17
```

assistant: ```c
void kernel_dgetr_3_lib4(int tri, int kmax, int kna, double *A, double *C, int sdc) {
  if (tri == 1) {
    kmax += 1;
  }
  const int bs = 4;
  int k;
  k = 0;
  if (kmax < kna)
    goto cleanup_loop;
  if (kna > 0) {
    for (; k < kna; k++) {
      C[0 + bs * 0] = A[0 + bs * 0];
      C[0 + bs * 1] = A[1 + bs * 0];
      C[0 + bs * 2] = A[2 + bs * 0];
      C += 1;
      A += bs;
    }
    C += bs * (sdc - 1);
  }
  for (; k < kmax - 3; k += 4) {
    C[0 + bs * 0] = A[0 + bs * 0];
    C[0 + bs * 1] = A[1 + bs * 0];
    C[0 + bs * 2] = A[2 + bs * 0];
    C[1 + bs * 0] = A[0 + bs * 1];
    C[1 + bs * 1] = A[1 + bs * 1];
    C[1 + bs * 2] = A[2 + bs * 1];
    C[2 + bs * 0] = A[0 + bs * 2];
    C[2 + bs * 1] = A[1 + bs * 2];
    C[2 + bs * 2] = A[2 + bs * 2];
    C[3 + bs * 0] = A[0 + bs * 3];
    C[3 + bs * 1] = A[1 + bs * 3];
    C[3 + bs * 2] = A[2 + bs * 3];
    C += bs * sdc;
    A += bs * bs;
  }
cleanup_loop:
  for (; k < kmax; k++) {
    C[0 + bs * 0] = A[0 + bs * 0];
    C[0 + bs * 1] = A[1 + bs * 0];
    C[0 + bs * 2] = A[2 + bs * 0];
    C += 1;
    A += bs;
  }
  if (tri == 1) {
    kna = (bs - (bs - kna + kmax) % bs) % bs;
    if (kna == 1) {
      C[0 + bs * 1] = A[1 + bs * 0];
      C[0 + bs * 2] = A[2 + bs * 0];
      C[1 + bs * (sdc + 1)] = A[2 + bs * 1];
    } else {
      C[0 + bs * 1] = A[1 + bs * 0];
      C[0 + bs * 2] = A[2 + bs * 0];
      C[1 + bs * 2] = A[2 + bs * 1];
    }
  }
}
```