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

```asm
<check_tri>:
  endbr64
  push   %r15
  mov    %ecx,%r11d
  mov    %rsi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x28,%rsp
  mov    %edx,0x1c(%rsp)
  test   %ecx,%ecx
  jne    L154
  test   %edi,%edi
  jle    L79
L96:
  lea    -0x1(%rbx),%eax
  mov    %r15,%rdx
  xor    %r14d,%r14d
  lea    (%rax,%rax,2),%rax
  lea    0xc(%r15,%rax,4),%rsi
L98:
  movslq 0x4(%rdx),%rcx
  movslq (%rdx),%rax
  cmp    %ecx,%eax
  cmovl  %rcx,%rax
  movslq 0x8(%rdx),%rcx
  cmp    %ecx,%eax
  cmovl  %rcx,%rax
  cmp    %eax,%r14d
  cmovl  %rax,%r14
  add    $0xc,%rdx
  cmp    %rsi,%rdx
  jne    L98
  lea    0x4(,%r14,4),%ebp
  test   %r11d,%r11d
  jne    L139
  mov    %ebp,%edi
  mov    %r11d,0x4(%rsp)
  call   <libaft_malloc@plt>
  lea    (%rbx,%rbx,2),%edi
  mov    %rax,%r13
  shl    $0x3,%edi
  call   <libaft_malloc@plt>
  lea    0x4(,%r14,4),%rdx
  mov    $0xff,%esi
  mov    %r13,%rdi
  mov    %rax,%rbp
  call   <memset@plt>
  mov    0x4(%rsp),%r11d
L225:
  lea    (%rbx,%rbx,2),%eax
  mov    %r15,%r10
  mov    %rbp,%rdx
  mov    $0x1,%ecx
  mov    %eax,0x4(%rsp)
  lea    0x1(%rax),%r8d
  mov    %r15,%rax
  nopl   0x0(%rax,%rax,1)
L104:
  mov    0x4(%rax),%esi
  lea    -0x1(%rcx),%edi
  add    $0xc,%rax
  add    $0x18,%rdx
  mov    %esi,-0x18(%rdx)
  movslq -0xc(%rax),%rsi
  mov    0x0(%r13,%rsi,4),%esi
  mov    %esi,-0x14(%rdx)
  movslq -0xc(%rax),%rsi
  mov    %edi,0x0(%r13,%rsi,4)
  mov    -0x4(%rax),%esi
  lea    0x1(%rcx),%edi
  mov    %esi,-0x10(%rdx)
  movslq -0x8(%rax),%rsi
  mov    0x0(%r13,%rsi,4),%esi
  mov    %esi,-0xc(%rdx)
  movslq -0x8(%rax),%rsi
  mov    %ecx,0x0(%r13,%rsi,4)
  mov    -0xc(%rax),%esi
  add    $0x3,%ecx
  mov    %esi,-0x8(%rdx)
  movslq -0x4(%rax),%rsi
  mov    0x0(%r13,%rsi,4),%esi
  mov    %esi,-0x4(%rdx)
  movslq -0x4(%rax),%rsi
  mov    %edi,0x0(%r13,%rsi,4)
  cmp    %r8d,%ecx
  jne    L104
  movl   $0x0,0x10(%rsp)
  xor    %r14d,%r14d
  xor    %r8d,%r8d
  mov    $0xaaaaaaab,%r9d
  nopl   0x0(%rax,%rax,1)
L123:
  mov    %r10,%r12
  mov    $0x2,%ebx
L212:
  movslq (%r12),%rax
  mov    %rax,%rsi
  mov    0x0(%r13,%rax,4),%eax
  test   %eax,%eax
  js     L88
  mov    %ebx,%edx
  imul   %r9,%rdx
  shr    $0x21,%rdx
  lea    (%rdx,%rdx,2),%ecx
  mov    %ebx,%edx
  sub    %ecx,%edx
  xor    %ecx,%ecx
  add    %r14d,%edx
  movslq %edx,%rdx
  mov    (%r15,%rdx,4),%edx
  nopl   0x0(%rax)
L90:
  add    %eax,%eax
  cltq
  cmp    0x0(%rbp,%rax,4),%edx
  jne    L38
  add    $0x1,%ecx
L38:
  mov    0x4(%rbp,%rax,4),%eax
  test   %eax,%eax
  jns    L90
  test   %ecx,%ecx
  je     L88
  cmp    $0x1,%ecx
  je     L168
  test   %r11d,%r11d
  jne    L200
L39:
  addl   $0x1,0x10(%rsp)
L168:
  add    $0x1,%ebx
  add    $0x4,%r12
  cmp    $0x5,%ebx
  jne    L212
  add    $0x3,%r14d
  add    $0xc,%r10
  cmp    0x4(%rsp),%r14d
  jne    L123
  mov    %r13,%rdi
  mov    %r8d,0x4(%rsp)
  call   <libaft_free@plt>
  mov    %rbp,%rdi
  call   <libaft_free@plt>
  mov    0x4(%rsp),%r8d
  test   %r8d,%r8d
  jne    L43
L146:
  add    $0x28,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L88:
  test   %r11d,%r11d
  jne    L87
L163:
  add    $0x1,%r8d
  jmp    L168
  nopl   0x0(%rax,%rax,1)
L87:
  mov    %ebx,%eax
  mov    0x1c(%rsp),%edi
  mov    %r11d,0x18(%rsp)
  imul   %r9,%rax
  mov    %r8d,0x14(%rsp)
  add    %edi,%esi
  mov    %r10,0x8(%rsp)
  shr    $0x21,%rax
  lea    (%rax,%rax,2),%edx
  mov    %ebx,%eax
  sub    %edx,%eax
  add    %r14d,%eax
  cltq
  mov    (%r15,%rax,4),%edx
  add    %edi,%edx
  lea    D14(%rip),%rdi
  call   <libaft_3d_warn@plt>
  mov    0x18(%rsp),%r11d
  mov    0x14(%rsp),%r8d
  mov    $0xaaaaaaab,%r9d
  mov    0x8(%rsp),%r10
  jmp    L163
  nopl   0x0(%rax)
L200:
  mov    0x1c(%rsp),%eax
  lea    D23(%rip),%rdi
  mov    %r11d,0x18(%rsp)
  mov    %r8d,0x14(%rsp)
  add    %eax,%edx
  add    %eax,%esi
  xor    %eax,%eax
  mov    %r10,0x8(%rsp)
  call   <printf@plt>
  mov    0x18(%rsp),%r11d
  mov    0x14(%rsp),%r8d
  mov    $0xaaaaaaab,%r9d
  mov    0x8(%rsp),%r10
  jmp    L39
L43:
  mov    0x10(%rsp),%edx
  mov    %r8d,%esi
  lea    D26(%rip),%rdi
  call   <libaft_3d_warn@plt>
  mov    0x4(%rsp),%r8d
  jmp    L146
L154:
  lea    D5(%rip),%rdi
  mov    %ecx,0x4(%rsp)
  call   <puts@plt>
  test   %ebx,%ebx
  mov    0x4(%rsp),%r11d
  jg     L96
  mov    $0x4,%ebp
  xor    %r14d,%r14d
L139:
  mov    0x1c(%rsp),%eax
  lea    D21(%rip),%rdi
  mov    %r11d,0x4(%rsp)
  lea    (%rax,%r14,1),%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebp,%edi
  call   <libaft_malloc@plt>
  lea    (%rbx,%rbx,2),%edi
  shl    $0x3,%edi
  mov    %rax,%r13
  call   <libaft_malloc@plt>
  lea    0x4(,%r14,4),%rdx
  mov    $0xff,%esi
  mov    %r13,%rdi
  mov    %rax,%rbp
  mov    %rax,%r12
  call   <memset@plt>
  test   %ebx,%ebx
  mov    0x4(%rsp),%r11d
  jg     L225
L108:
  mov    %r13,%rdi
  call   <libaft_free@plt>
  mov    %r12,%rdi
  call   <libaft_free@plt>
  xor    %r8d,%r8d
  jmp    L146
L79:
  mov    $0x4,%edi
  call   <libaft_malloc@plt>
  lea    (%rbx,%rbx,2),%edi
  shl    $0x3,%edi
  mov    %rax,%r13
  call   <libaft_malloc@plt>
  movl   $0xffffffff,0x0(%r13)
  mov    %rax,%r12
  jmp    L108
```

