void mp_mul_cmul_nt_d1_add(int nfft, double d1[], double d2[], double d3[]) {
  void cdft(int n, int isgn, double *a);
  void mp_mul_rcmul_nt_in1_add(int n, double *a, double *b, double *badd);
  double xr, xi;
  cdft(nfft, 1, &d2[1]);
  xr = d1[1] * d2[1] + d1[2] * d2[2];
  xi = d1[1] * d2[2] + d1[2] * d2[1];
  d3[1] += xr;
  d3[2] += xi;
  if (nfft > 2) {
    mp_mul_rcmul_nt_in1_add(nfft, &d1[1], &d2[1], &d3[1]);
  }
  d3[nfft + 1] += d1[nfft + 1] * d2[nfft + 1];
  cdft(nfft, -1, &d3[1]);
}


x86 assembly (clang, -O0):
<mp_mul_cmul_nt_d1_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rdx
add    $0x8,%rdx
mov    $0x1,%esi
call   1040 <cdft@plt>
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,-0x28(%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,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x20(%rbp),%rax
addsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x30(%rbp),%xmm0
mov    -0x20(%rbp),%rax
addsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rax)
cmpl   $0x2,-0x4(%rbp)
jle    11fe <mp_mul_cmul_nt_d1_add+0xde>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
mov    -0x18(%rbp),%rdx
add    $0x8,%rdx
mov    -0x20(%rbp),%rcx
add    $0x8,%rcx
call   1030 <mp_mul_rcmul_nt_in1_add@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
movsd  (%rax,%rcx,8),%xmm2
mov    -0x20(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rdx
add    $0x8,%rdx
mov    $0xffffffff,%esi
call   1040 <cdft@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_mul_cmul_nt_d1_add>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%ebp
lea    0x8(%rdx),%r12
mov    $0x1,%esi
mov    %r12,%rdx
call   1040 <cdft@plt>
movupd 0x8(%r14),%xmm0
movsd  0x8(%r15),%xmm1
movsd  0x10(%r15),%xmm2
unpcklpd %xmm2,%xmm2
unpcklpd %xmm1,%xmm1
mulpd  %xmm0,%xmm1
shufpd $0x1,%xmm0,%xmm0
mulpd  %xmm2,%xmm0
addpd  %xmm0,%xmm1
lea    0x8(%rbx),%r13
movupd 0x8(%rbx),%xmm0
addpd  %xmm1,%xmm0
movupd %xmm0,0x8(%rbx)
cmp    $0x3,%ebp
jl     119a <mp_mul_cmul_nt_d1_add+0x7a>
lea    0x8(%r15),%rsi
mov    %ebp,%edi
mov    %r12,%rdx
mov    %r13,%rcx
call   1030 <mp_mul_rcmul_nt_in1_add@plt>
movslq %ebp,%rax
movsd  0x8(%r15,%rax,8),%xmm0
mulsd  0x8(%r14,%rax,8),%xmm0
addsd  0x8(%rbx,%rax,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rax,8)
mov    %ebp,%edi
mov    $0xffffffff,%esi
mov    %r13,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <cdft@plt>

LLVM IR (-O0):
define void @mp_mul_cmul_nt_d1_add(i32 %0, double* %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
store i32 %0, i32* %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%11 = load i32, i32* %5
%12 = load double*, double** %7
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double*, double** %6
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = load double*, double** %7
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = load double*, double** %6
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = load double*, double** %7
%24 = getelementptr inbounds double, double* %23, i64 2
%25 = load double, double* %24
%26 = fmul double %22, %25
%27 = call double @llvm.fmuladd.f64(double %16, double %19, double %26)
store double %27, double* %9
%28 = load double*, double** %6
%29 = getelementptr inbounds double, double* %28, i64 1
%30 = load double, double* %29
%31 = load double*, double** %7
%32 = getelementptr inbounds double, double* %31, i64 2
%33 = load double, double* %32
%34 = load double*, double** %6
%35 = getelementptr inbounds double, double* %34, i64 2
%36 = load double, double* %35
%37 = load double*, double** %7
%38 = getelementptr inbounds double, double* %37, i64 1
%39 = load double, double* %38
%40 = fmul double %36, %39
%41 = call double @llvm.fmuladd.f64(double %30, double %33, double %40)
store double %41, double* %10
%42 = load double, double* %9
%43 = load double*, double** %8
%44 = getelementptr inbounds double, double* %43, i64 1
%45 = load double, double* %44
%46 = fadd double %45, %42
store double %46, double* %44
%47 = load double, double* %10
%48 = load double*, double** %8
%49 = getelementptr inbounds double, double* %48, i64 2
%50 = load double, double* %49
%51 = fadd double %50, %47
store double %51, double* %49
%52 = load i32, i32* %5
%53 = icmp sgt i32 %52, 2
br i1 %53, label %54, label %62
54: ; preds = %4
%55 = load i32, i32* %5
%56 = load double*, double** %6
%57 = getelementptr inbounds double, double* %56, i64 1
%58 = load double*, double** %7
%59 = getelementptr inbounds double, double* %58, i64 1
%60 = load double*, double** %8
%61 = getelementptr inbounds double, double* %60, i64 1
br label %62
62: ; preds = %54, %4
%63 = load double*, double** %6
%64 = load i32, i32* %5
%65 = add nsw i32 %64, 1
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds double, double* %63, i64 %66
%68 = load double, double* %67
%69 = load double*, double** %7
%70 = load i32, i32* %5
%71 = add nsw i32 %70, 1
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %69, i64 %72
%74 = load double, double* %73
%75 = load double*, double** %8
%76 = load i32, i32* %5
%77 = add nsw i32 %76, 1
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %75, i64 %78
%80 = load double, double* %79
%81 = call double @llvm.fmuladd.f64(double %68, double %74, double %80)
store double %81, double* %79
%82 = load i32, i32* %5
%83 = load double*, double** %8
%84 = getelementptr inbounds double, double* %83, i64 1
ret void
}

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