user: 请从给定的汇编指令推导出C源代码：

```asm
<tr_partialcopy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8,-0x58(%rbp)
  mov    %r9,-0x60(%rbp)
  movl   $0xffffffff,-0x28(%rbp)
  mov    -0x58(%rbp),%rax
  sub    -0x40(%rbp),%rax
  sar    $0x2,%rax
  sub    $0x1,%eax
  mov    %eax,-0x24(%rbp)
  movl   $0xffffffff,-0x2c(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x50(%rbp),%rax
  sub    $0x4,%rax
  mov    %rax,-0x10(%rbp)
  jmp    L99
L10:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  sub    0x10(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  cmpl   $0x0,-0x20(%rbp)
  js     L19
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x24(%rbp)
  jne    L19
  addq   $0x4,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  mov    -0x20(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x20(%rbp),%edx
  mov    0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x2c(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  je     L3
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x10(%rbp),%rax
  sub    -0x40(%rbp),%rax
  sar    $0x2,%rax
  mov    %eax,-0x28(%rbp)
L3:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%eax
  mov    %eax,(%rdx)
L19:
  addq   $0x4,-0x18(%rbp)
L99:
  mov    -0x18(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  jbe    L10
  movl   $0xffffffff,-0x2c(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L89
L86:
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x2c(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  je     L124
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x8(%rbp),%rax
  sub    -0x40(%rbp),%rax
  sar    $0x2,%rax
  mov    %eax,-0x28(%rbp)
L124:
  mov    -0x28(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  je     L84
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%eax
  mov    %eax,(%rdx)
L84:
  subq   $0x4,-0x8(%rbp)
L89:
  mov    -0x48(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jbe    L86
  movl   $0xffffffff,-0x2c(%rbp)
  mov    -0x60(%rbp),%rax
  sub    $0x4,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x10(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L130
L23:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  sub    0x10(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  cmpl   $0x0,-0x20(%rbp)
  js     L35
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x24(%rbp)
  jne    L35
  subq   $0x4,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  mov    -0x20(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x20(%rbp),%edx
  mov    0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x2c(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  je     L37
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x10(%rbp),%rax
  sub    -0x40(%rbp),%rax
  sar    $0x2,%rax
  mov    %eax,-0x28(%rbp)
L37:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%eax
  mov    %eax,(%rdx)
L35:
  subq   $0x4,-0x18(%rbp)
L130:
  mov    -0x8(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  jb     L23
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void tr_partialcopy(int *ISA, const int *SA, int *first, int *a, int *b, int *last, int depth) {
  int *c, *d, *e;
  int s, v;
  int rank, lastrank, newrank = -1;
  v = b - SA - 1;
  lastrank = -1;
  for (c = first, d = a - 1; c <= d; ++c) {
    if ((0 <= (s = *c - depth)) && (ISA[s] == v)) {
      *++d = s;
      rank = ISA[s + depth];
      if (lastrank != rank) {
        lastrank = rank;
        newrank = d - SA;
      }
      ISA[s] = newrank;
    }
  }
  lastrank = -1;
  for (e = d; first <= e; --e) {
    rank = ISA[*e];
    if (lastrank != rank) {
      lastrank = rank;
      newrank = e - SA;
    }
    if (newrank != rank) {
      ISA[*e] = newrank;
    }
  }
  lastrank = -1;
  for (c = last - 1, e = d + 1, d = b; e < d; --c) {
    if ((0 <= (s = *c - depth)) && (ISA[s] == v)) {
      *--d = s;
      rank = ISA[s + depth];
      if (lastrank != rank) {
        lastrank = rank;
        newrank = d - SA;
      }
      ISA[s] = newrank;
    }
  }
}
```