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

```asm
<get_next_line>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x810,%rsp
  mov    %edi,-0x804(%rbp)
  mov    %rsi,-0x810(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x1,-0x7fc(%rbp)
  mov    -0x810(%rbp),%rax
  test   %rax,%rax
  je     L59
  cmpl   $0x2a,-0x804(%rbp)
  jg     L59
  cmpl   $0x0,-0x804(%rbp)
  jns    L8
L59:
  mov    $0xffffffff,%eax
  jmp    L107
L8:
  mov    -0x804(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    D5(%rip),%rax
  mov    (%rdx,%rax,1),%rax
  test   %rax,%rax
  jne    L126
  mov    $0x7e1,%edi
  call   <malloc@plt>
  mov    %rax,%rcx
  mov    -0x804(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    D5(%rip),%rax
  mov    %rcx,(%rdx,%rax,1)
  mov    -0x804(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    D5(%rip),%rax
  mov    (%rdx,%rax,1),%rax
  test   %rax,%rax
  jne    L66
  mov    $0xffffffff,%eax
  jmp    L107
L66:
  mov    -0x804(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    D5(%rip),%rax
  mov    (%rdx,%rax,1),%rax
  mov    $0x7e1,%esi
  mov    %rax,%rdi
  call   <ft_bzero@plt>
  jmp    L126
L30:
  lea    -0x7f0(%rbp),%rcx
  mov    -0x804(%rbp),%eax
  mov    $0x7e1,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  mov    %eax,-0x7fc(%rbp)
  cmpl   $0xffffffff,-0x7fc(%rbp)
  jne    L89
  mov    $0xffffffff,%eax
  jmp    L107
L89:
  mov    -0x7fc(%rbp),%eax
  cltq
  movb   $0x0,-0x7f0(%rbp,%rax,1)
  mov    -0x804(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    D5(%rip),%rax
  mov    (%rdx,%rax,1),%rax
  mov    %rax,%rdi
  call   <ft_strdup@plt>
  mov    %rax,-0x7f8(%rbp)
  mov    -0x804(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    D5(%rip),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <ft_strdel@plt>
  mov    -0x7f8(%rbp),%rax
  lea    -0x7f0(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <ft_strjoin@plt>
  mov    -0x804(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  lea    D5(%rip),%rdx
  mov    %rax,(%rcx,%rdx,1)
  lea    -0x7f8(%rbp),%rax
  mov    %rax,%rdi
  call   <ft_strdel@plt>
L126:
  mov    -0x804(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    D5(%rip),%rax
  mov    (%rdx,%rax,1),%rax
  mov    %rax,%rdi
  call   <cs@plt>
  cmp    $0xffffffff,%eax
  jne    L71
  cmpl   $0x0,-0x7fc(%rbp)
  jne    L30
L71:
  mov    -0x804(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    D5(%rip),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x810(%rbp),%rdx
  mov    -0x7fc(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <processline@plt>
L107:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L58
  call   <__stack_chk_fail@plt>
L58:
  leave
  ret
```

assistant: ```c
int get_next_line(const int fd, char **line) {
  char buffer[2017 + 1];
  int ret;
  static char *str[42];
  char *swap;
  ret = 1;
  if (!line || fd > 42 || fd < 0 || 2017 < 1)
    return (-1);
  if (!str[fd]) {
    if (!(str[fd] = (char *)malloc(sizeof(char) * 2017)))
      return (-1);
    ft_bzero(str[fd], 2017);
  }
  while (cs(str[fd]) == -1 && ret) {
    if ((ret = read(fd, buffer, 2017)) == -1)
      return (-1);
    buffer[ret] = '\0';
    swap = ft_strdup(str[fd]);
    ft_strdel(&str[fd]);
    str[fd] = ft_strjoin(swap, buffer);
    ft_strdel(&swap);
  }
  return (processline(ret, &str[fd], &line));
}
```