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

```asm
<get_cross_vec>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbp
  mov    %rdx,%rbx
  movss  0x4(%rsi),%xmm0
  mulss  0x8(%rdx),%xmm0
  movss  0x8(%rsi),%xmm1
  mulss  0x4(%rdx),%xmm1
  subss  %xmm1,%xmm0
  movss  %xmm0,(%rdi)
  movss  (%rsi),%xmm1
  mulss  0x8(%rdx),%xmm1
  movss  0x8(%rsi),%xmm2
  mulss  (%rdx),%xmm2
  subss  %xmm1,%xmm2
  movss  %xmm2,0x4(%rdi)
  movss  (%rsi),%xmm1
  mulss  0x4(%rdx),%xmm1
  movss  0x4(%rsi),%xmm3
  mulss  (%rdx),%xmm3
  subss  %xmm3,%xmm1
  movss  %xmm1,0x8(%rdi)
  mulss  %xmm0,%xmm0
  mulss  %xmm2,%xmm2
  addss  %xmm2,%xmm0
  mulss  %xmm1,%xmm1
  addss  %xmm1,%xmm0
  call   <sqrt@plt>
  ucomisd D68(%rip),%xmm0
  jp     L48
  jne    L48
  movss  0x0(%rbp),%xmm0
  ucomiss D68(%rip),%xmm0
  jp     L50
  jne    L50
  movss  0x4(%rbp),%xmm0
  ucomiss D68(%rip),%xmm0
  jp     L31
  jne    L31
  movss  0x8(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  mulsd  D13(%rip),%xmm1
  pxor   %xmm7,%xmm7
  cvtsd2ss %xmm1,%xmm7
  movd   %xmm7,%r13d
  mulss  %xmm0,%xmm0
  movaps %xmm7,%xmm1
  mulss  %xmm7,%xmm1
  subss  %xmm1,%xmm0
  call   <sqrt@plt>
  pxor   %xmm7,%xmm7
  cvtsd2ss %xmm0,%xmm7
  movss  %xmm7,0xc(%rsp)
  mov    D68(%rip),%ebp
  jmp    L61
L50:
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  mulsd  D13(%rip),%xmm1
  pxor   %xmm6,%xmm6
  cvtsd2ss %xmm1,%xmm6
  movd   %xmm6,%ebp
  mulss  %xmm0,%xmm0
  movaps %xmm6,%xmm1
  mulss  %xmm6,%xmm1
  subss  %xmm1,%xmm0
  call   <sqrt@plt>
  pxor   %xmm5,%xmm5
  cvtsd2ss %xmm0,%xmm5
  movss  %xmm5,0xc(%rsp)
  mov    D68(%rip),%r13d
  jmp    L61
L31:
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  mulsd  D13(%rip),%xmm1
  cvtsd2ss %xmm1,%xmm1
  movss  %xmm1,0xc(%rsp)
  mulss  %xmm0,%xmm0
  mulss  %xmm1,%xmm1
  subss  %xmm1,%xmm0
  call   <sqrt@plt>
  pxor   %xmm6,%xmm6
  cvtsd2ss %xmm0,%xmm6
  movd   %xmm6,%ebp
  mov    D68(%rip),%r13d
L61:
  movss  0xc(%rsp),%xmm4
  movaps %xmm4,%xmm0
  mulss  0x8(%rbx),%xmm0
  movd   %r13d,%xmm1
  mulss  0x4(%rbx),%xmm1
  subss  %xmm1,%xmm0
  movss  %xmm0,(%r12)
  movd   %ebp,%xmm1
  mulss  0x8(%rbx),%xmm1
  movd   %r13d,%xmm0
  mulss  (%rbx),%xmm0
  subss  %xmm1,%xmm0
  movss  %xmm0,0x4(%r12)
  movd   %ebp,%xmm0
  mulss  0x4(%rbx),%xmm0
  mulss  (%rbx),%xmm4
  subss  %xmm4,%xmm0
  movss  %xmm0,0x8(%r12)
  mov    $0x0,%eax
L14:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L48:
  mov    $0x1,%eax
  jmp    L14
```

tool_calls: name: unpack_data
arguments: data_tag: D68
type: f64
name: unpack_data
arguments: data_tag: D13
type: f64

tool: D68: 0

tool: D13: 0.99999

assistant: ```c
int get_cross_vec(float *res, float *dir, float *up) {
  float fudge[3];
  {
    res[0] = dir[1] * up[2] - dir[2] * up[1];
    res[1] = -dir[0] * up[2] + dir[2] * up[0];
    res[2] = dir[0] * up[1] - dir[1] * up[0];
  };
  if (sqrt(res[0] * res[0] + res[1] * res[1] + res[2] * res[2]) != 0.0)
    return 1;
  if (dir[0] != 0.0) {
    fudge[0] = dir[0] * 0.99999;
    fudge[1] = sqrt((dir[0] * dir[0]) - (fudge[0] * fudge[0]));
    fudge[2] = 0.0;
  } else if (dir[1] != 0.0) {
    fudge[1] = dir[1] * 0.99999;
    fudge[0] = sqrt((dir[1] * dir[1]) - (fudge[1] * fudge[1]));
    fudge[2] = 0.0;
  } else {
    fudge[2] = dir[2] * 0.99999;
    fudge[1] = sqrt((dir[2] * dir[2]) - (fudge[2] * fudge[2]));
    fudge[0] = 0.0;
  }
  {
    res[0] = fudge[1] * up[2] - fudge[2] * up[1];
    res[1] = -fudge[0] * up[2] + fudge[2] * up[0];
    res[2] = fudge[0] * up[1] - fudge[1] * up[0];
  };
  return 0;
}
```