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

```asm
<get_line>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x18,%rsp
  mov    (%rdi),%r15
  mov    %rcx,(%rsp)
L241:
  mov    (%rbx),%rax
  xor    %ebp,%ebp
  jmp    L192
  nopl   0x0(%rax)
L32:
  mov    (%r12),%r15
  lea    (%r15,%rbp,1),%rdi
  call   <strlen@plt>
  add    %rax,%rbp
  mov    (%rbx),%rax
  lea    -0x1(%rax),%rdx
  cmp    %rbp,%rdx
  jne    L166
  lea    -0x2(%rax),%rdx
  lea    (%r15,%rdx,1),%rcx
  cmpb   $0xa,(%rcx)
  je     L234
L192:
  mov    %rax,%rsi
  sub    %rbp,%rsi
  cmp    $0x9,%rsi
  ja     L210
  mov    %r15,%rdi
  lea    0x50(%rax,%rax,1),%rsi
  call   <realloc@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L318
  mov    %rax,(%r12)
  mov    (%rbx),%rax
  lea    0x50(%rax,%rax,1),%rsi
  mov    %rsi,(%rbx)
  sub    %rbp,%rsi
L210:
  lea    (%r15,%rbp,1),%rdi
  mov    %r13,%rdx
  call   <fgets@plt>
  test   %eax,%eax
  jne    L32
  mov    %r13,%rdi
  call   <ferror@plt>
  or     %rbp,%rax
  je     L318
  mov    %r13,%rdi
  call   <ferror@plt>
  test   %rax,%rax
  je     L32
  nopw   0x0(%rax,%rax,1)
L318:
  xor    %eax,%eax
L223:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L166:
  test   %rbp,%rbp
  je     L3
  lea    -0x1(%rbp),%rdx
  lea    (%r15,%rdx,1),%rcx
  cmpb   $0xa,(%rcx)
  je     L244
  add    %rbp,%r15
L3:
  mov    (%rsp),%rax
  xor    %edi,%edi
  addl   $0x1,(%rax)
  cmpb   $0x0,(%r15)
  sete   %dil
  xor    %r15d,%r15d
  call   <assert@plt>
  mov    (%r12),%rdi
  jmp    L218
  nopl   0x0(%rax,%rax,1)
L26:
  cmpb   $0x0,(%rsi)
  lea    0x1(%r15),%rax
  je     L337
  mov    %rax,%r15
L218:
  movsbl (%rdi,%r15,1),%edi
  call   <isspace@plt>
  mov    (%r12),%rdi
  lea    (%rdi,%r15,1),%rsi
  test   %rax,%rax
  jne    L26
L337:
  mov    %rbp,%r8
  sub    %r15,%r8
  lea    0x1(%r8),%rdx
  mov    %r8,0x8(%rsp)
  call   <memmove@plt>
  mov    (%r12),%r15
  cmpb   $0x23,(%r15)
  je     L241
  mov    0x8(%rsp),%r8
  lea    -0x1(%r8),%rbp
  add    %rbp,%r15
  mov    %rbp,%r14
  movsbl (%r15),%edi
  cmp    $0x5c,%dil
  jne    L68
L13:
  movb   $0x0,(%r15)
  mov    (%rbx),%rax
  mov    (%r12),%rbp
  jmp    L97
  nop
L51:
  mov    (%r12),%rbp
  lea    0x0(%rbp,%r14,1),%rdi
  call   <strlen@plt>
  add    %rax,%r14
  mov    (%rbx),%rax
  lea    -0x1(%rax),%rdx
  cmp    %r14,%rdx
  jne    L8
  lea    -0x2(%rax),%r8
  lea    0x0(%rbp,%r8,1),%rdx
  cmpb   $0xa,(%rdx)
  je     L121
L97:
  mov    %rax,%rsi
  sub    %r14,%rsi
  cmp    $0x9,%rsi
  ja     L160
  mov    %rbp,%rdi
  lea    0x50(%rax,%rax,1),%rsi
  call   <realloc@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L318
  mov    %rax,(%r12)
  mov    (%rbx),%rax
  lea    0x50(%rax,%rax,1),%rsi
  mov    %rsi,(%rbx)
  sub    %r14,%rsi
L160:
  lea    0x0(%rbp,%r14,1),%rdi
  mov    %r13,%rdx
  call   <fgets@plt>
  test   %eax,%eax
  jne    L51
  mov    %r13,%rdi
  call   <ferror@plt>
  or     %r14,%rax
  je     L318
  mov    %r13,%rdi
  call   <ferror@plt>
  test   %rax,%rax
  je     L51
  jmp    L318
  nopw   0x0(%rax,%rax,1)
L275:
  movsbl -0x2(%rax,%r8,1),%edi
  mov    %rbp,%r8
  sub    $0x1,%rbp
L68:
  mov    %r8,(%rsp)
  call   <isspace@plt>
  mov    (%rsp),%r8
  test   %rax,%rax
  mov    (%r12),%rax
  jne    L275
  movb   $0x0,(%rax,%r8,1)
  mov    $0x1,%eax
  jmp    L223
  nopw   0x0(%rax,%rax,1)
L8:
  test   %r14,%r14
  je     L320
  lea    -0x1(%r14),%r8
  lea    0x0(%rbp,%r8,1),%rdx
  cmpb   $0xa,(%rdx)
  je     L38
  mov    %r8,%rax
  add    %r14,%rbp
  mov    %r14,%r8
  mov    %rax,%r14
L102:
  mov    (%rsp),%rax
  xor    %edi,%edi
  mov    %r8,0x8(%rsp)
  addl   $0x1,(%rax)
  cmpb   $0x0,0x0(%rbp)
  sete   %dil
  call   <assert@plt>
  mov    (%r12),%r15
  mov    0x8(%rsp),%r8
  add    %r14,%r15
  movsbl (%r15),%edi
  cmp    $0x5c,%dil
  je     L13
  lea    -0x1(%r8),%rbp
  jmp    L68
  nopl   0x0(%rax)
L121:
  test   %r14,%r14
  jne    L38
L320:
  xor    %r8d,%r8d
  mov    $0xffffffffffffffff,%r14
  jmp    L102
  nopl   0x0(%rax)
L234:
  test   %rbp,%rbp
  je     L3
L244:
  movb   $0x0,(%rcx)
  mov    (%r12),%r15
  mov    %rdx,%rbp
  add    %rdx,%r15
  jmp    L3
L38:
  movb   $0x0,(%rdx)
  mov    (%r12),%rbp
  lea    -0x1(%r8),%r14
  add    %r8,%rbp
  jmp    L102
```

