void mp_mul_cmul_nt_d1_add(int nfft, double d1[], double d2[], double d3[],
                           int ip[], double w[]) {
  void cdft(int n, int isgn, double *a, int *ip, double *w);
  void mp_mul_rcmul_nt_in1_add(int n, double *a, double *b, double *badd,
                               int nc, double *c);
  double xr, xi;
  cdft(nfft, 1, &d2[1], ip, w);
  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], ip[1], &w[ip[0]]);
  }
  d3[nfft + 1] += d1[nfft + 1] * d2[nfft + 1];
  cdft(nfft, -1, &d3[1], ip, w);
}


x86 assembly (clang, -O0):
<mp_mul_cmul_nt_d1_add>:
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    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rdx
add    $0x8,%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
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,-0x38(%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,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x20(%rbp),%rax
addsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%rax
addsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rax)
cmpl   $0x2,-0x4(%rbp)
jle    1228 <mp_mul_cmul_nt_d1_add+0x108>
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
mov    -0x28(%rbp),%rax
mov    0x4(%rax),%r8d
mov    -0x30(%rbp),%r9
mov    -0x28(%rbp),%rax
movslq (%rax),%rax
shl    $0x3,%rax
add    %rax,%r9
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    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    $0xffffffff,%esi
call   1040 <cdft@plt>
add    $0x40,%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
sub    $0x18,%rsp
mov    %r8,%r15
mov    %rcx,%rbx
mov    %rdx,%r12
mov    %rsi,%r13
mov    %edi,%ebp
add    $0x8,%rdx
mov    $0x1,%esi
mov    %rdx,0x10(%rsp)
mov    %r8,%rcx
mov    %r9,0x8(%rsp)
mov    %r9,%r8
call   1040 <cdft@plt>
movupd 0x8(%r12),%xmm0
movsd  0x8(%r13),%xmm1
movsd  0x10(%r13),%xmm2
unpcklpd %xmm2,%xmm2
unpcklpd %xmm1,%xmm1
mulpd  %xmm0,%xmm1
shufpd $0x1,%xmm0,%xmm0
mulpd  %xmm2,%xmm0
addpd  %xmm0,%xmm1
lea    0x8(%rbx),%r14
movupd 0x8(%rbx),%xmm0
addpd  %xmm1,%xmm0
movupd %xmm0,0x8(%rbx)
cmp    $0x3,%ebp
jl     11c0 <mp_mul_cmul_nt_d1_add+0xa0>
lea    0x8(%r13),%rsi
mov    0x4(%r15),%r8d
movslq (%r15),%rax
mov    0x8(%rsp),%rcx
lea    (%rcx,%rax,8),%r9
mov    %ebp,%edi
mov    0x10(%rsp),%rdx
mov    %r14,%rcx
call   1030 <mp_mul_rcmul_nt_in1_add@plt>
movslq %ebp,%rax
movsd  0x8(%r13,%rax,8),%xmm0
mulsd  0x8(%r12,%rax,8),%xmm0
addsd  0x8(%rbx,%rax,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rax,8)
mov    %ebp,%edi
mov    $0xffffffff,%esi
mov    %r14,%rdx
mov    %r15,%rcx
mov    0x8(%rsp),%r8
add    $0x18,%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, i32* %4, double* %5) {
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32*
%12 = alloca double*
%13 = alloca double
%14 = alloca double
store i32 %0, i32* %7
store double* %1, double** %8
store double* %2, double** %9
store double* %3, double** %10
store i32* %4, i32** %11
store double* %5, double** %12
%15 = load i32, i32* %7
%16 = load double*, double** %9
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load i32*, i32** %11
%19 = load double*, double** %12
%20 = load double*, double** %8
%21 = getelementptr inbounds double, double* %20, i64 1
%22 = load double, double* %21
%23 = load double*, double** %9
%24 = getelementptr inbounds double, double* %23, i64 1
%25 = load double, double* %24
%26 = load double*, double** %8
%27 = getelementptr inbounds double, double* %26, i64 2
%28 = load double, double* %27
%29 = load double*, double** %9
%30 = getelementptr inbounds double, double* %29, i64 2
%31 = load double, double* %30
%32 = fmul double %28, %31
%33 = call double @llvm.fmuladd.f64(double %22, double %25, double %32)
store double %33, double* %13
%34 = load double*, double** %8
%35 = getelementptr inbounds double, double* %34, i64 1
%36 = load double, double* %35
%37 = load double*, double** %9
%38 = getelementptr inbounds double, double* %37, i64 2
%39 = load double, double* %38
%40 = load double*, double** %8
%41 = getelementptr inbounds double, double* %40, i64 2
%42 = load double, double* %41
%43 = load double*, double** %9
%44 = getelementptr inbounds double, double* %43, i64 1
%45 = load double, double* %44
%46 = fmul double %42, %45
%47 = call double @llvm.fmuladd.f64(double %36, double %39, double %46)
store double %47, double* %14
%48 = load double, double* %13
%49 = load double*, double** %10
%50 = getelementptr inbounds double, double* %49, i64 1
%51 = load double, double* %50
%52 = fadd double %51, %48
store double %52, double* %50
%53 = load double, double* %14
%54 = load double*, double** %10
%55 = getelementptr inbounds double, double* %54, i64 2
%56 = load double, double* %55
%57 = fadd double %56, %53
store double %57, double* %55
%58 = load i32, i32* %7
%59 = icmp sgt i32 %58, 2
br i1 %59, label %60, label %77
60: ; preds = %6
%61 = load i32, i32* %7
%62 = load double*, double** %8
%63 = getelementptr inbounds double, double* %62, i64 1
%64 = load double*, double** %9
%65 = getelementptr inbounds double, double* %64, i64 1
%66 = load double*, double** %10
%67 = getelementptr inbounds double, double* %66, i64 1
%68 = load i32*, i32** %11
%69 = getelementptr inbounds i32, i32* %68, i64 1
%70 = load i32, i32* %69
%71 = load double*, double** %12
%72 = load i32*, i32** %11
%73 = getelementptr inbounds i32, i32* %72, i64 0
%74 = load i32, i32* %73
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %71, i64 %75
br label %77
77: ; preds = %60, %6
%78 = load double*, double** %8
%79 = load i32, i32* %7
%80 = add nsw i32 %79, 1
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds double, double* %78, i64 %81
%83 = load double, double* %82
%84 = load double*, double** %9
%85 = load i32, i32* %7
%86 = add nsw i32 %85, 1
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds double, double* %84, i64 %87
%89 = load double, double* %88
%90 = load double*, double** %10
%91 = load i32, i32* %7
%92 = add nsw i32 %91, 1
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %90, i64 %93
%95 = load double, double* %94
%96 = call double @llvm.fmuladd.f64(double %83, double %89, double %95)
store double %96, double* %94
%97 = load i32, i32* %7
%98 = load double*, double** %10
%99 = getelementptr inbounds double, double* %98, i64 1
%100 = load i32*, i32** %11
%101 = load double*, double** %12
ret void
}

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