user: Converte this assembly snippet into its equivalent C code:

```asm
<CalculateTangentSpace>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xf0,%rsp
  mov    %edi,-0xc4(%rbp)
  mov    %esi,-0xc8(%rbp)
  mov    %rdx,-0xd0(%rbp)
  mov    %rcx,-0xd8(%rbp)
  mov    %r8,-0xe0(%rbp)
  mov    %r9,-0xe8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0xa8(%rbp)
  cmpq   $0x0,-0xe0(%rbp)
  je     L76
  cmpq   $0x0,-0xe8(%rbp)
  je     L76
  cmpq   $0x0,-0xd8(%rbp)
  je     L76
  mov    -0xc8(%rbp),%eax
  cltq
  shl    $0x4,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0xa8(%rbp)
  mov    -0xc8(%rbp),%eax
  cltq
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0xa8(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0xc8(%rbp),%eax
  cltq
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0xa0(%rbp)
  mov    -0xc8(%rbp),%eax
  cltq
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x98(%rbp)
  mov    -0xc8(%rbp),%eax
  cltq
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    -0xa0(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0xc8(%rbp),%eax
  cltq
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    -0x98(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0x0,-0xc0(%rbp)
  jmp    L92
L82:
  mov    -0xc0(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xd0(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xb8(%rbp)
  mov    -0xc0(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0xd0(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xb4(%rbp)
  mov    -0xc0(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  add    $0x2,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0xd0(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xb0(%rbp)
  mov    -0xb8(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xe8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x80(%rbp)
  mov    -0xb4(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xe8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x78(%rbp)
  mov    -0xb0(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xe8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x70(%rbp)
  mov    -0xb8(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xd8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x68(%rbp)
  mov    -0xb4(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xd8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x60(%rbp)
  mov    -0xb0(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xd8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x58(%rbp)
  mov    -0x68(%rbp),%rdx
  mov    -0x60(%rbp),%rcx
  lea    -0x50(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sub3d@plt>
  mov    -0x68(%rbp),%rdx
  mov    -0x58(%rbp),%rcx
  lea    -0x44(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sub3d@plt>
  mov    -0x80(%rbp),%rdx
  mov    -0x78(%rbp),%rcx
  lea    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sub3d@plt>
  mov    -0x80(%rbp),%rdx
  mov    -0x70(%rbp),%rcx
  lea    -0x2c(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sub3d@plt>
  movss  -0x38(%rbp),%xmm1
  movss  -0x28(%rbp),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x2c(%rbp),%xmm2
  movss  -0x34(%rbp),%xmm1
  mulss  %xmm1,%xmm2
  movaps %xmm0,%xmm1
  subss  %xmm2,%xmm1
  movss  D3(%rip),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,-0xac(%rbp)
  movss  -0x28(%rbp),%xmm1
  movss  -0x50(%rbp),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x34(%rbp),%xmm2
  movss  -0x44(%rbp),%xmm1
  mulss  %xmm2,%xmm1
  subss  %xmm1,%xmm0
  mulss  -0xac(%rbp),%xmm0
  movss  %xmm0,-0x20(%rbp)
  movss  -0x28(%rbp),%xmm1
  movss  -0x4c(%rbp),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x34(%rbp),%xmm2
  movss  -0x40(%rbp),%xmm1
  mulss  %xmm2,%xmm1
  subss  %xmm1,%xmm0
  mulss  -0xac(%rbp),%xmm0
  movss  %xmm0,-0x1c(%rbp)
  movss  -0x28(%rbp),%xmm1
  movss  -0x48(%rbp),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x34(%rbp),%xmm2
  movss  -0x3c(%rbp),%xmm1
  mulss  %xmm2,%xmm1
  subss  %xmm1,%xmm0
  mulss  -0xac(%rbp),%xmm0
  movss  %xmm0,-0x18(%rbp)
  movss  -0x38(%rbp),%xmm1
  movss  -0x44(%rbp),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x2c(%rbp),%xmm2
  movss  -0x50(%rbp),%xmm1
  mulss  %xmm2,%xmm1
  subss  %xmm1,%xmm0
  mulss  -0xac(%rbp),%xmm0
  movss  %xmm0,-0x14(%rbp)
  movss  -0x38(%rbp),%xmm1
  movss  -0x40(%rbp),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x2c(%rbp),%xmm2
  movss  -0x4c(%rbp),%xmm1
  mulss  %xmm2,%xmm1
  subss  %xmm1,%xmm0
  mulss  -0xac(%rbp),%xmm0
  movss  %xmm0,-0x10(%rbp)
  movss  -0x38(%rbp),%xmm1
  movss  -0x3c(%rbp),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x2c(%rbp),%xmm2
  movss  -0x48(%rbp),%xmm1
  mulss  %xmm2,%xmm1
  subss  %xmm1,%xmm0
  mulss  -0xac(%rbp),%xmm0
  movss  %xmm0,-0xc(%rbp)
  mov    -0xb8(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa0(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0xb8(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa0(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdx
  mov    %rcx,%rdi
  call   <add3d@plt>
  mov    -0xb4(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa0(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0xb4(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa0(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdx
  mov    %rcx,%rdi
  call   <add3d@plt>
  mov    -0xb0(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa0(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0xb0(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa0(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdx
  mov    %rcx,%rdi
  call   <add3d@plt>
  mov    -0xb8(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x98(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0xb8(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x98(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdx
  mov    %rcx,%rdi
  call   <add3d@plt>
  mov    -0xb4(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x98(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0xb4(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x98(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdx
  mov    %rcx,%rdi
  call   <add3d@plt>
  mov    -0xb0(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x98(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0xb0(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x98(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdx
  mov    %rcx,%rdi
  call   <add3d@plt>
  addl   $0x1,-0xc0(%rbp)
L92:
  mov    -0xc0(%rbp),%eax
  cmp    -0xc4(%rbp),%eax
  jl     L82
  movl   $0x0,-0xc0(%rbp)
  jmp    L86
L24:
  mov    -0xc0(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xe0(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x90(%rbp)
  mov    -0xc0(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa0(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x88(%rbp)
  mov    -0x88(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <dot3d@plt>
  movd   %xmm0,%eax
  mov    %eax,-0xbc(%rbp)
  mov    -0xbc(%rbp),%ecx
  mov    -0x90(%rbp),%rdx
  lea    -0x14(%rbp),%rax
  movd   %ecx,%xmm0
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <scale3d@plt>
  lea    -0x14(%rbp),%rdx
  mov    -0x88(%rbp),%rcx
  lea    -0x20(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sub3d@plt>
  mov    -0xc0(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rax,%rdx
  lea    -0x20(%rbp),%rax
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <normalize3d@plt>
  mov    -0x88(%rbp),%rdx
  mov    -0x90(%rbp),%rcx
  lea    -0x20(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <cross3d@plt>
  mov    -0xc0(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x98(%rbp),%rax
  add    %rax,%rdx
  lea    -0x20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <dot3d@plt>
  pxor   %xmm1,%xmm1
  comiss %xmm0,%xmm1
  jbe    L97
  movss  D8(%rip),%xmm0
  jmp    L59
L97:
  movss  D3(%rip),%xmm0
L59:
  mov    -0xc0(%rbp),%eax
  shl    $0x2,%eax
  cltq
  add    $0x3,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  movss  %xmm0,(%rax)
  addl   $0x1,-0xc0(%rbp)
L86:
  mov    -0xc0(%rbp),%eax
  cmp    -0xc8(%rbp),%eax
  jl     L24
L76:
  mov    -0xa8(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L27
  call   <__stack_chk_fail@plt>
L27:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D3
datatype: f32
name: extract_symbolic_data
arguments: tag: D8
datatype: byte[4]

tool: D3: 1

tool: {"D8": [0x00,0x00,0x80,0xbf]}

assistant: ```c
float *CalculateTangentSpace(int Triangles, int VertexCount, int *Indices, float *verts, float *normals, float *texs) {
  int i;
  float *tans = 0;
  if (normals && texs && verts) {
    tans = malloc(VertexCount * sizeof(float) * 4);
    memset(tans, 0, VertexCount * sizeof(float) * 4);
    float *tan1 = malloc(VertexCount * sizeof(float) * 3);
    float *tan2 = malloc(VertexCount * sizeof(float) * 3);
    memset(tan1, 0, VertexCount * sizeof(float) * 3);
    memset(tan2, 0, VertexCount * sizeof(float) * 3);
    for (i = 0; i < Triangles; i++) {
      int v1 = Indices[i * 3 + 0];
      int v2 = Indices[i * 3 + 1];
      int v3 = Indices[i * 3 + 2];
      float *t1 = &texs[v1 * 3];
      float *t2 = &texs[v2 * 3];
      float *t3 = &texs[v3 * 3];
      float *p1 = &verts[v1 * 3];
      float *p2 = &verts[v2 * 3];
      float *p3 = &verts[v3 * 3];
      float vec1[3];
      float vec2[3];
      float tex1[3];
      float tex2[3];
      sub3d(vec1, p2, p1);
      sub3d(vec2, p3, p1);
      sub3d(tex1, t2, t1);
      sub3d(tex2, t3, t1);
      float r = 1.0f / (tex1[0] * tex2[1] - tex2[0] * tex1[1]);
      float sdir[3] = {(tex2[1] * vec1[0] - tex1[1] * vec2[0]) * r, (tex2[1] * vec1[1] - tex1[1] * vec2[1]) * r, (tex2[1] * vec1[2] - tex1[1] * vec2[2]) * r};
      float tdir[3] = {(tex1[0] * vec2[0] - tex2[0] * vec1[0]) * r, (tex1[0] * vec2[1] - tex2[0] * vec1[1]) * r, (tex1[0] * vec2[2] - tex2[0] * vec1[2]) * r};
      add3d(&tan1[v1 * 3], &tan1[v1 * 3], sdir);
      add3d(&tan1[v2 * 3], &tan1[v2 * 3], sdir);
      add3d(&tan1[v3 * 3], &tan1[v3 * 3], sdir);
      add3d(&tan2[v1 * 3], &tan2[v1 * 3], sdir);
      add3d(&tan2[v2 * 3], &tan2[v2 * 3], sdir);
      add3d(&tan2[v3 * 3], &tan2[v3 * 3], sdir);
    }
    for (i = 0; i < VertexCount; i++) {
      const float *n = &normals[i * 3];
      const float *t = &tan1[i * 3];
      float tmp[3];
      float tdn[3];
      float thisdot = dot3d(n, t);
      scale3d(tdn, n, thisdot);
      sub3d(tmp, t, tdn);
      normalize3d(&tans[i * 4], tmp);
      cross3d(tmp, n, t);
      tans[i * 4 + 3] = (dot3d(tmp, &tan2[i * 3]) < 0) ? -1 : 1;
    }
  }
  return tans;
}
```