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

```asm
<get_swap_info>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xa0,%rsp
  mov    %rdi,-0x88(%rbp)
  mov    %rsi,-0x90(%rbp)
  mov    %rdx,-0x98(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D17(%rip),%rax
  mov    %rax,-0x50(%rbp)
  movq   $0x9,-0x48(%rbp)
  mov    -0x88(%rbp),%rax
  mov    %rax,-0x40(%rbp)
  lea    D22(%rip),%rax
  mov    %rax,-0x38(%rbp)
  movq   $0x8,-0x30(%rbp)
  mov    -0x90(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  lea    D63(%rip),%rax
  mov    %rax,-0x20(%rbp)
  movq   $0xa,-0x18(%rbp)
  mov    -0x98(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movq   $0x0,-0x78(%rbp)
  movq   $0x0,-0x70(%rbp)
  movq   $0x0,-0x68(%rbp)
  movq   $0x0,-0x60(%rbp)
  jmp    L23
L30:
  mov    -0x68(%rbp),%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  add    %rbp,%rax
  sub    $0x40,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L5
  addq   $0x1,-0x60(%rbp)
L5:
  addq   $0x1,-0x68(%rbp)
L23:
  cmpq   $0x2,-0x68(%rbp)
  jbe    L30
  lea    D39(%rip),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x58(%rbp)
  cmpq   $0x0,-0x58(%rbp)
  jne    L45
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  call   <warn@plt>
  mov    $0x1,%eax
  jmp    L56
L86:
  movq   $0x0,-0x68(%rbp)
  jmp    L93
L4:
  mov    -0x68(%rbp),%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  add    %rbp,%rax
  sub    $0x40,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L34
  mov    -0x68(%rbp),%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  add    %rbp,%rax
  sub    $0x48,%rax
  mov    (%rax),%rdx
  mov    -0x68(%rbp),%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x3,%rax
  add    %rbp,%rax
  sub    $0x50,%rax
  mov    (%rax),%rcx
  mov    -0x70(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L34
  mov    -0x68(%rbp),%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  add    %rbp,%rax
  sub    $0x40,%rax
  mov    (%rax),%rdx
  mov    -0x70(%rbp),%rsi
  mov    -0x68(%rbp),%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x3,%rax
  add    %rbp,%rax
  sub    $0x48,%rax
  mov    (%rax),%rax
  add    $0x1,%rax
  add    %rsi,%rax
  lea    D59(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  subq   $0x1,-0x60(%rbp)
  jmp    L45
L34:
  addq   $0x1,-0x68(%rbp)
L93:
  cmpq   $0x2,-0x68(%rbp)
  jbe    L4
L45:
  cmpq   $0x0,-0x60(%rbp)
  je     L38
  mov    -0x58(%rbp),%rdx
  lea    -0x78(%rbp),%rcx
  lea    -0x70(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <getline@plt>
  test   %rax,%rax
  jns    L86
L38:
  mov    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <ferror@plt>
  test   %rax,%rax
  je     L70
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  call   <warn@plt>
  mov    $0x1,%eax
  jmp    L56
L70:
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
L56:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L55
  call   <__stack_chk_fail@plt>
L55:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D17
type_infered: string
name: read_data
arguments: label: D22
type_infered: string
name: read_data
arguments: label: D63
type_infered: string
name: read_data
arguments: label: D39
type_infered: string
name: read_data
arguments: label: D37
type_infered: string
name: read_data
arguments: label: D27
type_infered: string
name: read_data
arguments: label: D59
type_infered: string
name: read_data
arguments: label: D25
type_infered: string

tool: D17: SwapTotal

tool: D22: SwapFree

tool: D63: SwapCached

tool: D39: r

tool: D37: /proc/meminfo

tool: D27: fopen '/proc/meminfo':

tool: D59: %ld kB


tool: D25: getline '/proc/meminfo':

assistant: ```c
int get_swap_info(long *s_total, long *s_free, long *s_cached) {
  FILE *fp;
  struct {
    const char *name;
    const size_t len;
    long *var;
  } ent[] = {
      {"SwapTotal", sizeof("SwapTotal") - 1, s_total},
      {"SwapFree", sizeof("SwapFree") - 1, s_free},
      {"SwapCached", sizeof("SwapCached") - 1, s_cached},
  };
  size_t line_len = 0, i, left;
  char *line = NULL;
  for (i = 0, left = 0; i < (sizeof(ent) / sizeof *(ent)); i++) {
    if (ent[i].var) {
      left++;
    }
  }
  if (!(fp = fopen("/proc/meminfo", "r"))) {
    warn("fopen '/proc/meminfo':");
    return 1;
  }
  while (left > 0 && getline(&line, &line_len, fp) >= 0) {
    for (i = 0; i < (sizeof(ent) / sizeof *(ent)); i++) {
      if (ent[i].var && !strncmp(line, ent[i].name, ent[i].len)) {
        sscanf(line + ent[i].len + 1, "%ld kB\n", ent[i].var);
        left--;
        break;
      }
    }
  }
  free(line);
  if (ferror(fp)) {
    warn("getline '/proc/meminfo':");
    return 1;
  }
  fclose(fp);
  return 0;
}
```