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

```asm
<partition_sort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1b8,%rsp
  mov    %rdx,%r15
  mov    %rcx,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x1a8(%rsp)
  xor    %eax,%eax
  mov    %rdi,0xa0(%rsp)
  mov    %esi,0x20(%rsp)
  movl   $0x1,0x18(%rsp)
  mov    %edx,%eax
  mov    %edx,0x10(%rsp)
  sub    $0x1,%eax
  mov    %eax,0x1c(%rsp)
  mov    %rdx,%rax
  neg    %rax
  mov    %rax,(%rsp)
  jmp    L39
L98:
  lea    -0x1(%r15),%eax
  lea    0x1(%r14,%rax,1),%rdi
  mov    %rbx,%rdx
  mov    %r14,%rax
L76:
  movzbl (%rax),%ecx
  add    $0x1,%rax
  movzbl (%rdx),%esi
  mov    %sil,-0x1(%rax)
  add    $0x1,%rdx
  mov    %cl,-0x1(%rdx)
  cmp    %rdi,%rax
  jne    L76
  lea    -0x1(%r15),%eax
  add    $0x1,%rax
  lea    (%r14,%rax,1),%rsi
  add    %rbx,%rax
L198:
  mov    (%rsp),%rdx
  lea    (%rsi,%rdx,1),%r14
  lea    (%rax,%rdx,1),%rbx
L283:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   *%r13
  test   %eax,%eax
  jle    L182
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   *%r13
  test   %eax,%eax
  jle    L239
  mov    %r15d,%eax
  or     %r14d,%eax
  test   $0x3,%al
  jne    L373
  lea    -0x4(%r15),%eax
  lea    0x4(%rax),%rsi
  lea    (%r14,%rsi,1),%rdi
  mov    %rbp,%rax
L265:
  mov    (%r14),%edx
  mov    (%rax),%ecx
  mov    %ecx,(%r14)
  mov    %edx,(%rax)
  add    $0x4,%r14
  add    $0x4,%rax
  cmp    %rdi,%r14
  jne    L265
  lea    0x0(%rbp,%rsi,1),%rax
  jmp    L397
L373:
  lea    -0x1(%r15),%eax
  lea    0x1(%r14,%rax,1),%rdi
  mov    %rbp,%rdx
  mov    %r14,%rax
L355:
  movzbl (%rax),%ecx
  add    $0x1,%rax
  movzbl (%rdx),%esi
  mov    %sil,-0x1(%rax)
  add    $0x1,%rdx
  mov    %cl,-0x1(%rdx)
  cmp    %rdi,%rax
  jne    L355
  lea    -0x1(%r15),%eax
  add    $0x1,%rax
  lea    (%r14,%rax,1),%rdi
  add    %rbp,%rax
L397:
  mov    (%rsp),%rdx
  lea    (%rdi,%rdx,1),%r14
  lea    (%rax,%rdx,1),%rbp
L239:
  mov    %r15d,%eax
  or     %ebx,%eax
  test   $0x3,%al
  jne    L133
  lea    -0x4(%r15),%eax
  lea    0x4(%rax),%rdi
  lea    (%rbx,%rdi,1),%rsi
  mov    %rbp,%rax
L298:
  mov    (%rbx),%edx
  mov    (%rax),%ecx
  mov    %ecx,(%rbx)
  mov    %edx,(%rax)
  add    $0x4,%rbx
  add    $0x4,%rax
  cmp    %rsi,%rbx
  jne    L298
  lea    0x0(%rbp,%rdi,1),%rax
  jmp    L134
L133:
  lea    -0x1(%r15),%eax
  lea    0x1(%rbx,%rax,1),%rdi
  mov    %rbp,%rdx
  mov    %rbx,%rax
L125:
  movzbl (%rax),%ecx
  add    $0x1,%rax
  movzbl (%rdx),%esi
  mov    %sil,-0x1(%rax)
  add    $0x1,%rdx
  mov    %cl,-0x1(%rdx)
  cmp    %rdi,%rax
  jne    L125
  lea    -0x1(%r15),%eax
  add    $0x1,%rax
  lea    (%rbx,%rax,1),%rsi
  add    %rbp,%rax
L134:
  mov    (%rsp),%rdi
  lea    (%rsi,%rdi,1),%rbx
  lea    (%rax,%rdi,1),%rbp
L182:
  add    (%rsp),%rbp
  mov    %r15d,%eax
  or     %ebx,%eax
  test   $0x3,%al
  jne    L113
  lea    -0x4(%r15),%edi
  add    $0x4,%rdi
  lea    (%rbx,%rdi,1),%rsi
  mov    %rbp,%rax
L229:
  mov    (%rbx),%edx
  mov    (%rax),%ecx
  mov    %ecx,(%rbx)
  mov    %edx,(%rax)
  add    $0x4,%rbx
  add    $0x4,%rax
  cmp    %rsi,%rbx
  jne    L229
  add    %rdi,%rbp
  jmp    L185
L113:
  lea    -0x1(%r15),%eax
  lea    0x1(%rbx,%rax,1),%rsi
  mov    %rbp,%rax
L341:
  movzbl (%rbx),%edx
  add    $0x1,%rbx
  movzbl (%rax),%ecx
  mov    %cl,-0x1(%rbx)
  add    $0x1,%rax
  mov    %dl,-0x1(%rax)
  cmp    %rsi,%rbx
  jne    L341
  lea    -0x1(%r15),%eax
  lea    0x1(%rbp,%rax,1),%rbp
L185:
  mov    (%rsp),%rax
  lea    0x0(%rbp,%rax,1),%r12
  mov    %r12,%rbp
  mov    %r14,%rbx
  jmp    L338
L426:
  mov    0x8(%rsp),%rax
  lea    (%rbx,%rax,1),%rdi
  mov    %rbp,%rdx
  mov    %rbx,%rax
L192:
  movzbl (%rax),%ecx
  add    $0x1,%rax
  movzbl (%rdx),%esi
  mov    %sil,-0x1(%rax)
  add    $0x1,%rdx
  mov    %cl,-0x1(%rdx)
  cmp    %rdi,%rax
  jne    L192
  mov    0x8(%rsp),%rax
  lea    (%rbx,%rax,1),%rsi
  add    %rbp,%rax
L389:
  mov    (%rsp),%rcx
  lea    (%rsi,%rcx,1),%rbx
  lea    (%rax,%rcx,1),%rbp
L338:
  add    %r15,%rbx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   *%r13
  test   %eax,%eax
  js     L338
L309:
  add    (%rsp),%rbp
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   *%r13
  test   %eax,%eax
  jg     L309
  cmp    %rbp,%rbx
  jae    L130
  mov    0x10(%rsp),%ecx
  mov    %ecx,%eax
  or     %ebx,%eax
  test   $0x3,%al
  jne    L426
  lea    -0x4(%rcx),%eax
  lea    0x4(%rax),%rdi
  lea    (%rbx,%rdi,1),%rsi
  mov    %rbp,%rax
L228:
  mov    (%rbx),%edx
  mov    (%rax),%ecx
  mov    %ecx,(%rbx)
  mov    %edx,(%rax)
  add    $0x4,%rbx
  add    $0x4,%rax
  cmp    %rsi,%rbx
  jne    L228
  lea    0x0(%rbp,%rdi,1),%rax
  jmp    L389
L130:
  mov    %r15d,%eax
  or     %ebx,%eax
  test   $0x3,%al
  jne    L323
  lea    -0x4(%r15),%eax
  lea    0x4(%rbx,%rax,1),%rax
L208:
  mov    (%rbx),%edx
  mov    (%r12),%ecx
  mov    %ecx,(%rbx)
  mov    %edx,(%r12)
  add    $0x4,%rbx
  add    $0x4,%r12
  cmp    %rax,%rbx
  jne    L208
L202:
  mov    (%rsp),%rdi
  lea    (%rax,%rdi,1),%rcx
  mov    %rcx,%rax
  sub    %r14,%rax
  mov    $0x0,%edx
  div    %r15
  lea    -0x1(%rax),%edx
  sub    %eax,0x14(%rsp)
  mov    0x14(%rsp),%eax
  cmp    %eax,%edx
  jle    L116
  cmp    $0xa,%eax
  jle    L4
  mov    0x18(%rsp),%edi
  movslq %edi,%rax
  mov    %r14,0xa0(%rsp,%rax,8)
  mov    %edx,0x20(%rsp,%rax,4)
  mov    %rcx,%r14
  lea    0x1(%rdi),%eax
  mov    %eax,0x18(%rsp)
L413:
  mov    0x14(%rsp),%edi
  mov    %edi,%eax
  sar    %eax
  imul   %r15d,%eax
  movslq %eax,%rbx
  add    %r14,%rbx
  mov    %eax,%ebp
  sub    %r15d,%ebp
  test   $0x1,%dil
  cmovne %eax,%ebp
  movslq %ebp,%rbp
  add    %rbx,%rbp
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   *%r13
  test   %eax,%eax
  jle    L283
  mov    %r15d,%eax
  or     %r14d,%eax
  test   $0x3,%al
  jne    L98
  lea    -0x4(%r15),%eax
  lea    0x4(%rax),%rdi
  lea    (%r14,%rdi,1),%rsi
  mov    %rbx,%rax
L44:
  mov    (%r14),%edx
  mov    (%rax),%ecx
  mov    %ecx,(%r14)
  mov    %edx,(%rax)
  add    $0x4,%r14
  add    $0x4,%rax
  cmp    %rsi,%r14
  jne    L44
  lea    (%rbx,%rdi,1),%rax
  jmp    L198
L323:
  lea    -0x1(%r15),%eax
  lea    0x1(%rbx,%rax,1),%rsi
  mov    %rbx,%rax
L85:
  movzbl (%rax),%edx
  add    $0x1,%rax
  movzbl (%r12),%ecx
  mov    %cl,-0x1(%rax)
  add    $0x1,%r12
  mov    %dl,-0x1(%r12)
  cmp    %rsi,%rax
  jne    L85
  lea    -0x1(%r15),%eax
  lea    0x1(%rbx,%rax,1),%rax
  jmp    L202
L4:
  cmp    $0xa,%edx
  jle    L175
  mov    %edx,0x14(%rsp)
  jmp    L413
L116:
  cmp    $0xa,%edx
  jle    L388
  mov    0x18(%rsp),%edi
  movslq %edi,%rax
  mov    %rcx,0xa0(%rsp,%rax,8)
  mov    0x14(%rsp),%ecx
  mov    %ecx,0x20(%rsp,%rax,4)
  mov    %edx,0x14(%rsp)
  lea    0x1(%rdi),%eax
  mov    %eax,0x18(%rsp)
  jmp    L413
L388:
  cmpl   $0xa,0x14(%rsp)
  jle    L175
  mov    %rcx,%r14
  jmp    L413
L175:
  cmpl   $0x0,0x18(%rsp)
  je     L399
L39:
  subl   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%eax
  cltq
  mov    0xa0(%rsp,%rax,8),%r14
  mov    0x20(%rsp,%rax,4),%eax
  mov    %eax,0x14(%rsp)
  mov    0x1c(%rsp),%eax
  add    $0x1,%rax
  mov    %rax,0x8(%rsp)
  jmp    L413
L399:
  mov    0x1a8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L34
  add    $0x1b8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L34:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void partition_sort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
  int stackpointer = 1;
  void *basestack[32];
  int sizestack[32];
  basestack[0] = base;
  sizestack[0] = nmemb;
  while (stackpointer != 0) {
    char *b = (char *)basestack[--stackpointer];
    int n = sizestack[stackpointer];
    for (;;) {
      int halfn = (n >> 1) * size;
      char *bmid = b + halfn;
      char *btop;
      if ((n & 1) == 0)
        halfn -= size;
      btop = bmid + halfn;
      if ((*compar)(b, bmid) > 0) {
        int xsize = size;
        if (((xsize | (int)b) & 0x3) == 0) {
          do {
            int temp = *(int *)b;
            *(int *)b = *(int *)bmid;
            *(int *)bmid = temp;
            b += 4;
            bmid += 4;
            xsize -= 4;
            ;
          } while (xsize != 0);
        } else {
          do {
            char temp = *b;
            *b++ = *bmid;
            *bmid++ = temp;
            xsize--;
          } while (xsize != 0);
        }
        b -= size;
        bmid -= size;
      };
      if ((*compar)(bmid, btop) > 0) {
        if ((*compar)(b, btop) > 0) {
          int xsize = size;
          if (((xsize | (int)b) & 0x3) == 0) {
            do {
              int temp = *(int *)b;
              *(int *)b = *(int *)btop;
              *(int *)btop = temp;
              b += 4;
              btop += 4;
              xsize -= 4;
              ;
            } while (xsize != 0);
          } else {
            do {
              char temp = *b;
              *b++ = *btop;
              *btop++ = temp;
              xsize--;
            } while (xsize != 0);
          }
          b -= size;
          btop -= size;
        };
        {
          int xsize = size;
          if (((xsize | (int)bmid) & 0x3) == 0) {
            do {
              int temp = *(int *)bmid;
              *(int *)bmid = *(int *)btop;
              *(int *)btop = temp;
              bmid += 4;
              btop += 4;
              xsize -= 4;
              ;
            } while (xsize != 0);
          } else {
            do {
              char temp = *bmid;
              *bmid++ = *btop;
              *btop++ = temp;
              xsize--;
            } while (xsize != 0);
          }
          bmid -= size;
          btop -= size;
        };
      }
      {
        char *l;
        char *r = btop - size;
        char *pivot;
        int s1, s2;
        {
          int xsize = size;
          if (((xsize | (int)bmid) & 0x3) == 0) {
            do {
              int temp = *(int *)bmid;
              *(int *)bmid = *(int *)r;
              *(int *)r = temp;
              bmid += 4;
              r += 4;
              xsize -= 4;
              ;
            } while (xsize != 0);
          } else {
            do {
              char temp = *bmid;
              *bmid++ = *r;
              *r++ = temp;
              xsize--;
            } while (xsize != 0);
          }
          bmid -= size;
          r -= size;
        };
        l = b;
        pivot = r;
        for (;;) {
          do
            l += size;
          while ((*compar)(l, pivot) < 0);
          do
            r -= size;
          while ((*compar)(r, pivot) > 0);
          if (r <= l)
            break;
          {
            int xsize = size;
            if (((xsize | (int)l) & 0x3) == 0) {
              do {
                int temp = *(int *)l;
                *(int *)l = *(int *)r;
                *(int *)r = temp;
                l += 4;
                r += 4;
                xsize -= 4;
                ;
              } while (xsize != 0);
            } else {
              do {
                char temp = *l;
                *l++ = *r;
                *r++ = temp;
                xsize--;
              } while (xsize != 0);
            }
            l -= size;
            r -= size;
          };
        }
        {
          int xsize = size;
          if (((xsize | (int)l) & 0x3) == 0) {
            do {
              int temp = *(int *)l;
              *(int *)l = *(int *)pivot;
              *(int *)pivot = temp;
              l += 4;
              pivot += 4;
              xsize -= 4;
              ;
            } while (xsize != 0);
          } else {
            do {
              char temp = *l;
              *l++ = *pivot;
              *pivot++ = temp;
              xsize--;
            } while (xsize != 0);
          }
          l -= size;
          pivot -= size;
        };
        s1 = ((l - b) / size) - 1;
        s2 = n - s1 - 1;
        if (s1 > s2) {
          if (s2 > 10) {
            (basestack[stackpointer] = (void *)(b), sizestack[stackpointer++] = (s1));
            b = l;
            n = s2;
          } else if (s1 > 10)
            n = s1;
          else
            break;
        } else {
          if (s1 > 10) {
            (basestack[stackpointer] = (void *)(l), sizestack[stackpointer++] = (s2));
            n = s1;
          } else if (s2 > 10) {
            b = l;
            n = s2;
          } else
            break;
        }
      }
    }
  }
}
```