void cross3(double *restrict a, double *restrict b, double *restrict c) {
  double *a0 = a++;
  double *a1 = a++;
  double *a2 = a;
  double *b0 = b++;
  double *b1 = b++;
  double *b2 = b;
  *c++ = *a1 * *b2 - *a2 * *b1;
  *c++ = *a2 * *b0 - *a0 * *b2;
  *c = *a0 * *b1 - *a1 * *b0;
}


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

x86 assembly (clang, -O2):
<cross3>:
movupd 0x8(%rdi),%xmm0
movupd 0x8(%rsi),%xmm1
movsd  (%rsi),%xmm2
movsd  (%rdi),%xmm3
movapd %xmm0,%xmm4
shufpd $0x1,%xmm3,%xmm4
mulpd  %xmm1,%xmm4
mulsd  %xmm1,%xmm3
shufpd $0x1,%xmm2,%xmm1
mulpd  %xmm0,%xmm1
subpd  %xmm4,%xmm1
movupd %xmm1,(%rdx)
mulsd  %xmm0,%xmm2
subsd  %xmm2,%xmm3
movsd  %xmm3,0x10(%rdx)
ret

LLVM IR (-O0):
define void @cross3(double* noalias %0, double* noalias %1, double* noalias %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i32 1
store double* %14, double** %4
store double* %13, double** %7
%15 = load double*, double** %4
%16 = getelementptr inbounds double, double* %15, i32 1
store double* %16, double** %4
store double* %15, double** %8
%17 = load double*, double** %4
store double* %17, double** %9
%18 = load double*, double** %5
%19 = getelementptr inbounds double, double* %18, i32 1
store double* %19, double** %5
store double* %18, double** %10
%20 = load double*, double** %5
%21 = getelementptr inbounds double, double* %20, i32 1
store double* %21, double** %5
store double* %20, double** %11
%22 = load double*, double** %5
store double* %22, double** %12
%23 = load double*, double** %8
%24 = load double, double* %23
%25 = load double*, double** %12
%26 = load double, double* %25
%27 = load double*, double** %9
%28 = load double, double* %27
%29 = load double*, double** %11
%30 = load double, double* %29
%31 = fmul double %28, %30
%32 = fneg double %31
%33 = call double @llvm.fmuladd.f64(double %24, double %26, double %32)
%34 = load double*, double** %6
%35 = getelementptr inbounds double, double* %34, i32 1
store double* %35, double** %6
store double %33, double* %34
%36 = load double*, double** %9
%37 = load double, double* %36
%38 = load double*, double** %10
%39 = load double, double* %38
%40 = load double*, double** %7
%41 = load double, double* %40
%42 = load double*, double** %12
%43 = load double, double* %42
%44 = fmul double %41, %43
%45 = fneg double %44
%46 = call double @llvm.fmuladd.f64(double %37, double %39, double %45)
%47 = load double*, double** %6
%48 = getelementptr inbounds double, double* %47, i32 1
store double* %48, double** %6
store double %46, double* %47
%49 = load double*, double** %7
%50 = load double, double* %49
%51 = load double*, double** %11
%52 = load double, double* %51
%53 = load double*, double** %8
%54 = load double, double* %53
%55 = load double*, double** %10
%56 = load double, double* %55
%57 = fmul double %54, %56
%58 = fneg double %57
%59 = call double @llvm.fmuladd.f64(double %50, double %52, double %58)
%60 = load double*, double** %6
store double %59, double* %60
ret void
}

LLVM IR (-O2):
define void @cross3(double* noalias nocapture %0, double* noalias nocapture %1, double* noalias nocapture writeonly %2) {
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = bitcast double* %4 to <2 x double>*
%7 = load <2 x double>, <2 x double>* %6
%8 = bitcast double* %5 to <2 x double>*
%9 = load <2 x double>, <2 x double>* %8
%10 = load double, double* %1
%11 = load double, double* %0
%12 = insertelement <2 x double> %7, double %11, i64 0
%13 = fneg <2 x double> %12
%14 = shufflevector <2 x double> %13, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%15 = fmul <2 x double> %9, %14
%16 = extractelement <2 x double> %9, i64 1
%17 = insertelement <2 x double> poison, double %16, i64 0
%18 = insertelement <2 x double> %17, double %10, i64 1
%19 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %7, <2 x double> %18, <2 x double> %15)
%20 = getelementptr inbounds double, double* %2, i64 2
%21 = bitcast double* %2 to <2 x double>*
store <2 x double> %19, <2 x double>* %21
%22 = extractelement <2 x double> %7, i64 0
%23 = fneg double %22
%24 = fmul double %10, %23
%25 = extractelement <2 x double> %9, i64 0
%26 = tail call double @llvm.fmuladd.f64(double %11, double %25, double %24)
store double %26, double* %20
ret void
}