void mp_mul_cmul_nt_d2(int nfft, double d1[], double d2[]) {
  void cdft(int n, int isgn, double *a);
  void mp_mul_rcmul_nt_in2(int n, double *a, double *b);
  double xr, xi;
  cdft(nfft, 1, &d1[1]);
  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_in2(nfft, &d1[1], &d2[1]);
  }
  d2[nfft + 1] *= d1[nfft + 1];
  cdft(nfft, -1, &d2[1]);
}


x86 assembly (clang, -O0):
<mp_mul_cmul_nt_d2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
add    $0x8,%rdx
mov    $0x1,%esi
call   1040 <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,-0x20(%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,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
cmpl   $0x2,-0x4(%rbp)
jle    11fc <mp_mul_cmul_nt_d2+0xdc>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
mov    -0x18(%rbp),%rdx
add    $0x8,%rdx
call   1030 <mp_mul_rcmul_nt_in2@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    $0xffffffff,%esi
call   1040 <cdft@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_mul_cmul_nt_d2>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rbp
mov    %edi,%r14d
lea    0x8(%rsi),%r12
mov    $0x1,%esi
mov    %r12,%rdx
call   1040 <cdft@plt>
movsd  0x0(%rbp),%xmm0
addsd  (%rbx),%xmm0
movsd  %xmm0,(%rbx)
lea    0x8(%rbx),%r15
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,%r14d
jl     1194 <mp_mul_cmul_nt_d2+0x74>
mov    %r14d,%edi
mov    %r12,%rsi
mov    %r15,%rdx
call   1030 <mp_mul_rcmul_nt_in2@plt>
movslq %r14d,%rax
movsd  0x8(%rbp,%rax,8),%xmm0
mulsd  0x8(%rbx,%rax,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rax,8)
mov    %r14d,%edi
mov    $0xffffffff,%esi
mov    %r15,%rdx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <cdft@plt>

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

LLVM IR (-O2):
define void @mp_mul_cmul_nt_d2(i32 %0, double* %1, double* %2) {
%4 = getelementptr inbounds double, double* %1, i64 1
tail call void @cdft(i32 %0, i32 1, double* %4)
%5 = load double, double* %1
%6 = load double, double* %2
%7 = fadd double %5, %6
store double %7, double* %2
%8 = load double, double* %4
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = getelementptr inbounds double, double* %1, i64 2
%11 = load double, double* %10
%12 = bitcast double* %9 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 %8, 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 = bitcast double* %9 to <2 x double>*
store <2 x double> %20, <2 x double>* %21
%22 = icmp sgt i32 %0, 2
br i1 %22, label %23, label %24
23: ; preds = %3
tail call void @mp_mul_rcmul_nt_in2(i32 %0, double* %4, double* %9)
br label %24
24: ; preds = %23, %3
%25 = add nsw i32 %0, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %1, i64 %26
%28 = load double, double* %27
%29 = getelementptr inbounds double, double* %2, i64 %26
%30 = load double, double* %29
%31 = fmul double %28, %30
store double %31, double* %29
tail call void @cdft(i32 %0, i32 -1, double* %9)
ret void
}