// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/alpha_processing_sse2.c
// Function: MultARGBRow_SSE2
static void MultARGBRow_SSE2(uint32_t* const ptr, int width, int inverse) {
  int x = 0;
  if (!inverse) {
    const int kSpan = 2;
    const __m128i zero = _mm_setzero_si128();
    const __m128i k128 = _mm_set1_epi16(128);
    const __m128i kMult = _mm_set1_epi16(0x0101);
    const __m128i kMask = _mm_set_epi16(0, 0xff, 0, 0, 0, 0xff, 0, 0);
    for (x = 0; x + kSpan <= width; x += kSpan) {
      // To compute 'result = (int)(a * x / 255. + .5)', we use:
      //   tmp = a * v + 128, result = (tmp * 0x0101u) >> 16
      const __m128i A0 = _mm_loadl_epi64((const __m128i*)&ptr[x]);
      const __m128i A1 = _mm_unpacklo_epi8(A0, zero);
      const __m128i A2 = _mm_or_si128(A1, kMask);
      const __m128i A3 = _mm_shufflelo_epi16(A2, _MM_SHUFFLE(2, 3, 3, 3));
      const __m128i A4 = _mm_shufflehi_epi16(A3, _MM_SHUFFLE(2, 3, 3, 3));
      // here, A4 = [ff a0 a0 a0][ff a1 a1 a1]
      const __m128i A5 = _mm_mullo_epi16(A4, A1);
      const __m128i A6 = _mm_add_epi16(A5, k128);
      const __m128i A7 = _mm_mulhi_epu16(A6, kMult);
      const __m128i A10 = _mm_packus_epi16(A7, zero);
      _mm_storel_epi64((__m128i*)&ptr[x], A10);
    }
  }
  width -= x;
  if (width > 0) WebPMultARGBRow_C(ptr + x, width, inverse);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
movq %rdi, -0x188(%rbp)
movl %esi, -0x18c(%rbp)
movl %edx, -0x190(%rbp)
movl $0x0, -0x194(%rbp)
cmpl $0x0, -0x190(%rbp)
jne 0x1552d5
movl $0x2, -0x198(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x180(%rbp)
movaps -0x180(%rbp), %xmm0
movaps %xmm0, -0x1b0(%rbp)
movw $0x80, -0x162(%rbp)
movw -0x162(%rbp), %ax
movw %ax, -0x274(%rbp)
movw %ax, -0x142(%rbp)
movw %ax, -0x144(%rbp)
movw %ax, -0x146(%rbp)
movw %ax, -0x148(%rbp)
movw %ax, -0x14a(%rbp)
movw %ax, -0x14c(%rbp)
movw %ax, -0x14e(%rbp)
movw %ax, -0x150(%rbp)
movzwl -0x142(%rbp), %eax
movd %eax, %xmm1
movzwl -0x144(%rbp), %eax
movd %eax, %xmm0
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
movzwl -0x146(%rbp), %eax
movd %eax, %xmm2
movzwl -0x148(%rbp), %eax
movd %eax, %xmm1
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]
movzwl -0x14a(%rbp), %eax
movd %eax, %xmm0
movzwl -0x14c(%rbp), %eax
movd %eax, %xmm2
punpcklwd %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
movzwl -0x14e(%rbp), %eax
movd %eax, %xmm3
movzwl -0x150(%rbp), %eax
movd %eax, %xmm0
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, -0x160(%rbp)
movaps -0x160(%rbp), %xmm0
movaps %xmm0, -0x1c0(%rbp)
movw $0x101, -0x164(%rbp)    # imm = 0x101
movw -0x164(%rbp), %ax
movw %ax, -0x272(%rbp)
movw %ax, -0x122(%rbp)
movw %ax, -0x124(%rbp)
movw %ax, -0x126(%rbp)
movw %ax, -0x128(%rbp)
movw %ax, -0x12a(%rbp)
movw %ax, -0x12c(%rbp)
movw %ax, -0x12e(%rbp)
movw %ax, -0x130(%rbp)
movzwl -0x122(%rbp), %eax
movd %eax, %xmm1
movzwl -0x124(%rbp), %eax
movd %eax, %xmm0
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
movzwl -0x126(%rbp), %eax
movd %eax, %xmm2
movzwl -0x128(%rbp), %eax
movd %eax, %xmm1
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]
movzwl -0x12a(%rbp), %eax
movd %eax, %xmm0
movzwl -0x12c(%rbp), %eax
movd %eax, %xmm2
punpcklwd %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
movzwl -0x12e(%rbp), %eax
movd %eax, %xmm3
movzwl -0x130(%rbp), %eax
movd %eax, %xmm0
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, -0x140(%rbp)
movaps -0x140(%rbp), %xmm0
movaps %xmm0, -0x1d0(%rbp)
movw $0x0, -0x102(%rbp)
movw $0xff, -0x104(%rbp)
movw $0x0, -0x106(%rbp)
movw $0x0, -0x108(%rbp)
movw $0x0, -0x10a(%rbp)
movw $0xff, -0x10c(%rbp)
movw $0x0, -0x10e(%rbp)
movw $0x0, -0x110(%rbp)
movzwl -0x102(%rbp), %eax
movd %eax, %xmm1
movzwl -0x104(%rbp), %eax
movd %eax, %xmm0
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
movzwl -0x106(%rbp), %eax
movd %eax, %xmm2
movzwl -0x108(%rbp), %eax
movd %eax, %xmm1
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]
movzwl -0x10a(%rbp), %eax
movd %eax, %xmm0
movzwl -0x10c(%rbp), %eax
movd %eax, %xmm2
punpcklwd %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
movzwl -0x10e(%rbp), %eax
movd %eax, %xmm3
movzwl -0x110(%rbp), %eax
movd %eax, %xmm0
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]
movdqa %xmm0, -0x120(%rbp)
movdqa -0x120(%rbp), %xmm0
movdqa %xmm0, -0x1e0(%rbp)
movl $0x0, -0x194(%rbp)
movl -0x194(%rbp), %eax
addl $0x2, %eax
cmpl -0x18c(%rbp), %eax
jg 0x1552d3
movq -0x188(%rbp), %rax
movslq -0x194(%rbp), %rcx
leaq (%rax,%rcx,4), %rax
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rax
movq (%rax), %xmm0
movaps %xmm0, -0x100(%rbp)
movaps -0x100(%rbp), %xmm0
movaps %xmm0, -0x1f0(%rbp)
movaps -0x1f0(%rbp), %xmm1
movaps -0x1b0(%rbp), %xmm0
movaps %xmm1, -0xd0(%rbp)
movaps %xmm0, -0xe0(%rbp)
movaps -0xd0(%rbp), %xmm0
movaps -0xe0(%rbp), %xmm1
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]
movaps %xmm0, -0x200(%rbp)
movaps -0x200(%rbp), %xmm1
movaps -0x1e0(%rbp), %xmm0
movaps %xmm1, -0xb0(%rbp)
movaps %xmm0, -0xc0(%rbp)
movaps -0xb0(%rbp), %xmm0
movaps -0xc0(%rbp), %xmm1
por %xmm1, %xmm0
movaps %xmm0, -0x210(%rbp)
movaps -0x210(%rbp), %xmm0
pshuflw $0xbf, %xmm0, %xmm0     # xmm0 = xmm0[3,3,3,2,4,5,6,7]
movaps %xmm0, -0x220(%rbp)
movaps -0x220(%rbp), %xmm0
pshufhw $0xbf, %xmm0, %xmm0     # xmm0 = xmm0[0,1,2,3,7,7,7,6]
movaps %xmm0, -0x230(%rbp)
movaps -0x230(%rbp), %xmm1
movaps -0x200(%rbp), %xmm0
movaps %xmm1, -0x90(%rbp)
movaps %xmm0, -0xa0(%rbp)
movaps -0x90(%rbp), %xmm0
movaps -0xa0(%rbp), %xmm1
pmullw %xmm1, %xmm0
movaps %xmm0, -0x240(%rbp)
movaps -0x240(%rbp), %xmm1
movaps -0x1c0(%rbp), %xmm0
movaps %xmm1, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
movaps -0x70(%rbp), %xmm0
movaps -0x80(%rbp), %xmm1
paddw %xmm1, %xmm0
movaps %xmm0, -0x250(%rbp)
movaps -0x250(%rbp), %xmm1
movaps -0x1d0(%rbp), %xmm0
movaps %xmm1, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
movaps -0x50(%rbp), %xmm0
movaps -0x60(%rbp), %xmm1
pmulhuw %xmm1, %xmm0
movaps %xmm0, -0x260(%rbp)
movaps -0x260(%rbp), %xmm1
movaps -0x1b0(%rbp), %xmm0
movaps %xmm1, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
movaps -0x30(%rbp), %xmm0
movaps -0x40(%rbp), %xmm1
packuswb %xmm1, %xmm0
movaps %xmm0, -0x270(%rbp)
movq -0x188(%rbp), %rax
movslq -0x194(%rbp), %rcx
leaq (%rax,%rcx,4), %rax
movaps -0x270(%rbp), %xmm0
movq %rax, -0x8(%rbp)
movaps %xmm0, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movl -0x194(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x194(%rbp)
jmp 0x155105
jmp 0x1552d5
movl -0x194(%rbp), %ecx
movl -0x18c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x18c(%rbp)
cmpl $0x0, -0x18c(%rbp)
jle 0x155318
movq -0x188(%rbp), %rdi
movslq -0x194(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movl -0x18c(%rbp), %esi
movl -0x190(%rbp), %edx
callq 0x1490a0
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
nopw %cs:(%rax,%rax)