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

```asm
<generic_partition>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %rcx,-0x60(%rbp)
  mov    %r8,-0x68(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x58(%rbp),%rax
  imul   -0x60(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x50(%rbp),%rax
  sub    $0x1,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L12
L81:
  mov    -0x10(%rbp),%rax
  imul   -0x60(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x8(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x30(%rbp),%rax
  mov    -0x68(%rbp),%rdx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   *%rdx
  test   %eax,%eax
  jg     L91
  addq   $0x1,-0x28(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %eax,-0x38(%rbp)
  mov    -0x10(%rbp),%rax
  imul   -0x60(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x28(%rbp),%rax
  imul   -0x60(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  jmp    L20
L59:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x18(%rbp),%rax
  mov    -0x34(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x38(%rbp),%eax
  sub    $0x4,%eax
  mov    %eax,-0x38(%rbp)
  addq   $0x4,-0x20(%rbp)
  addq   $0x4,-0x18(%rbp)
L20:
  mov    -0x38(%rbp),%eax
  cmp    $0x3,%eax
  ja     L59
  jmp    L70
L52:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x34(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %dl,(%rax)
  subl   $0x1,-0x38(%rbp)
  addq   $0x1,-0x20(%rbp)
  addq   $0x1,-0x18(%rbp)
L70:
  cmpl   $0x0,-0x38(%rbp)
  jne    L52
L91:
  addq   $0x1,-0x10(%rbp)
L12:
  mov    -0x10(%rbp),%rax
  cmp    -0x58(%rbp),%rax
  jb     L81
  addq   $0x1,-0x28(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %eax,-0x38(%rbp)
  mov    -0x28(%rbp),%rax
  imul   -0x60(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  jmp    L77
L66:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x30(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x30(%rbp),%rax
  mov    -0x34(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x38(%rbp),%eax
  sub    $0x4,%eax
  mov    %eax,-0x38(%rbp)
  addq   $0x4,-0x20(%rbp)
  addq   $0x4,-0x30(%rbp)
L77:
  mov    -0x38(%rbp),%eax
  cmp    $0x3,%eax
  ja     L66
  jmp    L33
L61:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x34(%rbp),%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %dl,(%rax)
  subl   $0x1,-0x38(%rbp)
  addq   $0x1,-0x20(%rbp)
  addq   $0x1,-0x30(%rbp)
L33:
  cmpl   $0x0,-0x38(%rbp)
  jne    L61
  mov    -0x28(%rbp),%rax
  leave
  ret
```

assistant: ```c
int generic_partition(void *array, size_t p, size_t r, size_t size, int (*compare)(const void *, const void *)) {
  unsigned char *a = (unsigned char *)array;
  unsigned char *x = &a[r * size];
  size_t i = p - 1;
  int temp, k;
  unsigned char *ptr1, *ptr2;
  for (size_t j = p; j < r; ++j) {
    if (compare(&a[j * size], x) <= 0) {
      ++i;
      k = size;
      ptr1 = &a[j * size];
      ptr2 = &a[i * size];
      while (k >= sizeof(int)) {
        temp = *(int *)ptr1;
        *(int *)ptr1 = *(int *)ptr2;
        *(int *)ptr2 = temp;
        k -= sizeof(int);
        ptr1 += sizeof(int);
        ptr2 += sizeof(int);
      }
      while (k) {
        temp = *ptr1;
        *ptr1 = *ptr2;
        *ptr2 = temp;
        --k;
        ++ptr1;
        ++ptr2;
      }
    }
  }
  ++i;
  k = size;
  ptr1 = &a[i * size];
  while (k >= sizeof(int)) {
    temp = *(int *)ptr1;
    *(int *)ptr1 = *(int *)x;
    *(int *)x = temp;
    k -= sizeof(int);
    ptr1 += sizeof(int);
    x += sizeof(int);
  }
  while (k) {
    temp = *ptr1;
    *ptr1 = *x;
    *x = temp;
    --k;
    ++ptr1;
    ++x;
  }
  return i;
}
```