user: Demonstrate the C code that generates the assembly output below:

```asm
<get_mode_string>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <S_ISBLK@plt>
  test   %rax,%rax
  jne    L406
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <S_ISCHR@plt>
  test   %rax,%rax
  jne    L161
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <S_ISDIR@plt>
  test   %rax,%rax
  jne    L123
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <S_ISREG@plt>
  test   %rax,%rax
  jne    L35
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <S_ISFIFO@plt>
  test   %rax,%rax
  jne    L186
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <S_ISLNK@plt>
  test   %rax,%rax
  jne    L124
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <S_ISSOCK@plt>
  test   %rax,%rax
  je     L34
  mov    $0x73,%eax
  jmp    L130
L34:
  mov    $0x3f,%eax
  jmp    L130
L124:
  mov    $0x6c,%eax
  jmp    L130
L186:
  mov    $0x70,%eax
  jmp    L130
L35:
  mov    $0x2d,%eax
  jmp    L130
L123:
  mov    $0x64,%eax
  jmp    L130
L161:
  mov    $0x63,%eax
  jmp    L130
L406:
  mov    $0x62,%eax
L130:
  mov    -0x10(%rbp),%rdx
  mov    %al,(%rdx)
  mov    D105(%rip),%rax
  mov    (%rax),%eax
  and    -0x4(%rbp),%eax
  test   %eax,%eax
  je     L28
  mov    $0x72,%edx
  jmp    L301
L28:
  mov    $0x2d,%edx
L301:
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  mov    %dl,(%rax)
  mov    D48(%rip),%rax
  mov    (%rax),%eax
  and    -0x4(%rbp),%eax
  test   %eax,%eax
  je     L287
  mov    $0x77,%edx
  jmp    L413
L287:
  mov    $0x2d,%edx
L413:
  mov    -0x10(%rbp),%rax
  add    $0x2,%rax
  mov    %dl,(%rax)
  mov    D144(%rip),%rax
  mov    (%rax),%eax
  and    -0x4(%rbp),%eax
  test   %eax,%eax
  je     L223
  mov    D111(%rip),%rax
  mov    (%rax),%eax
  and    -0x4(%rbp),%eax
  test   %eax,%eax
  je     L152
  mov    $0x73,%eax
  jmp    L393
L152:
  mov    $0x53,%eax
  jmp    L393
L223:
  mov    D111(%rip),%rax
  mov    (%rax),%eax
  and    -0x4(%rbp),%eax
  test   %eax,%eax
  je     L208
  mov    $0x78,%eax
  jmp    L393
L208:
  mov    $0x2d,%eax
L393:
  mov    -0x10(%rbp),%rdx
  add    $0x3,%rdx
  mov    %al,(%rdx)
  mov    D75(%rip),%rax
  mov    (%rax),%eax
  and    -0x4(%rbp),%eax
  test   %eax,%eax
  je     L131
  mov    $0x72,%edx
  jmp    L4
L131:
  mov    $0x2d,%edx
L4:
  mov    -0x10(%rbp),%rax
  add    $0x4,%rax
  mov    %dl,(%rax)
  mov    D85(%rip),%rax
  mov    (%rax),%eax
  and    -0x4(%rbp),%eax
  test   %eax,%eax
  je     L384
  mov    $0x77,%edx
  jmp    L39
L384:
  mov    $0x2d,%edx
L39:
  mov    -0x10(%rbp),%rax
  add    $0x5,%rax
  mov    %dl,(%rax)
  mov    D87(%rip),%rax
  mov    (%rax),%eax
  and    -0x4(%rbp),%eax
  test   %eax,%eax
  je     L37
  mov    D107(%rip),%rax
  mov    (%rax),%eax
  and    -0x4(%rbp),%eax
  test   %eax,%eax
  je     L420
  mov    $0x73,%eax
  jmp    L391
L420:
  mov    $0x53,%eax
  jmp    L391
L37:
  mov    D107(%rip),%rax
  mov    (%rax),%eax
  and    -0x4(%rbp),%eax
  test   %eax,%eax
  je     L368
  mov    $0x78,%eax
  jmp    L391
L368:
  mov    $0x2d,%eax
L391:
  mov    -0x10(%rbp),%rdx
  add    $0x6,%rdx
  mov    %al,(%rdx)
  mov    D33(%rip),%rax
  mov    (%rax),%eax
  and    -0x4(%rbp),%eax
  test   %eax,%eax
  je     L401
  mov    $0x72,%edx
  jmp    L435
L401:
  mov    $0x2d,%edx
L435:
  mov    -0x10(%rbp),%rax
  add    $0x7,%rax
  mov    %dl,(%rax)
  mov    D146(%rip),%rax
  mov    (%rax),%eax
  and    -0x4(%rbp),%eax
  test   %eax,%eax
  je     L87
  mov    $0x77,%edx
  jmp    L25
L87:
  mov    $0x2d,%edx
L25:
  mov    -0x10(%rbp),%rax
  add    $0x8,%rax
  mov    %dl,(%rax)
  mov    D72(%rip),%rax
  mov    (%rax),%eax
  and    -0x4(%rbp),%eax
  test   %eax,%eax
  je     L177
  mov    D124(%rip),%rax
  mov    (%rax),%eax
  and    -0x4(%rbp),%eax
  test   %eax,%eax
  je     L198
  mov    $0x74,%eax
  jmp    L61
L198:
  mov    $0x54,%eax
  jmp    L61
L177:
  mov    D124(%rip),%rax
  mov    (%rax),%eax
  and    -0x4(%rbp),%eax
  test   %eax,%eax
  je     L330
  mov    $0x78,%eax
  jmp    L61
L330:
  mov    $0x2d,%eax
L61:
  mov    -0x10(%rbp),%rdx
  add    $0x9,%rdx
  mov    %al,(%rdx)
  mov    -0x10(%rbp),%rax
  add    $0xa,%rax
  movb   $0x0,(%rax)
  nop
  leave
  ret
```

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';
}
```