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

```asm
<XD_Draw_Vector>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,0x30(%rsp)
  mov    %esi,0x18(%rsp)
  mov    %r9,0x8(%rsp)
  mov    0x80(%rsp),%r14
  cmp    $0x1,%edx
  jle    L113
  lea    0x4(%rcx),%rax
  mov    %rax,0x10(%rsp)
  lea    0x4(%r8),%rax
  mov    %rax,0x28(%rsp)
  lea    -0x2(%rdx),%eax
  lea    0x8(%rcx,%rax,4),%rax
  mov    %rax,0x38(%rsp)
  jmp    L0
L53:
  add    0x24(%rsp),%r13d
L89:
  sub    $0x8,%rsp
  push   %r14
  mov    0x18(%rsp),%r9
  mov    %ebp,%r8d
  mov    %ebx,%ecx
  mov    0x28(%rsp),%edx
  mov    $0x9,%esi
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <XD_Device_Interface@plt>
  add    $0x10,%rsp
  cmp    $0x1,%eax
  jne    L64
  add    $0x1,%ebp
  cmp    %ebp,%r12d
  jl     L64
L147:
  test   %r13d,%r13d
  js     L53
  add    0x1c(%rsp),%ebx
  add    0x20(%rsp),%r13d
  jmp    L89
L119:
  cmp    %r13d,%ebx
  jle    L161
  mov    %ebp,%eax
  mov    %r12d,%ebp
  mov    %eax,%r12d
  mov    %ebx,%eax
  mov    %r13d,%ebx
  mov    %eax,%r13d
L161:
  sub    $0x8,%rsp
  push   %r14
  mov    0x18(%rsp),%r9
  mov    %ebp,%r8d
  mov    %ebx,%ecx
  mov    0x28(%rsp),%edx
  mov    $0x9,%esi
  mov    0x40(%rsp),%rdi
  mov    $0x0,%eax
  call   <XD_Device_Interface@plt>
  add    $0x10,%rsp
  cmp    $0x1,%eax
  jne    L139
  cmp    %r12d,%ebp
  mov    $0xffffffff,%ecx
  cmovle %eax,%ecx
  mov    %ecx,0x1c(%rsp)
  lea    (%r15,%r15,1),%r12d
  mov    %r12d,0x24(%rsp)
  mov    0x20(%rsp),%edx
  sub    %edx,%r12d
  sub    %edx,%r15d
  add    %r15d,%r15d
  add    $0x1,%ebx
  cmp    %ebx,%r13d
  jl     L64
  mov    %r15d,0x20(%rsp)
  mov    0x30(%rsp),%r15
  jmp    L175
L30:
  add    0x24(%rsp),%r12d
L145:
  sub    $0x8,%rsp
  push   %r14
  mov    0x18(%rsp),%r9
  mov    %ebp,%r8d
  mov    %ebx,%ecx
  mov    0x28(%rsp),%edx
  mov    $0x9,%esi
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <XD_Device_Interface@plt>
  add    $0x10,%rsp
  cmp    $0x1,%eax
  jne    L64
  add    $0x1,%ebx
  cmp    %ebx,%r13d
  jl     L64
L175:
  test   %r12d,%r12d
  js     L30
  add    0x1c(%rsp),%ebp
  add    0x20(%rsp),%r12d
  jmp    L145
L64:
  addq   $0x4,0x10(%rsp)
  mov    0x10(%rsp),%rdi
  addq   $0x4,0x28(%rsp)
  cmp    0x38(%rsp),%rdi
  je     L139
L0:
  mov    0x10(%rsp),%rax
  mov    -0x4(%rax),%ebx
  mov    (%rax),%r13d
  mov    0x28(%rsp),%rax
  mov    -0x4(%rax),%ebp
  mov    (%rax),%r12d
  mov    %r13d,%eax
  sub    %ebx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  mov    %eax,%esi
  mov    %eax,0x20(%rsp)
  mov    %r12d,%eax
  sub    %ebp,%eax
  mov    %eax,%r15d
  neg    %r15d
  cmovs  %eax,%r15d
  cmp    %r15d,%esi
  jge    L119
  cmp    %r12d,%ebp
  jle    L191
  mov    %ebp,%eax
  mov    %r12d,%ebp
  mov    %eax,%r12d
  mov    %ebx,%eax
  mov    %r13d,%ebx
  mov    %eax,%r13d
L191:
  sub    $0x8,%rsp
  push   %r14
  mov    0x18(%rsp),%r9
  mov    %ebp,%r8d
  mov    %ebx,%ecx
  mov    0x28(%rsp),%edx
  mov    $0x9,%esi
  mov    0x40(%rsp),%rdi
  mov    $0x0,%eax
  call   <XD_Device_Interface@plt>
  add    $0x10,%rsp
  cmp    $0x1,%eax
  jne    L139
  cmp    %r13d,%ebx
  mov    $0xffffffff,%esi
  cmovle %eax,%esi
  mov    %esi,0x1c(%rsp)
  mov    0x20(%rsp),%esi
  lea    (%rsi,%rsi,1),%ecx
  mov    %ecx,0x24(%rsp)
  mov    %ecx,%r13d
  sub    %r15d,%r13d
  mov    %esi,%edx
  sub    %r15d,%edx
  lea    (%rdx,%rdx,1),%r15d
  add    $0x1,%ebp
  cmp    %ebp,%r12d
  jl     L64
  mov    %r15d,0x20(%rsp)
  mov    0x30(%rsp),%r15
  jmp    L147
L113:
  mov    $0x0,%eax
L139:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int XD_Draw_Vector(Unit, Imp, NPts, X, Y, Value, Mask)
int *Unit, Imp, NPts, *X, *Y, *Mask;
char *Value;
{
  int dx, dy, incr1, incr2, d, x, y;
  int XStart, YStart, XEnd, YEnd, Offset, i, status;
  for (i = 0; i < NPts - 1; i++) {
    Offset = 1;
    XStart = X[i];
    XEnd = X[i + 1];
    YStart = Y[i];
    YEnd = Y[i + 1];
    dx = abs(XEnd - XStart);
    dy = abs(YEnd - YStart);
    if (dx < dy) {
      if (YStart > YEnd) {
        XStart = X[i + 1], XEnd = X[i];
        YStart = Y[i + 1], YEnd = Y[i];
      }
      status = XD_Device_Interface(Unit, 9, Imp, XStart, YStart, Value, Mask);
      if (status != 1)
        break;
      x = XStart;
      if (XStart > XEnd)
        Offset = -1;
      d = 2 * dx - dy;
      incr1 = 2 * dx;
      incr2 = 2 * (dx - dy);
      for (y = YStart + 1; y <= YEnd; y++) {
        if (d < 0) {
          d = d + incr1;
        } else {
          x = x + Offset;
          d = d + incr2;
        }
        status = XD_Device_Interface(Unit, 9, Imp, x, y, Value, Mask);
        if (status != 1)
          break;
      }
    } else {
      if (XStart > XEnd) {
        XStart = X[i + 1], XEnd = X[i];
        YStart = Y[i + 1], YEnd = Y[i];
      }
      status = XD_Device_Interface(Unit, 9, Imp, XStart, YStart, Value, Mask);
      if (status != 1)
        break;
      y = YStart;
      if (YStart > YEnd)
        Offset = -1;
      d = 2 * dy - dx;
      incr1 = 2 * dy;
      incr2 = 2 * (dy - dx);
      for (x = XStart + 1; x <= XEnd; x++) {
        if (d < 0) {
          d = d + incr1;
        } else {
          y = y + Offset;
          d = d + incr2;
        }
        status = XD_Device_Interface(Unit, 9, Imp, x, y, Value, Mask);
        if (status != 1)
          break;
      }
    }
  }
  return (status);
}
```