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

```asm
<deviceinfo_from_sysinfo>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x28(%rbp)
  movq   $0x0,-0x20(%rbp)
  movl   $0xfffffffe,-0x38(%rbp)
  mov    -0x50(%rbp),%rdx
  lea    -0x30(%rbp),%rax
  mov    %rdx,%rcx
  lea    D1(%rip),%rdx
  lea    D15(%rip),%rsi
  mov    %rax,%rdi
  call   <asprintf@plt>
  cmp    $0xffffffff,%eax
  jne    L111
  mov    -0x38(%rbp),%eax
  jmp    L116
L111:
  mov    -0x30(%rbp),%rax
  lea    D10(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  cmpq   $0x0,-0x10(%rbp)
  jne    L108
  mov    $0xffffffff,%eax
  jmp    L116
L108:
  mov    -0x10(%rbp),%rdx
  lea    -0x20(%rbp),%rcx
  lea    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <getline@plt>
  mov    %eax,-0x34(%rbp)
  cmpl   $0xffffffff,-0x34(%rbp)
  jne    L57
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0xffffffff,%eax
  jmp    L116
L57:
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  jmp    L60
L118:
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x30(%rbp)
L60:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L69
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L118
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L118
L69:
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L106
L21:
  addq   $0x1,-0x18(%rbp)
L106:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L131
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  je     L131
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xd,%al
  jne    L21
L131:
  mov    -0x18(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x30(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  sub    %rdx,%rax
  mov    %eax,-0x38(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x28(%rbp),%rax
  test   %rax,%rax
  je     L121
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L121:
  mov    -0x38(%rbp),%eax
L116:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L26
  call   <__stack_chk_fail@plt>
L26:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D1
type: string
name: extract_symbolic_data
arguments: tag: D15
type: string
name: extract_symbolic_data
arguments: tag: D10
type: string

tool: D1: /tmp/sysinfo

tool: D15: %s/%s

tool: D10: rb

assistant: ```c
int deviceinfo_from_sysinfo(char **dest, const char *key) {
  FILE *f;
  char *s, *nl, *line = NULL;
  size_t len = 0;
  ssize_t c;
  int rv = -2;
  if (asprintf(&s, "%s/%s", "/tmp/sysinfo", key) == -1)
    return rv;
  f = fopen(s, "rb");
  free(s);
  if (f == NULL)
    return -1;
  if ((c = getline(&line, &len, f)) == -1) {
    fclose(f);
    return -1;
  }
  s = line;
  while (*s && (*s == ' ' || *s == '\t'))
    s++;
  nl = s;
  while (*nl && *nl != '\n' && *nl != '\r')
    nl++;
  *nl = '\0';
  *dest = strdup(s);
  rv = nl - s;
  fclose(f);
  if (line)
    free(line);
  return rv;
}
```