user: Demonstrate the C code that generates the assembly output below:

```asm
<rxsort>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  lea    0x0(,%rcx,4),%edi
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %ecx,%ebx
  sub    $0x28,%rsp
  mov    %esi,0x4(%rsp)
  mov    %edx,0x8(%rsp)
  call   <malloc@plt>
  test   %rax,%rax
  je     L107
  mov    0x4(%rsp),%ebp
  mov    %rax,%r15
  lea    0x0(,%rbp,4),%eax
  mov    %eax,%edi
  mov    %eax,0xc(%rsp)
  call   <malloc@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L107
  mov    0x8(%rsp),%ecx
  test   %ecx,%ecx
  jle    L18
  pxor   %xmm2,%xmm2
  lea    -0x1(%rbx),%eax
  lea    -0x1(%rbp),%ecx
  xor    %ebp,%ebp
  cvtsi2sd %ebx,%xmm2
  lea    0x4(,%rax,4),%rax
  mov    %ecx,(%rsp)
  mov    %rax,0x18(%rsp)
  mov    %ecx,%eax
  lea    0x4(%r14,%rax,4),%r12
  mov    %r13,%rax
  mov    %r15,%r13
  mov    %rax,%r15
  movsd  %xmm2,0x10(%rsp)
  nopl   0x0(%rax,%rax,1)
L49:
  test   %ebx,%ebx
  jle    L5
  mov    0x18(%rsp),%rdx
  xor    %esi,%esi
  mov    %r13,%rdi
  call   <memset@plt>
L5:
  pxor   %xmm1,%xmm1
  movsd  0x10(%rsp),%xmm0
  cvtsi2sd %ebp,%xmm1
  call   <pow@plt>
  mov    0x4(%rsp),%edx
  mov    %eax,%ecx
  test   %edx,%edx
  jle    L44
  mov    %r14,%rsi
  nopw   0x0(%rax,%rax,1)
L17:
  mov    (%rsi),%eax
  add    $0x4,%rsi
  cltd
  idiv   %ecx
  cltd
  idiv   %ebx
  movslq %edx,%rdx
  addl   $0x1,0x0(%r13,%rdx,4)
  cmp    %rsi,%r12
  jne    L17
  cmp    $0x1,%ebx
  jle    L95
L77:
  mov    0x0(%r13),%esi
  lea    0x4(%r13),%rax
  mov    $0x1,%edx
  nopl   0x0(%rax)
L94:
  add    (%rax),%esi
  add    $0x1,%edx
  add    $0x4,%rax
  mov    %esi,-0x4(%rax)
  cmp    %edx,%ebx
  jg     L94
L62:
  mov    (%rsp),%eax
  test   %eax,%eax
  js     L138
L95:
  movslq (%rsp),%rsi
  nopl   0x0(%rax,%rax,1)
L4:
  mov    (%r14,%rsi,4),%edi
  sub    $0x1,%rsi
  mov    %edi,%eax
  cltd
  idiv   %ecx
  cltd
  idiv   %ebx
  movslq %edx,%rdx
  lea    0x0(%r13,%rdx,4),%rax
  movslq (%rax),%rdx
  mov    %edi,-0x4(%r15,%rdx,4)
  subl   $0x1,(%rax)
  test   %esi,%esi
  jns    L4
L138:
  mov    0xc(%rsp),%edx
  mov    %r15,%rsi
  mov    %r14,%rdi
  add    $0x1,%ebp
  call   <memcpy@plt>
  cmp    %ebp,0x8(%rsp)
  jne    L49
  mov    %r15,%rax
  mov    %r13,%r15
  mov    %rax,%r13
L18:
  mov    %r15,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  xor    %eax,%eax
L20:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L44:
  cmp    $0x1,%ebx
  jg     L77
  jmp    L62
L107:
  mov    $0xffffffff,%eax
  jmp    L20
```

assistant: ```c
int rxsort(int *data, int size, int p, int k) {
  int *counts, *temp;
  int index, pval, i, j, n;
  if ((counts = (int *)malloc(k * sizeof(int))) == NULL)
    return -1;
  if ((temp = (int *)malloc(size * sizeof(int))) == NULL)
    return -1;
  for (n = 0; n < p; n++) {
    for (i = 0; i < k; i++)
      counts[i] = 0;
    pval = (int)pow((double)k, (double)n);
    for (j = 0; j < size; j++) {
      index = (int)(data[j] / pval) % k;
      counts[index] = counts[index] + 1;
    }
    for (i = 1; i < k; i++)
      counts[i] = counts[i] + counts[i - 1];
    for (j = size - 1; j >= 0; j--) {
      index = (int)(data[j] / pval) % k;
      temp[counts[index] - 1] = data[j];
      counts[index] = counts[index] - 1;
    }
    memcpy(data, temp, size * sizeof(int));
  }
  free(counts);
  free(temp);
  return 0;
}
```