#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_loadu_ps(float *);
int /*<<< orphan*/ _mm_max_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_min_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_shuffle_ps(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_storeu_ps(float *, int /*<<< orphan*/);
void _bitonic_merge_kernel4core(float *a, float *b) {
  __m128 ma;
  __m128 map;
  __m128 mb;
  __m128 mbp;
  __m128 lo;
  __m128 hi;
  ma = _mm_loadu_ps(a);
  mb = _mm_loadu_ps(b);
  lo = _mm_min_ps(ma, mb);
  hi = _mm_max_ps(ma, mb);
  map = _mm_shuffle_ps(lo, hi, 0xe4);
  mbp = _mm_shuffle_ps(lo, hi, 0x4e);
  lo = _mm_min_ps(map, mbp);
  hi = _mm_max_ps(map, mbp);
  map = _mm_shuffle_ps(lo, hi, 0xd8);
  mbp = _mm_shuffle_ps(lo, hi, 0x8d);
  lo = _mm_min_ps(map, mbp);
  hi = _mm_max_ps(map, mbp);
  map = _mm_shuffle_ps(hi, lo, 0x88);
  mbp = _mm_shuffle_ps(hi, lo, 0xdd);
  map = _mm_shuffle_ps(map, map, 0x72);
  mbp = _mm_shuffle_ps(mbp, mbp, 0x72);
  _mm_storeu_ps(a, map);
  _mm_storeu_ps(b, mbp);
}


x86 assembly (clang, -O0):
<_bitonic_merge_kernel4core>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <_mm_loadu_ps@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <_mm_loadu_ps@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1050 <_mm_min_ps@plt>
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1070 <_mm_max_ps@plt>
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    $0xe4,%edx
call   1030 <_mm_shuffle_ps@plt>
mov    %eax,-0x18(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    $0x4e,%edx
call   1030 <_mm_shuffle_ps@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1050 <_mm_min_ps@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1070 <_mm_max_ps@plt>
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    $0xd8,%edx
call   1030 <_mm_shuffle_ps@plt>
mov    %eax,-0x18(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    $0x8d,%edx
call   1030 <_mm_shuffle_ps@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1050 <_mm_min_ps@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1070 <_mm_max_ps@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    $0x88,%edx
call   1030 <_mm_shuffle_ps@plt>
mov    %eax,-0x18(%rbp)
mov    -0x28(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    $0xdd,%edx
call   1030 <_mm_shuffle_ps@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    $0x72,%edx
call   1030 <_mm_shuffle_ps@plt>
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    $0x72,%edx
call   1030 <_mm_shuffle_ps@plt>
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1040 <_mm_storeu_ps@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1040 <_mm_storeu_ps@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_bitonic_merge_kernel4core>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1060 <_mm_loadu_ps@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1060 <_mm_loadu_ps@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <_mm_min_ps@plt>
mov    %eax,%r12d
mov    %ebp,%edi
mov    %ebx,%esi
call   1070 <_mm_max_ps@plt>
mov    %eax,%ebx
mov    %r12d,%edi
mov    %eax,%esi
mov    $0xe4,%edx
call   1030 <_mm_shuffle_ps@plt>
mov    %eax,%ebp
mov    %r12d,%edi
mov    %ebx,%esi
mov    $0x4e,%edx
call   1030 <_mm_shuffle_ps@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <_mm_min_ps@plt>
mov    %eax,%r12d
mov    %ebp,%edi
mov    %ebx,%esi
call   1070 <_mm_max_ps@plt>
mov    %eax,%ebx
mov    %r12d,%edi
mov    %eax,%esi
mov    $0xd8,%edx
call   1030 <_mm_shuffle_ps@plt>
mov    %eax,%ebp
mov    %r12d,%edi
mov    %ebx,%esi
mov    $0x8d,%edx
call   1030 <_mm_shuffle_ps@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <_mm_min_ps@plt>
mov    %eax,%r12d
mov    %ebp,%edi
mov    %ebx,%esi
call   1070 <_mm_max_ps@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    %r12d,%esi
mov    $0x88,%edx
call   1030 <_mm_shuffle_ps@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    %r12d,%esi
mov    $0xdd,%edx
call   1030 <_mm_shuffle_ps@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %ebp,%esi
mov    $0x72,%edx
call   1030 <_mm_shuffle_ps@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    %ebx,%esi
mov    $0x72,%edx
call   1030 <_mm_shuffle_ps@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <_mm_storeu_ps@plt>
mov    %r14,%rdi
mov    %ebx,%esi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <_mm_storeu_ps@plt>

LLVM IR (-O0):
define void @_bitonic_merge_kernel4core(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store float* %0, float** %3
store float* %1, float** %4
%11 = load float*, float** %3
%12 = call i32 @_mm_loadu_ps(float* %11)
store i32 %12, i32* %5
%13 = load float*, float** %4
%14 = call i32 @_mm_loadu_ps(float* %13)
store i32 %14, i32* %7
%15 = load i32, i32* %5
%16 = load i32, i32* %7
%17 = call i32 @_mm_min_ps(i32 %15, i32 %16)
store i32 %17, i32* %9
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = call i32 @_mm_max_ps(i32 %18, i32 %19)
store i32 %20, i32* %10
%21 = load i32, i32* %9
%22 = load i32, i32* %10
%23 = call i32 @_mm_shuffle_ps(i32 %21, i32 %22, i32 228)
store i32 %23, i32* %6
%24 = load i32, i32* %9
%25 = load i32, i32* %10
%26 = call i32 @_mm_shuffle_ps(i32 %24, i32 %25, i32 78)
store i32 %26, i32* %8
%27 = load i32, i32* %6
%28 = load i32, i32* %8
%29 = call i32 @_mm_min_ps(i32 %27, i32 %28)
store i32 %29, i32* %9
%30 = load i32, i32* %6
%31 = load i32, i32* %8
%32 = call i32 @_mm_max_ps(i32 %30, i32 %31)
store i32 %32, i32* %10
%33 = load i32, i32* %9
%34 = load i32, i32* %10
%35 = call i32 @_mm_shuffle_ps(i32 %33, i32 %34, i32 216)
store i32 %35, i32* %6
%36 = load i32, i32* %9
%37 = load i32, i32* %10
%38 = call i32 @_mm_shuffle_ps(i32 %36, i32 %37, i32 141)
store i32 %38, i32* %8
%39 = load i32, i32* %6
%40 = load i32, i32* %8
%41 = call i32 @_mm_min_ps(i32 %39, i32 %40)
store i32 %41, i32* %9
%42 = load i32, i32* %6
%43 = load i32, i32* %8
%44 = call i32 @_mm_max_ps(i32 %42, i32 %43)
store i32 %44, i32* %10
%45 = load i32, i32* %10
%46 = load i32, i32* %9
%47 = call i32 @_mm_shuffle_ps(i32 %45, i32 %46, i32 136)
store i32 %47, i32* %6
%48 = load i32, i32* %10
%49 = load i32, i32* %9
%50 = call i32 @_mm_shuffle_ps(i32 %48, i32 %49, i32 221)
store i32 %50, i32* %8
%51 = load i32, i32* %6
%52 = load i32, i32* %6
%53 = call i32 @_mm_shuffle_ps(i32 %51, i32 %52, i32 114)
store i32 %53, i32* %6
%54 = load i32, i32* %8
%55 = load i32, i32* %8
%56 = call i32 @_mm_shuffle_ps(i32 %54, i32 %55, i32 114)
store i32 %56, i32* %8
%57 = load float*, float** %3
%58 = load i32, i32* %6
%59 = call i32 @_mm_storeu_ps(float* %57, i32 %58)
%60 = load float*, float** %4
%61 = load i32, i32* %8
%62 = call i32 @_mm_storeu_ps(float* %60, i32 %61)
ret void
}

LLVM IR (-O2):
define void @_bitonic_merge_kernel4core(float* %0, float* %1) {
%3 = tail call i32 @_mm_loadu_ps(float* %0)
%4 = tail call i32 @_mm_loadu_ps(float* %1)
%5 = tail call i32 @_mm_min_ps(i32 %3, i32 %4)
%6 = tail call i32 @_mm_max_ps(i32 %3, i32 %4)
%7 = tail call i32 @_mm_shuffle_ps(i32 %5, i32 %6, i32 228)
%8 = tail call i32 @_mm_shuffle_ps(i32 %5, i32 %6, i32 78)
%9 = tail call i32 @_mm_min_ps(i32 %7, i32 %8)
%10 = tail call i32 @_mm_max_ps(i32 %7, i32 %8)
%11 = tail call i32 @_mm_shuffle_ps(i32 %9, i32 %10, i32 216)
%12 = tail call i32 @_mm_shuffle_ps(i32 %9, i32 %10, i32 141)
%13 = tail call i32 @_mm_min_ps(i32 %11, i32 %12)
%14 = tail call i32 @_mm_max_ps(i32 %11, i32 %12)
%15 = tail call i32 @_mm_shuffle_ps(i32 %14, i32 %13, i32 136)
%16 = tail call i32 @_mm_shuffle_ps(i32 %14, i32 %13, i32 221)
%17 = tail call i32 @_mm_shuffle_ps(i32 %15, i32 %15, i32 114)
%18 = tail call i32 @_mm_shuffle_ps(i32 %16, i32 %16, i32 114)
%19 = tail call i32 @_mm_storeu_ps(float* %0, i32 %17)
%20 = tail call i32 @_mm_storeu_ps(float* %1, i32 %18)
ret void
}