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

```asm
<LMSsort1>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x48,%rsp
  mov    %rdx,0x20(%rsp)
  mov    %r8d,0x2c(%rsp)
  mov    %r9d,0x30(%rsp)
  cmp    %rcx,%rdx
  je     L122
L66:
  mov    0x30(%rsp),%edx
  mov    0x20(%rsp),%rdi
  xor    %ecx,%ecx
  mov    %r12,%rsi
  call   <getBuckets@plt>
  mov    0x2c(%rsp),%ecx
  cmpl   $0x4,0x80(%rsp)
  lea    -0x1(%rcx),%eax
  mov    %eax,0x34(%rsp)
  movslq %eax,%r13
  lea    -0x2(%rcx),%eax
  movslq %eax,%rcx
  je     L215
  movzbl 0x0(%rbp,%r13,1),%r10d
  movzbl 0x0(%rbp,%rcx,1),%esi
  movslq (%r12,%r10,4),%rdx
  lea    (%rbx,%rdx,4),%rdx
L0:
  mov    %eax,%ecx
  cmp    %r10d,%esi
  movslq 0x2c(%rsp),%rdi
  not    %ecx
  cmovl  %ecx,%eax
  mov    %rdi,0x10(%rsp)
  lea    0x4(%rdx),%rcx
  xor    %r15d,%r15d
  mov    %eax,(%rdx)
  test   %edi,%edi
  jle    L42
  mov    %r13,0x38(%rsp)
  mov    %rcx,%r13
  mov    %r12,0x18(%rsp)
  mov    %rbx,%r12
  mov    %r10d,%ebx
  jmp    L24
  nopl   0x0(%rax,%rax,1)
L115:
  cmpl   $0x4,0x80(%rsp)
  movslq %r14d,%rax
  je     L150
  lea    0x0(%rbp,%rax,1),%rsi
  movzbl 0x1(%rbp,%rax,1),%eax
  cmp    %al,(%rsi)
  mov    %rsi,(%rsp)
  setae  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    (%rsp),%rsi
  movzbl (%rsi),%r9d
L78:
  mov    %r13,%rsi
  cmp    %ebx,%r9d
  je     L149
  mov    0x18(%rsp),%rdx
  sub    %r12,%rsi
  movslq %ebx,%r10
  movslq %r9d,%rax
  sar    $0x2,%rsi
  mov    %esi,(%rdx,%r10,4)
  movslq (%rdx,%rax,4),%rax
  lea    (%r12,%rax,4),%rsi
L149:
  mov    %rsi,%rax
  xor    %edi,%edi
  mov    %r9d,0x8(%rsp)
  sub    %r12,%rax
  mov    %rsi,(%rsp)
  sar    $0x2,%rax
  cmp    %r15,%rax
  setg   %dil
  call   <assert@plt>
  lea    -0x1(%r14),%eax
  mov    (%rsp),%rsi
  cmpl   $0x4,0x80(%rsp)
  mov    0x8(%rsp),%r9d
  movslq %eax,%rcx
  je     L37
  movzbl 0x0(%rbp,%rcx,1),%ecx
L188:
  neg    %r14d
  cmp    %ecx,%r9d
  lea    0x4(%rsi),%r13
  mov    %r9d,%ebx
  cmovg  %r14d,%eax
  mov    %eax,(%rsi)
  movl   $0x0,(%r12,%r15,4)
L46:
  add    $0x1,%r15
  cmp    %r15,0x10(%rsp)
  je     L75
L24:
  mov    (%r12,%r15,4),%r14d
  test   %r14d,%r14d
  jg     L115
  je     L46
  not    %r14d
  mov    %r14d,(%r12,%r15,4)
  add    $0x1,%r15
  cmp    %r15,0x10(%rsp)
  jne    L24
L75:
  mov    %r12,%rbx
  mov    0x38(%rsp),%r13
  mov    0x18(%rsp),%r12
L42:
  cmp    %r12,0x20(%rsp)
  je     L227
L173:
  mov    0x30(%rsp),%edx
  mov    0x20(%rsp),%rdi
  mov    %r12,%rsi
  xor    %r14d,%r14d
  mov    $0x1,%ecx
  call   <getBuckets@plt>
  movslq (%r12),%rax
  lea    (%rbx,%rax,4),%r8
  mov    0x34(%rsp),%eax
  test   %eax,%eax
  js     L233
  mov    %r12,0x8(%rsp)
  mov    %r14d,%r12d
  mov    %r8,(%rsp)
  jmp    L17
  nopl   (%rax)
L29:
  lea    0x0(%rbp,%rax,1),%r14
  xor    %edi,%edi
  movzbl 0x1(%rbp,%rax,1),%eax
  cmp    %al,(%r14)
  setbe  %dil
  call   <assert@plt>
  movzbl (%r14),%esi
L27:
  mov    (%rsp),%r14
  cmp    %r12d,%esi
  je     L93
  mov    0x8(%rsp),%rdx
  sub    %rbx,%r14
  movslq %r12d,%rcx
  movslq %esi,%rax
  sar    $0x2,%r14
  mov    %r14d,(%rdx,%rcx,4)
  movslq (%rdx,%rax,4),%rax
  lea    (%rbx,%rax,4),%r14
L93:
  mov    %r14,%rax
  xor    %edi,%edi
  mov    %esi,(%rsp)
  sub    %rbx,%rax
  sar    $0x2,%rax
  cmp    %r13,%rax
  setle  %dil
  call   <assert@plt>
  lea    -0x1(%r15),%eax
  cmpl   $0x4,0x80(%rsp)
  mov    (%rsp),%esi
  movslq %eax,%rcx
  je     L214
  movzbl 0x0(%rbp,%rcx,1),%edi
L10:
  mov    $0xfffffffe,%ecx
  lea    -0x4(%r14),%rdx
  mov    %esi,%r12d
  sub    %eax,%ecx
  cmp    %edi,%esi
  mov    %rdx,(%rsp)
  cmovl  %ecx,%eax
  mov    %eax,-0x4(%r14)
  movl   $0x0,(%rbx,%r13,4)
L19:
  sub    $0x1,%r13
  test   %r13d,%r13d
  js     L233
L17:
  mov    (%rbx,%r13,4),%r15d
  test   %r15d,%r15d
  jle    L19
  cmpl   $0x4,0x80(%rsp)
  movslq %r15d,%rax
  jne    L29
  shl    $0x2,%rax
  xor    %edi,%edi
  lea    0x0(%rbp,%rax,1),%r14
  mov    0x4(%rbp,%rax,1),%eax
  cmp    %eax,(%r14)
  setle  %dil
  call   <assert@plt>
  mov    (%r14),%esi
  jmp    L27
  nopl   0x0(%rax,%rax,1)
L150:
  shl    $0x2,%rax
  lea    0x0(%rbp,%rax,1),%rsi
  mov    0x4(%rbp,%rax,1),%eax
  cmp    %eax,(%rsi)
  mov    %rsi,(%rsp)
  setge  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    (%rsp),%rsi
  mov    (%rsi),%r9d
  jmp    L78
  nopl   0x0(%rax)
L37:
  mov    0x0(%rbp,%rcx,4),%ecx
  jmp    L188
  nopl   0x0(%rax)
L214:
  mov    0x0(%rbp,%rcx,4),%edi
  jmp    L10
  nopl   0x0(%rax)
L233:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L215:
  movslq 0x0(%rbp,%r13,4),%rdx
  mov    -0x4(%rbp,%r13,4),%esi
  mov    %rdx,%r10
  movslq (%r12,%rdx,4),%rdx
  lea    (%rbx,%rdx,4),%rdx
  jmp    L0
  nopw   0x0(%rax,%rax,1)
L122:
  mov    %r8d,%edx
  mov    0x20(%rsp),%rsi
  mov    0x80(%rsp),%r8d
  mov    %r9d,%ecx
  call   <getCounts@plt>
  jmp    L66
  nopl   (%rax)
L227:
  mov    0x80(%rsp),%r8d
  mov    0x30(%rsp),%ecx
  mov    %rbp,%rdi
  mov    0x2c(%rsp),%edx
  mov    0x20(%rsp),%rsi
  call   <getCounts@plt>
  jmp    L173
```

