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

```asm
<FixCollision>:
  endbr64
  push   %r15
  shl    $0x4,%ecx
  push   %r14
  add    %edx,%ecx
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %edx,0xc(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  mov    %ecx,0x2c(%rsp)
  cmp    %ecx,%edx
  jge    L100
  lea    0x5c(%rsp),%rax
  movslq %edx,%rcx
  mov    %rdi,%rbx
  mov    %esi,%ebp
  mov    %rax,0x30(%rsp)
  lea    0x68(%rsp),%rax
  lea    (%rdi,%rcx,1),%r13
  mov    %rax,0x38(%rsp)
  lea    0x74(%rsp),%rax
  mov    %rax,0x40(%rsp)
  lea    0x8c(%rsp),%rax
  mov    %rax,0x18(%rsp)
  lea    0x80(%rsp),%rax
  mov    %rax,0x48(%rsp)
  lea    0x98(%rsp),%rax
  mov    %rax,0x10(%rsp)
  xchg   %ax,%ax
L65:
  movzbl 0x2(%r13),%eax
  movzbl 0x3(%r13),%edx
  mov    0x30(%rsp),%rcx
  mov    0x38(%rsp),%r9
  shl    $0x8,%eax
  mov    0x40(%rsp),%r10
  or     %edx,%eax
  movzbl 0x5(%r13),%edx
  lea    (%rax,%rax,2),%eax
  lea    0x0(%rbp,%rax,2),%r8d
  movzbl 0x4(%r13),%eax
  movslq %r8d,%r8
  shl    $0x8,%eax
  add    %rbx,%r8
  or     %edx,%eax
  movzbl 0x7(%r13),%edx
  lea    (%rax,%rax,2),%eax
  lea    0x0(%rbp,%rax,2),%edi
  movzbl 0x6(%r13),%eax
  movslq %edi,%rdi
  shl    $0x8,%eax
  add    %rbx,%rdi
  or     %edx,%eax
  lea    (%rax,%rax,2),%eax
  lea    0x0(%rbp,%rax,2),%esi
  xor    %eax,%eax
  movslq %esi,%rsi
  add    %rbx,%rsi
L6:
  movzbl (%r8,%rax,1),%r11d
  movzbl 0x1(%r8,%rax,1),%edx
  shl    $0x8,%r11d
  or     %r11d,%edx
  movzbl (%rdi,%rax,1),%r11d
  movswl %dx,%edx
  mov    %edx,(%rcx,%rax,2)
  movzbl 0x1(%rdi,%rax,1),%edx
  shl    $0x8,%r11d
  or     %r11d,%edx
  movzbl (%rsi,%rax,1),%r11d
  movswl %dx,%edx
  mov    %edx,(%r9,%rax,2)
  movzbl 0x1(%rsi,%rax,1),%edx
  shl    $0x8,%r11d
  or     %r11d,%edx
  movswl %dx,%edx
  mov    %edx,(%r10,%rax,2)
  add    $0x2,%rax
  cmp    $0x6,%rax
  jne    L6
  mov    0x60(%rsp),%ecx
  mov    0x5c(%rsp),%eax
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  mov    0x68(%rsp),%esi
  mov    0x70(%rsp),%edi
  pxor   %xmm2,%xmm2
  pxor   %xmm4,%xmm4
  mov    0x6c(%rsp),%r10d
  mov    %ecx,%r9d
  mov    0x48(%rsp),%r14
  mov    %ecx,0x24(%rsp)
  mov    0x64(%rsp),%ecx
  mov    0x18(%rsp),%r15
  mov    %eax,0x20(%rsp)
  sub    %esi,%eax
  sub    %r10d,%r9d
  sub    0x78(%rsp),%r10d
  sub    0x74(%rsp),%esi
  mov    %r14,%r12
  mov    %ecx,%edx
  mov    %r9d,%r8d
  mov    %r10d,%r11d
  mov    %ecx,0x28(%rsp)
  sub    %edi,%edx
  sub    0x7c(%rsp),%edi
  imul   %edi,%r8d
  imul   %edx,%r11d
  imul   %eax,%edi
  imul   %esi,%edx
  sub    %r11d,%r8d
  imul   %r10d,%eax
  imul   %r9d,%esi
  mov    %r8d,0x80(%rsp)
  sub    %edi,%edx
  cvtsi2ss %r8d,%xmm0
  cvtsi2ss %edx,%xmm1
  mov    %edx,0x84(%rsp)
  sub    %esi,%eax
  cvtsi2ss %eax,%xmm2
  mov    %eax,0x88(%rsp)
  mulss  %xmm0,%xmm0
  mulss  %xmm1,%xmm1
  mulss  %xmm2,%xmm2
  movss  %xmm0,0x8c(%rsp)
  movss  %xmm1,0x90(%rsp)
  addss  %xmm0,%xmm1
  movss  %xmm2,0x94(%rsp)
  addss  %xmm2,%xmm1
  movss  %xmm1,0x8(%rsp)
  movss  0x8(%rsp),%xmm3
  ucomiss %xmm4,%xmm3
  jp     L21
L75:
  je     L79
L21:
  divss  0x8(%rsp),%xmm0
  movss  %xmm0,(%r15)
L79:
  mulss  D43(%rip),%xmm0
  call   <sqrt@plt>
  mov    (%r14),%eax
  movss  %xmm0,(%r15)
  test   %eax,%eax
  jns    L23
  xorps  D40(%rip),%xmm0
  movss  %xmm0,(%r15)
L23:
  add    $0x4,%r15
  add    $0x4,%r14
  cmp    %r15,0x10(%rsp)
  je     L2
  movss  0x8(%rsp),%xmm3
  pxor   %xmm4,%xmm4
  movss  (%r15),%xmm0
  ucomiss %xmm4,%xmm3
  jnp    L75
  jmp    L21
L2:
  pxor   %xmm2,%xmm2
  pxor   %xmm0,%xmm0
  mov    $0x10000,%eax
  mov    %rbx,%rsi
  movss  0x8c(%rsp),%xmm1
  cvtsi2ssl 0x20(%rsp),%xmm2
  cvtsi2ssl 0x24(%rsp),%xmm0
  mulss  0x90(%rsp),%xmm0
  divss  D15(%rip),%xmm0
  mulss  %xmm1,%xmm2
  divss  D15(%rip),%xmm2
  addss  %xmm2,%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2ssl 0x28(%rsp),%xmm2
  mulss  0x94(%rsp),%xmm2
  divss  D15(%rip),%xmm2
  addss  %xmm2,%xmm0
  cvttss2si %xmm0,%edx
  mov    %edx,%edi
  sub    %edx,%eax
  neg    %edi
  test   %edx,%edx
  cmovle %edi,%eax
  xor    %edx,%edx
  movzbl %ah,%ecx
  mov    %al,0xf(%r13)
  cvttss2si %xmm1,%eax
  mov    %cl,0xe(%r13)
  mov    0x18(%rsp),%rcx
  test   %eax,%eax
  jns    L114
L128:
  add    $0x10000,%eax
L114:
  mov    %eax,(%r12)
  movzwl %ax,%eax
  add    $0x4,%r12
  movzbl %ah,%ebx
  mov    %al,0x9(%r13,%rdx,1)
  mov    %bl,0x8(%r13,%rdx,1)
  add    $0x2,%rdx
  mov    %eax,-0x4(%r12)
  cmp    $0x6,%rdx
  je     L136
  movss  (%rcx,%rdx,2),%xmm1
  cvttss2si %xmm1,%eax
  test   %eax,%eax
  jns    L114
  jmp    L128
  nopl   0x0(%rax)
L136:
  addl   $0x10,0xc(%rsp)
  mov    %rsi,%rbx
  mov    0xc(%rsp),%eax
  add    $0x10,%r13
  cmp    %eax,0x2c(%rsp)
  jg     L65
L100:
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L18
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L18:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D43
type_guessed: byte[4]
name: extract_symbolic_data
arguments: data_label: D40
type_guessed: byte[16]
name: extract_symbolic_data
arguments: data_label: D15
type_guessed: byte[4]

tool: {"D43": [0x00,0xfc,0x7f,0x4e]}

tool: {"D40": [0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: {"D15": [0x00,0xfe,0xff,0x46]}

assistant: ```c
void FixCollision(unsigned char *data, int vertOff, int TriOff, int TriCount) {
  int i, pos, end = TriOff + (TriCount << 4);
  int v1, v2, v3, p1[3], p2[3], p3[3], dx[2], dy[2], dz[2], dn, ni[3];
  float nf[3], nd;
  for (pos = TriOff; pos < end; pos += 0x10) {
    v1 = (((data)[pos + 2] << 8) | ((data)[pos + 2 + 1]));
    v2 = (((data)[pos + 4] << 8) | ((data)[pos + 4 + 1]));
    v3 = (((data)[pos + 6] << 8) | ((data)[pos + 6 + 1]));
    for (i = 0; i < 3; i++) {
      p1[i] = (signed short)(((data)[vertOff + (v1 * 0x6) + (i << 1)] << 8) | ((data)[vertOff + (v1 * 0x6) + (i << 1) + 1]));
      p2[i] = (signed short)(((data)[vertOff + (v2 * 0x6) + (i << 1)] << 8) | ((data)[vertOff + (v2 * 0x6) + (i << 1) + 1]));
      p3[i] = (signed short)(((data)[vertOff + (v3 * 0x6) + (i << 1)] << 8) | ((data)[vertOff + (v3 * 0x6) + (i << 1) + 1]));
    }
    dx[0] = p1[0] - p2[0];
    dx[1] = p2[0] - p3[0];
    dy[0] = p1[1] - p2[1];
    dy[1] = p2[1] - p3[1];
    dz[0] = p1[2] - p2[2];
    dz[1] = p2[2] - p3[2];
    ni[0] = (dy[0] * dz[1]) - (dz[0] * dy[1]);
    ni[1] = (dz[0] * dx[1]) - (dx[0] * dz[1]);
    ni[2] = (dx[0] * dy[1]) - (dy[0] * dx[1]);
    for (i = 0; i < 3; i++)
      nf[i] = (float)ni[i] * ni[i];
    nd = nf[0] + nf[1] + nf[2];
    for (i = 0; i < 3; i++) {
      if (nd)
        nf[i] /= nd;
      nf[i] *= 0x3FFF0001;
      nf[i] = sqrt(nf[i]);
      if (ni[i] < 0)
        nf[i] *= -1;
    }
    dn = (int)((nf[0] * p1[0] / 0x7FFF) + (nf[1] * p1[1] / 0x7FFF) + (nf[2] * p1[2] / 0x7FFF)) * -1;
    if (dn < 0)
      dn += 0x10000;
    data[pos + 0xE] = (dn >> 8) & 0xFF;
    data[pos + 0xF] = dn & 0xFF;
    dn &= 0xFFFF;
    for (i = 0; i < 3; i++) {
      ni[i] = (int)nf[i];
      if (ni[i] < 0)
        ni[i] += 0x10000;
      ni[i] &= 0xFFFF;
      data[pos + 8 + (i << 1)] = (ni[i] >> 8) & 0xFF;
      data[pos + 9 + (i << 1)] = ni[i] & 0xFF;
    }
  }
}
```