user: 请将以下的汇编代码转换成C语言代码:

```asm
<fdequal>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %esi,%r12d
  mov    %rdx,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <fdreadlink@plt>
  mov    %rax,%rbp
  mov    %r12d,%edi
  call   <fdreadlink@plt>
  mov    %rax,%r12
  test   %rbx,%rbx
  je     L79
  cmpb   $0x2f,(%rbx)
  je     L49
  mov    %rsp,%rdi
  mov    %rbx,%rcx
  mov    %rax,%rdx
  lea    D80(%rip),%rsi
  mov    $0x0,%eax
  call   <asprintf@plt>
  test   %rax,%rax
  js     L4
L0:
  mov    (%rsp),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  mov    %eax,%ebx
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  test   %ebx,%ebx
  sete   %al
  movzbl %al,%eax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L87
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L79:
  mov    %rsp,%rdi
  mov    %rax,%rdx
  lea    D3(%rip),%rsi
  mov    $0x0,%eax
  call   <asprintf@plt>
  test   %rax,%rax
  jns    L0
  lea    D60(%rip),%rcx
  mov    $0x50,%edx
  lea    D69(%rip),%rsi
  lea    D107(%rip),%rdi
  call   <ksft_exit_fail_msg@plt>
  jmp    L0
L49:
  mov    %rsp,%rdi
  mov    %rbx,%rdx
  lea    D3(%rip),%rsi
  mov    $0x0,%eax
  call   <asprintf@plt>
  test   %rax,%rax
  jns    L0
  lea    D60(%rip),%rcx
  mov    $0x52,%edx
  lea    D69(%rip),%rsi
  lea    D107(%rip),%rdi
  call   <ksft_exit_fail_msg@plt>
  jmp    L0
L4:
  lea    D60(%rip),%rcx
  mov    $0x54,%edx
  lea    D69(%rip),%rsi
  lea    D107(%rip),%rdi
  call   <ksft_exit_fail_msg@plt>
  jmp    L0
L87:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D80
type_guessed: string
name: disassemble_data
arguments: label: D3
type_guessed: string
name: disassemble_data
arguments: label: D60
type_guessed: string
name: disassemble_data
arguments: label: D69
type_guessed: string
name: disassemble_data
arguments: label: D107
type_guessed: string

tool: D80: %s/%s

tool: D3: %s

tool: D60: asprintf

tool: D69: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Broadcom/linux-rdma-nxt/refs/heads/hwpoison/.backup_do_not_remove/tools/testing/selftests/openat2/helpers.c

tool: D107: %s:%d %s failed


assistant: ```c
bool fdequal(int fd, int dfd, const char *path) {
  char *fdpath, *dfdpath, *other;
  bool cmp;
  fdpath = fdreadlink(fd);
  dfdpath = fdreadlink(dfd);
  if (!path)
    do {
      if (asprintf(&other, "%s", dfdpath) < 0)
        ksft_exit_fail_msg("%s:%d %s failed\n", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Broadcom/linux-rdma-nxt/refs/heads/hwpoison/.backup_do_not_remove/tools/testing/selftests/openat2/helpers.c", 80, "asprintf");
    } while (0);
  else if (*path == '/')
    do {
      if (asprintf(&other, "%s", path) < 0)
        ksft_exit_fail_msg("%s:%d %s failed\n", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Broadcom/linux-rdma-nxt/refs/heads/hwpoison/.backup_do_not_remove/tools/testing/selftests/openat2/helpers.c", 82, "asprintf");
    } while (0);
  else
    do {
      if (asprintf(&other, "%s/%s", dfdpath, path) < 0)
        ksft_exit_fail_msg("%s:%d %s failed\n", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Broadcom/linux-rdma-nxt/refs/heads/hwpoison/.backup_do_not_remove/tools/testing/selftests/openat2/helpers.c", 84, "asprintf");
    } while (0);
  cmp = !strcmp(fdpath, other);
  free(fdpath);
  free(dfdpath);
  free(other);
  return cmp;
}
```