// File: /workspace/github_c_makefile_star2_O2/enzo1982[P]smooth/libraries/libwebp/src/dsp/dec_sse2.c
// Function: HFilter16_SSE2
static void HFilter16_SSE2(uint8_t* p, int stride,
                           int thresh, int ithresh, int hev_thresh) {
  __m128i mask;
  __m128i p3, p2, p1, p0, q0, q1, q2, q3;

  uint8_t* const b = p - 4;
  Load16x4_SSE2(b, b + 8 * stride, stride, &p3, &p2, &p1, &p0);
  MAX_DIFF1(p3, p2, p1, p0, mask);

  Load16x4_SSE2(p, p + 8 * stride, stride, &q0, &q1, &q2, &q3);
  MAX_DIFF2(q3, q2, q1, q0, mask);

  ComplexMask_SSE2(&p1, &p0, &q0, &q1, thresh, ithresh, &mask);
  DoFilter6_SSE2(&p2, &p1, &p0, &q0, &q1, &q2, &mask, hev_thresh);

  Store16x4_SSE2(&p3, &p2, &p1, &p0, b, b + 8 * stride, stride);
  Store16x4_SSE2(&q0, &q1, &q2, &q3, p, p + 8 * stride, stride);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movl %r8d, 0x1c(%rsp)
movl %ecx, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movl %esi, %r15d
movq %rdi, %rcx
movq %rdi, 0x20(%rsp)
leaq -0x4(%rdi), %rdi
movq %rdi, 0x38(%rsp)
leal (,%r15,8), %eax
cltq
leaq -0x4(%rcx,%rax), %rsi
movq %rax, %r14
movq %rsi, 0x30(%rsp)
leaq 0x90(%rsp), %rax
movq %rax, (%rsp)
movq %rax, %r12
leaq 0xc0(%rsp), %rcx
leaq 0xb0(%rsp), %rbx
leaq 0xa0(%rsp), %r13
movl %r15d, %edx
movq %rcx, %rbp
movq %rbx, %r8
movq %r13, %r9
callq 0xd8926
movdqa (%r12), %xmm0
movdqa (%r13), %xmm1
movdqa %xmm1, %xmm2
psubusb %xmm0, %xmm2
psubusb %xmm1, %xmm0
por %xmm2, %xmm0
movdqa (%rbx), %xmm4
movdqa (%rbp), %xmm3
movdqa %xmm4, %xmm2
psubusb %xmm3, %xmm2
psubusb %xmm4, %xmm3
por %xmm2, %xmm3
pmaxub %xmm0, %xmm3
movdqa %xmm3, 0x50(%rsp)
movdqa %xmm1, %xmm0
psubusb %xmm4, %xmm0
psubusb %xmm1, %xmm4
por %xmm0, %xmm4
movdqa %xmm4, 0x40(%rsp)
movq 0x20(%rsp), %rdi
movq %r14, %rsi
addq %rdi, %rsi
movq %rsi, 0x28(%rsp)
leaq 0x60(%rsp), %r14
movq %r14, (%rsp)
leaq 0xd0(%rsp), %rbx
leaq 0x80(%rsp), %rbp
leaq 0x70(%rsp), %r12
movl %r15d, %edx
movq %rbx, %rcx
movq %rbp, %r8
movq %r12, %r9
callq 0xd8926
movdqa (%rbx), %xmm0
movdqa (%rbp), %xmm1
movq %rbp, %rax
movdqa %xmm1, %xmm2
psubusb %xmm0, %xmm2
psubusb %xmm1, %xmm0
por %xmm2, %xmm0
pmaxub 0x40(%rsp), %xmm0
pmaxub 0x50(%rsp), %xmm0
movdqa (%r12), %xmm2
movdqa (%r14), %xmm3
movdqa %xmm2, %xmm4
psubusb %xmm3, %xmm4
psubusb %xmm2, %xmm3
por %xmm4, %xmm3
movdqa %xmm1, %xmm4
psubusb %xmm2, %xmm4
psubusb %xmm1, %xmm2
por %xmm4, %xmm2
pmaxub %xmm3, %xmm2
pmaxub %xmm0, %xmm2
leaq 0xe0(%rsp), %r12
movdqa %xmm2, (%r12)
movq %r12, (%rsp)
leaq 0xa0(%rsp), %rbp
movq %rbp, %rdi
leaq 0x90(%rsp), %r13
movq %r13, %rsi
movq %rbx, %r14
movq %rbx, %rdx
movq %rax, %rbx
movq %rax, %rcx
movl 0x14(%rsp), %r8d
movl 0x18(%rsp), %r9d
callq 0xd8554
movl 0x1c(%rsp), %eax
movl %eax, 0x8(%rsp)
movq %r12, (%rsp)
leaq 0xb0(%rsp), %r12
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r14, %rcx
movq %rbx, %r8
leaq 0x70(%rsp), %rbx
movq %rbx, %r9
callq 0xd85a5
movl %r15d, (%rsp)
leaq 0xc0(%rsp), %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq 0x38(%rsp), %r8
movq 0x30(%rsp), %r9
callq 0xd89a3
movl %r15d, (%rsp)
movq %r14, %rdi
leaq 0x80(%rsp), %rsi
movq %rbx, %rdx
leaq 0x60(%rsp), %rcx
movq 0x20(%rsp), %r8
movq 0x28(%rsp), %r9
callq 0xd89a3
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq