// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dsp/dec_sse2.c
// Function: HFilter8i_SSE2
static WEBP_INLINE void Load8x4_SSE2(const uint8_t* const b, int stride,
                                     __m128i* const p, __m128i* const q) {
  // A0 = 63 62 61 60 23 22 21 20 43 42 41 40 03 02 01 00
  // A1 = 73 72 71 70 33 32 31 30 53 52 51 50 13 12 11 10
  const __m128i A0 = _mm_set_epi32(
      WebPMemToInt32(&b[6 * stride]), WebPMemToInt32(&b[2 * stride]),
      WebPMemToInt32(&b[4 * stride]), WebPMemToInt32(&b[0 * stride]));
  const __m128i A1 = _mm_set_epi32(
      WebPMemToInt32(&b[7 * stride]), WebPMemToInt32(&b[3 * stride]),
      WebPMemToInt32(&b[5 * stride]), WebPMemToInt32(&b[1 * stride]));

  // B0 = 53 43 52 42 51 41 50 40 13 03 12 02 11 01 10 00
  // B1 = 73 63 72 62 71 61 70 60 33 23 32 22 31 21 30 20
  const __m128i B0 = _mm_unpacklo_epi8(A0, A1);
  const __m128i B1 = _mm_unpackhi_epi8(A0, A1);

  // C0 = 33 23 13 03 32 22 12 02 31 21 11 01 30 20 10 00
  // C1 = 73 63 53 43 72 62 52 42 71 61 51 41 70 60 50 40
  const __m128i C0 = _mm_unpacklo_epi16(B0, B1);
  const __m128i C1 = _mm_unpackhi_epi16(B0, B1);

  // *p = 71 61 51 41 31 21 11 01 70 60 50 40 30 20 10 00
  // *q = 73 63 53 43 33 23 13 03 72 62 52 42 32 22 12 02
  *p = _mm_unpacklo_epi32(C0, C1);
  *q = _mm_unpackhi_epi32(C0, C1);
}

