user: Please show me the C implementation that matches the assembly code listed below:

```asm
<get_cross_vec>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x10,%rsp
  movss  0x4(%rsi),%xmm0
  movss  0x8(%rsi),%xmm1
  mulss  0x8(%rdx),%xmm0
  mulss  0x4(%rdx),%xmm1
  subss  %xmm1,%xmm0
  movss  %xmm0,(%rdi)
  movss  (%rsi),%xmm1
  movss  0x8(%rsi),%xmm2
  mulss  %xmm0,%xmm0
  mulss  0x8(%rdx),%xmm1
  mulss  (%rdx),%xmm2
  subss  %xmm1,%xmm2
  movss  %xmm2,0x4(%rdi)
  movss  (%rsi),%xmm1
  movss  0x4(%rsi),%xmm3
  mulss  %xmm2,%xmm2
  mulss  0x4(%rdx),%xmm1
  mulss  (%rdx),%xmm3
  addss  %xmm2,%xmm0
  subss  %xmm3,%xmm1
  movss  %xmm1,0x8(%rdi)
  mulss  %xmm1,%xmm1
  addss  %xmm1,%xmm0
  call   <sqrt@plt>
  ucomisd D64(%rip),%xmm0
  jp     L23
  jne    L23
  movss  0x0(%rbp),%xmm0
  pxor   %xmm6,%xmm6
  ucomiss %xmm6,%xmm0
  jp     L20
  jne    L20
  movss  0x4(%rbp),%xmm0
  pxor   %xmm7,%xmm7
  ucomiss %xmm7,%xmm0
  jp     L30
  je     L37
L30:
  pxor   %xmm2,%xmm2
  cvtss2sd %xmm0,%xmm2
  mulsd  D23(%rip),%xmm2
  mulss  %xmm0,%xmm0
  cvtsd2ss %xmm2,%xmm2
  movaps %xmm2,%xmm1
  movss  %xmm2,0xc(%rsp)
  mulss  %xmm2,%xmm1
  subss  %xmm1,%xmm0
  call   <sqrt@plt>
  pxor   %xmm1,%xmm1
  movss  0xc(%rsp),%xmm2
  pxor   %xmm3,%xmm3
  cvtsd2ss %xmm0,%xmm1
  movaps %xmm1,%xmm0
  xorps  D25(%rip),%xmm0
L11:
  movss  0x8(%rbx),%xmm4
  movss  0x4(%rbx),%xmm5
  xor    %eax,%eax
  mulss  %xmm2,%xmm4
  mulss  %xmm3,%xmm5
  subss  %xmm5,%xmm4
  movss  %xmm4,(%r12)
  mulss  0x8(%rbx),%xmm0
  mulss  (%rbx),%xmm3
  addss  %xmm3,%xmm0
  movss  %xmm0,0x4(%r12)
  mulss  0x4(%rbx),%xmm1
  mulss  (%rbx),%xmm2
  subss  %xmm2,%xmm1
  movss  %xmm1,0x8(%r12)
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L20:
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  mulsd  D23(%rip),%xmm1
  mulss  %xmm0,%xmm0
  cvtsd2ss %xmm1,%xmm1
  movaps %xmm1,%xmm2
  movss  %xmm1,0xc(%rsp)
  mulss  %xmm1,%xmm2
  subss  %xmm2,%xmm0
  call   <sqrt@plt>
  movss  0xc(%rsp),%xmm1
  pxor   %xmm2,%xmm2
  pxor   %xmm3,%xmm3
  cvtsd2ss %xmm0,%xmm2
  movaps %xmm1,%xmm0
  xorps  D25(%rip),%xmm0
  jmp    L11
  nop
L23:
  add    $0x10,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  xchg   %ax,%ax
L37:
  movss  0x8(%rbp),%xmm0
  pxor   %xmm3,%xmm3
  cvtss2sd %xmm0,%xmm3
  mulsd  D23(%rip),%xmm3
  mulss  %xmm0,%xmm0
  cvtsd2ss %xmm3,%xmm3
  movaps %xmm3,%xmm1
  movss  %xmm3,0xc(%rsp)
  mulss  %xmm3,%xmm1
  subss  %xmm1,%xmm0
  call   <sqrt@plt>
  pxor   %xmm2,%xmm2
  movss  0xc(%rsp),%xmm3
  pxor   %xmm1,%xmm1
  cvtsd2ss %xmm0,%xmm2
  movss  D25(%rip),%xmm0
  jmp    L11
```

tool_calls: name: extract_symbolic_data
arguments: tag: D64
type: f64
name: extract_symbolic_data
arguments: tag: D23
type: f64
name: extract_symbolic_data
arguments: tag: D25
type: byte[16]

tool: D64: 0

tool: D23: 0.99999

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

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;
}
```