user: What is the c source code of the assembly code below?

```asm
<fdequal>:
  endbr64
  push   %r13
  mov    %esi,%r13d
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <fdreadlink@plt>
  mov    %r13d,%edi
  mov    %rax,%rbp
  call   <fdreadlink@plt>
  mov    %rsp,%rdi
  mov    %rax,%r13
  test   %r12,%r12
  je     L33
  cmpb   $0x2f,(%r12)
  je     L66
  mov    %rax,%rdx
  mov    %r12,%rcx
  lea    D82(%rip),%rsi
  xor    %eax,%eax
  call   <asprintf@plt>
  test   %rax,%rax
  js     L2
L59:
  mov    (%rsp),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  mov    %rbp,%rdi
  mov    %eax,%r12d
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  xor    %eax,%eax
  test   %r12d,%r12d
  sete   %al
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L58
  add    $0x10,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L66:
  xor    %eax,%eax
  mov    %r12,%rdx
  lea    D23(%rip),%rsi
  call   <asprintf@plt>
  test   %rax,%rax
  jns    L59
  lea    D100(%rip),%rcx
  mov    $0x52,%edx
  lea    D16(%rip),%rsi
  lea    D99(%rip),%rdi
  call   <ksft_exit_fail_msg@plt>
  jmp    L59
  nopw   0x0(%rax,%rax,1)
L2:
  lea    D100(%rip),%rcx
  mov    $0x54,%edx
  lea    D16(%rip),%rsi
  lea    D99(%rip),%rdi
  call   <ksft_exit_fail_msg@plt>
  jmp    L59
  nopl   0x0(%rax)
L33:
  mov    %rax,%rdx
  lea    D23(%rip),%rsi
  xor    %eax,%eax
  call   <asprintf@plt>
  test   %rax,%rax
  jns    L59
  lea    D100(%rip),%rcx
  mov    $0x50,%edx
  lea    D16(%rip),%rsi
  lea    D99(%rip),%rdi
  call   <ksft_exit_fail_msg@plt>
  jmp    L59
L58:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D82
data_type: string
name: unpack_data
arguments: data_label: D23
data_type: string
name: unpack_data
arguments: data_label: D100
data_type: string
name: unpack_data
arguments: data_label: D16
data_type: string
name: unpack_data
arguments: data_label: D99
data_type: string

tool: D82: %s/%s

tool: D23: %s

tool: D100: asprintf

tool: D16: /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: D99: %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;
}
```