// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/lossless_sse2.c
// Function: TransformColorInverse_SSE2
static void TransformColorInverse_SSE2(const VP8LMultipliers* const m,
                                       const uint32_t* const src,
                                       int num_pixels, uint32_t* dst) {
// sign-extended multiplying constants, pre-shifted by 5.
#define CST(X)  (((int16_t)(m->X << 8)) >> 5)   // sign-extend
#define MK_CST_16(HI, LO) \
  _mm_set1_epi32((int)(((uint32_t)(HI) << 16) | ((LO) & 0xffff)))
  const __m128i mults_rb = MK_CST_16(CST(green_to_red_), CST(green_to_blue_));
  const __m128i mults_b2 = MK_CST_16(CST(red_to_blue_), 0);
#undef MK_CST_16
#undef CST
  const __m128i mask_ag = _mm_set1_epi32((int)0xff00ff00);  // alpha-green masks
  int i;
  for (i = 0; i + 4 <= num_pixels; i += 4) {
    const __m128i in = _mm_loadu_si128((const __m128i*)&src[i]); // argb
    const __m128i A = _mm_and_si128(in, mask_ag);     // a   0   g   0
    const __m128i B = _mm_shufflelo_epi16(A, _MM_SHUFFLE(2, 2, 0, 0));
    const __m128i C = _mm_shufflehi_epi16(B, _MM_SHUFFLE(2, 2, 0, 0));  // g0g0
    const __m128i D = _mm_mulhi_epi16(C, mults_rb);    // x dr  x db1
    const __m128i E = _mm_add_epi8(in, D);             // x r'  x   b'
    const __m128i F = _mm_slli_epi16(E, 8);            // r' 0   b' 0
    const __m128i G = _mm_mulhi_epi16(F, mults_b2);    // x db2  0  0
    const __m128i H = _mm_srli_epi32(G, 8);            // 0  x db2  0
    const __m128i I = _mm_add_epi8(H, F);              // r' x  b'' 0
    const __m128i J = _mm_srli_epi16(I, 8);            // 0  r'  0  b''
    const __m128i out = _mm_or_si128(J, A);
    _mm_storeu_si128((__m128i*)&dst[i], out);
  }
  // Fall-back to C-version for left-overs.
  if (i != num_pixels) {
    VP8LTransformColorInverse_C(m, src + i, num_pixels - i, dst + i);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2d0, %rsp            # imm = 0x2D0
movq %rdi, -0x1b0(%rbp)
movq %rsi, -0x1b8(%rbp)
movl %edx, -0x1bc(%rbp)
movq %rcx, -0x1c8(%rbp)
movq -0x1b0(%rbp), %rcx
movzbl (%rcx), %eax
shll $0x8, %eax
cwtl
shll $0xb, %eax
movzbl 0x1(%rcx), %ecx
shll $0x8, %ecx
movswl %cx, %ecx
shrl $0x5, %ecx
movzwl %cx, %ecx
orl %ecx, %eax
movl %eax, -0x12c(%rbp)
movl -0x12c(%rbp), %eax
movl %eax, -0xc4(%rbp)
movl %eax, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
movl %eax, -0xd0(%rbp)
movd -0xc4(%rbp), %xmm0
movd -0xc8(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd -0xcc(%rbp), %xmm2
movd -0xd0(%rbp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movaps %xmm0, -0xe0(%rbp)
movaps -0xe0(%rbp), %xmm0
movaps %xmm0, -0x1e0(%rbp)
movq -0x1b0(%rbp), %rax
movzbl 0x2(%rax), %eax
shll $0x8, %eax
cwtl
shll $0xb, %eax
movl %eax, -0x130(%rbp)
movl -0x130(%rbp), %eax
movl %eax, -0xa4(%rbp)
movl %eax, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
movl %eax, -0xb0(%rbp)
movd -0xa4(%rbp), %xmm0
movd -0xa8(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd -0xac(%rbp), %xmm2
movd -0xb0(%rbp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movaps %xmm0, -0xc0(%rbp)
movaps -0xc0(%rbp), %xmm0
movaps %xmm0, -0x1f0(%rbp)
movl $0xff00ff00, -0x134(%rbp) # imm = 0xFF00FF00
movl -0x134(%rbp), %eax
movl %eax, -0x84(%rbp)
movl %eax, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
movl %eax, -0x90(%rbp)
movd -0x84(%rbp), %xmm0
movd -0x88(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd -0x8c(%rbp), %xmm2
movd -0x90(%rbp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movdqa %xmm0, -0xa0(%rbp)
movdqa -0xa0(%rbp), %xmm0
movdqa %xmm0, -0x200(%rbp)
movl $0x0, -0x204(%rbp)
movl -0x204(%rbp), %eax
addl $0x4, %eax
cmpl -0x1bc(%rbp), %eax
jg 0x167ff9
movq -0x1b8(%rbp), %rax
movslq -0x204(%rbp), %rcx
leaq (%rax,%rcx,4), %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x220(%rbp)
movaps -0x220(%rbp), %xmm1
movaps -0x200(%rbp), %xmm0
movaps %xmm1, -0x180(%rbp)
movaps %xmm0, -0x190(%rbp)
movaps -0x180(%rbp), %xmm0
movaps -0x190(%rbp), %xmm1
pand %xmm1, %xmm0
movaps %xmm0, -0x230(%rbp)
movaps -0x230(%rbp), %xmm0
pshuflw $0xa0, %xmm0, %xmm0     # xmm0 = xmm0[0,0,2,2,4,5,6,7]
movaps %xmm0, -0x240(%rbp)
movaps -0x240(%rbp), %xmm0
pshufhw $0xa0, %xmm0, %xmm0     # xmm0 = xmm0[0,1,2,3,4,4,6,6]
movdqa %xmm0, -0x250(%rbp)
movdqa -0x250(%rbp), %xmm1
movdqa -0x1e0(%rbp), %xmm0
movdqa %xmm1, -0x50(%rbp)
movdqa %xmm0, -0x60(%rbp)
movdqa -0x50(%rbp), %xmm0
movdqa -0x60(%rbp), %xmm1
pmulhw %xmm1, %xmm0
movdqa %xmm0, -0x260(%rbp)
movdqa -0x220(%rbp), %xmm1
movdqa -0x260(%rbp), %xmm0
movdqa %xmm1, -0xf0(%rbp)
movdqa %xmm0, -0x100(%rbp)
movdqa -0xf0(%rbp), %xmm0
movdqa -0x100(%rbp), %xmm1
paddb %xmm1, %xmm0
movdqa %xmm0, -0x270(%rbp)
movdqa -0x270(%rbp), %xmm0
movdqa %xmm0, -0x30(%rbp)
movl $0x8, -0x34(%rbp)
movdqa -0x30(%rbp), %xmm0
movl -0x34(%rbp), %eax
movd %eax, %xmm1
psllw %xmm1, %xmm0
movdqa %xmm0, -0x280(%rbp)
movdqa -0x280(%rbp), %xmm1
movdqa -0x1f0(%rbp), %xmm0
movdqa %xmm1, -0x70(%rbp)
movdqa %xmm0, -0x80(%rbp)
movdqa -0x70(%rbp), %xmm0
movdqa -0x80(%rbp), %xmm1
pmulhw %xmm1, %xmm0
movdqa %xmm0, -0x290(%rbp)
movdqa -0x290(%rbp), %xmm0
movdqa %xmm0, -0x10(%rbp)
movl $0x8, -0x14(%rbp)
movdqa -0x10(%rbp), %xmm0
movl -0x14(%rbp), %eax
movd %eax, %xmm1
psrld %xmm1, %xmm0
movdqa %xmm0, -0x2a0(%rbp)
movdqa -0x2a0(%rbp), %xmm1
movdqa -0x280(%rbp), %xmm0
movdqa %xmm1, -0x110(%rbp)
movdqa %xmm0, -0x120(%rbp)
movdqa -0x110(%rbp), %xmm0
movdqa -0x120(%rbp), %xmm1
paddb %xmm1, %xmm0
movdqa %xmm0, -0x2b0(%rbp)
movdqa -0x2b0(%rbp), %xmm0
movdqa %xmm0, -0x1a0(%rbp)
movl $0x8, -0x1a4(%rbp)
movdqa -0x1a0(%rbp), %xmm0
movl -0x1a4(%rbp), %eax
movd %eax, %xmm1
psrlw %xmm1, %xmm0
movdqa %xmm0, -0x2c0(%rbp)
movdqa -0x2c0(%rbp), %xmm1
movdqa -0x230(%rbp), %xmm0
movdqa %xmm1, -0x160(%rbp)
movdqa %xmm0, -0x170(%rbp)
movdqa -0x160(%rbp), %xmm0
por -0x170(%rbp), %xmm0
movdqa %xmm0, -0x2d0(%rbp)
movq -0x1c8(%rbp), %rax
movslq -0x204(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movdqa -0x2d0(%rbp), %xmm0
movq %rax, -0x140(%rbp)
movdqa %xmm0, -0x150(%rbp)
movdqa -0x150(%rbp), %xmm0
movq -0x140(%rbp), %rax
movdqu %xmm0, (%rax)
movl -0x204(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x204(%rbp)
jmp 0x167d6b
movl -0x204(%rbp), %eax
cmpl -0x1bc(%rbp), %eax
je 0x168049
movq -0x1b0(%rbp), %rdi
movq -0x1b8(%rbp), %rsi
movslq -0x204(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
movl -0x1bc(%rbp), %edx
subl -0x204(%rbp), %edx
movq -0x1c8(%rbp), %rcx
movslq -0x204(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rcx
callq 0x14e720
addq $0x2d0, %rsp            # imm = 0x2D0
popq %rbp
retq
nopw %cs:(%rax,%rax)