// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/yuv_sse2.c
// Function: RGBA32PackedToPlanar_16b_SSE2
static WEBP_INLINE void RGBA32PackedToPlanar_16b_SSE2(
    const uint16_t* const rgbx,
    __m128i* const r, __m128i* const g, __m128i* const b) {
  const __m128i in0 = LOAD_16(rgbx +  0);  // r0 | g0 | b0 |x| r1 | g1 | b1 |x
  const __m128i in1 = LOAD_16(rgbx +  8);  // r2 | g2 | b2 |x| r3 | g3 | b3 |x
  const __m128i in2 = LOAD_16(rgbx + 16);  // r4 | ...
  const __m128i in3 = LOAD_16(rgbx + 24);  // r6 | ...
  // column-wise transpose
  const __m128i A0 = _mm_unpacklo_epi16(in0, in1);
  const __m128i A1 = _mm_unpackhi_epi16(in0, in1);
  const __m128i A2 = _mm_unpacklo_epi16(in2, in3);
  const __m128i A3 = _mm_unpackhi_epi16(in2, in3);
  const __m128i B0 = _mm_unpacklo_epi16(A0, A1);  // r0 r1 r2 r3 | g0 g1 ..
  const __m128i B1 = _mm_unpackhi_epi16(A0, A1);  // b0 b1 b2 b3 | x x x x
  const __m128i B2 = _mm_unpacklo_epi16(A2, A3);  // r4 r5 r6 r7 | g4 g5 ..
  const __m128i B3 = _mm_unpackhi_epi16(A2, A3);  // b4 b5 b6 b7 | x x x x
  *r = _mm_unpacklo_epi64(B0, B2);
  *g = _mm_unpackhi_epi64(B0, B2);
  *b = _mm_unpacklo_epi64(B1, B3);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rdi, -0x188(%rbp)
movq %rsi, -0x190(%rbp)
movq %rdx, -0x198(%rbp)
movq %rcx, -0x1a0(%rbp)
movq -0x188(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x1b0(%rbp)
movq -0x188(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x1c0(%rbp)
movq -0x188(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x1d0(%rbp)
movq -0x188(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x1e0(%rbp)
movaps -0x1b0(%rbp), %xmm1
movaps -0x1c0(%rbp), %xmm0
movaps %xmm1, -0x110(%rbp)
movaps %xmm0, -0x120(%rbp)
movaps -0x110(%rbp), %xmm0
movaps -0x120(%rbp), %xmm1
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
movaps %xmm0, -0x1f0(%rbp)
movaps -0x1b0(%rbp), %xmm1
movaps -0x1c0(%rbp), %xmm0
movaps %xmm1, -0x90(%rbp)
movaps %xmm0, -0xa0(%rbp)
movaps -0x90(%rbp), %xmm0
movaps -0xa0(%rbp), %xmm1
punpckhwd %xmm1, %xmm0    # xmm0 = xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
movaps %xmm0, -0x200(%rbp)
movaps -0x1d0(%rbp), %xmm1
movaps -0x1e0(%rbp), %xmm0
movaps %xmm1, -0x130(%rbp)
movaps %xmm0, -0x140(%rbp)
movaps -0x130(%rbp), %xmm0
movaps -0x140(%rbp), %xmm1
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
movaps %xmm0, -0x210(%rbp)
movaps -0x1d0(%rbp), %xmm1
movaps -0x1e0(%rbp), %xmm0
movaps %xmm1, -0xb0(%rbp)
movaps %xmm0, -0xc0(%rbp)
movaps -0xb0(%rbp), %xmm0
movaps -0xc0(%rbp), %xmm1
punpckhwd %xmm1, %xmm0    # xmm0 = xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
movaps %xmm0, -0x220(%rbp)
movaps -0x1f0(%rbp), %xmm1
movaps -0x200(%rbp), %xmm0
movaps %xmm1, -0x150(%rbp)
movaps %xmm0, -0x160(%rbp)
movaps -0x150(%rbp), %xmm0
movaps -0x160(%rbp), %xmm1
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
movaps %xmm0, -0x230(%rbp)
movaps -0x1f0(%rbp), %xmm1
movaps -0x200(%rbp), %xmm0
movaps %xmm1, -0xd0(%rbp)
movaps %xmm0, -0xe0(%rbp)
movaps -0xd0(%rbp), %xmm0
movaps -0xe0(%rbp), %xmm1
punpckhwd %xmm1, %xmm0    # xmm0 = xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
movaps %xmm0, -0x240(%rbp)
movaps -0x210(%rbp), %xmm1
movaps -0x220(%rbp), %xmm0
movaps %xmm1, -0x170(%rbp)
movaps %xmm0, -0x180(%rbp)
movaps -0x170(%rbp), %xmm0
movaps -0x180(%rbp), %xmm1
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
movaps %xmm0, -0x250(%rbp)
movaps -0x210(%rbp), %xmm1
movaps -0x220(%rbp), %xmm0
movaps %xmm1, -0xf0(%rbp)
movaps %xmm0, -0x100(%rbp)
movaps -0xf0(%rbp), %xmm0
movaps -0x100(%rbp), %xmm1
punpckhwd %xmm1, %xmm0    # xmm0 = xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
movaps %xmm0, -0x260(%rbp)
movaps -0x230(%rbp), %xmm1
movaps -0x250(%rbp), %xmm0
movaps %xmm1, -0x10(%rbp)
movaps %xmm0, -0x20(%rbp)
movaps -0x10(%rbp), %xmm0
movaps -0x20(%rbp), %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movq -0x190(%rbp), %rax
movaps %xmm0, (%rax)
movaps -0x230(%rbp), %xmm1
movaps -0x250(%rbp), %xmm0
movaps %xmm1, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
movaps -0x50(%rbp), %xmm0
movaps -0x60(%rbp), %xmm1
punpckhqdq %xmm1, %xmm0    # xmm0 = xmm0[1],xmm1[1]
movq -0x198(%rbp), %rax
movaps %xmm0, (%rax)
movaps -0x240(%rbp), %xmm1
movaps -0x260(%rbp), %xmm0
movaps %xmm1, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
movaps -0x30(%rbp), %xmm0
movaps -0x40(%rbp), %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movq -0x1a0(%rbp), %rax
movdqa %xmm0, (%rax)
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
nopl (%rax)