void mp_mul_cmul_nt_d1(int nfft, double d1[], double d2[], int ip[],
                       double w[]) {
  void cdft(int n, int isgn, double *a, int *ip, double *w);
  void mp_mul_rcmul_nt_in1(int n, double *a, double *b, int nc, double *c);
  double xr, xi;
  cdft(nfft, 1, &d2[1], ip, w);
  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_nt_in1(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_nt_d1>:
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    -0x18(%rbp),%rdx
add    $0x8,%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x1,%esi
call   1030 <cdft@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    1225 <mp_mul_cmul_nt_d1+0x105>
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   1040 <mp_mul_rcmul_nt_in1@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_nt_d1>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r12
mov    %rdx,%rbx
mov    %rsi,%rbp
mov    %edi,%r13d
lea    0x8(%rdx),%r15
mov    $0x1,%esi
mov    %r15,%rdx
call   1030 <cdft@plt>
movsd  0x0(%rbp),%xmm0
addsd  (%rbx),%xmm0
movsd  %xmm0,(%rbx)
movupd 0x8(%rbx),%xmm0
movsd  0x8(%rbp),%xmm1
movsd  0x10(%rbp),%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,%r13d
jl     11a7 <mp_mul_cmul_nt_d1+0x87>
lea    0x8(%rbp),%rsi
mov    0x4(%r12),%ecx
movslq (%r12),%rax
lea    (%r14,%rax,8),%r8
mov    %r13d,%edi
mov    %r15,%rdx
call   1040 <mp_mul_rcmul_nt_in1@plt>
movslq %r13d,%rax
movsd  0x8(%rbp,%rax,8),%xmm0
mulsd  0x8(%rbx,%rax,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rax,8)
mov    %r13d,%edi
mov    $0xffffffff,%esi
mov    %r15,%rdx
mov    %r12,%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_nt_d1(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** %8
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load i32*, i32** %9
%17 = load double*, double** %10
%18 = load double*, double** %7
%19 = getelementptr inbounds double, double* %18, i64 0
%20 = load double, double* %19
%21 = load double*, double** %8
%22 = getelementptr inbounds double, double* %21, i64 0
%23 = load double, double* %22
%24 = fadd double %23, %20
store double %24, double* %22
%25 = load double*, double** %7
%26 = getelementptr inbounds double, double* %25, i64 1
%27 = load double, double* %26
%28 = load double*, double** %8
%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** %8
%35 = getelementptr inbounds double, double* %34, i64 2
%36 = load double, double* %35
%37 = fmul double %33, %36
%38 = call double @llvm.fmuladd.f64(double %27, double %30, double %37)
store double %38, double* %11
%39 = load double*, double** %7
%40 = getelementptr inbounds double, double* %39, i64 1
%41 = load double, double* %40
%42 = load double*, double** %8
%43 = getelementptr inbounds double, double* %42, i64 2
%44 = load double, double* %43
%45 = load double*, double** %7
%46 = getelementptr inbounds double, double* %45, i64 2
%47 = load double, double* %46
%48 = load double*, double** %8
%49 = getelementptr inbounds double, double* %48, i64 1
%50 = load double, double* %49
%51 = fmul double %47, %50
%52 = call double @llvm.fmuladd.f64(double %41, double %44, double %51)
store double %52, double* %12
%53 = load double, double* %11
%54 = load double*, double** %8
%55 = getelementptr inbounds double, double* %54, i64 1
store double %53, double* %55
%56 = load double, double* %12
%57 = load double*, double** %8
%58 = getelementptr inbounds double, double* %57, i64 2
store double %56, double* %58
%59 = load i32, i32* %6
%60 = icmp sgt i32 %59, 2
br i1 %60, label %61, label %76
61: ; preds = %5
%62 = load i32, i32* %6
%63 = load double*, double** %7
%64 = getelementptr inbounds double, double* %63, i64 1
%65 = load double*, double** %8
%66 = getelementptr inbounds double, double* %65, i64 1
%67 = load i32*, i32** %9
%68 = getelementptr inbounds i32, i32* %67, i64 1
%69 = load i32, i32* %68
%70 = load double*, double** %10
%71 = load i32*, i32** %9
%72 = getelementptr inbounds i32, i32* %71, i64 0
%73 = load i32, i32* %72
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds double, double* %70, i64 %74
br label %76
76: ; preds = %61, %5
%77 = load double*, double** %7
%78 = load i32, i32* %6
%79 = add nsw i32 %78, 1
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds double, double* %77, i64 %80
%82 = load double, double* %81
%83 = load double*, double** %8
%84 = load i32, i32* %6
%85 = add nsw i32 %84, 1
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double, double* %83, i64 %86
%88 = load double, double* %87
%89 = fmul double %88, %82
store double %89, double* %87
%90 = load i32, i32* %6
%91 = load double*, double** %8
%92 = getelementptr inbounds double, double* %91, i64 1
%93 = load i32*, i32** %9
%94 = load double*, double** %10
ret void
}

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