#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*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_slli_si128(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_srli_si128(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_unpackhi_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_unpackhi_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_unpackhi_epi64(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_unpacklo_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_unpacklo_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_unpacklo_epi64(int /*<<< orphan*/, int /*<<< orphan*/);
void highbd_transpose6x6_sse2(__m128i *x0, __m128i *x1, __m128i *x2,
                              __m128i *x3, __m128i *x4, __m128i *x5,
                              __m128i *d0, __m128i *d1, __m128i *d2,
                              __m128i *d3, __m128i *d4, __m128i *d5) {
  __m128i w0, w1, w2, w3, w4, w5, ww0;
  w0 = _mm_unpacklo_epi16(*x0, *x1);
  w1 = _mm_unpacklo_epi16(*x2, *x3);
  w2 = _mm_unpacklo_epi16(*x4, *x5);
  ww0 = _mm_unpacklo_epi32(w0, w1);
  *d0 = _mm_unpacklo_epi64(ww0, w2);
  *d1 = _mm_unpackhi_epi64(ww0, _mm_srli_si128(w2, 4));
  ww0 = _mm_unpackhi_epi32(w0, w1);
  *d2 = _mm_unpacklo_epi64(ww0, _mm_srli_si128(w2, 8));
  w3 = _mm_unpackhi_epi16(*x0, *x1);
  w4 = _mm_unpackhi_epi16(*x2, *x3);
  w5 = _mm_unpackhi_epi16(*x4, *x5);
  *d3 = _mm_unpackhi_epi64(ww0, _mm_srli_si128(w2, 4));
  ww0 = _mm_unpacklo_epi32(w3, w4);
  *d4 = _mm_unpacklo_epi64(ww0, w5);
  *d5 = _mm_unpackhi_epi64(ww0, _mm_slli_si128(w5, 4));
}


