user: What would the C source look like for the assembly code provided here:

```asm
<SortArray_copy>:
  endbr64
  push   %r15
  mov    %esi,%r15d
  mov    $0x4,%esi
  push   %r14
  mov    %rdx,%r14
  push   %r13
  mov    %rdi,%r13
  lea    0x1(%r8),%edi
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %r8d,%ebp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,0xc(%rsp)
  call   <calloc@plt>
  test   %ebp,%ebp
  mov    0xc(%rsp),%edi
  movslq %ebp,%rcx
  mov    %rax,%rbx
  js     L62
  lea    0x4(%r12),%rdx
  sub    %rdx,%rax
  cmp    $0x8,%rax
  jbe    L208
  cmp    $0x2,%ebp
  jbe    L208
  mov    %edi,%edx
  mov    %r12,%rcx
  mov    %rbx,%rax
  shr    $0x2,%edx
  sub    %rbx,%rcx
  shl    $0x4,%rdx
  add    %rbx,%rdx
  nopl   (%rax)
L146:
  movdqu (%rax,%rcx,1),%xmm0
  add    $0x10,%rax
  movups %xmm0,-0x10(%rax)
  cmp    %rdx,%rax
  jne    L146
  mov    %edi,%eax
  movslq %ebp,%rcx
  and    $0xfffffffc,%eax
  and    $0x3,%edi
  je     L62
  movslq %eax,%rsi
  mov    (%r12,%rsi,4),%edi
  lea    0x0(,%rsi,4),%rdx
  mov    %edi,(%rbx,%rsi,4)
  lea    0x1(%rax),%esi
  cmp    %esi,%ebp
  jl     L62
  mov    0x4(%r12,%rdx,1),%esi
  add    $0x2,%eax
  mov    %esi,0x4(%rbx,%rdx,1)
  cmp    %eax,%ebp
  jl     L62
  mov    0x8(%r12,%rdx,1),%eax
  mov    %eax,0x8(%rbx,%rdx,1)
L62:
  xor    %edi,%edi
  cmp    %r15d,(%r12,%rcx,4)
  sete   %dil
  call   <assert@plt>
  mov    %r15d,%edi
  mov    $0x4,%esi
  call   <calloc@plt>
  mov    %rax,%rdi
  test   %r15d,%r15d
  jle    L98
  lea    0x4(%r13),%rdx
  sub    %rdx,%rax
  cmp    $0x8,%rax
  jbe    L4
  lea    -0x1(%r15),%eax
  cmp    $0x2,%eax
  jbe    L4
  mov    %r15d,%edx
  mov    %r13,%rcx
  mov    %rdi,%rax
  shr    $0x2,%edx
  sub    %rdi,%rcx
  shl    $0x4,%rdx
  add    %rdi,%rdx
  nopl   (%rax)
L185:
  movdqu (%rax,%rcx,1),%xmm1
  add    $0x10,%rax
  movups %xmm1,-0x10(%rax)
  cmp    %rdx,%rax
  jne    L185
  mov    %r15d,%eax
  mov    %r15d,%esi
  and    $0xfffffffc,%eax
  test   $0x3,%r15b
  je     L154
  mov    %eax,%ecx
  mov    0x0(%r13,%rcx,4),%r8d
  lea    0x0(,%rcx,4),%rdx
  mov    %r8d,(%rdi,%rcx,4)
  lea    0x1(%rax),%ecx
  cmp    %ecx,%r15d
  jle    L154
  mov    0x4(%r13,%rdx,1),%ecx
  add    $0x2,%eax
  mov    %ecx,0x4(%rdx,%rdi,1)
  cmp    %eax,%r15d
  jle    L154
  mov    0x8(%r13,%rdx,1),%eax
  mov    %eax,0x8(%rdx,%rdi,1)
L154:
  lea    (%rdi,%rsi,4),%r8
  mov    %rdi,%rax
  sub    %rdi,%r14
  nopl   0x0(%rax,%rax,1)
L139:
  movslq (%r14,%rax,1),%rdx
  add    $0x4,%rax
  lea    (%r12,%rdx,4),%rcx
  movslq (%rcx),%rdx
  lea    0x1(%rdx),%esi
  mov    %esi,(%rcx)
  mov    -0x4(%rax),%ecx
  mov    %ecx,0x0(%r13,%rdx,4)
  cmp    %r8,%rax
  jne    L139
L98:
  call   <free@plt>
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <EndIndex2BeginIndex@plt>
  test   %ebp,%ebp
  js     L159
  xor    %r13d,%r13d
  sub    %rbx,%r12
  nopw   0x0(%rax,%rax,1)
L37:
  mov    (%rbx),%eax
  xor    %edi,%edi
  cmp    %eax,(%r12,%rbx,1)
  sete   %dil
  add    $0x1,%r13d
  add    $0x4,%rbx
  call   <assert@plt>
  cmp    %r13d,%ebp
  jge    L37
L159:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L4:
  mov    %r15d,%esi
  mov    %r13,%rcx
  mov    %rdi,%rax
  lea    (%rdi,%rsi,4),%r8
  sub    %rdi,%rcx
L93:
  mov    (%rcx,%rax,1),%edx
  add    $0x4,%rax
  mov    %edx,-0x4(%rax)
  cmp    %r8,%rax
  jne    L93
  jmp    L154
  nopl   0x0(%rax)
L208:
  movslq %ebp,%rcx
  mov    %r12,%rsi
  mov    %rbx,%rax
  lea    0x4(%rbx,%rcx,4),%rdi
  sub    %rbx,%rsi
  nopl   0x0(%rax)
L99:
  mov    (%rsi,%rax,1),%edx
  add    $0x4,%rax
  mov    %edx,-0x4(%rax)
  cmp    %rdi,%rax
  jne    L99
  jmp    L62
```

assistant: ```c
void SortArray_copy(int *a, int na, int *key, int *index, int ni) {
  int i;
  int *newa;
  int *aux;
  aux = (int *)calloc(ni + 1, sizeof(int));
  for (i = 0; i <= ni; i++)
    aux[i] = index[i];
  assert(index[ni] == na);
  newa = (int *)calloc(na, sizeof(int));
  for (i = 0; i < na; i++)
    newa[i] = a[i];
  for (i = 0; i < na; i++)
    a[index[key[i]]++] = newa[i];
  free(newa);
  EndIndex2BeginIndex(index, ni);
  for (i = 0; i <= ni; i++)
    assert(aux[i] == index[i]);
}
```