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

```asm
<SortInt>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  mov    $0x4,%esi
  push   %r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  lea    0x0(,%r12,4),%r14d
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x28,%rsp
  call   <calloc@plt>
  mov    %r14d,%edi
  mov    %rax,%rbp
  call   <malloc@plt>
  mov    %r13,%rcx
  mov    %rbx,%rdx
  mov    %r15,%rsi
  mov    %r12d,%edi
  mov    %rax,(%rsp)
  call   <SortUnstableInt@plt>
  cmp    $0x1,%r12d
  jle    L42
  lea    -0x1(%r12),%ecx
  xor    %eax,%eax
  xor    %edx,%edx
  xor    %r12d,%r12d
  jmp    L77
  nopl   0x0(%rax,%rax,1)
L48:
  xor    %edx,%edx
L112:
  add    $0x1,%rax
  cmp    %rax,%rcx
  je     L64
L77:
  mov    (%rbx,%rax,4),%edi
  cmp    %edi,0x4(%rbx,%rax,4)
  jne    L48
  test   %edx,%edx
  je     L95
  movslq %r12d,%rsi
  add    $0x1,%rax
  addl   $0x1,-0x4(%rbp,%rsi,4)
  cmp    %rax,%rcx
  jne    L77
  nopl   (%rax)
L64:
  mov    %r14d,%edi
  call   <malloc@plt>
  mov    %r14d,%edx
  mov    %r13,%rsi
  mov    %rax,%rdi
  mov    %rax,%rbx
  call   <memcpy@plt>
  test   %r12d,%r12d
  je     L40
  lea    -0x1(%r12),%eax
  mov    %rbp,%r15
  lea    0x4(%rbp,%rax,4),%r14
  mov    (%rsp),%rax
  sub    %rbp,%rax
  mov    %rax,0x10(%rsp)
L7:
  mov    (%r15),%eax
  lea    0x0(,%rax,4),%edi
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  mov    (%r15),%eax
  lea    0x0(,%rax,4),%edi
  call   <malloc@plt>
  mov    0x8(%rsp),%rcx
  mov    (%r15),%edi
  mov    %rax,%r12
  mov    0x10(%rsp),%rax
  mov    %r12,%rdx
  lea    (%rax,%r15,1),%r10
  movslq (%r10),%rax
  mov    %r10,0x18(%rsp)
  lea    0x0(%r13,%rax,4),%rsi
  call   <SortInt>
  mov    (%r15),%eax
  mov    0x8(%rsp),%r11
  test   %eax,%eax
  jle    L105
  mov    0x18(%rsp),%r10
  mov    %r11,%rcx
  xor    %edx,%edx
  nopl   (%rax)
L109:
  mov    (%r10),%eax
  mov    (%rcx),%esi
  add    $0x4,%rcx
  add    %eax,%esi
  add    %edx,%eax
  add    $0x1,%edx
  movslq %esi,%rsi
  cltq
  mov    (%rbx,%rsi,4),%esi
  mov    %esi,0x0(%r13,%rax,4)
  cmp    %edx,(%r15)
  jg     L109
L105:
  mov    %r11,%rdi
  add    $0x4,%r15
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  cmp    %r15,%r14
  jne    L7
L40:
  mov    %rbx,%rdi
  call   <free@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  add    $0x28,%rsp
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <free@plt>
  cs nopw 0x0(%rax,%rax,1)
L95:
  add    $0x1,%r12d
  mov    (%rsp),%rdi
  movslq %r12d,%rdx
  shl    $0x2,%rdx
  mov    %eax,-0x4(%rdi,%rdx,1)
  movl   $0x2,-0x4(%rbp,%rdx,1)
  mov    $0x1,%edx
  jmp    L112
L42:
  mov    %r14d,%edi
  call   <malloc@plt>
  mov    %r14d,%edx
  mov    %r13,%rsi
  mov    %rax,%rdi
  mov    %rax,%rbx
  call   <memcpy@plt>
  jmp    L40
```

assistant: ```c
void SortInt(int N, int *A, int *C, int *idx) {
  int u, n, j, U;
  int *run_length, *run_start, *run_idx, *run_sort;
  int run_flag;
  int *idx_temp;
  run_length = (int *)calloc(N, sizeof(int));
  run_start = (int *)malloc(N * sizeof(int));
  SortUnstableInt(N, A, C, idx);
  u = 0;
  run_flag = 0;
  for (n = 1; n < N; n++)
    if (C[n] == C[n - 1])
      if (run_flag)
        run_length[u - 1]++;
      else {
        u++;
        run_start[u - 1] = n - 1;
        run_length[u - 1] = 2;
        run_flag = 1;
      }
    else
      run_flag = 0;
  U = u;
  idx_temp = (int *)malloc(N * sizeof(int));
  memcpy(idx_temp, idx, N * sizeof(int));
  for (u = 0; u < U; u++) {
    run_idx = (int *)malloc(run_length[u] * sizeof(int));
    run_sort = (int *)malloc(run_length[u] * sizeof(int));
    SortInt(run_length[u], &idx[run_start[u]], run_sort, run_idx);
    for (j = 0; j < run_length[u]; j++)
      idx[run_start[u] + j] = idx_temp[run_start[u] + run_idx[j]];
    free(run_idx);
    free(run_sort);
  }
  free(idx_temp);
  free(run_start);
  free(run_length);
}
```