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


x86 assembly (clang, -O0):
<unpack18_32_avx2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3ffff,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <_mm256_set1_epi32@plt>
mov    %eax,-0x20(%rbp)
xor    %r8d,%r8d
mov    $0xc,%esi
mov    $0x8,%ecx
mov    $0x4,%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    $0x1e,%edi
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
shl    $0x2,%eax
or     %eax,%edi
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%edx
sar    $0x1a,%edx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
shl    $0x6,%eax
or     %eax,%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%r8d
sar    $0x16,%r8d
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0xa,%eax
or     %eax,%r8d
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%r9d
mov    -0x8(%rbp),%rax
mov    (%rax),%r10d
sar    $0x12,%r10d
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0xe,%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)
mov    $0xe,%edi
xor    %r9d,%r9d
mov    $0xa,%edx
mov    $0x6,%r8d
mov    %r9d,%esi
mov    %r9d,%ecx
movl   $0x2,(%rsp)
movl   $0x0,0x8(%rsp)
call   1070 <_mm256_set_epi32@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%esi
sar    $0x1c,%esi
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%eax
shl    $0x4,%eax
or     %eax,%esi
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%ecx
sar    $0x18,%ecx
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%eax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%r8d
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%r9d
sar    $0x14,%r9d
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
shl    $0xc,%eax
or     %eax,%r9d
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%r10d
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
sar    $0x10,%eax
mov    -0x8(%rbp),%r11
mov    0x14(%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)
xor    %r8d,%r8d
mov    $0xc,%esi
mov    $0x8,%ecx
mov    $0x4,%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    0x30(%rax),%edi
sar    $0x1e,%edi
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%eax
shl    $0x2,%eax
or     %eax,%edi
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%edx
sar    $0x1a,%edx
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%eax
shl    $0x6,%eax
or     %eax,%edx
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%r8d
sar    $0x16,%r8d
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%eax
shl    $0xa,%eax
or     %eax,%r8d
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%r9d
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%r10d
sar    $0x12,%r10d
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%eax
shl    $0xe,%eax
or     %eax,%r10d
mov    -0x8(%rbp),%rax
mov    0x24(%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    $0xe,%edi
xor    %r9d,%r9d
mov    $0xa,%edx
mov    $0x6,%r8d
mov    %r9d,%esi
mov    %r9d,%ecx
movl   $0x2,(%rsp)
movl   $0x0,0x8(%rsp)
call   1070 <_mm256_set_epi32@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x44(%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x40(%rax),%esi
sar    $0x1c,%esi
mov    -0x8(%rbp),%rax
mov    0x44(%rax),%eax
shl    $0x4,%eax
or     %eax,%esi
mov    -0x8(%rbp),%rax
mov    0x40(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x3c(%rax),%ecx
sar    $0x18,%ecx
mov    -0x8(%rbp),%rax
mov    0x40(%rax),%eax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    0x3c(%rax),%r8d
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%r9d
sar    $0x14,%r9d
mov    -0x8(%rbp),%rax
mov    0x3c(%rax),%eax
shl    $0xc,%eax
or     %eax,%r9d
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%r10d
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%eax
sar    $0x10,%eax
mov    -0x8(%rbp),%r11
mov    0x38(%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    -0x8(%rbp),%rax
add    $0x48,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack18_32_avx2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x3ffff,%edi
call   1050 <_mm256_set1_epi32@plt>
mov    %eax,%ebx
xor    %edi,%edi
mov    $0xc,%esi
xor    %edx,%edx
mov    $0x8,%ecx
xor    %r8d,%r8d
mov    $0x4,%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    $0x1e,%eax
mov    0x10(%r15),%edi
shl    $0x2,%edi
or     %eax,%edi
mov    0x8(%r15),%ecx
mov    %ecx,%eax
sar    $0x1a,%eax
mov    %esi,%edx
shl    $0x6,%edx
or     %eax,%edx
mov    (%r15),%r10d
mov    0x4(%r15),%r9d
mov    %r9d,%ebp
sar    $0x16,%ebp
mov    %ecx,%r8d
shl    $0xa,%r8d
or     %ebp,%r8d
mov    %r10d,%ebp
sar    $0x12,%ebp
mov    %r9d,%eax
shl    $0xe,%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,%r12d
mov    %ebx,0xc(%rsp)
call   1040 <_mm256_and_si256@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <_mm256_storeu_si256@plt>
lea    0x20(%r14),%rax
mov    %rax,0x10(%rsp)
mov    $0xe,%edi
xor    %esi,%esi
mov    $0xa,%edx
xor    %ecx,%ecx
mov    $0x6,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x2
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r13d
mov    0x20(%r15),%edi
mov    0x1c(%r15),%edx
mov    %edx,%eax
sar    $0x1c,%eax
mov    %edi,%esi
shl    $0x4,%esi
or     %eax,%esi
mov    0x14(%r15),%ebx
mov    0x18(%r15),%r8d
mov    %r8d,%ebp
sar    $0x18,%ebp
mov    %edx,%ecx
shl    $0x8,%ecx
or     %ebp,%ecx
mov    %ebx,%ebp
sar    $0x14,%ebp
mov    %r8d,%r9d
shl    $0xc,%r9d
or     %ebp,%r9d
movswl 0x12(%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    %r12d,%esi
call   1040 <_mm256_and_si256@plt>
mov    0x10(%rsp),%rdi
mov    %eax,%esi
call   1030 <_mm256_storeu_si256@plt>
lea    0x40(%r14),%r12
xor    %edi,%edi
mov    $0xc,%esi
xor    %edx,%edx
mov    $0x8,%ecx
xor    %r8d,%r8d
mov    $0x4,%r9d
push   $0x0
push   $0x0
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r13d
mov    0x30(%r15),%esi
mov    %esi,%eax
sar    $0x1e,%eax
mov    0x34(%r15),%edi
shl    $0x2,%edi
or     %eax,%edi
mov    0x2c(%r15),%ecx
mov    %ecx,%eax
sar    $0x1a,%eax
mov    %esi,%edx
shl    $0x6,%edx
or     %eax,%edx
mov    0x24(%r15),%eax
mov    0x28(%r15),%r9d
mov    %r9d,%ebx
sar    $0x16,%ebx
mov    %ecx,%r8d
shl    $0xa,%r8d
or     %ebx,%r8d
mov    %eax,%ebx
sar    $0x12,%ebx
mov    %r9d,%ebp
shl    $0xe,%ebp
or     %ebx,%ebp
push   %rax
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    0xc(%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    $0xe,%edi
xor    %esi,%esi
mov    $0xa,%edx
xor    %ecx,%ecx
mov    $0x6,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x2
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r12d
mov    0x44(%r15),%edi
mov    0x40(%r15),%edx
mov    %edx,%eax
sar    $0x1c,%eax
mov    %edi,%esi
shl    $0x4,%esi
or     %eax,%esi
mov    0x38(%r15),%ebp
mov    0x3c(%r15),%r8d
mov    %r8d,%ebx
sar    $0x18,%ebx
mov    %edx,%ecx
shl    $0x8,%ecx
or     %ebx,%ecx
mov    %ebp,%ebx
sar    $0x14,%ebx
mov    %r8d,%r9d
shl    $0xc,%r9d
or     %ebx,%r9d
movswl 0x36(%r15),%ebx
mov    %ebp,%eax
shl    $0x10,%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    $0x48,%r15
mov    %r15,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32* @unpack18_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 262143, 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 12, i32 0, i32 8, i32 0, i32 4, 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, 30
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 4
%19 = load i32, i32* %18
%20 = shl i32 %19, 2
%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, 26
%29 = load i32*, i32** %3
%30 = getelementptr inbounds i32, i32* %29, i64 3
%31 = load i32, i32* %30
%32 = shl i32 %31, 6
%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, 22
%41 = load i32*, i32** %3
%42 = getelementptr inbounds i32, i32* %41, i64 2
%43 = load i32, i32* %42
%44 = shl i32 %43, 10
%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, 18
%53 = load i32*, i32** %3
%54 = getelementptr inbounds i32, i32* %53, i64 1
%55 = load i32, i32* %54
%56 = shl i32 %55, 14
%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 14, i32 0, i32 10, i32 0, i32 6, i32 0, i32 2, i32 0)
store i32 %72, i32* %6
%73 = load i32*, i32** %3
%74 = getelementptr inbounds i32, i32* %73, i64 8
%75 = load i32, i32* %74
%76 = load i32*, i32** %3
%77 = getelementptr inbounds i32, i32* %76, i64 7
%78 = load i32, i32* %77
%79 = ashr i32 %78, 28
%80 = load i32*, i32** %3
%81 = getelementptr inbounds i32, i32* %80, i64 8
%82 = load i32, i32* %81
%83 = shl i32 %82, 4
%84 = or i32 %79, %83
%85 = load i32*, i32** %3
%86 = getelementptr inbounds i32, i32* %85, i64 7
%87 = load i32, i32* %86
%88 = load i32*, i32** %3
%89 = getelementptr inbounds i32, i32* %88, i64 6
%90 = load i32, i32* %89
%91 = ashr i32 %90, 24
%92 = load i32*, i32** %3
%93 = getelementptr inbounds i32, i32* %92, i64 7
%94 = load i32, i32* %93
%95 = shl i32 %94, 8
%96 = or i32 %91, %95
%97 = load i32*, i32** %3
%98 = getelementptr inbounds i32, i32* %97, i64 6
%99 = load i32, i32* %98
%100 = load i32*, i32** %3
%101 = getelementptr inbounds i32, i32* %100, i64 5
%102 = load i32, i32* %101
%103 = ashr i32 %102, 20
%104 = load i32*, i32** %3
%105 = getelementptr inbounds i32, i32* %104, i64 6
%106 = load i32, i32* %105
%107 = shl i32 %106, 12
%108 = or i32 %103, %107
%109 = load i32*, i32** %3
%110 = getelementptr inbounds i32, i32* %109, i64 5
%111 = load i32, i32* %110
%112 = load i32*, i32** %3
%113 = getelementptr inbounds i32, i32* %112, i64 4
%114 = load i32, i32* %113
%115 = ashr i32 %114, 16
%116 = load i32*, i32** %3
%117 = getelementptr inbounds i32, i32* %116, i64 5
%118 = load i32, i32* %117
%119 = shl i32 %118, 16
%120 = or i32 %115, %119
%121 = call i32 @_mm256_set_epi32(i32 %75, i32 %84, i32 %87, i32 %96, i32 %99, i32 %108, i32 %111, 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 0, i32 12, i32 0, i32 8, i32 0, i32 4, i32 0, 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 = ashr i32 %135, 30
%137 = load i32*, i32** %3
%138 = getelementptr inbounds i32, i32* %137, i64 13
%139 = load i32, i32* %138
%140 = shl i32 %139, 2
%141 = or i32 %136, %140
%142 = load i32*, i32** %3
%143 = getelementptr inbounds i32, i32* %142, i64 12
%144 = load i32, i32* %143
%145 = load i32*, i32** %3
%146 = getelementptr inbounds i32, i32* %145, i64 11
%147 = load i32, i32* %146
%148 = ashr i32 %147, 26
%149 = load i32*, i32** %3
%150 = getelementptr inbounds i32, i32* %149, i64 12
%151 = load i32, i32* %150
%152 = shl i32 %151, 6
%153 = or i32 %148, %152
%154 = load i32*, i32** %3
%155 = getelementptr inbounds i32, i32* %154, i64 11
%156 = load i32, i32* %155
%157 = load i32*, i32** %3
%158 = getelementptr inbounds i32, i32* %157, i64 10
%159 = load i32, i32* %158
%160 = ashr i32 %159, 22
%161 = load i32*, i32** %3
%162 = getelementptr inbounds i32, i32* %161, i64 11
%163 = load i32, i32* %162
%164 = shl i32 %163, 10
%165 = or i32 %160, %164
%166 = load i32*, i32** %3
%167 = getelementptr inbounds i32, i32* %166, i64 10
%168 = load i32, i32* %167
%169 = load i32*, i32** %3
%170 = getelementptr inbounds i32, i32* %169, i64 9
%171 = load i32, i32* %170
%172 = ashr i32 %171, 18
%173 = load i32*, i32** %3
%174 = getelementptr inbounds i32, i32* %173, i64 10
%175 = load i32, i32* %174
%176 = shl i32 %175, 14
%177 = or i32 %172, %176
%178 = load i32*, i32** %3
%179 = getelementptr inbounds i32, i32* %178, i64 9
%180 = load i32, i32* %179
%181 = call i32 @_mm256_set_epi32(i32 %141, i32 %144, i32 %153, i32 %156, i32 %165, i32 %168, i32 %177, 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 14, i32 0, i32 10, i32 0, i32 6, i32 0, i32 2, i32 0)
store i32 %192, i32* %6
%193 = load i32*, i32** %3
%194 = getelementptr inbounds i32, i32* %193, i64 17
%195 = load i32, i32* %194
%196 = load i32*, i32** %3
%197 = getelementptr inbounds i32, i32* %196, i64 16
%198 = load i32, i32* %197
%199 = ashr i32 %198, 28
%200 = load i32*, i32** %3
%201 = getelementptr inbounds i32, i32* %200, i64 17
%202 = load i32, i32* %201
%203 = shl i32 %202, 4
%204 = or i32 %199, %203
%205 = load i32*, i32** %3
%206 = getelementptr inbounds i32, i32* %205, i64 16
%207 = load i32, i32* %206
%208 = load i32*, i32** %3
%209 = getelementptr inbounds i32, i32* %208, i64 15
%210 = load i32, i32* %209
%211 = ashr i32 %210, 24
%212 = load i32*, i32** %3
%213 = getelementptr inbounds i32, i32* %212, i64 16
%214 = load i32, i32* %213
%215 = shl i32 %214, 8
%216 = or i32 %211, %215
%217 = load i32*, i32** %3
%218 = getelementptr inbounds i32, i32* %217, i64 15
%219 = load i32, i32* %218
%220 = load i32*, i32** %3
%221 = getelementptr inbounds i32, i32* %220, i64 14
%222 = load i32, i32* %221
%223 = ashr i32 %222, 20
%224 = load i32*, i32** %3
%225 = getelementptr inbounds i32, i32* %224, i64 15
%226 = load i32, i32* %225
%227 = shl i32 %226, 12
%228 = or i32 %223, %227
%229 = load i32*, i32** %3
%230 = getelementptr inbounds i32, i32* %229, i64 14
%231 = load i32, i32* %230
%232 = load i32*, i32** %3
%233 = getelementptr inbounds i32, i32* %232, i64 13
%234 = load i32, i32* %233
%235 = ashr i32 %234, 16
%236 = load i32*, i32** %3
%237 = getelementptr inbounds i32, i32* %236, i64 14
%238 = load i32, i32* %237
%239 = shl i32 %238, 16
%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 18
store i32* %253, i32** %3
%254 = load i32*, i32** %3
ret i32* %254
}

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