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


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

x86 assembly (clang, -O2):
<unpack30_32_avx2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r13
mov    %rdi,%r15
mov    $0x3fffffff,%edi
call   1050 <_mm256_set1_epi32@plt>
mov    %eax,%r14d
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r12d
mov    0x18(%r15),%esi
mov    %esi,%eax
sar    $0x12,%eax
mov    0x1c(%r15),%edi
shl    $0xe,%edi
or     %eax,%edi
mov    0x14(%r15),%edx
mov    %edx,%eax
sar    $0x14,%eax
shl    $0xc,%esi
or     %eax,%esi
mov    0x10(%r15),%ecx
mov    %ecx,%eax
sar    $0x16,%eax
shl    $0xa,%edx
or     %eax,%edx
mov    0xc(%r15),%r8d
mov    %r8d,%eax
sar    $0x18,%eax
shl    $0x8,%ecx
or     %eax,%ecx
mov    0x8(%r15),%r9d
mov    %r9d,%eax
sar    $0x1a,%eax
shl    $0x6,%r8d
or     %eax,%r8d
mov    (%r15),%r10d
mov    0x4(%r15),%ebp
mov    %ebp,%eax
sar    $0x1c,%eax
shl    $0x4,%r9d
or     %eax,%r9d
mov    %r10d,%eax
sar    $0x1e,%eax
shl    $0x2,%ebp
or     %eax,%ebp
push   %r10
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    %r14d,%esi
mov    %r14d,0xc(%rsp)
call   1040 <_mm256_and_si256@plt>
mov    %r13,0x10(%rsp)
mov    %r13,%rdi
mov    %eax,%esi
call   1030 <_mm256_storeu_si256@plt>
lea    0x20(%r13),%r12
mov    $0x2,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r13d
mov    0x38(%r15),%edi
mov    0x34(%r15),%edx
mov    %edx,%eax
sar    $0x4,%eax
mov    %edi,%esi
shl    $0x1c,%esi
or     %eax,%esi
mov    0x30(%r15),%ecx
mov    %ecx,%eax
sar    $0x6,%eax
shl    $0x1a,%edx
or     %eax,%edx
mov    0x2c(%r15),%r8d
mov    %r8d,%eax
sar    $0x8,%eax
shl    $0x18,%ecx
or     %eax,%ecx
mov    0x28(%r15),%r9d
mov    %r9d,%eax
sar    $0xa,%eax
shl    $0x16,%r8d
or     %eax,%r8d
mov    0x20(%r15),%eax
mov    0x24(%r15),%ebp
mov    %ebp,%ebx
sar    $0xc,%ebx
shl    $0x14,%r9d
or     %ebx,%r9d
mov    %eax,%ebx
sar    $0xe,%ebx
shl    $0x12,%ebp
or     %ebx,%ebp
movswl 0x1e(%r15),%ebx
shl    $0x10,%eax
or     %ebx,%eax
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    %r14d,%esi
call   1040 <_mm256_and_si256@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1030 <_mm256_storeu_si256@plt>
mov    0x10(%rsp),%r14
lea    0x40(%r14),%r12
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r13d
mov    0x54(%r15),%esi
mov    %esi,%eax
sar    $0x12,%eax
mov    0x58(%r15),%edi
shl    $0xe,%edi
or     %eax,%edi
mov    0x50(%r15),%edx
mov    %edx,%eax
sar    $0x14,%eax
shl    $0xc,%esi
or     %eax,%esi
mov    0x4c(%r15),%ecx
mov    %ecx,%eax
sar    $0x16,%eax
shl    $0xa,%edx
or     %eax,%edx
mov    0x48(%r15),%r8d
mov    %r8d,%eax
sar    $0x18,%eax
shl    $0x8,%ecx
or     %eax,%ecx
mov    0x44(%r15),%r9d
mov    %r9d,%eax
sar    $0x1a,%eax
shl    $0x6,%r8d
or     %eax,%r8d
mov    0x3c(%r15),%eax
mov    0x40(%r15),%ebx
mov    %ebx,%ebp
sar    $0x1c,%ebp
shl    $0x4,%r9d
or     %ebp,%r9d
mov    %eax,%ebp
sar    $0x1e,%ebp
shl    $0x2,%ebx
or     %ebp,%ebx
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    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    $0x2,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%r12d
mov    0x74(%r15),%edi
mov    0x70(%r15),%edx
mov    %edx,%eax
sar    $0x4,%eax
mov    %edi,%esi
shl    $0x1c,%esi
or     %eax,%esi
mov    0x6c(%r15),%ecx
mov    %ecx,%eax
sar    $0x6,%eax
shl    $0x1a,%edx
or     %eax,%edx
mov    0x68(%r15),%r8d
mov    %r8d,%eax
sar    $0x8,%eax
shl    $0x18,%ecx
or     %eax,%ecx
mov    0x64(%r15),%r9d
mov    %r9d,%eax
sar    $0xa,%eax
shl    $0x16,%r8d
or     %eax,%r8d
mov    0x5c(%r15),%eax
mov    0x60(%r15),%ebx
mov    %ebx,%ebp
sar    $0xc,%ebp
shl    $0x14,%r9d
or     %ebp,%r9d
mov    %eax,%ebp
sar    $0xe,%ebp
shl    $0x12,%ebx
or     %ebp,%ebx
movswl 0x5a(%r15),%ebp
shl    $0x10,%eax
or     %ebp,%eax
push   %rax
push   %rbx
call   1070 <_mm256_set_epi32@plt>
add    $0x10,%rsp
mov    %eax,%edi
mov    %r12d,%esi
call   1060 <_mm256_srlv_epi32@plt>
mov    %eax,%edi
mov    %r13d,%esi
call   1040 <_mm256_and_si256@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <_mm256_storeu_si256@plt>
add    $0x78,%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* @unpack30_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 1073741823, i32* %5
%10 = load i32, i32* %5
%11 = call i32 @_mm256_set1_epi32(i32 %10)
store i32 %11, i32* %8
%12 = call i32 @_mm256_set_epi32(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
store i32 %12, i32* %6
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 6
%15 = load i32, i32* %14
%16 = ashr i32 %15, 18
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 7
%19 = load i32, i32* %18
%20 = shl i32 %19, 14
%21 = or i32 %16, %20
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 5
%24 = load i32, i32* %23
%25 = ashr i32 %24, 20
%26 = load i32*, i32** %3
%27 = getelementptr inbounds i32, i32* %26, i64 6
%28 = load i32, i32* %27
%29 = shl i32 %28, 12
%30 = or i32 %25, %29
%31 = load i32*, i32** %3
%32 = getelementptr inbounds i32, i32* %31, i64 4
%33 = load i32, i32* %32
%34 = ashr i32 %33, 22
%35 = load i32*, i32** %3
%36 = getelementptr inbounds i32, i32* %35, i64 5
%37 = load i32, i32* %36
%38 = shl i32 %37, 10
%39 = or i32 %34, %38
%40 = load i32*, i32** %3
%41 = getelementptr inbounds i32, i32* %40, i64 3
%42 = load i32, i32* %41
%43 = ashr i32 %42, 24
%44 = load i32*, i32** %3
%45 = getelementptr inbounds i32, i32* %44, i64 4
%46 = load i32, i32* %45
%47 = shl i32 %46, 8
%48 = or i32 %43, %47
%49 = load i32*, i32** %3
%50 = getelementptr inbounds i32, i32* %49, i64 2
%51 = load i32, i32* %50
%52 = ashr i32 %51, 26
%53 = load i32*, i32** %3
%54 = getelementptr inbounds i32, i32* %53, i64 3
%55 = load i32, i32* %54
%56 = shl i32 %55, 6
%57 = or i32 %52, %56
%58 = load i32*, i32** %3
%59 = getelementptr inbounds i32, i32* %58, i64 1
%60 = load i32, i32* %59
%61 = ashr i32 %60, 28
%62 = load i32*, i32** %3
%63 = getelementptr inbounds i32, i32* %62, i64 2
%64 = load i32, i32* %63
%65 = shl i32 %64, 4
%66 = or i32 %61, %65
%67 = load i32*, i32** %3
%68 = getelementptr inbounds i32, i32* %67, i64 0
%69 = load i32, i32* %68
%70 = ashr i32 %69, 30
%71 = load i32*, i32** %3
%72 = getelementptr inbounds i32, i32* %71, i64 1
%73 = load i32, i32* %72
%74 = shl i32 %73, 2
%75 = or i32 %70, %74
%76 = load i32*, i32** %3
%77 = getelementptr inbounds i32, i32* %76, i64 0
%78 = load i32, i32* %77
%79 = call i32 @_mm256_set_epi32(i32 %21, i32 %30, i32 %39, i32 %48, i32 %57, i32 %66, i32 %75, i32 %78)
store i32 %79, i32* %7
%80 = load i32, i32* %7
%81 = load i32, i32* %6
%82 = call i32 @_mm256_srlv_epi32(i32 %80, i32 %81)
%83 = load i32, i32* %8
%84 = call i32 @_mm256_and_si256(i32 %82, i32 %83)
store i32 %84, i32* %9
%85 = load i32*, i32** %4
%86 = load i32, i32* %9
%87 = call i32 @_mm256_storeu_si256(i32* %85, i32 %86)
%88 = load i32*, i32** %4
%89 = getelementptr inbounds i32, i32* %88, i64 8
store i32* %89, i32** %4
%90 = call i32 @_mm256_set_epi32(i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
store i32 %90, i32* %6
%91 = load i32*, i32** %3
%92 = getelementptr inbounds i32, i32* %91, i64 14
%93 = load i32, i32* %92
%94 = load i32*, i32** %3
%95 = getelementptr inbounds i32, i32* %94, i64 13
%96 = load i32, i32* %95
%97 = ashr i32 %96, 4
%98 = load i32*, i32** %3
%99 = getelementptr inbounds i32, i32* %98, i64 14
%100 = load i32, i32* %99
%101 = shl i32 %100, 28
%102 = or i32 %97, %101
%103 = load i32*, i32** %3
%104 = getelementptr inbounds i32, i32* %103, i64 12
%105 = load i32, i32* %104
%106 = ashr i32 %105, 6
%107 = load i32*, i32** %3
%108 = getelementptr inbounds i32, i32* %107, i64 13
%109 = load i32, i32* %108
%110 = shl i32 %109, 26
%111 = or i32 %106, %110
%112 = load i32*, i32** %3
%113 = getelementptr inbounds i32, i32* %112, i64 11
%114 = load i32, i32* %113
%115 = ashr i32 %114, 8
%116 = load i32*, i32** %3
%117 = getelementptr inbounds i32, i32* %116, i64 12
%118 = load i32, i32* %117
%119 = shl i32 %118, 24
%120 = or i32 %115, %119
%121 = load i32*, i32** %3
%122 = getelementptr inbounds i32, i32* %121, i64 10
%123 = load i32, i32* %122
%124 = ashr i32 %123, 10
%125 = load i32*, i32** %3
%126 = getelementptr inbounds i32, i32* %125, i64 11
%127 = load i32, i32* %126
%128 = shl i32 %127, 22
%129 = or i32 %124, %128
%130 = load i32*, i32** %3
%131 = getelementptr inbounds i32, i32* %130, i64 9
%132 = load i32, i32* %131
%133 = ashr i32 %132, 12
%134 = load i32*, i32** %3
%135 = getelementptr inbounds i32, i32* %134, i64 10
%136 = load i32, i32* %135
%137 = shl i32 %136, 20
%138 = or i32 %133, %137
%139 = load i32*, i32** %3
%140 = getelementptr inbounds i32, i32* %139, i64 8
%141 = load i32, i32* %140
%142 = ashr i32 %141, 14
%143 = load i32*, i32** %3
%144 = getelementptr inbounds i32, i32* %143, i64 9
%145 = load i32, i32* %144
%146 = shl i32 %145, 18
%147 = or i32 %142, %146
%148 = load i32*, i32** %3
%149 = getelementptr inbounds i32, i32* %148, i64 7
%150 = load i32, i32* %149
%151 = ashr i32 %150, 16
%152 = load i32*, i32** %3
%153 = getelementptr inbounds i32, i32* %152, i64 8
%154 = load i32, i32* %153
%155 = shl i32 %154, 16
%156 = or i32 %151, %155
%157 = call i32 @_mm256_set_epi32(i32 %93, i32 %102, i32 %111, i32 %120, i32 %129, i32 %138, i32 %147, i32 %156)
store i32 %157, i32* %7
%158 = load i32, i32* %7
%159 = load i32, i32* %6
%160 = call i32 @_mm256_srlv_epi32(i32 %158, i32 %159)
%161 = load i32, i32* %8
%162 = call i32 @_mm256_and_si256(i32 %160, i32 %161)
store i32 %162, i32* %9
%163 = load i32*, i32** %4
%164 = load i32, i32* %9
%165 = call i32 @_mm256_storeu_si256(i32* %163, i32 %164)
%166 = load i32*, i32** %4
%167 = getelementptr inbounds i32, i32* %166, i64 8
store i32* %167, i32** %4
%168 = call i32 @_mm256_set_epi32(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
store i32 %168, i32* %6
%169 = load i32*, i32** %3
%170 = getelementptr inbounds i32, i32* %169, i64 21
%171 = load i32, i32* %170
%172 = ashr i32 %171, 18
%173 = load i32*, i32** %3
%174 = getelementptr inbounds i32, i32* %173, i64 22
%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 20
%180 = load i32, i32* %179
%181 = ashr i32 %180, 20
%182 = load i32*, i32** %3
%183 = getelementptr inbounds i32, i32* %182, i64 21
%184 = load i32, i32* %183
%185 = shl i32 %184, 12
%186 = or i32 %181, %185
%187 = load i32*, i32** %3
%188 = getelementptr inbounds i32, i32* %187, i64 19
%189 = load i32, i32* %188
%190 = ashr i32 %189, 22
%191 = load i32*, i32** %3
%192 = getelementptr inbounds i32, i32* %191, i64 20
%193 = load i32, i32* %192
%194 = shl i32 %193, 10
%195 = or i32 %190, %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 17
%207 = load i32, i32* %206
%208 = ashr i32 %207, 26
%209 = load i32*, i32** %3
%210 = getelementptr inbounds i32, i32* %209, i64 18
%211 = load i32, i32* %210
%212 = shl i32 %211, 6
%213 = or i32 %208, %212
%214 = load i32*, i32** %3
%215 = getelementptr inbounds i32, i32* %214, i64 16
%216 = load i32, i32* %215
%217 = ashr i32 %216, 28
%218 = load i32*, i32** %3
%219 = getelementptr inbounds i32, i32* %218, i64 17
%220 = load i32, i32* %219
%221 = shl i32 %220, 4
%222 = or i32 %217, %221
%223 = load i32*, i32** %3
%224 = getelementptr inbounds i32, i32* %223, i64 15
%225 = load i32, i32* %224
%226 = ashr i32 %225, 30
%227 = load i32*, i32** %3
%228 = getelementptr inbounds i32, i32* %227, i64 16
%229 = load i32, i32* %228
%230 = shl i32 %229, 2
%231 = or i32 %226, %230
%232 = load i32*, i32** %3
%233 = getelementptr inbounds i32, i32* %232, i64 15
%234 = load i32, i32* %233
%235 = call i32 @_mm256_set_epi32(i32 %177, i32 %186, i32 %195, i32 %204, i32 %213, i32 %222, i32 %231, i32 %234)
store i32 %235, i32* %7
%236 = load i32, i32* %7
%237 = load i32, i32* %6
%238 = call i32 @_mm256_srlv_epi32(i32 %236, i32 %237)
%239 = load i32, i32* %8
%240 = call i32 @_mm256_and_si256(i32 %238, i32 %239)
store i32 %240, i32* %9
%241 = load i32*, i32** %4
%242 = load i32, i32* %9
%243 = call i32 @_mm256_storeu_si256(i32* %241, i32 %242)
%244 = load i32*, i32** %4
%245 = getelementptr inbounds i32, i32* %244, i64 8
store i32* %245, i32** %4
%246 = call i32 @_mm256_set_epi32(i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
store i32 %246, i32* %6
%247 = load i32*, i32** %3
%248 = getelementptr inbounds i32, i32* %247, i64 29
%249 = load i32, i32* %248
%250 = load i32*, i32** %3
%251 = getelementptr inbounds i32, i32* %250, i64 28
%252 = load i32, i32* %251
%253 = ashr i32 %252, 4
%254 = load i32*, i32** %3
%255 = getelementptr inbounds i32, i32* %254, i64 29
%256 = load i32, i32* %255
%257 = shl i32 %256, 28
%258 = or i32 %253, %257
%259 = load i32*, i32** %3
%260 = getelementptr inbounds i32, i32* %259, i64 27
%261 = load i32, i32* %260
%262 = ashr i32 %261, 6
%263 = load i32*, i32** %3
%264 = getelementptr inbounds i32, i32* %263, i64 28
%265 = load i32, i32* %264
%266 = shl i32 %265, 26
%267 = or i32 %262, %266
%268 = load i32*, i32** %3
%269 = getelementptr inbounds i32, i32* %268, i64 26
%270 = load i32, i32* %269
%271 = ashr i32 %270, 8
%272 = load i32*, i32** %3
%273 = getelementptr inbounds i32, i32* %272, i64 27
%274 = load i32, i32* %273
%275 = shl i32 %274, 24
%276 = or i32 %271, %275
%277 = load i32*, i32** %3
%278 = getelementptr inbounds i32, i32* %277, i64 25
%279 = load i32, i32* %278
%280 = ashr i32 %279, 10
%281 = load i32*, i32** %3
%282 = getelementptr inbounds i32, i32* %281, i64 26
%283 = load i32, i32* %282
%284 = shl i32 %283, 22
%285 = or i32 %280, %284
%286 = load i32*, i32** %3
%287 = getelementptr inbounds i32, i32* %286, i64 24
%288 = load i32, i32* %287
%289 = ashr i32 %288, 12
%290 = load i32*, i32** %3
%291 = getelementptr inbounds i32, i32* %290, i64 25
%292 = load i32, i32* %291
%293 = shl i32 %292, 20
%294 = or i32 %289, %293
%295 = load i32*, i32** %3
%296 = getelementptr inbounds i32, i32* %295, i64 23
%297 = load i32, i32* %296
%298 = ashr i32 %297, 14
%299 = load i32*, i32** %3
%300 = getelementptr inbounds i32, i32* %299, i64 24
%301 = load i32, i32* %300
%302 = shl i32 %301, 18
%303 = or i32 %298, %302
%304 = load i32*, i32** %3
%305 = getelementptr inbounds i32, i32* %304, i64 22
%306 = load i32, i32* %305
%307 = ashr i32 %306, 16
%308 = load i32*, i32** %3
%309 = getelementptr inbounds i32, i32* %308, i64 23
%310 = load i32, i32* %309
%311 = shl i32 %310, 16
%312 = or i32 %307, %311
%313 = call i32 @_mm256_set_epi32(i32 %249, i32 %258, i32 %267, i32 %276, i32 %285, i32 %294, i32 %303, i32 %312)
store i32 %313, i32* %7
%314 = load i32, i32* %7
%315 = load i32, i32* %6
%316 = call i32 @_mm256_srlv_epi32(i32 %314, i32 %315)
%317 = load i32, i32* %8
%318 = call i32 @_mm256_and_si256(i32 %316, i32 %317)
store i32 %318, i32* %9
%319 = load i32*, i32** %4
%320 = load i32, i32* %9
%321 = call i32 @_mm256_storeu_si256(i32* %319, i32 %320)
%322 = load i32*, i32** %4
%323 = getelementptr inbounds i32, i32* %322, i64 8
store i32* %323, i32** %4
%324 = load i32*, i32** %3
%325 = getelementptr inbounds i32, i32* %324, i64 30
store i32* %325, i32** %3
%326 = load i32*, i32** %3
ret i32* %326
}

LLVM IR (-O2):
define i32* @unpack30_32_avx2(i32* %0, i32* %1) {
%3 = tail call i32 @_mm256_set1_epi32(i32 1073741823)
%4 = tail call i32 @_mm256_set_epi32(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%5 = getelementptr inbounds i32, i32* %0, i64 6
%6 = load i32, i32* %5
%7 = ashr i32 %6, 18
%8 = getelementptr inbounds i32, i32* %0, i64 7
%9 = load i32, i32* %8
%10 = shl i32 %9, 14
%11 = or i32 %10, %7
%12 = getelementptr inbounds i32, i32* %0, i64 5
%13 = load i32, i32* %12
%14 = ashr i32 %13, 20
%15 = shl i32 %6, 12
%16 = or i32 %14, %15
%17 = getelementptr inbounds i32, i32* %0, i64 4
%18 = load i32, i32* %17
%19 = ashr i32 %18, 22
%20 = shl i32 %13, 10
%21 = or i32 %19, %20
%22 = getelementptr inbounds i32, i32* %0, i64 3
%23 = load i32, i32* %22
%24 = ashr i32 %23, 24
%25 = shl i32 %18, 8
%26 = or i32 %24, %25
%27 = getelementptr inbounds i32, i32* %0, i64 2
%28 = load i32, i32* %27
%29 = ashr i32 %28, 26
%30 = shl i32 %23, 6
%31 = or i32 %29, %30
%32 = getelementptr inbounds i32, i32* %0, i64 1
%33 = load i32, i32* %32
%34 = ashr i32 %33, 28
%35 = shl i32 %28, 4
%36 = or i32 %34, %35
%37 = load i32, i32* %0
%38 = ashr i32 %37, 30
%39 = shl i32 %33, 2
%40 = or i32 %38, %39
%41 = tail call i32 @_mm256_set_epi32(i32 %11, i32 %16, i32 %21, i32 %26, i32 %31, i32 %36, i32 %40, i32 %37)
%42 = tail call i32 @_mm256_srlv_epi32(i32 %41, i32 %4)
%43 = tail call i32 @_mm256_and_si256(i32 %42, i32 %3)
%44 = tail call i32 @_mm256_storeu_si256(i32* %1, i32 %43)
%45 = getelementptr inbounds i32, i32* %1, i64 8
%46 = tail call i32 @_mm256_set_epi32(i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%47 = getelementptr inbounds i32, i32* %0, i64 14
%48 = load i32, i32* %47
%49 = getelementptr inbounds i32, i32* %0, i64 13
%50 = load i32, i32* %49
%51 = ashr i32 %50, 4
%52 = shl i32 %48, 28
%53 = or i32 %51, %52
%54 = getelementptr inbounds i32, i32* %0, i64 12
%55 = load i32, i32* %54
%56 = ashr i32 %55, 6
%57 = shl i32 %50, 26
%58 = or i32 %56, %57
%59 = getelementptr inbounds i32, i32* %0, i64 11
%60 = load i32, i32* %59
%61 = ashr i32 %60, 8
%62 = shl i32 %55, 24
%63 = or i32 %61, %62
%64 = getelementptr inbounds i32, i32* %0, i64 10
%65 = load i32, i32* %64
%66 = ashr i32 %65, 10
%67 = shl i32 %60, 22
%68 = or i32 %66, %67
%69 = getelementptr inbounds i32, i32* %0, i64 9
%70 = load i32, i32* %69
%71 = ashr i32 %70, 12
%72 = shl i32 %65, 20
%73 = or i32 %71, %72
%74 = getelementptr inbounds i32, i32* %0, i64 8
%75 = load i32, i32* %74
%76 = ashr i32 %75, 14
%77 = shl i32 %70, 18
%78 = or i32 %76, %77
%79 = load i32, i32* %8
%80 = ashr i32 %79, 16
%81 = shl i32 %75, 16
%82 = or i32 %80, %81
%83 = tail call i32 @_mm256_set_epi32(i32 %48, i32 %53, i32 %58, i32 %63, i32 %68, i32 %73, i32 %78, i32 %82)
%84 = tail call i32 @_mm256_srlv_epi32(i32 %83, i32 %46)
%85 = tail call i32 @_mm256_and_si256(i32 %84, i32 %3)
%86 = tail call i32 @_mm256_storeu_si256(i32* %45, i32 %85)
%87 = getelementptr inbounds i32, i32* %1, i64 16
%88 = tail call i32 @_mm256_set_epi32(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%89 = getelementptr inbounds i32, i32* %0, i64 21
%90 = load i32, i32* %89
%91 = ashr i32 %90, 18
%92 = getelementptr inbounds i32, i32* %0, i64 22
%93 = load i32, i32* %92
%94 = shl i32 %93, 14
%95 = or i32 %94, %91
%96 = getelementptr inbounds i32, i32* %0, i64 20
%97 = load i32, i32* %96
%98 = ashr i32 %97, 20
%99 = shl i32 %90, 12
%100 = or i32 %98, %99
%101 = getelementptr inbounds i32, i32* %0, i64 19
%102 = load i32, i32* %101
%103 = ashr i32 %102, 22
%104 = shl i32 %97, 10
%105 = or i32 %103, %104
%106 = getelementptr inbounds i32, i32* %0, i64 18
%107 = load i32, i32* %106
%108 = ashr i32 %107, 24
%109 = shl i32 %102, 8
%110 = or i32 %108, %109
%111 = getelementptr inbounds i32, i32* %0, i64 17
%112 = load i32, i32* %111
%113 = ashr i32 %112, 26
%114 = shl i32 %107, 6
%115 = or i32 %113, %114
%116 = getelementptr inbounds i32, i32* %0, i64 16
%117 = load i32, i32* %116
%118 = ashr i32 %117, 28
%119 = shl i32 %112, 4
%120 = or i32 %118, %119
%121 = getelementptr inbounds i32, i32* %0, i64 15
%122 = load i32, i32* %121
%123 = ashr i32 %122, 30
%124 = shl i32 %117, 2
%125 = or i32 %123, %124
%126 = tail call i32 @_mm256_set_epi32(i32 %95, i32 %100, i32 %105, i32 %110, i32 %115, i32 %120, i32 %125, i32 %122)
%127 = tail call i32 @_mm256_srlv_epi32(i32 %126, i32 %88)
%128 = tail call i32 @_mm256_and_si256(i32 %127, i32 %3)
%129 = tail call i32 @_mm256_storeu_si256(i32* %87, i32 %128)
%130 = getelementptr inbounds i32, i32* %1, i64 24
%131 = tail call i32 @_mm256_set_epi32(i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%132 = getelementptr inbounds i32, i32* %0, i64 29
%133 = load i32, i32* %132
%134 = getelementptr inbounds i32, i32* %0, i64 28
%135 = load i32, i32* %134
%136 = ashr i32 %135, 4
%137 = shl i32 %133, 28
%138 = or i32 %136, %137
%139 = getelementptr inbounds i32, i32* %0, i64 27
%140 = load i32, i32* %139
%141 = ashr i32 %140, 6
%142 = shl i32 %135, 26
%143 = or i32 %141, %142
%144 = getelementptr inbounds i32, i32* %0, i64 26
%145 = load i32, i32* %144
%146 = ashr i32 %145, 8
%147 = shl i32 %140, 24
%148 = or i32 %146, %147
%149 = getelementptr inbounds i32, i32* %0, i64 25
%150 = load i32, i32* %149
%151 = ashr i32 %150, 10
%152 = shl i32 %145, 22
%153 = or i32 %151, %152
%154 = getelementptr inbounds i32, i32* %0, i64 24
%155 = load i32, i32* %154
%156 = ashr i32 %155, 12
%157 = shl i32 %150, 20
%158 = or i32 %156, %157
%159 = getelementptr inbounds i32, i32* %0, i64 23
%160 = load i32, i32* %159
%161 = ashr i32 %160, 14
%162 = shl i32 %155, 18
%163 = or i32 %161, %162
%164 = load i32, i32* %92
%165 = ashr i32 %164, 16
%166 = shl i32 %160, 16
%167 = or i32 %165, %166
%168 = tail call i32 @_mm256_set_epi32(i32 %133, i32 %138, i32 %143, i32 %148, i32 %153, i32 %158, i32 %163, i32 %167)
%169 = tail call i32 @_mm256_srlv_epi32(i32 %168, i32 %131)
%170 = tail call i32 @_mm256_and_si256(i32 %169, i32 %3)
%171 = tail call i32 @_mm256_storeu_si256(i32* %130, i32 %170)
%172 = getelementptr inbounds i32, i32* %0, i64 30
ret i32* %172
}