double _Complex my_fxsmul(double _Complex x, double a) {
  double y[2];
  y[0] = a * my_creal(x);
  y[1] = a * my_cimag(x);
  return ((double _Complex *)y)[0];
}


x86 assembly (clang, -O0):
<my_fxsmul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  %xmm1,-0x50(%rbp)
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
mov    $0x2,%al
mov    %al,-0x69(%rbp)
call   1040 <my_creal@plt>
movsd  -0x78(%rbp),%xmm0
mov    %eax,%ecx
mov    -0x69(%rbp),%al
cvtsi2sd %ecx,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  %xmm1,-0x60(%rbp)
movsd  %xmm0,-0x58(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
call   1030 <my_cimag@plt>
movsd  -0x68(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fxsmul>:
sub    $0x28,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    $0x2,%al
call   1040 <my_creal@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mov    $0x2,%al
call   1030 <my_cimag@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0x8(%rsp),%xmm1
movsd  0x20(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define { double, double } @my_fxsmul(double %0, double %1, double %2) {
%4 = alloca { double, double }
%5 = alloca { double, double }
%6 = alloca double
%7 = alloca [2 x double]
%8 = alloca { double, double }
%9 = alloca { double, double }
%10 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
store double %0, double* %10
%11 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %1, double* %11
store double %2, double* %6
%12 = load double, double* %6
%13 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%14 = load double, double* %13
%15 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%16 = load double, double* %15
%17 = getelementptr inbounds { double, double }, { double, double }* %8, i32 0, i32 0
%18 = getelementptr inbounds { double, double }, { double, double }* %8, i32 0, i32 1
store double %14, double* %17
store double %16, double* %18
%19 = getelementptr inbounds { double, double }, { double, double }* %8, i32 0, i32 0
%20 = load double, double* %19
%21 = getelementptr inbounds { double, double }, { double, double }* %8, i32 0, i32 1
%22 = load double, double* %21
%23 = call i32 (double, double, ...) bitcast (i32 (...)* @my_creal to i32 (double, double, ...)*)(double %20, double %22)
%24 = sitofp i32 %23 to double
%25 = fmul double %12, %24
%26 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 0
store double %25, double* %26
%27 = load double, double* %6
%28 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%29 = load double, double* %28
%30 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%31 = load double, double* %30
%32 = getelementptr inbounds { double, double }, { double, double }* %9, i32 0, i32 0
%33 = getelementptr inbounds { double, double }, { double, double }* %9, i32 0, i32 1
store double %29, double* %32
store double %31, double* %33
%34 = getelementptr inbounds { double, double }, { double, double }* %9, i32 0, i32 0
%35 = load double, double* %34
%36 = getelementptr inbounds { double, double }, { double, double }* %9, i32 0, i32 1
%37 = load double, double* %36
%38 = call i32 (double, double, ...) bitcast (i32 (...)* @my_cimag to i32 (double, double, ...)*)(double %35, double %37)
%39 = sitofp i32 %38 to double
%40 = fmul double %27, %39
%41 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 1
store double %40, double* %41
%42 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 0
%43 = bitcast double* %42 to { double, double }*
%44 = getelementptr inbounds { double, double }, { double, double }* %43, i64 0
%45 = getelementptr inbounds { double, double }, { double, double }* %44, i32 0, i32 0
%46 = load double, double* %45
%47 = getelementptr inbounds { double, double }, { double, double }* %44, i32 0, i32 1
%48 = load double, double* %47
%49 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%50 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %46, double* %49
store double %48, double* %50
%51 = load { double, double }, { double, double }* %4
ret { double, double } %51
}

LLVM IR (-O2):
define { double, double } @my_fxsmul(double %0, double %1, double %2) {
%4 = tail call i32 (double, double, ...) bitcast (i32 (...)* @my_creal to i32 (double, double, ...)*)(double %0, double %1)
%5 = sitofp i32 %4 to double
%6 = fmul double %5, %2
%7 = tail call i32 (double, double, ...) bitcast (i32 (...)* @my_cimag to i32 (double, double, ...)*)(double %0, double %1)
%8 = sitofp i32 %7 to double
%9 = fmul double %8, %2
%10 = insertvalue { double, double } poison, double %6, 0
%11 = insertvalue { double, double } %10, double %9, 1
ret { double, double } %11
}