void fft2pt(float *ioptr) {
  float f0r, f0i, f1r, f1i;
  float t0r, t0i;
  f0r = ioptr[0];
  f0i = ioptr[1];
  f1r = ioptr[2];
  f1i = ioptr[3];
  t0r = f0r + f1r;
  t0i = f0i + f1i;
  f1r = f0r - f1r;
  f1i = f0i - f1i;
  ioptr[0] = t0r;
  ioptr[1] = t0i;
  ioptr[2] = f1r;
  ioptr[3] = f1i;
}


x86 assembly (clang, -O0):
<fft2pt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x1c(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fft2pt>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movaps %xmm0,%xmm2
addps  %xmm1,%xmm2
subps  %xmm1,%xmm0
movlhps %xmm0,%xmm2
movups %xmm2,(%rdi)
ret

LLVM IR (-O0):
define void @fft2pt(float* %0) {
%2 = alloca float*
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float* %0, float** %2
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 0
%11 = load float, float* %10
store float %11, float* %3
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
store float %14, float* %4
%15 = load float*, float** %2
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
store float %17, float* %5
%18 = load float*, float** %2
%19 = getelementptr inbounds float, float* %18, i64 3
%20 = load float, float* %19
store float %20, float* %6
%21 = load float, float* %3
%22 = load float, float* %5
%23 = fadd float %21, %22
store float %23, float* %7
%24 = load float, float* %4
%25 = load float, float* %6
%26 = fadd float %24, %25
store float %26, float* %8
%27 = load float, float* %3
%28 = load float, float* %5
%29 = fsub float %27, %28
store float %29, float* %5
%30 = load float, float* %4
%31 = load float, float* %6
%32 = fsub float %30, %31
store float %32, float* %6
%33 = load float, float* %7
%34 = load float*, float** %2
%35 = getelementptr inbounds float, float* %34, i64 0
store float %33, float* %35
%36 = load float, float* %8
%37 = load float*, float** %2
%38 = getelementptr inbounds float, float* %37, i64 1
store float %36, float* %38
%39 = load float, float* %5
%40 = load float*, float** %2
%41 = getelementptr inbounds float, float* %40, i64 2
store float %39, float* %41
%42 = load float, float* %6
%43 = load float*, float** %2
%44 = getelementptr inbounds float, float* %43, i64 3
store float %42, float* %44
ret void
}

LLVM IR (-O2):
define void @fft2pt(float* nocapture %0) {
%2 = bitcast float* %0 to <2 x float>*
%3 = load <2 x float>, <2 x float>* %2
%4 = shufflevector <2 x float> %3, <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
%5 = getelementptr inbounds float, float* %0, i64 2
%6 = bitcast float* %5 to <2 x float>*
%7 = load <2 x float>, <2 x float>* %6
%8 = shufflevector <2 x float> %7, <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
%9 = fadd <4 x float> %4, %8
%10 = fsub <4 x float> %4, %8
%11 = shufflevector <4 x float> %9, <4 x float> %10, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
%12 = bitcast float* %0 to <4 x float>*
store <4 x float> %11, <4 x float>* %12
ret void
}