// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/htscodecs/htscodecs/rANS_static32x16pr_avx2.c
// Function: mm256_i32gather_epi32x
static inline __m256i _mm256_i32gather_epi32x(int *b, __m256i idx, int size) {
    volatile // force the store to happen, hence forcing scalar loads
    int c[8] __attribute__((aligned(32)));
    _mm256_store_si256((__m256i *)c, idx);

    // Fast with modern gccs, and no change with clang.
    // Equivalent to:
    //     return _mm256_set_epi32(b[c[7]], b[c[6]], b[c[5]], b[c[4]],
    //                             b[c[3]], b[c[2]], b[c[1]], b[c[0]]);
    register int bc1 = b[c[1]];
    register int bc3 = b[c[3]];
    register int bc5 = b[c[5]];
    register int bc7 = b[c[7]];

    __m128i x0a = _mm_cvtsi32_si128(b[c[0]]);
    __m128i x1a = _mm_cvtsi32_si128(b[c[2]]);
    __m128i x2a = _mm_cvtsi32_si128(b[c[4]]);
    __m128i x3a = _mm_cvtsi32_si128(b[c[6]]);

    __m128i x0 = _mm_insert_epi32(x0a, bc1, 1);
    __m128i x1 = _mm_insert_epi32(x1a, bc3, 1);
    __m128i x2 = _mm_insert_epi32(x2a, bc5, 1);
    __m128i x3 = _mm_insert_epi32(x3a, bc7, 1);

    __m128i x01 = _mm_unpacklo_epi64(x0, x1);
    __m128i x23 = _mm_unpacklo_epi64(x2, x3);

    __m256i y =_mm256_castsi128_si256(x01);
    return _mm256_inserti128_si256(y, x23, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
andq $-0x20, %rsp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, 0x148(%rsp)
vmovaps %ymm0, 0x120(%rsp)
movl %esi, 0x11c(%rsp)
vmovaps 0x120(%rsp), %ymm0
leaq 0xe0(%rsp), %rax
movq %rax, 0x188(%rsp)
vmovaps %ymm0, 0x160(%rsp)
vmovaps 0x160(%rsp), %ymm0
movq 0x188(%rsp), %rax
vmovaps %ymm0, (%rax)
movq 0x148(%rsp), %rax
movslq 0xe4(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0xdc(%rsp)
movq 0x148(%rsp), %rax
movslq 0xec(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0xd8(%rsp)
movq 0x148(%rsp), %rax
movslq 0xf4(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0xd4(%rsp)
movq 0x148(%rsp), %rax
movslq 0xfc(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0xd0(%rsp)
movq 0x148(%rsp), %rax
movslq 0xe0(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x20c(%rsp)
vmovd 0x20c(%rsp), %xmm0
vmovdqa %xmm0, 0x1f0(%rsp)
vmovdqa 0x1f0(%rsp), %xmm0
vmovdqa %xmm0, 0xc0(%rsp)
movq 0x148(%rsp), %rax
movslq 0xe8(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x1ec(%rsp)
vmovd 0x1ec(%rsp), %xmm0
vmovdqa %xmm0, 0x1d0(%rsp)
vmovdqa 0x1d0(%rsp), %xmm0
vmovdqa %xmm0, 0xb0(%rsp)
movq 0x148(%rsp), %rax
movslq 0xf0(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x1cc(%rsp)
vmovd 0x1cc(%rsp), %xmm0
vmovdqa %xmm0, 0x1b0(%rsp)
vmovdqa 0x1b0(%rsp), %xmm0
vmovdqa %xmm0, 0xa0(%rsp)
movq 0x148(%rsp), %rax
movslq 0xf8(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x1ac(%rsp)
vmovd 0x1ac(%rsp), %xmm0
vmovdqa %xmm0, 0x190(%rsp)
vmovdqa 0x190(%rsp), %xmm0
vmovdqa %xmm0, 0x90(%rsp)
vmovdqa 0xc0(%rsp), %xmm0
movl 0xdc(%rsp), %eax
vpinsrd $0x1, %eax, %xmm0, %xmm0
vmovdqa %xmm0, 0x80(%rsp)
vmovdqa 0xb0(%rsp), %xmm0
movl 0xd8(%rsp), %eax
vpinsrd $0x1, %eax, %xmm0, %xmm0
vmovdqa %xmm0, 0x70(%rsp)
vmovdqa 0xa0(%rsp), %xmm0
movl 0xd4(%rsp), %eax
vpinsrd $0x1, %eax, %xmm0, %xmm0
vmovdqa %xmm0, 0x60(%rsp)
vmovdqa 0x90(%rsp), %xmm0
movl 0xd0(%rsp), %eax
vpinsrd $0x1, %eax, %xmm0, %xmm0
vmovdqa %xmm0, 0x50(%rsp)
vmovdqa 0x80(%rsp), %xmm1
vmovdqa 0x70(%rsp), %xmm0
vmovdqa %xmm1, 0x240(%rsp)
vmovdqa %xmm0, 0x230(%rsp)
vmovdqa 0x240(%rsp), %xmm0
vmovdqa 0x230(%rsp), %xmm1
vpunpcklqdq %xmm1, %xmm0, %xmm0 # xmm0 = xmm0[0],xmm1[0]
vmovdqa %xmm0, 0x40(%rsp)
vmovdqa 0x60(%rsp), %xmm1
vmovdqa 0x50(%rsp), %xmm0
vmovdqa %xmm1, 0x220(%rsp)
vmovdqa %xmm0, 0x210(%rsp)
vmovdqa 0x220(%rsp), %xmm0
vmovdqa 0x210(%rsp), %xmm1
vpunpcklqdq %xmm1, %xmm0, %xmm0 # xmm0 = xmm0[0],xmm1[0]
vmovdqa %xmm0, 0x30(%rsp)
vmovdqa 0x40(%rsp), %xmm0
vmovdqa %xmm0, 0x150(%rsp)
vmovdqa 0x150(%rsp), %xmm0
vmovdqa %xmm1, 0x10(%rsp)
vmovdqa %xmm0, (%rsp)
vmovaps (%rsp), %ymm0
vmovdqa 0x30(%rsp), %xmm1
vinserti128 $0x1, %xmm1, %ymm0, %ymm0
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)