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


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

x86 assembly (clang, -O2):
<unpack10_32_avx2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x3ff,%edi
call   1050 <_mm256_set1_epi32@plt>
mov    %eax,%r15d
mov    $0x6,%edi
xor    %esi,%esi
mov    $0x12,%edx
mov    $0x8,%ecx
xor    %r8d,%r8d
mov    $0x14,%r9d
push   $0x0
push   $0xa
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%ebp
mov    0x8(%rbx),%edi
mov    (%rbx),%r9d
mov    0x4(%rbx),%ecx
mov    %ecx,%eax
sar    $0x1c,%eax
mov    %edi,%esi
shl    $0x4,%esi
or     %eax,%esi
mov    %r9d,%eax
sar    $0x1e,%eax
lea    0x0(,%rcx,4),%r8d
or     %eax,%r8d
mov    %ecx,%edx
push   %r9
push   %r9
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%edi
mov    %ebp,%esi
call   1060 <_mm256_srlv_epi32@plt>
mov    %eax,%edi
mov    %r15d,%esi
call   1040 <_mm256_and_si256@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <_mm256_storeu_si256@plt>
lea    0x20(%r14),%r12
mov    $0x16,%edi
mov    $0xc,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
mov    $0xe,%r8d
mov    $0x4,%r9d
push   $0x10
push   $0x0
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r13d
mov    0x10(%rbx),%edi
mov    0x8(%rbx),%eax
mov    0xc(%rbx),%r8d
mov    %r8d,%edx
sar    $0x18,%edx
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edx,%ecx
mov    %eax,%edx
sar    $0x1a,%edx
mov    %r8d,%ebp
shl    $0x6,%ebp
or     %edx,%ebp
mov    %edi,%esi
mov    %edi,%edx
mov    %r8d,%r9d
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    %r15d,%esi
call   1040 <_mm256_and_si256@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1030 <_mm256_storeu_si256@plt>
lea    0x40(%r14),%r12
mov    $0x6,%edi
xor    %esi,%esi
mov    $0x12,%edx
mov    $0x8,%ecx
xor    %r8d,%r8d
mov    $0x14,%r9d
push   $0x0
push   $0xa
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%ebp
mov    0x1c(%rbx),%edi
mov    0x14(%rbx),%r9d
mov    0x18(%rbx),%ecx
mov    %ecx,%eax
sar    $0x1c,%eax
mov    %edi,%esi
shl    $0x4,%esi
or     %eax,%esi
mov    %r9d,%eax
sar    $0x1e,%eax
lea    0x0(,%rcx,4),%r8d
or     %eax,%r8d
mov    %ecx,%edx
push   %r9
push   %r9
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%edi
mov    %ebp,%esi
call   1060 <_mm256_srlv_epi32@plt>
mov    %eax,%edi
mov    %r15d,%esi
call   1040 <_mm256_and_si256@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1030 <_mm256_storeu_si256@plt>
add    $0x60,%r14
mov    $0x16,%edi
mov    $0xc,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
mov    $0xe,%r8d
mov    $0x4,%r9d
push   $0x10
push   $0x0
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r12d
mov    0x24(%rbx),%edi
mov    0x1c(%rbx),%eax
mov    0x20(%rbx),%r8d
mov    %r8d,%edx
sar    $0x18,%edx
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edx,%ecx
mov    %eax,%edx
sar    $0x1a,%edx
mov    %r8d,%ebp
shl    $0x6,%ebp
or     %edx,%ebp
mov    %edi,%esi
mov    %edi,%edx
mov    %r8d,%r9d
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    %r15d,%esi
call   1040 <_mm256_and_si256@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <_mm256_storeu_si256@plt>
add    $0x28,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32* @unpack10_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 1023, 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 6, i32 0, i32 18, i32 8, i32 0, i32 20, i32 10, i32 0)
store i32 %12, i32* %6
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = ashr i32 %18, 28
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 2
%22 = load i32, i32* %21
%23 = shl i32 %22, 4
%24 = or i32 %19, %23
%25 = load i32*, i32** %3
%26 = getelementptr inbounds i32, i32* %25, i64 1
%27 = load i32, i32* %26
%28 = load i32*, i32** %3
%29 = getelementptr inbounds i32, i32* %28, i64 1
%30 = load i32, i32* %29
%31 = load i32*, i32** %3
%32 = getelementptr inbounds i32, i32* %31, i64 0
%33 = load i32, i32* %32
%34 = ashr i32 %33, 30
%35 = load i32*, i32** %3
%36 = getelementptr inbounds i32, i32* %35, i64 1
%37 = load i32, i32* %36
%38 = shl i32 %37, 2
%39 = or i32 %34, %38
%40 = load i32*, i32** %3
%41 = getelementptr inbounds i32, i32* %40, i64 0
%42 = load i32, i32* %41
%43 = load i32*, i32** %3
%44 = getelementptr inbounds i32, i32* %43, i64 0
%45 = load i32, i32* %44
%46 = load i32*, i32** %3
%47 = getelementptr inbounds i32, i32* %46, i64 0
%48 = load i32, i32* %47
%49 = call i32 @_mm256_set_epi32(i32 %15, i32 %24, i32 %27, i32 %30, i32 %39, i32 %42, i32 %45, i32 %48)
store i32 %49, i32* %7
%50 = load i32, i32* %7
%51 = load i32, i32* %6
%52 = call i32 @_mm256_srlv_epi32(i32 %50, i32 %51)
%53 = load i32, i32* %8
%54 = call i32 @_mm256_and_si256(i32 %52, i32 %53)
store i32 %54, i32* %9
%55 = load i32*, i32** %4
%56 = load i32, i32* %9
%57 = call i32 @_mm256_storeu_si256(i32* %55, i32 %56)
%58 = load i32*, i32** %4
%59 = getelementptr inbounds i32, i32* %58, i64 8
store i32* %59, i32** %4
%60 = call i32 @_mm256_set_epi32(i32 22, i32 12, i32 2, i32 0, i32 14, i32 4, i32 0, i32 16)
store i32 %60, i32* %6
%61 = load i32*, i32** %3
%62 = getelementptr inbounds i32, i32* %61, i64 4
%63 = load i32, i32* %62
%64 = load i32*, i32** %3
%65 = getelementptr inbounds i32, i32* %64, i64 4
%66 = load i32, i32* %65
%67 = load i32*, i32** %3
%68 = getelementptr inbounds i32, i32* %67, i64 4
%69 = load i32, i32* %68
%70 = load i32*, i32** %3
%71 = getelementptr inbounds i32, i32* %70, i64 3
%72 = load i32, i32* %71
%73 = ashr i32 %72, 24
%74 = load i32*, i32** %3
%75 = getelementptr inbounds i32, i32* %74, i64 4
%76 = load i32, i32* %75
%77 = shl i32 %76, 8
%78 = or i32 %73, %77
%79 = load i32*, i32** %3
%80 = getelementptr inbounds i32, i32* %79, i64 3
%81 = load i32, i32* %80
%82 = load i32*, i32** %3
%83 = getelementptr inbounds i32, i32* %82, i64 3
%84 = load i32, i32* %83
%85 = load i32*, i32** %3
%86 = getelementptr inbounds i32, i32* %85, i64 2
%87 = load i32, i32* %86
%88 = ashr i32 %87, 26
%89 = load i32*, i32** %3
%90 = getelementptr inbounds i32, i32* %89, i64 3
%91 = load i32, i32* %90
%92 = shl i32 %91, 6
%93 = or i32 %88, %92
%94 = load i32*, i32** %3
%95 = getelementptr inbounds i32, i32* %94, i64 2
%96 = load i32, i32* %95
%97 = call i32 @_mm256_set_epi32(i32 %63, i32 %66, i32 %69, i32 %78, i32 %81, i32 %84, i32 %93, i32 %96)
store i32 %97, i32* %7
%98 = load i32, i32* %7
%99 = load i32, i32* %6
%100 = call i32 @_mm256_srlv_epi32(i32 %98, i32 %99)
%101 = load i32, i32* %8
%102 = call i32 @_mm256_and_si256(i32 %100, i32 %101)
store i32 %102, i32* %9
%103 = load i32*, i32** %4
%104 = load i32, i32* %9
%105 = call i32 @_mm256_storeu_si256(i32* %103, i32 %104)
%106 = load i32*, i32** %4
%107 = getelementptr inbounds i32, i32* %106, i64 8
store i32* %107, i32** %4
%108 = call i32 @_mm256_set_epi32(i32 6, i32 0, i32 18, i32 8, i32 0, i32 20, i32 10, i32 0)
store i32 %108, i32* %6
%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, 28
%116 = load i32*, i32** %3
%117 = getelementptr inbounds i32, i32* %116, i64 7
%118 = load i32, i32* %117
%119 = shl i32 %118, 4
%120 = or i32 %115, %119
%121 = load i32*, i32** %3
%122 = getelementptr inbounds i32, i32* %121, i64 6
%123 = load i32, i32* %122
%124 = load i32*, i32** %3
%125 = getelementptr inbounds i32, i32* %124, i64 6
%126 = load i32, i32* %125
%127 = load i32*, i32** %3
%128 = getelementptr inbounds i32, i32* %127, i64 5
%129 = load i32, i32* %128
%130 = ashr i32 %129, 30
%131 = load i32*, i32** %3
%132 = getelementptr inbounds i32, i32* %131, i64 6
%133 = load i32, i32* %132
%134 = shl i32 %133, 2
%135 = or i32 %130, %134
%136 = load i32*, i32** %3
%137 = getelementptr inbounds i32, i32* %136, i64 5
%138 = load i32, i32* %137
%139 = load i32*, i32** %3
%140 = getelementptr inbounds i32, i32* %139, i64 5
%141 = load i32, i32* %140
%142 = load i32*, i32** %3
%143 = getelementptr inbounds i32, i32* %142, i64 5
%144 = load i32, i32* %143
%145 = call i32 @_mm256_set_epi32(i32 %111, i32 %120, i32 %123, i32 %126, i32 %135, i32 %138, i32 %141, i32 %144)
store i32 %145, i32* %7
%146 = load i32, i32* %7
%147 = load i32, i32* %6
%148 = call i32 @_mm256_srlv_epi32(i32 %146, i32 %147)
%149 = load i32, i32* %8
%150 = call i32 @_mm256_and_si256(i32 %148, i32 %149)
store i32 %150, i32* %9
%151 = load i32*, i32** %4
%152 = load i32, i32* %9
%153 = call i32 @_mm256_storeu_si256(i32* %151, i32 %152)
%154 = load i32*, i32** %4
%155 = getelementptr inbounds i32, i32* %154, i64 8
store i32* %155, i32** %4
%156 = call i32 @_mm256_set_epi32(i32 22, i32 12, i32 2, i32 0, i32 14, i32 4, i32 0, i32 16)
store i32 %156, i32* %6
%157 = load i32*, i32** %3
%158 = getelementptr inbounds i32, i32* %157, i64 9
%159 = load i32, i32* %158
%160 = load i32*, i32** %3
%161 = getelementptr inbounds i32, i32* %160, i64 9
%162 = load i32, i32* %161
%163 = load i32*, i32** %3
%164 = getelementptr inbounds i32, i32* %163, i64 9
%165 = load i32, i32* %164
%166 = load i32*, i32** %3
%167 = getelementptr inbounds i32, i32* %166, i64 8
%168 = load i32, i32* %167
%169 = ashr i32 %168, 24
%170 = load i32*, i32** %3
%171 = getelementptr inbounds i32, i32* %170, i64 9
%172 = load i32, i32* %171
%173 = shl i32 %172, 8
%174 = or i32 %169, %173
%175 = load i32*, i32** %3
%176 = getelementptr inbounds i32, i32* %175, i64 8
%177 = load i32, i32* %176
%178 = load i32*, i32** %3
%179 = getelementptr inbounds i32, i32* %178, i64 8
%180 = load i32, i32* %179
%181 = load i32*, i32** %3
%182 = getelementptr inbounds i32, i32* %181, i64 7
%183 = load i32, i32* %182
%184 = ashr i32 %183, 26
%185 = load i32*, i32** %3
%186 = getelementptr inbounds i32, i32* %185, i64 8
%187 = load i32, i32* %186
%188 = shl i32 %187, 6
%189 = or i32 %184, %188
%190 = load i32*, i32** %3
%191 = getelementptr inbounds i32, i32* %190, i64 7
%192 = load i32, i32* %191
%193 = call i32 @_mm256_set_epi32(i32 %159, i32 %162, i32 %165, i32 %174, i32 %177, i32 %180, i32 %189, i32 %192)
store i32 %193, i32* %7
%194 = load i32, i32* %7
%195 = load i32, i32* %6
%196 = call i32 @_mm256_srlv_epi32(i32 %194, i32 %195)
%197 = load i32, i32* %8
%198 = call i32 @_mm256_and_si256(i32 %196, i32 %197)
store i32 %198, i32* %9
%199 = load i32*, i32** %4
%200 = load i32, i32* %9
%201 = call i32 @_mm256_storeu_si256(i32* %199, i32 %200)
%202 = load i32*, i32** %4
%203 = getelementptr inbounds i32, i32* %202, i64 8
store i32* %203, i32** %4
%204 = load i32*, i32** %3
%205 = getelementptr inbounds i32, i32* %204, i64 10
store i32* %205, i32** %3
%206 = load i32*, i32** %3
ret i32* %206
}

