user: 这段汇编代码用C语言表示是什么样的：

```asm
<get_destroy_root>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x250,%rsp
  mov    %rdi,-0x248(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x230(%rbp),%rdx
  mov    -0x248(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stat@plt>
  test   %rax,%rax
  jns    L54
  mov    $0x0,%eax
  jmp    L103
L54:
  mov    -0x230(%rbp),%rax
  mov    %rax,-0x218(%rbp)
  mov    -0x248(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  movslq %eax,%rdx
  mov    -0x248(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x228(%rbp)
  mov    -0x228(%rbp),%rax
  mov    %rax,-0x220(%rbp)
  jmp    L188
L52:
  subq   $0x1,-0x228(%rbp)
L39:
  mov    -0x228(%rbp),%rax
  cmp    -0x248(%rbp),%rax
  jbe    L28
  mov    -0x228(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L52
  mov    -0x228(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L52
  jmp    L28
L115:
  subq   $0x1,-0x228(%rbp)
L28:
  mov    -0x228(%rbp),%rax
  cmp    -0x248(%rbp),%rax
  jbe    L48
  mov    -0x228(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L115
L48:
  mov    -0x228(%rbp),%rax
  cmp    -0x248(%rbp),%rax
  jbe    L98
  mov    -0x228(%rbp),%rax
  sub    -0x248(%rbp),%rax
  add    $0x1,%eax
  mov    %eax,-0x234(%rbp)
  mov    -0x234(%rbp),%edx
  mov    -0x248(%rbp),%rcx
  lea    -0x210(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x234(%rbp),%eax
  cltq
  movb   $0x0,-0x210(%rbp,%rax,1)
  lea    -0x230(%rbp),%rdx
  lea    -0x210(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stat@plt>
  test   %rax,%rax
  jns    L38
  mov    $0x0,%eax
  jmp    L103
L38:
  mov    -0x230(%rbp),%rax
  cmp    %rax,-0x218(%rbp)
  jne    L118
  mov    -0x228(%rbp),%rax
  mov    %rax,-0x220(%rbp)
L188:
  mov    -0x228(%rbp),%rax
  cmp    -0x248(%rbp),%rax
  ja     L39
  jmp    L110
L98:
  nop
  jmp    L110
L118:
  nop
L110:
  mov    -0x220(%rbp),%rax
  sub    -0x248(%rbp),%rax
  mov    %eax,-0x234(%rbp)
  cmpl   $0x0,-0x234(%rbp)
  je     L36
  mov    -0x234(%rbp),%edx
  mov    -0x248(%rbp),%rcx
  lea    -0x210(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x234(%rbp),%eax
  cltq
  movb   $0x0,-0x210(%rbp,%rax,1)
  lea    -0x210(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  jmp    L103
L36:
  mov    $0x0,%eax
L103:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L165
  call   <__stack_chk_fail@plt>
L165:
  leave
  ret
```

assistant: ```c
char *get_destroy_root(const char *dir) {
  struct stat st;
  dev_t id;
  int len;
  const char *p, *prev;
  char tmp[512];
  if (stat(dir, &st) < 0)
    return NULL;
  id = st.st_dev;
  p = dir + strlen(dir);
  prev = p;
  while (p > dir) {
    while (p > dir && (*p == '/' || *p == '.'))
      p--;
    while (p > dir && *p != '/')
      p--;
    if (p <= dir)
      break;
    len = p - dir + 1;
    strncpy(tmp, dir, len);
    tmp[len] = 0;
    if (stat(tmp, &st) < 0)
      return NULL;
    if (id != st.st_dev)
      break;
    prev = p;
  }
  len = prev - dir;
  if (len) {
    strncpy(tmp, dir, len);
    tmp[len] = 0;
    return strdup(tmp);
  }
  return NULL;
}
```