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

```asm
<counting_sort2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r11
  mov    %rsi,%rdi
  mov    %edx,%r8d
  mov    %ecx,%r10d
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movslq %edx,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L118:
  cmp    %rdx,%rsp
  je     L228
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L118
L228:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L229
  orq    $0x0,-0x8(%rsp,%rax,1)
L229:
  mov    %rsp,%r9
  test   %r8d,%r8d
  jle    L185
  mov    %r8d,%esi
  mov    $0x0,%eax
  mov    $0x0,%ecx
L244:
  movl   $0x0,(%rdi,%rax,4)
  mov    (%r11,%rax,4),%edx
  cmp    %edx,%ecx
  cmovg  %edx,%ecx
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L244
  sub    %ecx,%r10d
  mov    $0x0,%eax
L187:
  mov    (%r11,%rax,4),%edx
  sub    %ecx,%edx
  mov    %edx,(%r9,%rax,4)
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L187
  lea    0x1(%r10),%eax
  cltq
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L19:
  cmp    %rdx,%rsp
  je     L123
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L19
L263:
  test   %r10d,%r10d
  jg     L259
  jmp    L265
L235:
  lea    -0x1(%r8),%esi
  jmp    L204
L123:
  mov    %rsi,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L96
  orq    $0x0,-0x8(%rsp,%rax,1)
L96:
  mov    %rsp,%rax
  test   %r10d,%r10d
  js     L166
L169:
  mov    $0x0,%edx
L224:
  movl   $0x0,(%rax,%rdx,4)
  add    $0x1,%rdx
  cmp    %edx,%r10d
  jge    L224
  test   %r8d,%r8d
  jle    L263
L166:
  mov    $0x0,%edx
L254:
  movslq (%r9,%rdx,4),%rsi
  addl   $0x1,(%rax,%rsi,4)
  add    $0x1,%rdx
  cmp    %edx,%r8d
  jg     L254
  test   %r10d,%r10d
  jle    L235
L259:
  mov    $0x1,%edx
L133:
  mov    -0x4(%rax,%rdx,4),%esi
  add    %esi,(%rax,%rdx,4)
  add    $0x1,%rdx
  cmp    %edx,%r10d
  jge    L133
L265:
  mov    %r8d,%esi
  sub    $0x1,%esi
  js     L39
L204:
  movslq %esi,%rsi
L74:
  mov    (%r9,%rsi,4),%r11d
  movslq %r11d,%r10
  mov    (%rax,%r10,4),%edx
  movslq %edx,%rbx
  mov    %r11d,-0x4(%rdi,%rbx,4)
  sub    $0x1,%edx
  mov    %edx,(%rax,%r10,4)
  sub    $0x1,%rsi
  test   %esi,%esi
  jns    L74
L39:
  test   %r8d,%r8d
  jle    L3
  mov    %rdi,%rax
  lea    -0x1(%r8),%edx
  lea    0x4(%rdi,%rdx,4),%rdx
L8:
  add    %ecx,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L8
L3:
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L145
  mov    -0x8(%rbp),%rbx
  leave
  ret
L185:
  lea    0x1(%r10),%eax
  cltq
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L283:
  cmp    %rdx,%rsp
  je     L78
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L283
L78:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L60
  orq    $0x0,-0x8(%rsp,%rax,1)
L60:
  mov    %rsp,%rax
  mov    $0x0,%ecx
  test   %r10d,%r10d
  jns    L169
  mov    $0x0,%ecx
  jg     L259
  jmp    L39
L145:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void counting_sort2(const int a[], int b[], int size, int maxvalue) {
  int i = 0;
  int copyofa[size];
  int min = 0;
  for (i = 0; i < size; i++) {
    b[i] = 0;
    if (min > a[i]) {
      min = a[i];
    }
  }
  int newmaxvalue = maxvalue - min;
  for (i = 0; i < size; i++) {
    copyofa[i] = a[i] - min;
  }
  int temp[newmaxvalue + 1];
  for (i = 0; i <= newmaxvalue; i++) {
    temp[i] = 0;
  }
  for (i = 0; i < size; i++) {
    temp[copyofa[i]] += 1;
  }
  for (i = 1; i <= newmaxvalue; i++) {
    temp[i] = temp[i] + temp[i - 1];
  }
  for (i = size - 1; i >= 0; i--) {
    b[temp[copyofa[i]] - 1] = copyofa[i];
    temp[copyofa[i]] = temp[copyofa[i]] - 1;
  }
  for (i = 0; i < size; i++) {
    b[i] = b[i] + min;
  }
}
```