user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<fts_stat>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x28,%rsp
  mov    D41(%rip),%rcx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  mov    (%rdi),%eax
  mov    %rsp,%rbp
  mov    %eax,%esi
  and    (%rcx),%esi
  jne    L57
  mov    0x40(%rbx),%rbp
L57:
  mov    D19(%rip),%rcx
  mov    0x3c(%rbx),%edi
  mov    %rbp,%rsi
  and    (%rcx),%eax
  or     %edx,%eax
  je     L0
  call   <stat@plt>
  test   %rax,%rax
  jne    L42
L157:
  mov    0x10(%rbp),%edi
  call   <S_ISDIR@plt>
  test   %rax,%rax
  je     L197
  mov    0x14(%rbp),%eax
  mov    0x8(%rbp),%rcx
  mov    0x0(%rbp),%rsi
  movdqu 0x0(%rbp),%xmm0
  mov    %eax,0x38(%rbx)
  mov    0x18(%rbx),%rax
  movups %xmm0,0x8(%rbx)
  cmpb   $0x2e,(%rax)
  je     L245
L165:
  mov    D8(%rip),%rdx
  mov    0x30(%rbx),%rax
  mov    (%rdx),%rdx
  cmp    0x20(%rax),%rdx
  jle    L56
  jmp    L142
  nopl   (%rax)
L191:
  mov    0x30(%rax),%rax
  cmp    %rdx,0x20(%rax)
  jl     L142
L56:
  cmp    %rcx,0x10(%rax)
  jne    L191
  cmp    0x8(%rax),%rsi
  jne    L191
  mov    %rax,0x28(%rbx)
  mov    D11(%rip),%rax
  mov    (%rax),%eax
  jmp    L26
  nopl   (%rax)
L0:
  call   <lstat@plt>
  test   %rax,%rax
  je     L157
  mov    D57(%rip),%rax
  mov    (%rax),%eax
L200:
  mov    %eax,(%rbx)
  mov    $0x18,%edx
  xor    %esi,%esi
  mov    %rbp,%rdi
  call   <memset@plt>
  mov    D35(%rip),%rax
  mov    (%rax),%eax
  jmp    L26
  nopl   0x0(%rax,%rax,1)
L197:
  mov    0x10(%rbp),%edi
  call   <S_ISLNK@plt>
  test   %rax,%rax
  je     L174
  mov    D76(%rip),%rax
  mov    (%rax),%eax
  jmp    L26
L142:
  mov    D28(%rip),%rax
  mov    (%rax),%eax
L26:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L150
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L42:
  mov    D57(%rip),%r13
  mov    0x3c(%rbx),%edi
  mov    %rbp,%rsi
  mov    0x0(%r13),%r12
  call   <lstat@plt>
  test   %rax,%rax
  jne    L253
  mov    D10(%rip),%rax
  movq   $0x0,0x0(%r13)
  mov    (%rax),%eax
  jmp    L26
  xchg   %ax,%ax
L174:
  mov    0x10(%rbp),%edi
  call   <S_ISREG@plt>
  test   %rax,%rax
  jne    L122
  mov    D68(%rip),%rax
  mov    (%rax),%eax
  jmp    L26
  nopl   0x0(%rax,%rax,1)
L245:
  movzbl 0x1(%rax),%edx
  test   %dl,%dl
  je     L256
  cmp    $0x2e,%dl
  jne    L165
  cmpb   $0x0,0x2(%rax)
  jne    L165
  nopl   0x0(%rax,%rax,1)
L256:
  mov    D51(%rip),%rax
  mov    (%rax),%eax
  jmp    L26
  xchg   %ax,%ax
L253:
  mov    %r12d,%eax
  jmp    L200
L122:
  mov    D53(%rip),%rax
  mov    (%rax),%eax
  jmp    L26
L150:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
u_short fts_stat(FTS *sp, FTSENT *p, int follow) {
  FTSENT *t;
  dev_t dev;
  ino_t ino;
  struct stat *sbp, sb;
  int saved_errno;
  sbp = (sp->fts_options & (FTS_NOSTAT)) ? &sb : p->fts_statp;
  if ((sp->fts_options & (FTS_LOGICAL)) || follow) {
    if (stat(p->fts_accpath, sbp)) {
      saved_errno = errno;
      if (!lstat(p->fts_accpath, sbp)) {
        errno = 0;
        return (FTS_SLNONE);
      }
      p->fts_errno = saved_errno;
      goto err;
    }
  } else if (lstat(p->fts_accpath, sbp)) {
    p->fts_errno = errno;
  err:
    memset(sbp, 0, sizeof(struct stat));
    return (FTS_NS);
  }
  if (S_ISDIR(sbp->st_mode)) {
    dev = p->fts_dev = sbp->st_dev;
    ino = p->fts_ino = sbp->st_ino;
    p->fts_nlink = sbp->st_nlink;
    if ((p->fts_name[0] == '.' && (!p->fts_name[1] || (p->fts_name[1] == '.' && !p->fts_name[2]))))
      return (FTS_DOT);
    for (t = p->fts_parent; t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent)
      if (ino == t->fts_ino && dev == t->fts_dev) {
        p->fts_cycle = t;
        return (FTS_DC);
      }
    return (FTS_D);
  }
  if (S_ISLNK(sbp->st_mode))
    return (FTS_SL);
  if (S_ISREG(sbp->st_mode))
    return (FTS_F);
  return (FTS_DEFAULT);
}
```