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


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

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

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