user: What would the C source look like for the assembly code provided here:

```asm
<smack_accesses_add_from_file>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %esi,-0x5c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x30(%rbp)
  movq   $0x0,-0x48(%rbp)
  movq   $0x0,-0x40(%rbp)
  mov    -0x5c(%rbp),%eax
  mov    %eax,%edi
  call   <dup@plt>
  mov    %eax,-0x4c(%rbp)
  cmpl   $0xffffffff,-0x4c(%rbp)
  jne    L75
  mov    $0xffffffff,%eax
  jmp    L137
L75:
  mov    -0x4c(%rbp),%eax
  lea    D40(%rip),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <fdopen@plt>
  mov    %rax,-0x30(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  jne    L153
  mov    -0x4c(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    $0xffffffff,%eax
  jmp    L137
L67:
  mov    -0x48(%rbp),%rax
  lea    D11(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L115
  jmp    L153
L115:
  mov    -0x48(%rbp),%rax
  lea    -0x38(%rbp),%rdx
  lea    D59(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtok_r@plt>
  mov    %rax,-0x28(%rbp)
  lea    -0x38(%rbp),%rax
  mov    %rax,%rdx
  lea    D59(%rip),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <strtok_r@plt>
  mov    %rax,-0x20(%rbp)
  lea    -0x38(%rbp),%rax
  mov    %rax,%rdx
  lea    D59(%rip),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <strtok_r@plt>
  mov    %rax,-0x18(%rbp)
  lea    -0x38(%rbp),%rax
  mov    %rax,%rdx
  lea    D59(%rip),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <strtok_r@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  je     L48
  cmpq   $0x0,-0x20(%rbp)
  je     L48
  cmpq   $0x0,-0x18(%rbp)
  je     L48
  lea    -0x38(%rbp),%rax
  mov    %rax,%rdx
  lea    D59(%rip),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <strtok_r@plt>
  test   %rax,%rax
  jne    L48
  cmpq   $0x0,-0x10(%rbp)
  jne    L53
  mov    -0x18(%rbp),%rcx
  mov    -0x20(%rbp),%rdx
  mov    -0x28(%rbp),%rsi
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <smack_accesses_add@plt>
  mov    %eax,-0x50(%rbp)
  jmp    L110
L53:
  mov    -0x10(%rbp),%rdi
  mov    -0x18(%rbp),%rcx
  mov    -0x20(%rbp),%rdx
  mov    -0x28(%rbp),%rsi
  mov    -0x58(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <smack_accesses_add_modify@plt>
  mov    %eax,-0x50(%rbp)
L110:
  cmpl   $0x0,-0x50(%rbp)
  jne    L65
L153:
  mov    -0x30(%rbp),%rdx
  lea    -0x40(%rbp),%rcx
  lea    -0x48(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <getline@plt>
  test   %rax,%rax
  jns    L67
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <ferror@plt>
  test   %rax,%rax
  jne    L143
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
  jmp    L137
L48:
  nop
  jmp    L185
L65:
  nop
  jmp    L185
L143:
  nop
L185:
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0xffffffff,%eax
L137:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L77
  call   <__stack_chk_fail@plt>
L77:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D40
datatype: string
name: unpack_data
arguments: tag: D11
datatype: string
name: unpack_data
arguments: tag: D59
datatype: string

tool: D40: r

tool: D11: 


tool: D59:  	


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