void crossproduct(double x1, double y1, double z1, double x2, double y2,
                  double z2, double *xa, double *ya, double *za) {
  *xa = y1 * z2 - y2 * z1;
  *ya = z1 * x2 - z2 * x1;
  *za = x1 * y2 - y1 * x2;
}


x86 assembly (clang, -O0):
<crossproduct>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
mov    %rdi,-0x38(%rbp)
mov    %rsi,-0x40(%rbp)
mov    %rdx,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<crossproduct>:
movapd %xmm1,%xmm6
mulsd  %xmm5,%xmm6
mulsd  %xmm0,%xmm5
mulsd  %xmm4,%xmm0
mulsd  %xmm2,%xmm4
subsd  %xmm4,%xmm6
movsd  %xmm6,(%rdi)
mulsd  %xmm3,%xmm2
subsd  %xmm5,%xmm2
movsd  %xmm2,(%rsi)
mulsd  %xmm3,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rdx)
ret

LLVM IR (-O0):
define void @crossproduct(double %0, double %1, double %2, double %3, double %4, double %5, double* %6, double* %7, double* %8) {
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
store double %0, double* %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store double %5, double* %15
store double* %6, double** %16
store double* %7, double** %17
store double* %8, double** %18
%19 = load double, double* %11
%20 = load double, double* %15
%21 = load double, double* %14
%22 = load double, double* %12
%23 = fmul double %21, %22
%24 = fneg double %23
%25 = call double @llvm.fmuladd.f64(double %19, double %20, double %24)
%26 = load double*, double** %16
store double %25, double* %26
%27 = load double, double* %12
%28 = load double, double* %13
%29 = load double, double* %15
%30 = load double, double* %10
%31 = fmul double %29, %30
%32 = fneg double %31
%33 = call double @llvm.fmuladd.f64(double %27, double %28, double %32)
%34 = load double*, double** %17
store double %33, double* %34
%35 = load double, double* %10
%36 = load double, double* %14
%37 = load double, double* %11
%38 = load double, double* %13
%39 = fmul double %37, %38
%40 = fneg double %39
%41 = call double @llvm.fmuladd.f64(double %35, double %36, double %40)
%42 = load double*, double** %18
store double %41, double* %42
ret void
}

LLVM IR (-O2):
define void @crossproduct(double %0, double %1, double %2, double %3, double %4, double %5, double* nocapture writeonly %6, double* nocapture writeonly %7, double* nocapture writeonly %8) {
%10 = fneg double %4
%11 = fmul double %10, %2
%12 = tail call double @llvm.fmuladd.f64(double %1, double %5, double %11)
store double %12, double* %6
%13 = fneg double %5
%14 = fmul double %13, %0
%15 = tail call double @llvm.fmuladd.f64(double %2, double %3, double %14)
store double %15, double* %7
%16 = fneg double %1
%17 = fmul double %16, %3
%18 = tail call double @llvm.fmuladd.f64(double %0, double %4, double %17)
store double %18, double* %8
ret void
}