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


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

x86 assembly (clang, -O2):
<unpack17_32_avx2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x1ffff,%edi
call   1050 <_mm256_set1_epi32@plt>
mov    %eax,%ebx
xor    %edi,%edi
mov    $0x6,%esi
xor    %edx,%edx
mov    $0x4,%ecx
xor    %r8d,%r8d
mov    $0x2,%r9d
push   $0x0
push   $0x0
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r12d
mov    0xc(%r15),%esi
mov    %esi,%eax
sar    $0x17,%eax
mov    0x10(%r15),%edi
shl    $0x9,%edi
or     %eax,%edi
mov    0x8(%r15),%ecx
mov    %ecx,%eax
sar    $0x15,%eax
mov    %esi,%edx
shl    $0xb,%edx
or     %eax,%edx
mov    (%r15),%r10d
mov    0x4(%r15),%r9d
mov    %r9d,%ebp
sar    $0x13,%ebp
mov    %ecx,%r8d
shl    $0xd,%r8d
or     %ebp,%r8d
mov    %r10d,%ebp
sar    $0x11,%ebp
mov    %r9d,%eax
shl    $0xf,%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
mov    %ebx,0x4(%rsp)
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    $0xe,%esi
xor    %edx,%edx
mov    $0xc,%ecx
xor    %r8d,%r8d
mov    $0xa,%r9d
push   $0x8
push   $0x0
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r13d
mov    0x1c(%r15),%esi
mov    %esi,%eax
sar    $0x1f,%eax
mov    0x20(%r15),%edi
add    %edi,%edi
or     %eax,%edi
mov    0x18(%r15),%ecx
mov    %ecx,%eax
sar    $0x1d,%eax
lea    0x0(,%rsi,8),%edx
or     %eax,%edx
mov    0x10(%r15),%r10d
mov    0x14(%r15),%r9d
mov    %r9d,%ebp
sar    $0x1b,%ebp
mov    %ecx,%r8d
shl    $0x5,%r8d
or     %ebp,%r8d
mov    %r10d,%ebp
sar    $0x19,%ebp
mov    %r9d,%eax
shl    $0x7,%eax
or     %ebp,%eax
push   %r10
push   %rax
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    $0x7,%edi
xor    %esi,%esi
mov    $0x5,%edx
xor    %ecx,%ecx
mov    $0x3,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x1
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r13d
mov    0x30(%r15),%edi
mov    0x2c(%r15),%edx
mov    %edx,%eax
sar    $0x16,%eax
mov    %edi,%esi
shl    $0xa,%esi
or     %eax,%esi
mov    0x24(%r15),%ebx
mov    0x28(%r15),%r8d
mov    %r8d,%ebp
sar    $0x14,%ebp
mov    %edx,%ecx
shl    $0xc,%ecx
or     %ebp,%ecx
mov    %ebx,%ebp
sar    $0x12,%ebp
mov    %r8d,%r9d
shl    $0xe,%r9d
or     %ebp,%r9d
movswl 0x22(%r15),%ebp
mov    %ebx,%eax
shl    $0x10,%eax
or     %ebp,%eax
push   %rax
push   %rbx
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    0x4(%rsp),%r13d
mov    %r13d,%esi
call   1040 <_mm256_and_si256@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1030 <_mm256_storeu_si256@plt>
add    $0x60,%r14
mov    $0xf,%edi
xor    %esi,%esi
mov    $0xd,%edx
xor    %ecx,%ecx
mov    $0xb,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x9
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r12d
mov    0x40(%r15),%edi
mov    0x3c(%r15),%edx
mov    %edx,%eax
sar    $0x1e,%eax
lea    0x0(,%rdi,4),%esi
or     %eax,%esi
mov    0x34(%r15),%ebp
mov    0x38(%r15),%r8d
mov    %r8d,%ebx
sar    $0x1c,%ebx
mov    %edx,%ecx
shl    $0x4,%ecx
or     %ebx,%ecx
mov    %ebp,%ebx
sar    $0x1a,%ebx
mov    %r8d,%r9d
shl    $0x6,%r9d
or     %ebx,%r9d
movsbl 0x33(%r15),%ebx
mov    %ebp,%eax
shl    $0x8,%eax
or     %ebx,%eax
push   %rax
push   %rbp
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    $0x44,%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* @unpack17_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 131071, 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 6, i32 0, i32 4, i32 0, i32 2, i32 0, i32 0)
store i32 %12, i32* %6
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 3
%15 = load i32, i32* %14
%16 = ashr i32 %15, 23
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 4
%19 = load i32, i32* %18
%20 = shl i32 %19, 9
%21 = or i32 %16, %20
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 3
%24 = load i32, i32* %23
%25 = load i32*, i32** %3
%26 = getelementptr inbounds i32, i32* %25, i64 2
%27 = load i32, i32* %26
%28 = ashr i32 %27, 21
%29 = load i32*, i32** %3
%30 = getelementptr inbounds i32, i32* %29, i64 3
%31 = load i32, i32* %30
%32 = shl i32 %31, 11
%33 = or i32 %28, %32
%34 = load i32*, i32** %3
%35 = getelementptr inbounds i32, i32* %34, i64 2
%36 = load i32, i32* %35
%37 = load i32*, i32** %3
%38 = getelementptr inbounds i32, i32* %37, i64 1
%39 = load i32, i32* %38
%40 = ashr i32 %39, 19
%41 = load i32*, i32** %3
%42 = getelementptr inbounds i32, i32* %41, i64 2
%43 = load i32, i32* %42
%44 = shl i32 %43, 13
%45 = or i32 %40, %44
%46 = load i32*, i32** %3
%47 = getelementptr inbounds i32, i32* %46, i64 1
%48 = load i32, i32* %47
%49 = load i32*, i32** %3
%50 = getelementptr inbounds i32, i32* %49, i64 0
%51 = load i32, i32* %50
%52 = ashr i32 %51, 17
%53 = load i32*, i32** %3
%54 = getelementptr inbounds i32, i32* %53, i64 1
%55 = load i32, i32* %54
%56 = shl i32 %55, 15
%57 = or i32 %52, %56
%58 = load i32*, i32** %3
%59 = getelementptr inbounds i32, i32* %58, i64 0
%60 = load i32, i32* %59
%61 = call i32 @_mm256_set_epi32(i32 %21, i32 %24, i32 %33, i32 %36, i32 %45, i32 %48, i32 %57, i32 %60)
store i32 %61, i32* %7
%62 = load i32, i32* %7
%63 = load i32, i32* %6
%64 = call i32 @_mm256_srlv_epi32(i32 %62, i32 %63)
%65 = load i32, i32* %8
%66 = call i32 @_mm256_and_si256(i32 %64, i32 %65)
store i32 %66, i32* %9
%67 = load i32*, i32** %4
%68 = load i32, i32* %9
%69 = call i32 @_mm256_storeu_si256(i32* %67, i32 %68)
%70 = load i32*, i32** %4
%71 = getelementptr inbounds i32, i32* %70, i64 8
store i32* %71, i32** %4
%72 = call i32 @_mm256_set_epi32(i32 0, i32 14, i32 0, i32 12, i32 0, i32 10, i32 0, i32 8)
store i32 %72, i32* %6
%73 = load i32*, i32** %3
%74 = getelementptr inbounds i32, i32* %73, i64 7
%75 = load i32, i32* %74
%76 = ashr i32 %75, 31
%77 = load i32*, i32** %3
%78 = getelementptr inbounds i32, i32* %77, i64 8
%79 = load i32, i32* %78
%80 = shl i32 %79, 1
%81 = or i32 %76, %80
%82 = load i32*, i32** %3
%83 = getelementptr inbounds i32, i32* %82, i64 7
%84 = load i32, i32* %83
%85 = load i32*, i32** %3
%86 = getelementptr inbounds i32, i32* %85, i64 6
%87 = load i32, i32* %86
%88 = ashr i32 %87, 29
%89 = load i32*, i32** %3
%90 = getelementptr inbounds i32, i32* %89, i64 7
%91 = load i32, i32* %90
%92 = shl i32 %91, 3
%93 = or i32 %88, %92
%94 = load i32*, i32** %3
%95 = getelementptr inbounds i32, i32* %94, i64 6
%96 = load i32, i32* %95
%97 = load i32*, i32** %3
%98 = getelementptr inbounds i32, i32* %97, i64 5
%99 = load i32, i32* %98
%100 = ashr i32 %99, 27
%101 = load i32*, i32** %3
%102 = getelementptr inbounds i32, i32* %101, i64 6
%103 = load i32, i32* %102
%104 = shl i32 %103, 5
%105 = or i32 %100, %104
%106 = load i32*, i32** %3
%107 = getelementptr inbounds i32, i32* %106, i64 5
%108 = load i32, i32* %107
%109 = load i32*, i32** %3
%110 = getelementptr inbounds i32, i32* %109, i64 4
%111 = load i32, i32* %110
%112 = ashr i32 %111, 25
%113 = load i32*, i32** %3
%114 = getelementptr inbounds i32, i32* %113, i64 5
%115 = load i32, i32* %114
%116 = shl i32 %115, 7
%117 = or i32 %112, %116
%118 = load i32*, i32** %3
%119 = getelementptr inbounds i32, i32* %118, i64 4
%120 = load i32, i32* %119
%121 = call i32 @_mm256_set_epi32(i32 %81, i32 %84, i32 %93, i32 %96, i32 %105, i32 %108, i32 %117, i32 %120)
store i32 %121, i32* %7
%122 = load i32, i32* %7
%123 = load i32, i32* %6
%124 = call i32 @_mm256_srlv_epi32(i32 %122, i32 %123)
%125 = load i32, i32* %8
%126 = call i32 @_mm256_and_si256(i32 %124, i32 %125)
store i32 %126, i32* %9
%127 = load i32*, i32** %4
%128 = load i32, i32* %9
%129 = call i32 @_mm256_storeu_si256(i32* %127, i32 %128)
%130 = load i32*, i32** %4
%131 = getelementptr inbounds i32, i32* %130, i64 8
store i32* %131, i32** %4
%132 = call i32 @_mm256_set_epi32(i32 7, i32 0, i32 5, i32 0, i32 3, i32 0, i32 1, i32 0)
store i32 %132, i32* %6
%133 = load i32*, i32** %3
%134 = getelementptr inbounds i32, i32* %133, i64 12
%135 = load i32, i32* %134
%136 = load i32*, i32** %3
%137 = getelementptr inbounds i32, i32* %136, i64 11
%138 = load i32, i32* %137
%139 = ashr i32 %138, 22
%140 = load i32*, i32** %3
%141 = getelementptr inbounds i32, i32* %140, i64 12
%142 = load i32, i32* %141
%143 = shl i32 %142, 10
%144 = or i32 %139, %143
%145 = load i32*, i32** %3
%146 = getelementptr inbounds i32, i32* %145, i64 11
%147 = load i32, i32* %146
%148 = load i32*, i32** %3
%149 = getelementptr inbounds i32, i32* %148, i64 10
%150 = load i32, i32* %149
%151 = ashr i32 %150, 20
%152 = load i32*, i32** %3
%153 = getelementptr inbounds i32, i32* %152, i64 11
%154 = load i32, i32* %153
%155 = shl i32 %154, 12
%156 = or i32 %151, %155
%157 = load i32*, i32** %3
%158 = getelementptr inbounds i32, i32* %157, i64 10
%159 = load i32, i32* %158
%160 = load i32*, i32** %3
%161 = getelementptr inbounds i32, i32* %160, i64 9
%162 = load i32, i32* %161
%163 = ashr i32 %162, 18
%164 = load i32*, i32** %3
%165 = getelementptr inbounds i32, i32* %164, i64 10
%166 = load i32, i32* %165
%167 = shl i32 %166, 14
%168 = or i32 %163, %167
%169 = load i32*, i32** %3
%170 = getelementptr inbounds i32, i32* %169, i64 9
%171 = load i32, i32* %170
%172 = load i32*, i32** %3
%173 = getelementptr inbounds i32, i32* %172, i64 8
%174 = load i32, i32* %173
%175 = ashr i32 %174, 16
%176 = load i32*, i32** %3
%177 = getelementptr inbounds i32, i32* %176, i64 9
%178 = load i32, i32* %177
%179 = shl i32 %178, 16
%180 = or i32 %175, %179
%181 = call i32 @_mm256_set_epi32(i32 %135, i32 %144, i32 %147, i32 %156, i32 %159, i32 %168, i32 %171, i32 %180)
store i32 %181, i32* %7
%182 = load i32, i32* %7
%183 = load i32, i32* %6
%184 = call i32 @_mm256_srlv_epi32(i32 %182, i32 %183)
%185 = load i32, i32* %8
%186 = call i32 @_mm256_and_si256(i32 %184, i32 %185)
store i32 %186, i32* %9
%187 = load i32*, i32** %4
%188 = load i32, i32* %9
%189 = call i32 @_mm256_storeu_si256(i32* %187, i32 %188)
%190 = load i32*, i32** %4
%191 = getelementptr inbounds i32, i32* %190, i64 8
store i32* %191, i32** %4
%192 = call i32 @_mm256_set_epi32(i32 15, i32 0, i32 13, i32 0, i32 11, i32 0, i32 9, i32 0)
store i32 %192, i32* %6
%193 = load i32*, i32** %3
%194 = getelementptr inbounds i32, i32* %193, i64 16
%195 = load i32, i32* %194
%196 = load i32*, i32** %3
%197 = getelementptr inbounds i32, i32* %196, i64 15
%198 = load i32, i32* %197
%199 = ashr i32 %198, 30
%200 = load i32*, i32** %3
%201 = getelementptr inbounds i32, i32* %200, i64 16
%202 = load i32, i32* %201
%203 = shl i32 %202, 2
%204 = or i32 %199, %203
%205 = load i32*, i32** %3
%206 = getelementptr inbounds i32, i32* %205, i64 15
%207 = load i32, i32* %206
%208 = load i32*, i32** %3
%209 = getelementptr inbounds i32, i32* %208, i64 14
%210 = load i32, i32* %209
%211 = ashr i32 %210, 28
%212 = load i32*, i32** %3
%213 = getelementptr inbounds i32, i32* %212, i64 15
%214 = load i32, i32* %213
%215 = shl i32 %214, 4
%216 = or i32 %211, %215
%217 = load i32*, i32** %3
%218 = getelementptr inbounds i32, i32* %217, i64 14
%219 = load i32, i32* %218
%220 = load i32*, i32** %3
%221 = getelementptr inbounds i32, i32* %220, i64 13
%222 = load i32, i32* %221
%223 = ashr i32 %222, 26
%224 = load i32*, i32** %3
%225 = getelementptr inbounds i32, i32* %224, i64 14
%226 = load i32, i32* %225
%227 = shl i32 %226, 6
%228 = or i32 %223, %227
%229 = load i32*, i32** %3
%230 = getelementptr inbounds i32, i32* %229, i64 13
%231 = load i32, i32* %230
%232 = load i32*, i32** %3
%233 = getelementptr inbounds i32, i32* %232, i64 12
%234 = load i32, i32* %233
%235 = ashr i32 %234, 24
%236 = load i32*, i32** %3
%237 = getelementptr inbounds i32, i32* %236, i64 13
%238 = load i32, i32* %237
%239 = shl i32 %238, 8
%240 = or i32 %235, %239
%241 = call i32 @_mm256_set_epi32(i32 %195, i32 %204, i32 %207, i32 %216, i32 %219, i32 %228, i32 %231, i32 %240)
store i32 %241, i32* %7
%242 = load i32, i32* %7
%243 = load i32, i32* %6
%244 = call i32 @_mm256_srlv_epi32(i32 %242, i32 %243)
%245 = load i32, i32* %8
%246 = call i32 @_mm256_and_si256(i32 %244, i32 %245)
store i32 %246, i32* %9
%247 = load i32*, i32** %4
%248 = load i32, i32* %9
%249 = call i32 @_mm256_storeu_si256(i32* %247, i32 %248)
%250 = load i32*, i32** %4
%251 = getelementptr inbounds i32, i32* %250, i64 8
store i32* %251, i32** %4
%252 = load i32*, i32** %3
%253 = getelementptr inbounds i32, i32* %252, i64 17
store i32* %253, i32** %3
%254 = load i32*, i32** %3
ret i32* %254
}

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