user: Please show me the C implementation that matches the assembly code listed below:

```asm
<oled_fill_triangle>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %esi,-0x58(%rbp)
  mov    %edx,-0x5c(%rbp)
  mov    %ecx,-0x60(%rbp)
  mov    %r8d,-0x64(%rbp)
  mov    %r9d,-0x68(%rbp)
  mov    -0x5c(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jle    L83
  mov    -0x5c(%rbp),%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x64(%rbp),%eax
  mov    %eax,-0x5c(%rbp)
  mov    -0x38(%rbp),%eax
  mov    %eax,-0x64(%rbp)
  mov    -0x58(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x60(%rbp),%eax
  mov    %eax,-0x58(%rbp)
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x60(%rbp)
L83:
  mov    -0x64(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jle    L101
  mov    0x10(%rbp),%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x64(%rbp),%eax
  mov    %eax,0x10(%rbp)
  mov    -0x30(%rbp),%eax
  mov    %eax,-0x64(%rbp)
  mov    -0x68(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x60(%rbp),%eax
  mov    %eax,-0x68(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x60(%rbp)
L101:
  mov    -0x5c(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jle    L109
  mov    -0x5c(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x64(%rbp),%eax
  mov    %eax,-0x5c(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x64(%rbp)
  mov    -0x58(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x60(%rbp),%eax
  mov    %eax,-0x58(%rbp)
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x60(%rbp)
L109:
  mov    -0x5c(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jne    L157
  mov    -0x58(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x4c(%rbp),%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x60(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jge    L141
  mov    -0x60(%rbp),%eax
  mov    %eax,-0x50(%rbp)
  jmp    L3
L141:
  mov    -0x60(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jle    L3
  mov    -0x60(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
L3:
  mov    -0x68(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jge    L45
  mov    -0x68(%rbp),%eax
  mov    %eax,-0x50(%rbp)
  jmp    L149
L45:
  mov    -0x68(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jle    L149
  mov    -0x68(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
L149:
  mov    -0x5c(%rbp),%edi
  mov    -0x4c(%rbp),%ecx
  mov    -0x5c(%rbp),%edx
  mov    -0x50(%rbp),%esi
  mov    -0x54(%rbp),%eax
  mov    %edi,%r8d
  mov    %eax,%edi
  call   <oled_fill@plt>
  jmp    L114
L157:
  mov    -0x60(%rbp),%eax
  sub    -0x58(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x64(%rbp),%eax
  sub    -0x5c(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x68(%rbp),%eax
  sub    -0x58(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  mov    0x10(%rbp),%eax
  sub    -0x5c(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x68(%rbp),%eax
  sub    -0x60(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  mov    0x10(%rbp),%eax
  sub    -0x64(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  movl   $0x0,-0x40(%rbp)
  movl   $0x0,-0x3c(%rbp)
  mov    -0x64(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jne    L174
  mov    -0x64(%rbp),%eax
  mov    %eax,-0x44(%rbp)
  jmp    L103
L174:
  mov    -0x64(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x44(%rbp)
L103:
  mov    -0x5c(%rbp),%eax
  mov    %eax,-0x48(%rbp)
  jmp    L140
L121:
  mov    -0x40(%rbp),%eax
  cltd
  idivl  -0x1c(%rbp)
  mov    %eax,%edx
  mov    -0x58(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x3c(%rbp),%eax
  cltd
  idivl  -0x14(%rbp)
  mov    %eax,%edx
  mov    -0x58(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x20(%rbp),%eax
  add    %eax,-0x40(%rbp)
  mov    -0x18(%rbp),%eax
  add    %eax,-0x3c(%rbp)
  mov    -0x50(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jle    L169
  mov    -0x50(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4c(%rbp),%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
L169:
  mov    -0x48(%rbp),%edi
  mov    -0x4c(%rbp),%ecx
  mov    -0x48(%rbp),%edx
  mov    -0x50(%rbp),%esi
  mov    -0x54(%rbp),%eax
  mov    %edi,%r8d
  mov    %eax,%edi
  call   <oled_fill@plt>
  addl   $0x1,-0x48(%rbp)
L140:
  mov    -0x48(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jle    L121
  mov    -0x48(%rbp),%eax
  sub    -0x64(%rbp),%eax
  mov    -0x10(%rbp),%edx
  imul   %edx,%eax
  mov    %eax,-0x40(%rbp)
  mov    -0x48(%rbp),%eax
  sub    -0x5c(%rbp),%eax
  mov    -0x18(%rbp),%edx
  imul   %edx,%eax
  mov    %eax,-0x3c(%rbp)
  jmp    L16
L29:
  mov    -0x40(%rbp),%eax
  cltd
  idivl  -0xc(%rbp)
  mov    %eax,%edx
  mov    -0x60(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x3c(%rbp),%eax
  cltd
  idivl  -0x14(%rbp)
  mov    %eax,%edx
  mov    -0x58(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x10(%rbp),%eax
  add    %eax,-0x40(%rbp)
  mov    -0x18(%rbp),%eax
  add    %eax,-0x3c(%rbp)
  mov    -0x50(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jle    L68
  mov    -0x50(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x4c(%rbp),%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x8(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
L68:
  mov    -0x48(%rbp),%edi
  mov    -0x4c(%rbp),%ecx
  mov    -0x48(%rbp),%edx
  mov    -0x50(%rbp),%esi
  mov    -0x54(%rbp),%eax
  mov    %edi,%r8d
  mov    %eax,%edi
  call   <oled_fill@plt>
  addl   $0x1,-0x48(%rbp)
L16:
  mov    -0x48(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jle    L29
L114:
  leave
  ret
```

assistant: ```c
void oled_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;
    oled_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;
    };
    oled_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;
    };
    oled_fill(color, a, y, b, y);
  }
}
```