user: Translate the below assembly code into C programming language:

```asm
<FixCollision>:
  endbr64
  push   %r15
  shl    $0x4,%ecx
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  lea    (%rcx,%rdx,1),%eax
  cmp    %eax,%edx
  jge    L5
  mov    %esi,%r14d
  movslq %edx,%rsi
  lea    -0x1(%rcx),%edx
  mov    %rdi,%rbx
  shr    $0x4,%edx
  lea    0x12(%rdi,%rsi,1),%rcx
  lea    0x2(%rdi,%rsi,1),%r15
  shl    $0x4,%rdx
  lea    (%rdx,%rcx,1),%rax
  mov    %rax,0x28(%rsp)
  lea    0x48(%rsp),%rax
  mov    %rax,0x20(%rsp)
  lea    0x38(%rsp),%rax
  mov    %rax,0x18(%rsp)
  lea    0x54(%rsp),%rax
  mov    %rax,(%rsp)
  nopl   0x0(%rax,%rax,1)
L9:
  movzbl (%r15),%edx
  movzbl 0x1(%r15),%ecx
  movzbl 0x5(%r15),%edi
  shl    $0x8,%edx
  or     %ecx,%edx
  lea    (%rdx,%rdx,2),%edx
  lea    (%r14,%rdx,2),%r8d
  movslq %r8d,%rcx
  movzbl (%rbx,%rcx,1),%edx
  movzbl 0x1(%rbx,%rcx,1),%r13d
  movzbl 0x3(%r15),%ecx
  shl    $0x8,%edx
  or     %edx,%r13d
  movzbl 0x2(%r15),%edx
  movswl %r13w,%r13d
  shl    $0x8,%edx
  or     %ecx,%edx
  lea    (%rdx,%rdx,2),%edx
  lea    (%r14,%rdx,2),%ecx
  movslq %ecx,%rdx
  movzbl (%rbx,%rdx,1),%esi
  movzbl 0x1(%rbx,%rdx,1),%edx
  shl    $0x8,%esi
  or     %esi,%edx
  movzbl 0x4(%r15),%esi
  movswl %dx,%edx
  shl    $0x8,%esi
  or     %edi,%esi
  lea    (%rsi,%rsi,2),%esi
  lea    (%r14,%rsi,2),%edi
  lea    0x2(%r8),%esi
  add    $0x4,%r8d
  movslq %esi,%rsi
  movslq %r8d,%r8
  movslq %edi,%r10
  movzbl (%rbx,%rsi,1),%r9d
  movzbl 0x1(%rbx,%rsi,1),%r12d
  movzbl 0x1(%rbx,%r8,1),%ebp
  shl    $0x8,%r9d
  or     %r9d,%r12d
  lea    0x2(%rcx),%r9d
  add    $0x4,%ecx
  movslq %r9d,%r9
  movslq %ecx,%rcx
  movswl %r12w,%eax
  mov    0x20(%rsp),%r12
  movzbl (%rbx,%r9,1),%r11d
  movzbl 0x1(%rbx,%r9,1),%esi
  lea    0x2(%rdi),%r9d
  add    $0x4,%edi
  movslq %r9d,%r9
  movslq %edi,%rdi
  mov    %eax,0xc(%rsp)
  shl    $0x8,%r11d
  or     %r11d,%esi
  movzbl (%rbx,%r8,1),%r11d
  movzbl (%rbx,%rcx,1),%r8d
  movzbl 0x1(%rbx,%rcx,1),%ecx
  movswl %si,%esi
  shl    $0x8,%r11d
  shl    $0x8,%r8d
  or     %r11d,%ebp
  movzbl (%rbx,%r10,1),%r11d
  movzbl 0x1(%rbx,%r10,1),%r10d
  or     %r8d,%ecx
  mov    %r13d,%r8d
  movswl %cx,%ecx
  shl    $0x8,%r11d
  sub    %edx,%r8d
  or     %r11d,%r10d
  movzbl (%rbx,%r9,1),%r11d
  movzbl 0x1(%rbx,%r9,1),%r9d
  movswl %r10w,%r10d
  shl    $0x8,%r11d
  sub    %r10d,%edx
  mov    %eax,%r10d
  movswl %bp,%eax
  or     %r11d,%r9d
  movzbl (%rbx,%rdi,1),%r11d
  movzbl 0x1(%rbx,%rdi,1),%edi
  sub    %esi,%r10d
  movswl %r9w,%r9d
  mov    %eax,0x10(%rsp)
  mov    0x18(%rsp),%rbp
  shl    $0x8,%r11d
  sub    %r9d,%esi
  mov    %eax,%r9d
  mov    %r10d,%eax
  or     %r11d,%edi
  sub    %ecx,%r9d
  movswl %di,%edi
  sub    %edi,%ecx
  mov    %edx,%edi
  imul   %ecx,%eax
  imul   %r9d,%edi
  imul   %r8d,%ecx
  imul   %esi,%r9d
  movd   %eax,%xmm2
  movd   %edi,%xmm6
  imul   %esi,%r8d
  movd   %ecx,%xmm7
  imul   %r10d,%edx
  punpckldq %xmm6,%xmm2
  movd   %r9d,%xmm0
  pxor   %xmm6,%xmm6
  punpckldq %xmm7,%xmm0
  psubd  %xmm0,%xmm2
  sub    %edx,%r8d
  mov    %r8d,0x40(%rsp)
  cvtdq2ps %xmm2,%xmm1
  movq   %xmm2,0x38(%rsp)
  pxor   %xmm2,%xmm2
  mulps  %xmm1,%xmm1
  cvtsi2ss %r8d,%xmm2
  mulss  %xmm2,%xmm2
  movaps %xmm1,%xmm0
  movlps %xmm1,0x48(%rsp)
  shufps $0xe5,%xmm1,%xmm1
  addss  %xmm0,%xmm1
  addss  %xmm2,%xmm1
  movss  %xmm2,0x50(%rsp)
  ucomiss %xmm6,%xmm1
  jp     L47
  je     L48
L47:
  movss  %xmm1,0x14(%rsp)
L35:
  divss  0x14(%rsp),%xmm0
  mulss  D20(%rip),%xmm0
  call   <sqrt@plt>
  mov    0x0(%rbp),%eax
  movss  %xmm0,(%r12)
  test   %eax,%eax
  jns    L23
  xorps  D53(%rip),%xmm0
  movss  %xmm0,(%r12)
L23:
  add    $0x4,%r12
  add    $0x4,%rbp
  cmp    (%rsp),%r12
  je     L30
  movss  (%r12),%xmm0
  jmp    L35
  nopw   0x0(%rax,%rax,1)
L48:
  mulss  D20(%rip),%xmm0
  call   <sqrt@plt>
  mov    0x0(%rbp),%edx
  movss  %xmm0,(%r12)
  test   %edx,%edx
  jns    L0
  xorps  D53(%rip),%xmm0
  movss  %xmm0,(%r12)
L0:
  add    $0x4,%r12
  add    $0x4,%rbp
  cmp    (%rsp),%r12
  je     L30
  movss  (%r12),%xmm0
  jmp    L48
  nopl   (%rax)
L30:
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  movss  0x48(%rsp),%xmm4
  movss  0x4c(%rsp),%xmm3
  cvtsi2ss %r13d,%xmm0
  movss  0x50(%rsp),%xmm2
  mov    $0x10000,%edx
  cvtsi2ssl 0xc(%rsp),%xmm1
  mulss  %xmm4,%xmm0
  mulss  %xmm3,%xmm1
  divss  D4(%rip),%xmm0
  divss  D4(%rip),%xmm1
  addss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl 0x10(%rsp),%xmm1
  mulss  %xmm2,%xmm1
  divss  D4(%rip),%xmm1
  addss  %xmm1,%xmm0
  cvttss2si %xmm0,%ecx
  mov    %ecx,%esi
  sub    %ecx,%edx
  neg    %esi
  test   %ecx,%ecx
  cmovle %esi,%edx
  add    $0x10,%r15
  movzbl %dh,%eax
  mov    %dl,-0x3(%r15)
  cvttss2si %xmm4,%edx
  mov    %al,-0x4(%r15)
  movzwl %dx,%edx
  movzbl %dh,%eax
  mov    %dl,-0x9(%r15)
  mov    %edx,0x38(%rsp)
  cvttss2si %xmm3,%edx
  mov    %al,-0xa(%r15)
  movzwl %dx,%edx
  movzbl %dh,%eax
  mov    %dl,-0x7(%r15)
  mov    %edx,0x3c(%rsp)
  cvttss2si %xmm2,%edx
  mov    %al,-0x8(%r15)
  movzwl %dx,%edx
  movzbl %dh,%eax
  mov    %dl,-0x5(%r15)
  mov    %al,-0x6(%r15)
  mov    %edx,0x40(%rsp)
  cmp    0x28(%rsp),%r15
  jne    L9
L5:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L37
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L37:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D20
datatype: byte[4]
name: parse_data
arguments: label: D53
datatype: byte[16]
name: parse_data
arguments: label: D4
datatype: byte[4]

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

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

tool: {"D4": [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;
    }
  }
}
```