void tt_complex_mul(double *out, const double *in1, const double *in2) {
  double ac = in1[0] * in2[0];
  double bd = in1[1] * in2[1];
  out[1] = in1[0] * in2[1] + in2[0] * in1[1];
  out[0] = ac - bd;
}


x86 assembly (clang, -O0):
<tt_complex_mul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x20(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tt_complex_mul>:
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
movsd  (%rdx),%xmm2
movsd  0x8(%rdx),%xmm3
movapd %xmm0,%xmm4
mulsd  %xmm2,%xmm4
mulsd  %xmm1,%xmm2
mulsd  %xmm3,%xmm1
subsd  %xmm1,%xmm4
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  %xmm4,(%rdi)
ret

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

LLVM IR (-O2):
define void @tt_complex_mul(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = load double, double* %9
%11 = fmul double %8, %10
%12 = fmul double %5, %8
%13 = tail call double @llvm.fmuladd.f64(double %4, double %10, double %12)
%14 = getelementptr inbounds double, double* %0, i64 1
store double %13, double* %14
%15 = fsub double %6, %11
store double %15, double* %0
ret void
}