// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/yuv_sse2.c
// Function: PackAndStore4444_SSE2
static WEBP_INLINE void PackAndStore4444_SSE2(const __m128i* const R,
                                              const __m128i* const G,
                                              const __m128i* const B,
                                              const __m128i* const A,
                                              uint8_t* const dst) {
#if (WEBP_SWAP_16BIT_CSP == 0)
  const __m128i rg0 = _mm_packus_epi16(*R, *G);
  const __m128i ba0 = _mm_packus_epi16(*B, *A);
#else
  const __m128i rg0 = _mm_packus_epi16(*B, *A);
  const __m128i ba0 = _mm_packus_epi16(*R, *G);
#endif
  const __m128i mask_0xf0 = _mm_set1_epi8((char)0xf0);
  const __m128i rb1 = _mm_unpacklo_epi8(rg0, ba0);  // rbrbrbrbrb...
  const __m128i ga1 = _mm_unpackhi_epi8(rg0, ba0);  // gagagagaga...
  const __m128i rb2 = _mm_and_si128(rb1, mask_0xf0);
  const __m128i ga2 = _mm_srli_epi16(_mm_and_si128(ga1, mask_0xf0), 4);
  const __m128i rgba4444 = _mm_or_si128(rb2, ga2);
  _mm_storeu_si128((__m128i*)dst, rgba4444);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x148(%rbp)
movq %rsi, -0x150(%rbp)
movq %rdx, -0x158(%rbp)
movq %rcx, -0x160(%rbp)
movq %r8, -0x168(%rbp)
movq -0x148(%rbp), %rax
movaps (%rax), %xmm1
movq -0x150(%rbp), %rax
movaps (%rax), %xmm0
movaps %xmm1, -0x110(%rbp)
movaps %xmm0, -0x120(%rbp)
movaps -0x110(%rbp), %xmm0
movaps -0x120(%rbp), %xmm1
packuswb %xmm1, %xmm0
movaps %xmm0, -0x180(%rbp)
movq -0x158(%rbp), %rax
movaps (%rax), %xmm1
movq -0x160(%rbp), %rax
movaps (%rax), %xmm0
movaps %xmm1, -0x130(%rbp)
movaps %xmm0, -0x140(%rbp)
movaps -0x130(%rbp), %xmm0
movaps -0x140(%rbp), %xmm1
packuswb %xmm1, %xmm0
movaps %xmm0, -0x190(%rbp)
movb $-0x10, -0x81(%rbp)
movb -0x81(%rbp), %al
movb %al, -0x1(%rbp)
movb %al, -0x2(%rbp)
movb %al, -0x3(%rbp)
movb %al, -0x4(%rbp)
movb %al, -0x5(%rbp)
movb %al, -0x6(%rbp)
movb %al, -0x7(%rbp)
movb %al, -0x8(%rbp)
movb %al, -0x9(%rbp)
movb %al, -0xa(%rbp)
movb %al, -0xb(%rbp)
movb %al, -0xc(%rbp)
movb %al, -0xd(%rbp)
movb %al, -0xe(%rbp)
movb %al, -0xf(%rbp)
movb %al, -0x10(%rbp)
movzbl -0x1(%rbp), %eax
movd %eax, %xmm0
movzbl -0x2(%rbp), %eax
movd %eax, %xmm1
punpcklbw %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
movzbl -0x3(%rbp), %eax
movd %eax, %xmm2
movzbl -0x4(%rbp), %eax
movd %eax, %xmm0
punpcklbw %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7]
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
movzbl -0x5(%rbp), %eax
movd %eax, %xmm1
movzbl -0x6(%rbp), %eax
movd %eax, %xmm2
punpcklbw %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3],xmm2[4],xmm1[4],xmm2[5],xmm1[5],xmm2[6],xmm1[6],xmm2[7],xmm1[7]
movzbl -0x7(%rbp), %eax
movd %eax, %xmm3
movzbl -0x8(%rbp), %eax
movd %eax, %xmm1
punpcklbw %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1],xmm1[2],xmm3[2],xmm1[3],xmm3[3],xmm1[4],xmm3[4],xmm1[5],xmm3[5],xmm1[6],xmm3[6],xmm1[7],xmm3[7]
punpcklwd %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3]
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movzbl -0x9(%rbp), %eax
movd %eax, %xmm2
movzbl -0xa(%rbp), %eax
movd %eax, %xmm0
punpcklbw %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7]
movzbl -0xb(%rbp), %eax
movd %eax, %xmm3
movzbl -0xc(%rbp), %eax
movd %eax, %xmm2
punpcklbw %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1],xmm2[2],xmm3[2],xmm2[3],xmm3[3],xmm2[4],xmm3[4],xmm2[5],xmm3[5],xmm2[6],xmm3[6],xmm2[7],xmm3[7]
punpcklwd %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
movzbl -0xd(%rbp), %eax
movd %eax, %xmm0
movzbl -0xe(%rbp), %eax
movd %eax, %xmm3
punpcklbw %xmm0, %xmm3    # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1],xmm3[2],xmm0[2],xmm3[3],xmm0[3],xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
movzbl -0xf(%rbp), %eax
movd %eax, %xmm4
movzbl -0x10(%rbp), %eax
movd %eax, %xmm0
punpcklbw %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1],xmm0[2],xmm4[2],xmm0[3],xmm4[3],xmm0[4],xmm4[4],xmm0[5],xmm4[5],xmm0[6],xmm4[6],xmm0[7],xmm4[7]
punpcklwd %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1],xmm0[2],xmm3[2],xmm0[3],xmm3[3]
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movaps %xmm0, -0x20(%rbp)
movaps -0x20(%rbp), %xmm0
movaps %xmm0, -0x1a0(%rbp)
movaps -0x180(%rbp), %xmm1
movaps -0x190(%rbp), %xmm0
movaps %xmm1, -0xf0(%rbp)
movaps %xmm0, -0x100(%rbp)
movaps -0xf0(%rbp), %xmm0
movaps -0x100(%rbp), %xmm1
punpcklbw %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
movaps %xmm0, -0x1b0(%rbp)
movaps -0x180(%rbp), %xmm1
movaps -0x190(%rbp), %xmm0
movaps %xmm1, -0xb0(%rbp)
movaps %xmm0, -0xc0(%rbp)
movaps -0xb0(%rbp), %xmm0
movaps -0xc0(%rbp), %xmm1
punpckhbw %xmm1, %xmm0    # xmm0 = xmm0[8],xmm1[8],xmm0[9],xmm1[9],xmm0[10],xmm1[10],xmm0[11],xmm1[11],xmm0[12],xmm1[12],xmm0[13],xmm1[13],xmm0[14],xmm1[14],xmm0[15],xmm1[15]
movdqa %xmm0, -0x1c0(%rbp)
movdqa -0x1b0(%rbp), %xmm1
movdqa -0x1a0(%rbp), %xmm0
movdqa %xmm1, -0x50(%rbp)
movdqa %xmm0, -0x60(%rbp)
movdqa -0x50(%rbp), %xmm0
pand -0x60(%rbp), %xmm0
movdqa %xmm0, -0x1d0(%rbp)
movdqa -0x1c0(%rbp), %xmm1
movdqa -0x1a0(%rbp), %xmm0
movdqa %xmm1, -0x70(%rbp)
movdqa %xmm0, -0x80(%rbp)
movdqa -0x70(%rbp), %xmm0
pand -0x80(%rbp), %xmm0
movdqa %xmm0, -0xd0(%rbp)
movl $0x4, -0xd4(%rbp)
movdqa -0xd0(%rbp), %xmm0
movl -0xd4(%rbp), %eax
movd %eax, %xmm1
psrlw %xmm1, %xmm0
movdqa %xmm0, -0x1e0(%rbp)
movdqa -0x1d0(%rbp), %xmm1
movdqa -0x1e0(%rbp), %xmm0
movdqa %xmm1, -0x30(%rbp)
movdqa %xmm0, -0x40(%rbp)
movdqa -0x30(%rbp), %xmm0
por -0x40(%rbp), %xmm0
movdqa %xmm0, -0x1f0(%rbp)
movq -0x168(%rbp), %rax
movdqa -0x1f0(%rbp), %xmm0
movq %rax, -0x90(%rbp)
movdqa %xmm0, -0xa0(%rbp)
movdqa -0xa0(%rbp), %xmm0
movq -0x90(%rbp), %rax
movdqu %xmm0, (%rax)
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopl (%rax)