user: 请将以下的汇编代码转换成C语言代码:

```asm
<LMSsort2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8,-0x48(%rbp)
  mov    %r9d,-0x4c(%rbp)
  mov    -0x38(%rbp),%rax
  cmp    -0x40(%rbp),%rax
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x40(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    $0x0,%ecx
  mov    0x10(%rbp),%edx
  mov    %rax,%rdi
  call   <getBuckets@plt>
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x4,0x18(%rbp)
  jne    L155
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  jmp    L434
L155:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
L434:
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  subl   $0x1,-0x1c(%rbp)
  cmpl   $0x4,0x18(%rbp)
  jne    L367
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  jmp    L293
L367:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
L293:
  cmp    -0x14(%rbp),%eax
  setl   %al
  movzbl %al,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x4c(%rbp),%eax
  add    %eax,-0x1c(%rbp)
  mov    -0x10(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L104
  mov    -0x1c(%rbp),%eax
  not    %eax
  mov    %eax,%edx
  jmp    L384
L104:
  mov    -0x1c(%rbp),%edx
L384:
  mov    -0x8(%rbp),%rax
  lea    0x4(%rax),%rcx
  mov    %rcx,-0x8(%rbp)
  mov    %edx,(%rax)
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L328
L145:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jle    L255
  mov    -0x4c(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jg     L134
  addl   $0x1,-0x18(%rbp)
  mov    -0x4c(%rbp),%eax
  sub    %eax,-0x1c(%rbp)
L134:
  cmpl   $0x4,0x18(%rbp)
  jne    L41
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  jmp    L275
L41:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
L275:
  cmpl   $0x4,0x18(%rbp)
  jne    L222
  mov    -0x1c(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  jmp    L194
L222:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x1(%rax),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
L194:
  cmp    %eax,%edx
  setge  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpl   $0x4,0x18(%rbp)
  jne    L352
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  jmp    L271
L352:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
L271:
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  je     L277
  mov    -0x8(%rbp),%rax
  sub    -0x30(%rbp),%rax
  sar    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  mov    %edx,(%rax)
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
L277:
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  sub    -0x30(%rbp),%rax
  sar    $0x2,%rax
  cmp    %rax,%rdx
  setl   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  subl   $0x1,-0x1c(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  lea    (%rax,%rax,1),%ecx
  cmpl   $0x4,0x18(%rbp)
  jne    L37
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  jmp    L428
L37:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
L428:
  cmp    -0x14(%rbp),%eax
  setl   %al
  movzbl %al,%eax
  or     %ecx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x18(%rbp)
  je     L402
  mov    -0x4c(%rbp),%eax
  add    %eax,-0x1c(%rbp)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%eax
  mov    %eax,(%rdx)
L402:
  mov    -0x10(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L349
  mov    -0x1c(%rbp),%eax
  not    %eax
  mov    %eax,%edx
  jmp    L34
L349:
  mov    -0x1c(%rbp),%edx
L34:
  mov    -0x8(%rbp),%rax
  lea    0x4(%rax),%rcx
  mov    %rcx,-0x8(%rbp)
  mov    %edx,(%rax)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  jmp    L29
L255:
  cmpl   $0x0,-0x1c(%rbp)
  jns    L29
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    -0x1c(%rbp),%edx
  not    %edx
  mov    %edx,(%rax)
L29:
  addl   $0x1,-0x20(%rbp)
L328:
  mov    -0x20(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L145
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L174
L457:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jle    L394
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4c(%rbp)
  jle    L394
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    -0x4c(%rbp),%edx
  add    %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x20(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L88
L91:
  subl   $0x1,-0x1c(%rbp)
L88:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4c(%rbp)
  jg     L91
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  sub    -0x4c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x20(%rbp)
L394:
  subl   $0x1,-0x20(%rbp)
L174:
  cmpl   $0x0,-0x20(%rbp)
  jns    L457
  mov    -0x40(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    $0x1,%ecx
  mov    0x10(%rbp),%edx
  mov    %rax,%rdi
  call   <getBuckets@plt>
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x20(%rbp)
  addl   $0x1,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  jmp    L237
L16:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jle    L58
  mov    -0x4c(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jg     L350
  addl   $0x1,-0x18(%rbp)
  mov    -0x4c(%rbp),%eax
  sub    %eax,-0x1c(%rbp)
L350:
  cmpl   $0x4,0x18(%rbp)
  jne    L235
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  jmp    L241
L235:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
L241:
  cmpl   $0x4,0x18(%rbp)
  jne    L137
  mov    -0x1c(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  jmp    L323
L137:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x1(%rax),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
L323:
  cmp    %eax,%edx
  setle  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpl   $0x4,0x18(%rbp)
  jne    L156
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  jmp    L340
L156:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
L340:
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  je     L315
  mov    -0x8(%rbp),%rax
  sub    -0x30(%rbp),%rax
  sar    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  mov    %edx,(%rax)
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
L315:
  mov    -0x8(%rbp),%rax
  sub    -0x30(%rbp),%rax
  sar    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x20(%rbp),%eax
  cltq
  cmp    %rax,%rdx
  setle  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  subl   $0x1,-0x1c(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  lea    (%rax,%rax,1),%ecx
  cmpl   $0x4,0x18(%rbp)
  jne    L112
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  jmp    L279
L112:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
L279:
  cmp    -0x14(%rbp),%eax
  setg   %al
  movzbl %al,%eax
  or     %ecx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x18(%rbp)
  je     L433
  mov    -0x4c(%rbp),%eax
  add    %eax,-0x1c(%rbp)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%eax
  mov    %eax,(%rdx)
L433:
  mov    -0x10(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L331
  mov    $0xfffffffe,%eax
  sub    -0x1c(%rbp),%eax
  jmp    L4
L331:
  mov    -0x1c(%rbp),%eax
L4:
  subq   $0x4,-0x8(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    %eax,(%rdx)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
L58:
  subl   $0x1,-0x20(%rbp)
L237:
  cmpl   $0x0,-0x20(%rbp)
  jns    L16
  nop
  nop
  leave
  ret
```

assistant: ```c
void LMSsort2(const void *T, off_t *SA, off_t *C, off_t *B, off_t *D, off_t n, off_t k, int cs) {
  off_t *b, i, j, t, d;
  off_t c0, c1;
  assert(C != B);
  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;
  t = ((cs == sizeof(off_t) ? ((off_t *)T)[(j)] : ((unsigned char *)T)[(j)]) < c1);
  j += n;
  *b++ = (t & 1) ? ~j : j;
  for (i = 0, d = 0; i < n; ++i) {
    if (0 < (j = SA[i])) {
      if (n <= j) {
        d += 1;
        j -= n;
      }
      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;
      t = c0;
      t = (t << 1) | ((cs == sizeof(off_t) ? ((off_t *)T)[(j)] : ((unsigned char *)T)[(j)]) < c1);
      if (D[t] != d) {
        j += n;
        D[t] = d;
      }
      *b++ = (t & 1) ? ~j : j;
      SA[i] = 0;
    } else if (j < 0) {
      SA[i] = ~j;
    }
  }
  for (i = n - 1; 0 <= i; --i) {
    if (0 < SA[i]) {
      if (SA[i] < n) {
        SA[i] += n;
        for (j = i - 1; SA[j] < n; --j) {
        }
        SA[j] -= n;
        i = j;
      }
    }
  }
  getBuckets(C, B, k, 1);
  for (i = n - 1, d += 1, b = SA + B[c1 = 0]; 0 <= i; --i) {
    if (0 < (j = SA[i])) {
      if (n <= j) {
        d += 1;
        j -= n;
      }
      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;
      t = c0;
      t = (t << 1) | ((cs == sizeof(off_t) ? ((off_t *)T)[(j)] : ((unsigned char *)T)[(j)]) > c1);
      if (D[t] != d) {
        j += n;
        D[t] = d;
      }
      *--b = (t & 1) ? ~(j + 1) : j;
      SA[i] = 0;
    }
  }
}
```