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

```asm
<line>:
  endbr64
  push   %r15
  mov    %ecx,%eax
  mov    %edx,%r15d
  push   %r14
  mov    %r8d,%r14d
  push   %r13
  mov    %esi,%r13d
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  mov    $0x1,%ebp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x18,%rsp
  sub    %esi,%eax
  mov    %eax,0x8(%rsp)
  jns    L47
  mov    %esi,%eax
  mov    $0xffffffff,%ebp
  sub    %ecx,%eax
  mov    %eax,0x8(%rsp)
L47:
  mov    %r14d,%eax
  movl   $0x1,0x4(%rsp)
  sub    %r15d,%eax
  mov    %eax,(%rsp)
  jns    L128
  mov    %r15d,%eax
  movl   $0xffffffff,0x4(%rsp)
  sub    %r14d,%eax
  mov    %eax,(%rsp)
L128:
  mov    (%rsp),%eax
  test   %eax,%eax
  jne    L23
  mov    %ebx,%r8d
  xor    %ecx,%ecx
  mov    %r13d,%edx
  mov    %r12d,%esi
  cmp    $0xffffffff,%ebp
  je     L17
  mov    %r12d,%edx
L121:
  mov    %r13d,%esi
L17:
  add    $0x18,%rsp
  mov    %r15d,%edi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1050 <save_line@plt>
  nopl   0x0(%rax,%rax,1)
L23:
  mov    0x8(%rsp),%eax
  mov    (%rsp),%esi
  cmp    %esi,%eax
  jle    L65
  cmp    %r13d,%r12d
  je     L21
  mov    %eax,0xc(%rsp)
  xor    %r14d,%r14d
  jmp    L157
  nopl   0x0(%rax)
L5:
  add    %ebp,%r13d
  add    (%rsp),%r14d
  cmp    %r13d,%r12d
  je     L21
L157:
  xor    %ecx,%ecx
  mov    %ebx,%r8d
  mov    %r13d,%edx
  mov    %r13d,%esi
  mov    %r15d,%edi
  call   <save_line@plt>
  cmp    0xc(%rsp),%r14d
  jle    L5
  mov    0x8(%rsp),%eax
  add    %ebp,%r13d
  add    0x4(%rsp),%r15d
  sub    %r14d,%eax
  mov    (%rsp),%r14d
  add    %eax,0xc(%rsp)
  cmp    %r13d,%r12d
  jne    L157
L21:
  mov    %ebx,%r8d
  xor    %ecx,%ecx
  mov    %r13d,%edx
  jmp    L121
  nopw   0x0(%rax,%rax,1)
L65:
  jge    L189
  cmp    %r15d,%r14d
  je     L21
  mov    (%rsp),%eax
  xor    %r12d,%r12d
  mov    %eax,0xc(%rsp)
  jmp    L178
  nopl   0x0(%rax,%rax,1)
L32:
  add    0x8(%rsp),%r12d
L126:
  add    0x4(%rsp),%r15d
  cmp    %r15d,%r14d
  je     L21
L178:
  xor    %ecx,%ecx
  mov    %ebx,%r8d
  mov    %r13d,%edx
  mov    %r13d,%esi
  mov    %r15d,%edi
  call   <save_line@plt>
  cmp    0xc(%rsp),%r12d
  jle    L32
  mov    (%rsp),%eax
  add    %ebp,%r13d
  sub    %r12d,%eax
  mov    0x8(%rsp),%r12d
  add    %eax,0xc(%rsp)
  jmp    L126
  nopl   (%rax)
L52:
  mov    %r13d,%edx
  mov    %r13d,%esi
  mov    %r15d,%edi
  mov    %ebx,%r8d
  xor    %ecx,%ecx
  add    %ebp,%r13d
  call   <save_line@plt>
  add    0x4(%rsp),%r15d
L189:
  cmp    %r13d,%r12d
  jne    L52
  mov    %ebx,%r8d
  xor    %ecx,%ecx
  mov    %r13d,%edx
  jmp    L121
```

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);
    }
  }
}
```