user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<tft_fill_triangle>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,%r14d
  mov    %edx,%ebx
  mov    %ecx,0x14(%rsp)
  mov    %r8d,%r13d
  cmp    %r8d,%edx
  jle    L192
  mov    %r8d,%ebx
  mov    %edx,%r13d
  mov    %esi,%eax
  mov    %ecx,%esi
  mov    %eax,0x14(%rsp)
L192:
  cmp    %r13d,0x70(%rsp)
  jge    L219
  cmp    %ebx,0x70(%rsp)
  jge    L115
  mov    %esi,%r12d
  sub    %r9d,%r12d
  mov    %ebx,%eax
  sub    0x70(%rsp),%eax
  mov    %eax,0x20(%rsp)
  mov    0x14(%rsp),%eax
  mov    %eax,%ebp
  sub    %r9d,%ebp
  mov    %r13d,%r15d
  sub    0x70(%rsp),%r15d
  sub    %esi,%eax
  mov    %eax,0x18(%rsp)
  mov    %r13d,%eax
  sub    %ebx,%eax
  mov    %eax,0x1c(%rsp)
  cmp    %r13d,%ebx
  je     L111
  mov    %ebx,0x28(%rsp)
  mov    %esi,0x14(%rsp)
  mov    0x70(%rsp),%ebx
  mov    %r9d,%esi
  jmp    L168
L219:
  cmp    %ebx,0x70(%rsp)
  je     L38
  mov    0x14(%rsp),%eax
  mov    %eax,%r12d
  sub    %esi,%r12d
  mov    %r13d,%edx
  sub    %ebx,%edx
  mov    %edx,0x20(%rsp)
  mov    %r9d,%ebp
  sub    %esi,%ebp
  mov    0x70(%rsp),%r15d
  sub    %ebx,%r15d
  sub    %eax,%r9d
  mov    %r9d,0x18(%rsp)
  mov    0x70(%rsp),%eax
  sub    %r13d,%eax
  mov    %eax,0x1c(%rsp)
  cmp    %r13d,0x70(%rsp)
  jne    L77
  mov    %r13d,0x28(%rsp)
  mov    0x70(%rsp),%r13d
  jmp    L213
L7:
  mov    0x14(%rsp),%eax
  mov    %r9d,0x14(%rsp)
  mov    %eax,%r9d
L38:
  mov    0x14(%rsp),%eax
  cmp    %esi,%eax
  jl     L169
  cmovl  %esi,%eax
  mov    %esi,0x14(%rsp)
  mov    %eax,%esi
L169:
  mov    0x14(%rsp),%eax
  cmp    %r9d,%eax
  jg     L179
  cmp    %r9d,%esi
  cmovl  %r9d,%esi
  mov    %eax,%r9d
L179:
  mov    %ebx,%r8d
  mov    %esi,%ecx
  mov    %ebx,%edx
  mov    %r9d,%esi
  mov    %r14d,%edi
  call   <tft_fill@plt>
L185:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L77:
  mov    %r13d,0x28(%rsp)
  mov    0x70(%rsp),%r13d
  jmp    L168
L82:
  mov    %ebx,0x2c(%rsp)
  mov    %esi,0x10(%rsp)
  mov    %ebp,0xc(%rsp)
L41:
  mov    %ebx,%r12d
  sub    0x28(%rsp),%r12d
  imul   0x18(%rsp),%r12d
  mov    %ebx,%ebp
  sub    0x2c(%rsp),%ebp
  imul   0xc(%rsp),%ebp
  cmp    %r13d,%ebx
  jle    L71
  jmp    L185
L111:
  mov    %ebx,0x28(%rsp)
  mov    %esi,0x14(%rsp)
  mov    0x70(%rsp),%eax
  mov    %eax,0x2c(%rsp)
  mov    %r9d,0x10(%rsp)
  mov    %ebp,0xc(%rsp)
  mov    %r12d,0x24(%rsp)
  mov    %eax,%ebx
  mov    %r13d,0x70(%rsp)
  mov    %r9d,%esi
  mov    %r9d,%ecx
  jmp    L183
