user: Demonstrate the C code that generates the assembly output below:

```asm
<DrawlineBmp>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %esi,%r10d
  mov    %ecx,%esi
  mov    %r8d,%eax
  mov    %r9d,%r11d
  sub    %edx,%r8d
  sub    %r10d,%ecx
  js     L85
  test   %r8d,%r8d
  js     L201
  test   %ecx,%ecx
  jne    L63
  test   %r8d,%r8d
  jg     L66
L179:
  lea    (%rdx,%rdx,4),%eax
  shl    $0x7,%eax
  add    %r10d,%eax
  cltq
  mov    %r9w,(%rdi,%rax,2)
L175:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L201:
  test   %ecx,%ecx
  jne    L47
  test   %r8d,%r8d
  jg     L66
  jns    L179
  movzwl %r9w,%r9d
  sub    %eax,%edx
  mov    %edx,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edx
  mov    %r10d,%esi
  call   <DrawVlineBmp@plt>
  jmp    L175
L47:
  mov    $0xffffffff,%eax
  mov    $0x1,%r9d
  jmp    L158
L66:
  movzwl %r9w,%r9d
  mov    $0x0,%ecx
  mov    %r10d,%esi
  call   <DrawVlineBmp@plt>
  jmp    L175
L63:
  test   %r8d,%r8d
  jne    L122
  test   %ecx,%ecx
  jle    L91
  movzwl %r9w,%r9d
  mov    %r10d,%esi
  call   <DrawHlineBmp@plt>
  jmp    L175
L122:
  mov    $0x1,%eax
  mov    $0x1,%r9d
  jmp    L158
L132:
  add    $0x1,%ecx
  add    %r9d,%eax
  cmp    %ecx,%esi
  je     L175
L100:
  movslq %eax,%r8
  mov    %r11w,(%rdi,%r8,2)
  add    %ebx,%edx
  cmp    %edx,%esi
  jg     L132
  sub    %esi,%edx
  add    %ebp,%eax
  jmp    L132
L85:
  test   %r8d,%r8d
  js     L50
  jne    L24
L91:
  mov    %r10d,%ecx
  sub    %esi,%ecx
  movzwl %r9w,%r9d
  mov    $0x0,%r8d
  call   <DrawHlineBmp@plt>
  jmp    L175
L50:
  mov    $0xffffffff,%eax
  mov    $0xffffffff,%r9d
L158:
  imul   %r9d,%ecx
  lea    0x1(%rcx),%esi
  imul   %eax,%r8d
  lea    0x1(%r8),%ebx
  lea    (%rax,%rax,4),%eax
  shl    $0x7,%eax
  mov    %eax,%ebp
  cmp    %r8d,%ecx
  jge    L182
  mov    %esi,%ecx
  mov    %ebx,%esi
  mov    %ecx,%ebx
  mov    %r9d,%ebp
  mov    %eax,%r9d
L182:
  lea    (%rdx,%rdx,4),%eax
  shl    $0x7,%eax
  add    %r10d,%eax
  test   %esi,%esi
  jle    L175
  mov    $0x0,%edx
  mov    $0x0,%ecx
  jmp    L100
L24:
  mov    $0x1,%eax
  mov    $0xffffffff,%r9d
  jmp    L158
```

assistant: ```c
void DrawlineBmp(unsigned short *buffer, int x1, int y1, int x2, int y2, unsigned short color) {
  int pixx, pixy;
  int x, y;
  int dx, dy;
  int sx, sy;
  int swaptmp;
  int idx;
  dx = x2 - x1;
  dy = y2 - y1;
  sx = (dx >= 0) ? 1 : -1;
  sy = (dy >= 0) ? 1 : -1;
  if (dx == 0) {
    if (dy > 0) {
      DrawVlineBmp(buffer, x1, y1, 0, dy, color);
      return;
    } else if (dy < 0) {
      DrawVlineBmp(buffer, x1, y2, 0, -dy, color);
      return;
    } else {
      idx = x1 + y1 * 640;
      buffer[idx] = color;
      return;
    }
  }
  if (dy == 0) {
    if (dx > 0) {
      DrawHlineBmp(buffer, x1, y1, dx, 0, color);
      return;
    } else if (dx < 0) {
      DrawHlineBmp(buffer, x2, y1, -dx, 0, color);
      return;
    }
  }
  dx = sx * dx + 1;
  dy = sy * dy + 1;
  pixx = 1;
  pixy = 640;
  pixx *= sx;
  pixy *= sy;
  if (dx < dy) {
    swaptmp = dx;
    dx = dy;
    dy = swaptmp;
    swaptmp = pixx;
    pixx = pixy;
    pixy = swaptmp;
  }
  x = 0;
  y = 0;
  idx = x1 + y1 * 640;
  for (; x < dx; x++, idx += pixx) {
    buffer[idx] = color;
    y += dy;
    if (y >= dx) {
      y -= dx;
      idx += pixy;
    }
  }
}
```