#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 /*<<< orphan*/, int, int,
                                   int, int, int, int, int, int, int, int, int,
                                   int, int, int, int, int /*<<< orphan*/, int,
                                   int, int);
int /*<<< orphan*/ _mm256_shuffle_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((always_)) __m256i rot8(__m256i x) {
  return _mm256_shuffle_epi8(
      x, _mm256_set_epi8(12, 15, 14, 13, 8, 11, 10, 9, 4, 7, 6, 5, 0, 3, 2, 1,
                         12, 15, 14, 13, 8, 11, 10, 9, 4, 7, 6, 5, 0, 3, 2, 1));
}


x86 assembly (clang, -O0):
<rot8>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xc,%edi
mov    $0xf,%esi
mov    $0xe,%edx
mov    $0xd,%ecx
mov    $0x8,%r8d
mov    $0xb,%r9d
xor    %eax,%eax
movl   $0xa,(%rsp)
movl   $0x9,0x8(%rsp)
movl   $0x4,0x10(%rsp)
movl   $0x7,0x18(%rsp)
movl   $0x6,0x20(%rsp)
movl   $0x5,0x28(%rsp)
movl   $0x0,0x30(%rsp)
movl   $0x3,0x38(%rsp)
movl   $0x2,0x40(%rsp)
movl   $0x1,0x48(%rsp)
movl   $0xc,0x50(%rsp)
movl   $0xf,0x58(%rsp)
movl   $0xe,0x60(%rsp)
movl   $0xd,0x68(%rsp)
movl   $0x8,0x70(%rsp)
movl   $0xb,0x78(%rsp)
movl   $0xa,0x80(%rsp)
movl   $0x9,0x88(%rsp)
movl   $0x4,0x90(%rsp)
movl   $0x7,0x98(%rsp)
movl   $0x6,0xa0(%rsp)
movl   $0x5,0xa8(%rsp)
movl   $0x0,0xb0(%rsp)
movl   $0x3,0xb8(%rsp)
movl   $0x2,0xc0(%rsp)
movl   $0x1,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):
<rot8>:
push   %rbx
mov    %edi,%ebx
mov    $0xc,%edi
mov    $0xf,%esi
mov    $0xe,%edx
mov    $0xd,%ecx
mov    $0x8,%r8d
mov    $0xb,%r9d
push   $0x1
push   $0x2
push   $0x3
push   $0x0
push   $0x5
push   $0x6
push   $0x7
push   $0x4
push   $0x9
push   $0xa
push   $0xb
push   $0x8
push   $0xd
push   $0xe
push   $0xf
push   $0xc
push   $0x1
push   $0x2
push   $0x3
push   $0x0
push   $0x5
push   $0x6
push   $0x7
push   $0x4
push   $0x9
push   $0xa
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 @rot8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_mm256_set_epi8(i32 12, i32 15, i32 14, i32 13, i32 8, i32 11, i32 10, i32 9, i32 4, i32 7, i32 6, i32 5, i32 0, i32 3, i32 2, i32 1, i32 12, i32 15, i32 14, i32 13, i32 8, i32 11, i32 10, i32 9, i32 4, i32 7, i32 6, i32 5, i32 0, i32 3, i32 2, i32 1)
%5 = call i32 @_mm256_shuffle_epi8(i32 %3, i32 %4)
ret i32 %5
}

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