assistant: ```c
void LMSsort1(const void *T, off_t *SA, off_t *C, off_t *B, off_t n, off_t k, int cs) {
  off_t *b, i, j;
  off_t c0, c1;
  if (C == B) {
    getCounts(T, C, n, k, cs);
  }
  getBuckets(C, B, k, 0);
  j = n - 1;
  b = SA + B[c1 = (cs == sizeof(off_t) ? ((off_t *)T)[(j)] : ((unsigned char *)T)[(j)])];
  --j;
  *b++ = ((cs == sizeof(off_t) ? ((off_t *)T)[(j)] : ((unsigned char *)T)[(j)]) < c1) ? ~j : j;
  for (i = 0; i < n; ++i) {
    if (0 < (j = SA[i])) {
      assert((cs == sizeof(off_t) ? ((off_t *)T)[(j)] : ((unsigned char *)T)[(j)]) >= (cs == sizeof(off_t) ? ((off_t *)T)[(j + 1)] : ((unsigned char *)T)[(j + 1)]));
      if ((c0 = (cs == sizeof(off_t) ? ((off_t *)T)[(j)] : ((unsigned char *)T)[(j)])) != c1) {
        B[c1] = b - SA;
        b = SA + B[c1 = c0];
      }
      assert(i < (b - SA));
      --j;
      *b++ = ((cs == sizeof(off_t) ? ((off_t *)T)[(j)] : ((unsigned char *)T)[(j)]) < c1) ? ~j : j;
      SA[i] = 0;
    } else if (j < 0) {
      SA[i] = ~j;
    }
  }
  if (C == B) {
    getCounts(T, C, n, k, cs);
  }
  getBuckets(C, B, k, 1);
  for (i = n - 1, b = SA + B[c1 = 0]; 0 <= i; --i) {
    if (0 < (j = SA[i])) {
      assert((cs == sizeof(off_t) ? ((off_t *)T)[(j)] : ((unsigned char *)T)[(j)]) <= (cs == sizeof(off_t) ? ((off_t *)T)[(j + 1)] : ((unsigned char *)T)[(j + 1)]));
      if ((c0 = (cs == sizeof(off_t) ? ((off_t *)T)[(j)] : ((unsigned char *)T)[(j)])) != c1) {
        B[c1] = b - SA;
        b = SA + B[c1 = c0];
      }
      assert((b - SA) <= i);
      --j;
      *--b = ((cs == sizeof(off_t) ? ((off_t *)T)[(j)] : ((unsigned char *)T)[(j)]) > c1) ? ~(j + 1) : j;
      SA[i] = 0;
    }
  }
}
```