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


x86 assembly (clang, -O0):
<mp_mul_csqu_nt_d1>:
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    -0x10(%rbp),%rax
movsd  0xebd(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xe78(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
cmpl   $0x2,-0x4(%rbp)
jle    11ea <mp_mul_csqu_nt_d1+0xca>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
movslq (%rax),%rax
shl    $0x3,%rax
add    %rax,%rcx
call   1040 <mp_mul_rcsqu_nt_in@plt>
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%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    -0x10(%rbp),%rdx
add    $0x8,%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0xffffffff,%esi
call   1030 <cdft@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_mul_csqu_nt_d1>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %edi,%ebp
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
addsd  %xmm0,%xmm0
movsd  %xmm0,(%rsi)
lea    0x8(%rsi),%r12
movsd  0x10(%rsi),%xmm0
movapd %xmm1,%xmm2
addsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rsi)
movsd  %xmm1,0x10(%rsi)
cmp    $0x3,%edi
jl     1189 <mp_mul_csqu_nt_d1+0x69>
mov    0x4(%r15),%edx
movslq (%r15),%rax
lea    (%r14,%rax,8),%rcx
mov    %ebp,%edi
mov    %r12,%rsi
call   1040 <mp_mul_rcsqu_nt_in@plt>
movslq %ebp,%rax
movsd  0x8(%rbx,%rax,8),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rbx,%rax,8)
mov    %ebp,%edi
mov    $0xffffffff,%esi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <cdft@plt>

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

LLVM IR (-O2):
define void @mp_mul_csqu_nt_d1(i32 %0, double* %1, i32* %2, double* %3) {
%5 = load double, double* %1
%6 = fmul double %5, 2.000000e+00
store double %6, double* %1
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 2
%10 = load double, double* %9
%11 = fmul double %10, %10
%12 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %11)
%13 = fmul double %8, 2.000000e+00
%14 = fmul double %13, %10
store double %12, double* %7
store double %14, double* %9
%15 = icmp sgt i32 %0, 2
br i1 %15, label %16, label %22
16: ; preds = %4
%17 = getelementptr inbounds i32, i32* %2, i64 1
%18 = load i32, i32* %17
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %3, i64 %20
tail call void @mp_mul_rcsqu_nt_in(i32 %0, double* %7, i32 %18, double* %21)
br label %22
22: ; preds = %16, %4
%23 = add nsw i32 %0, 1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %1, i64 %24
%26 = load double, double* %25
%27 = fmul double %26, %26
store double %27, double* %25
tail call void @cdft(i32 %0, i32 -1, double* %7, i32* %2, double* %3)
ret void
}