#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_add_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_load_ps(float *);
int /*<<< orphan*/ _mm_mul_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_store_ps(float *, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_sub_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  float x[4] = {1, 2, 3, 4};
  float y[4] = {4, 3, 2, 1};
  float z[4];
  __m128 vec1, vec2;
  __m128 vec3;
  vec1 = _mm_load_ps(x);
  vec2 = _mm_load_ps(y);
  vec3 = _mm_add_ps(vec1, _mm_add_ps(vec2, vec3));
  vec3 = _mm_mul_ps(vec3, _mm_sub_ps(vec3, vec1));
  _mm_store_ps(z, vec3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe9a(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe97(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe94(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe91(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <_mm_load_ps@plt>
mov    %eax,-0x44(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <_mm_load_ps@plt>
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x48(%rbp),%edi
mov    -0x4c(%rbp),%esi
call   1070 <_mm_add_ps@plt>
mov    -0x54(%rbp),%edi
mov    %eax,%esi
call   1070 <_mm_add_ps@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x4c(%rbp),%edi
mov    -0x44(%rbp),%esi
call   1050 <_mm_sub_ps@plt>
mov    -0x50(%rbp),%edi
mov    %eax,%esi
call   1040 <_mm_mul_ps@plt>
mov    %eax,-0x4c(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x4c(%rbp),%esi
call   1060 <_mm_store_ps@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
movaps 0xea3(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea7(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%rdi
call   1030 <_mm_load_ps@plt>
mov    %eax,%ebx
mov    %rsp,%rdi
call   1030 <_mm_load_ps@plt>
mov    %eax,%edi
call   1070 <_mm_add_ps@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1070 <_mm_add_ps@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %ebx,%esi
call   1050 <_mm_sub_ps@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <_mm_mul_ps@plt>
lea    0x20(%rsp),%rdi
mov    %eax,%esi
call   1060 <_mm_store_ps@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.x = [4 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00]
@__const.main.y = [4 x float] [float 4.000000e+00, float 3.000000e+00, float 2.000000e+00, float 1.000000e+00]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x float]
%3 = alloca [4 x float]
%4 = alloca [4 x float]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [4 x float]* %2 to i8*
%9 = bitcast [4 x float]* %3 to i8*
%10 = getelementptr inbounds [4 x float], [4 x float]* %2, i64 0, i64 0
%11 = call i32 @_mm_load_ps(float* %10)
store i32 %11, i32* %5
%12 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
%13 = call i32 @_mm_load_ps(float* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = call i32 @_mm_add_ps(i32 %15, i32 %16)
%18 = call i32 @_mm_add_ps(i32 %14, i32 %17)
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = load i32, i32* %7
%21 = load i32, i32* %5
%22 = call i32 @_mm_sub_ps(i32 %20, i32 %21)
%23 = call i32 @_mm_mul_ps(i32 %19, i32 %22)
store i32 %23, i32* %7
%24 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 0
%25 = load i32, i32* %7
%26 = call i32 @_mm_store_ps(float* %24, i32 %25)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [4 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00]
@__const.main.y = [4 x float] [float 4.000000e+00, float 3.000000e+00, float 2.000000e+00, float 1.000000e+00]
define i32 @main() {
%1 = alloca [4 x float]
%2 = alloca [4 x float]
%3 = alloca [4 x float]
%4 = bitcast [4 x float]* %1 to i8*
%5 = bitcast [4 x float]* %2 to i8*
%6 = bitcast [4 x float]* %3 to i8*
%7 = getelementptr inbounds [4 x float], [4 x float]* %1, i64 0, i64 0
%8 = call i32 @_mm_load_ps(float* %7)
%9 = getelementptr inbounds [4 x float], [4 x float]* %2, i64 0, i64 0
%10 = call i32 @_mm_load_ps(float* %9)
%11 = call i32 @_mm_add_ps(i32 %10, i32 undef)
%12 = call i32 @_mm_add_ps(i32 %8, i32 %11)
%13 = call i32 @_mm_sub_ps(i32 %12, i32 %8)
%14 = call i32 @_mm_mul_ps(i32 %12, i32 %13)
%15 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
%16 = call i32 @_mm_store_ps(float* %15, i32 %14)
ret i32 0
}