user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<getline_wrapped>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  movl   $0x100,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %eax,%edi
  lea    D5(%rip),%rax
  mov    %rax,%rcx
  mov    $0x1a,%edx
  lea    D8(%rip),%rax
  mov    %rax,%rsi
  call   <do_nofail@plt>
  mov    %rax,-0x8(%rbp)
L144:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <getc_unlocked@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x80,-0xc(%rbp)
  je     L133
  cmpl   $0x80,-0xc(%rbp)
  jg     L50
  cmpl   $0xa,-0xc(%rbp)
  je     L7
  cmpl   $0x5c,-0xc(%rbp)
  je     L114
  jmp    L50
L133:
  cmpl   $0x0,-0x10(%rbp)
  jne    L7
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L98
L7:
  cmpq   $0x0,-0x30(%rbp)
  je     L58
  mov    -0x30(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,(%rax)
L58:
  mov    -0x10(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jne    L101
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %eax,%edi
  lea    D4(%rip),%rax
  mov    %rax,%rcx
  mov    $0x2a,%edx
  lea    D8(%rip),%rax
  mov    %rax,%rsi
  call   <do_nofail@plt>
  mov    %rax,-0x8(%rbp)
L101:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  jmp    L98
L114:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <getc_unlocked@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0xa,-0xc(%rbp)
  jne    L50
  cmpq   $0x0,-0x30(%rbp)
  je     L3
  mov    -0x30(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L3
L50:
  mov    -0x10(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x10(%rbp)
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    -0xc(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jne    L144
  shll   -0x14(%rbp)
  mov    -0x14(%rbp),%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %eax,%edi
  lea    D53(%rip),%rax
  mov    %rax,%rcx
  mov    $0x3d,%edx
  lea    D8(%rip),%rax
  mov    %rax,%rsi
  call   <do_nofail@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L144
L3:
  nop
  jmp    L144
L98:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D5
type: string
name: unpack_data
arguments: data_label: D8
type: string
name: unpack_data
arguments: data_label: D4
type: string
name: unpack_data
arguments: data_label: D53
type: string

tool: D5: malloc(size)

tool: D8: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Distrotech/module-init-tools/refs/heads/master/usermode/module-init-tools-3.12/util.c

tool: D4: realloc(buf, size + 1)

tool: D53: realloc(buf, size)

assistant: ```c
char *getline_wrapped(FILE *file, unsigned int *linenum) {
  int size = 256;
  int i = 0;
  char *buf = do_nofail((malloc(size)), "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Distrotech/module-init-tools/refs/heads/master/usermode/module-init-tools-3.12/util.c", 26, "malloc(size)");
  for (;;) {
    int ch = getc_unlocked(file);
    switch (ch) {
    case EOF:
      if (i == 0) {
        free(buf);
        return NULL;
      }
    case '\n':
      if (linenum)
        (*linenum)++;
      if (i == size)
        buf = do_nofail((realloc(buf, size + 1)), "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Distrotech/module-init-tools/refs/heads/master/usermode/module-init-tools-3.12/util.c", 42, "realloc(buf, size + 1)");
      buf[i] = '\0';
      return buf;
    case '\\':
      ch = getc_unlocked(file);
      if (ch == '\n') {
        if (linenum)
          (*linenum)++;
        continue;
      }
    default:
      buf[i++] = ch;
      if (i == size) {
        size *= 2;
        buf = do_nofail((realloc(buf, size)), "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Distrotech/module-init-tools/refs/heads/master/usermode/module-init-tools-3.12/util.c", 61, "realloc(buf, size)");
      }
    }
  }
}
```