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


x86 assembly (clang, -O0):
<unpack20_32_avx2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xfffff,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <_mm256_set1_epi32@plt>
mov    %eax,-0x20(%rbp)
mov    $0xc,%edi
xor    %r8d,%r8d
mov    $0x4,%edx
mov    $0x8,%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    0x10(%rax),%edi
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%esi
sar    $0x18,%esi
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
shl    $0x8,%eax
or     %eax,%esi
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
sar    $0x10,%ecx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
shl    $0x10,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%r8d
sar    $0x1c,%r8d
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x4,%eax
or     %eax,%r8d
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%r9d
mov    -0x8(%rbp),%rax
mov    (%rax),%r10d
sar    $0x14,%r10d
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0xc,%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    $0xc,%edi
xor    %r8d,%r8d
mov    $0x4,%edx
mov    $0x8,%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    0x24(%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%esi
sar    $0x18,%esi
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%eax
shl    $0x8,%eax
or     %eax,%esi
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%ecx
sar    $0x10,%ecx
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%eax
shl    $0x10,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%r8d
sar    $0x1c,%r8d
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%eax
shl    $0x4,%eax
or     %eax,%r8d
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%r9d
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%r10d
sar    $0x14,%r10d
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
shl    $0xc,%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    $0xc,%edi
xor    %r8d,%r8d
mov    $0x4,%edx
mov    $0x8,%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    0x38(%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%esi
sar    $0x18,%esi
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%eax
shl    $0x8,%eax
or     %eax,%esi
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%ecx
sar    $0x10,%ecx
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%eax
shl    $0x10,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%r8d
sar    $0x1c,%r8d
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%eax
shl    $0x4,%eax
or     %eax,%r8d
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%r9d
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%r10d
sar    $0x14,%r10d
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%eax
shl    $0xc,%eax
or     %eax,%r10d
mov    -0x8(%rbp),%rax
mov    0x28(%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    $0xc,%edi
xor    %r8d,%r8d
mov    $0x4,%edx
mov    $0x8,%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    0x4c(%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x48(%rax),%esi
sar    $0x18,%esi
mov    -0x8(%rbp),%rax
mov    0x4c(%rax),%eax
shl    $0x8,%eax
or     %eax,%esi
mov    -0x8(%rbp),%rax
mov    0x48(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x44(%rax),%ecx
sar    $0x10,%ecx
mov    -0x8(%rbp),%rax
mov    0x48(%rax),%eax
shl    $0x10,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    0x40(%rax),%r8d
sar    $0x1c,%r8d
mov    -0x8(%rbp),%rax
mov    0x44(%rax),%eax
shl    $0x4,%eax
or     %eax,%r8d
mov    -0x8(%rbp),%rax
mov    0x40(%rax),%r9d
mov    -0x8(%rbp),%rax
mov    0x3c(%rax),%r10d
sar    $0x14,%r10d
mov    -0x8(%rbp),%rax
mov    0x40(%rax),%eax
shl    $0xc,%eax
or     %eax,%r10d
mov    -0x8(%rbp),%rax
mov    0x3c(%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    $0x50,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack20_32_avx2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xfffff,%edi
call   1050 <_mm256_set1_epi32@plt>
mov    %eax,%r15d
mov    $0xc,%edi
xor    %esi,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0x8,%r9d
push   $0x0
push   $0x0
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r12d
mov    0x10(%rbx),%edi
mov    0xc(%rbx),%edx
mov    %edx,%eax
sar    $0x18,%eax
mov    %edi,%esi
shl    $0x8,%esi
or     %eax,%esi
mov    0x8(%rbx),%r8d
mov    %r8d,%eax
sar    $0x10,%eax
mov    %edx,%ecx
shl    $0x10,%ecx
or     %eax,%ecx
mov    (%rbx),%r10d
mov    0x4(%rbx),%r9d
mov    %r9d,%ebp
sar    $0x1c,%ebp
shl    $0x4,%r8d
or     %ebp,%r8d
mov    %r10d,%ebp
sar    $0x14,%ebp
mov    %r9d,%eax
shl    $0xc,%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    %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    $0xc,%edi
xor    %esi,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0x8,%r9d
push   $0x0
push   $0x0
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r13d
mov    0x24(%rbx),%edi
mov    0x20(%rbx),%edx
mov    %edx,%eax
sar    $0x18,%eax
mov    %edi,%esi
shl    $0x8,%esi
or     %eax,%esi
mov    0x1c(%rbx),%r8d
mov    %r8d,%eax
sar    $0x10,%eax
mov    %edx,%ecx
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x14(%rbx),%r10d
mov    0x18(%rbx),%r9d
mov    %r9d,%ebp
sar    $0x1c,%ebp
shl    $0x4,%r8d
or     %ebp,%r8d
mov    %r10d,%ebp
sar    $0x14,%ebp
mov    %r9d,%eax
shl    $0xc,%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    %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    $0xc,%edi
xor    %esi,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0x8,%r9d
push   $0x0
push   $0x0
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r13d
mov    0x38(%rbx),%edi
mov    0x34(%rbx),%edx
mov    %edx,%eax
sar    $0x18,%eax
mov    %edi,%esi
shl    $0x8,%esi
or     %eax,%esi
mov    0x30(%rbx),%r8d
mov    %r8d,%eax
sar    $0x10,%eax
mov    %edx,%ecx
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x28(%rbx),%r10d
mov    0x2c(%rbx),%r9d
mov    %r9d,%ebp
sar    $0x1c,%ebp
shl    $0x4,%r8d
or     %ebp,%r8d
mov    %r10d,%ebp
sar    $0x14,%ebp
mov    %r9d,%eax
shl    $0xc,%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    %r15d,%esi
call   1040 <_mm256_and_si256@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1030 <_mm256_storeu_si256@plt>
add    $0x60,%r14
mov    $0xc,%edi
xor    %esi,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0x8,%r9d
push   $0x0
push   $0x0
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r12d
mov    0x4c(%rbx),%edi
mov    0x48(%rbx),%edx
mov    %edx,%eax
sar    $0x18,%eax
mov    %edi,%esi
shl    $0x8,%esi
or     %eax,%esi
mov    0x44(%rbx),%r8d
mov    %r8d,%eax
sar    $0x10,%eax
mov    %edx,%ecx
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x3c(%rbx),%r10d
mov    0x40(%rbx),%r9d
mov    %r9d,%ebp
sar    $0x1c,%ebp
shl    $0x4,%r8d
or     %ebp,%r8d
mov    %r10d,%ebp
sar    $0x14,%ebp
mov    %r9d,%eax
shl    $0xc,%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    %r15d,%esi
call   1040 <_mm256_and_si256@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <_mm256_storeu_si256@plt>
add    $0x50,%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* @unpack20_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 1048575, 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 12, i32 0, i32 4, i32 0, i32 0, i32 8, 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 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 3
%18 = load i32, i32* %17
%19 = ashr i32 %18, 24
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 4
%22 = load i32, i32* %21
%23 = shl i32 %22, 8
%24 = or i32 %19, %23
%25 = load i32*, i32** %3
%26 = getelementptr inbounds i32, i32* %25, i64 3
%27 = load i32, i32* %26
%28 = load i32*, i32** %3
%29 = getelementptr inbounds i32, i32* %28, i64 2
%30 = load i32, i32* %29
%31 = ashr i32 %30, 16
%32 = load i32*, i32** %3
%33 = getelementptr inbounds i32, i32* %32, i64 3
%34 = load i32, i32* %33
%35 = shl i32 %34, 16
%36 = or i32 %31, %35
%37 = load i32*, i32** %3
%38 = getelementptr inbounds i32, i32* %37, i64 1
%39 = load i32, i32* %38
%40 = ashr i32 %39, 28
%41 = load i32*, i32** %3
%42 = getelementptr inbounds i32, i32* %41, i64 2
%43 = load i32, i32* %42
%44 = shl i32 %43, 4
%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, 20
%53 = load i32*, i32** %3
%54 = getelementptr inbounds i32, i32* %53, i64 1
%55 = load i32, i32* %54
%56 = shl i32 %55, 12
%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 %15, i32 %24, i32 %27, 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 12, i32 0, i32 4, i32 0, i32 0, i32 8, i32 0, i32 0)
store i32 %72, i32* %6
%73 = load i32*, i32** %3
%74 = getelementptr inbounds i32, i32* %73, i64 9
%75 = load i32, i32* %74
%76 = load i32*, i32** %3
%77 = getelementptr inbounds i32, i32* %76, i64 8
%78 = load i32, i32* %77
%79 = ashr i32 %78, 24
%80 = load i32*, i32** %3
%81 = getelementptr inbounds i32, i32* %80, i64 9
%82 = load i32, i32* %81
%83 = shl i32 %82, 8
%84 = or i32 %79, %83
%85 = load i32*, i32** %3
%86 = getelementptr inbounds i32, i32* %85, i64 8
%87 = load i32, i32* %86
%88 = load i32*, i32** %3
%89 = getelementptr inbounds i32, i32* %88, i64 7
%90 = load i32, i32* %89
%91 = ashr i32 %90, 16
%92 = load i32*, i32** %3
%93 = getelementptr inbounds i32, i32* %92, i64 8
%94 = load i32, i32* %93
%95 = shl i32 %94, 16
%96 = or i32 %91, %95
%97 = load i32*, i32** %3
%98 = getelementptr inbounds i32, i32* %97, i64 6
%99 = load i32, i32* %98
%100 = ashr i32 %99, 28
%101 = load i32*, i32** %3
%102 = getelementptr inbounds i32, i32* %101, i64 7
%103 = load i32, i32* %102
%104 = shl i32 %103, 4
%105 = or i32 %100, %104
%106 = load i32*, i32** %3
%107 = getelementptr inbounds i32, i32* %106, i64 6
%108 = load i32, i32* %107
%109 = load i32*, i32** %3
%110 = getelementptr inbounds i32, i32* %109, i64 5
%111 = load i32, i32* %110
%112 = ashr i32 %111, 20
%113 = load i32*, i32** %3
%114 = getelementptr inbounds i32, i32* %113, i64 6
%115 = load i32, i32* %114
%116 = shl i32 %115, 12
%117 = or i32 %112, %116
%118 = load i32*, i32** %3
%119 = getelementptr inbounds i32, i32* %118, i64 5
%120 = load i32, i32* %119
%121 = call i32 @_mm256_set_epi32(i32 %75, i32 %84, i32 %87, 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 12, i32 0, i32 4, i32 0, i32 0, i32 8, i32 0, i32 0)
store i32 %132, i32* %6
%133 = load i32*, i32** %3
%134 = getelementptr inbounds i32, i32* %133, i64 14
%135 = load i32, i32* %134
%136 = load i32*, i32** %3
%137 = getelementptr inbounds i32, i32* %136, i64 13
%138 = load i32, i32* %137
%139 = ashr i32 %138, 24
%140 = load i32*, i32** %3
%141 = getelementptr inbounds i32, i32* %140, i64 14
%142 = load i32, i32* %141
%143 = shl i32 %142, 8
%144 = or i32 %139, %143
%145 = load i32*, i32** %3
%146 = getelementptr inbounds i32, i32* %145, i64 13
%147 = load i32, i32* %146
%148 = load i32*, i32** %3
%149 = getelementptr inbounds i32, i32* %148, i64 12
%150 = load i32, i32* %149
%151 = ashr i32 %150, 16
%152 = load i32*, i32** %3
%153 = getelementptr inbounds i32, i32* %152, i64 13
%154 = load i32, i32* %153
%155 = shl i32 %154, 16
%156 = or i32 %151, %155
%157 = load i32*, i32** %3
%158 = getelementptr inbounds i32, i32* %157, i64 11
%159 = load i32, i32* %158
%160 = ashr i32 %159, 28
%161 = load i32*, i32** %3
%162 = getelementptr inbounds i32, i32* %161, i64 12
%163 = load i32, i32* %162
%164 = shl i32 %163, 4
%165 = or i32 %160, %164
%166 = load i32*, i32** %3
%167 = getelementptr inbounds i32, i32* %166, i64 11
%168 = load i32, i32* %167
%169 = load i32*, i32** %3
%170 = getelementptr inbounds i32, i32* %169, i64 10
%171 = load i32, i32* %170
%172 = ashr i32 %171, 20
%173 = load i32*, i32** %3
%174 = getelementptr inbounds i32, i32* %173, i64 11
%175 = load i32, i32* %174
%176 = shl i32 %175, 12
%177 = or i32 %172, %176
%178 = load i32*, i32** %3
%179 = getelementptr inbounds i32, i32* %178, i64 10
%180 = load i32, i32* %179
%181 = call i32 @_mm256_set_epi32(i32 %135, i32 %144, i32 %147, 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 12, i32 0, i32 4, i32 0, i32 0, i32 8, i32 0, i32 0)
store i32 %192, i32* %6
%193 = load i32*, i32** %3
%194 = getelementptr inbounds i32, i32* %193, i64 19
%195 = load i32, i32* %194
%196 = load i32*, i32** %3
%197 = getelementptr inbounds i32, i32* %196, i64 18
%198 = load i32, i32* %197
%199 = ashr i32 %198, 24
%200 = load i32*, i32** %3
%201 = getelementptr inbounds i32, i32* %200, i64 19
%202 = load i32, i32* %201
%203 = shl i32 %202, 8
%204 = or i32 %199, %203
%205 = load i32*, i32** %3
%206 = getelementptr inbounds i32, i32* %205, i64 18
%207 = load i32, i32* %206
%208 = load i32*, i32** %3
%209 = getelementptr inbounds i32, i32* %208, i64 17
%210 = load i32, i32* %209
%211 = ashr i32 %210, 16
%212 = load i32*, i32** %3
%213 = getelementptr inbounds i32, i32* %212, i64 18
%214 = load i32, i32* %213
%215 = shl i32 %214, 16
%216 = or i32 %211, %215
%217 = load i32*, i32** %3
%218 = getelementptr inbounds i32, i32* %217, i64 16
%219 = load i32, i32* %218
%220 = ashr i32 %219, 28
%221 = load i32*, i32** %3
%222 = getelementptr inbounds i32, i32* %221, i64 17
%223 = load i32, i32* %222
%224 = shl i32 %223, 4
%225 = or i32 %220, %224
%226 = load i32*, i32** %3
%227 = getelementptr inbounds i32, i32* %226, i64 16
%228 = load i32, i32* %227
%229 = load i32*, i32** %3
%230 = getelementptr inbounds i32, i32* %229, i64 15
%231 = load i32, i32* %230
%232 = ashr i32 %231, 20
%233 = load i32*, i32** %3
%234 = getelementptr inbounds i32, i32* %233, i64 16
%235 = load i32, i32* %234
%236 = shl i32 %235, 12
%237 = or i32 %232, %236
%238 = load i32*, i32** %3
%239 = getelementptr inbounds i32, i32* %238, i64 15
%240 = load i32, i32* %239
%241 = call i32 @_mm256_set_epi32(i32 %195, i32 %204, i32 %207, i32 %216, i32 %225, i32 %228, i32 %237, 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 20
store i32* %253, i32** %3
%254 = load i32*, i32** %3
ret i32* %254
}

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