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

```asm
<graph_fill_polygon>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x8,%rsp
  mov    %ecx,%r13d
  mov    %esi,0x38(%rsp)
  mov    %rdi,%rbx
  mov    %edx,%r14d
  mov    %dl,0x41(%rsp)
  mov    %r8d,%r15d
  mov    %r9d,%r11d
  mov    %r9d,%ebp
  mov    %r13b,0x42(%rsp)
  mov    0x1040(%rsp),%rcx
  mov    %r8b,0x43(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xff8(%rsp)
  xor    %eax,%eax
  test   %esi,%esi
  je     L279
  lea    -0x1(%rsi),%eax
  mov    %rdi,%rdx
  mov    $0xfffe7961,%r12d
  mov    $0x1869f,%r10d
  lea    0x8(%rdi,%rax,8),%r9
  mov    $0x1869f,%r8d
  mov    $0xfffe7961,%eax
  nopw   0x0(%rax,%rax,1)
L12:
  mov    (%rdx),%esi
  mov    0x4(%rdx),%edi
  cmp    $0x270f,%esi
  je     L242
  cmp    $0x270f,%edi
  je     L242
  cmp    %esi,%r8d
  cmovg  %esi,%r8d
  cmp    %edi,%r10d
  cmovg  %edi,%r10d
  cmp    %esi,%r12d
  cmovl  %esi,%r12d
  cmp    %edi,%eax
  cmovl  %edi,%eax
L242:
  add    $0x8,%rdx
  cmp    %r9,%rdx
  jne    L12
  xor    %edi,%edi
  test   %r10d,%r10d
  mov    %r12d,%esi
  mov    %eax,%edx
  cmovs  %edi,%r10d
  test   %r8d,%r8d
  cmovns %r8d,%edi
  mov    %edi,0x8(%rsp)
L145:
  mov    0x1048(%rsp),%edi
  sub    $0x1,%edi
  cmp    %esi,0x1048(%rsp)
  cmovbe %edi,%r12d
  mov    0x1050(%rsp),%edi
  lea    -0x1(%rdi),%esi
  cmp    %edx,%edi
  cmovbe %esi,%eax
  cmp    %r10d,%eax
  jl     L243
  movzbl %r11b,%r9d
  mov    $0xff,%edx
  movzbl %r15b,%esi
  add    $0x1,%eax
  sub    %r9d,%edx
  mov    0x38(%rsp),%edi
  mov    %eax,0x3c(%rsp)
  imul   %edx,%esi
  sub    $0x1,%edi
  lea    (%rdi,%rdi,1),%eax
  mov    %edi,0x44(%rsp)
  mov    %esi,0xc(%rsp)
  movzbl %r13b,%esi
  cltq
  imul   %edx,%esi
  lea    0x4(%rbx,%rax,4),%rax
  mov    %rax,0x48(%rsp)
  lea    0x50(%rsp),%rax
  mov    %rax,0x18(%rsp)
  lea    -0x1(%r12),%eax
  mov    %esi,0x10(%rsp)
  movzbl %r14b,%esi
  imul   %edx,%esi
  mov    %eax,0x30(%rsp)
  mov    0x8(%rsp),%eax
  add    $0x1,%eax
  mov    %esi,0x14(%rsp)
  mov    0x1048(%rsp),%esi
  mov    %eax,0x34(%rsp)
  imul   %r10d,%esi
  mov    %esi,0x20(%rsp)
  nopl   0x0(%rax)
L10:
  mov    0x38(%rsp),%eax
  test   %eax,%eax
  je     L28
  mov    0x48(%rsp),%rdi
  mov    0x44(%rsp),%r11d
  mov    %eax,%r13d
  xor    %esi,%esi
  xor    %r8d,%r8d
  mov    (%rdi),%edi
  jmp    L335
  nopw   0x0(%rax,%rax,1)
L58:
  cmp    %r15d,%r10d
  jg     L289
L168:
  add    %eax,%eax
  mov    %r10d,%edx
  sub    %edi,%r15d
  movslq %r8d,%r14
  cltq
  sub    %edi,%edx
  add    $0x1,%r8d
  mov    (%rbx,%rax,4),%eax
  sub    (%rbx,%rsi,8),%eax
  imul   %edx,%eax
  cltd
  idiv   %r15d
  add    (%rbx,%rsi,8),%eax
  mov    %eax,0x50(%rsp,%r14,4)
L289:
  cmp    $0x3e8,%r8d
  je     L9
L319:
  add    $0x1,%rsi
  cmp    %rsi,%r13
  je     L307
L335:
  mov    %edi,%r15d
  mov    0x4(%rbx,%rsi,8),%edi
  mov    %r11d,%eax
  mov    %esi,%r11d
  cmp    %r10d,%edi
  jl     L58
  cmp    %r15d,%r10d
  jg     L168
  cmp    $0x3e8,%r8d
  jne    L319
L9:
  mov    $0x3e7,%r13d
L166:
  xor    %edx,%edx
  xor    %eax,%eax
L81:
  mov    0x18(%rsp),%rdi
  lea    (%rdi,%rax,4),%rax
  jmp    L299
L286:
  mov    (%rax),%edi
  mov    0x4(%rax),%r11d
  add    $0x4,%rax
  lea    0x1(%rdx),%esi
  cmp    %r11d,%edi
  jg     L159
  mov    %esi,%edx
L299:
  cmp    %r13d,%edx
  jl     L286
  test   %r8d,%r8d
  je     L35
  sub    $0x1,%r8d
  mov    %rbx,0x28(%rsp)
  mov    0x18(%rsp),%r11
  shr    %r8d
  mov    %r10d,0x24(%rsp)
  movzbl 0x41(%rsp),%ebx
  mov    %r8d,%eax
  movzbl 0x42(%rsp),%r13d
  movzbl 0x43(%rsp),%r15d
  lea    0x58(%rsp,%rax,8),%r14
  jmp    L42
  nopw   0x0(%rax,%rax,1)
L224:
  add    $0x8,%r11
  cmp    %r11,%r14
  je     L223
L42:
  mov    (%r11),%eax
  cmp    %r12d,%eax
  jge    L223
  mov    0x4(%r11),%edx
  cmp    0x8(%rsp),%edx
  jle    L224
  cmp    0x8(%rsp),%eax
  jg     L214
  mov    0x34(%rsp),%eax
  mov    %eax,(%r11)
L214:
  cmp    %r12d,%edx
  jl     L191
  mov    0x30(%rsp),%esi
  mov    %esi,0x4(%r11)
  mov    %esi,%edx
L191:
  cmp    %edx,%eax
  jge    L224
  mov    0x20(%rsp),%esi
  add    %esi,%eax
  add    %esi,%edx
  lea    (%rax,%rax,2),%eax
  lea    (%rdx,%rdx,2),%r10d
  jmp    L203
  nopl   0x0(%rax)
L269:
  mov    %r15b,(%r8)
  mov    %ebx,%edx
  mov    %r13b,(%rdi)
L161:
  add    $0x3,%eax
  mov    %dl,(%rsi)
  cmp    %eax,%r10d
  je     L224
L203:
  movslq %eax,%rdx
  lea    (%rcx,%rdx,1),%r8
  lea    0x1(%rcx,%rdx,1),%rdi
  lea    0x2(%rcx,%rdx,1),%rsi
  test   %bpl,%bpl
  je     L269
  movzbl (%r8),%edx
  imul   %r9d,%edx
  add    0xc(%rsp),%edx
  movzbl %dh,%edx
  mov    %dl,(%r8)
  movzbl (%rdi),%edx
  imul   %r9d,%edx
  add    0x10(%rsp),%edx
  mov    %dh,(%rdi)
  movzbl (%rsi),%edx
  imul   %r9d,%edx
  add    0x14(%rsp),%edx
  movzbl %dh,%edx
  jmp    L161
  nop
L223:
  mov    0x24(%rsp),%r10d
  mov    0x28(%rsp),%rbx
L35:
  mov    0x1048(%rsp),%edi
  add    $0x1,%r10d
  add    %edi,0x20(%rsp)
  cmp    %r10d,0x3c(%rsp)
  jne    L10
L243:
  mov    0xff8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L302
  add    $0x1008,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L159:
  movslq %edx,%rax
  movslq %esi,%rsi
  mov    %r11d,0x50(%rsp,%rax,4)
  mov    %edi,0x50(%rsp,%rsi,4)
  test   %edx,%edx
  je     L81
  sub    $0x1,%edx
  movslq %edx,%rax
  jmp    L81
  nopw   0x0(%rax,%rax,1)
L307:
  lea    -0x1(%r8),%r13d
  jmp    L166
L28:
  mov    $0xffffffff,%r13d
  xor    %r8d,%r8d
  jmp    L166
L279:
  mov    $0x1869f,%r10d
  mov    $0xfffe7961,%edx
  mov    $0xfffe7961,%esi
  movl   $0x1869f,0x8(%rsp)
  mov    $0xfffe7961,%eax
  mov    $0xfffe7961,%r12d
  jmp    L145
L302:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void graph_fill_polygon(int *points, unsigned int no_of_points, unsigned char r, unsigned char g, unsigned char b, unsigned char transparency, unsigned char *buffer, unsigned int img_width, unsigned int img_height) {
  int nodes, nodeX[1000], i, j, swap, n, x, y;
  int min_x = 99999, min_y = 99999;
  int max_x = -99999, max_y = -99999;
  for (i = 0; i < no_of_points; i++) {
    x = points[i * 2];
    y = points[i * 2 + 1];
    if ((x == 9999) || (y == 9999))
      continue;
    if (x < min_x)
      min_x = x;
    if (y < min_y)
      min_y = y;
    if (x > max_x)
      max_x = x;
    if (y > max_y)
      max_y = y;
  }
  if (min_x < 0)
    min_x = 0;
  if (min_y < 0)
    min_y = 0;
  if (max_x >= img_width)
    max_x = img_width - 1;
  if (max_y >= img_height)
    max_y = img_height - 1;
  for (y = min_y; y <= max_y; y++) {
    nodes = 0;
    j = no_of_points - 1;
    for (i = 0; i < no_of_points; i++) {
      if (((points[i * 2 + 1] < y) && (points[j * 2 + 1] >= y)) || ((points[j * 2 + 1] < y) && (points[i * 2 + 1] >= y))) {
        nodeX[nodes++] = points[i * 2] + (y - points[i * 2 + 1]) * (points[j * 2] - points[i * 2]) / (points[j * 2 + 1] - points[i * 2 + 1]);
      }
      j = i;
      if (nodes == 1000)
        break;
    }
    i = 0;
    while (i < nodes - 1) {
      if (nodeX[i] > nodeX[i + 1]) {
        swap = nodeX[i];
        nodeX[i] = nodeX[i + 1];
        nodeX[i + 1] = swap;
        if (i)
          i--;
      } else {
        i++;
      }
    }
    for (i = 0; i < nodes; i += 2) {
      if (nodeX[i] >= max_x)
        break;
      if (nodeX[i + 1] > min_x) {
        if (nodeX[i] <= min_x)
          nodeX[i] = min_x + 1;
        if (nodeX[i + 1] >= max_x)
          nodeX[i + 1] = max_x - 1;
        for (x = nodeX[i]; x < nodeX[i + 1]; x++) {
          n = ((y * img_width) + x) * 3;
          if (transparency == 0) {
            buffer[n] = b;
            buffer[n + 1] = g;
            buffer[n + 2] = r;
          } else {
            buffer[n] = ((b * (255 - transparency)) + (buffer[n] * transparency)) / 256;
            buffer[n + 1] = ((g * (255 - transparency)) + (buffer[n + 1] * transparency)) / 256;
            buffer[n + 2] = ((r * (255 - transparency)) + (buffer[n + 2] * transparency)) / 256;
          }
        }
      }
    }
  }
}
```