#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 uint32_t;
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
int /*<<< orphan*/ _mm256_and_si256(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm256_set1_epi32(int);
int /*<<< orphan*/ _mm256_set_epi32(int const, int const, int const, int const,
                                    int const, int const, int const, int const);
int /*<<< orphan*/ _mm256_srlv_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm256_storeu_si256(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/);
const uint32_t *unpack21_32_avx2(const uint32_t *in, uint32_t *out) {
  uint32_t mask = 0x1fffff;
  __m256i reg_shifts, reg_inls, reg_masks;
  __m256i results;
  reg_masks = _mm256_set1_epi32(mask);
  reg_shifts = _mm256_set_epi32(0, 0, 9, 0, 0, 10, 0, 0);
  reg_inls = _mm256_set_epi32(
      in[4] >> 19 | in[5] << 13, in[3] >> 30 | in[4] << 2, in[3],
      in[2] >> 20 | in[3] << 12, in[1] >> 31 | in[2] << 1, in[1],
      in[0] >> 21 | in[1] << 11, in[0]);
  results =
      _mm256_and_si256(_mm256_srlv_epi32(reg_inls, reg_shifts), reg_masks);
  _mm256_storeu_si256((__m256i *)(out), results);
  out += 8;
  reg_shifts = _mm256_set_epi32(0, 6, 0, 0, 7, 0, 0, 8);
  reg_inls = _mm256_set_epi32(
      in[9] >> 27 | in[10] << 5, in[9], in[8] >> 17 | in[9] << 15,
      in[7] >> 28 | in[8] << 4, in[7], in[6] >> 18 | in[7] << 14,
      in[5] >> 29 | in[6] << 3, in[5]);
  results =
      _mm256_and_si256(_mm256_srlv_epi32(reg_inls, reg_shifts), reg_masks);
  _mm256_storeu_si256((__m256i *)(out), results);
  out += 8;
  reg_shifts = _mm256_set_epi32(3, 0, 0, 4, 0, 0, 5, 0);
  reg_inls = _mm256_set_epi32(
      in[15], in[14] >> 14 | in[15] << 18, in[13] >> 25 | in[14] << 7, in[13],
      in[12] >> 15 | in[13] << 17, in[11] >> 26 | in[12] << 6, in[11],
      in[10] >> 16 | in[11] << 16);
  results =
      _mm256_and_si256(_mm256_srlv_epi32(reg_inls, reg_shifts), reg_masks);
  _mm256_storeu_si256((__m256i *)(out), results);
  out += 8;
  reg_shifts = _mm256_set_epi32(11, 0, 1, 0, 0, 2, 0, 0);
  reg_inls = _mm256_set_epi32(
      in[20], in[19] >> 22 | in[20] << 10, in[19], in[18] >> 12 | in[19] << 20,
      in[17] >> 23 | in[18] << 9, in[17], in[16] >> 13 | in[17] << 19,
      in[15] >> 24 | in[16] << 8);
  results =
      _mm256_and_si256(_mm256_srlv_epi32(reg_inls, reg_shifts), reg_masks);
  _mm256_storeu_si256((__m256i *)(out), results);
  out += 8;
  in += 21;
  return in;
}


x86 assembly (clang, -O0):
<unpack21_32_avx2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1fffff,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <_mm256_set1_epi32@plt>
mov    %eax,-0x20(%rbp)
xor    %r8d,%r8d
mov    $0x9,%edx
mov    $0xa,%r9d
mov    %r8d,%edi
mov    %r8d,%esi
mov    %r8d,%ecx
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1070 <_mm256_set_epi32@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%edi
sar    $0x13,%edi
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
shl    $0xd,%eax
or     %eax,%edi
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%esi
sar    $0x1e,%esi
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
shl    $0x2,%eax
or     %eax,%esi
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
sar    $0x14,%ecx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
shl    $0xc,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%r8d
sar    $0x1f,%r8d
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x1,%eax
or     %eax,%r8d
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%r9d
mov    -0x8(%rbp),%rax
mov    (%rax),%r10d
sar    $0x15,%r10d
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0xb,%eax
or     %eax,%r10d
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1070 <_mm256_set_epi32@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1060 <_mm256_srlv_epi32@plt>
mov    %eax,%edi
mov    -0x20(%rbp),%esi
call   1040 <_mm256_and_si256@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <_mm256_storeu_si256@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x10(%rbp)
xor    %r9d,%r9d
mov    $0x6,%esi
mov    $0x7,%r8d
mov    %r9d,%edi
mov    %r9d,%edx
mov    %r9d,%ecx
movl   $0x0,(%rsp)
movl   $0x8,0x8(%rsp)
call   1070 <_mm256_set_epi32@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%edi
sar    $0x1b,%edi
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%eax
shl    $0x5,%eax
or     %eax,%edi
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%edx
sar    $0x11,%edx
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%eax
shl    $0xf,%eax
or     %eax,%edx
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%ecx
sar    $0x1c,%ecx
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%eax
shl    $0x4,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%r8d
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%r9d
sar    $0x12,%r9d
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%eax
shl    $0xe,%eax
or     %eax,%r9d
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%r10d
sar    $0x1d,%r10d
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
shl    $0x3,%eax
or     %eax,%r10d
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1070 <_mm256_set_epi32@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1060 <_mm256_srlv_epi32@plt>
mov    %eax,%edi
mov    -0x20(%rbp),%esi
call   1040 <_mm256_and_si256@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <_mm256_storeu_si256@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x10(%rbp)
mov    $0x3,%edi
xor    %r9d,%r9d
mov    $0x4,%ecx
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%r8d
movl   $0x5,(%rsp)
movl   $0x0,0x8(%rsp)
call   1070 <_mm256_set_epi32@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3c(%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%esi
sar    $0xe,%esi
mov    -0x8(%rbp),%rax
mov    0x3c(%rax),%eax
shl    $0x12,%eax
or     %eax,%esi
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%edx
sar    $0x19,%edx
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%eax
shl    $0x7,%eax
or     %eax,%edx
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%r8d
sar    $0xf,%r8d
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%eax
shl    $0x11,%eax
or     %eax,%r8d
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%r9d
sar    $0x1a,%r9d
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%eax
shl    $0x6,%eax
or     %eax,%r9d
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%r10d
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%eax
sar    $0x10,%eax
mov    -0x8(%rbp),%r11
mov    0x2c(%r11),%r11d
shl    $0x10,%r11d
or     %r11d,%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1070 <_mm256_set_epi32@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1060 <_mm256_srlv_epi32@plt>
mov    %eax,%edi
mov    -0x20(%rbp),%esi
call   1040 <_mm256_and_si256@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <_mm256_storeu_si256@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x10(%rbp)
mov    $0xb,%edi
xor    %r8d,%r8d
mov    $0x1,%edx
mov    $0x2,%r9d
mov    %r8d,%esi
mov    %r8d,%ecx
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1070 <_mm256_set_epi32@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x50(%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x4c(%rax),%esi
sar    $0x16,%esi
mov    -0x8(%rbp),%rax
mov    0x50(%rax),%eax
shl    $0xa,%eax
or     %eax,%esi
mov    -0x8(%rbp),%rax
mov    0x4c(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x48(%rax),%ecx
sar    $0xc,%ecx
mov    -0x8(%rbp),%rax
mov    0x4c(%rax),%eax
shl    $0x14,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    0x44(%rax),%r8d
sar    $0x17,%r8d
mov    -0x8(%rbp),%rax
mov    0x48(%rax),%eax
shl    $0x9,%eax
or     %eax,%r8d
mov    -0x8(%rbp),%rax
mov    0x44(%rax),%r9d
mov    -0x8(%rbp),%rax
mov    0x40(%rax),%r10d
sar    $0xd,%r10d
mov    -0x8(%rbp),%rax
mov    0x44(%rax),%eax
shl    $0x13,%eax
or     %eax,%r10d
mov    -0x8(%rbp),%rax
mov    0x3c(%rax),%eax
sar    $0x18,%eax
mov    -0x8(%rbp),%r11
mov    0x40(%r11),%r11d
shl    $0x8,%r11d
or     %r11d,%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1070 <_mm256_set_epi32@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1060 <_mm256_srlv_epi32@plt>
mov    %eax,%edi
mov    -0x20(%rbp),%esi
call   1040 <_mm256_and_si256@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <_mm256_storeu_si256@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x54,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack21_32_avx2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x1fffff,%edi
call   1050 <_mm256_set1_epi32@plt>
mov    %eax,%ebx
xor    %edi,%edi
xor    %esi,%esi
mov    $0x9,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0xa,%r9d
push   $0x0
push   $0x0
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r12d
mov    0x10(%r15),%esi
mov    %esi,%eax
sar    $0x13,%eax
mov    0x14(%r15),%edi
shl    $0xd,%edi
or     %eax,%edi
mov    0xc(%r15),%edx
mov    %edx,%eax
sar    $0x1e,%eax
shl    $0x2,%esi
or     %eax,%esi
mov    0x8(%r15),%r8d
mov    %r8d,%eax
sar    $0x14,%eax
mov    %edx,%ecx
shl    $0xc,%ecx
or     %eax,%ecx
mov    (%r15),%r10d
mov    0x4(%r15),%r9d
mov    %r9d,%ebp
sar    $0x1f,%ebp
add    %r8d,%r8d
or     %ebp,%r8d
mov    %r10d,%ebp
sar    $0x15,%ebp
mov    %r9d,%eax
shl    $0xb,%eax
or     %ebp,%eax
push   %r10
push   %rax
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%edi
mov    %r12d,%esi
call   1060 <_mm256_srlv_epi32@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <_mm256_and_si256@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <_mm256_storeu_si256@plt>
lea    0x20(%r14),%r12
xor    %edi,%edi
mov    $0x6,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x7,%r8d
xor    %r9d,%r9d
push   $0x8
push   $0x0
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r13d
mov    0x24(%r15),%esi
mov    %esi,%eax
sar    $0x1b,%eax
mov    0x28(%r15),%edi
shl    $0x5,%edi
or     %eax,%edi
mov    0x20(%r15),%ecx
mov    %ecx,%eax
sar    $0x11,%eax
mov    %esi,%edx
shl    $0xf,%edx
or     %eax,%edx
mov    0x1c(%r15),%r8d
mov    %r8d,%eax
sar    $0x1c,%eax
shl    $0x4,%ecx
or     %eax,%ecx
mov    0x14(%r15),%r10d
mov    0x18(%r15),%ebp
mov    %ebp,%eax
sar    $0x12,%eax
mov    %r8d,%r9d
shl    $0xe,%r9d
or     %eax,%r9d
mov    %r10d,%eax
sar    $0x1d,%eax
shl    $0x3,%ebp
or     %eax,%ebp
push   %r10
push   %rbp
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%edi
mov    %r13d,%esi
call   1060 <_mm256_srlv_epi32@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <_mm256_and_si256@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1030 <_mm256_storeu_si256@plt>
lea    0x40(%r14),%r12
mov    $0x3,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x4,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x5
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r13d
mov    0x3c(%r15),%edi
mov    0x38(%r15),%edx
mov    %edx,%eax
sar    $0xe,%eax
mov    %edi,%esi
shl    $0x12,%esi
or     %eax,%esi
mov    0x34(%r15),%ecx
mov    %ecx,%eax
sar    $0x19,%eax
shl    $0x7,%edx
or     %eax,%edx
mov    0x2c(%r15),%r10d
mov    0x30(%r15),%r9d
mov    %r9d,%ebp
sar    $0xf,%ebp
mov    %ecx,%r8d
shl    $0x11,%r8d
or     %ebp,%r8d
mov    %r10d,%ebp
sar    $0x1a,%ebp
shl    $0x6,%r9d
or     %ebp,%r9d
movswl 0x2a(%r15),%ebp
mov    %r10d,%eax
shl    $0x10,%eax
or     %ebp,%eax
push   %rax
push   %r10
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%edi
mov    %r13d,%esi
call   1060 <_mm256_srlv_epi32@plt>
mov    %eax,%edi
mov    %ebx,%r13d
mov    %ebx,%esi
call   1040 <_mm256_and_si256@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1030 <_mm256_storeu_si256@plt>
add    $0x60,%r14
mov    $0xb,%edi
xor    %esi,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0x2,%r9d
push   $0x0
push   $0x0
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r12d
mov    0x50(%r15),%edi
mov    0x4c(%r15),%edx
mov    %edx,%eax
sar    $0x16,%eax
mov    %edi,%esi
shl    $0xa,%esi
or     %eax,%esi
mov    0x48(%r15),%r8d
mov    %r8d,%eax
sar    $0xc,%eax
mov    %edx,%ecx
shl    $0x14,%ecx
or     %eax,%ecx
mov    0x40(%r15),%eax
mov    0x44(%r15),%r9d
mov    %r9d,%ebp
sar    $0x17,%ebp
shl    $0x9,%r8d
or     %ebp,%r8d
mov    %eax,%ebp
sar    $0xd,%ebp
mov    %r9d,%ebx
shl    $0x13,%ebx
or     %ebp,%ebx
movsbl 0x3f(%r15),%ebp
shl    $0x8,%eax
or     %ebp,%eax
push   %rax
push   %rbx
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%edi
mov    %r12d,%esi
call   1060 <_mm256_srlv_epi32@plt>
mov    %eax,%edi
mov    %r13d,%esi
call   1040 <_mm256_and_si256@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <_mm256_storeu_si256@plt>
add    $0x54,%r15
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32* @unpack21_32_avx2(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 2097151, i32* %5
%10 = load i32, i32* %5
%11 = call i32 @_mm256_set1_epi32(i32 %10)
store i32 %11, i32* %8
%12 = call i32 @_mm256_set_epi32(i32 0, i32 0, i32 9, i32 0, i32 0, i32 10, i32 0, i32 0)
store i32 %12, i32* %6
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 4
%15 = load i32, i32* %14
%16 = ashr i32 %15, 19
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 5
%19 = load i32, i32* %18
%20 = shl i32 %19, 13
%21 = or i32 %16, %20
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 3
%24 = load i32, i32* %23
%25 = ashr i32 %24, 30
%26 = load i32*, i32** %3
%27 = getelementptr inbounds i32, i32* %26, i64 4
%28 = load i32, i32* %27
%29 = shl i32 %28, 2
%30 = or i32 %25, %29
%31 = load i32*, i32** %3
%32 = getelementptr inbounds i32, i32* %31, i64 3
%33 = load i32, i32* %32
%34 = load i32*, i32** %3
%35 = getelementptr inbounds i32, i32* %34, i64 2
%36 = load i32, i32* %35
%37 = ashr i32 %36, 20
%38 = load i32*, i32** %3
%39 = getelementptr inbounds i32, i32* %38, i64 3
%40 = load i32, i32* %39
%41 = shl i32 %40, 12
%42 = or i32 %37, %41
%43 = load i32*, i32** %3
%44 = getelementptr inbounds i32, i32* %43, i64 1
%45 = load i32, i32* %44
%46 = ashr i32 %45, 31
%47 = load i32*, i32** %3
%48 = getelementptr inbounds i32, i32* %47, i64 2
%49 = load i32, i32* %48
%50 = shl i32 %49, 1
%51 = or i32 %46, %50
%52 = load i32*, i32** %3
%53 = getelementptr inbounds i32, i32* %52, i64 1
%54 = load i32, i32* %53
%55 = load i32*, i32** %3
%56 = getelementptr inbounds i32, i32* %55, i64 0
%57 = load i32, i32* %56
%58 = ashr i32 %57, 21
%59 = load i32*, i32** %3
%60 = getelementptr inbounds i32, i32* %59, i64 1
%61 = load i32, i32* %60
%62 = shl i32 %61, 11
%63 = or i32 %58, %62
%64 = load i32*, i32** %3
%65 = getelementptr inbounds i32, i32* %64, i64 0
%66 = load i32, i32* %65
%67 = call i32 @_mm256_set_epi32(i32 %21, i32 %30, i32 %33, i32 %42, i32 %51, i32 %54, i32 %63, i32 %66)
store i32 %67, i32* %7
%68 = load i32, i32* %7
%69 = load i32, i32* %6
%70 = call i32 @_mm256_srlv_epi32(i32 %68, i32 %69)
%71 = load i32, i32* %8
%72 = call i32 @_mm256_and_si256(i32 %70, i32 %71)
store i32 %72, i32* %9
%73 = load i32*, i32** %4
%74 = load i32, i32* %9
%75 = call i32 @_mm256_storeu_si256(i32* %73, i32 %74)
%76 = load i32*, i32** %4
%77 = getelementptr inbounds i32, i32* %76, i64 8
store i32* %77, i32** %4
%78 = call i32 @_mm256_set_epi32(i32 0, i32 6, i32 0, i32 0, i32 7, i32 0, i32 0, i32 8)
store i32 %78, i32* %6
%79 = load i32*, i32** %3
%80 = getelementptr inbounds i32, i32* %79, i64 9
%81 = load i32, i32* %80
%82 = ashr i32 %81, 27
%83 = load i32*, i32** %3
%84 = getelementptr inbounds i32, i32* %83, i64 10
%85 = load i32, i32* %84
%86 = shl i32 %85, 5
%87 = or i32 %82, %86
%88 = load i32*, i32** %3
%89 = getelementptr inbounds i32, i32* %88, i64 9
%90 = load i32, i32* %89
%91 = load i32*, i32** %3
%92 = getelementptr inbounds i32, i32* %91, i64 8
%93 = load i32, i32* %92
%94 = ashr i32 %93, 17
%95 = load i32*, i32** %3
%96 = getelementptr inbounds i32, i32* %95, i64 9
%97 = load i32, i32* %96
%98 = shl i32 %97, 15
%99 = or i32 %94, %98
%100 = load i32*, i32** %3
%101 = getelementptr inbounds i32, i32* %100, i64 7
%102 = load i32, i32* %101
%103 = ashr i32 %102, 28
%104 = load i32*, i32** %3
%105 = getelementptr inbounds i32, i32* %104, i64 8
%106 = load i32, i32* %105
%107 = shl i32 %106, 4
%108 = or i32 %103, %107
%109 = load i32*, i32** %3
%110 = getelementptr inbounds i32, i32* %109, i64 7
%111 = load i32, i32* %110
%112 = load i32*, i32** %3
%113 = getelementptr inbounds i32, i32* %112, i64 6
%114 = load i32, i32* %113
%115 = ashr i32 %114, 18
%116 = load i32*, i32** %3
%117 = getelementptr inbounds i32, i32* %116, i64 7
%118 = load i32, i32* %117
%119 = shl i32 %118, 14
%120 = or i32 %115, %119
%121 = load i32*, i32** %3
%122 = getelementptr inbounds i32, i32* %121, i64 5
%123 = load i32, i32* %122
%124 = ashr i32 %123, 29
%125 = load i32*, i32** %3
%126 = getelementptr inbounds i32, i32* %125, i64 6
%127 = load i32, i32* %126
%128 = shl i32 %127, 3
%129 = or i32 %124, %128
%130 = load i32*, i32** %3
%131 = getelementptr inbounds i32, i32* %130, i64 5
%132 = load i32, i32* %131
%133 = call i32 @_mm256_set_epi32(i32 %87, i32 %90, i32 %99, i32 %108, i32 %111, i32 %120, i32 %129, i32 %132)
store i32 %133, i32* %7
%134 = load i32, i32* %7
%135 = load i32, i32* %6
%136 = call i32 @_mm256_srlv_epi32(i32 %134, i32 %135)
%137 = load i32, i32* %8
%138 = call i32 @_mm256_and_si256(i32 %136, i32 %137)
store i32 %138, i32* %9
%139 = load i32*, i32** %4
%140 = load i32, i32* %9
%141 = call i32 @_mm256_storeu_si256(i32* %139, i32 %140)
%142 = load i32*, i32** %4
%143 = getelementptr inbounds i32, i32* %142, i64 8
store i32* %143, i32** %4
%144 = call i32 @_mm256_set_epi32(i32 3, i32 0, i32 0, i32 4, i32 0, i32 0, i32 5, i32 0)
store i32 %144, i32* %6
%145 = load i32*, i32** %3
%146 = getelementptr inbounds i32, i32* %145, i64 15
%147 = load i32, i32* %146
%148 = load i32*, i32** %3
%149 = getelementptr inbounds i32, i32* %148, i64 14
%150 = load i32, i32* %149
%151 = ashr i32 %150, 14
%152 = load i32*, i32** %3
%153 = getelementptr inbounds i32, i32* %152, i64 15
%154 = load i32, i32* %153
%155 = shl i32 %154, 18
%156 = or i32 %151, %155
%157 = load i32*, i32** %3
%158 = getelementptr inbounds i32, i32* %157, i64 13
%159 = load i32, i32* %158
%160 = ashr i32 %159, 25
%161 = load i32*, i32** %3
%162 = getelementptr inbounds i32, i32* %161, i64 14
%163 = load i32, i32* %162
%164 = shl i32 %163, 7
%165 = or i32 %160, %164
%166 = load i32*, i32** %3
%167 = getelementptr inbounds i32, i32* %166, i64 13
%168 = load i32, i32* %167
%169 = load i32*, i32** %3
%170 = getelementptr inbounds i32, i32* %169, i64 12
%171 = load i32, i32* %170
%172 = ashr i32 %171, 15
%173 = load i32*, i32** %3
%174 = getelementptr inbounds i32, i32* %173, i64 13
%175 = load i32, i32* %174
%176 = shl i32 %175, 17
%177 = or i32 %172, %176
%178 = load i32*, i32** %3
%179 = getelementptr inbounds i32, i32* %178, i64 11
%180 = load i32, i32* %179
%181 = ashr i32 %180, 26
%182 = load i32*, i32** %3
%183 = getelementptr inbounds i32, i32* %182, i64 12
%184 = load i32, i32* %183
%185 = shl i32 %184, 6
%186 = or i32 %181, %185
%187 = load i32*, i32** %3
%188 = getelementptr inbounds i32, i32* %187, i64 11
%189 = load i32, i32* %188
%190 = load i32*, i32** %3
%191 = getelementptr inbounds i32, i32* %190, i64 10
%192 = load i32, i32* %191
%193 = ashr i32 %192, 16
%194 = load i32*, i32** %3
%195 = getelementptr inbounds i32, i32* %194, i64 11
%196 = load i32, i32* %195
%197 = shl i32 %196, 16
%198 = or i32 %193, %197
%199 = call i32 @_mm256_set_epi32(i32 %147, i32 %156, i32 %165, i32 %168, i32 %177, i32 %186, i32 %189, i32 %198)
store i32 %199, i32* %7
%200 = load i32, i32* %7
%201 = load i32, i32* %6
%202 = call i32 @_mm256_srlv_epi32(i32 %200, i32 %201)
%203 = load i32, i32* %8
%204 = call i32 @_mm256_and_si256(i32 %202, i32 %203)
store i32 %204, i32* %9
%205 = load i32*, i32** %4
%206 = load i32, i32* %9
%207 = call i32 @_mm256_storeu_si256(i32* %205, i32 %206)
%208 = load i32*, i32** %4
%209 = getelementptr inbounds i32, i32* %208, i64 8
store i32* %209, i32** %4
%210 = call i32 @_mm256_set_epi32(i32 11, i32 0, i32 1, i32 0, i32 0, i32 2, i32 0, i32 0)
store i32 %210, i32* %6
%211 = load i32*, i32** %3
%212 = getelementptr inbounds i32, i32* %211, i64 20
%213 = load i32, i32* %212
%214 = load i32*, i32** %3
%215 = getelementptr inbounds i32, i32* %214, i64 19
%216 = load i32, i32* %215
%217 = ashr i32 %216, 22
%218 = load i32*, i32** %3
%219 = getelementptr inbounds i32, i32* %218, i64 20
%220 = load i32, i32* %219
%221 = shl i32 %220, 10
%222 = or i32 %217, %221
%223 = load i32*, i32** %3
%224 = getelementptr inbounds i32, i32* %223, i64 19
%225 = load i32, i32* %224
%226 = load i32*, i32** %3
%227 = getelementptr inbounds i32, i32* %226, i64 18
%228 = load i32, i32* %227
%229 = ashr i32 %228, 12
%230 = load i32*, i32** %3
%231 = getelementptr inbounds i32, i32* %230, i64 19
%232 = load i32, i32* %231
%233 = shl i32 %232, 20
%234 = or i32 %229, %233
%235 = load i32*, i32** %3
%236 = getelementptr inbounds i32, i32* %235, i64 17
%237 = load i32, i32* %236
%238 = ashr i32 %237, 23
%239 = load i32*, i32** %3
%240 = getelementptr inbounds i32, i32* %239, i64 18
%241 = load i32, i32* %240
%242 = shl i32 %241, 9
%243 = or i32 %238, %242
%244 = load i32*, i32** %3
%245 = getelementptr inbounds i32, i32* %244, i64 17
%246 = load i32, i32* %245
%247 = load i32*, i32** %3
%248 = getelementptr inbounds i32, i32* %247, i64 16
%249 = load i32, i32* %248
%250 = ashr i32 %249, 13
%251 = load i32*, i32** %3
%252 = getelementptr inbounds i32, i32* %251, i64 17
%253 = load i32, i32* %252
%254 = shl i32 %253, 19
%255 = or i32 %250, %254
%256 = load i32*, i32** %3
%257 = getelementptr inbounds i32, i32* %256, i64 15
%258 = load i32, i32* %257
%259 = ashr i32 %258, 24
%260 = load i32*, i32** %3
%261 = getelementptr inbounds i32, i32* %260, i64 16
%262 = load i32, i32* %261
%263 = shl i32 %262, 8
%264 = or i32 %259, %263
%265 = call i32 @_mm256_set_epi32(i32 %213, i32 %222, i32 %225, i32 %234, i32 %243, i32 %246, i32 %255, i32 %264)
store i32 %265, i32* %7
%266 = load i32, i32* %7
%267 = load i32, i32* %6
%268 = call i32 @_mm256_srlv_epi32(i32 %266, i32 %267)
%269 = load i32, i32* %8
%270 = call i32 @_mm256_and_si256(i32 %268, i32 %269)
store i32 %270, i32* %9
%271 = load i32*, i32** %4
%272 = load i32, i32* %9
%273 = call i32 @_mm256_storeu_si256(i32* %271, i32 %272)
%274 = load i32*, i32** %4
%275 = getelementptr inbounds i32, i32* %274, i64 8
store i32* %275, i32** %4
%276 = load i32*, i32** %3
%277 = getelementptr inbounds i32, i32* %276, i64 21
store i32* %277, i32** %3
%278 = load i32*, i32** %3
ret i32* %278
}

LLVM IR (-O2):
define i32* @unpack21_32_avx2(i32* %0, i32* %1) {
%3 = tail call i32 @_mm256_set1_epi32(i32 2097151)
%4 = tail call i32 @_mm256_set_epi32(i32 0, i32 0, i32 9, i32 0, i32 0, i32 10, i32 0, i32 0)
%5 = getelementptr inbounds i32, i32* %0, i64 4
%6 = load i32, i32* %5
%7 = ashr i32 %6, 19
%8 = getelementptr inbounds i32, i32* %0, i64 5
%9 = load i32, i32* %8
%10 = shl i32 %9, 13
%11 = or i32 %10, %7
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = ashr i32 %13, 30
%15 = shl i32 %6, 2
%16 = or i32 %14, %15
%17 = getelementptr inbounds i32, i32* %0, i64 2
%18 = load i32, i32* %17
%19 = ashr i32 %18, 20
%20 = shl i32 %13, 12
%21 = or i32 %19, %20
%22 = getelementptr inbounds i32, i32* %0, i64 1
%23 = load i32, i32* %22
%24 = ashr i32 %23, 31
%25 = shl i32 %18, 1
%26 = or i32 %24, %25
%27 = load i32, i32* %0
%28 = ashr i32 %27, 21
%29 = shl i32 %23, 11
%30 = or i32 %28, %29
%31 = tail call i32 @_mm256_set_epi32(i32 %11, i32 %16, i32 %13, i32 %21, i32 %26, i32 %23, i32 %30, i32 %27)
%32 = tail call i32 @_mm256_srlv_epi32(i32 %31, i32 %4)
%33 = tail call i32 @_mm256_and_si256(i32 %32, i32 %3)
%34 = tail call i32 @_mm256_storeu_si256(i32* %1, i32 %33)
%35 = getelementptr inbounds i32, i32* %1, i64 8
%36 = tail call i32 @_mm256_set_epi32(i32 0, i32 6, i32 0, i32 0, i32 7, i32 0, i32 0, i32 8)
%37 = getelementptr inbounds i32, i32* %0, i64 9
%38 = load i32, i32* %37
%39 = ashr i32 %38, 27
%40 = getelementptr inbounds i32, i32* %0, i64 10
%41 = load i32, i32* %40
%42 = shl i32 %41, 5
%43 = or i32 %42, %39
%44 = getelementptr inbounds i32, i32* %0, i64 8
%45 = load i32, i32* %44
%46 = ashr i32 %45, 17
%47 = shl i32 %38, 15
%48 = or i32 %46, %47
%49 = getelementptr inbounds i32, i32* %0, i64 7
%50 = load i32, i32* %49
%51 = ashr i32 %50, 28
%52 = shl i32 %45, 4
%53 = or i32 %51, %52
%54 = getelementptr inbounds i32, i32* %0, i64 6
%55 = load i32, i32* %54
%56 = ashr i32 %55, 18
%57 = shl i32 %50, 14
%58 = or i32 %56, %57
%59 = load i32, i32* %8
%60 = ashr i32 %59, 29
%61 = shl i32 %55, 3
%62 = or i32 %60, %61
%63 = tail call i32 @_mm256_set_epi32(i32 %43, i32 %38, i32 %48, i32 %53, i32 %50, i32 %58, i32 %62, i32 %59)
%64 = tail call i32 @_mm256_srlv_epi32(i32 %63, i32 %36)
%65 = tail call i32 @_mm256_and_si256(i32 %64, i32 %3)
%66 = tail call i32 @_mm256_storeu_si256(i32* %35, i32 %65)
%67 = getelementptr inbounds i32, i32* %1, i64 16
%68 = tail call i32 @_mm256_set_epi32(i32 3, i32 0, i32 0, i32 4, i32 0, i32 0, i32 5, i32 0)
%69 = getelementptr inbounds i32, i32* %0, i64 15
%70 = load i32, i32* %69
%71 = getelementptr inbounds i32, i32* %0, i64 14
%72 = load i32, i32* %71
%73 = ashr i32 %72, 14
%74 = shl i32 %70, 18
%75 = or i32 %73, %74
%76 = getelementptr inbounds i32, i32* %0, i64 13
%77 = load i32, i32* %76
%78 = ashr i32 %77, 25
%79 = shl i32 %72, 7
%80 = or i32 %78, %79
%81 = getelementptr inbounds i32, i32* %0, i64 12
%82 = load i32, i32* %81
%83 = ashr i32 %82, 15
%84 = shl i32 %77, 17
%85 = or i32 %83, %84
%86 = getelementptr inbounds i32, i32* %0, i64 11
%87 = load i32, i32* %86
%88 = ashr i32 %87, 26
%89 = shl i32 %82, 6
%90 = or i32 %88, %89
%91 = load i32, i32* %40
%92 = ashr i32 %91, 16
%93 = shl i32 %87, 16
%94 = or i32 %92, %93
%95 = tail call i32 @_mm256_set_epi32(i32 %70, i32 %75, i32 %80, i32 %77, i32 %85, i32 %90, i32 %87, i32 %94)
%96 = tail call i32 @_mm256_srlv_epi32(i32 %95, i32 %68)
%97 = tail call i32 @_mm256_and_si256(i32 %96, i32 %3)
%98 = tail call i32 @_mm256_storeu_si256(i32* %67, i32 %97)
%99 = getelementptr inbounds i32, i32* %1, i64 24
%100 = tail call i32 @_mm256_set_epi32(i32 11, i32 0, i32 1, i32 0, i32 0, i32 2, i32 0, i32 0)
%101 = getelementptr inbounds i32, i32* %0, i64 20
%102 = load i32, i32* %101
%103 = getelementptr inbounds i32, i32* %0, i64 19
%104 = load i32, i32* %103
%105 = ashr i32 %104, 22
%106 = shl i32 %102, 10
%107 = or i32 %105, %106
%108 = getelementptr inbounds i32, i32* %0, i64 18
%109 = load i32, i32* %108
%110 = ashr i32 %109, 12
%111 = shl i32 %104, 20
%112 = or i32 %110, %111
%113 = getelementptr inbounds i32, i32* %0, i64 17
%114 = load i32, i32* %113
%115 = ashr i32 %114, 23
%116 = shl i32 %109, 9
%117 = or i32 %115, %116
%118 = getelementptr inbounds i32, i32* %0, i64 16
%119 = load i32, i32* %118
%120 = ashr i32 %119, 13
%121 = shl i32 %114, 19
%122 = or i32 %120, %121
%123 = load i32, i32* %69
%124 = ashr i32 %123, 24
%125 = shl i32 %119, 8
%126 = or i32 %124, %125
%127 = tail call i32 @_mm256_set_epi32(i32 %102, i32 %107, i32 %104, i32 %112, i32 %117, i32 %114, i32 %122, i32 %126)
%128 = tail call i32 @_mm256_srlv_epi32(i32 %127, i32 %100)
%129 = tail call i32 @_mm256_and_si256(i32 %128, i32 %3)
%130 = tail call i32 @_mm256_storeu_si256(i32* %99, i32 %129)
%131 = getelementptr inbounds i32, i32* %0, i64 21
ret i32* %131
}