#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 uint;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _MM_SHUFFLE(int, int, int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_addsub_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_load_ps(float *);
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 /*<<< orphan*/);
int /*<<< orphan*/ _mm_store_ps(float *, int /*<<< orphan*/);
void LXC_SSE3HelperCpxMul_offset(float *A, float *B, float *C, uint Offset) {
  __m128 val1;
  __m128 val2;
  __m128 val3;
  __m128 val4;
  val1 = _mm_load_ps(A + Offset);
  val2 = _mm_load_ps(B + Offset);
  val3 = _mm_moveldup_ps(val1);
  val4 = _mm_movehdup_ps(val1);
  val1 = _mm_mul_ps(val3, val2);
  val3 = _mm_mul_ps(val4, _mm_shuffle_ps(val2, val2, _MM_SHUFFLE(2, 3, 0, 1)));
  val3 = _mm_addsub_ps(val1, val3);
  _mm_store_ps(C + Offset, val3);
}


x86 assembly (clang, -O0):
<LXC_SSE3HelperCpxMul_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <_mm_load_ps@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <_mm_load_ps@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%edi
call   1060 <_mm_moveldup_ps@plt>
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%edi
call   1070 <_mm_movehdup_ps@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%edi
mov    -0x24(%rbp),%esi
call   1090 <_mm_mul_ps@plt>
mov    %eax,-0x20(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1040 <_MM_SHUFFLE@plt>
mov    -0x38(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    %eax,%edx
call   1050 <_mm_shuffle_ps@plt>
mov    -0x30(%rbp),%edi
mov    %eax,%esi
call   1090 <_mm_mul_ps@plt>
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x28(%rbp),%esi
call   1080 <_mm_addsub_ps@plt>
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x28(%rbp),%esi
call   10a0 <_mm_store_ps@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LXC_SSE3HelperCpxMul_offset>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbp
movslq %ecx,%r12
lea    (%rdi,%r12,4),%rdi
call   1030 <_mm_load_ps@plt>
mov    %eax,%ebx
lea    0x0(,%r12,4),%rdi
add    %rbp,%rdi
call   1030 <_mm_load_ps@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1060 <_mm_moveldup_ps@plt>
mov    %eax,%r15d
mov    %ebx,%edi
call   1070 <_mm_movehdup_ps@plt>
mov    %eax,%ebx
mov    %r15d,%edi
mov    %ebp,%esi
call   1090 <_mm_mul_ps@plt>
mov    %eax,%r15d
mov    $0x2,%edi
mov    $0x3,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1040 <_MM_SHUFFLE@plt>
mov    %ebp,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1050 <_mm_shuffle_ps@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1090 <_mm_mul_ps@plt>
mov    %r15d,%edi
mov    %eax,%esi
call   1080 <_mm_addsub_ps@plt>
lea    (%r14,%r12,4),%rdi
mov    %eax,%esi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    10a0 <_mm_store_ps@plt>

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

LLVM IR (-O2):
define void @LXC_SSE3HelperCpxMul_offset(float* %0, float* %1, float* %2, i32 %3) {
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds float, float* %0, i64 %5
%7 = tail call i32 @_mm_load_ps(float* %6)
%8 = getelementptr inbounds float, float* %1, i64 %5
%9 = tail call i32 @_mm_load_ps(float* %8)
%10 = tail call i32 @_mm_moveldup_ps(i32 %7)
%11 = tail call i32 @_mm_movehdup_ps(i32 %7)
%12 = tail call i32 @_mm_mul_ps(i32 %10, i32 %9)
%13 = tail call i32 @_MM_SHUFFLE(i32 2, i32 3, i32 0, i32 1)
%14 = tail call i32 @_mm_shuffle_ps(i32 %9, i32 %9, i32 %13)
%15 = tail call i32 @_mm_mul_ps(i32 %11, i32 %14)
%16 = tail call i32 @_mm_addsub_ps(i32 %12, i32 %15)
%17 = getelementptr inbounds float, float* %2, i64 %5
%18 = tail call i32 @_mm_store_ps(float* %17, i32 %16)
ret void
}