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

```asm
<kasai_lcp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %ecx,-0x4c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rsi
  mov    -0x4c(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x18(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  movslq %eax,%rdx
  mov    %rdx,%r8
  mov    $0x0,%r9d
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L128:
  cmp    %rdx,%rsp
  je     L69
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L128
L69:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L96
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L96:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L124
L129:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x10(%rbp),%rax
  movslq %edx,%rdx
  mov    -0x24(%rbp),%ecx
  mov    %ecx,(%rax,%rdx,4)
  addl   $0x1,-0x24(%rbp)
L124:
  mov    -0x24(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L129
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L74
L88:
  mov    -0x10(%rbp),%rax
  mov    -0x24(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  mov    -0x4c(%rbp),%edx
  sub    $0x1,%edx
  cmp    %edx,%eax
  jne    L102
  movl   $0x0,-0x20(%rbp)
  jmp    L144
L102:
  mov    -0x10(%rbp),%rax
  mov    -0x24(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L125
L82:
  addl   $0x1,-0x20(%rbp)
L125:
  mov    -0x24(%rbp),%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jle    L28
  mov    -0x1c(%rbp),%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jle    L28
  mov    -0x24(%rbp),%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x1c(%rbp),%ecx
  mov    -0x20(%rbp),%eax
  add    %ecx,%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  je     L82
L28:
  mov    -0x10(%rbp),%rax
  mov    -0x24(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rax,%rdx,4),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rax,%rdx
  mov    -0x20(%rbp),%eax
  mov    %eax,(%rdx)
  cmpl   $0x0,-0x20(%rbp)
  jle    L144
  subl   $0x1,-0x20(%rbp)
L144:
  addl   $0x1,-0x24(%rbp)
L74:
  mov    -0x24(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L88
  nop
  mov    %rsi,%rsp
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L45
  call   <__stack_chk_fail@plt>
L45:
  leave
  ret
```

assistant: ```c
void kasai_lcp(char *text, int *lcp, int *suffArr, int n) {
  int i;
  int invSuff[n];
  for (i = 0; i < n; i++) {
    invSuff[suffArr[i]] = i;
  }
  int k = 0;
  for (i = 0; i < n; i++) {
    if (invSuff[i] == n - 1) {
      k = 0;
      continue;
    }
    int j = suffArr[invSuff[i] + 1];
    while (i + k < n && j + k < n && text[i + k] == text[j + k]) {
      k++;
    }
    lcp[invSuff[i]] = k;
    if (k > 0) {
      k--;
    }
  }
  return;
}
```