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

```asm
<smack_accesses_add_from_file>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %esi,%edi
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x20(%rsp)
  movq   $0x0,0x28(%rsp)
  call   <dup@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  je     L109
  lea    D4(%rip),%rsi
  mov    %eax,%edi
  call   <fdopen@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L48
  lea    0x20(%rsp),%rax
  lea    0x28(%rsp),%r15
  mov    %rax,(%rsp)
  lea    0x30(%rsp),%rbp
  lea    D19(%rip),%rbx
L71:
  mov    (%rsp),%rdi
  mov    %r14,%rdx
  mov    %r15,%rsi
  call   <getline@plt>
  test   %rax,%rax
  js     L73
  mov    0x20(%rsp),%rdi
  lea    D22(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L71
  mov    0x20(%rsp),%rdi
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  call   <strtok_r@plt>
  xor    %edi,%edi
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %rax,%r12
  call   <strtok_r@plt>
  xor    %edi,%edi
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %rax,%r13
  call   <strtok_r@plt>
  mov    %rbp,%rdx
  xor    %edi,%edi
  mov    %rbx,%rsi
  mov    %rax,0x8(%rsp)
  call   <strtok_r@plt>
  test   %r12,%r12
  mov    %rax,0x10(%rsp)
  sete   %al
  test   %r13,%r13
  sete   %dl
  or     %dl,%al
  jne    L7
  mov    0x8(%rsp),%rcx
  test   %rcx,%rcx
  je     L7
  xor    %edi,%edi
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  call   <strtok_r@plt>
  test   %rax,%rax
  jne    L7
  mov    0x10(%rsp),%r8
  mov    0x18(%rsp),%rdi
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    0x8(%rsp),%rcx
  test   %r8,%r8
  je     L20
  call   <smack_accesses_add_modify@plt>
  test   %eax,%eax
  je     L71
  nopl   0x0(%rax,%rax,1)
L7:
  mov    0x20(%rsp),%rdi
  mov    $0xffffffff,%r12d
  call   <free@plt>
  mov    %r14,%rdi
  call   <fclose@plt>
L109:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L18
  add    $0x48,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L20:
  call   <smack_accesses_add@plt>
  test   %eax,%eax
  je     L71
  jmp    L7
  nop
L73:
  mov    %r14,%rdi
  call   <ferror@plt>
  test   %rax,%rax
  jne    L7
  mov    0x20(%rsp),%rdi
  xor    %r12d,%r12d
  call   <free@plt>
  mov    %r14,%rdi
  call   <fclose@plt>
  jmp    L109
L48:
  mov    %r12d,%edi
  mov    $0xffffffff,%r12d
  call   <close@plt>
  jmp    L109
L18:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D4
type: string
name: extract_symbolic_data
arguments: data_label: D19
type: string
name: extract_symbolic_data
arguments: data_label: D22
type: string

tool: D4: r

tool: D19:  	


tool: D22: 


assistant: ```c
int smack_accesses_add_from_file(struct smack_accesses *accesses, int fd) {
  FILE *file = NULL;
  char *buf = NULL;
  size_t buf_len = 0;
  char *ptr;
  const char *subject, *object, *access, *access2;
  int newfd;
  int ret;
  newfd = dup(fd);
  if (newfd == -1)
    return -1;
  file = fdopen(newfd, "r");
  if (file == NULL) {
    close(newfd);
    return -1;
  }
  while (getline(&buf, &buf_len, file) >= 0) {
    if (strcmp(buf, "\n") == 0)
      continue;
    subject = strtok_r(buf, " \t\n", &ptr);
    object = strtok_r(NULL, " \t\n", &ptr);
    access = strtok_r(NULL, " \t\n", &ptr);
    access2 = strtok_r(NULL, " \t\n", &ptr);
    if (subject == NULL || object == NULL || access == NULL || strtok_r(NULL, " \t\n", &ptr) != NULL)
      goto err_out;
    if (access2 == NULL)
      ret = smack_accesses_add(accesses, subject, object, access);
    else
      ret = smack_accesses_add_modify(accesses, subject, object, access, access2);
    if (ret)
      goto err_out;
  }
  if (ferror(file))
    goto err_out;
  free(buf);
  fclose(file);
  return 0;
err_out:
  free(buf);
  fclose(file);
  return -1;
}
```