user: Please show me the C implementation that matches the assembly code listed below:

```asm
<is_vma_lock_on_fault>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  lea    D50(%rip),%rsi
  call   <is_vmflag_set@plt>
  test   %eax,%eax
  jne    L58
L116:
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  mov    $0x0,%ebp
  jmp    L12
L58:
  mov    %rbx,%rdi
  call   <seek_to_smaps_entry@plt>
  mov    %rax,%rbx
  lea    D39(%rip),%rbp
  test   %rax,%rax
  je     L95
L108:
  lea    0x20(%rsp),%rsi
  lea    0x18(%rsp),%rdi
  mov    %rbx,%rdx
  call   <getline@plt>
  test   %rax,%rax
  jle    L132
  mov    %rbp,%rsi
  mov    0x18(%rsp),%rdi
  call   <strstr@plt>
  test   %eax,%eax
  je     L134
  mov    0x18(%rsp),%rbp
  lea    D39(%rip),%rdi
  call   <strlen@plt>
  lea    0x8(%rsp),%rdx
  cltq
  lea    0x0(%rbp,%rax,1),%rdi
  lea    D91(%rip),%rsi
  call   <sscanf@plt>
  test   %eax,%eax
  jle    L114
L132:
  lea    D95(%rip),%rbp
L28:
  lea    0x20(%rsp),%rsi
  lea    0x18(%rsp),%rdi
  mov    %rbx,%rdx
  call   <getline@plt>
  test   %rax,%rax
  jle    L6
  mov    %rbp,%rsi
  mov    0x18(%rsp),%rdi
  call   <strstr@plt>
  test   %eax,%eax
  je     L143
  mov    0x18(%rsp),%rbp
  lea    D95(%rip),%rdi
  call   <strlen@plt>
  lea    0x10(%rsp),%rdx
  cltq
  lea    0x0(%rbp,%rax,1),%rdi
  lea    D91(%rip),%rsi
  call   <sscanf@plt>
  test   %eax,%eax
  jle    L90
L6:
  mov    0x8(%rsp),%rax
  cmp    %rax,0x10(%rsp)
  setb   %bpl
  movzbl %bpl,%ebp
L136:
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
L12:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L149
  mov    %ebp,%eax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  ret
L95:
  lea    D73(%rip),%rdi
  call   <printf@plt>
  jmp    L116
L134:
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  jmp    L108
L114:
  lea    D40(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%ebp
  jmp    L136
L143:
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  jmp    L28
L90:
  lea    D68(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%ebp
  jmp    L136
L149:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D50
type_infered: string
name: retrieve_data
arguments: label: D39
type_infered: string
name: retrieve_data
arguments: label: D91
type_infered: string
name: retrieve_data
arguments: label: D95
type_infered: string
name: retrieve_data
arguments: label: D73
type_infered: string
name: retrieve_data
arguments: label: D40
type_infered: string
name: retrieve_data
arguments: label: D68
type_infered: string

tool: D50: lo

tool: D39: Size:

tool: D91: %lu kB

tool: D95: Rss:

tool: D73: Unable to parse /proc/self/smaps


tool: D40: Unable to parse smaps entry for Size


tool: D68: Unable to parse smaps entry for Rss


assistant: ```c
bool is_vma_lock_on_fault(unsigned long addr) {
  bool ret = false;
  bool locked;
  FILE *smaps = NULL;
  unsigned long vma_size, vma_rss;
  char *line = NULL;
  char *value;
  size_t size = 0;
  locked = is_vmflag_set(addr, "lo");
  if (!locked)
    goto out;
  smaps = seek_to_smaps_entry(addr);
  if (!smaps) {
    printf("Unable to parse /proc/self/smaps\n");
    goto out;
  }
  while (getline(&line, &size, smaps) > 0) {
    if (!strstr(line, "Size:")) {
      free(line);
      line = NULL;
      size = 0;
      continue;
    }
    value = line + strlen("Size:");
    if (sscanf(value, "%lu kB", &vma_size) < 1) {
      printf("Unable to parse smaps entry for Size\n");
      goto out;
    }
    break;
  }
  while (getline(&line, &size, smaps) > 0) {
    if (!strstr(line, "Rss:")) {
      free(line);
      line = NULL;
      size = 0;
      continue;
    }
    value = line + strlen("Rss:");
    if (sscanf(value, "%lu kB", &vma_rss) < 1) {
      printf("Unable to parse smaps entry for Rss\n");
      goto out;
    }
    break;
  }
  ret = locked && (vma_rss < vma_size);
out:
  free(line);
  if (smaps)
    fclose(smaps);
  return ret;
}
```