#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_addsub_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_movehdup_ps(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_moveldup_ps(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_mul_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_shuffle_ps(int /*<<< orphan*/, int /*<<< orphan*/, int);
__m128 _mm_complexmul_ps(__m128 x, __m128 y) {
  __m128 yl, yh, tmp1, tmp2;
  yl = _mm_moveldup_ps(y);
  yh = _mm_movehdup_ps(y);
  tmp1 = _mm_mul_ps(x, yl);
  x = _mm_shuffle_ps(x, x, 0xB1);
  tmp2 = _mm_mul_ps(x, yh);
  return _mm_addsub_ps(tmp1, tmp2);
}


x86 assembly (clang, -O0):
<_mm_complexmul_ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <_mm_moveldup_ps@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <_mm_movehdup_ps@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1070 <_mm_mul_ps@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0xb1,%edx
call   1030 <_mm_shuffle_ps@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1070 <_mm_mul_ps@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1060 <_mm_addsub_ps@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_complexmul_ps>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1040 <_mm_moveldup_ps@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1050 <_mm_movehdup_ps@plt>
mov    %eax,%r15d
mov    %ebp,%edi
mov    %r14d,%esi
call   1070 <_mm_mul_ps@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %ebp,%esi
mov    $0xb1,%edx
call   1030 <_mm_shuffle_ps@plt>
mov    %eax,%edi
mov    %r15d,%esi
call   1070 <_mm_mul_ps@plt>
mov    %ebx,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <_mm_addsub_ps@plt>

LLVM IR (-O0):
define i32 @_mm_complexmul_ps(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %4
%10 = call i32 @_mm_moveldup_ps(i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = call i32 @_mm_movehdup_ps(i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = call i32 @_mm_mul_ps(i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32, i32* %3
%17 = load i32, i32* %3
%18 = call i32 @_mm_shuffle_ps(i32 %16, i32 %17, i32 177)
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = load i32, i32* %6
%21 = call i32 @_mm_mul_ps(i32 %19, i32 %20)
store i32 %21, i32* %8
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = call i32 @_mm_addsub_ps(i32 %22, i32 %23)
ret i32 %24
}

LLVM IR (-O2):
define i32 @_mm_complexmul_ps(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_moveldup_ps(i32 %1)
%4 = tail call i32 @_mm_movehdup_ps(i32 %1)
%5 = tail call i32 @_mm_mul_ps(i32 %0, i32 %3)
%6 = tail call i32 @_mm_shuffle_ps(i32 %0, i32 %0, i32 177)
%7 = tail call i32 @_mm_mul_ps(i32 %6, i32 %4)
%8 = tail call i32 @_mm_addsub_ps(i32 %5, i32 %7)
ret i32 %8
}