user: Converte this assembly snippet into its equivalent C code:

```asm
<is_vma_lock_on_fault>:
  endbr64
  push   %r14
  lea    D63(%rip),%rsi
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  call   <is_vmflag_set@plt>
  test   %eax,%eax
  jne    L77
  mov    0x18(%rsp),%rdi
  mov    %eax,%r12d
  call   <free@plt>
L124:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L91
  add    $0x30,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  cs nopw 0x0(%rax,%rax,1)
L77:
  mov    %rbp,%rdi
  lea    0x20(%rsp),%rbx
  lea    0x18(%rsp),%r12
  call   <seek_to_smaps_entry@plt>
  lea    D64(%rip),%r14
  mov    %rax,%rbp
  test   %rax,%rax
  je     L126
L0:
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <getline@plt>
  test   %rax,%rax
  jle    L42
  mov    0x18(%rsp),%rdi
  mov    %r14,%rsi
  call   <strstr@plt>
  test   %eax,%eax
  je     L43
  mov    %r14,%rdi
  mov    0x18(%rsp),%r13
  call   <strlen@plt>
  lea    0x8(%rsp),%rdx
  lea    D48(%rip),%rsi
  cltq
  lea    0x0(%r13,%rax,1),%rdi
  call   <sscanf@plt>
  test   %eax,%eax
  jle    L2
L42:
  lea    D51(%rip),%r13
L102:
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <getline@plt>
  test   %rax,%rax
  jle    L72
  mov    0x18(%rsp),%rdi
  mov    %r13,%rsi
  call   <strstr@plt>
  test   %eax,%eax
  je     L125
  mov    %r13,%rdi
  mov    0x18(%rsp),%rbx
  call   <strlen@plt>
  lea    0x10(%rsp),%rdx
  lea    D48(%rip),%rsi
  cltq
  lea    (%rbx,%rax,1),%rdi
  call   <sscanf@plt>
  test   %eax,%eax
  jle    L35
L72:
  xor    %r12d,%r12d
  mov    0x8(%rsp),%rax
  cmp    %rax,0x10(%rsp)
  setb   %r12b
L87:
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  jmp    L124
  nopl   (%rax)
L43:
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  jmp    L0
  nopl   0x0(%rax)
L125:
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  jmp    L102
  nopl   0x0(%rax)
L2:
  lea    D8(%rip),%rdi
  xor    %r12d,%r12d
  call   <printf@plt>
  jmp    L87
  nopl   0x0(%rax)
L35:
  lea    D79(%rip),%rdi
  xor    %r12d,%r12d
  call   <printf@plt>
  jmp    L87
  nopl   0x0(%rax)
L126:
  lea    D68(%rip),%rdi
  xor    %r12d,%r12d
  call   <printf@plt>
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  jmp    L124
L91:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D63
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D64
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D48
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D51
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D8
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D79
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D68
type_guessed: string

tool: D63: lo

tool: D64: Size:

tool: D48: %lu kB

tool: D51: Rss:

tool: D8: Unable to parse smaps entry for Size


tool: D79: Unable to parse smaps entry for Rss


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


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;
}
```