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

```asm
<drawLineHMaxUnclipped>:
  endbr64
  push   %r14
  mov    %edx,%eax
  mov    %ecx,%edx
  mov    %esi,%ecx
  push   %r13
  mov    %esi,%r10d
  mov    %r9d,%r14d
  and    $0x1,%ecx
  push   %r12
  movsbl %r9b,%r12d
  mov    $0x40,%r11d
  shl    $0x4,%r12d
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %r9d,%edi
  mov    %r12d,%r13d
  or     %r12d,%edi
  test   %r8d,%r8d
  jg     L127
  neg    %r8d
  mov    $0xffffffffffffffc0,%r11
L127:
  shl    $0x6,%eax
  sar    %r10d
  lea    (%r8,%r8,1),%ebp
  sub    %edx,%r8d
  add    %r10d,%eax
  mov    %ebp,%esi
  add    %r8d,%r8d
  cltq
  sub    %edx,%esi
  add    %rbx,%rax
  test   %ecx,%ecx
  jne    L69
  mov    $0x1,%ebx
  test   %edx,%edx
  jg     L147
  movzbl (%rax),%edx
  and    $0xfffffff0,%edx
  or     %r9d,%edx
  mov    %dl,(%rax)
L7:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L158:
  add    %r8d,%esi
  mov    %edi,%r10d
  test   %ebx,%ecx
  jne    L123
  movzbl (%rax),%r10d
  test   %ebx,%ebx
  je     L15
  and    $0xfffffff0,%r10d
  or     %r14d,%r10d
L123:
  mov    %r10b,(%rax)
  mov    $0x1,%r10d
  cmp    $0x1,%ecx
  jne    L54
  add    $0x1,%rax
  xor    %r10d,%r10d
L54:
  mov    %ecx,%ebx
  add    %r11,%rax
  mov    %r10d,%ecx
L48:
  sub    $0x1,%edx
  je     L41
L147:
  test   %esi,%esi
  jg     L158
  add    %ebp,%esi
  cmp    $0x1,%ecx
  je     L84
  mov    $0x1,%ecx
  sub    $0x1,%edx
  jne    L147
L41:
  test   %ebx,%ecx
  je     L85
  mov    %dil,(%rax)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L15:
  and    $0xf,%r10d
  or     %r13d,%r10d
  jmp    L123
  nopl   0x0(%rax)
L84:
  mov    %edi,%ecx
  test   %ebx,%ebx
  jne    L145
  movzbl (%rax),%ecx
  and    $0xf,%ecx
  or     %r13d,%ecx
L145:
  mov    %cl,(%rax)
  mov    $0x1,%ebx
  add    $0x1,%rax
  xor    %ecx,%ecx
  jmp    L48
  xchg   %ax,%ax
L69:
  xor    %ebx,%ebx
  test   %edx,%edx
  jg     L147
L128:
  movzbl (%rax),%edx
  and    $0xf,%edx
  or     %r12d,%edx
  mov    %dl,(%rax)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L85:
  test   %ebx,%ebx
  je     L128
  movzbl (%rax),%edx
  and    $0xfffffff0,%edx
  or     %r9d,%edx
  mov    %dl,(%rax)
  jmp    L7
```

assistant: ```c
void drawLineHMaxUnclipped(char *buffer, int x0, int y0, int dx, int dy, char shade) {
  int d, incrH, incrHV, addV;
  int pixelPos = x0 & 0x1;
  int loPixel = 0;
  int hiPixel = 0;
  char hiShade = shade << 4;
  char biShade = shade | hiShade;
  if (dy > 0)
    addV = 64;
  else {
    addV = -64;
    dy = -dy;
  }
  d = 2 * dy - dx;
  incrH = 2 * dy;
  incrHV = 2 * (dy - dx);
  buffer += (y0 << 6) + (x0 >> 1);
  if (pixelPos == 0)
    loPixel = 1;
  else
    hiPixel = 1;
  while (dx-- > 0)
    if (d <= 0) {
      d += incrH;
      pixelPos++;
      if (pixelPos == 2) {
        if (loPixel && hiPixel) {
          *buffer = biShade;
        } else if (loPixel) {
          *buffer &= 0xF0;
          *buffer |= shade;
        } else {
          *buffer &= 0x0F;
          *buffer |= hiShade;
        }
        buffer++;
        pixelPos = 0;
        hiPixel = 0;
        loPixel = 1;
      } else {
        hiPixel = 1;
      }
    } else {
      d += incrHV;
      if (loPixel && hiPixel) {
        *buffer = biShade;
      } else if (loPixel) {
        *buffer &= 0xF0;
        *buffer |= shade;
      } else {
        *buffer &= 0x0F;
        *buffer |= hiShade;
      }
      pixelPos++;
      if (pixelPos == 2) {
        buffer++;
        pixelPos = 0;
        loPixel = 1;
        hiPixel = 0;
      } else {
        loPixel = 0;
        hiPixel = 1;
      }
      buffer += addV;
    }
  if (loPixel && hiPixel) {
    *buffer = biShade;
  } else if (loPixel) {
    *buffer &= 0xF0;
    *buffer |= shade;
  } else {
    *buffer &= 0x0F;
    *buffer |= hiShade;
  }
}
```