// Assembly:
pushq %r14
pushq %rbx
movslq %edx, %rax
leaq (%rax,%rax), %rdx
leaq (%rdx,%rdx,2), %r10
leaq (,%rax,4), %rdx
movd (%rdi,%rax,2), %xmm1
movd (%rdi,%r10), %xmm0
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd (%rdi,%rax,4), %xmm0
movd (%rdi), %xmm2
punpckldq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
leaq (,%rax,8), %rbx
subq %rax, %rbx
leaq (%rax,%rax,2), %r14
leaq (%rax,%rax,4), %r11
movd (%rdi,%r14), %xmm0
movd (%rdi,%rbx), %xmm3
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
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]
movd (%rdi,%rax), %xmm0
movd (%rdi,%r11), %xmm3
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
punpcklbw %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3],xmm2[4],xmm0[4],xmm2[5],xmm0[5],xmm2[6],xmm0[6],xmm2[7],xmm0[7]
movdqa %xmm2, %xmm0
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
punpckhwd %xmm1, %xmm2    # xmm2 = xmm2[4],xmm1[4],xmm2[5],xmm1[5],xmm2[6],xmm1[6],xmm2[7],xmm1[7]
movdqa %xmm0, %xmm5
punpckldq %xmm2, %xmm5    # xmm5 = xmm5[0],xmm2[0],xmm5[1],xmm2[1]
punpckhdq %xmm2, %xmm0    # xmm0 = xmm0[2],xmm2[2],xmm0[3],xmm2[3]
movd (%rsi,%rax,2), %xmm1
movd (%rsi,%r10), %xmm2
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movd (%rsi,%rax,4), %xmm2
movd (%rsi), %xmm3
punpckldq %xmm2, %xmm3    # xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
movd (%rsi,%r14), %xmm2
movd (%rsi,%rbx), %xmm4
punpckldq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
punpcklbw %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3],xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7]
movd (%rsi,%rax), %xmm2
movd (%rsi,%r11), %xmm4
punpckldq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
punpcklbw %xmm2, %xmm3    # xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1],xmm3[2],xmm2[2],xmm3[3],xmm2[3],xmm3[4],xmm2[4],xmm3[5],xmm2[5],xmm3[6],xmm2[6],xmm3[7],xmm2[7]
movdqa %xmm3, %xmm4
punpcklwd %xmm1, %xmm4    # xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1],xmm4[2],xmm1[2],xmm4[3],xmm1[3]
punpckhwd %xmm1, %xmm3    # xmm3 = xmm3[4],xmm1[4],xmm3[5],xmm1[5],xmm3[6],xmm1[6],xmm3[7],xmm1[7]
movdqa %xmm4, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
punpckhdq %xmm3, %xmm4    # xmm4 = xmm4[2],xmm3[2],xmm4[3],xmm3[3]
movdqa %xmm5, %xmm6
punpcklqdq %xmm1, %xmm6    # xmm6 = xmm6[0],xmm1[0]
punpckhqdq %xmm1, %xmm5    # xmm5 = xmm5[1],xmm1[1]
movdqa %xmm0, %xmm2
punpcklqdq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0]
punpckhqdq %xmm4, %xmm0    # xmm0 = xmm0[1],xmm4[1]
movdqa %xmm0, %xmm1
psubusb %xmm2, %xmm1
movdqa %xmm2, %xmm4
psubusb %xmm0, %xmm4
por %xmm1, %xmm4
movdqa %xmm5, %xmm1
psubusb %xmm6, %xmm1
psubusb %xmm5, %xmm6
por %xmm1, %xmm6
pmaxub %xmm4, %xmm6
movdqa %xmm2, %xmm1
psubusb %xmm5, %xmm1
psubusb %xmm2, %xmm5
por %xmm1, %xmm5
movd 0x4(%rdi,%rax,2), %xmm1
movd 0x4(%rdi,%r10), %xmm3
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
movd 0x4(%rdi,%rax,4), %xmm3
movd 0x4(%rdi), %xmm7
punpckldq %xmm3, %xmm7    # xmm7 = xmm7[0],xmm3[0],xmm7[1],xmm3[1]
movd 0x4(%rdi,%r14), %xmm3
movd 0x4(%rdi,%rbx), %xmm8
punpckldq %xmm8, %xmm3    # xmm3 = xmm3[0],xmm8[0],xmm3[1],xmm8[1]
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]
movd 0x4(%rdi,%rax), %xmm3
movd 0x4(%rdi,%r11), %xmm8
punpckldq %xmm8, %xmm3    # xmm3 = xmm3[0],xmm8[0],xmm3[1],xmm8[1]
punpcklbw %xmm3, %xmm7    # xmm7 = xmm7[0],xmm3[0],xmm7[1],xmm3[1],xmm7[2],xmm3[2],xmm7[3],xmm3[3],xmm7[4],xmm3[4],xmm7[5],xmm3[5],xmm7[6],xmm3[6],xmm7[7],xmm3[7]
movdqa %xmm7, %xmm8
punpcklwd %xmm1, %xmm8    # xmm8 = xmm8[0],xmm1[0],xmm8[1],xmm1[1],xmm8[2],xmm1[2],xmm8[3],xmm1[3]
punpckhwd %xmm1, %xmm7    # xmm7 = xmm7[4],xmm1[4],xmm7[5],xmm1[5],xmm7[6],xmm1[6],xmm7[7],xmm1[7]
movdqa %xmm8, %xmm3
punpckldq %xmm7, %xmm3    # xmm3 = xmm3[0],xmm7[0],xmm3[1],xmm7[1]
punpckhdq %xmm7, %xmm8    # xmm8 = xmm8[2],xmm7[2],xmm8[3],xmm7[3]
movd 0x4(%rsi,%rax,2), %xmm1
movd 0x4(%rsi,%r10), %xmm7
punpckldq %xmm7, %xmm1    # xmm1 = xmm1[0],xmm7[0],xmm1[1],xmm7[1]
movd 0x4(%rsi,%rax,4), %xmm7
movd 0x4(%rsi), %xmm9
punpckldq %xmm7, %xmm9    # xmm9 = xmm9[0],xmm7[0],xmm9[1],xmm7[1]
movd 0x4(%rsi,%r14), %xmm7
movd 0x4(%rsi,%rbx), %xmm10
punpckldq %xmm10, %xmm7   # xmm7 = xmm7[0],xmm10[0],xmm7[1],xmm10[1]
punpcklbw %xmm7, %xmm1    # xmm1 = xmm1[0],xmm7[0],xmm1[1],xmm7[1],xmm1[2],xmm7[2],xmm1[3],xmm7[3],xmm1[4],xmm7[4],xmm1[5],xmm7[5],xmm1[6],xmm7[6],xmm1[7],xmm7[7]
movd 0x4(%rsi,%rax), %xmm7
movd 0x4(%rsi,%r11), %xmm10
punpckldq %xmm10, %xmm7   # xmm7 = xmm7[0],xmm10[0],xmm7[1],xmm10[1]
punpcklbw %xmm7, %xmm9    # xmm9 = xmm9[0],xmm7[0],xmm9[1],xmm7[1],xmm9[2],xmm7[2],xmm9[3],xmm7[3],xmm9[4],xmm7[4],xmm9[5],xmm7[5],xmm9[6],xmm7[6],xmm9[7],xmm7[7]
movdqa %xmm9, %xmm7
punpcklwd %xmm1, %xmm7    # xmm7 = xmm7[0],xmm1[0],xmm7[1],xmm1[1],xmm7[2],xmm1[2],xmm7[3],xmm1[3]
punpckhwd %xmm1, %xmm9    # xmm9 = xmm9[4],xmm1[4],xmm9[5],xmm1[5],xmm9[6],xmm1[6],xmm9[7],xmm1[7]
movdqa %xmm7, %xmm10
punpckldq %xmm9, %xmm10   # xmm10 = xmm10[0],xmm9[0],xmm10[1],xmm9[1]
punpckhdq %xmm9, %xmm7    # xmm7 = xmm7[2],xmm9[2],xmm7[3],xmm9[3]
movdqa %xmm3, %xmm1
punpcklqdq %xmm10, %xmm1   # xmm1 = xmm1[0],xmm10[0]
punpckhqdq %xmm10, %xmm3   # xmm3 = xmm3[1],xmm10[1]
movdqa %xmm8, %xmm9
punpcklqdq %xmm7, %xmm9    # xmm9 = xmm9[0],xmm7[0]
punpckhqdq %xmm7, %xmm8    # xmm8 = xmm8[1],xmm7[1]
movdqa %xmm1, %xmm10
psubusb %xmm3, %xmm10
movdqa %xmm3, %xmm7
psubusb %xmm1, %xmm7
por %xmm10, %xmm7
pmaxub %xmm7, %xmm5
pmaxub %xmm6, %xmm5
movdqa %xmm9, %xmm6
psubusb %xmm8, %xmm6
psubusb %xmm9, %xmm8
por %xmm6, %xmm8
movdqa %xmm3, %xmm6
psubusb %xmm9, %xmm6
psubusb %xmm3, %xmm9
por %xmm6, %xmm9
pmaxub %xmm8, %xmm9
pmaxub %xmm5, %xmm9
movd %r8d, %xmm5
punpcklbw %xmm5, %xmm5    # xmm5 = xmm5[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pshuflw $0x0, %xmm5, %xmm5      # xmm5 = xmm5[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm5, %xmm6      # xmm6 = xmm5[0,0,0,0]
pminub %xmm9, %xmm6
pcmpeqb %xmm9, %xmm6
movd %ecx, %xmm5
punpcklbw %xmm5, %xmm5    # xmm5 = xmm5[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pshuflw $0x0, %xmm5, %xmm5      # xmm5 = xmm5[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm5, %xmm9      # xmm9 = xmm5[0,0,0,0]
movdqa %xmm3, %xmm5
psubusb %xmm2, %xmm5
movdqa %xmm2, %xmm8
psubusb %xmm3, %xmm8
por %xmm5, %xmm8
psrlw $0x1, %xmm8
movdqa %xmm1, %xmm5
psubusb %xmm0, %xmm5
movdqa %xmm0, %xmm10
psubusb %xmm1, %xmm10
por %xmm5, %xmm10
pand 0x4410c(%rip), %xmm8    # 0x129c80
paddusb %xmm10, %xmm10
paddusb %xmm10, %xmm8
pminub %xmm8, %xmm9
pcmpeqb %xmm8, %xmm9
movd %r9d, %xmm5
punpcklbw %xmm5, %xmm5    # xmm5 = xmm5[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pshuflw $0x0, %xmm5, %xmm5      # xmm5 = xmm5[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm5, %xmm8      # xmm8 = xmm5[0,0,0,0]
pmaxub %xmm4, %xmm7
pminub %xmm7, %xmm8
pcmpeqb %xmm7, %xmm8
movdqa 0x458fe(%rip), %xmm5    # 0x12b4b0
pxor %xmm5, %xmm2
pxor %xmm5, %xmm3
movdqa %xmm2, %xmm4
psubsb %xmm3, %xmm4
pxor %xmm5, %xmm1
pxor %xmm5, %xmm0
movdqa %xmm1, %xmm10
psubsb %xmm0, %xmm10
movdqa %xmm8, %xmm11
pandn %xmm4, %xmm11
pxor %xmm7, %xmm7
paddsb %xmm10, %xmm11
paddsb %xmm10, %xmm11
paddsb %xmm10, %xmm11
pand %xmm6, %xmm11
pand %xmm9, %xmm11
movdqa 0x47ead(%rip), %xmm4    # 0x12dab0
paddsb %xmm11, %xmm4
paddsb 0x47eaf(%rip), %xmm11   # 0x12dac0
punpcklbw %xmm4, %xmm6    # xmm6 = xmm6[0],xmm4[0],xmm6[1],xmm4[1],xmm6[2],xmm4[2],xmm6[3],xmm4[3],xmm6[4],xmm4[4],xmm6[5],xmm4[5],xmm6[6],xmm4[6],xmm6[7],xmm4[7]
punpckhbw %xmm4, %xmm4    # xmm4 = xmm4[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
psraw $0xb, %xmm6
psraw $0xb, %xmm4
packsswb %xmm4, %xmm6
punpcklbw %xmm11, %xmm4   # xmm4 = xmm4[0],xmm11[0],xmm4[1],xmm11[1],xmm4[2],xmm11[2],xmm4[3],xmm11[3],xmm4[4],xmm11[4],xmm4[5],xmm11[5],xmm4[6],xmm11[6],xmm4[7],xmm11[7]
punpckhbw %xmm11, %xmm9   # xmm9 = xmm9[8],xmm11[8],xmm9[9],xmm11[9],xmm9[10],xmm11[10],xmm9[11],xmm11[11],xmm9[12],xmm11[12],xmm9[13],xmm11[13],xmm9[14],xmm11[14],xmm9[15],xmm11[15]
psraw $0xb, %xmm4
psraw $0xb, %xmm9
packsswb %xmm9, %xmm4
paddsb %xmm0, %xmm6
psubsb %xmm4, %xmm1
pxor %xmm5, %xmm4
pavgb %xmm7, %xmm4
paddb 0x47e97(%rip), %xmm4    # 0x12daf0
pand %xmm8, %xmm4
psubsb %xmm4, %xmm3
paddsb %xmm2, %xmm4
addq $0x2, %rdi
pxor %xmm5, %xmm6
pxor %xmm5, %xmm4
movdqa %xmm4, %xmm2
punpcklbw %xmm6, %xmm2    # xmm2 = xmm2[0],xmm6[0],xmm2[1],xmm6[1],xmm2[2],xmm6[2],xmm2[3],xmm6[3],xmm2[4],xmm6[4],xmm2[5],xmm6[5],xmm2[6],xmm6[6],xmm2[7],xmm6[7]
punpckhbw %xmm6, %xmm4    # xmm4 = xmm4[8],xmm6[8],xmm4[9],xmm6[9],xmm4[10],xmm6[10],xmm4[11],xmm6[11],xmm4[12],xmm6[12],xmm4[13],xmm6[13],xmm4[14],xmm6[14],xmm4[15],xmm6[15]
pxor %xmm5, %xmm1
pxor %xmm5, %xmm3
movdqa %xmm1, %xmm5
punpcklbw %xmm3, %xmm5    # xmm5 = xmm5[0],xmm3[0],xmm5[1],xmm3[1],xmm5[2],xmm3[2],xmm5[3],xmm3[3],xmm5[4],xmm3[4],xmm5[5],xmm3[5],xmm5[6],xmm3[6],xmm5[7],xmm3[7]
punpckhbw %xmm3, %xmm1    # xmm1 = xmm1[8],xmm3[8],xmm1[9],xmm3[9],xmm1[10],xmm3[10],xmm1[11],xmm3[11],xmm1[12],xmm3[12],xmm1[13],xmm3[13],xmm1[14],xmm3[14],xmm1[15],xmm3[15]
movdqa %xmm2, %xmm3
punpcklwd %xmm5, %xmm3    # xmm3 = xmm3[0],xmm5[0],xmm3[1],xmm5[1],xmm3[2],xmm5[2],xmm3[3],xmm5[3]
movdqa %xmm4, %xmm0
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
movl $0x4, %ecx
movq %rdi, %r8
movd %xmm3, (%r8)
psrldq $0x4, %xmm3             # xmm3 = xmm3[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero
addq %rax, %r8
decl %ecx
jne 0xe5caa
punpckhwd %xmm5, %xmm2    # xmm2 = xmm2[4],xmm5[4],xmm2[5],xmm5[5],xmm2[6],xmm5[6],xmm2[7],xmm5[7]
addq %rdx, %rdi
movl $0x4, %ecx
movd %xmm2, (%rdi)
psrldq $0x4, %xmm2             # xmm2 = xmm2[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero
addq %rax, %rdi
decl %ecx
jne 0xe5cc7
addq $0x2, %rsi
movl $0x4, %ecx
movq %rsi, %rdi
movd %xmm0, (%rdi)
psrldq $0x4, %xmm0             # xmm0 = xmm0[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero
addq %rax, %rdi
decl %ecx
jne 0xe5ce3
punpckhwd %xmm1, %xmm4    # xmm4 = xmm4[4],xmm1[4],xmm4[5],xmm1[5],xmm4[6],xmm1[6],xmm4[7],xmm1[7]
addq %rdx, %rsi
movl $0x4, %ecx
movd %xmm4, (%rsi)
psrldq $0x4, %xmm4             # xmm4 = xmm4[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero
addq %rax, %rsi
decl %ecx
jne 0xe5cff
popq %rbx
popq %r14
retq