void mp_mul_cmul(int nfft, double d1[], double d2[], int ip[], double w[]) {
  void makect(int nc, int *ip, double *c);
  void cdft(int n, int isgn, double *a, int *ip, double *w);
  void mp_mul_rcmul(int n, double *a, double *b, int nc, double *c);
  double xr, xi;
  cdft(nfft, 1, &d1[1], ip, w);
  cdft(nfft, 1, &d2[1], ip, w);
  if (nfft > (ip[1] << 2)) {
    makect(nfft >> 2, ip, &w[ip[0]]);
  }
  d2[0] += d1[0];
  xr = d1[1] * d2[1] + d1[2] * d2[2];
  xi = d1[1] * d2[2] + d1[2] * d2[1];
  d2[1] = xr;
  d2[2] = xi;
  if (nfft > 2) {
    mp_mul_rcmul(nfft, &d1[1], &d2[1], ip[1], &w[ip[0]]);
  }
  d2[nfft + 1] *= d1[nfft + 1];
  cdft(nfft, -1, &d2[1], ip, w);
}


x86 assembly (clang, -O0):
<mp_mul_cmul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
add    $0x8,%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x1,%esi
call   1030 <cdft@plt>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rdx
add    $0x8,%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x1,%esi
call   1030 <cdft@plt>
mov    -0x4(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x2,%ecx
cmp    %ecx,%eax
jle    11bb <mp_mul_cmul+0x8b>
mov    -0x4(%rbp),%edi
sar    $0x2,%edi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rax
movslq (%rax),%rax
shl    $0x3,%rax
add    %rax,%rdx
call   1040 <makect@plt>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x18(%rbp),%rax
mulsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x18(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
cmpl   $0x2,-0x4(%rbp)
jle    1288 <mp_mul_cmul+0x158>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
mov    -0x18(%rbp),%rdx
add    $0x8,%rdx
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x28(%rbp),%r8
mov    -0x20(%rbp),%rax
movslq (%rax),%rax
shl    $0x3,%rax
add    %rax,%r8
call   1050 <mp_mul_rcmul@plt>
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rdx
add    $0x8,%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0xffffffff,%esi
call   1030 <cdft@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_mul_cmul>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%rbx
mov    %rsi,%r12
mov    %edi,%ebp
lea    0x8(%rsi),%rdx
mov    $0x1,%esi
mov    %rdx,(%rsp)
call   1030 <cdft@plt>
lea    0x8(%rbx),%r13
mov    %ebp,%edi
mov    $0x1,%esi
mov    %r13,%rdx
mov    %r15,%rcx
mov    %r14,%r8
call   1030 <cdft@plt>
mov    0x4(%r15),%eax
shl    $0x2,%eax
cmp    %ebp,%eax
jge    1193 <mp_mul_cmul+0x63>
mov    %ebp,%edi
sar    $0x2,%edi
movslq (%r15),%rax
lea    (%r14,%rax,8),%rdx
mov    %r15,%rsi
call   1040 <makect@plt>
movsd  (%r12),%xmm0
addsd  (%rbx),%xmm0
movsd  %xmm0,(%rbx)
movupd 0x8(%rbx),%xmm0
movsd  0x8(%r12),%xmm1
movsd  0x10(%r12),%xmm2
unpcklpd %xmm2,%xmm2
unpcklpd %xmm1,%xmm1
mulpd  %xmm0,%xmm1
shufpd $0x1,%xmm0,%xmm0
mulpd  %xmm2,%xmm0
addpd  %xmm0,%xmm1
movupd %xmm1,0x8(%rbx)
cmp    $0x3,%ebp
jl     11f0 <mp_mul_cmul+0xc0>
mov    0x4(%r15),%ecx
movslq (%r15),%rax
lea    (%r14,%rax,8),%r8
mov    %ebp,%edi
mov    (%rsp),%rsi
mov    %r13,%rdx
call   1050 <mp_mul_rcmul@plt>
movslq %ebp,%rax
movsd  0x8(%r12,%rax,8),%xmm0
mulsd  0x8(%rbx,%rax,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rax,8)
mov    %ebp,%edi
mov    $0xffffffff,%esi
mov    %r13,%rdx
mov    %r15,%rcx
mov    %r14,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <cdft@plt>

LLVM IR (-O0):
define void @mp_mul_cmul(i32 %0, double* %1, double* %2, i32* %3, double* %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32*
%10 = alloca double*
%11 = alloca double
%12 = alloca double
store i32 %0, i32* %6
store double* %1, double** %7
store double* %2, double** %8
store i32* %3, i32** %9
store double* %4, double** %10
%13 = load i32, i32* %6
%14 = load double*, double** %7
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load i32*, i32** %9
%17 = load double*, double** %10
%18 = load i32, i32* %6
%19 = load double*, double** %8
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load i32*, i32** %9
%22 = load double*, double** %10
%23 = load i32, i32* %6
%24 = load i32*, i32** %9
%25 = getelementptr inbounds i32, i32* %24, i64 1
%26 = load i32, i32* %25
%27 = shl i32 %26, 2
%28 = icmp sgt i32 %23, %27
br i1 %28, label %29, label %39
29: ; preds = %5
%30 = load i32, i32* %6
%31 = ashr i32 %30, 2
%32 = load i32*, i32** %9
%33 = load double*, double** %10
%34 = load i32*, i32** %9
%35 = getelementptr inbounds i32, i32* %34, i64 0
%36 = load i32, i32* %35
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %33, i64 %37
br label %39
39: ; preds = %29, %5
%40 = load double*, double** %7
%41 = getelementptr inbounds double, double* %40, i64 0
%42 = load double, double* %41
%43 = load double*, double** %8
%44 = getelementptr inbounds double, double* %43, i64 0
%45 = load double, double* %44
%46 = fadd double %45, %42
store double %46, double* %44
%47 = load double*, double** %7
%48 = getelementptr inbounds double, double* %47, i64 1
%49 = load double, double* %48
%50 = load double*, double** %8
%51 = getelementptr inbounds double, double* %50, i64 1
%52 = load double, double* %51
%53 = load double*, double** %7
%54 = getelementptr inbounds double, double* %53, i64 2
%55 = load double, double* %54
%56 = load double*, double** %8
%57 = getelementptr inbounds double, double* %56, i64 2
%58 = load double, double* %57
%59 = fmul double %55, %58
%60 = call double @llvm.fmuladd.f64(double %49, double %52, double %59)
store double %60, double* %11
%61 = load double*, double** %7
%62 = getelementptr inbounds double, double* %61, i64 1
%63 = load double, double* %62
%64 = load double*, double** %8
%65 = getelementptr inbounds double, double* %64, i64 2
%66 = load double, double* %65
%67 = load double*, double** %7
%68 = getelementptr inbounds double, double* %67, i64 2
%69 = load double, double* %68
%70 = load double*, double** %8
%71 = getelementptr inbounds double, double* %70, i64 1
%72 = load double, double* %71
%73 = fmul double %69, %72
%74 = call double @llvm.fmuladd.f64(double %63, double %66, double %73)
store double %74, double* %12
%75 = load double, double* %11
%76 = load double*, double** %8
%77 = getelementptr inbounds double, double* %76, i64 1
store double %75, double* %77
%78 = load double, double* %12
%79 = load double*, double** %8
%80 = getelementptr inbounds double, double* %79, i64 2
store double %78, double* %80
%81 = load i32, i32* %6
%82 = icmp sgt i32 %81, 2
br i1 %82, label %83, label %98
83: ; preds = %39
%84 = load i32, i32* %6
%85 = load double*, double** %7
%86 = getelementptr inbounds double, double* %85, i64 1
%87 = load double*, double** %8
%88 = getelementptr inbounds double, double* %87, i64 1
%89 = load i32*, i32** %9
%90 = getelementptr inbounds i32, i32* %89, i64 1
%91 = load i32, i32* %90
%92 = load double*, double** %10
%93 = load i32*, i32** %9
%94 = getelementptr inbounds i32, i32* %93, i64 0
%95 = load i32, i32* %94
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %92, i64 %96
br label %98
98: ; preds = %83, %39
%99 = load double*, double** %7
%100 = load i32, i32* %6
%101 = add nsw i32 %100, 1
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds double, double* %99, i64 %102
%104 = load double, double* %103
%105 = load double*, double** %8
%106 = load i32, i32* %6
%107 = add nsw i32 %106, 1
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %105, i64 %108
%110 = load double, double* %109
%111 = fmul double %110, %104
store double %111, double* %109
%112 = load i32, i32* %6
%113 = load double*, double** %8
%114 = getelementptr inbounds double, double* %113, i64 1
%115 = load i32*, i32** %9
%116 = load double*, double** %10
ret void
}

LLVM IR (-O2):
define void @mp_mul_cmul(i32 %0, double* %1, double* %2, i32* %3, double* %4) {
%6 = getelementptr inbounds double, double* %1, i64 1
tail call void @cdft(i32 %0, i32 1, double* %6, i32* %3, double* %4)
%7 = getelementptr inbounds double, double* %2, i64 1
tail call void @cdft(i32 %0, i32 1, double* %7, i32* %3, double* %4)
%8 = getelementptr inbounds i32, i32* %3, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 2
%11 = icmp slt i32 %10, %0
br i1 %11, label %12, label %17
12: ; preds = %5
%13 = ashr i32 %0, 2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* %4, i64 %15
tail call void @makect(i32 %13, i32* %3, double* %16)
br label %17
17: ; preds = %12, %5
%18 = load double, double* %1
%19 = load double, double* %2
%20 = fadd double %18, %19
store double %20, double* %2
%21 = load double, double* %6
%22 = getelementptr inbounds double, double* %1, i64 2
%23 = load double, double* %22
%24 = bitcast double* %7 to <2 x double>*
%25 = load <2 x double>, <2 x double>* %24
%26 = insertelement <2 x double> poison, double %23, i64 0
%27 = shufflevector <2 x double> %26, <2 x double> poison, <2 x i32> zeroinitializer
%28 = fmul <2 x double> %25, %27
%29 = shufflevector <2 x double> %28, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%30 = insertelement <2 x double> poison, double %21, i64 0
%31 = shufflevector <2 x double> %30, <2 x double> poison, <2 x i32> zeroinitializer
%32 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %31, <2 x double> %25, <2 x double> %29)
%33 = bitcast double* %7 to <2 x double>*
store <2 x double> %32, <2 x double>* %33
%34 = icmp sgt i32 %0, 2
br i1 %34, label %35, label %40
35: ; preds = %17
%36 = load i32, i32* %8
%37 = load i32, i32* %3
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %4, i64 %38
tail call void @mp_mul_rcmul(i32 %0, double* %6, double* %7, i32 %36, double* %39)
br label %40
40: ; preds = %35, %17
%41 = add nsw i32 %0, 1
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %1, i64 %42
%44 = load double, double* %43
%45 = getelementptr inbounds double, double* %2, i64 %42
%46 = load double, double* %45
%47 = fmul double %44, %46
store double %47, double* %45
tail call void @cdft(i32 %0, i32 -1, double* %7, i32* %3, double* %4)
ret void
}