tool_calls: name: parse_data
arguments: tag: D14
type_guessed: string
name: parse_data
arguments: tag: D23
type_guessed: string
name: parse_data
arguments: tag: D26
type_guessed: string
name: parse_data
arguments: tag: D5
type_guessed: string
name: parse_data
arguments: tag: D21
type_guessed: string

tool: D14: Check: no pair for edge [%d %d]


tool: D23: warning: more then one pair for edge [%d %d] (actually  %d pairs)


tool: D26: Check: %d errors, %d warnings


tool: D5: Checking tri data.

tool: D21: max vertex index used: %d


assistant: ```c
int check_tri(int nF, int *face, int indshift, int verbose) {
  int i, j, k, p, nV = 0;
  int *vertex, *edge;
  int errors = 0, warnings = 0;
  if (verbose)
    printf("Checking tri data.\n");
  for (i = 0; i < nF; i++) {
    for (j = 0; j < 3; j++) {
      if (face[3 * i + j] > nV)
        nV = face[3 * i + j];
    }
  }
  if (verbose)
    printf("max vertex index used: %d\n", nV + indshift);
  nV++;
  vertex = (int *)libaft_malloc(sizeof(int) * nV);
  edge = (int *)libaft_malloc(2 * sizeof(int) * 3 * nF);
  for (i = 0; i < nV; i++) {
    vertex[i] = -1;
  }
  for (i = 0; i < nF; i++) {
    for (j = 0; j < 3; j++) {
      edge[2 * (3 * i + j)] = face[3 * i + (j + 1) % 3];
      edge[2 * (3 * i + j) + 1] = vertex[face[3 * i + j]];
      vertex[face[3 * i + j]] = 3 * i + j;
    }
  }
  for (i = 0; i < nF; i++) {
    for (j = 0; j < 3; j++) {
      k = vertex[face[3 * i + j]];
      p = 0;
      while (k >= 0) {
        if (edge[2 * k] == face[3 * i + (j + 2) % 3])
          p++;
        k = edge[2 * k + 1];
      }
      if (p == 0) {
        if (verbose)
          libaft_3d_warn("Check: no pair for edge [%d %d]\n", face[3 * i + j] + indshift, face[3 * i + (j + 2) % 3] + indshift);
        errors++;
      } else if (p > 1) {
        if (verbose)
          printf("warning: more then one pair for edge [%d %d] (actually  %d pairs)\n", face[3 * i + j] + indshift, face[3 * i + (j + 2) % 3] + indshift, p);
        warnings++;
      }
    }
  }
  libaft_free(vertex);
  libaft_free(edge);
  if (errors > 0)
    libaft_3d_warn("Check: %d errors, %d warnings\n", errors, warnings);
  return errors;
}
```