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

```asm
<get_library_address>:
  endbr64
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x230,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x228(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%r12
  call   <strlen@plt>
  mov    %eax,%ebp
  xor    %eax,%eax
  call   <getpid@plt>
  mov    $0x100,%esi
  mov    %r12,%rdi
  lea    D4(%rip),%rdx
  mov    %eax,%ecx
  call   <snprintf@plt>
  lea    D6(%rip),%rsi
  mov    %r12,%rdi
  call   <fopen@plt>
  test   %rax,%rax
  je     L0
  mov    %rax,%r12
  lea    0x120(%rsp),%rbx
  lea    D12(%rip),%r14
  nopl   0x0(%rax)
L64:
  mov    %r12,%rdx
  mov    $0x100,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L97
  mov    %rbx,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L119
  lea    -0x1(%rax),%edx
  movslq %edx,%rcx
  cmpb   $0xa,0x120(%rsp,%rcx,1)
  jne    L119
  movb   $0x0,0x120(%rsp,%rcx,1)
  mov    %edx,%eax
L119:
  cmp    %ebp,%eax
  jle    L64
  movslq %eax,%rdi
  movslq %ebp,%rdx
  mov    %r13,%rsi
  mov    %rdi,%rax
  sub    %rdx,%rax
  mov    %ebp,%edx
  lea    (%rbx,%rax,1),%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L64
  lea    0x8(%rsp),%rcx
  mov    %rsp,%rdx
  sub    $0x8,%rsp
  mov    %r14,%rsi
  lea    0x18(%rsp),%rax
  mov    %rbx,%rdi
  push   %rax
  lea    0x2f(%rsp),%rax
  push   %rax
  lea    0x36(%rsp),%rax
  push   %rax
  lea    0x3d(%rsp),%r9
  lea    0x3c(%rsp),%r8
  call   <sscanf@plt>
  add    $0x20,%rsp
  cmp    $0x7,%eax
  jne    L64
  cmpb   $0x72,0x1c(%rsp)
  jne    L64
  cmpb   $0x78,0x1e(%rsp)
  jne    L64
  mov    (%rsp),%r13
  sub    0x10(%rsp),%r13
  jmp    L27
  nopl   0x0(%rax,%rax,1)
L97:
  xor    %r13d,%r13d
L27:
  mov    %r12,%rdi
  call   <fclose@plt>
L61:
  mov    0x228(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L106
  add    $0x230,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L0:
  xor    %r13d,%r13d
  jmp    L61
L106:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D4
datatype: string
name: disassemble_data
arguments: data_tag: D6
datatype: string
name: disassemble_data
arguments: data_tag: D12
datatype: string

tool: D4: /proc/%d/smaps

tool: D6: rt

tool: D12: %zx-%zx %c%c%c%c %zx

assistant: ```c
size_t get_library_address(const char *libname) {
  char path[256];
  char buff[256];
  int len_libname = strlen(libname);
  FILE *file;
  size_t addr = 0;
  snprintf(path, sizeof path, "/proc/%d/smaps", getpid());
  file = fopen(path, "rt");
  if (file == NULL)
    return 0;
  while (fgets(buff, sizeof buff, file) != NULL) {
    int len = strlen(buff);
    if (len > 0 && buff[len - 1] == '\n') {
      buff[--len] = '\0';
    }
    if (len <= len_libname || memcmp(buff + len - len_libname, libname, len_libname))
      continue;
    size_t start, end, offset;
    char flags[4];
    if (sscanf(buff, "%zx-%zx %c%c%c%c %zx", &start, &end, &flags[0], &flags[1], &flags[2], &flags[3], &offset) != 7)
      continue;
    if (flags[0] != 'r' || flags[2] != 'x') {
      continue;
    }
    addr = start - offset;
    break;
  }
  fclose(file);
  return addr;
}
```