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

```asm
<fillTriangle>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,%r10d
  mov    %esi,%edi
  mov    %edx,%esi
  mov    %ecx,%eax
  mov    0x60(%rsp),%r11d
  mov    %r8d,%ecx
  mov    %r9w,0xc(%rsp)
  mov    %r11d,%r13d
  mov    %eax,%edx
  cmp    %ax,%di
  cmovle %edi,%edx
  mov    %dx,0x18(%rsp)
  mov    %eax,%ebx
  cmovg  %edi,%ebx
  mov    %bx,0x1a(%rsp)
  mov    %r10d,%edx
  cmovg  %esi,%edx
  mov    %esi,%eax
  cmovg  %r10d,%eax
  cmp    %bx,%r9w
  jge    L27
  cmp    0x18(%rsp),%r9w
  jge    L148
  movzwl 0x18(%rsp),%ecx
  mov    %r9w,0x18(%rsp)
  movzwl 0x1a(%rsp),%ebx
  mov    %bx,0xc(%rsp)
  mov    %cx,0x1a(%rsp)
  mov    %edx,%esi
  mov    %r8d,%edx
  mov    %eax,%ecx
  mov    %esi,%eax
  jmp    L14
L152:
  cmp    %dx,%ax
  jl     L113
  cmovl  %edx,%eax
  mov    %eax,%esi
  mov    %edx,%eax
  mov    %esi,%edx
L113:
  cmp    %cx,%ax
  jg     L91
  cmp    %cx,%dx
  cmovl  %ecx,%edx
  mov    %eax,%ecx
L91:
  movswl %r11w,%r11d
  add    $0x1,%edx
  sub    %ecx,%edx
  movswl %dx,%edx
  movswl 0x18(%rsp),%esi
  movswl %cx,%edi
  mov    %r11d,%ecx
  call   <writeFastHLine@plt>
L29:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L159:
  movswl %r13w,%ecx
  lea    0x1(%rax),%edx
  mov    %edx,%eax
  sub    %edi,%eax
  movswl %ax,%edx
  movswl %bx,%esi
  movswl %di,%edi
  call   <writeFastHLine@plt>
  add    $0x1,%ebx
  cmp    %bx,%r14w
  jl     L78
L25:
  mov    %ebp,%eax
  cltd
  idivl  0x14(%rsp)
  movzwl 0x6(%rsp),%esi
  lea    (%rsi,%rax,1),%edi
  movswl %r15w,%ecx
  mov    %r12d,%eax
  cltd
  idiv   %ecx
  add    %esi,%eax
  movswl 0x10(%rsp),%edx
  add    %edx,%ebp
  movswl 0x8(%rsp),%edx
  add    %edx,%r12d
  cmp    %ax,%di
  jle    L159
  mov    %edi,%edx
  mov    %eax,%edi
  mov    %edx,%eax
  jmp    L159
L40:
  movzwl 0x18(%rsp),%ebx
L78:
  movswl 0x1c(%rsp),%ecx
  mov    %ecx,0x10(%rsp)
  movswl %bx,%ebp
  movswl 0x1a(%rsp),%eax
  mov    %ebp,%r12d
  sub    %eax,%r12d
  imul   %ecx,%r12d
  movswl 0x8(%rsp),%ecx
  mov    %ecx,0x8(%rsp)
  movswl 0x18(%rsp),%eax
  sub    %eax,%ebp
  imul   %ecx,%ebp
  cmp    0xc(%rsp),%bx
  jg     L29
  movswl 0x1e(%rsp),%r14d
  jmp    L100
L22:
  movswl %r13w,%ecx
  lea    0x1(%rax),%edx
  mov    %edx,%eax
  sub    %edi,%eax
  movswl %ax,%edx
  movswl %bx,%esi
  movswl %di,%edi
  call   <writeFastHLine@plt>
  add    $0x1,%ebx
  cmp    0xc(%rsp),%bx
  jg     L29
L100:
  mov    %r12d,%eax
  cltd
  idiv   %r14d
  movzwl 0xe(%rsp),%esi
  lea    (%rsi,%rax,1),%edi
  movswl %r15w,%ecx
  mov    %ebp,%eax
  cltd
  idiv   %ecx
  add    0x6(%rsp),%ax
  add    0x10(%rsp),%r12d
  add    0x8(%rsp),%ebp
  cmp    %ax,%di
  jle    L22
  mov    %edi,%edx
  mov    %eax,%edi
  mov    %edx,%eax
  jmp    L22
L148:
  movzwl 0x1a(%rsp),%ecx
  mov    %r9w,0x1a(%rsp)
  mov    %cx,0xc(%rsp)
  mov    %eax,%ecx
  mov    %r8d,%eax
L27:
  movzwl 0xc(%rsp),%esi
  cmp    %si,0x18(%rsp)
  je     L152
L14:
  mov    %ax,0xe(%rsp)
  mov    %dx,0x6(%rsp)
  mov    %eax,%ebx
  sub    %edx,%ebx
  mov    %bx,0x10(%rsp)
  movzwl 0x1a(%rsp),%edi
  mov    %edi,%esi
  movzwl 0x18(%rsp),%r11d
  sub    %r11d,%esi
  mov    %ecx,%ebx
  sub    %edx,%ebx
  mov    %bx,0x8(%rsp)
  movzwl 0xc(%rsp),%ebx
  mov    %ebx,%r15d
  mov    %r11d,%edx
  sub    %edx,%r15d
  sub    %eax,%ecx
  mov    %cx,0x1c(%rsp)
  mov    %ebx,%eax
  sub    %edi,%eax
  mov    %ax,0x1e(%rsp)
  lea    -0x1(%rdi),%eax
  cmp    %bx,%di
  cmove  %ebx,%eax
  mov    %eax,%r14d
  cmp    %r11w,%ax
  jl     L40
  mov    %r11d,%ebx
  mov    $0x0,%r12d
  mov    $0x0,%ebp
  movswl %si,%eax
  mov    %eax,0x14(%rsp)
  jmp    L25
```