x86 assembly (clang, -O0):
<highbd_transpose6x6_sse2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1070 <_mm_unpacklo_epi16@plt>
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
call   1070 <_mm_unpacklo_epi16@plt>
mov    %eax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rax
mov    (%rax),%esi
call   1070 <_mm_unpacklo_epi16@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x34(%rbp),%edi
mov    -0x38(%rbp),%esi
call   1030 <_mm_unpacklo_epi32@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%edi
mov    -0x3c(%rbp),%esi
call   1080 <_mm_unpacklo_epi64@plt>
mov    %eax,%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4c(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x3c(%rbp),%edi
mov    $0x4,%esi
call   1060 <_mm_srli_si128@plt>
mov    -0x5c(%rbp),%edi
mov    %eax,%esi
call   1050 <_mm_unpackhi_epi64@plt>
mov    %eax,%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x34(%rbp),%edi
mov    -0x38(%rbp),%esi
call   10a0 <_mm_unpackhi_epi32@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x3c(%rbp),%edi
mov    $0x8,%esi
call   1060 <_mm_srli_si128@plt>
mov    -0x58(%rbp),%edi
mov    %eax,%esi
call   1080 <_mm_unpacklo_epi64@plt>
mov    %eax,%ecx
mov    0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1040 <_mm_unpackhi_epi16@plt>
mov    %eax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
call   1040 <_mm_unpackhi_epi16@plt>
mov    %eax,-0x44(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rax
mov    (%rax),%esi
call   1040 <_mm_unpackhi_epi16@plt>
mov    %eax,-0x48(%rbp)
mov    -0x4c(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x3c(%rbp),%edi
mov    $0x4,%esi
call   1060 <_mm_srli_si128@plt>
mov    -0x54(%rbp),%edi
mov    %eax,%esi
call   1050 <_mm_unpackhi_epi64@plt>
mov    %eax,%ecx
mov    0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x40(%rbp),%edi
mov    -0x44(%rbp),%esi
call   1030 <_mm_unpacklo_epi32@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%edi
mov    -0x48(%rbp),%esi
call   1080 <_mm_unpacklo_epi64@plt>
mov    %eax,%ecx
mov    0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4c(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x48(%rbp),%edi
mov    $0x4,%esi
call   1090 <_mm_slli_si128@plt>
mov    -0x50(%rbp),%edi
mov    %eax,%esi
call   1050 <_mm_unpackhi_epi64@plt>
mov    %eax,%ecx
mov    0x38(%rbp),%rax
mov    %ecx,(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<highbd_transpose6x6_sse2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,%r14
mov    %r8,%r13
mov    %r8,0x20(%rsp)
mov    %rcx,%rbx
mov    %rcx,0x18(%rsp)
mov    %rdx,%rbp
mov    %rsi,0x10(%rsp)
mov    %rdi,0x8(%rsp)
mov    (%rdi),%edi
mov    (%rsi),%esi
call   1070 <_mm_unpacklo_epi16@plt>
mov    %eax,%r15d
mov    0x0(%rbp),%edi
mov    (%rbx),%esi
call   1070 <_mm_unpacklo_epi16@plt>
mov    %eax,%r12d
mov    0x0(%r13),%edi
mov    (%r14),%esi
mov    %r14,%r13
call   1070 <_mm_unpacklo_epi16@plt>
mov    %eax,%r14d
mov    %r15d,%edi
mov    %r12d,%esi
call   1030 <_mm_unpacklo_epi32@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    %r14d,%esi
call   1080 <_mm_unpacklo_epi64@plt>
mov    0x60(%rsp),%rcx
mov    %eax,(%rcx)
mov    %r14d,%edi
mov    $0x4,%esi
call   1060 <_mm_srli_si128@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <_mm_unpackhi_epi64@plt>
mov    0x68(%rsp),%rcx
mov    %eax,(%rcx)
mov    %r15d,%edi
mov    %r12d,%esi
call   10a0 <_mm_unpackhi_epi32@plt>
mov    %eax,%r15d
mov    %r14d,%edi
mov    $0x8,%esi
call   1060 <_mm_srli_si128@plt>
mov    %r15d,%edi
mov    %eax,%esi
call   1080 <_mm_unpacklo_epi64@plt>
mov    0x70(%rsp),%rcx
mov    %eax,(%rcx)
mov    0x8(%rsp),%rax
mov    (%rax),%edi
mov    0x10(%rsp),%rax
mov    (%rax),%esi
call   1040 <_mm_unpackhi_epi16@plt>
mov    %eax,%r12d
mov    0x0(%rbp),%edi
mov    0x18(%rsp),%rax
mov    (%rax),%esi
call   1040 <_mm_unpackhi_epi16@plt>
mov    %eax,%ebp
mov    0x20(%rsp),%rax
mov    (%rax),%edi
mov    0x0(%r13),%esi
call   1040 <_mm_unpackhi_epi16@plt>
mov    %eax,%ebx
mov    %r14d,%edi
mov    $0x4,%esi
call   1060 <_mm_srli_si128@plt>
mov    %r15d,%edi
mov    %eax,%esi
call   1050 <_mm_unpackhi_epi64@plt>
mov    0x78(%rsp),%rcx
mov    %eax,(%rcx)
mov    %r12d,%edi
mov    %ebp,%esi
call   1030 <_mm_unpacklo_epi32@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %ebx,%esi
call   1080 <_mm_unpacklo_epi64@plt>
mov    0x80(%rsp),%rcx
mov    %eax,(%rcx)
mov    %ebx,%edi
mov    $0x4,%esi
call   1090 <_mm_slli_si128@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <_mm_unpackhi_epi64@plt>
mov    0x88(%rsp),%rcx
mov    %eax,(%rcx)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @highbd_transpose6x6_sse2(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i32* %11) {
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca i32*
%21 = alloca i32*
%22 = alloca i32*
%23 = alloca i32*
%24 = alloca i32*
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
store i32* %0, i32** %13
store i32* %1, i32** %14
store i32* %2, i32** %15
store i32* %3, i32** %16
store i32* %4, i32** %17
store i32* %5, i32** %18
store i32* %6, i32** %19
store i32* %7, i32** %20
store i32* %8, i32** %21
store i32* %9, i32** %22
store i32* %10, i32** %23
store i32* %11, i32** %24
%32 = load i32*, i32** %13
%33 = load i32, i32* %32
%34 = load i32*, i32** %14
%35 = load i32, i32* %34
%36 = call i32 @_mm_unpacklo_epi16(i32 %33, i32 %35)
store i32 %36, i32* %25
%37 = load i32*, i32** %15
%38 = load i32, i32* %37
%39 = load i32*, i32** %16
%40 = load i32, i32* %39
%41 = call i32 @_mm_unpacklo_epi16(i32 %38, i32 %40)
store i32 %41, i32* %26
%42 = load i32*, i32** %17
%43 = load i32, i32* %42
%44 = load i32*, i32** %18
%45 = load i32, i32* %44
%46 = call i32 @_mm_unpacklo_epi16(i32 %43, i32 %45)
store i32 %46, i32* %27
%47 = load i32, i32* %25
%48 = load i32, i32* %26
%49 = call i32 @_mm_unpacklo_epi32(i32 %47, i32 %48)
store i32 %49, i32* %31
%50 = load i32, i32* %31
%51 = load i32, i32* %27
%52 = call i32 @_mm_unpacklo_epi64(i32 %50, i32 %51)
%53 = load i32*, i32** %19
store i32 %52, i32* %53
%54 = load i32, i32* %31
%55 = load i32, i32* %27
%56 = call i32 @_mm_srli_si128(i32 %55, i32 4)
%57 = call i32 @_mm_unpackhi_epi64(i32 %54, i32 %56)
%58 = load i32*, i32** %20
store i32 %57, i32* %58
%59 = load i32, i32* %25
%60 = load i32, i32* %26
%61 = call i32 @_mm_unpackhi_epi32(i32 %59, i32 %60)
store i32 %61, i32* %31
%62 = load i32, i32* %31
%63 = load i32, i32* %27
%64 = call i32 @_mm_srli_si128(i32 %63, i32 8)
%65 = call i32 @_mm_unpacklo_epi64(i32 %62, i32 %64)
%66 = load i32*, i32** %21
store i32 %65, i32* %66
%67 = load i32*, i32** %13
%68 = load i32, i32* %67
%69 = load i32*, i32** %14
%70 = load i32, i32* %69
%71 = call i32 @_mm_unpackhi_epi16(i32 %68, i32 %70)
store i32 %71, i32* %28
%72 = load i32*, i32** %15
%73 = load i32, i32* %72
%74 = load i32*, i32** %16
%75 = load i32, i32* %74
%76 = call i32 @_mm_unpackhi_epi16(i32 %73, i32 %75)
store i32 %76, i32* %29
%77 = load i32*, i32** %17
%78 = load i32, i32* %77
%79 = load i32*, i32** %18
%80 = load i32, i32* %79
%81 = call i32 @_mm_unpackhi_epi16(i32 %78, i32 %80)
store i32 %81, i32* %30
%82 = load i32, i32* %31
%83 = load i32, i32* %27
%84 = call i32 @_mm_srli_si128(i32 %83, i32 4)
%85 = call i32 @_mm_unpackhi_epi64(i32 %82, i32 %84)
%86 = load i32*, i32** %22
store i32 %85, i32* %86
%87 = load i32, i32* %28
%88 = load i32, i32* %29
%89 = call i32 @_mm_unpacklo_epi32(i32 %87, i32 %88)
store i32 %89, i32* %31
%90 = load i32, i32* %31
%91 = load i32, i32* %30
%92 = call i32 @_mm_unpacklo_epi64(i32 %90, i32 %91)
%93 = load i32*, i32** %23
store i32 %92, i32* %93
%94 = load i32, i32* %31
%95 = load i32, i32* %30
%96 = call i32 @_mm_slli_si128(i32 %95, i32 4)
%97 = call i32 @_mm_unpackhi_epi64(i32 %94, i32 %96)
%98 = load i32*, i32** %24
store i32 %97, i32* %98
ret void
}

LLVM IR (-O2):
define void @highbd_transpose6x6_sse2(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5, i32* nocapture writeonly %6, i32* nocapture writeonly %7, i32* nocapture writeonly %8, i32* nocapture writeonly %9, i32* nocapture writeonly %10, i32* nocapture writeonly %11) {
%13 = load i32, i32* %0
%14 = load i32, i32* %1
%15 = tail call i32 @_mm_unpacklo_epi16(i32 %13, i32 %14)
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = tail call i32 @_mm_unpacklo_epi16(i32 %16, i32 %17)
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = tail call i32 @_mm_unpacklo_epi16(i32 %19, i32 %20)
%22 = tail call i32 @_mm_unpacklo_epi32(i32 %15, i32 %18)
%23 = tail call i32 @_mm_unpacklo_epi64(i32 %22, i32 %21)
store i32 %23, i32* %6
%24 = tail call i32 @_mm_srli_si128(i32 %21, i32 4)
%25 = tail call i32 @_mm_unpackhi_epi64(i32 %22, i32 %24)
store i32 %25, i32* %7
%26 = tail call i32 @_mm_unpackhi_epi32(i32 %15, i32 %18)
%27 = tail call i32 @_mm_srli_si128(i32 %21, i32 8)
%28 = tail call i32 @_mm_unpacklo_epi64(i32 %26, i32 %27)
store i32 %28, i32* %8
%29 = load i32, i32* %0
%30 = load i32, i32* %1
%31 = tail call i32 @_mm_unpackhi_epi16(i32 %29, i32 %30)
%32 = load i32, i32* %2
%33 = load i32, i32* %3
%34 = tail call i32 @_mm_unpackhi_epi16(i32 %32, i32 %33)
%35 = load i32, i32* %4
%36 = load i32, i32* %5
%37 = tail call i32 @_mm_unpackhi_epi16(i32 %35, i32 %36)
%38 = tail call i32 @_mm_srli_si128(i32 %21, i32 4)
%39 = tail call i32 @_mm_unpackhi_epi64(i32 %26, i32 %38)
store i32 %39, i32* %9
%40 = tail call i32 @_mm_unpacklo_epi32(i32 %31, i32 %34)
%41 = tail call i32 @_mm_unpacklo_epi64(i32 %40, i32 %37)
store i32 %41, i32* %10
%42 = tail call i32 @_mm_slli_si128(i32 %37, i32 4)
%43 = tail call i32 @_mm_unpackhi_epi64(i32 %40, i32 %42)
store i32 %43, i32* %11
ret void
}