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

```asm
<line>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8d,-0x44(%rbp)
  mov    -0x38(%rbp),%rax
  sub    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <abs@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0x40(%rbp),%rax
  sub    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <abs@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0xc(%rbp),%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x38(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jne    L140
  movl   $0x2,-0x20(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %eax,-0x14(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %eax,-0x10(%rbp)
  jmp    L21
L140:
  mov    -0x38(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jb     L35
  mov    -0x40(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jb     L45
  mov    $0x1,%eax
  jmp    L82
L45:
  mov    $0x4,%eax
L82:
  mov    %eax,-0x20(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %eax,-0x14(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %eax,-0x10(%rbp)
  jmp    L21
L35:
  mov    -0x40(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jb     L296
  mov    $0x2,%eax
  jmp    L313
L296:
  mov    $0x4,%eax
L313:
  mov    %eax,-0x20(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %eax,-0x14(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %eax,-0x10(%rbp)
L21:
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L184
L222:
  cmpl   $0x0,-0x18(%rbp)
  js     L105
  cmpl   $0x4,-0x20(%rbp)
  je     L251
  cmpl   $0x4,-0x20(%rbp)
  jg     L76
  cmpl   $0x3,-0x20(%rbp)
  je     L132
  cmpl   $0x3,-0x20(%rbp)
  jg     L76
  cmpl   $0x1,-0x20(%rbp)
  je     L64
  cmpl   $0x2,-0x20(%rbp)
  je     L55
  jmp    L76
L64:
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  mov    -0x44(%rbp),%edx
  mov    -0x10(%rbp),%ecx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <putpixel@plt>
  mov    -0x8(%rbp),%eax
  sub    %eax,-0x18(%rbp)
  jmp    L76
L55:
  mov    -0x10(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x10(%rbp)
  mov    -0x44(%rbp),%edx
  mov    -0x14(%rbp),%ecx
  mov    %eax,%esi
  mov    %ecx,%edi
  call   <putpixel@plt>
  mov    -0xc(%rbp),%eax
  sub    %eax,-0x18(%rbp)
  jmp    L76
L132:
  mov    -0x14(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  mov    -0x44(%rbp),%edx
  mov    -0x10(%rbp),%ecx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <putpixel@plt>
  mov    -0x8(%rbp),%eax
  sub    %eax,-0x18(%rbp)
  jmp    L76
L251:
  mov    -0x10(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x10(%rbp)
  mov    -0x44(%rbp),%edx
  mov    -0x14(%rbp),%ecx
  mov    %eax,%esi
  mov    %ecx,%edi
  call   <putpixel@plt>
  mov    -0xc(%rbp),%eax
  sub    %eax,-0x18(%rbp)
  jmp    L76
L105:
  cmpl   $0x4,-0x20(%rbp)
  je     L198
  cmpl   $0x4,-0x20(%rbp)
  jg     L76
  cmpl   $0x3,-0x20(%rbp)
  je     L256
  cmpl   $0x3,-0x20(%rbp)
  jg     L76
  cmpl   $0x1,-0x20(%rbp)
  je     L298
  cmpl   $0x2,-0x20(%rbp)
  je     L75
  jmp    L76
L298:
  mov    -0x10(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x10(%rbp)
  mov    -0x44(%rbp),%edx
  mov    -0x14(%rbp),%ecx
  mov    %eax,%esi
  mov    %ecx,%edi
  call   <putpixel@plt>
  mov    -0xc(%rbp),%eax
  add    %eax,-0x18(%rbp)
  jmp    L76
L75:
  mov    -0x14(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  mov    -0x44(%rbp),%edx
  mov    -0x10(%rbp),%ecx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <putpixel@plt>
  mov    -0x8(%rbp),%eax
  add    %eax,-0x18(%rbp)
  jmp    L76
L256:
  mov    -0x10(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x10(%rbp)
  mov    -0x44(%rbp),%edx
  mov    -0x14(%rbp),%ecx
  mov    %eax,%esi
  mov    %ecx,%edi
  call   <putpixel@plt>
  mov    -0xc(%rbp),%eax
  add    %eax,-0x18(%rbp)
  jmp    L76
L198:
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  mov    -0x44(%rbp),%edx
  mov    -0x10(%rbp),%ecx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <putpixel@plt>
  mov    -0x8(%rbp),%eax
  add    %eax,-0x18(%rbp)
  nop
L76:
  addl   $0x1,-0x1c(%rbp)
L184:
  mov    -0x1c(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jl     L222
  nop
  nop
  leave
  ret
```

assistant: ```c
void line(unsigned long x0, unsigned long y0, unsigned long x1, unsigned long y1, unsigned int color) {
  int dx, dy, n, k, i, f;
  int x, y;
  dx = abs(x1 - x0);
  dy = abs(y1 - y0);
  n = dx + dy;
  if (x1 == x0) {
    k = 2;
    x = x0;
    y = y0;
  } else if (x1 >= x0) {
    k = y1 >= y0 ? 1 : 4;
    x = x0;
    y = y0;
  } else {
    k = y1 >= y0 ? 2 : 4;
    x = x0;
    y = y0;
  }
  for (i = 0, f = 0; i < n; i++)
    if (f >= 0)
      switch (k) {
      case 1:
        putpixel(x++, y, color);
        f -= dy;
        break;
      case 2:
        putpixel(x, y++, color);
        f -= dx;
        break;
      case 3:
        putpixel(x--, y, color);
        f -= dy;
        break;
      case 4:
        putpixel(x, y--, color);
        f -= dx;
        break;
      }
    else
      switch (k) {
      case 1:
        putpixel(x, y++, color);
        f += dx;
        break;
      case 2:
        putpixel(x--, y, color);
        f += dy;
        break;
      case 3:
        putpixel(x, y--, color);
        f += dx;
        break;
      case 4:
        putpixel(x++, y, color);
        f += dy;
        break;
      }
}
```