user: 请将以下的汇编代码转换成C语言代码：

```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    D23(%rip),%rdx
  mov    %eax,%ecx
  call   <snprintf@plt>
  lea    D3(%rip),%rsi
  mov    %r12,%rdi
  call   <fopen@plt>
  test   %rax,%rax
  je     L64
  mov    %rax,%r12
  lea    0x120(%rsp),%rbx
  lea    D13(%rip),%r14
  nopl   0x0(%rax)
L114:
  mov    %r12,%rdx
  mov    $0x100,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L88
  mov    %rbx,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L6
  lea    -0x1(%rax),%edx
  movslq %edx,%rcx
  cmpb   $0xa,0x120(%rsp,%rcx,1)
  jne    L6
  movb   $0x0,0x120(%rsp,%rcx,1)
  mov    %edx,%eax
L6:
  cmp    %ebp,%eax
  jle    L114
  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    L114
  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    L114
  cmpb   $0x72,0x1c(%rsp)
  jne    L114
  cmpb   $0x78,0x1e(%rsp)
  jne    L114
  mov    (%rsp),%r13
  sub    0x10(%rsp),%r13
  jmp    L72
  nopl   0x0(%rax,%rax,1)
L88:
  xor    %r13d,%r13d
L72:
  mov    %r12,%rdi
  call   <fclose@plt>
L20:
  mov    0x228(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L90
  add    $0x230,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L64:
  xor    %r13d,%r13d
  jmp    L20
L90:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D23
type: string
name: disassemble_data
arguments: data_label: D3
type: string
name: disassemble_data
arguments: data_label: D13
type: string

tool: D23: /proc/%d/smaps

tool: D3: rt

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