user: What is the c source code of the assembly code below?

```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    L127
  mov    %esi,%eax
  mov    $0xffffffff,%ebp
  sub    %ecx,%eax
  mov    %eax,0x8(%rsp)
L127:
  mov    %r14d,%eax
  movl   $0x1,0x4(%rsp)
  sub    %r15d,%eax
  mov    %eax,(%rsp)
  jns    L3
  mov    %r15d,%eax
  movl   $0xffffffff,0x4(%rsp)
  sub    %r14d,%eax
  mov    %eax,(%rsp)
L3:
  mov    (%rsp),%eax
  test   %eax,%eax
  jne    L172
  mov    %ebx,%r8d
  xor    %ecx,%ecx
  mov    %r13d,%edx
  mov    %r12d,%esi
  cmp    $0xffffffff,%ebp
  je     L171
  mov    %r12d,%edx
L90:
  mov    %r13d,%esi
L171:
  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)
L172:
  mov    0x8(%rsp),%eax
  mov    (%rsp),%esi
  cmp    %esi,%eax
  jle    L68
  cmp    %r13d,%r12d
  je     L181
  mov    %eax,0xc(%rsp)
  xor    %r14d,%r14d
  jmp    L81
  nopl   0x0(%rax)
L49:
  add    %ebp,%r13d
  add    (%rsp),%r14d
  cmp    %r13d,%r12d
  je     L181
L81:
  xor    %ecx,%ecx
  mov    %ebx,%r8d
  mov    %r13d,%edx
  mov    %r13d,%esi
  mov    %r15d,%edi
  call   <save_line@plt>
  cmp    0xc(%rsp),%r14d
  jle    L49
  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    L81
L181:
  mov    %ebx,%r8d
  xor    %ecx,%ecx
  mov    %r13d,%edx
  jmp    L90
  nopw   0x0(%rax,%rax,1)
L68:
  jge    L2
  cmp    %r15d,%r14d
  je     L181
  mov    %esi,0xc(%rsp)
  xor    %r12d,%r12d
  jmp    L185
L148:
  add    0x8(%rsp),%r12d
L110:
  add    0x4(%rsp),%r15d
  cmp    %r15d,%r14d
  je     L181
L185:
  xor    %ecx,%ecx
  mov    %ebx,%r8d
  mov    %r13d,%edx
  mov    %r13d,%esi
  mov    %r15d,%edi
  call   <save_line@plt>
  cmp    0xc(%rsp),%r12d
  jle    L148
  mov    (%rsp),%eax
  add    %ebp,%r13d
  sub    %r12d,%eax
  mov    0x8(%rsp),%r12d
  add    %eax,0xc(%rsp)
  jmp    L110
  nopl   (%rax)
L101:
  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
L2:
  cmp    %r13d,%r12d
  jne    L101
  mov    %ebx,%r8d
  xor    %ecx,%ecx
  mov    %r13d,%edx
  jmp    L90
```

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