user: 请将以下的汇编代码转换成C语言代码:

```asm
<draw_line>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %esi,-0x38(%rbp)
  mov    %edx,-0x3c(%rbp)
  mov    %ecx,-0x40(%rbp)
  mov    %r8,-0x48(%rbp)
  movl   $0x0,-0x24(%rbp)
  mov    -0x40(%rbp),%eax
  sub    -0x38(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x3c(%rbp),%eax
  sub    -0x34(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x14(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jle    L116
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  movl   $0x1,-0x24(%rbp)
L116:
  cmpl   $0x0,-0x18(%rbp)
  jns    L124
  mov    $0xffffffff,%eax
  jmp    L55
L124:
  mov    $0x1,%eax
L55:
  mov    %eax,-0x8(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jne    L93
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x18(%rbp),%xmm0
  jmp    L10
L93:
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x18(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x1c(%rbp),%xmm1
  divss  %xmm1,%xmm0
L10:
  movss  %xmm0,-0x4(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  je     L80
  cmpl   $0x2,-0x10(%rbp)
  jg     L9
  movb   $0x7c,-0x25(%rbp)
  jmp    L131
L9:
  cmpl   $0x2,-0x14(%rbp)
  jg     L166
  movb   $0x2d,-0x25(%rbp)
  jmp    L131
L166:
  movb   $0x2f,-0x25(%rbp)
L131:
  movl   $0x0,-0x20(%rbp)
  jmp    L99
L141:
  mov    -0x38(%rbp),%edx
  mov    -0x20(%rbp),%eax
  lea    (%rdx,%rax,1),%edi
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x20(%rbp),%xmm0
  divss  -0x4(%rbp),%xmm0
  cvttss2si %xmm0,%edx
  mov    -0x34(%rbp),%eax
  lea    (%rdx,%rax,1),%esi
  movsbl -0x25(%rbp),%eax
  mov    -0x48(%rbp),%rdx
  mov    %rdx,%rcx
  mov    %edi,%edx
  mov    %eax,%edi
  call   <put_char@plt>
  mov    -0x8(%rbp),%eax
  add    %eax,-0x20(%rbp)
L99:
  mov    -0x20(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jne    L141
  jmp    L78
L80:
  cmpl   $0x2,-0x10(%rbp)
  jg     L174
  movb   $0x7c,-0x25(%rbp)
  jmp    L59
L174:
  cmpl   $0x2,-0x14(%rbp)
  jg     L3
  movb   $0x2d,-0x25(%rbp)
  jmp    L59
L3:
  movb   $0x5c,-0x25(%rbp)
L59:
  movl   $0x0,-0x20(%rbp)
  jmp    L21
L51:
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x20(%rbp),%xmm0
  divss  -0x4(%rbp),%xmm0
  cvttss2si %xmm0,%edx
  mov    -0x38(%rbp),%eax
  lea    (%rdx,%rax,1),%edi
  mov    -0x34(%rbp),%edx
  mov    -0x20(%rbp),%eax
  lea    (%rdx,%rax,1),%esi
  movsbl -0x25(%rbp),%eax
  mov    -0x48(%rbp),%rdx
  mov    %rdx,%rcx
  mov    %edi,%edx
  mov    %eax,%edi
  call   <put_char@plt>
  mov    -0x8(%rbp),%eax
  add    %eax,-0x20(%rbp)
L21:
  mov    -0x20(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jne    L51
L78:
  nop
  leave
  ret
```

assistant: ```c
void draw_line(int x1, int y1, int x2, int y2, char *buffer) {
  int yLonger = 0;
  int incrementVal;
  int i;
  int shortLen = y2 - y1;
  int a_shortLen = (shortLen >= 0 ? shortLen : shortLen * -1);
  int longLen = x2 - x1;
  int a_longLen = (longLen >= 0 ? longLen : longLen * -1);
  char c;
  float divDiff;
  if (a_shortLen > a_longLen) {
    int swap = shortLen;
    shortLen = longLen;
    longLen = swap;
    yLonger = 1;
  }
  incrementVal = (longLen < 0 ? -1 : 1);
  divDiff = (shortLen == 0 ? longLen : (float)longLen / (float)shortLen);
  if (yLonger) {
    if (a_longLen <= 2)
      c = '|';
    else if (a_shortLen <= 2)
      c = '-';
    else
      c = '/';
    for (i = 0; i != longLen; i += incrementVal)
      put_char(c, x1 + (int)((float)i / divDiff), y1 + i, buffer);
  } else {
    if (a_longLen <= 2)
      c = '|';
    else if (a_shortLen <= 2)
      c = '-';
    else
      c = '\\';
    for (i = 0; i != longLen; i += incrementVal)
      put_char(c, x1 + i, y1 + (int)((float)i / divDiff), buffer);
  }
}
```