// File: /workspace/github_c_makefile_star2_O3/enzo1982[P]smooth/libraries/libwebp/src/dsp/dec_sse2.c
// Function: SimpleHFilter16_SSE2
static void SimpleHFilter16_SSE2(uint8_t* p, int stride, int thresh) {
  __m128i p1, p0, q0, q1;

  p -= 2;  // beginning of p1

  Load16x4_SSE2(p, p + 8 * stride, stride, &p1, &p0, &q0, &q1);
  DoFilter2_SSE2(&p1, &p0, &q0, &q1, thresh);
  Store16x4_SSE2(&p1, &p0, &q0, &q1, p, p + 8 * stride, stride);
}

// Assembly:
pushq %r14
pushq %rbx
leaq -0x2(%rdi), %r9
movslq %esi, %rax
leaq (,%rax,8), %r10
leaq -0x2(%rdi,%rax,8), %rcx
leaq (%rax,%rax), %rsi
leaq (%rsi,%rsi,2), %r11
leaq -0x2(%rdi,%rax,4), %r8
movd -0x2(%rdi,%rax,2), %xmm0
movd -0x2(%rdi,%r11), %xmm1
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movd (%r8), %xmm1
movd -0x2(%rdi), %xmm2
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
subq %rax, %r10
leaq (%rax,%rax,2), %r14
leaq (%rax,%rax,4), %rbx
movd -0x2(%rdi,%r14), %xmm1
movd -0x2(%rdi,%r10), %xmm3
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
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]
movd -0x2(%rdi,%rax), %xmm1
movd -0x2(%rdi,%rbx), %xmm3
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
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]
movdqa %xmm2, %xmm3
punpcklwd %xmm0, %xmm3    # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1],xmm3[2],xmm0[2],xmm3[3],xmm0[3]
punpckhwd %xmm0, %xmm2    # xmm2 = xmm2[4],xmm0[4],xmm2[5],xmm0[5],xmm2[6],xmm0[6],xmm2[7],xmm0[7]
movdqa %xmm3, %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
punpckhdq %xmm2, %xmm3    # xmm3 = xmm3[2],xmm2[2],xmm3[3],xmm2[3]
leaq (%rcx,%rax,4), %rsi
movd (%rcx,%rax,2), %xmm0
movd (%rcx,%r11), %xmm2
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movd -0x2(%rdi,%rax,8), %xmm2
movd (%rsi), %xmm4
punpckldq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
movd (%r10,%rcx), %xmm4
movd (%rcx,%r14), %xmm5
punpckldq %xmm4, %xmm5    # xmm5 = xmm5[0],xmm4[0],xmm5[1],xmm4[1]
punpcklbw %xmm5, %xmm0    # xmm0 = xmm0[0],xmm5[0],xmm0[1],xmm5[1],xmm0[2],xmm5[2],xmm0[3],xmm5[3],xmm0[4],xmm5[4],xmm0[5],xmm5[5],xmm0[6],xmm5[6],xmm0[7],xmm5[7]
movd (%rcx,%rbx), %xmm4
movd (%rax,%rcx), %xmm5
punpckldq %xmm4, %xmm5    # xmm5 = xmm5[0],xmm4[0],xmm5[1],xmm4[1]
punpcklbw %xmm5, %xmm2    # xmm2 = xmm2[0],xmm5[0],xmm2[1],xmm5[1],xmm2[2],xmm5[2],xmm2[3],xmm5[3],xmm2[4],xmm5[4],xmm2[5],xmm5[5],xmm2[6],xmm5[6],xmm2[7],xmm5[7]
movdqa %xmm2, %xmm4
punpcklwd %xmm0, %xmm4    # xmm4 = xmm4[0],xmm0[0],xmm4[1],xmm0[1],xmm4[2],xmm0[2],xmm4[3],xmm0[3]
punpckhwd %xmm0, %xmm2    # xmm2 = xmm2[4],xmm0[4],xmm2[5],xmm0[5],xmm2[6],xmm0[6],xmm2[7],xmm0[7]
movdqa %xmm4, %xmm6
punpckldq %xmm2, %xmm6    # xmm6 = xmm6[0],xmm2[0],xmm6[1],xmm2[1]
punpckhdq %xmm2, %xmm4    # xmm4 = xmm4[2],xmm2[2],xmm4[3],xmm2[3]
movdqa %xmm1, %xmm0
punpcklqdq %xmm6, %xmm0    # xmm0 = xmm0[0],xmm6[0]
movdqa %xmm1, %xmm5
punpckhqdq %xmm6, %xmm5    # xmm5 = xmm5[1],xmm6[1]
movdqa %xmm3, %xmm2
punpcklqdq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0]
punpckhqdq %xmm4, %xmm3    # xmm3 = xmm3[1],xmm4[1]
movd %edx, %xmm6
punpcklbw %xmm6, %xmm6    # xmm6 = xmm6[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pshuflw $0x0, %xmm6, %xmm6      # xmm6 = xmm6[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm6, %xmm7      # xmm7 = xmm6[0,0,0,0]
movdqa %xmm3, %xmm6
psubusb %xmm0, %xmm6
movdqa %xmm0, %xmm8
psubusb %xmm3, %xmm8
por %xmm6, %xmm8
psrlw $0x1, %xmm8
movdqa %xmm2, %xmm6
psubusb %xmm5, %xmm6
movdqa %xmm5, %xmm9
psubusb %xmm2, %xmm9
por %xmm6, %xmm9
paddusb %xmm9, %xmm9
pand 0x43d21(%rip), %xmm8    # 0x128ea0
paddusb %xmm9, %xmm8
movdqa 0x45544(%rip), %xmm6    # 0x12a6d0
pxor %xmm6, %xmm5
movdqa %xmm0, %xmm9
pxor %xmm6, %xmm9
movdqa %xmm3, %xmm10
pxor %xmm6, %xmm10
psubsb %xmm10, %xmm9
pxor %xmm6, %xmm2
movdqa %xmm2, %xmm10
psubsb %xmm5, %xmm10
paddsb %xmm10, %xmm9
paddsb %xmm10, %xmm9
paddsb %xmm10, %xmm9
pminub %xmm8, %xmm7
pcmpeqb %xmm8, %xmm7
pand %xmm9, %xmm7
movdqa 0x47af2(%rip), %xmm8    # 0x12ccd0
paddsb %xmm7, %xmm8
paddsb 0x47af5(%rip), %xmm7    # 0x12cce0
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]
punpckhbw %xmm7, %xmm7    # xmm7 = xmm7[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
psraw $0xb, %xmm9
psraw $0xb, %xmm7
packsswb %xmm7, %xmm9
punpcklbw %xmm8, %xmm7    # xmm7 = xmm7[0],xmm8[0],xmm7[1],xmm8[1],xmm7[2],xmm8[2],xmm7[3],xmm8[3],xmm7[4],xmm8[4],xmm7[5],xmm8[5],xmm7[6],xmm8[6],xmm7[7],xmm8[7]
punpckhbw %xmm8, %xmm8    # xmm8 = xmm8[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
psraw $0xb, %xmm7
psraw $0xb, %xmm8
packsswb %xmm8, %xmm7
psubsb %xmm9, %xmm2
paddsb %xmm5, %xmm7
pxor %xmm6, %xmm7
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]
punpckhbw %xmm7, %xmm0    # xmm0 = xmm0[8],xmm7[8],xmm0[9],xmm7[9],xmm0[10],xmm7[10],xmm0[11],xmm7[11],xmm0[12],xmm7[12],xmm0[13],xmm7[13],xmm0[14],xmm7[14],xmm0[15],xmm7[15]
pxor %xmm6, %xmm2
movdqa %xmm2, %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 %xmm4, %xmm2    # xmm2 = xmm2[8],xmm4[8],xmm2[9],xmm4[9],xmm2[10],xmm4[10],xmm2[11],xmm4[11],xmm2[12],xmm4[12],xmm2[13],xmm4[13],xmm2[14],xmm4[14],xmm2[15],xmm4[15]
movdqa %xmm1, %xmm4
punpcklwd %xmm5, %xmm4    # xmm4 = xmm4[0],xmm5[0],xmm4[1],xmm5[1],xmm4[2],xmm5[2],xmm4[3],xmm5[3]
movdqa %xmm0, %xmm3
punpcklwd %xmm2, %xmm3    # xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1],xmm3[2],xmm2[2],xmm3[3],xmm2[3]
movd %xmm4, %edi
movl $0x4, %edx
movl %edi, (%r9)
psrldq $0x4, %xmm4             # xmm4 = xmm4[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero
addq %rax, %r9
movd %xmm4, %edi
decl %edx
jne 0xe525c
punpckhwd %xmm5, %xmm1    # xmm1 = xmm1[4],xmm5[4],xmm1[5],xmm5[5],xmm1[6],xmm5[6],xmm1[7],xmm5[7]
movd %xmm1, %edi
movl $0x4, %edx
movl %edi, (%r8)
psrldq $0x4, %xmm1             # xmm1 = xmm1[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero
addq %rax, %r8
movd %xmm1, %edi
decl %edx
jne 0xe527c
movd %xmm3, %edi
movl $0x4, %edx
movl %edi, (%rcx)
psrldq $0x4, %xmm3             # xmm3 = xmm3[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero
addq %rax, %rcx
movd %xmm3, %edi
decl %edx
jne 0xe5298
punpckhwd %xmm2, %xmm0    # xmm0 = xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7]
movd %xmm0, %edx
movl $0x4, %ecx
movl %edx, (%rsi)
psrldq $0x4, %xmm0             # xmm0 = xmm0[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero
addq %rax, %rsi
movd %xmm0, %edx
decl %ecx
jne 0xe52b7
popq %rbx
popq %r14
retq