user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    -0x78(%rbp),%rax
  mov    %rax,%rsi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movl   $0x1,-0x6c(%rbp)
  jmp    L19
L70:
  mov    %rsp,%rax
  mov    %rax,%rbx
  lea    -0x70(%rbp),%rdx
  lea    -0x74(%rbp),%rax
  mov    %rax,%rsi
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x74(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x48(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  movslq %eax,%rdx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%ecx
  mov    $0x0,%edx
  div    %rcx
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L99:
  cmp    %rdx,%rsp
  je     L104
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L99
L104:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L11
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L11:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x40(%rbp)
  movl   $0x0,-0x68(%rbp)
  jmp    L26
L48:
  mov    -0x68(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  addl   $0x1,-0x68(%rbp)
L26:
  mov    -0x74(%rbp),%eax
  cmp    %eax,-0x68(%rbp)
  jl     L48
  mov    -0x74(%rbp),%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <bubble_sort@plt>
  mov    -0x74(%rbp),%eax
  mov    -0x70(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,-0x5c(%rbp)
  movq   $0x0,-0x58(%rbp)
  movq   $0x0,-0x50(%rbp)
  movl   $0x1,-0x64(%rbp)
  jmp    L59
L45:
  mov    -0x74(%rbp),%eax
  sub    -0x64(%rbp),%eax
  mov    %eax,%edx
  mov    -0x40(%rbp),%rax
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  cltq
  add    %rax,-0x50(%rbp)
  addl   $0x1,-0x64(%rbp)
L59:
  mov    -0x64(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jle    L45
  movl   $0x0,-0x60(%rbp)
  jmp    L31
L35:
  mov    -0x40(%rbp),%rax
  mov    -0x60(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  cltq
  add    %rax,-0x58(%rbp)
  addl   $0x1,-0x60(%rbp)
L31:
  mov    -0x60(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jl     L35
  mov    -0x50(%rbp),%rax
  sub    -0x58(%rbp),%rax
  mov    %rax,%rsi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    %rbx,%rsp
  addl   $0x1,-0x6c(%rbp)
L19:
  mov    -0x78(%rbp),%eax
  cmp    %eax,-0x6c(%rbp)
  jle    L70
  mov    $0x0,%eax
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L16
  call   <__stack_chk_fail@plt>
L16:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: read_data
arguments: data_tag: D15
type: string
name: read_data
arguments: data_tag: D30
type: string
name: read_data
arguments: data_tag: D8
type: string

tool: D15: %d

tool: D30: %d %d

tool: D8: %llu


assistant: ```c
int main() {
  int cases, len, m;
  scanf("%d", &cases);
  for (int i = 1; i <= cases; ++i) {
    scanf("%d %d", &len, &m);
    int arr[len];
    for (int i = 0; i < len; ++i)
      scanf("%d", &arr[i]);
    bubble_sort(arr, len);
    int diff = len - m;
    unsigned long long int min = 0, max = 0;
    for (int i = 1; i <= diff; ++i)
      max += arr[len - i];
    for (int i = 0; i < diff; ++i)
      min += arr[i];
    printf("%llu\n", max - min);
  }
  return 0;
}
```