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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  lea    D13(%rip),%rbp
  push   %rbx
  mov    %rbp,%rdi
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x1c(%rsp),%rsi
  call   <scanf@plt>
  mov    0x1c(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x1c(%rsp)
  test   %eax,%eax
  je     L92
  lea    0x20(%rsp),%rax
  lea    0x24(%rsp),%r15
  mov    %rax,0x8(%rsp)
  nopl   0x0(%rax,%rax,1)
L63:
  mov    0x8(%rsp),%rsi
  mov    %r15,%rdx
  lea    D8(%rip),%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x20(%rsp),%edi
  mov    $0x4,%esi
  call   <calloc@plt>
  mov    0x20(%rsp),%edi
  mov    $0x4,%esi
  mov    %rax,%r12
  call   <calloc@plt>
  mov    0x20(%rsp),%edx
  mov    %rax,%rbx
  test   %edx,%edx
  jle    L122
  mov    %r12,%r14
  xor    %r13d,%r13d
  cs nopw 0x0(%rax,%rax,1)
L143:
  mov    %r14,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  add    $0x1,%r13d
  call   <scanf@plt>
  mov    0x20(%rsp),%edx
  add    $0x4,%r14
  cmp    %r13d,%edx
  jg     L143
L122:
  sub    $0x1,%edx
  xor    %esi,%esi
  mov    %r12,%rdi
  call   <mergeSort@plt>
  movslq 0x20(%rsp),%rdx
  cmp    $0x1,%edx
  jle    L104
  mov    $0x1,%eax
  nopw   0x0(%rax,%rax,1)
L73:
  mov    (%r12,%rax,4),%edx
  sub    -0x4(%r12,%rax,4),%edx
  mov    %edx,%esi
  neg    %esi
  cmovns %esi,%edx
  mov    %edx,(%rbx,%rax,4)
  movslq 0x20(%rsp),%rdx
  add    $0x1,%rax
  cmp    %eax,%edx
  jg     L73
L104:
  mov    -0x4(%r12,%rdx,4),%eax
  sub    (%r12),%eax
  mov    %rbx,%rdi
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  xor    %esi,%esi
  mov    %eax,(%rbx)
  mov    0x20(%rsp),%eax
  lea    -0x1(%rax),%edx
  call   <mergeSort@plt>
  mov    0x20(%rsp),%ecx
  sub    0x24(%rsp),%ecx
  test   %ecx,%ecx
  jle    L37
  lea    -0x1(%rcx),%eax
  cmp    $0x2,%eax
  jbe    L62
  mov    %ecx,%edx
  mov    %rbx,%rax
  pxor   %xmm0,%xmm0
  shr    $0x2,%edx
  shl    $0x4,%rdx
  add    %rbx,%rdx
  nopw   0x0(%rax,%rax,1)
L100:
  movdqu (%rax),%xmm2
  add    $0x10,%rax
  paddd  %xmm2,%xmm0
  cmp    %rax,%rdx
  jne    L100
  movdqa %xmm0,%xmm1
  mov    %ecx,%eax
  psrldq $0x8,%xmm1
  and    $0xfffffffc,%eax
  paddd  %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  psrldq $0x4,%xmm1
  paddd  %xmm1,%xmm0
  movd   %xmm0,%esi
  test   $0x3,%cl
  je     L29
L113:
  movslq %eax,%rdx
  lea    0x0(,%rdx,4),%rdi
  add    (%rbx,%rdx,4),%esi
  lea    0x1(%rax),%edx
  cmp    %edx,%ecx
  jle    L29
  add    $0x2,%eax
  add    0x4(%rbx,%rdi,1),%esi
  cmp    %eax,%ecx
  jle    L29
  add    0x8(%rbx,%rdi,1),%esi
L29:
  lea    D22(%rip),%rdi
  call   <printf@plt>
  mov    0x1c(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x1c(%rsp)
  test   %eax,%eax
  jne    L63
L92:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L128
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L37:
  xor    %esi,%esi
  jmp    L29
L62:
  xor    %esi,%esi
  xor    %eax,%eax
  jmp    L113
L128:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D13
type: string
name: extract_symbolic_data
arguments: data_label: D8
type: string
name: extract_symbolic_data
arguments: data_label: D22
type: string

tool: D13: %d

tool: D8: %d %d

tool: D22: %d


assistant: ```c
int main() {
  int test;
  scanf("%d", &test);
  while (test--) {
    int n, k;
    scanf("%d %d", &n, &k);
    int i;
    int range = 0;
    int *size = calloc(n, sizeof(int));
    int *sorted = calloc(n, sizeof(int));
    for (i = 0; i < n; i++) {
      scanf("%d", &size[i]);
    }
    mergeSort(size, 0, n - 1);
    for (i = 1; i < n; i++) {
      sorted[i] = abs(size[i] - size[i - 1]);
    }
    sorted[0] = abs(size[n - 1] - size[0]);
    mergeSort(sorted, 0, n - 1);
    int temp = n - k;
    for (i = 0; i < temp; i++) {
      range += sorted[i];
    }
    printf("%d\n", range);
  }
  return 0;
}
```