user: Translate the below assembly code into C programming language:

```asm
<do_get_perms>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  call   <do_get_type@plt>
  cmp    $0x66,%al
  mov    $0x2d,%edx
  cmove  %edx,%eax
  mov    %al,D61(%rip)
  mov    D269(%rip),%rax
  mov    %ebx,%ecx
  and    (%rax),%ecx
  cmp    $0x1,%ecx
  sbb    %eax,%eax
  and    $0xffffffbb,%eax
  add    $0x72,%eax
  mov    %al,D111(%rip)
  mov    D33(%rip),%rax
  mov    %ebx,%esi
  and    (%rax),%esi
  cmp    $0x1,%esi
  sbb    %eax,%eax
  and    $0xffffffb6,%eax
  add    $0x77,%eax
  mov    %al,D242(%rip)
  mov    D123(%rip),%rax
  mov    %ebx,%edx
  and    (%rax),%edx
  je     L3
  mov    D57(%rip),%rax
  mov    %ebx,%edi
  and    (%rax),%edi
  cmp    $0x1,%edi
  sbb    %eax,%eax
  and    $0xffffffe0,%eax
  add    $0x73,%eax
L42:
  mov    %al,D236(%rip)
  mov    D129(%rip),%rax
  mov    %ebx,%ecx
  and    (%rax),%ecx
  cmp    $0x1,%ecx
  sbb    %eax,%eax
  and    $0xffffffbb,%eax
  add    $0x72,%eax
  mov    %al,D8(%rip)
  mov    D240(%rip),%rax
  mov    %ebx,%esi
  and    (%rax),%esi
  cmp    $0x1,%esi
  sbb    %eax,%eax
  and    $0xffffffb6,%eax
  add    $0x77,%eax
  mov    %al,D21(%rip)
  mov    D108(%rip),%rax
  mov    %ebx,%edi
  and    (%rax),%edi
  je     L31
  mov    D24(%rip),%rax
  mov    %ebx,%edi
  and    (%rax),%edi
  cmp    $0x1,%edi
  sbb    %eax,%eax
  and    $0xffffffe0,%eax
  add    $0x73,%eax
L47:
  mov    %al,D82(%rip)
  mov    D218(%rip),%rax
  mov    %ebx,%edx
  and    (%rax),%edx
  cmp    $0x1,%edx
  sbb    %eax,%eax
  and    $0xffffffbb,%eax
  add    $0x72,%eax
  mov    %al,D63(%rip)
  mov    D131(%rip),%rax
  mov    %ebx,%ecx
  and    (%rax),%ecx
  cmp    $0x1,%ecx
  sbb    %eax,%eax
  and    $0xffffffb6,%eax
  add    $0x77,%eax
  mov    %al,D247(%rip)
  mov    D204(%rip),%rax
  mov    %ebx,%esi
  and    (%rax),%esi
  je     L58
  mov    D243(%rip),%rax
  and    (%rax),%ebx
  cmp    $0x1,%ebx
  sbb    %eax,%eax
  and    $0xffffffe0,%eax
  add    $0x74,%eax
L18:
  mov    %al,D268(%rip)
  movb   $0x0,D199(%rip)
  lea    D61(%rip),%rax
  pop    %rbx
  ret
L3:
  mov    D57(%rip),%rax
  mov    %ebx,%edx
  and    (%rax),%edx
  cmp    $0x1,%edx
  sbb    %eax,%eax
  and    $0xffffffb5,%eax
  add    $0x78,%eax
  jmp    L42
L31:
  mov    D24(%rip),%rax
  mov    %ebx,%ecx
  and    (%rax),%ecx
  cmp    $0x1,%ecx
  sbb    %eax,%eax
  and    $0xffffffb5,%eax
  add    $0x78,%eax
  jmp    L47
L58:
  mov    D243(%rip),%rax
  and    (%rax),%ebx
  cmp    $0x1,%ebx
  sbb    %eax,%eax
  and    $0xffffffb5,%eax
  add    $0x78,%eax
  jmp    L18
```

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