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

```asm
<polygon_triangulate>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %edi,0x30(%rsp)
  mov    %rdx,0x38(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  cmp    $0x2,%edi
  jle    L154
  mov    %rsi,%r13
  test   %rsi,%rsi
  je     L53
  test   %rdx,%rdx
  je     L71
  lea    (%rdi,%rdi,1),%ecx
  movslq %ecx,%rax
  lea    -0x18(%rdx,%rax,4),%r15
  movslq %edi,%rdx
  xor    %eax,%eax
  nopl   0x0(%rax)
L91:
  mov    %eax,(%r15,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L91
  mov    0x30(%rsp),%eax
  movl   $0x0,0x34(%rsp)
  lea    -0x1(%rax),%r14d
  lea    -0x1(%rcx),%eax
  mov    %eax,0x2c(%rsp)
  lea    0x50(%rsp),%rax
  mov    %rax,0x20(%rsp)
  jmp    L225
  nopl   0x0(%rax,%rax,1)
L43:
  movslq %ebp,%rax
  lea    (%r15,%rax,4),%rax
  mov    %rax,0x8(%rsp)
  lea    0x2(%r14),%eax
  mov    %eax,0x28(%rsp)
  cmp    %eax,%edi
  jg     L130
  mov    %r15,0x10(%rsp)
  movl   $0x0,0x28(%rsp)
L89:
  movslq %r14d,%rdx
  mov    0x8(%rsp),%rax
  lea    (%r15,%rdx,4),%r12
  mov    (%rax),%eax
  mov    (%r12),%ecx
  add    %eax,%eax
  lea    (%rcx,%rcx,1),%edx
  cltq
  movslq %edx,%rdx
  lea    0x0(%r13,%rax,8),%rsi
  lea    0x0(%r13,%rdx,8),%rdi
  movsd  0x8(%r13,%rdx,8),%xmm1
  movsd  (%rdi),%xmm2
  movsd  (%rsi),%xmm0
  subsd  %xmm2,%xmm0
  movsd  %xmm0,0x40(%rsp)
  movsd  0x8(%r13,%rax,8),%xmm0
  mov    0x10(%rsp),%rax
  mov    (%rax),%eax
  subsd  %xmm1,%xmm0
  mov    %eax,0x18(%rsp)
  add    %eax,%eax
  cltq
  movsd  %xmm0,0x48(%rsp)
  lea    0x0(%r13,%rax,8),%rdx
  movsd  (%rdx),%xmm0
  subsd  %xmm2,%xmm0
  movsd  %xmm0,0x50(%rsp)
  movsd  0x8(%r13,%rax,8),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,0x58(%rsp)
  call   <LeftTurn@plt>
  test   %rax,%rax
  jns    L54
  mov    0x2c(%rsp),%ecx
  lea    -0x1(%rcx),%eax
  test   %ecx,%ecx
  jle    L39
L32:
  mov    %eax,0x2c(%rsp)
  mov    %ebp,%r14d
L225:
  mov    0x30(%rsp),%edi
  lea    0x1(%r14),%ebp
  cmp    %edi,%ebp
  jl     L43
  mov    %r15,0x8(%rsp)
  xor    %ebp,%ebp
  movl   $0x1,0x28(%rsp)
L130:
  movslq 0x28(%rsp),%rax
  lea    (%r15,%rax,4),%rax
  mov    %rax,0x10(%rsp)
  jmp    L89
  cs nopw 0x0(%rax,%rax,1)
L54:
  movslq 0x30(%rsp),%r11
  mov    (%r12),%ecx
  mov    %r12,0x18(%rsp)
  xor    %ebx,%ebx
  mov    %r15,%r12
  mov    %ebp,%r15d
  mov    %r13,%rbp
  mov    %r11,%r13
  nopl   0x0(%rax)
L14:
  cmp    %r14d,%ebx
  sete   %al
  cmp    %r15d,%ebx
  sete   %dl
  or     %dl,%al
  jne    L156
  cmp    %ebx,0x28(%rsp)
  je     L156
  mov    (%r12,%rbx,4),%eax
  mov    0x20(%rsp),%rdx
  lea    0x40(%rsp),%rsi
  add    %eax,%eax
  cltq
  lea    0x0(%rbp,%rax,8),%r10
  lea    (%rcx,%rcx,1),%eax
  cltq
  mov    %r10,%rcx
  lea    0x0(%rbp,%rax,8),%rdi
  call   <TriangleContainsPoint@plt>
  test   %rax,%rax
  jne    L191
  mov    0x18(%rsp),%rax
  mov    (%rax),%ecx
L156:
  add    $0x1,%rbx
  cmp    %r13,%rbx
  jne    L14
  mov    0x8(%rsp),%rax
  mov    %rbp,%r13
  mov    %r15d,%ebp
  mov    %r12,%r15
  mov    (%rax),%ebx
  mov    0x10(%rsp),%rax
  mov    (%rax),%r12d
  test   %ebp,%ebp
  je     L211
  lea    -0x1(%rbp),%eax
  movslq %ebp,%rdx
  mov    %ecx,0x28(%rsp)
  cltq
  shl    $0x2,%rdx
  neg    %rax
  shl    $0x2,%rax
  lea    -0x4(%rdx,%rax,1),%rsi
  add    %rdx,%rax
  add    %r15,%rsi
  lea    (%r15,%rax,1),%rdi
  call   <memmove@plt>
  mov    0x28(%rsp),%ecx
L211:
  mov    0x34(%rsp),%edi
  mov    0x38(%rsp),%r8
  add    $0x4,%r15
  subl   $0x1,0x30(%rsp)
  mov    0x30(%rsp),%esi
  lea    (%rdi,%rdi,2),%edx
  add    $0x1,%edi
  movslq %edx,%rdx
  mov    %edi,0x34(%rsp)
  lea    (%rsi,%rsi,1),%eax
  mov    %ecx,(%r8,%rdx,4)
  add    $0x1,%rdx
  mov    %ebx,(%r8,%rdx,4)
  mov    %r12d,0x4(%r8,%rdx,4)
  cmp    $0x2,%esi
  je     L159
  sub    $0x1,%eax
  xor    %ebp,%ebp
  jmp    L32
  nopl   0x0(%rax)
L191:
  mov    0x2c(%rsp),%ecx
  mov    %rbp,%r13
  mov    %r15d,%ebp
  mov    %r12,%r15
  lea    -0x1(%rcx),%eax
  test   %ecx,%ecx
  jg     L32
  nopl   0x0(%rax,%rax,1)
L39:
  mov    $0x1,%eax
L148:
  mov    0x68(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L190
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L159:
  xor    %eax,%eax
  jmp    L148
L154:
  mov    $0xffffffff,%eax
  jmp    L148
L53:
  mov    $0xfffffffe,%eax
  jmp    L148
L71:
  mov    $0xfffffffd,%eax
  jmp    L148
L190:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int polygon_triangulate(int n, const double *v, int *t) {
  int *V;
  int nv;
  int i;
  int count;
  int tc = 0;
  if (n < 3) {
    return -1;
  }
  if (NULL == v) {
    return -2;
  }
  if (NULL == t) {
    return -3;
  }
  V = t + 2 * n - 6;
  nv = n;
  for (i = 0; i < n; ++i) {
    V[i] = i;
  }
  count = 2 * nv;
  for (i = nv - 1; nv > 2;) {
    int u, w;
    if (0 >= (count--)) {
      return 1;
    }
    u = i;
    i = u + 1;
    if (nv <= i) {
      i = 0;
    }
    w = i + 1;
    if (nv <= w) {
      w = 0;
    }
    int can_clip = 1;
    {
      int p;
      double tri_a[2] = {v[2 * V[i] + 0] - v[2 * V[u] + 0], v[2 * V[i] + 1] - v[2 * V[u] + 1]};
      double tri_b[2] = {v[2 * V[w] + 0] - v[2 * V[u] + 0], v[2 * V[w] + 1] - v[2 * V[u] + 1]};
      if (LeftTurn(&v[2 * V[u]], &v[2 * V[i]], &v[2 * V[w]]) < 0) {
        can_clip = 0;
      } else {
        for (p = 0; p < nv; ++p) {
          if ((p == u) || (p == i) || (p == w)) {
            continue;
          }
          if (TriangleContainsPoint(&v[2 * V[u]], tri_a, tri_b, &v[2 * V[p]])) {
            can_clip = 0;
            break;
          }
        }
      }
    }
    if (can_clip) {
      int tri[3] = {V[u], V[i], V[w]};
      while (i > 0) {
        V[i] = V[i - 1];
        --i;
      }
      ++V;
      --nv;
      count = 2 * nv;
      t[3 * tc + 0] = tri[0];
      t[3 * tc + 1] = tri[1];
      t[3 * tc + 2] = tri[2];
      ++tc;
    }
  }
  return 0;
}
```