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

```asm
<qst>:
  endbr64
  push   %r15
  movslq %ecx,%rax
  mov    %esi,%r10d
  push   %r14
  sub    %edi,%r10d
  push   %r13
  push   %r12
  mov    %rax,%r12
  push   %rbp
  neg    %r12
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x48,%rsp
  mov    %rsi,0x28(%rsp)
  sub    %rax,%rsi
  mov    %rax,0x8(%rsp)
  lea    -0x1(%rax),%eax
  mov    %rdi,0x18(%rsp)
  mov    %ecx,0x34(%rsp)
  mov    %r8d,0x30(%rsp)
  mov    %r9d,0x38(%rsp)
  mov    %rsi,0x20(%rsp)
  mov    %eax,0x14(%rsp)
L7:
  mov    0x34(%rsp),%edi
  mov    %r10d,%eax
  mov    0x20(%rsp),%r15
  cltd
  idiv   %edi
  sar    %eax
  mov    %eax,%ecx
  mov    0x18(%rsp),%rax
  imul   %edi,%ecx
  movslq %ecx,%rcx
  lea    (%rax,%rcx,1),%r14
  cmp    0x38(%rsp),%r10d
  jl     L317
  mov    0x18(%rsp),%rdi
  mov    %r14,%rsi
  call   *%rbx
  test   %eax,%eax
  jle    L117
  mov    0x18(%rsp),%rbp
  mov    0x20(%rsp),%rsi
  mov    %rbp,%rdi
  call   *%rbx
  test   %eax,%eax
  jg     L126
  mov    %rbp,%rax
L288:
  cmp    %r14,%rax
  jne    L17
L317:
  mov    0x18(%rsp),%rbp
  cmp    %r14,%rbp
  jb     L120
  nopl   0x0(%rax,%rax,1)
L299:
  mov    %r15,%r13
  cmp    %r14,%r15
  jbe    L0
L262:
  mov    %r15,%r13
L298:
  mov    %r13,%rsi
  mov    %r14,%rdi
  call   *%rbx
  test   %eax,%eax
  jg     L269
  add    %r12,%r13
  cmp    %r13,%r14
  jb     L298
L0:
  cmp    %r14,%rbp
  je     L107
L193:
  lea    0x0(%r13,%r12,1),%r15
  mov    %rbp,%rsi
  mov    %r14,%r13
  mov    %rbp,%r14
  cs nopw 0x0(%rax,%rax,1)
L12:
  mov    0x14(%rsp),%eax
  lea    0x1(%rbp,%rax,1),%rcx
  nopl   0x0(%rax)
L121:
  movzbl 0x0(%rbp),%eax
  movzbl 0x0(%r13),%edx
  add    $0x1,%rbp
  add    $0x1,%r13
  mov    %dl,-0x1(%rbp)
  mov    %al,-0x1(%r13)
  cmp    %rcx,%rbp
  jne    L121
  mov    %rsi,%rbp
L86:
  cmp    %r14,%rbp
  jae    L299
L120:
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L182
  mov    %r15,%r13
  cmp    %r14,%r15
  ja     L262
  jmp    L193
  nop
L269:
  mov    0x8(%rsp),%rax
  lea    0x0(%r13,%r12,1),%r15
  lea    0x0(%rbp,%rax,1),%rsi
  cmp    %r14,%rbp
  jne    L12
  mov    %r13,%r14
  mov    %r13,%r15
  jmp    L12
  nopl   0x0(%rax)
L182:
  mov    0x8(%rsp),%rax
  lea    0x0(%rbp,%rax,1),%rsi
  mov    %rsi,%rbp
  jmp    L86
L107:
  mov    0x8(%rsp),%rax
  mov    0x28(%rsp),%r15
  mov    %rbp,%rdx
  sub    0x18(%rsp),%rdx
  lea    0x0(%rbp,%rax,1),%r14
  mov    %edx,%r10d
  sub    %r14,%r15
  cmp    %r15d,%edx
  jg     L204
  cmp    0x30(%rsp),%edx
  jge    L201
  mov    %r14,0x18(%rsp)
  mov    %r15d,%r10d
  cmp    0x30(%rsp),%r10d
  jl     L2
L187:
  mov    0x28(%rsp),%rax
  add    %r12,%rax
  mov    %rax,0x20(%rsp)
  jmp    L7
L204:
  cmp    0x30(%rsp),%r15d
  jge    L57
  mov    %rbp,0x28(%rsp)
  cmp    0x30(%rsp),%r10d
  jge    L187
L2:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L117:
  mov    0x20(%rsp),%rsi
  mov    %r14,%rdi
  call   *%rbx
  test   %eax,%eax
  jle    L317
  cmp    %r14,0x18(%rsp)
  je     L126
  mov    0x18(%rsp),%rbp
  mov    0x20(%rsp),%r13
  mov    %rbp,%rdi
  mov    %r13,%rsi
  call   *%rbx
  mov    %eax,%r9d
  mov    %rbp,%rax
  test   %r9d,%r9d
  js     L301
L17:
  mov    0x14(%rsp),%edx
  lea    0x1(%r14,%rdx,1),%r9
  mov    %r14,%rdx
L87:
  movzbl (%rdx),%ecx
  movzbl (%rax),%esi
  add    $0x1,%rdx
  add    $0x1,%rax
  mov    %sil,-0x1(%rdx)
  mov    %cl,-0x1(%rax)
  cmp    %r9,%rdx
  jne    L87
  jmp    L317
L201:
  mov    0x38(%rsp),%r9d
  mov    0x30(%rsp),%r8d
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  mov    0x34(%rsp),%ecx
  mov    0x18(%rsp),%rdi
  call   <qst>
  mov    %r14,0x18(%rsp)
  mov    %r15d,%r10d
  jmp    L7
L57:
  mov    0x38(%rsp),%r9d
  mov    0x34(%rsp),%ecx
  mov    %edx,0x3c(%rsp)
  mov    %r14,%rdi
  mov    0x30(%rsp),%r8d
  mov    0x28(%rsp),%rsi
  mov    %rbx,%rdx
  call   <qst>
  mov    %rbp,%rax
  mov    %rbp,0x28(%rsp)
  mov    0x3c(%rsp),%r10d
  add    %r12,%rax
  mov    %rax,0x20(%rsp)
  jmp    L7
L301:
  mov    %r13,%rax
  jmp    L288
L126:
  mov    0x20(%rsp),%rsi
  mov    %r14,%rdi
  call   *%rbx
  test   %eax,%eax
  jns    L317
  mov    0x20(%rsp),%rax
  jmp    L288
```

