user: 请从给定的汇编指令推导出C源代码:

```asm
<get_slot_info>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %edi,-0x44(%rbp)
  mov    %esi,-0x48(%rbp)
  mov    %rdx,-0x50(%rbp)
  mov    %rcx,-0x58(%rbp)
  mov    %r8,-0x60(%rbp)
  mov    %r9,-0x68(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0xffffffff,-0x3c(%rbp)
  mov    -0x48(%rbp),%eax
  mov    %eax,%ecx
  lea    D103(%rip),%rax
  mov    %rax,%rdx
  mov    $0x400,%esi
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  call   <snprintf@plt>
  mov    %eax,-0x38(%rbp)
  cmpl   $0x0,-0x38(%rbp)
  jns    L62
  lea    D2(%rip),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <warnc@plt>
  jmp    L257
L62:
  mov    -0x38(%rbp),%edx
  mov    -0x44(%rbp),%eax
  lea    D27(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <write@plt>
  mov    %eax,-0x34(%rbp)
  cmpl   $0x0,-0x34(%rbp)
  jns    L285
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <warn@plt>
  jmp    L257
L285:
  mov    -0x34(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  je     L42
  lea    D2(%rip),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <warnc@plt>
  jmp    L257
L42:
  mov    -0x44(%rbp),%eax
  mov    $0x400,%edx
  lea    D27(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  mov    %eax,-0x34(%rbp)
  cmpl   $0x0,-0x34(%rbp)
  jns    L90
  lea    D44(%rip),%rax
  mov    %rax,%rdi
  call   <warn@plt>
  jmp    L257
L90:
  lea    D27(%rip),%rax
  mov    %rax,-0x30(%rbp)
  lea    -0x30(%rbp),%rax
  lea    D169(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strsep@plt>
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  je     L202
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  cmp    %eax,-0x48(%rbp)
  jne    L91
  lea    -0x30(%rbp),%rax
  lea    D169(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strsep@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L171
  lea    -0x30(%rbp),%rax
  lea    D169(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strsep@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L137
  lea    -0x30(%rbp),%rax
  lea    D169(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strsep@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L204
  mov    -0x30(%rbp),%rax
  mov    -0x68(%rbp),%rdx
  lea    D168(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  jne    L306
  mov    -0x30(%rbp),%rax
  test   %rax,%rax
  je     L203
  mov    -0x30(%rbp),%rax
  mov    $0x7e,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L108
L203:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,%rdx
  mov    -0x50(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x50(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L225
  lea    D61(%rip),%rax
  mov    %rax,%rdi
  call   <warn@plt>
  jmp    L257
L225:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,%rdx
  mov    -0x58(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x58(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L316
  lea    D61(%rip),%rax
  mov    %rax,%rdi
  call   <warn@plt>
  jmp    L257
L316:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,%rdx
  mov    -0x60(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L255
  lea    D61(%rip),%rax
  mov    %rax,%rdi
  call   <warn@plt>
  jmp    L257
L255:
  mov    -0x50(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L256
  mov    -0x58(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L256
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L240
L256:
  lea    D61(%rip),%rax
  mov    %rax,%rdi
  call   <warn@plt>
  jmp    L257
L240:
  movl   $0x0,-0x3c(%rbp)
L257:
  mov    -0x3c(%rbp),%eax
  jmp    L148
L202:
  nop
  jmp    L20
L91:
  nop
  jmp    L20
L171:
  nop
  jmp    L20
L137:
  nop
  jmp    L20
L204:
  nop
  jmp    L20
L306:
  nop
  jmp    L20
L108:
  nop
L20:
  mov    -0x34(%rbp),%eax
  lea    D27(%rip),%rdx
  mov    %rdx,%rcx
  mov    %eax,%edx
  lea    D5(%rip),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <warnc@plt>
  mov    -0x3c(%rbp),%eax
L148:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L49
  call   <__stack_chk_fail@plt>
L49:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D103
type_infered: string
name: parse_data
arguments: tag: D2
type_infered: string
name: parse_data
arguments: tag: D44
type_infered: string
name: parse_data
arguments: tag: D169
type_infered: string
name: parse_data
arguments: tag: D168
type_infered: string
name: parse_data
arguments: tag: D61
type_infered: string
name: parse_data
arguments: tag: D5
type_infered: string

tool: D103: N%d

tool: D2: write

tool: D44: read

tool: D169: ~

tool: D168: %1d

tool: D61: strdup

tool: D5: Invalid response: %*s

assistant: ```c
int get_slot_info(int so, int slot, char **manuf, char **version, char **device, int *state) {
  int rc = -1;
  int rv;
  static char buf[1024];
  int slen;
  char *s;
  char *sl;
  char *_manuf;
  char *_version;
  char *_device;
  if ((slen = snprintf(buf, sizeof buf, "N%d", slot)) < 0) {
    warnc(0, "write");
    goto err;
  }
  if ((rv = write(so, buf, slen)) < 0) {
    warn("write");
    goto err;
  } else if (rv != slen) {
    warnc(0, "write");
    goto err;
  }
  if ((rv = read(so, buf, sizeof buf)) < 0) {
    warn("read");
    goto err;
  }
  s = buf;
  if ((sl = strsep(&s, "~")) == NULL)
    goto parse_err;
  if (atoi(sl) != slot)
    goto parse_err;
  if ((_manuf = strsep(&s, "~")) == NULL)
    goto parse_err;
  if ((_version = strsep(&s, "~")) == NULL)
    goto parse_err;
  if ((_device = strsep(&s, "~")) == NULL)
    goto parse_err;
  if (sscanf(s, "%1d", state) != 1)
    goto parse_err;
  if (s != NULL && strchr(s, '~') != NULL)
    goto parse_err;
  if ((*manuf = strdup(_manuf)) == NULL) {
    warn("strdup");
    goto err;
  }
  if ((*version = strdup(_version)) == NULL) {
    warn("strdup");
    goto err;
  }
  if ((*device = strdup(_device)) == NULL) {
    warn("strdup");
    goto err;
  }
  if (*manuf == NULL || *version == NULL || *device == NULL) {
    warn("strdup");
    goto err;
  }
  rc = 0;
err:
  return rc;
parse_err:
  warnc(0, "Invalid response: %*s", rv, buf);
  return rc;
}
```