// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/dec_sse2.c
// Function: VR4_SSE2
static void VR4_SSE2(uint8_t* dst) {   // Vertical-Right
  const __m128i one = _mm_set1_epi8(1);
  const int I = dst[-1 + 0 * BPS];
  const int J = dst[-1 + 1 * BPS];
  const int K = dst[-1 + 2 * BPS];
  const int X = dst[-1 - BPS];
  const __m128i XABCD = _mm_loadl_epi64((__m128i*)(dst - BPS - 1));
  const __m128i ABCD0 = _mm_srli_si128(XABCD, 1);
  const __m128i abcd = _mm_avg_epu8(XABCD, ABCD0);
  const __m128i _XABCD = _mm_slli_si128(XABCD, 1);
  const __m128i IXABCD = _mm_insert_epi16(_XABCD, (short)(I | (X << 8)), 0);
  const __m128i avg1 = _mm_avg_epu8(IXABCD, ABCD0);
  const __m128i lsb = _mm_and_si128(_mm_xor_si128(IXABCD, ABCD0), one);
  const __m128i avg2 = _mm_subs_epu8(avg1, lsb);
  const __m128i efgh = _mm_avg_epu8(avg2, XABCD);
  WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(               abcd    ));
  WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(               efgh    ));
  WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(abcd, 1)));
  WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(efgh, 1)));

  // these two are hard to implement in SSE2, so we keep the C-version:
  DST(0, 2) = AVG3(J, I, X);
  DST(0, 3) = AVG3(K, J, I);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x198(%rbp)
