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

```asm
<get_cross_vec>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x30(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm1
  mov    -0x38(%rbp),%rax
  add    $0x8,%rax
  movss  (%rax),%xmm0
  mulss  %xmm1,%xmm0
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  movss  (%rax),%xmm2
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm1
  mulss  %xmm2,%xmm1
  subss  %xmm1,%xmm0
  mov    -0x28(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0x30(%rbp),%rax
  movss  (%rax),%xmm0
  movss  D47(%rip),%xmm1
  xorps  %xmm0,%xmm1
  mov    -0x38(%rbp),%rax
  add    $0x8,%rax
  movss  (%rax),%xmm0
  mulss  %xmm0,%xmm1
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  movss  (%rax),%xmm2
  mov    -0x38(%rbp),%rax
  movss  (%rax),%xmm0
  mulss  %xmm2,%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x4,%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x30(%rbp),%rax
  movss  (%rax),%xmm1
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm0
  mulss  %xmm1,%xmm0
  mov    -0x30(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm2
  mov    -0x38(%rbp),%rax
  movss  (%rax),%xmm1
  mulss  %xmm2,%xmm1
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  subss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x28(%rbp),%rax
  movss  (%rax),%xmm1
  mov    -0x28(%rbp),%rax
  movss  (%rax),%xmm0
  mulss  %xmm0,%xmm1
  mov    -0x28(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm2
  mov    -0x28(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm0,%xmm1
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movss  (%rax),%xmm2
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movss  (%rax),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm0,%xmm1
  movd   %xmm1,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  pxor   %xmm0,%xmm0
  movq   %rax,%xmm3
  ucomisd %xmm0,%xmm3
  jp     L77
  pxor   %xmm0,%xmm0
  movq   %rax,%xmm4
  ucomisd %xmm0,%xmm4
  je     L10
L77:
  mov    $0x1,%eax
  jmp    L6
L10:
  mov    -0x30(%rbp),%rax
  movss  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  ucomiss %xmm1,%xmm0
  jp     L27
  pxor   %xmm1,%xmm1
  ucomiss %xmm1,%xmm0
  je     L73
L27:
  mov    -0x30(%rbp),%rax
  movss  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movsd  D37(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x14(%rbp)
  mov    -0x30(%rbp),%rax
  movss  (%rax),%xmm1
  mov    -0x30(%rbp),%rax
  movss  (%rax),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x14(%rbp),%xmm2
  movss  -0x14(%rbp),%xmm1
  mulss  %xmm2,%xmm1
  subss  %xmm1,%xmm0
  movd   %xmm0,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x10(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0xc(%rbp)
  jmp    L82
L73:
  mov    -0x30(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  ucomiss %xmm1,%xmm0
  jp     L32
  pxor   %xmm1,%xmm1
  ucomiss %xmm1,%xmm0
  je     L15
L32:
  mov    -0x30(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movsd  D37(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm1
  mov    -0x30(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x10(%rbp),%xmm2
  movss  -0x10(%rbp),%xmm1
  mulss  %xmm2,%xmm1
  subss  %xmm1,%xmm0
  movd   %xmm0,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x14(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0xc(%rbp)
  jmp    L82
L15:
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  movss  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movsd  D37(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0xc(%rbp)
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  movss  (%rax),%xmm1
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  movss  (%rax),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0xc(%rbp),%xmm2
  movss  -0xc(%rbp),%xmm1
  mulss  %xmm2,%xmm1
  subss  %xmm1,%xmm0
  movd   %xmm0,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x10(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x14(%rbp)
L82:
  movss  -0x10(%rbp),%xmm1
  mov    -0x38(%rbp),%rax
  add    $0x8,%rax
  movss  (%rax),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0xc(%rbp),%xmm2
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm1
  mulss  %xmm2,%xmm1
  subss  %xmm1,%xmm0
  mov    -0x28(%rbp),%rax
  movss  %xmm0,(%rax)
  movss  -0x14(%rbp),%xmm0
  movss  D47(%rip),%xmm1
  xorps  %xmm0,%xmm1
  mov    -0x38(%rbp),%rax
  add    $0x8,%rax
  movss  (%rax),%xmm0
  mulss  %xmm0,%xmm1
  movss  -0xc(%rbp),%xmm2
  mov    -0x38(%rbp),%rax
  movss  (%rax),%xmm0
  mulss  %xmm2,%xmm0
  mov    -0x28(%rbp),%rax
  add    $0x4,%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  movss  -0x14(%rbp),%xmm1
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movss  (%rax),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x10(%rbp),%xmm2
  mov    -0x38(%rbp),%rax
  movss  (%rax),%xmm1
  mulss  %xmm2,%xmm1
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  subss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  mov    $0x0,%eax
L6:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L36
  call   <__stack_chk_fail@plt>
L36:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D47
data_type: byte[4]
name: disassemble_data
arguments: data_label: D37
data_type: f64

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

tool: D37: 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;
}
```