L62:
  mov    %ebx,%r8d
  mov    %ebx,%edx
  mov    %r14d,%edi
  call   <tft_fill@plt>
  add    $0x1,%ebx
  cmp    %r13d,%ebx
  jg     L185
L71:
  mov    %r12d,%eax
  cltd
  idivl  0x1c(%rsp)
  mov    0x14(%rsp),%edx
  lea    (%rax,%rdx,1),%esi
  mov    %ebp,%eax
  cltd
  idiv   %r15d
  mov    0x10(%rsp),%edi
  lea    (%rax,%rdi,1),%ecx
  add    0x18(%rsp),%r12d
  add    0xc(%rsp),%ebp
  cmp    %ecx,%esi
  jle    L62
  mov    %esi,%eax
  mov    %ecx,%esi
  mov    %eax,%ecx
  jmp    L62
L115:
  cmp    %r13d,%ebx
  je     L7
  mov    %r9d,%r12d
  sub    %esi,%r12d
  mov    0x70(%rsp),%eax
  sub    %ebx,%eax
  mov    %eax,0x20(%rsp)
  mov    0x14(%rsp),%eax
  mov    %eax,%ebp
  sub    %esi,%ebp
  mov    %r13d,%r15d
  sub    %ebx,%r15d
  sub    %r9d,%eax
  mov    %eax,0x18(%rsp)
  mov    %r13d,%eax
  sub    0x70(%rsp),%eax
  mov    %eax,0x1c(%rsp)
  mov    0x70(%rsp),%eax
  mov    %eax,0x28(%rsp)
  mov    %r9d,0x14(%rsp)
L168:
  mov    0x28(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0x70(%rsp)
L213:
  cmp    %ebx,0x70(%rsp)
  jl     L82
  mov    %ebx,0x2c(%rsp)
  mov    %esi,0x10(%rsp)
  mov    %ebp,0xc(%rsp)
  mov    %r12d,0x24(%rsp)
  mov    %esi,%ecx
L183:
  mov    %ebx,%r8d
  mov    %ebx,%edx
  mov    %r14d,%edi
  call   <tft_fill@plt>
  add    $0x1,%ebx
  cmp    0x70(%rsp),%ebx
  jg     L41
  mov    %r12d,%eax
  cltd
  idivl  0x20(%rsp)
  mov    %eax,%edi
  mov    0x10(%rsp),%ecx
  lea    (%rax,%rcx,1),%esi
  mov    %ebp,%eax
  cltd
  idiv   %r15d
  add    %eax,%ecx
  add    0x24(%rsp),%r12d
  add    0xc(%rsp),%ebp
  cmp    %eax,%edi
  jle    L183
  mov    %esi,%eax
  mov    %ecx,%esi
  mov    %eax,%ecx
  jmp    L183
```

assistant: ```c
void tft_fill_triangle(int color, int x0, int y0, int x1, int y1, int x2, int y2) {
  int a, b, y, last;
  if (y0 > y1) {
    {
      int _t = y0;
      y0 = y1;
      y1 = _t;
    };
    {
      int _t = x0;
      x0 = x1;
      x1 = _t;
    };
  }
  if (y1 > y2) {
    {
      int _t = y2;
      y2 = y1;
      y1 = _t;
    };
    {
      int _t = x2;
      x2 = x1;
      x1 = _t;
    };
  }
  if (y0 > y1) {
    {
      int _t = y0;
      y0 = y1;
      y1 = _t;
    };
    {
      int _t = x0;
      x0 = x1;
      x1 = _t;
    };
  }
  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;
    tft_fill(color, a, y0, b, y0);
    return;
  }
  int dx01 = x1 - x0;
  int dy01 = y1 - y0;
  int dx02 = x2 - x0;
  int dy02 = y2 - y0;
  int dx12 = x2 - x1;
  int dy12 = y2 - y1;
  int sa = 0;
  int 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) {
      int _t = a;
      a = b;
      b = _t;
    };
    tft_fill(color, a, y, b, y);
  }
  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) {
      int _t = a;
      a = b;
      b = _t;
    };
    tft_fill(color, a, y, b, y);
  }
}
```