movb $0x1, -0xc1(%rbp)
movb -0xc1(%rbp), %al
movb %al, -0x81(%rbp)
movb %al, -0x82(%rbp)
movb %al, -0x83(%rbp)
movb %al, -0x84(%rbp)
movb %al, -0x85(%rbp)
movb %al, -0x86(%rbp)
movb %al, -0x87(%rbp)
movb %al, -0x88(%rbp)
movb %al, -0x89(%rbp)
movb %al, -0x8a(%rbp)
movb %al, -0x8b(%rbp)
movb %al, -0x8c(%rbp)
movb %al, -0x8d(%rbp)
movb %al, -0x8e(%rbp)
movb %al, -0x8f(%rbp)
movb %al, -0x90(%rbp)
movzbl -0x81(%rbp), %eax
movd %eax, %xmm0
movzbl -0x82(%rbp), %eax
movd %eax, %xmm1
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]
movzbl -0x83(%rbp), %eax
movd %eax, %xmm2
movzbl -0x84(%rbp), %eax
movd %eax, %xmm0
punpcklbw %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7]
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
movzbl -0x85(%rbp), %eax
movd %eax, %xmm1
movzbl -0x86(%rbp), %eax
movd %eax, %xmm2
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]
movzbl -0x87(%rbp), %eax
movd %eax, %xmm3
movzbl -0x88(%rbp), %eax
movd %eax, %xmm1
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]
punpcklwd %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3]
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movzbl -0x89(%rbp), %eax
movd %eax, %xmm2
movzbl -0x8a(%rbp), %eax
movd %eax, %xmm0
punpcklbw %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7]
movzbl -0x8b(%rbp), %eax
movd %eax, %xmm3
movzbl -0x8c(%rbp), %eax
movd %eax, %xmm2
punpcklbw %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1],xmm2[2],xmm3[2],xmm2[3],xmm3[3],xmm2[4],xmm3[4],xmm2[5],xmm3[5],xmm2[6],xmm3[6],xmm2[7],xmm3[7]
punpcklwd %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
movzbl -0x8d(%rbp), %eax
movd %eax, %xmm0
movzbl -0x8e(%rbp), %eax
movd %eax, %xmm3
punpcklbw %xmm0, %xmm3    # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1],xmm3[2],xmm0[2],xmm3[3],xmm0[3],xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
movzbl -0x8f(%rbp), %eax
movd %eax, %xmm4
movzbl -0x90(%rbp), %eax
movd %eax, %xmm0
punpcklbw %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1],xmm0[2],xmm4[2],xmm0[3],xmm4[3],xmm0[4],xmm4[4],xmm0[5],xmm4[5],xmm0[6],xmm4[6],xmm0[7],xmm4[7]
punpcklwd %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1],xmm0[2],xmm3[2],xmm0[3],xmm3[3]
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movaps %xmm0, -0xa0(%rbp)
movaps -0xa0(%rbp), %xmm0
movaps %xmm0, -0x1b0(%rbp)
movq -0x198(%rbp), %rax
movzbl -0x1(%rax), %eax
movl %eax, -0x1b4(%rbp)
movq -0x198(%rbp), %rax
movzbl 0x1f(%rax), %eax
movl %eax, -0x1b8(%rbp)
movq -0x198(%rbp), %rax
movzbl 0x3f(%rax), %eax
movl %eax, -0x1bc(%rbp)
movq -0x198(%rbp), %rax
movzbl -0x21(%rax), %eax
movl %eax, -0x1c0(%rbp)
movq -0x198(%rbp), %rax
addq $-0x21, %rax
movq %rax, -0x178(%rbp)
movq -0x178(%rbp), %rax
movq (%rax), %xmm0
movaps %xmm0, -0x190(%rbp)
movaps -0x190(%rbp), %xmm0
movaps %xmm0, -0x1d0(%rbp)
movaps -0x1d0(%rbp), %xmm0
psrldq $0x1, %xmm0             # xmm0 = xmm0[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],zero
movaps %xmm0, -0x1e0(%rbp)
movaps -0x1d0(%rbp), %xmm1
movaps -0x1e0(%rbp), %xmm0
movaps %xmm1, -0x10(%rbp)
movaps %xmm0, -0x20(%rbp)
movaps -0x10(%rbp), %xmm0
movaps -0x20(%rbp), %xmm1
pavgb %xmm1, %xmm0
movaps %xmm0, -0x1f0(%rbp)
movaps -0x1d0(%rbp), %xmm0
pslldq $0x1, %xmm0             # xmm0 = zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
movaps %xmm0, -0x200(%rbp)
movaps -0x200(%rbp), %xmm0
movl -0x1b4(%rbp), %eax
movl -0x1c0(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
pinsrw $0x0, %eax, %xmm0
movaps %xmm0, -0x210(%rbp)
movaps -0x210(%rbp), %xmm1
movaps -0x1e0(%rbp), %xmm0
movaps %xmm1, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
movaps -0x30(%rbp), %xmm0
movaps -0x40(%rbp), %xmm1
pavgb %xmm1, %xmm0
movaps %xmm0, -0x220(%rbp)
movaps -0x210(%rbp), %xmm1
movaps -0x1e0(%rbp), %xmm0
movaps %xmm1, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
movaps -0x70(%rbp), %xmm1
movaps -0x80(%rbp), %xmm0
pxor %xmm0, %xmm1
movaps -0x1b0(%rbp), %xmm0
movaps %xmm1, -0xb0(%rbp)
movaps %xmm0, -0xc0(%rbp)
movaps -0xb0(%rbp), %xmm0
movaps -0xc0(%rbp), %xmm1
pand %xmm1, %xmm0
movaps %xmm0, -0x230(%rbp)
movaps -0x220(%rbp), %xmm1
movaps -0x230(%rbp), %xmm0
movaps %xmm1, -0xe0(%rbp)
movaps %xmm0, -0xf0(%rbp)
movaps -0xe0(%rbp), %xmm0
movaps -0xf0(%rbp), %xmm1
psubusb %xmm1, %xmm0
movaps %xmm0, -0x240(%rbp)
movaps -0x240(%rbp), %xmm1
movaps -0x1d0(%rbp), %xmm0
movaps %xmm1, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
movaps -0x50(%rbp), %xmm0
movaps -0x60(%rbp), %xmm1
pavgb %xmm1, %xmm0
movaps %xmm0, -0x250(%rbp)
movq -0x198(%rbp), %rdi
movaps -0x1f0(%rbp), %xmm0
movaps %xmm0, -0x100(%rbp)
movaps -0x100(%rbp), %xmm0
movaps %xmm0, -0x110(%rbp)
movl -0x110(%rbp), %esi
callq 0x15f7a0
movq -0x198(%rbp), %rdi
addq $0x20, %rdi
movaps -0x250(%rbp), %xmm0
movaps %xmm0, -0x120(%rbp)
movaps -0x120(%rbp), %xmm0
movaps %xmm0, -0x130(%rbp)
movl -0x130(%rbp), %esi
callq 0x15f7a0
movq -0x198(%rbp), %rdi
addq $0x40, %rdi
movaps -0x1f0(%rbp), %xmm0
pslldq $0x1, %xmm0             # xmm0 = zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
movaps %xmm0, -0x140(%rbp)
movaps -0x140(%rbp), %xmm0
movaps %xmm0, -0x150(%rbp)
movl -0x150(%rbp), %esi
callq 0x15f7a0
movq -0x198(%rbp), %rdi
addq $0x60, %rdi
movaps -0x250(%rbp), %xmm0
pslldq $0x1, %xmm0             # xmm0 = zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
movaps %xmm0, -0x160(%rbp)
movaps -0x160(%rbp), %xmm0
movaps %xmm0, -0x170(%rbp)
movl -0x170(%rbp), %esi
callq 0x15f7a0
movl -0x1b8(%rbp), %eax
movl -0x1b4(%rbp), %ecx
shll %ecx
addl %ecx, %eax
addl -0x1c0(%rbp), %eax
addl $0x2, %eax
sarl $0x2, %eax
movb %al, %cl
movq -0x198(%rbp), %rax
movb %cl, 0x40(%rax)
movl -0x1bc(%rbp), %eax
movl -0x1b8(%rbp), %ecx
shll %ecx
addl %ecx, %eax
addl -0x1b4(%rbp), %eax
addl $0x2, %eax
sarl $0x2, %eax
movb %al, %cl
movq -0x198(%rbp), %rax
movb %cl, 0x60(%rax)
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
nopw (%rax,%rax)