#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_SHUFFLE(int, int, int, int);
int /*<<< orphan*/ _mm_add_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_mul_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_shuffle_ps(int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
__m128 _mm_magnitudesquared_ps(__m128 cplxValue1, __m128 cplxValue2) {
  __m128 iValue, qValue;
  iValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(2, 0, 2, 0));
  qValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(3, 1, 3, 1));
  iValue = _mm_mul_ps(iValue, iValue);
  qValue = _mm_mul_ps(qValue, qValue);
  return _mm_add_ps(iValue, qValue);
}


x86 assembly (clang, -O0):
<_mm_magnitudesquared_ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x2,%edx
xor    %ecx,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1030 <_MM_SHUFFLE@plt>
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
call   1040 <_mm_shuffle_ps@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x3,%edx
mov    $0x1,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1030 <_MM_SHUFFLE@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    %eax,%edx
call   1040 <_mm_shuffle_ps@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <_mm_mul_ps@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1050 <_mm_mul_ps@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1060 <_mm_add_ps@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_magnitudesquared_ps>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
mov    $0x2,%edi
xor    %esi,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1030 <_MM_SHUFFLE@plt>
mov    %ebp,%edi
mov    %r14d,%esi
mov    %eax,%edx
call   1040 <_mm_shuffle_ps@plt>
mov    %eax,%ebx
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
call   1030 <_MM_SHUFFLE@plt>
mov    %ebp,%edi
mov    %r14d,%esi
mov    %eax,%edx
call   1040 <_mm_shuffle_ps@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    %ebx,%esi
call   1050 <_mm_mul_ps@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %ebp,%esi
call   1050 <_mm_mul_ps@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <_mm_add_ps@plt>

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

LLVM IR (-O2):
define i32 @_mm_magnitudesquared_ps(i32 %0, i32 %1) {
%3 = tail call i32 @_MM_SHUFFLE(i32 2, i32 0, i32 2, i32 0)
%4 = tail call i32 @_mm_shuffle_ps(i32 %0, i32 %1, i32 %3)
%5 = tail call i32 @_MM_SHUFFLE(i32 3, i32 1, i32 3, i32 1)
%6 = tail call i32 @_mm_shuffle_ps(i32 %0, i32 %1, i32 %5)
%7 = tail call i32 @_mm_mul_ps(i32 %4, i32 %4)
%8 = tail call i32 @_mm_mul_ps(i32 %6, i32 %6)
%9 = tail call i32 @_mm_add_ps(i32 %7, i32 %8)
ret i32 %9
}