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

```asm
<line>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %edx,-0x2c(%rbp)
  mov    %ecx,-0x30(%rbp)
  mov    %r8d,-0x34(%rbp)
  movl   $0x1,-0x10(%rbp)
  movl   $0x1,-0xc(%rbp)
  mov    -0x30(%rbp),%eax
  sub    -0x28(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  cmpl   $0x0,-0x18(%rbp)
  jns    L42
  movl   $0xffffffff,-0x10(%rbp)
  negl   -0x18(%rbp)
L42:
  mov    -0x34(%rbp),%eax
  sub    -0x2c(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jns    L12
  movl   $0xffffffff,-0xc(%rbp)
  negl   -0x14(%rbp)
L12:
  cmpl   $0x0,-0x14(%rbp)
  jne    L52
  cmpl   $0x0,-0x10(%rbp)
  jns    L55
  mov    -0x24(%rbp),%ecx
  mov    -0x28(%rbp),%edx
  mov    -0x30(%rbp),%esi
  mov    -0x2c(%rbp),%eax
  mov    %ecx,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <save_line@plt>
  jmp    L69
L55:
  mov    -0x24(%rbp),%ecx
  mov    -0x30(%rbp),%edx
  mov    -0x28(%rbp),%esi
  mov    -0x2c(%rbp),%eax
  mov    %ecx,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <save_line@plt>
  jmp    L69
L52:
  movl   $0x0,-0x8(%rbp)
  mov    -0x18(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jle    L83
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  jmp    L4
L26:
  mov    -0x24(%rbp),%ecx
  mov    -0x28(%rbp),%edx
  mov    -0x28(%rbp),%esi
  mov    -0x2c(%rbp),%eax
  mov    %ecx,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <save_line@plt>
  mov    -0x8(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jle    L130
  mov    -0x18(%rbp),%eax
  sub    -0x8(%rbp),%eax
  add    %eax,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  add    %eax,-0x2c(%rbp)
L130:
  mov    -0x14(%rbp),%eax
  add    %eax,-0x8(%rbp)
  mov    -0x10(%rbp),%eax
  add    %eax,-0x28(%rbp)
L4:
  mov    -0x28(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jne    L26
  mov    -0x24(%rbp),%ecx
  mov    -0x28(%rbp),%edx
  mov    -0x28(%rbp),%esi
  mov    -0x2c(%rbp),%eax
  mov    %ecx,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <save_line@plt>
  jmp    L69
L83:
  mov    -0x18(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jge    L128
  mov    -0x14(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  jmp    L21
L129:
  mov    -0x24(%rbp),%ecx
  mov    -0x28(%rbp),%edx
  mov    -0x28(%rbp),%esi
  mov    -0x2c(%rbp),%eax
  mov    %ecx,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <save_line@plt>
  mov    -0x8(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jle    L18
  mov    -0x14(%rbp),%eax
  sub    -0x8(%rbp),%eax
  add    %eax,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  mov    -0x10(%rbp),%eax
  add    %eax,-0x28(%rbp)
L18:
  mov    -0x18(%rbp),%eax
  add    %eax,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  add    %eax,-0x2c(%rbp)
L21:
  mov    -0x2c(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jne    L129
  mov    -0x24(%rbp),%ecx
  mov    -0x28(%rbp),%edx
  mov    -0x28(%rbp),%esi
  mov    -0x2c(%rbp),%eax
  mov    %ecx,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <save_line@plt>
  jmp    L69
L17:
  mov    -0x24(%rbp),%ecx
  mov    -0x28(%rbp),%edx
  mov    -0x28(%rbp),%esi
  mov    -0x2c(%rbp),%eax
  mov    %ecx,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <save_line@plt>
  mov    -0xc(%rbp),%eax
  add    %eax,-0x2c(%rbp)
  mov    -0x10(%rbp),%eax
  add    %eax,-0x28(%rbp)
L128:
  mov    -0x28(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jne    L17
  mov    -0x24(%rbp),%ecx
  mov    -0x28(%rbp),%edx
  mov    -0x28(%rbp),%esi
  mov    -0x2c(%rbp),%eax
  mov    %ecx,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <save_line@plt>
L69:
  nop
  leave
  ret
```

assistant: ```c
void line(int cat, int x0, int y0, int x1, int y1) {
  int dx, dy;
  int xinc, yinc;
  int res1;
  int res2;
  xinc = 1;
  yinc = 1;
  if ((dx = x1 - x0) < 0) {
    xinc = -1;
    dx = -dx;
  }
  if ((dy = y1 - y0) < 0) {
    yinc = -1;
    dy = -dy;
  }
  if (dy == 0) {
    if (xinc < 0)
      save_line(y0, x1, x0, 0, cat);
    else
      save_line(y0, x0, x1, 0, cat);
  } else {
    res1 = 0;
    if (dx > dy) {
      res2 = dx;
      while (x0 != x1) {
        save_line(y0, x0, x0, 0, cat);
        if (res1 > res2) {
          res2 += dx - res1;
          res1 = 0;
          y0 += yinc;
        }
        res1 += dy;
        x0 += xinc;
      }
      save_line(y0, x0, x0, 0, cat);
    } else if (dx < dy) {
      res2 = dy;
      while (y0 != y1) {
        save_line(y0, x0, x0, 0, cat);
        if (res1 > res2) {
          res2 += dy - res1;
          res1 = 0;
          x0 += xinc;
        }
        res1 += dx;
        y0 += yinc;
      }
      save_line(y0, x0, x0, 0, cat);
    } else {
      while (x0 != x1) {
        save_line(y0, x0, x0, 0, cat);
        y0 += yinc;
        x0 += xinc;
      }
      save_line(y0, x0, x0, 0, cat);
    }
  }
}
```