LLVM IR (-O2):
define i32* @unpack10_32_avx2(i32* %0, i32* %1) {
%3 = tail call i32 @_mm256_set1_epi32(i32 1023)
%4 = tail call i32 @_mm256_set_epi32(i32 6, i32 0, i32 18, i32 8, i32 0, i32 20, i32 10, i32 0)
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = ashr i32 %8, 28
%10 = shl i32 %6, 4
%11 = or i32 %9, %10
%12 = load i32, i32* %0
%13 = ashr i32 %12, 30
%14 = shl i32 %8, 2
%15 = or i32 %13, %14
%16 = tail call i32 @_mm256_set_epi32(i32 %6, i32 %11, i32 %8, i32 %8, i32 %15, i32 %12, i32 %12, i32 %12)
%17 = tail call i32 @_mm256_srlv_epi32(i32 %16, i32 %4)
%18 = tail call i32 @_mm256_and_si256(i32 %17, i32 %3)
%19 = tail call i32 @_mm256_storeu_si256(i32* %1, i32 %18)
%20 = getelementptr inbounds i32, i32* %1, i64 8
%21 = tail call i32 @_mm256_set_epi32(i32 22, i32 12, i32 2, i32 0, i32 14, i32 4, i32 0, i32 16)
%22 = getelementptr inbounds i32, i32* %0, i64 4
%23 = load i32, i32* %22
%24 = getelementptr inbounds i32, i32* %0, i64 3
%25 = load i32, i32* %24
%26 = ashr i32 %25, 24
%27 = shl i32 %23, 8
%28 = or i32 %26, %27
%29 = load i32, i32* %5
%30 = ashr i32 %29, 26
%31 = shl i32 %25, 6
%32 = or i32 %30, %31
%33 = tail call i32 @_mm256_set_epi32(i32 %23, i32 %23, i32 %23, i32 %28, i32 %25, i32 %25, i32 %32, i32 %29)
%34 = tail call i32 @_mm256_srlv_epi32(i32 %33, i32 %21)
%35 = tail call i32 @_mm256_and_si256(i32 %34, i32 %3)
%36 = tail call i32 @_mm256_storeu_si256(i32* %20, i32 %35)
%37 = getelementptr inbounds i32, i32* %1, i64 16
%38 = tail call i32 @_mm256_set_epi32(i32 6, i32 0, i32 18, i32 8, i32 0, i32 20, i32 10, i32 0)
%39 = getelementptr inbounds i32, i32* %0, i64 7
%40 = load i32, i32* %39
%41 = getelementptr inbounds i32, i32* %0, i64 6
%42 = load i32, i32* %41
%43 = ashr i32 %42, 28
%44 = shl i32 %40, 4
%45 = or i32 %43, %44
%46 = getelementptr inbounds i32, i32* %0, i64 5
%47 = load i32, i32* %46
%48 = ashr i32 %47, 30
%49 = shl i32 %42, 2
%50 = or i32 %48, %49
%51 = tail call i32 @_mm256_set_epi32(i32 %40, i32 %45, i32 %42, i32 %42, i32 %50, i32 %47, i32 %47, i32 %47)
%52 = tail call i32 @_mm256_srlv_epi32(i32 %51, i32 %38)
%53 = tail call i32 @_mm256_and_si256(i32 %52, i32 %3)
%54 = tail call i32 @_mm256_storeu_si256(i32* %37, i32 %53)
%55 = getelementptr inbounds i32, i32* %1, i64 24
%56 = tail call i32 @_mm256_set_epi32(i32 22, i32 12, i32 2, i32 0, i32 14, i32 4, i32 0, i32 16)
%57 = getelementptr inbounds i32, i32* %0, i64 9
%58 = load i32, i32* %57
%59 = getelementptr inbounds i32, i32* %0, i64 8
%60 = load i32, i32* %59
%61 = ashr i32 %60, 24
%62 = shl i32 %58, 8
%63 = or i32 %61, %62
%64 = load i32, i32* %39
%65 = ashr i32 %64, 26
%66 = shl i32 %60, 6
%67 = or i32 %65, %66
%68 = tail call i32 @_mm256_set_epi32(i32 %58, i32 %58, i32 %58, i32 %63, i32 %60, i32 %60, i32 %67, i32 %64)
%69 = tail call i32 @_mm256_srlv_epi32(i32 %68, i32 %56)
%70 = tail call i32 @_mm256_and_si256(i32 %69, i32 %3)
%71 = tail call i32 @_mm256_storeu_si256(i32* %55, i32 %70)
%72 = getelementptr inbounds i32, i32* %0, i64 10
ret i32* %72
}