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


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

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

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