void vprodukt(double *v, double a0, double a1, double a2, double b0, double b1,
              double b2) {
  v[0] = a1 * b2 - a2 * b1;
  v[1] = a2 * b0 - a0 * b2;
  v[2] = a0 * b1 - a1 * b0;
}


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

x86 assembly (clang, -O2):
<vprodukt>:
movapd %xmm1,%xmm6
unpcklpd %xmm2,%xmm6
unpcklpd %xmm0,%xmm2
mulsd  %xmm4,%xmm0
unpcklpd %xmm5,%xmm4
mulpd  %xmm2,%xmm4
unpcklpd %xmm3,%xmm5
mulpd  %xmm6,%xmm5
subpd  %xmm4,%xmm5
movupd %xmm5,(%rdi)
mulsd  %xmm3,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rdi)
ret

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

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