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

```asm
<do_get_perms>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <do_get_type@plt>
  mov    %al,-0x1(%rbp)
  cmpb   $0x66,-0x1(%rbp)
  je     L278
  movzbl -0x1(%rbp),%eax
  jmp    L162
L278:
  mov    $0x2d,%eax
L162:
  mov    %al,D2(%rip)
  mov    -0x14(%rbp),%edx
  mov    D199(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L65
  mov    $0x72,%eax
  jmp    L55
L65:
  mov    $0x2d,%eax
L55:
  mov    %al,D217(%rip)
  mov    -0x14(%rbp),%edx
  mov    D28(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L197
  mov    $0x77,%eax
  jmp    L105
L197:
  mov    $0x2d,%eax
L105:
  mov    %al,D131(%rip)
  mov    -0x14(%rbp),%edx
  mov    D150(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L108
  mov    -0x14(%rbp),%edx
  mov    D120(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L291
  mov    $0x73,%eax
  jmp    L154
L291:
  mov    $0x53,%eax
  jmp    L154
L108:
  mov    -0x14(%rbp),%edx
  mov    D120(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L165
  mov    $0x78,%eax
  jmp    L154
L165:
  mov    $0x2d,%eax
L154:
  mov    %al,D198(%rip)
  mov    -0x14(%rbp),%edx
  mov    D18(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L178
  mov    $0x72,%eax
  jmp    L66
L178:
  mov    $0x2d,%eax
L66:
  mov    %al,D46(%rip)
  mov    -0x14(%rbp),%edx
  mov    D255(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L293
  mov    $0x77,%eax
  jmp    L123
L293:
  mov    $0x2d,%eax
L123:
  mov    %al,D117(%rip)
  mov    -0x14(%rbp),%edx
  mov    D43(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L222
  mov    -0x14(%rbp),%edx
  mov    D130(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L38
  mov    $0x73,%eax
  jmp    L251
L38:
  mov    $0x53,%eax
  jmp    L251
L222:
  mov    -0x14(%rbp),%edx
  mov    D130(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L164
  mov    $0x78,%eax
  jmp    L251
L164:
  mov    $0x2d,%eax
L251:
  mov    %al,D145(%rip)
  mov    -0x14(%rbp),%edx
  mov    D142(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L16
  mov    $0x72,%eax
  jmp    L37
L16:
  mov    $0x2d,%eax
L37:
  mov    %al,D57(%rip)
  mov    -0x14(%rbp),%edx
  mov    D50(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L239
  mov    $0x77,%eax
  jmp    L102
L239:
  mov    $0x2d,%eax
L102:
  mov    %al,D129(%rip)
  mov    -0x14(%rbp),%edx
  mov    D103(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L189
  mov    -0x14(%rbp),%edx
  mov    D225(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L195
  mov    $0x74,%eax
  jmp    L314
L195:
  mov    $0x54,%eax
  jmp    L314
L189:
  mov    -0x14(%rbp),%edx
  mov    D225(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L298
  mov    $0x78,%eax
  jmp    L314
L298:
  mov    $0x2d,%eax
L314:
  mov    %al,D226(%rip)
  movb   $0x0,D204(%rip)
  lea    D2(%rip),%rax
  leave
  ret
```

assistant: ```c
char *do_get_perms(struct stat attr) {
  static char perms[11];
  char type = do_get_type(attr);
  perms[0] = (char)(type == 'f' ? '-' : type);
  perms[1] = (char)(attr.st_mode & S_IRUSR ? 'r' : '-');
  perms[2] = (char)(attr.st_mode & S_IWUSR ? 'w' : '-');
  perms[3] = (char)(attr.st_mode & S_ISUID ? (attr.st_mode & S_IXUSR ? 's' : 'S') : (attr.st_mode & S_IXUSR ? 'x' : '-'));
  perms[4] = (char)(attr.st_mode & S_IRGRP ? 'r' : '-');
  perms[5] = (char)(attr.st_mode & S_IWGRP ? 'w' : '-');
  perms[6] = (char)(attr.st_mode & S_ISGID ? (attr.st_mode & S_IXGRP ? 's' : 'S') : (attr.st_mode & S_IXGRP ? 'x' : '-'));
  perms[7] = (char)(attr.st_mode & S_IROTH ? 'r' : '-');
  perms[8] = (char)(attr.st_mode & S_IWOTH ? 'w' : '-');
  perms[9] = (char)(attr.st_mode & S_ISVTX ? (attr.st_mode & S_IXOTH ? 't' : 'T') : (attr.st_mode & S_IXOTH ? 'x' : '-'));
  perms[10] = '\0';
  return perms;
}
```