user: 请从给定的汇编指令推导出C源代码:

```asm
<rdr_readline>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <feof@plt>
  test   %rax,%rax
  je     L113
  mov    $0x0,%eax
  jmp    L56
L113:
  movl   $0x0,-0x10(%rbp)
  movl   $0x10,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <xmalloc@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L40
L81:
  mov    -0xc(%rbp),%eax
  sub    -0x10(%rbp),%eax
  mov    -0x10(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x8(%rbp),%rdx
  add    %rdx,%rcx
  mov    -0x18(%rbp),%rdx
  mov    %eax,%esi
  mov    %rcx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L116
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <ferror@plt>
  test   %rax,%rax
  je     L112
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  call   <pfatal@plt>
L112:
  cmpl   $0x0,-0x10(%rbp)
  jne    L15
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L56
L116:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0xc(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x10(%rbp)
  jne    L69
  mov    -0x10(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  je     L69
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0xc(%rbp),%xmm1
  movsd  D7(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <xrealloc@plt>
  mov    %rax,-0x8(%rbp)
  nop
L40:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <feof@plt>
  test   %rax,%rax
  je     L81
  jmp    L125
L15:
  nop
  jmp    L125
L69:
  nop
L125:
  mov    -0x10(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L97
  subl   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L97:
  mov    -0x10(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <xrealloc@plt>
L56:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D0
type_guessed: string
name: read_data
arguments: label: D7
type_guessed: f64

tool: D0: cannot read from file

tool: D7: 1.4

assistant: ```c
char *rdr_readline(FILE *file) {
  if (feof(file))
    return NULL;
  uint32_t len = 0, size = 16;
  char *buffer = xmalloc(size);
  while (!feof(file)) {
    if (fgets(buffer + len, size - len, file) == NULL) {
      if (ferror(file))
        pfatal("cannot read from file");
      if (len == 0) {
        free(buffer);
        return NULL;
      }
      break;
    }
    len += strlen(buffer + len);
    if (len == size - 1 && buffer[len - 1] != '\n') {
      size = size * 1.4;
      buffer = xrealloc(buffer, size);
      continue;
    }
    break;
  }
  if (buffer[len - 1] == '\n')
    buffer[--len] = '\0';
  return xrealloc(buffer, len + 1);
}
```