user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<countingSort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  lea    -0x3d0000(%rsp),%r11
L1:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L1
  sub    $0x948,%rsp
  mov    %rdi,-0x3d0948(%rbp)
  mov    %esi,-0x3d094c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    -0x3d094c(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x3d0930(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  movslq %eax,%rdx
  mov    %rdx,%r8
  mov    $0x0,%r9d
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L87:
  cmp    %rdx,%rsp
  je     L16
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L87
L16:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L104
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L104:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x3d0928(%rbp)
  mov    -0x3d094c(%rbp),%edx
  mov    -0x3d0928(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0x0,-0x3d0940(%rbp)
  jmp    L54
L45:
  mov    -0x3d0940(%rbp),%eax
  cltq
  movl   $0x0,-0x3d0920(%rbp,%rax,4)
  addl   $0x1,-0x3d0940(%rbp)
L54:
  cmpl   $0xf423f,-0x3d0940(%rbp)
  jle    L45
  movl   $0x0,-0x3d093c(%rbp)
  jmp    L79
L56:
  mov    -0x3d093c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x3d0948(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  mov    -0x3d0920(%rbp,%rdx,4),%edx
  add    $0x1,%edx
  cltq
  mov    %edx,-0x3d0920(%rbp,%rax,4)
  addl   $0x1,-0x3d093c(%rbp)
L79:
  mov    -0x3d093c(%rbp),%eax
  cmp    -0x3d094c(%rbp),%eax
  jl     L56
  movl   $0x1,-0x3d0938(%rbp)
  jmp    L96
L42:
  mov    -0x3d0938(%rbp),%eax
  cltq
  mov    -0x3d0920(%rbp,%rax,4),%edx
  mov    -0x3d0938(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    -0x3d0920(%rbp,%rax,4),%eax
  add    %eax,%edx
  mov    -0x3d0938(%rbp),%eax
  cltq
  mov    %edx,-0x3d0920(%rbp,%rax,4)
  addl   $0x1,-0x3d0938(%rbp)
L96:
  cmpl   $0xf423f,-0x3d0938(%rbp)
  jle    L42
  mov    -0x3d094c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x3d0934(%rbp)
  jmp    L8
L75:
  mov    -0x3d0934(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x3d0948(%rbp),%rax
  add    %rax,%rdx
  mov    -0x3d0934(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x3d0948(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cltq
  mov    -0x3d0920(%rbp,%rax,4),%eax
  lea    -0x1(%rax),%esi
  mov    (%rdx),%ecx
  mov    -0x3d0928(%rbp),%rax
  movslq %esi,%rdx
  mov    %ecx,(%rax,%rdx,4)
  mov    -0x3d0934(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x3d0948(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  mov    -0x3d0920(%rbp,%rdx,4),%edx
  sub    $0x1,%edx
  cltq
  mov    %edx,-0x3d0920(%rbp,%rax,4)
  subl   $0x1,-0x3d0934(%rbp)
L8:
  cmpl   $0x0,-0x3d0934(%rbp)
  jns    L75
  mov    -0x3d094c(%rbp),%edx
  mov    -0x3d0928(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <printArray@plt>
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    %rbx,%rsp
  nop
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L128
  call   <__stack_chk_fail@plt>
L128:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D7
type: string

tool: D7: 


assistant: ```c
void countingSort(int *a, int size) {
  int output[size];
  memset(output, 0, size);
  int count[1000000];
  for (int i = 0; i < 1000000; i++)
    count[i] = 0;
  for (int i = 0; i < size; i++) {
    count[a[i]]++;
  }
  for (int i = 1; i < 1000000; i++)
    count[i] += count[i - 1];
  for (int i = size - 1; i >= 0; i--) {
    output[count[a[i]] - 1] = a[i];
    count[a[i]]--;
  }
  printArray(output, size);
  printf("\n");
}
```