user: Please show me the C implementation that matches the assembly code listed below:

```asm
<ConvertMode>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  call   <S_ISDIR@plt>
  test   %rax,%rax
  setne  %bl
  movzbl %bl,%ebx
  mov    %rbp,%rdi
  call   <S_ISCHR@plt>
  mov    %rax,%rdx
  mov    %rbx,%rax
  or     $0x2,%rax
  test   %rdx,%rdx
  cmovne %rax,%rbx
  mov    %rbp,%rdi
  call   <S_ISBLK@plt>
  mov    %rax,%rdx
  mov    %rbx,%rax
  or     $0x4,%rax
  test   %rdx,%rdx
  cmovne %rax,%rbx
  mov    %rbp,%rdi
  call   <S_ISREG@plt>
  mov    %rax,%rdx
  mov    %rbx,%rax
  or     $0x8,%rax
  test   %rdx,%rdx
  cmovne %rax,%rbx
  mov    %rbp,%rdi
  call   <S_ISFIFO@plt>
  mov    %rax,%rdx
  mov    %rbx,%rax
  or     $0x10,%rax
  test   %rdx,%rdx
  cmovne %rax,%rbx
  mov    D50(%rip),%rax
  mov    %rbp,%rdx
  and    (%rax),%rdx
  mov    %rbx,%rax
  or     $0x10000,%rax
  test   %rdx,%rdx
  cmovne %rax,%rbx
  mov    D68(%rip),%rax
  mov    %rbp,%rdx
  and    (%rax),%rdx
  mov    %rbx,%rax
  or     $0x20000,%rax
  test   %rdx,%rdx
  cmovne %rax,%rbx
  mov    D24(%rip),%rax
  mov    %rbp,%rdx
  and    (%rax),%rdx
  mov    %rbx,%rax
  or     $0x40000,%rax
  test   %rdx,%rdx
  cmovne %rax,%rbx
  mov    D52(%rip),%rax
  mov    %rbp,%rdx
  and    (%rax),%rdx
  mov    %rbx,%rax
  or     $0x80000,%rax
  test   %rdx,%rdx
  cmovne %rax,%rbx
  mov    D79(%rip),%rax
  mov    %rbp,%rdx
  and    (%rax),%rdx
  mov    %rbx,%rax
  or     $0x100000,%rax
  test   %rdx,%rdx
  cmovne %rax,%rbx
  mov    D90(%rip),%rax
  mov    %rbp,%rdx
  and    (%rax),%rdx
  mov    %rbx,%rax
  or     $0x200000,%rax
  test   %rdx,%rdx
  cmovne %rax,%rbx
  mov    D66(%rip),%rax
  mov    %rbp,%rdx
  and    (%rax),%rdx
  mov    %rbx,%rax
  or     $0x400000,%rax
  test   %rdx,%rdx
  cmovne %rax,%rbx
  mov    D1(%rip),%rax
  mov    %rbp,%rdx
  and    (%rax),%rdx
  mov    %rbx,%rax
  or     $0x800000,%rax
  test   %rdx,%rdx
  cmovne %rax,%rbx
  mov    D28(%rip),%rax
  mov    %rbp,%rdx
  and    (%rax),%rdx
  mov    %rbx,%rax
  or     $0x1000000,%rax
  test   %rdx,%rdx
  cmovne %rax,%rbx
  mov    D60(%rip),%rax
  mov    %rbp,%rdx
  and    (%rax),%rdx
  mov    %rbx,%rax
  or     $0x2000000,%rax
  test   %rdx,%rdx
  cmovne %rax,%rbx
  mov    D95(%rip),%rax
  and    (%rax),%rbp
  mov    %rbx,%rax
  or     $0x4000000,%rax
  test   %rbp,%rbp
  cmovne %rax,%rbx
  mov    %rbx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
unsigned long ConvertMode(unsigned long posix_mode) {
  unsigned long result = 0;
  if (S_ISDIR(posix_mode))
    result |= 1 << 0;
  if (S_ISCHR(posix_mode))
    result |= 1 << 1;
  if (S_ISBLK(posix_mode))
    result |= 1 << 2;
  if (S_ISREG(posix_mode))
    result |= 1 << 3;
  if (S_ISFIFO(posix_mode))
    result |= 1 << 4;
  if (posix_mode & S_IRUSR)
    result |= 1 << 16;
  if (posix_mode & S_IWUSR)
    result |= 1 << 17;
  if (posix_mode & S_IXUSR)
    result |= 1 << 18;
  if (posix_mode & S_IRGRP)
    result |= 1 << 19;
  if (posix_mode & S_IWGRP)
    result |= 1 << 20;
  if (posix_mode & S_IXGRP)
    result |= 1 << 21;
  if (posix_mode & S_IROTH)
    result |= 1 << 22;
  if (posix_mode & S_IWOTH)
    result |= 1 << 23;
  if (posix_mode & S_IXOTH)
    result |= 1 << 24;
  if (posix_mode & S_ISUID)
    result |= 1 << 25;
  if (posix_mode & S_ISGID)
    result |= 1 << 26;
  return result;
}
```