void mp_mul_csqu_nt_d1(int nfft, double d1[]) {
  void cdft(int n, int isgn, double *a);
  void mp_mul_rcsqu_nt_in(int n, double *a);
  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]);
  }
  d1[nfft + 1] *= d1[nfft + 1];
  cdft(nfft, -1, &d1[1]);
}


x86 assembly (clang, -O0):
<mp_mul_csqu_nt_d1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xec5(%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,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xe80(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
cmpl   $0x2,-0x4(%rbp)
jle    11c9 <mp_mul_csqu_nt_d1+0xa9>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
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    $0xffffffff,%esi
call   1030 <cdft@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_mul_csqu_nt_d1>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
addsd  %xmm0,%xmm0
movsd  %xmm0,(%rsi)
lea    0x8(%rsi),%r14
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     1174 <mp_mul_csqu_nt_d1+0x54>
mov    %ebp,%edi
mov    %r14,%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    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <cdft@plt>

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

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