// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/dec_sse2.c
// Function: Store16x4_SSE2
static WEBP_INLINE void Store16x4_SSE2(const __m128i* const p1,
                                       const __m128i* const p0,
                                       const __m128i* const q0,
                                       const __m128i* const q1,
                                       uint8_t* r0, uint8_t* r8,
                                       int stride) {
  __m128i t1, p1_s, p0_s, q0_s, q1_s;

  // p0 = 71 70 61 60 51 50 41 40 31 30 21 20 11 10 01 00
  // p1 = f1 f0 e1 e0 d1 d0 c1 c0 b1 b0 a1 a0 91 90 81 80
  t1 = *p0;
  p0_s = _mm_unpacklo_epi8(*p1, t1);
  p1_s = _mm_unpackhi_epi8(*p1, t1);

  // q0 = 73 72 63 62 53 52 43 42 33 32 23 22 13 12 03 02
  // q1 = f3 f2 e3 e2 d3 d2 c3 c2 b3 b2 a3 a2 93 92 83 82
  t1 = *q0;
  q0_s = _mm_unpacklo_epi8(t1, *q1);
  q1_s = _mm_unpackhi_epi8(t1, *q1);

  // p0 = 33 32 31 30 23 22 21 20 13 12 11 10 03 02 01 00
  // q0 = 73 72 71 70 63 62 61 60 53 52 51 50 43 42 41 40
  t1 = p0_s;
  p0_s = _mm_unpacklo_epi16(t1, q0_s);
  q0_s = _mm_unpackhi_epi16(t1, q0_s);

  // p1 = b3 b2 b1 b0 a3 a2 a1 a0 93 92 91 90 83 82 81 80
  // q1 = f3 f2 f1 f0 e3 e2 e1 e0 d3 d2 d1 d0 c3 c2 c1 c0
  t1 = p1_s;
  p1_s = _mm_unpacklo_epi16(t1, q1_s);
  q1_s = _mm_unpackhi_epi16(t1, q1_s);

  Store4x4_SSE2(&p0_s, r0, stride);
  r0 += 4 * stride;
  Store4x4_SSE2(&q0_s, r0, stride);

  Store4x4_SSE2(&p1_s, r8, stride);
  r8 += 4 * stride;
  Store4x4_SSE2(&q1_s, r8, stride);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movl 0x10(%rbp), %eax
movq %rdi, -0x108(%rbp)
movq %rsi, -0x110(%rbp)
movq %rdx, -0x118(%rbp)
movq %rcx, -0x120(%rbp)
movq %r8, -0x128(%rbp)
movq %r9, -0x130(%rbp)
movq -0x110(%rbp), %rax
movaps (%rax), %xmm0
movaps %xmm0, -0x140(%rbp)
movq -0x108(%rbp), %rax
movaps (%rax), %xmm1
movaps -0x140(%rbp), %xmm0
movaps %xmm1, -0xd0(%rbp)
movaps %xmm0, -0xe0(%rbp)
movaps -0xd0(%rbp), %xmm0
movaps -0xe0(%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, -0x160(%rbp)
movq -0x108(%rbp), %rax
movaps (%rax), %xmm1
movaps -0x140(%rbp), %xmm0
movaps %xmm1, -0x10(%rbp)
movaps %xmm0, -0x20(%rbp)
movaps -0x10(%rbp), %xmm0
movaps -0x20(%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]
movaps %xmm0, -0x150(%rbp)
movq -0x118(%rbp), %rax
movaps (%rax), %xmm0
movaps %xmm0, -0x140(%rbp)
movaps -0x140(%rbp), %xmm1
movq -0x120(%rbp), %rax
movaps (%rax), %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, -0x170(%rbp)
movaps -0x140(%rbp), %xmm1
movq -0x120(%rbp), %rax
movaps (%rax), %xmm0
movaps %xmm1, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
movaps -0x30(%rbp), %xmm0
movaps -0x40(%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]
movaps %xmm0, -0x180(%rbp)
movaps -0x160(%rbp), %xmm0
movaps %xmm0, -0x140(%rbp)
movaps -0x140(%rbp), %xmm1
movaps -0x170(%rbp), %xmm0
movaps %xmm1, -0x90(%rbp)
movaps %xmm0, -0xa0(%rbp)
movaps -0x90(%rbp), %xmm0
movaps -0xa0(%rbp), %xmm1
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
movaps %xmm0, -0x160(%rbp)
movaps -0x140(%rbp), %xmm1
movaps -0x170(%rbp), %xmm0
movaps %xmm1, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
movaps -0x50(%rbp), %xmm0
movaps -0x60(%rbp), %xmm1
punpckhwd %xmm1, %xmm0    # xmm0 = xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
movaps %xmm0, -0x170(%rbp)
movaps -0x150(%rbp), %xmm0
movaps %xmm0, -0x140(%rbp)
movaps -0x140(%rbp), %xmm1
movaps -0x180(%rbp), %xmm0
movaps %xmm1, -0xb0(%rbp)
movaps %xmm0, -0xc0(%rbp)
movaps -0xb0(%rbp), %xmm0
movaps -0xc0(%rbp), %xmm1
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
movaps %xmm0, -0x150(%rbp)
movaps -0x140(%rbp), %xmm1
movaps -0x180(%rbp), %xmm0
movaps %xmm1, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
movaps -0x70(%rbp), %xmm0
movaps -0x80(%rbp), %xmm1
punpckhwd %xmm1, %xmm0    # xmm0 = xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
movdqa %xmm0, -0x180(%rbp)
movq -0x128(%rbp), %rsi
movl 0x10(%rbp), %edx
leaq -0x160(%rbp), %rdi
callq 0x161b70
movl 0x10(%rbp), %ecx
shll $0x2, %ecx
movq -0x128(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rsi
movl 0x10(%rbp), %edx
leaq -0x170(%rbp), %rdi
callq 0x161b70
movq -0x130(%rbp), %rsi
movl 0x10(%rbp), %edx
leaq -0x150(%rbp), %rdi
callq 0x161b70
movl 0x10(%rbp), %ecx
shll $0x2, %ecx
movq -0x130(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x130(%rbp)
movq -0x130(%rbp), %rsi
movl 0x10(%rbp), %edx
leaq -0x180(%rbp), %rdi
callq 0x161b70
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq