user: Translate the below assembly code into C programming language:

```asm
<LMSpostproc1>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  xor    %edi,%edi
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x38,%rsp
  test   %edx,%edx
  setg   %dil
  mov    %r8d,0xc(%rsp)
  call   <assert@plt>
  mov    (%rbx),%eax
  test   %eax,%eax
  jns    L185
  mov    %rbx,%r15
  xor    %r14d,%r14d
  nop
L356:
  not    %eax
  add    $0x1,%r14d
  xor    %edi,%edi
  mov    %eax,(%r15)
  cmp    %ebp,%r14d
  setl   %dil
  add    $0x4,%r15
  call   <assert@plt>
  mov    (%r15),%eax
  test   %eax,%eax
  js     L356
L370:
  cmp    %r14d,%r12d
  jle    L328
  lea    0x1(%r14),%eax
  mov    %r13,0x10(%rsp)
  movslq %eax,%r15
  mov    %r15,%r13
  mov    %eax,%r15d
  jmp    L354
  nopl   0x0(%rax,%rax,1)
L261:
  add    $0x1,%r13
L354:
  xor    %edi,%edi
  cmp    %r13d,%ebp
  setg   %dil
  call   <assert@plt>
  mov    (%rbx,%r13,4),%eax
  test   %eax,%eax
  jns    L261
  movslq %r14d,%r14
  not    %eax
  mov    %eax,(%rbx,%r14,4)
  movl   $0x0,(%rbx,%r13,4)
  cmp    %r15d,%r12d
  je     L148
  mov    %r15d,%r14d
  add    $0x1,%r15d
  jmp    L261
L148:
  mov    0x10(%rsp),%r13
L328:
  cmpl   $0x4,0xc(%rsp)
  lea    -0x1(%rbp),%r8d
  movslq %ebp,%rax
  je     L249
  movzbl -0x1(%r13,%rax,1),%esi
  lea    -0x2(%rbp),%eax
  cltq
  jmp    L128
  nopl   (%rax)
L494:
  movzbl 0x0(%r13,%rax,1),%edx
  sub    $0x1,%rax
  cmp    %esi,%edx
  jl     L59
  mov    %edx,%esi
L128:
  mov    %eax,%ecx
  test   %eax,%eax
  jns    L494
  nopw   0x0(%rax,%rax,1)
L74:
  xor    %r8d,%r8d
  test   %r12d,%r12d
  jle    L277
  lea    -0x1(%r12),%edx
  mov    %rbx,%rax
  mov    %ebp,%r15d
  xor    %r8d,%r8d
  lea    0x4(%rbx,%rdx,4),%r10
  xor    %edx,%edx
  jmp    L136
  nopl   0x0(%rax,%rax,1)
L419:
  add    $0x1,%r8d
  add    $0x4,%rax
  mov    %r9d,%edx
  mov    %esi,%r15d
  mov    %r8d,(%rdi)
  cmp    %rax,%r10
  je     L277
L136:
  mov    (%rax),%esi
  mov    %esi,%ecx
  sar    %ecx
  add    %r12d,%ecx
  movslq %ecx,%rcx
  lea    (%rbx,%rcx,4),%rdi
  mov    (%rdi),%r9d
  cmp    %edx,%r9d
  jne    L419
  lea    (%r15,%rdx,1),%ecx
  cmp    %ebp,%ecx
  jge    L419
  test   %edx,%edx
  jle    L323
  cmpl   $0x4,0xc(%rsp)
  lea    0x1(%rdx),%ecx
  je     L159
  movslq %r15d,%r11
  mov    %rcx,0x10(%rsp)
  movslq %esi,%r14
  mov    $0x1,%ecx
  mov    %r15d,0x18(%rsp)
  add    %r13,%r11
  mov    0x10(%rsp),%r15
  add    %r13,%r14
  mov    %edx,0x20(%rsp)
  mov    %r11,%rdx
  nop
L287:
  movzbl -0x1(%rcx,%r14,1),%r11d
  cmp    %r11b,-0x1(%rcx,%rdx,1)
  jne    L419
  mov    %ecx,%r11d
  add    $0x1,%rcx
  cmp    %rcx,%r15
  jne    L287
  mov    0x18(%rsp),%r15d
  mov    0x20(%rsp),%edx
L414:
  cmp    %edx,%r11d
  jne    L419
  add    $0x4,%rax
  mov    %r8d,(%rdi)
  cmp    %rax,%r10
  jne    L136
L277:
  add    $0x38,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L418:
  mov    %eax,%r8d
L59:
  movslq %ecx,%rax
  cmpl   $0x4,0xc(%rsp)
  lea    -0x1(%r13,%rax,1),%rdi
  jne    L301
  jmp    L493
  nopl   (%rax)
L134:
  movzbl (%rdi),%esi
  sub    $0x1,%rdi
  cmp    %edx,%esi
  jg     L330
  mov    %esi,%edx
L301:
  mov    %ecx,%eax
  lea    -0x1(%rcx),%ecx
  test   %eax,%eax
  jne    L134
  jmp    L74
L493:
  lea    0x0(%r13,%rax,4),%rdi
  jmp    L290
  nopw   0x0(%rax,%rax,1)
L362:
  mov    -0x4(%rdi),%esi
  sub    $0x4,%rdi
  cmp    %esi,%edx
  jl     L369
  mov    %esi,%edx
L290:
  mov    %ecx,%eax
  lea    -0x1(%rcx),%ecx
  test   %eax,%eax
  jne    L362
  jmp    L74
  nop
L330:
  mov    %eax,%edx
  sub    %ecx,%r8d
  lea    -0x2(%rax),%edi
  sar    %edx
  movslq %edi,%rdi
  add    %r12d,%edx
  movslq %edx,%rdx
  mov    %r8d,(%rbx,%rdx,4)
  jmp    L429
  nopl   0x0(%rax)
L5:
  movzbl 0x0(%r13,%rdi,1),%edx
  sub    $0x1,%rdi
  cmp    %esi,%edx
  jl     L418
  mov    %edx,%esi
L429:
  mov    %edi,%ecx
  cmp    $0xffffffff,%edi
  jne    L5
  jmp    L74
L159:
  mov    %rcx,0x28(%rsp)
  movslq %esi,%rcx
  lea    0x0(%r13,%rcx,4),%r11
  mov    %r10,0x10(%rsp)
  mov    $0x1,%ecx
  mov    0x28(%rsp),%r10
  mov    %r11,0x20(%rsp)
  movslq %r15d,%r11
  mov    %rdi,0x18(%rsp)
  lea    0x0(%r13,%r11,4),%r14
  mov    0x20(%rsp),%rdi
  jmp    L73
  nopl   (%rax)
L311:
  mov    %ecx,%r11d
  add    $0x1,%rcx
  cmp    %r10,%rcx
  je     L286
L73:
  mov    -0x4(%r14,%rcx,4),%r11d
  cmp    %r11d,-0x4(%rdi,%rcx,4)
  je     L311
  mov    0x10(%rsp),%r10
  mov    0x18(%rsp),%rdi
  jmp    L419
L249:
  mov    -0x4(%r13,%rax,4),%esi
  lea    -0x2(%rbp),%eax
  cltq
  jmp    L288
  nop
L182:
  sub    $0x1,%rax
  mov    0x4(%r13,%rax,4),%edx
  cmp    %edx,%esi
  jg     L59
  mov    %edx,%esi
L288:
  mov    %eax,%ecx
  test   %eax,%eax
  jns    L182
  jmp    L74
  xchg   %ax,%ax
L369:
  mov    %eax,%edx
  sub    %ecx,%r8d
  lea    -0x2(%rax),%edi
  sar    %edx
  movslq %edi,%rdi
  add    %r12d,%edx
  movslq %edx,%rdx
  mov    %r8d,(%rbx,%rdx,4)
  jmp    L468
  nopl   0x0(%rax)
L334:
  sub    $0x1,%rdi
  mov    0x4(%r13,%rdi,4),%edx
  cmp    %edx,%esi
  jg     L418
  mov    %edx,%esi
L468:
  mov    %edi,%ecx
  cmp    $0xffffffff,%edi
  jne    L334
  jmp    L74
L185:
  xor    %r14d,%r14d
  jmp    L370
L286:
  mov    0x10(%rsp),%r10
  mov    0x18(%rsp),%rdi
  jmp    L414
L323:
  xor    %r11d,%r11d
  jmp    L414
```

assistant: ```c
int LMSpostproc1(const void *T, int *SA, int n, int m, int cs) {
  int i, j, p, q, plen, qlen, name;
  int c0, c1;
  int diff;
  assert(0 < n);
  for (i = 0; (p = SA[i]) < 0; ++i) {
    SA[i] = ~p;
    assert((i + 1) < n);
  }
  if (i < m) {
    for (j = i, ++i;; ++i) {
      assert(i < n);
      if ((p = SA[i]) < 0) {
        SA[j++] = ~p;
        SA[i] = 0;
        if (j == m) {
          break;
        }
      }
    }
  }
  i = n - 1;
  j = n - 1;
  c0 = (cs == sizeof(int) ? ((int *)T)[(n - 1)] : ((unsigned char *)T)[(n - 1)]);
  do {
    c1 = c0;
  } while ((0 <= --i) && ((c0 = (cs == sizeof(int) ? ((int *)T)[(i)] : ((unsigned char *)T)[(i)])) >= c1));
  for (; 0 <= i;) {
    do {
      c1 = c0;
    } while ((0 <= --i) && ((c0 = (cs == sizeof(int) ? ((int *)T)[(i)] : ((unsigned char *)T)[(i)])) <= c1));
    if (0 <= i) {
      SA[m + ((i + 1) >> 1)] = j - i;
      j = i + 1;
      do {
        c1 = c0;
      } while ((0 <= --i) && ((c0 = (cs == sizeof(int) ? ((int *)T)[(i)] : ((unsigned char *)T)[(i)])) >= c1));
    }
  }
  for (i = 0, name = 0, q = n, qlen = 0; i < m; ++i) {
    p = SA[i], plen = SA[m + (p >> 1)], diff = 1;
    if ((plen == qlen) && ((q + plen) < n)) {
      for (j = 0; (j < plen) && ((cs == sizeof(int) ? ((int *)T)[(p + j)] : ((unsigned char *)T)[(p + j)]) == (cs == sizeof(int) ? ((int *)T)[(q + j)] : ((unsigned char *)T)[(q + j)])); ++j) {
      }
      if (j == plen) {
        diff = 0;
      }
    }
    if (diff != 0) {
      ++name, q = p, qlen = plen;
    }
    SA[m + (p >> 1)] = name;
  }
  return name;
}
```