// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/alpha_processing_sse2.c
// Function: ApplyAlphaMultiply_SSE2
void ApplyAlphaMultiply_SSE2(uint8_t* rgba, int alpha_first,
                                    int w, int h, int stride) {
  const __m128i zero = _mm_setzero_si128();
  const __m128i kMult = _mm_set1_epi16((short)0x8081);
  const __m128i kMask = _mm_set_epi16(0, 0xff, 0xff, 0, 0, 0xff, 0xff, 0);
  const int kSpan = 4;
  while (h-- > 0) {
    uint32_t* const rgbx = (uint32_t*)rgba;
    int i;
    if (!alpha_first) {
      for (i = 0; i + kSpan <= w; i += kSpan) {
        APPLY_ALPHA(rgbx[i], _MM_SHUFFLE(2, 3, 3, 3));
      }
    } else {
      for (i = 0; i + kSpan <= w; i += kSpan) {
        APPLY_ALPHA(rgbx[i], _MM_SHUFFLE(0, 0, 0, 1));
      }
    }
    // Finish with left-overs.
    for (; i < w; ++i) {
      uint8_t* const rgb = rgba + (alpha_first ? 1 : 0);
      const uint8_t* const alpha = rgba + (alpha_first ? 0 : 3);
      const uint32_t a = alpha[4 * i];
      if (a != 0xff) {
        const uint32_t mult = MULTIPLIER(a);
        rgb[4 * i + 0] = PREMULTIPLY(rgb[4 * i + 0], mult);
        rgb[4 * i + 1] = PREMULTIPLY(rgb[4 * i + 1], mult);
        rgb[4 * i + 2] = PREMULTIPLY(rgb[4 * i + 2], mult);
      }
    }
    rgba += stride;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x580, %rsp            # imm = 0x580
movq %rdi, -0x378(%rbp)
movl %esi, -0x37c(%rbp)
movl %edx, -0x380(%rbp)
movl %ecx, -0x384(%rbp)
movl %r8d, -0x388(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x370(%rbp)
movaps -0x370(%rbp), %xmm0
movaps %xmm0, -0x3a0(%rbp)
movw $0x8081, -0x352(%rbp)   # imm = 0x8081
movw -0x352(%rbp), %ax
movw %ax, -0x5fa(%rbp)
movw %ax, -0x332(%rbp)
movw %ax, -0x334(%rbp)
movw %ax, -0x336(%rbp)
movw %ax, -0x338(%rbp)
movw %ax, -0x33a(%rbp)
movw %ax, -0x33c(%rbp)
movw %ax, -0x33e(%rbp)
movw %ax, -0x340(%rbp)
movzwl -0x332(%rbp), %eax
movd %eax, %xmm1
movzwl -0x334(%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 -0x336(%rbp), %eax
movd %eax, %xmm2
movzwl -0x338(%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 -0x33a(%rbp), %eax
movd %eax, %xmm0
movzwl -0x33c(%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 -0x33e(%rbp), %eax
movd %eax, %xmm3
movzwl -0x340(%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, -0x350(%rbp)
movaps -0x350(%rbp), %xmm0
movaps %xmm0, -0x3b0(%rbp)
movw $0x0, -0x312(%rbp)
movw $0xff, -0x314(%rbp)
movw $0xff, -0x316(%rbp)
movw $0x0, -0x318(%rbp)
movw $0x0, -0x31a(%rbp)
movw $0xff, -0x31c(%rbp)
movw $0xff, -0x31e(%rbp)
movw $0x0, -0x320(%rbp)
movzwl -0x312(%rbp), %eax
movd %eax, %xmm1
movzwl -0x314(%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 -0x316(%rbp), %eax
movd %eax, %xmm2
movzwl -0x318(%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 -0x31a(%rbp), %eax
movd %eax, %xmm0
movzwl -0x31c(%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 -0x31e(%rbp), %eax
movd %eax, %xmm3
movzwl -0x320(%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, -0x330(%rbp)
movdqa -0x330(%rbp), %xmm0
movdqa %xmm0, -0x3c0(%rbp)
movl $0x4, -0x3c4(%rbp)
movl -0x384(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x384(%rbp)
cmpl $0x0, %eax
jle 0x1561d0
movq -0x378(%rbp), %rax
movq %rax, -0x3d0(%rbp)
cmpl $0x0, -0x37c(%rbp)
jne 0x155cec
movl $0x0, -0x3d4(%rbp)
movl -0x3d4(%rbp), %eax
addl $0x4, %eax
cmpl -0x380(%rbp), %eax
jg 0x155ce7
jmp 0x1559cf
movq -0x3d0(%rbp), %rax
movslq -0x3d4(%rbp), %rcx
leaq (%rax,%rcx,4), %rax
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x3f0(%rbp)
movaps -0x3f0(%rbp), %xmm1
movaps -0x3a0(%rbp), %xmm0
movaps %xmm1, -0x2e0(%rbp)
movaps %xmm0, -0x2f0(%rbp)
movaps -0x2e0(%rbp), %xmm0
movaps -0x2f0(%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, -0x400(%rbp)
movaps -0x3f0(%rbp), %xmm1
movaps -0x3a0(%rbp), %xmm0
movaps %xmm1, -0xd0(%rbp)
movaps %xmm0, -0xe0(%rbp)
movaps -0xd0(%rbp), %xmm0
movaps -0xe0(%rbp), %xmm1
punpckhbw %xmm1, %xmm0    # xmm0 = xmm0[8],xmm1[8],xmm0[9],xmm1[9],xmm0[10],xmm1[10],xmm0[11],xmm1[11],xmm0[12],xmm1[12],xmm0[13],xmm1[13],xmm0[14],xmm1[14],xmm0[15],xmm1[15]
movaps %xmm0, -0x410(%rbp)
movaps -0x400(%rbp), %xmm1
movaps -0x3c0(%rbp), %xmm0
movaps %xmm1, -0x260(%rbp)
movaps %xmm0, -0x270(%rbp)
movaps -0x260(%rbp), %xmm0
movaps -0x270(%rbp), %xmm1
por %xmm1, %xmm0
movaps %xmm0, -0x420(%rbp)
movaps -0x410(%rbp), %xmm1
movaps -0x3c0(%rbp), %xmm0
movaps %xmm1, -0x280(%rbp)
movaps %xmm0, -0x290(%rbp)
movaps -0x280(%rbp), %xmm0
movaps -0x290(%rbp), %xmm1
por %xmm1, %xmm0
movaps %xmm0, -0x430(%rbp)
movaps -0x420(%rbp), %xmm0
pshuflw $0xbf, %xmm0, %xmm0     # xmm0 = xmm0[3,3,3,2,4,5,6,7]
movaps %xmm0, -0x440(%rbp)
movaps -0x430(%rbp), %xmm0
pshuflw $0xbf, %xmm0, %xmm0     # xmm0 = xmm0[3,3,3,2,4,5,6,7]
movaps %xmm0, -0x450(%rbp)
movaps -0x440(%rbp), %xmm0
pshufhw $0xbf, %xmm0, %xmm0     # xmm0 = xmm0[0,1,2,3,7,7,7,6]
movaps %xmm0, -0x460(%rbp)
movaps -0x450(%rbp), %xmm0
pshufhw $0xbf, %xmm0, %xmm0     # xmm0 = xmm0[0,1,2,3,7,7,7,6]
movdqa %xmm0, -0x470(%rbp)
movdqa -0x460(%rbp), %xmm1
movdqa -0x400(%rbp), %xmm0
movdqa %xmm1, -0x1e0(%rbp)
movdqa %xmm0, -0x1f0(%rbp)
movdqa -0x1e0(%rbp), %xmm0
movdqa -0x1f0(%rbp), %xmm1
pmullw %xmm1, %xmm0
movdqa %xmm0, -0x480(%rbp)
movdqa -0x470(%rbp), %xmm1
movdqa -0x410(%rbp), %xmm0
movdqa %xmm1, -0x200(%rbp)
movdqa %xmm0, -0x210(%rbp)
movdqa -0x200(%rbp), %xmm0
movdqa -0x210(%rbp), %xmm1
pmullw %xmm1, %xmm0
movdqa %xmm0, -0x490(%rbp)
movdqa -0x480(%rbp), %xmm1
movdqa -0x3b0(%rbp), %xmm0
movdqa %xmm1, -0x160(%rbp)
movdqa %xmm0, -0x170(%rbp)
movdqa -0x160(%rbp), %xmm0
movdqa -0x170(%rbp), %xmm1
pmulhuw %xmm1, %xmm0
movdqa %xmm0, -0x4a0(%rbp)
movdqa -0x490(%rbp), %xmm1
movdqa -0x3b0(%rbp), %xmm0
movdqa %xmm1, -0x180(%rbp)
movdqa %xmm0, -0x190(%rbp)
movdqa -0x180(%rbp), %xmm0
movdqa -0x190(%rbp), %xmm1
pmulhuw %xmm1, %xmm0
movdqa %xmm0, -0x4b0(%rbp)
movdqa -0x4a0(%rbp), %xmm0
movdqa %xmm0, -0x50(%rbp)
movl $0x7, -0x54(%rbp)
movdqa -0x50(%rbp), %xmm0
movl -0x54(%rbp), %eax
movd %eax, %xmm1
psrlw %xmm1, %xmm0
movdqa %xmm0, -0x4c0(%rbp)
movdqa -0x4b0(%rbp), %xmm0
movdqa %xmm0, -0x70(%rbp)
movl $0x7, -0x74(%rbp)
movdqa -0x70(%rbp), %xmm0
movl -0x74(%rbp), %eax
movd %eax, %xmm1
psrlw %xmm1, %xmm0
movdqa %xmm0, -0x4d0(%rbp)
movdqa -0x4c0(%rbp), %xmm1
movdqa -0x4d0(%rbp), %xmm0
movdqa %xmm1, -0x120(%rbp)
movdqa %xmm0, -0x130(%rbp)
movdqa -0x120(%rbp), %xmm0
movdqa -0x130(%rbp), %xmm1
packuswb %xmm1, %xmm0
movdqa %xmm0, -0x4e0(%rbp)
movq -0x3d0(%rbp), %rax
movslq -0x3d4(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movdqa -0x4e0(%rbp), %xmm0
movq %rax, -0x8(%rbp)
movdqa %xmm0, -0x20(%rbp)
movdqa -0x20(%rbp), %xmm0
movq -0x8(%rbp), %rax
movdqu %xmm0, (%rax)
jmp 0x155cd3
movl -0x3d4(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x3d4(%rbp)
jmp 0x1559b8
jmp 0x15603f
movl $0x0, -0x3d4(%rbp)
movl -0x3d4(%rbp), %eax
addl $0x4, %eax
cmpl -0x380(%rbp), %eax
jg 0x15603d
jmp 0x155d0d
movq -0x3d0(%rbp), %rax
movslq -0x3d4(%rbp), %rcx
leaq (%rax,%rcx,4), %rax
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x4f0(%rbp)
movaps -0x4f0(%rbp), %xmm1
movaps -0x3a0(%rbp), %xmm0
movaps %xmm1, -0x300(%rbp)
movaps %xmm0, -0x310(%rbp)
movaps -0x300(%rbp), %xmm0
movaps -0x310(%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, -0x500(%rbp)
movaps -0x4f0(%rbp), %xmm1
movaps -0x3a0(%rbp), %xmm0
movaps %xmm1, -0xf0(%rbp)
movaps %xmm0, -0x100(%rbp)
movaps -0xf0(%rbp), %xmm0
movaps -0x100(%rbp), %xmm1
punpckhbw %xmm1, %xmm0    # xmm0 = xmm0[8],xmm1[8],xmm0[9],xmm1[9],xmm0[10],xmm1[10],xmm0[11],xmm1[11],xmm0[12],xmm1[12],xmm0[13],xmm1[13],xmm0[14],xmm1[14],xmm0[15],xmm1[15]
movaps %xmm0, -0x510(%rbp)
movaps -0x500(%rbp), %xmm1
movaps -0x3c0(%rbp), %xmm0
movaps %xmm1, -0x2a0(%rbp)
movaps %xmm0, -0x2b0(%rbp)
movaps -0x2a0(%rbp), %xmm0
movaps -0x2b0(%rbp), %xmm1
por %xmm1, %xmm0
movaps %xmm0, -0x520(%rbp)
movaps -0x510(%rbp), %xmm1
movaps -0x3c0(%rbp), %xmm0
movaps %xmm1, -0x2c0(%rbp)
movaps %xmm0, -0x2d0(%rbp)
movaps -0x2c0(%rbp), %xmm0
movaps -0x2d0(%rbp), %xmm1
por %xmm1, %xmm0
movaps %xmm0, -0x530(%rbp)
movaps -0x520(%rbp), %xmm0
pshuflw $0x1, %xmm0, %xmm0      # xmm0 = xmm0[1,0,0,0,4,5,6,7]
movaps %xmm0, -0x540(%rbp)
movaps -0x530(%rbp), %xmm0
pshuflw $0x1, %xmm0, %xmm0      # xmm0 = xmm0[1,0,0,0,4,5,6,7]
movaps %xmm0, -0x550(%rbp)
movaps -0x540(%rbp), %xmm0
pshufhw $0x1, %xmm0, %xmm0      # xmm0 = xmm0[0,1,2,3,5,4,4,4]
movaps %xmm0, -0x560(%rbp)
movaps -0x550(%rbp), %xmm0
pshufhw $0x1, %xmm0, %xmm0      # xmm0 = xmm0[0,1,2,3,5,4,4,4]
movdqa %xmm0, -0x570(%rbp)
movdqa -0x560(%rbp), %xmm1
movdqa -0x500(%rbp), %xmm0
movdqa %xmm1, -0x220(%rbp)
movdqa %xmm0, -0x230(%rbp)
movdqa -0x220(%rbp), %xmm0
movdqa -0x230(%rbp), %xmm1
pmullw %xmm1, %xmm0
movdqa %xmm0, -0x580(%rbp)
movdqa -0x570(%rbp), %xmm1
movdqa -0x510(%rbp), %xmm0
movdqa %xmm1, -0x240(%rbp)
movdqa %xmm0, -0x250(%rbp)
movdqa -0x240(%rbp), %xmm0
movdqa -0x250(%rbp), %xmm1
pmullw %xmm1, %xmm0
movdqa %xmm0, -0x590(%rbp)
movdqa -0x580(%rbp), %xmm1
movdqa -0x3b0(%rbp), %xmm0
movdqa %xmm1, -0x1a0(%rbp)
movdqa %xmm0, -0x1b0(%rbp)
movdqa -0x1a0(%rbp), %xmm0
movdqa -0x1b0(%rbp), %xmm1
pmulhuw %xmm1, %xmm0
movdqa %xmm0, -0x5a0(%rbp)
movdqa -0x590(%rbp), %xmm1
movdqa -0x3b0(%rbp), %xmm0
movdqa %xmm1, -0x1c0(%rbp)
movdqa %xmm0, -0x1d0(%rbp)
movdqa -0x1c0(%rbp), %xmm0
movdqa -0x1d0(%rbp), %xmm1
pmulhuw %xmm1, %xmm0
movdqa %xmm0, -0x5b0(%rbp)
movdqa -0x5a0(%rbp), %xmm0
movdqa %xmm0, -0x90(%rbp)
movl $0x7, -0x94(%rbp)
movdqa -0x90(%rbp), %xmm0
movl -0x94(%rbp), %eax
movd %eax, %xmm1
psrlw %xmm1, %xmm0
movdqa %xmm0, -0x5c0(%rbp)
movdqa -0x5b0(%rbp), %xmm0
movdqa %xmm0, -0xb0(%rbp)
movl $0x7, -0xb4(%rbp)
movdqa -0xb0(%rbp), %xmm0
movl -0xb4(%rbp), %eax
movd %eax, %xmm1
psrlw %xmm1, %xmm0
movdqa %xmm0, -0x5d0(%rbp)
movdqa -0x5c0(%rbp), %xmm1
movdqa -0x5d0(%rbp), %xmm0
movdqa %xmm1, -0x140(%rbp)
movdqa %xmm0, -0x150(%rbp)
movdqa -0x140(%rbp), %xmm0
movdqa -0x150(%rbp), %xmm1
packuswb %xmm1, %xmm0
movdqa %xmm0, -0x5e0(%rbp)
movq -0x3d0(%rbp), %rax
movslq -0x3d4(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movdqa -0x5e0(%rbp), %xmm0
movq %rax, -0x28(%rbp)
movdqa %xmm0, -0x40(%rbp)
movdqa -0x40(%rbp), %xmm0
movq -0x28(%rbp), %rax
movdqu %xmm0, (%rax)
jmp 0x156029
movl -0x3d4(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x3d4(%rbp)
jmp 0x155cf6
jmp 0x15603f
jmp 0x156041
movl -0x3d4(%rbp), %eax
cmpl -0x380(%rbp), %eax
jge 0x1561b1
movq -0x378(%rbp), %rax
movl -0x37c(%rbp), %esi
xorl %ecx, %ecx
movl $0x1, %edx
cmpl $0x0, %esi
cmovnel %edx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x5e8(%rbp)
movq -0x378(%rbp), %rax
movl -0x37c(%rbp), %esi
movl $0x3, %ecx
xorl %edx, %edx
cmpl $0x0, %esi
cmovnel %edx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x5f0(%rbp)
movq -0x5f0(%rbp), %rax
movl -0x3d4(%rbp), %ecx
shll $0x2, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x5f4(%rbp)
cmpl $0xff, -0x5f4(%rbp)
je 0x15619b
imull $0x8081, -0x5f4(%rbp), %eax # imm = 0x8081
movl %eax, -0x5f8(%rbp)
movq -0x5e8(%rbp), %rax
movl -0x3d4(%rbp), %ecx
shll $0x2, %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
imull -0x5f8(%rbp), %eax
shrl $0x17, %eax
movb %al, %dl
movq -0x5e8(%rbp), %rax
movl -0x3d4(%rbp), %ecx
shll $0x2, %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x5e8(%rbp), %rax
movl -0x3d4(%rbp), %ecx
shll $0x2, %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
imull -0x5f8(%rbp), %eax
shrl $0x17, %eax
movb %al, %dl
movq -0x5e8(%rbp), %rax
movl -0x3d4(%rbp), %ecx
shll $0x2, %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x5e8(%rbp), %rax
movl -0x3d4(%rbp), %ecx
shll $0x2, %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
imull -0x5f8(%rbp), %eax
shrl $0x17, %eax
movb %al, %dl
movq -0x5e8(%rbp), %rax
movl -0x3d4(%rbp), %ecx
shll $0x2, %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0x15619d
movl -0x3d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3d4(%rbp)
jmp 0x156041
movl -0x388(%rbp), %ecx
movq -0x378(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x378(%rbp)
jmp 0x155979
addq $0x580, %rsp            # imm = 0x580
popq %rbp
retq
nopl (%rax)