assistant: ```c
int get_line(char **result, size_t *result_len, FILE *f, int *line) {
  size_t pos;
  do {
    pos = 0;
    do {
      if (*result_len - pos < 10) {
        char *newstr = realloc(*result, *result_len * 2 + 80);
        if (newstr == NULL) {
          return 0;
        }
        *result = newstr;
        *result_len = *result_len * 2 + 80;
      }
      if (!fgets(*result + pos, *result_len - pos, f)) {
        if (ferror(f) == 0 && pos == 0)
          return 0;
        if (ferror(f) != 0)
          return 0;
      }
      pos += strlen(*result + pos);
    } while (pos == *result_len - 1 && (*result)[pos - 1] != '\n');
    if (pos != 0 && (*result)[pos - 1] == '\n') {
      (*result)[--pos] = '\0';
    }
    (*line)++;
    assert((*result)[pos] == '\0');
    {
      int first = 0;
      while (isspace((*result)[first]) && (*result)[first]) {
        first++;
      }
      memmove(*result, *result + first, pos - first + 1);
      pos -= first;
    }
  } while ((*result)[0] == '#');
  while ((*result)[pos - 1] == '\\') {
    (*result)[--pos] = '\0';
    do {
      if (*result_len - pos < 10) {
        char *newstr = realloc(*result, *result_len * 2 + 80);
        if (newstr == NULL) {
          return 0;
        }
        *result = newstr;
        *result_len = *result_len * 2 + 80;
      }
      if (!fgets(*result + pos, *result_len - pos, f)) {
        if (ferror(f) == 0 && pos == 0)
          return 0;
        if (ferror(f) != 0)
          return 0;
      }
      pos += strlen(*result + pos);
    } while (pos == *result_len - 1 && (*result)[pos - 1] != '\n');
    if (pos != 0 && (*result)[pos - 1] == '\n') {
      (*result)[--pos] = '\0';
    }
    (*line)++;
    assert((*result)[pos] == '\0');
  }
  while (isspace((*result)[pos - 1])) {
    pos--;
  }
  (*result)[pos] = '\0';
  return 1;
}
```