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

```asm
<Scovsrt>:
  endbr64
  push   %r15
  mov    %ecx,%eax
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x18,%rsp
  mov    %ecx,0xc(%rsp)
  add    $0x1,%ecx
  mov    %rdx,(%rsp)
  cmp    %esi,%ecx
  jg     L182
  test   %ecx,%ecx
  jle    L27
L50:
  movslq %ecx,%rcx
  nopl   0x0(%rax,%rax,1)
L73:
  mov    (%r12,%rcx,8),%rsi
  lea    0x0(,%rcx,8),%rdi
  mov    $0x1,%eax
  nopl   0x0(%rax)
L142:
  mov    (%r12,%rax,8),%rdx
  movq   $0x0,(%rsi,%rax,8)
  add    $0x1,%rax
  movq   $0x0,(%rdx,%rdi,1)
  cmp    %ecx,%eax
  jle    L142
  add    $0x1,%rcx
  cmp    %ecx,%ebx
  jge    L73
L182:
  movslq %ebx,%r13
  test   %ebx,%ebx
  jg     L114
  jmp    L12
L32:
  sub    $0x1,%r13
  test   %r13d,%r13d
  jle    L12
L114:
  mov    (%rsp),%rax
  mov    (%rax,%r13,4),%eax
  test   %eax,%eax
  je     L32
  movslq 0xc(%rsp),%r14
  lea    0x0(,%r13,8),%r15
  mov    $0x1,%ebp
  shl    $0x3,%r14
  nop
L187:
  mov    (%r12,%rbp,8),%rdi
  add    $0x1,%rbp
  lea    (%rdi,%r15,1),%rsi
  add    %r14,%rdi
  call   <swap@plt>
  cmp    %ebp,%ebx
  jge    L187
  add    %r12,%r14
  mov    $0x8,%r15d
  mov    $0x1,%ebp
  cs nopw 0x0(%rax,%rax,1)
L128:
  mov    (%r12,%r13,8),%rsi
  mov    (%r14),%rdi
  add    $0x1,%ebp
  add    %r15,%rsi
  add    %r15,%rdi
  add    $0x8,%r15
  call   <swap@plt>
  cmp    %ebp,%ebx
  jge    L128
  sub    $0x1,%r13
  subl   $0x1,0xc(%rsp)
  test   %r13d,%r13d
  jg     L114
L12:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L27:
  xor    %edx,%edx
  test   %ebx,%ebx
  mov    %eax,%esi
  mov    $0x1,%edi
  cmovle %ebx,%edx
  mov    %edx,%eax
  sub    %esi,%eax
  cmp    %edx,%esi
  cmovl  %eax,%edi
  sub    $0x1,%eax
  cmp    $0x2,%eax
  jbe    L6
  mov    %esi,%eax
  cmp    %edx,%esi
  jge    L6
  movd   %eax,%xmm4
  mov    %edi,%esi
  xor    %eax,%eax
  movdqa D14(%rip),%xmm3
  pshufd $0x0,%xmm4,%xmm1
  movdqa D8(%rip),%xmm2
  paddd  D0(%rip),%xmm1
  shr    $0x2,%esi
  nopl   (%rax)
L176:
  movdqa %xmm1,%xmm0
  add    $0x1,%eax
  paddd  %xmm3,%xmm1
  paddd  %xmm2,%xmm0
  cmp    %eax,%esi
  jne    L176
  mov    %edi,%esi
  pshufd $0xff,%xmm0,%xmm0
  and    $0xfffffffc,%esi
  movd   %xmm0,%eax
  add    %esi,%ecx
  cmp    %edi,%esi
  je     L119
L6:
  lea    0x1(%rcx),%eax
  cmp    %edx,%eax
  jg     L119
  lea    0x2(%rcx),%eax
  add    $0x3,%ecx
  cmp    %eax,%edx
  cmovl  %eax,%ecx
L0:
  cmp    %ecx,%ebx
  jge    L50
  jmp    L182
L119:
  mov    %eax,%ecx
  jmp    L0
```

tool_calls: name: disassemble_data
arguments: tag: D14
data_type: byte[16]
name: disassemble_data
arguments: tag: D8
data_type: byte[16]
name: disassemble_data
arguments: tag: D0
data_type: byte[16]

tool: {"D14": [0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

tool: {"D8": [0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00]}

tool: {"D0": [0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

assistant: ```c
void Scovsrt(double **covar, int ndim, int data[], int mfit) {
  int k = mfit;
  for (int i = mfit + 1; i <= ndim; i++) {
    for (int j = 1; j <= i; j++) {
      covar[i][j] = 0.0;
      covar[j][i] = 0.0;
    }
  }
  for (int j = ndim; j >= 1; j--) {
    if (data[j]) {
      for (int i = 1; i <= ndim; i++)
        swap(&covar[i][k], &covar[i][j]);
      for (int i = 1; i <= ndim; i++)
        swap(&covar[k][i], &covar[j][i]);
      k--;
    }
  }
}
```