assistant: ```c
void fillTriangle(short x0, short y0, short x1, short y1, short x2, short y2, short color) {
  short a, b, y, last, dx01, dy01, dx02, dy02, dx12, dy12;
  int sa, sb;
  if (y0 > y1) {
    {
      short temp;
      temp = y0;
      y0 = y1;
      y1 = temp;
    };
    {
      short temp;
      temp = x0;
      x0 = x1;
      x1 = temp;
    };
  }
  if (y1 > y2) {
    {
      short temp;
      temp = y2;
      y2 = y1;
      y1 = temp;
    };
    {
      short temp;
      temp = x2;
      x2 = x1;
      x1 = temp;
    };
  }
  if (y0 > y1) {
    {
      short temp;
      temp = y0;
      y0 = y1;
      y1 = temp;
    };
    {
      short temp;
      temp = x0;
      x0 = x1;
      x1 = temp;
    };
  }
  if (y0 == y2) {
    a = b = x0;
    if (x1 < a)
      a = x1;
    else if (x1 > b)
      b = x1;
    if (x2 < a)
      a = x2;
    else if (x2 > b)
      b = x2;
    writeFastHLine(a, y0, b - a + 1, color);
    return;
  }
  dx01 = x1 - x0;
  dy01 = y1 - y0;
  dx02 = x2 - x0;
  dy02 = y2 - y0;
  dx12 = x2 - x1;
  dy12 = y2 - y1;
  sa = 0;
  sb = 0;
  if (y1 == y2)
    last = y1;
  else
    last = y1 - 1;
  for (y = y0; y <= last; y++) {
    a = x0 + sa / dy01;
    b = x0 + sb / dy02;
    sa += dx01;
    sb += dx02;
    if (a > b) {
      short temp;
      temp = a;
      a = b;
      b = temp;
    };
    writeFastHLine(a, y, b - a + 1, color);
  }
  sa = dx12 * (y - y1);
  sb = dx02 * (y - y0);
  for (; y <= y2; y++) {
    a = x1 + sa / dy12;
    b = x0 + sb / dy02;
    sa += dx12;
    sb += dx02;
    if (a > b) {
      short temp;
      temp = a;
      a = b;
      b = temp;
    };
    writeFastHLine(a, y, b - a + 1, color);
  }
}
```