user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<get_mode_string>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebx
  mov    %rsi,%rbp
  call   <S_ISBLK@plt>
  mov    %rax,%rdx
  mov    $0x62,%eax
  test   %rdx,%rdx
  je     L47
L97:
  mov    %al,0x0(%rbp)
  mov    D17(%rip),%rax
  mov    %ebx,%ecx
  and    (%rax),%ecx
  cmp    $0x1,%ecx
  sbb    %eax,%eax
  and    $0xffffffbb,%eax
  add    $0x72,%eax
  mov    %al,0x1(%rbp)
  mov    D138(%rip),%rax
  mov    %ebx,%edx
  and    (%rax),%edx
  cmp    $0x1,%edx
  sbb    %eax,%eax
  and    $0xffffffb6,%eax
  add    $0x77,%eax
  mov    %al,0x2(%rbp)
  mov    D148(%rip),%rax
  mov    %ebx,%ecx
  and    (%rax),%ecx
  je     L36
  mov    D72(%rip),%rax
  mov    %ebx,%edx
  and    (%rax),%edx
  cmp    $0x1,%edx
  sbb    %eax,%eax
  and    $0xffffffe0,%eax
  add    $0x73,%eax
L51:
  mov    %al,0x3(%rbp)
  mov    D34(%rip),%rax
  mov    %ebx,%esi
  and    (%rax),%esi
  cmp    $0x1,%esi
  sbb    %eax,%eax
  and    $0xffffffbb,%eax
  add    $0x72,%eax
  mov    %al,0x4(%rbp)
  mov    D141(%rip),%rax
  mov    %ebx,%edi
  and    (%rax),%edi
  cmp    $0x1,%edi
  sbb    %eax,%eax
  and    $0xffffffb6,%eax
  add    $0x77,%eax
  mov    %al,0x5(%rbp)
  mov    D124(%rip),%rax
  mov    %ebx,%edx
  and    (%rax),%edx
  je     L39
  mov    D142(%rip),%rax
  mov    %ebx,%esi
  and    (%rax),%esi
  cmp    $0x1,%esi
  sbb    %eax,%eax
  and    $0xffffffe0,%eax
  add    $0x73,%eax
L29:
  mov    %al,0x6(%rbp)
  mov    D39(%rip),%rax
  mov    %ebx,%ecx
  and    (%rax),%ecx
  cmp    $0x1,%ecx
  sbb    %eax,%eax
  and    $0xffffffbb,%eax
  add    $0x72,%eax
  mov    %al,0x7(%rbp)
  mov    D144(%rip),%rax
  mov    %ebx,%esi
  and    (%rax),%esi
  cmp    $0x1,%esi
  sbb    %eax,%eax
  and    $0xffffffb6,%eax
  add    $0x77,%eax
  mov    %al,0x8(%rbp)
  mov    D128(%rip),%rax
  mov    %ebx,%edi
  and    (%rax),%edi
  je     L123
  mov    D116(%rip),%rax
  and    (%rax),%ebx
  cmp    $0x1,%ebx
  sbb    %eax,%eax
  and    $0xffffffe0,%eax
  add    $0x74,%eax
L109:
  mov    %al,0x9(%rbp)
  movb   $0x0,0xa(%rbp)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L47:
  mov    %ebx,%edi
  call   <S_ISCHR@plt>
  mov    %rax,%rdx
  mov    $0x63,%eax
  test   %rdx,%rdx
  jne    L97
  mov    %ebx,%edi
  call   <S_ISDIR@plt>
  mov    %rax,%rdx
  mov    $0x64,%eax
  test   %rdx,%rdx
  jne    L97
  mov    %ebx,%edi
  call   <S_ISREG@plt>
  mov    %rax,%rdx
  mov    $0x2d,%eax
  test   %rdx,%rdx
  jne    L97
  mov    %ebx,%edi
  call   <S_ISFIFO@plt>
  mov    %rax,%rdx
  mov    $0x70,%eax
  test   %rdx,%rdx
  jne    L97
  mov    %ebx,%edi
  call   <S_ISLNK@plt>
  mov    %rax,%rdx
  mov    $0x6c,%eax
  test   %rdx,%rdx
  jne    L97
  mov    %ebx,%edi
  call   <S_ISSOCK@plt>
  cmp    $0x1,%rax
  sbb    %eax,%eax
  and    $0xffffffcc,%eax
  add    $0x73,%eax
  jmp    L97
L36:
  mov    D72(%rip),%rax
  mov    %ebx,%ecx
  and    (%rax),%ecx
  cmp    $0x1,%ecx
  sbb    %eax,%eax
  and    $0xffffffb5,%eax
  add    $0x78,%eax
  jmp    L51
L39:
  mov    D142(%rip),%rax
  mov    %ebx,%edx
  and    (%rax),%edx
  cmp    $0x1,%edx
  sbb    %eax,%eax
  and    $0xffffffb5,%eax
  add    $0x78,%eax
  jmp    L29
L123:
  mov    D116(%rip),%rax
  and    (%rax),%ebx
  cmp    $0x1,%ebx
  sbb    %eax,%eax
  and    $0xffffffb5,%eax
  add    $0x78,%eax
  jmp    L109
```

assistant: ```c
void get_mode_string(mode_t mode, char *str) {
  str[0] = (S_ISBLK(mode)) ? 'b' : (S_ISCHR(mode)) ? 'c' : (S_ISDIR(mode)) ? 'd' : (S_ISREG(mode)) ? '-' : (S_ISFIFO(mode)) ? 'p' : (S_ISLNK(mode)) ? 'l' : (S_ISSOCK(mode)) ? 's' : '?';
  str[1] = mode & S_IRUSR ? 'r' : '-';
  str[2] = mode & S_IWUSR ? 'w' : '-';
  str[3] = mode & S_ISUID ? (mode & S_IXUSR ? 's' : 'S') : (mode & S_IXUSR ? 'x' : '-');
  str[4] = mode & S_IRGRP ? 'r' : '-';
  str[5] = mode & S_IWGRP ? 'w' : '-';
  str[6] = mode & S_ISGID ? (mode & S_IXGRP ? 's' : 'S') : (mode & S_IXGRP ? 'x' : '-');
  str[7] = mode & S_IROTH ? 'r' : '-';
  str[8] = mode & S_IWOTH ? 'w' : '-';
  str[9] = mode & S_ISVTX ? (mode & S_IXOTH ? 't' : 'T') : (mode & S_IXOTH ? 'x' : '-');
  str[10] = '\0';
}
```