// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/dec_sse2.c
// Function: VFilter16i_SSE2
static void VFilter16i_SSE2(uint8_t* p, int stride,
                            int thresh, int ithresh, int hev_thresh) {
  int k;
  __m128i p3, p2, p1, p0;   // loop invariants

  LOAD_H_EDGES4(p, stride, p3, p2, p1, p0);  // prologue

  for (k = 3; k > 0; --k) {
    __m128i mask, tmp1, tmp2;
    uint8_t* const b = p + 2 * stride;   // beginning of p1
    p += 4 * stride;

    MAX_DIFF1(p3, p2, p1, p0, mask);   // compute partial mask
    LOAD_H_EDGES4(p, stride, p3, p2, tmp1, tmp2);
    MAX_DIFF2(p3, p2, tmp1, tmp2, mask);

    // p3 and p2 are not just temporary variables here: they will be
    // re-used for next span. And q2/q3 will become p1/p0 accordingly.
    ComplexMask_SSE2(&p1, &p0, &p3, &p2, thresh, ithresh, &mask);
    DoFilter4_SSE2(&p1, &p0, &p3, &p2, &mask, hev_thresh);

    // Store
    _mm_storeu_si128((__m128i*)&b[0 * stride], p1);
    _mm_storeu_si128((__m128i*)&b[1 * stride], p0);
    _mm_storeu_si128((__m128i*)&b[2 * stride], p3);
    _mm_storeu_si128((__m128i*)&b[3 * stride], p2);

    // rotate samples
    p1 = tmp1;
    p0 = tmp2;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x440, %rsp            # imm = 0x440
movq %rdi, -0x3a8(%rbp)
movl %esi, -0x3ac(%rbp)
movl %edx, -0x3b0(%rbp)
movl %ecx, -0x3b4(%rbp)
movl %r8d, -0x3b8(%rbp)
movq -0x3a8(%rbp), %rax
imull $0x0, -0x3ac(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x368(%rbp)
movq -0x368(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x3d0(%rbp)
movq -0x3a8(%rbp), %rax
movl -0x3ac(%rbp), %ecx
shll $0x0, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x370(%rbp)
movq -0x370(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x3e0(%rbp)
movq -0x3a8(%rbp), %rax
movl -0x3ac(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x378(%rbp)
movq -0x378(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x3f0(%rbp)
movq -0x3a8(%rbp), %rax
imull $0x3, -0x3ac(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x380(%rbp)
movq -0x380(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x400(%rbp)
movl $0x3, -0x3bc(%rbp)
cmpl $0x0, -0x3bc(%rbp)
jle 0x15bf59
movq -0x3a8(%rbp), %rax
movl -0x3ac(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x438(%rbp)
movl -0x3ac(%rbp), %ecx
shll $0x2, %ecx
movq -0x3a8(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x3a8(%rbp)
movdqa -0x400(%rbp), %xmm1
movdqa -0x3f0(%rbp), %xmm0
movdqa %xmm1, -0x130(%rbp)
movdqa %xmm0, -0x140(%rbp)
movdqa -0x130(%rbp), %xmm1
movdqa -0x140(%rbp), %xmm0
psubusb %xmm0, %xmm1
movdqa -0x3f0(%rbp), %xmm2
movdqa -0x400(%rbp), %xmm0
movdqa %xmm2, -0x150(%rbp)
movdqa %xmm0, -0x160(%rbp)
movdqa -0x150(%rbp), %xmm0
movdqa -0x160(%rbp), %xmm2
psubusb %xmm2, %xmm0
movdqa %xmm1, -0x2b0(%rbp)
movdqa %xmm0, -0x2c0(%rbp)
movdqa -0x2b0(%rbp), %xmm0
por -0x2c0(%rbp), %xmm0
movdqa %xmm0, -0x410(%rbp)
movdqa -0x410(%rbp), %xmm1
movdqa -0x3e0(%rbp), %xmm2
movdqa -0x3d0(%rbp), %xmm0
movdqa %xmm2, -0x170(%rbp)
movdqa %xmm0, -0x180(%rbp)
movdqa -0x170(%rbp), %xmm2
movdqa -0x180(%rbp), %xmm0
psubusb %xmm0, %xmm2
movdqa -0x3d0(%rbp), %xmm3
movdqa -0x3e0(%rbp), %xmm0
movdqa %xmm3, -0x190(%rbp)
movdqa %xmm0, -0x1a0(%rbp)
movdqa -0x190(%rbp), %xmm0
movdqa -0x1a0(%rbp), %xmm3
psubusb %xmm3, %xmm0
movdqa %xmm2, -0x2d0(%rbp)
movdqa %xmm0, -0x2e0(%rbp)
movdqa -0x2d0(%rbp), %xmm0
por -0x2e0(%rbp), %xmm0
movdqa %xmm1, -0x90(%rbp)
movdqa %xmm0, -0xa0(%rbp)
movdqa -0x90(%rbp), %xmm0
movdqa -0xa0(%rbp), %xmm1
pmaxub %xmm1, %xmm0
movdqa %xmm0, -0x410(%rbp)
movdqa -0x410(%rbp), %xmm1
movdqa -0x3f0(%rbp), %xmm2
movdqa -0x3e0(%rbp), %xmm0
movdqa %xmm2, -0x1b0(%rbp)
movdqa %xmm0, -0x1c0(%rbp)
movdqa -0x1b0(%rbp), %xmm2
movdqa -0x1c0(%rbp), %xmm0
psubusb %xmm0, %xmm2
movdqa -0x3e0(%rbp), %xmm3
movdqa -0x3f0(%rbp), %xmm0
movdqa %xmm3, -0x1d0(%rbp)
movdqa %xmm0, -0x1e0(%rbp)
movdqa -0x1d0(%rbp), %xmm0
movdqa -0x1e0(%rbp), %xmm3
psubusb %xmm3, %xmm0
movdqa %xmm2, -0x2f0(%rbp)
movdqa %xmm0, -0x300(%rbp)
movdqa -0x2f0(%rbp), %xmm0
por -0x300(%rbp), %xmm0
movdqa %xmm1, -0xb0(%rbp)
movdqa %xmm0, -0xc0(%rbp)
movdqa -0xb0(%rbp), %xmm0
movdqa -0xc0(%rbp), %xmm1
pmaxub %xmm1, %xmm0
movdqa %xmm0, -0x410(%rbp)
jmp 0x15bb00
movq -0x3a8(%rbp), %rax
imull $0x0, -0x3ac(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x388(%rbp)
movq -0x388(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x3d0(%rbp)
movq -0x3a8(%rbp), %rax
movl -0x3ac(%rbp), %ecx
shll $0x0, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x390(%rbp)
movq -0x390(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x3e0(%rbp)
movq -0x3a8(%rbp), %rax
movl -0x3ac(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x398(%rbp)
movq -0x398(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x420(%rbp)
movq -0x3a8(%rbp), %rax
imull $0x3, -0x3ac(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x3a0(%rbp)
movq -0x3a0(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x430(%rbp)
jmp 0x15bbbd
movdqa -0x410(%rbp), %xmm1
movdqa -0x430(%rbp), %xmm2
movdqa -0x420(%rbp), %xmm0
movdqa %xmm2, -0x1f0(%rbp)
movdqa %xmm0, -0x200(%rbp)
movdqa -0x1f0(%rbp), %xmm2
movdqa -0x200(%rbp), %xmm0
psubusb %xmm0, %xmm2
movdqa -0x420(%rbp), %xmm3
movdqa -0x430(%rbp), %xmm0
movdqa %xmm3, -0x210(%rbp)
movdqa %xmm0, -0x220(%rbp)
movdqa -0x210(%rbp), %xmm0
movdqa -0x220(%rbp), %xmm3
psubusb %xmm3, %xmm0
movdqa %xmm2, -0x310(%rbp)
movdqa %xmm0, -0x320(%rbp)
movdqa -0x310(%rbp), %xmm0
por -0x320(%rbp), %xmm0
movdqa %xmm1, -0xd0(%rbp)
movdqa %xmm0, -0xe0(%rbp)
movdqa -0xd0(%rbp), %xmm0
movdqa -0xe0(%rbp), %xmm1
pmaxub %xmm1, %xmm0
movdqa %xmm0, -0x410(%rbp)
movdqa -0x410(%rbp), %xmm1
movdqa -0x3e0(%rbp), %xmm2
movdqa -0x3d0(%rbp), %xmm0
movdqa %xmm2, -0x230(%rbp)
movdqa %xmm0, -0x240(%rbp)
movdqa -0x230(%rbp), %xmm2
movdqa -0x240(%rbp), %xmm0
psubusb %xmm0, %xmm2
movdqa -0x3d0(%rbp), %xmm3
movdqa -0x3e0(%rbp), %xmm0
movdqa %xmm3, -0x250(%rbp)
movdqa %xmm0, -0x260(%rbp)
movdqa -0x250(%rbp), %xmm0
movdqa -0x260(%rbp), %xmm3
psubusb %xmm3, %xmm0
movdqa %xmm2, -0x330(%rbp)
movdqa %xmm0, -0x340(%rbp)
movdqa -0x330(%rbp), %xmm0
por -0x340(%rbp), %xmm0
movdqa %xmm1, -0xf0(%rbp)
movdqa %xmm0, -0x100(%rbp)
movdqa -0xf0(%rbp), %xmm0
movdqa -0x100(%rbp), %xmm1
pmaxub %xmm1, %xmm0
movdqa %xmm0, -0x410(%rbp)
movdqa -0x410(%rbp), %xmm1
movdqa -0x420(%rbp), %xmm2
movdqa -0x3e0(%rbp), %xmm0
movdqa %xmm2, -0x270(%rbp)
movdqa %xmm0, -0x280(%rbp)
movdqa -0x270(%rbp), %xmm2
movdqa -0x280(%rbp), %xmm0
psubusb %xmm0, %xmm2
movdqa -0x3e0(%rbp), %xmm3
movdqa -0x420(%rbp), %xmm0
movdqa %xmm3, -0x290(%rbp)
movdqa %xmm0, -0x2a0(%rbp)
movdqa -0x290(%rbp), %xmm0
movdqa -0x2a0(%rbp), %xmm3
psubusb %xmm3, %xmm0
movdqa %xmm2, -0x350(%rbp)
movdqa %xmm0, -0x360(%rbp)
movdqa -0x350(%rbp), %xmm0
por -0x360(%rbp), %xmm0
movdqa %xmm1, -0x110(%rbp)
movdqa %xmm0, -0x120(%rbp)
movdqa -0x110(%rbp), %xmm0
movdqa -0x120(%rbp), %xmm1
pmaxub %xmm1, %xmm0
movdqa %xmm0, -0x410(%rbp)
movl -0x3b0(%rbp), %r8d
movl -0x3b4(%rbp), %r9d
leaq -0x3f0(%rbp), %rdi
leaq -0x400(%rbp), %rsi
leaq -0x3d0(%rbp), %rdx
leaq -0x3e0(%rbp), %rcx
leaq -0x410(%rbp), %rax
movq %rax, (%rsp)
callq 0x15f810
movl -0x3b8(%rbp), %r9d
leaq -0x3f0(%rbp), %rdi
leaq -0x400(%rbp), %rsi
leaq -0x3d0(%rbp), %rdx
leaq -0x3e0(%rbp), %rcx
leaq -0x410(%rbp), %r8
callq 0x161bf0
movq -0x438(%rbp), %rax
imull $0x0, -0x3ac(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movdqa -0x3f0(%rbp), %xmm0
movq %rax, -0x8(%rbp)
movdqa %xmm0, -0x20(%rbp)
movdqa -0x20(%rbp), %xmm0
movq -0x8(%rbp), %rax
movdqu %xmm0, (%rax)
movq -0x438(%rbp), %rax
movl -0x3ac(%rbp), %ecx
shll $0x0, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movdqa -0x400(%rbp), %xmm0
movq %rax, -0x28(%rbp)
movdqa %xmm0, -0x40(%rbp)
movdqa -0x40(%rbp), %xmm0
movq -0x28(%rbp), %rax
movdqu %xmm0, (%rax)
movq -0x438(%rbp), %rax
movl -0x3ac(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movdqa -0x3d0(%rbp), %xmm0
movq %rax, -0x48(%rbp)
movdqa %xmm0, -0x60(%rbp)
movdqa -0x60(%rbp), %xmm0
movq -0x48(%rbp), %rax
movdqu %xmm0, (%rax)
movq -0x438(%rbp), %rax
imull $0x3, -0x3ac(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movdqa -0x3e0(%rbp), %xmm0
movq %rax, -0x68(%rbp)
movdqa %xmm0, -0x80(%rbp)
movdqa -0x80(%rbp), %xmm0
movq -0x68(%rbp), %rax
movdqu %xmm0, (%rax)
movdqa -0x420(%rbp), %xmm0
movdqa %xmm0, -0x3f0(%rbp)
movdqa -0x430(%rbp), %xmm0
movdqa %xmm0, -0x400(%rbp)
movl -0x3bc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3bc(%rbp)
jmp 0x15b8b0
addq $0x440, %rsp            # imm = 0x440
popq %rbp
retq
nopw %cs:(%rax,%rax)