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

```asm
<get_mode_string>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x50,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  lea    D178(%rip),%rax
  mov    %rax,(%rsp)
  lea    D183(%rip),%rax
  mov    %rax,0x8(%rsp)
  lea    D7(%rip),%rax
  mov    %rax,0x10(%rsp)
  lea    D90(%rip),%rax
  mov    %rax,0x18(%rsp)
  lea    D23(%rip),%rax
  mov    %rax,0x20(%rsp)
  lea    D133(%rip),%rax
  mov    %rax,0x28(%rsp)
  lea    D140(%rip),%rax
  mov    %rax,0x30(%rsp)
  lea    D74(%rip),%rax
  mov    %rax,0x38(%rsp)
  call   <S_ISREG@plt>
  test   %rax,%rax
  je     L1
  movb   $0x2d,D78(%rip)
  lea    D32(%rip),%rbp
  lea    -0x1(%rbp),%r12
L97:
  mov    %ebx,%eax
  mov    %rbp,%rdi
  sar    $0x6,%eax
  and    $0x7,%eax
  mov    (%rsp,%rax,8),%rsi
  call   <strcpy@plt>
  mov    %ebx,%eax
  lea    0x3(%rbp),%rdi
  and    $0x7,%ebx
  sar    $0x3,%eax
  and    $0x7,%eax
  mov    (%rsp,%rax,8),%rsi
  call   <strcpy@plt>
  mov    (%rsp,%rbx,8),%rsi
  lea    0x6(%rbp),%rdi
  call   <strcpy@plt>
  movb   $0x0,0x9(%rbp)
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L135
  add    $0x50,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L1:
  mov    %ebx,%edi
  call   <S_ISDIR@plt>
  test   %rax,%rax
  je     L136
  lea    D32(%rip),%rbp
  movb   $0x64,D78(%rip)
  lea    -0x1(%rbp),%r12
  jmp    L97
  nopl   0x0(%rax,%rax,1)
L136:
  mov    %ebx,%edi
  call   <S_ISCHR@plt>
  test   %rax,%rax
  je     L4
  lea    D32(%rip),%rbp
  movb   $0x63,D78(%rip)
  lea    -0x1(%rbp),%r12
  jmp    L97
  nopl   0x0(%rax,%rax,1)
L4:
  mov    %ebx,%edi
  call   <S_ISBLK@plt>
  test   %rax,%rax
  je     L16
  lea    D32(%rip),%rbp
  movb   $0x62,D78(%rip)
  lea    -0x1(%rbp),%r12
  jmp    L97
  nopl   0x0(%rax,%rax,1)
L16:
  mov    %ebx,%edi
  call   <S_ISFIFO@plt>
  test   %rax,%rax
  je     L131
  lea    D32(%rip),%rbp
  movb   $0x70,D78(%rip)
  lea    -0x1(%rbp),%r12
  jmp    L97
L131:
  mov    %ebx,%edi
  call   <S_ISLNK@plt>
  test   %rax,%rax
  je     L30
  lea    D32(%rip),%rbp
  movb   $0x6c,D78(%rip)
  lea    -0x1(%rbp),%r12
  jmp    L97
L30:
  mov    %ebx,%edi
  lea    D78(%rip),%r12
  call   <S_ISSOCK@plt>
  mov    %r12,%rbp
  test   %rax,%rax
  je     L97
  movb   $0x73,D78(%rip)
  add    $0x1,%rbp
  jmp    L97
L135:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D178
data_type: string
name: parse_data
arguments: label: D183
data_type: string
name: parse_data
arguments: label: D7
data_type: string
name: parse_data
arguments: label: D90
data_type: string
name: parse_data
arguments: label: D23
data_type: string
name: parse_data
arguments: label: D133
data_type: string
name: parse_data
arguments: label: D140
data_type: string
name: parse_data
arguments: label: D74
data_type: string

tool: D178: ---

tool: D183: --x

tool: D7: -w-

tool: D90: -wx

tool: D23: r--

tool: D133: r-x

tool: D140: rw-

tool: D74: rwx

assistant: ```c
char *get_mode_string(mode_t mode) {
  int m;
  static char mode_string[16];
  char *buff = mode_string;
  char *perm[] = {"---", "--x", "-w-", "-wx", "r--", "r-x", "rw-", "rwx"};
  if (S_ISREG(mode)) {
    *(buff++) = '-';
  } else if (S_ISDIR(mode)) {
    *(buff++) = 'd';
  } else if (S_ISCHR(mode)) {
    *(buff++) = 'c';
  } else if (S_ISBLK(mode)) {
    *(buff++) = 'b';
  } else if (S_ISFIFO(mode)) {
    *(buff++) = 'p';
  } else if (S_ISLNK(mode)) {
    *(buff++) = 'l';
  } else if (S_ISSOCK(mode)) {
    *(buff++) = 's';
  }
  m = (mode >> 6) & 7;
  strcpy(buff, perm[m]);
  buff += 3;
  m = (mode >> 3) & 7;
  strcpy(buff, perm[m]);
  buff += 3;
  m = (mode >> 0) & 7;
  strcpy(buff, perm[m]);
  buff += 3;
  *buff = 0;
  return (mode_string);
}
```