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

```asm
<get_slot_info>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,%r14d
  mov    %esi,%r13d
  mov    %rdx,%rbx
  mov    %rcx,%rbp
  mov    %r8,0x8(%rsp)
  mov    %r9,(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %esi,%ecx
  lea    D118(%rip),%rdx
  mov    $0x400,%esi
  lea    D100(%rip),%rdi
  call   <snprintf@plt>
  test   %eax,%eax
  js     L165
  mov    %eax,%r12d
  mov    %eax,%edx
  lea    D100(%rip),%rsi
  mov    %r14d,%edi
  call   <write@plt>
  test   %eax,%eax
  js     L223
  cmp    %eax,%r12d
  jne    L243
  mov    $0x400,%edx
  lea    D100(%rip),%rsi
  mov    %r14d,%edi
  call   <read@plt>
  mov    %eax,%r15d
  test   %eax,%eax
  js     L23
  lea    D100(%rip),%rax
  mov    %rax,0x10(%rsp)
  lea    0x10(%rsp),%rdi
  lea    D146(%rip),%rsi
  call   <strsep@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L76
  call   <atoi@plt>
  cmp    %r13d,%eax
  jne    L76
  lea    0x10(%rsp),%rdi
  lea    D146(%rip),%rsi
  call   <strsep@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L76
  lea    0x10(%rsp),%rdi
  lea    D146(%rip),%rsi
  call   <strsep@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L76
  lea    0x10(%rsp),%rdi
  lea    D146(%rip),%rsi
  call   <strsep@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L76
  mov    (%rsp),%rdx
  lea    D96(%rip),%rsi
  mov    0x10(%rsp),%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  jne    L76
  mov    0x10(%rsp),%rdi
  test   %rdi,%rdi
  je     L89
  mov    $0x7e,%esi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L76
L89:
  mov    %r12,%rdi
  call   <strdup@plt>
  mov    %rax,(%rbx)
  test   %rax,%rax
  je     L226
  mov    %r13,%rdi
  call   <strdup@plt>
  mov    %rax,0x0(%rbp)
  test   %rax,%rax
  je     L106
  mov    %r14,%rdi
  call   <strdup@plt>
  mov    0x8(%rsp),%rcx
  mov    %rax,(%rcx)
  test   %rax,%rax
  je     L228
  cmpq   $0x0,(%rbx)
  je     L240
  cmpq   $0x0,0x0(%rbp)
  je     L240
  mov    $0x0,%eax
L230:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L1
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L165:
  lea    D190(%rip),%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <warnc@plt>
  mov    $0xffffffff,%eax
  jmp    L230
L223:
  lea    D190(%rip),%rdi
  call   <warn@plt>
  mov    $0xffffffff,%eax
  jmp    L230
L243:
  lea    D190(%rip),%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <warnc@plt>
  mov    $0xffffffff,%eax
  jmp    L230
L23:
  lea    D163(%rip),%rdi
  call   <warn@plt>
  mov    $0xffffffff,%eax
  jmp    L230
L226:
  lea    D49(%rip),%rdi
  call   <warn@plt>
  mov    $0xffffffff,%eax
  jmp    L230
L106:
  lea    D49(%rip),%rdi
  call   <warn@plt>
  mov    $0xffffffff,%eax
  jmp    L230
L228:
  lea    D49(%rip),%rdi
  call   <warn@plt>
  mov    $0xffffffff,%eax
  jmp    L230
L240:
  lea    D49(%rip),%rdi
  call   <warn@plt>
  mov    $0xffffffff,%eax
  jmp    L230
L76:
  lea    D100(%rip),%rcx
  mov    %r15d,%edx
  lea    D47(%rip),%rsi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <warnc@plt>
  mov    $0xffffffff,%eax
  jmp    L230
L1:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D118
datatype: string
name: extract_symbolic_data
arguments: data_label: D146
datatype: string
name: extract_symbolic_data
arguments: data_label: D96
datatype: string
name: extract_symbolic_data
arguments: data_label: D190
datatype: string
name: extract_symbolic_data
arguments: data_label: D163
datatype: string
name: extract_symbolic_data
arguments: data_label: D49
datatype: string
name: extract_symbolic_data
arguments: data_label: D47
datatype: string

tool: D118: N%d

tool: D146: ~

tool: D96: %1d

tool: D190: write

tool: D163: read

tool: D49: strdup

tool: D47: 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;
}
```