user: Demonstrate the C code that generates the assembly output below:

```asm
<getline>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %rdi,%rdi
  je     L3
  mov    %rsi,%rbp
  test   %rsi,%rsi
  je     L3
  mov    %rdi,%rbx
  mov    (%rdi),%rdi
  mov    %rdx,%r13
  test   %rdi,%rdi
  je     L124
  mov    (%rsi),%rsi
  test   %rsi,%rsi
  je     L124
  cmp    $0x3c,%rsi
  jbe    L24
  call   <fgets@plt>
  test   %rax,%rax
  je     L201
  mov    %r13,%rdi
  xor    %r15d,%r15d
  xor    %r12d,%r12d
  xor    %r14d,%r14d
  call   <feof@plt>
  test   %rax,%rax
  je     L174
L94:
  mov    (%rbx),%rdi
  add    %r14,%rdi
  call   <strlen@plt>
  add    %eax,%r12d
  jmp    L32
  xchg   %ax,%ax
L124:
  movq   $0x0,(%rbx)
  xor    %edi,%edi
  mov    $0x78,%esi
  movq   $0x0,0x0(%rbp)
  call   <realloc@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L50
  mov    %rax,(%rbx)
  mov    %r13,%rdx
  mov    $0x78,%esi
  movq   $0x78,0x0(%rbp)
  call   <fgets@plt>
  test   %rax,%rax
  je     L26
  mov    $0x1,%r15d
  xor    %r12d,%r12d
  xor    %r14d,%r14d
L178:
  mov    %r13,%rdi
  call   <feof@plt>
  test   %rax,%rax
  jne    L94
L174:
  mov    (%rbx),%rdi
  mov    %r14,%rdx
  mov    $0xa,%esi
  not    %rdx
  add    0x0(%rbp),%rdx
  add    %r14,%rdi
  call   <memchr@plt>
  test   %rax,%rax
  je     L152
  sub    (%rbx),%rax
  lea    0x1(%rax),%r12d
L32:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L152:
  mov    0x0(%rbp),%rsi
  mov    (%rbx),%rdi
  lea    -0x1(%rsi),%r12d
L75:
  mov    $0x78,%r14d
  cmp    $0x3b,%rsi
  jbe    L62
  lea    (%rsi,%rsi,1),%r14d
L62:
  mov    %r14d,%esi
  call   <realloc@plt>
  mov    %rax,%rdx
  test   %rax,%rax
  je     L99
  mov    %rax,(%rbx)
  movslq %r14d,%rax
  movslq %r12d,%r14
  mov    %rax,0x0(%rbp)
  sub    %r14,%rax
  lea    (%rdx,%r14,1),%rdi
  mov    %r13,%rdx
  mov    %rax,%rsi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L178
  mov    %r13,%rdi
  call   <feof@plt>
  test   %r12d,%r12d
  je     L99
  test   %rax,%rax
  jne    L32
L99:
  test   %r15d,%r15d
  je     L144
  nopw   0x0(%rax,%rax,1)
L50:
  mov    (%rbx),%rdi
  mov    $0xffffffff,%r12d
  call   <free@plt>
  movq   $0x0,(%rbx)
  movq   $0x0,0x0(%rbp)
  jmp    L32
  nopw   0x0(%rax,%rax,1)
L201:
  mov    %r13,%rdi
  call   <feof@plt>
L144:
  mov    $0xffffffff,%r12d
  jmp    L32
  nopl   0x0(%rax,%rax,1)
L26:
  mov    %r13,%rdi
  call   <feof@plt>
  jmp    L50
  nopw   0x0(%rax,%rax,1)
L3:
  mov    D3(%rip),%rax
  mov    $0xffffffff,%r12d
  mov    (%rax),%edx
  mov    D2(%rip),%rax
  mov    %edx,(%rax)
  jmp    L32
L24:
  xor    %r15d,%r15d
  xor    %r12d,%r12d
  jmp    L75
```

assistant: ```c
ssize_t getline(char **buf, size_t *len, FILE *stream) {
  int i = 0, new_len, my_malloc = 0;
  char *nl, *new_buf;
  if (buf == NULL || len == NULL) {
    errno = EINVAL;
    return -1;
  }
  if (*buf == NULL || *len == 0) {
    *buf = NULL;
    *len = 0;
    my_malloc = 1;
  }
  if (*len <= 60)
    goto alloc;
  while (1) {
    if (fgets(*buf + i, *len - i, stream) == NULL) {
      if (!feof(stream) || i == 0) {
        goto error;
      } else {
        return i;
      }
    }
    if (feof(stream)) {
      return i + strlen(*buf + i);
    }
    if ((nl = memchr(*buf + i, '\n', *len - i - 1)) == NULL) {
      i = *len - 1;
    alloc:
      new_len = *len < 60 ? 120 : *len * 2;
      if ((new_buf = realloc(*buf, new_len)) == NULL)
        goto error;
      *buf = new_buf;
      *len = new_len;
    } else {
      return nl - *buf + 1;
    }
  }
error:
  if (my_malloc) {
    free(*buf);
    *buf = NULL;
    *len = 0;
  }
  return -1;
}
```