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

```asm
<drawline>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%r10d
  mov    %edx,%esi
  mov    %ecx,%eax
  mov    0x28(%rsp),%ebp
  sub    %r9d,%ecx
  mov    %r8d,%edx
  sub    %ebp,%edx
  mov    %ecx,%ebx
  or     %edx,%ebx
  je     L29
  mov    %r9d,%r11d
  sub    %eax,%r11d
  test   %ecx,%ecx
  cmovs  %r11d,%ecx
  mov    %ebp,%r11d
  sub    %r8d,%r11d
  test   %edx,%edx
  cmovs  %r11d,%edx
  cmp    %edx,%ecx
  jge    L54
  cmp    %ebp,%r8d
  jg     L171
  jne    L116
  test   %ebp,%ebp
  jle    L182
  lea    -0x1(%r8),%edx
  mov    %ebp,%r8d
  mov    %edx,%ebp
L156:
  mov    %r9d,%edx
  mov    %eax,%r9d
  mov    %edx,%eax
L171:
  sub    %r9d,%eax
  mov    %eax,%ecx
  mov    %ebp,%r12d
  imul   %r10d,%r12d
  mov    %ebp,%ebx
  mov    $0x0,%r11d
  mov    %r8d,%r13d
  sub    %ebp,%r13d
  lea    -0x1(%rsi),%eax
  lea    0x1(%rdi,%rax,1),%rbp
  jmp    L58
L29:
  test   %esi,%esi
  jle    L80
  imul   %r10d,%r8d
  imul   %esi,%eax
  mov    %eax,%ecx
  add    %r8d,%ecx
  movslq %ecx,%rcx
  lea    (%rdi,%rcx,1),%rax
  lea    -0x1(%rsi),%edx
  lea    0x1(%rdi,%rdx,1),%rdx
  add    %rcx,%rdx
L103:
  movb   $0xff,(%rax)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L103
L80:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L182:
  lea    0x1(%rbp),%edx
  mov    %r8d,%ebp
  mov    %edx,%r8d
  jmp    L156
L43:
  mov    %r11d,%eax
  cltd
  idiv   %r13d
  lea    (%rax,%r9,1),%edx
  imul   %esi,%edx
  add    %r12d,%edx
  movslq %edx,%rdx
  lea    (%rdi,%rdx,1),%rax
  add    %rbp,%rdx
L61:
  movb   $0xff,(%rax)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L61
L169:
  add    $0x1,%ebx
  add    %ecx,%r11d
  add    %r10d,%r12d
  cmp    %r8d,%ebx
  jg     L80
L58:
  test   %esi,%esi
  jg     L43
  jmp    L169
L54:
  cmp    %r9d,%eax
  jle    L183
  mov    %r8d,%edx
  mov    %ebp,%r8d
  mov    %edx,%ebp
  mov    %eax,%edx
  mov    %r9d,%eax
  mov    %edx,%r9d
L183:
  sub    %r8d,%ebp
  mov    %eax,%ebx
  imul   %esi,%ebx
  mov    %eax,%r11d
  mov    $0x0,%ecx
  mov    %r9d,%r12d
  sub    %eax,%r12d
  lea    -0x1(%rsi),%eax
  lea    0x1(%rdi,%rax,1),%r13
  jmp    L98
L92:
  mov    %ecx,%eax
  cltd
  idiv   %r12d
  lea    (%rax,%r8,1),%edx
  imul   %r10d,%edx
  add    %ebx,%edx
  movslq %edx,%rdx
  lea    (%rdi,%rdx,1),%rax
  add    %r13,%rdx
L165:
  movb   $0xff,(%rax)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L165
L196:
  add    $0x1,%r11d
  add    %ebp,%ecx
  add    %esi,%ebx
  cmp    %r11d,%r9d
  jl     L80
L98:
  test   %esi,%esi
  jg     L92
  jmp    L196
L116:
  mov    %r9d,%edx
  mov    %eax,%r9d
  mov    %edx,%eax
  mov    %ebp,%edx
  mov    %r8d,%ebp
  mov    %edx,%r8d
  jmp    L171
```

assistant: ```c
void drawline(unsigned char *buffer, int rowstride, int bpp, int x1, int y1, int x2, int y2) {
  int i, j;
  i = x1 - x2;
  j = y1 - y2;
  if (i == 0 && j == 0) {
    for (i = 0; i < bpp; i++)
      buffer[y1 * rowstride + x1 * bpp + i] = 0xff;
    return;
  }
  if (i < 0)
    i = -i;
  if (j < 0)
    j = -j;
  if (i < j) {
    if (y1 > y2) {
      i = y2;
      y2 = y1;
      y1 = i;
      i = x2;
      x2 = x1;
      x1 = i;
    }
    if (y2 == y1) {
      if (y2 > 0)
        y1--;
      else
        y2++;
    }
    for (j = y1; j <= y2; j++)
      for (i = 0; i < bpp; i++)
        buffer[j * rowstride + (x1 + (j - y1) * (x2 - x1) / (y2 - y1)) * bpp + i] = 0xff;
  } else {
    if (x1 > x2) {
      i = y2;
      y2 = y1;
      y1 = i;
      i = x2;
      x2 = x1;
      x1 = i;
    }
    for (i = x1; i <= x2; i++)
      for (j = 0; j < bpp; j++)
        buffer[(y1 + (i - x1) * (y2 - y1) / (x2 - x1)) * rowstride + i * bpp + j] = 0xff;
  }
}
```