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

```asm
<get_swap_info>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  lea    D36(%rip),%rax
  mov    %rax,0x20(%rsp)
  movq   $0x9,0x28(%rsp)
  mov    %rdi,0x30(%rsp)
  lea    D76(%rip),%rax
  mov    %rax,0x38(%rsp)
  movq   $0x8,0x40(%rsp)
  mov    %rsi,0x48(%rsp)
  lea    D3(%rip),%rax
  mov    %rax,0x50(%rsp)
  movq   $0xa,0x58(%rsp)
  mov    %rdx,0x60(%rsp)
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  test   %rdi,%rdi
  setne  %al
  movzbl %al,%eax
  cmp    $0x1,%rsi
  sbb    $0xffffffffffffffff,%rax
  cmp    $0x1,%rdx
  sbb    $0xffffffffffffffff,%rax
  mov    %rax,0x8(%rsp)
  lea    D38(%rip),%rsi
  lea    D53(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%r15
  test   %rax,%rax
  jne    L70
  lea    D32(%rip),%rdi
  call   <warn@plt>
  mov    $0x1,%eax
  jmp    L98
L94:
  add    $0x18,%rbx
  cmp    %r13,%rbx
  je     L22
L82:
  mov    0x10(%rbx),%rbp
  test   %rbp,%rbp
  je     L94
  mov    0x8(%rbx),%r12
  mov    %r12,%rdx
  mov    (%rbx),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L94
  lea    0x1(%r14,%r12,1),%rdi
  mov    %rbp,%rdx
  lea    D15(%rip),%rsi
  call   <sscanf@plt>
  subq   $0x1,0x8(%rsp)
L70:
  cmpq   $0x0,0x8(%rsp)
  je     L104
  lea    0x10(%rsp),%rax
  mov    %rax,(%rsp)
L22:
  lea    0x18(%rsp),%rdi
  mov    %r15,%rdx
  mov    (%rsp),%rsi
  call   <getline@plt>
  test   %rax,%rax
  js     L104
  mov    0x18(%rsp),%r14
  lea    0x20(%rsp),%rbx
  lea    0x68(%rsp),%r13
  jmp    L82
L104:
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  mov    %r15,%rdi
  call   <ferror@plt>
  test   %rax,%rax
  jne    L108
  mov    %r15,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
L98:
  mov    0x68(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L15
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L108:
  lea    D13(%rip),%rdi
  call   <warn@plt>
  mov    $0x1,%eax
  jmp    L98
L15:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D36
type_guessed: string
name: read_data
arguments: data_label: D76
type_guessed: string
name: read_data
arguments: data_label: D3
type_guessed: string
name: read_data
arguments: data_label: D38
type_guessed: string
name: read_data
arguments: data_label: D53
type_guessed: string
name: read_data
arguments: data_label: D32
type_guessed: string
name: read_data
arguments: data_label: D15
type_guessed: string
name: read_data
arguments: data_label: D13
type_guessed: string

tool: D36: SwapTotal

tool: D76: SwapFree

tool: D3: SwapCached

tool: D38: r

tool: D53: /proc/meminfo

tool: D32: fopen '/proc/meminfo':

tool: D15: %ld kB


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