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

/* Variables and functions */
int /*<<< orphan*/ _mm256_set_epi8(int, int, int, int, int, int, int, int, int,
                                   int, int, int, int, int /*<<< orphan*/, int,
                                   int, int, int, int, int, int, int, int, int,
                                   int, int, int, int, int, int /*<<< orphan*/,
                                   int, int);
int /*<<< orphan*/ _mm256_shuffle_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((always_)) __m256i rot16(__m256i x) {
  return _mm256_shuffle_epi8(
      x, _mm256_set_epi8(13, 12, 15, 14, 9, 8, 11, 10, 5, 4, 7, 6, 1, 0, 3, 2,
                         13, 12, 15, 14, 9, 8, 11, 10, 5, 4, 7, 6, 1, 0, 3, 2));
}


x86 assembly (clang, -O0):
<rot16>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xd,%edi
mov    $0xc,%esi
mov    $0xf,%edx
mov    $0xe,%ecx
mov    $0x9,%r8d
mov    $0x8,%r9d
xor    %eax,%eax
movl   $0xb,(%rsp)
movl   $0xa,0x8(%rsp)
movl   $0x5,0x10(%rsp)
movl   $0x4,0x18(%rsp)
movl   $0x7,0x20(%rsp)
movl   $0x6,0x28(%rsp)
movl   $0x1,0x30(%rsp)
movl   $0x0,0x38(%rsp)
movl   $0x3,0x40(%rsp)
movl   $0x2,0x48(%rsp)
movl   $0xd,0x50(%rsp)
movl   $0xc,0x58(%rsp)
movl   $0xf,0x60(%rsp)
movl   $0xe,0x68(%rsp)
movl   $0x9,0x70(%rsp)
movl   $0x8,0x78(%rsp)
movl   $0xb,0x80(%rsp)
movl   $0xa,0x88(%rsp)
movl   $0x5,0x90(%rsp)
movl   $0x4,0x98(%rsp)
movl   $0x7,0xa0(%rsp)
movl   $0x6,0xa8(%rsp)
movl   $0x1,0xb0(%rsp)
movl   $0x0,0xb8(%rsp)
movl   $0x3,0xc0(%rsp)
movl   $0x2,0xc8(%rsp)
call   1030 <_mm256_set_epi8@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <_mm256_shuffle_epi8@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot16>:
push   %rbx
mov    %edi,%ebx
mov    $0xd,%edi
mov    $0xc,%esi
mov    $0xf,%edx
mov    $0xe,%ecx
mov    $0x9,%r8d
mov    $0x8,%r9d
push   $0x2
push   $0x3
push   $0x0
push   $0x1
push   $0x6
push   $0x7
push   $0x4
push   $0x5
push   $0xa
push   $0xb
push   $0x8
push   $0x9
push   $0xe
push   $0xf
push   $0xc
push   $0xd
push   $0x2
push   $0x3
push   $0x0
push   $0x1
push   $0x6
push   $0x7
push   $0x4
push   $0x5
push   $0xa
push   $0xb
call   1030 <_mm256_set_epi8@plt>
add    $0xd0,%rsp
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <_mm256_shuffle_epi8@plt>

LLVM IR (-O0):
define i32 @rot16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_mm256_set_epi8(i32 13, i32 12, i32 15, i32 14, i32 9, i32 8, i32 11, i32 10, i32 5, i32 4, i32 7, i32 6, i32 1, i32 0, i32 3, i32 2, i32 13, i32 12, i32 15, i32 14, i32 9, i32 8, i32 11, i32 10, i32 5, i32 4, i32 7, i32 6, i32 1, i32 0, i32 3, i32 2)
%5 = call i32 @_mm256_shuffle_epi8(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @rot16(i32 %0) {
%2 = tail call i32 @_mm256_set_epi8(i32 13, i32 12, i32 15, i32 14, i32 9, i32 8, i32 11, i32 10, i32 5, i32 4, i32 7, i32 6, i32 1, i32 0, i32 3, i32 2, i32 13, i32 12, i32 15, i32 14, i32 9, i32 8, i32 11, i32 10, i32 5, i32 4, i32 7, i32 6, i32 1, i32 0, i32 3, i32 2)
%3 = tail call i32 @_mm256_shuffle_epi8(i32 %0, i32 %2)
ret i32 %3
}