void helper_float_2(float *buf) {
  for (int j = 0; j < 4; j += 4) {
    __asm__ volatile("movups (%0), %%xmm0\n"
                     "movaps %%xmm0, %%xmm8\n"
                     "shufps $160, %%xmm8, %%xmm8\n"
                     "shufps $245, %%xmm0, %%xmm0\n"
                     "xorps %%xmm9, %%xmm9\n"
                     "subps %%xmm0, %%xmm9\n"
                     "addsubps %%xmm9, %%xmm8\n"
                     "movaps %%xmm8, %%xmm0\n"
                     "movaps %%xmm0, %%xmm8\n"
                     "shufps $68, %%xmm8, %%xmm8\n"
                     "xorps %%xmm9, %%xmm9\n"
                     "movaps %%xmm0, %%xmm10\n"
                     "shufps $14, %%xmm9, %%xmm10\n"
                     "movaps %%xmm0, %%xmm11\n"
                     "shufps $224, %%xmm11, %%xmm9\n"
                     "addps %%xmm8, %%xmm10\n"
                     "subps %%xmm9, %%xmm10\n"
                     "movaps %%xmm10, %%xmm0\n"
                     "movups %%xmm0, (%0)\n" ::"r"(buf + j)
                     : "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5",
                       "%xmm6", "%xmm7", "%xmm8", "%xmm9", "%xmm10", "%xmm11",
                       "%xmm12", "%xmm13", "%xmm14", "%xmm15", "memory");
  }
}


x86 assembly (clang, -O0):
<helper_float_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1185 <helper_float_2+0x85>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movups (%rax),%xmm0
movaps %xmm0,%xmm8
shufps $0xa0,%xmm8,%xmm8
shufps $0xf5,%xmm0,%xmm0
xorps  %xmm9,%xmm9
subps  %xmm0,%xmm9
addsubps %xmm9,%xmm8
movaps %xmm8,%xmm0
movaps %xmm0,%xmm8
shufps $0x44,%xmm8,%xmm8
xorps  %xmm9,%xmm9
movaps %xmm0,%xmm10
shufps $0xe,%xmm9,%xmm10
movaps %xmm0,%xmm11
shufps $0xe0,%xmm11,%xmm9
addps  %xmm8,%xmm10
subps  %xmm9,%xmm10
movaps %xmm10,%xmm0
movups %xmm0,(%rax)
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <helper_float_2+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<helper_float_2>:
movups (%rdi),%xmm0
movaps %xmm0,%xmm8
shufps $0xa0,%xmm8,%xmm8
shufps $0xf5,%xmm0,%xmm0
xorps  %xmm9,%xmm9
subps  %xmm0,%xmm9
addsubps %xmm9,%xmm8
movaps %xmm8,%xmm0
movaps %xmm0,%xmm8
shufps $0x44,%xmm8,%xmm8
xorps  %xmm9,%xmm9
movaps %xmm0,%xmm10
shufps $0xe,%xmm9,%xmm10
movaps %xmm0,%xmm11
shufps $0xe0,%xmm11,%xmm9
addps  %xmm8,%xmm10
subps  %xmm9,%xmm10
movaps %xmm10,%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @helper_float_2(float* %0) {
%2 = alloca float*
%3 = alloca i32
store float* %0, float** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 4
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load float*, float** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds float, float* %8, i64 %10
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 4
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @helper_float_2(float* %0) {
tail call void asm sideeffect "movups ($0), %xmm0\0Amovaps %xmm0, %xmm8\0Ashufps $$160, %xmm8, %xmm8\0Ashufps $$245, %xmm0, %xmm0\0Axorps %xmm9, %xmm9\0Asubps %xmm0, %xmm9\0Aaddsubps %xmm9, %xmm8\0Amovaps %xmm8, %xmm0\0Amovaps %xmm0, %xmm8\0Ashufps $$68, %xmm8, %xmm8\0Axorps %xmm9, %xmm9\0Amovaps %xmm0, %xmm10\0Ashufps $$14, %xmm9, %xmm10\0Amovaps %xmm0, %xmm11\0Ashufps $$224, %xmm11, %xmm9\0Aaddps %xmm8, %xmm10\0Asubps %xmm9, %xmm10\0Amovaps %xmm10, %xmm0\0Amovups %xmm0, ($0)\0A", "r,~{xmm0},~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{memory},~{dirflag},~{fpsr},~{flags}"(float* %0)
ret void
}