assistant: ```c
void qst(char *base, char *max, int (*qcmp)(void *, void *), int qsz, int thresh, int mthresh) {
  register char c, *i, *j, *jj;
  register int ii;
  char *mid, *tmp;
  int lo, hi;
  lo = max - base;
  do {
    mid = i = base + qsz * ((lo / qsz) >> 1);
    if (lo >= mthresh) {
      j = (qcmp((jj = base), i) > 0 ? jj : i);
      if (qcmp(j, (tmp = max - qsz)) > 0) {
        j = (j == jj ? i : jj);
        if (qcmp(j, tmp) < 0)
          j = tmp;
      }
      if (j != i) {
        ii = qsz;
        do {
          c = *i;
          *i++ = *j;
          *j++ = c;
        } while (--ii);
      }
    }
    for (i = base, j = max - qsz;;) {
      while (i < mid && qcmp(i, mid) <= 0)
        i += qsz;
      while (j > mid) {
        if (qcmp(mid, j) <= 0) {
          j -= qsz;
          continue;
        }
        tmp = i + qsz;
        if (i == mid) {
          mid = jj = j;
        } else {
          jj = j;
          j -= qsz;
        }
        goto swap;
      }
      if (i == mid) {
        break;
      } else {
        jj = mid;
        tmp = mid = i;
        j -= qsz;
      }
    swap:
      ii = qsz;
      do {
        c = *i;
        *i++ = *jj;
        *jj++ = c;
      } while (--ii);
      i = tmp;
    }
    i = (j = mid) + qsz;
    if ((lo = j - base) <= (hi = max - i)) {
      if (lo >= thresh)
        qst(base, j, qcmp, qsz, thresh, mthresh);
      base = i;
      lo = hi;
    } else {
      if (hi >= thresh)
        qst(i, max, qcmp, qsz, thresh, mthresh);
      max = j;
    }
  } while (lo >= thresh);
}
```