// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/alpha_processing_sse2.c
// Function: DispatchAlphaToGreen_SSE2
static void DispatchAlphaToGreen_SSE2(const uint8_t* WEBP_RESTRICT alpha,
                                      int alpha_stride, int width, int height,
                                      uint32_t* WEBP_RESTRICT dst,
                                      int dst_stride) {
  int i, j;
  const __m128i zero = _mm_setzero_si128();
  const int limit = width & ~15;
  for (j = 0; j < height; ++j) {
    for (i = 0; i < limit; i += 16) {   // process 16 alpha bytes
      const __m128i a0 = _mm_loadu_si128((const __m128i*)&alpha[i]);
      const __m128i a1 = _mm_unpacklo_epi8(zero, a0);  // note the 'zero' first!
      const __m128i b1 = _mm_unpackhi_epi8(zero, a0);
      const __m128i a2_lo = _mm_unpacklo_epi16(a1, zero);
      const __m128i b2_lo = _mm_unpacklo_epi16(b1, zero);
      const __m128i a2_hi = _mm_unpackhi_epi16(a1, zero);
      const __m128i b2_hi = _mm_unpackhi_epi16(b1, zero);
      _mm_storeu_si128((__m128i*)&dst[i +  0], a2_lo);
      _mm_storeu_si128((__m128i*)&dst[i +  4], a2_hi);
      _mm_storeu_si128((__m128i*)&dst[i +  8], b2_lo);
      _mm_storeu_si128((__m128i*)&dst[i + 12], b2_hi);
    }
    for (; i < width; ++i) dst[i] = alpha[i] << 8;
    alpha += alpha_stride;
    dst += dst_stride;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x168(%rbp)
movl %esi, -0x16c(%rbp)
movl %edx, -0x170(%rbp)
movl %ecx, -0x174(%rbp)
movq %r8, -0x180(%rbp)
movl %r9d, -0x184(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x160(%rbp)
movdqa -0x160(%rbp), %xmm0
movdqa %xmm0, -0x1a0(%rbp)
movl -0x170(%rbp), %eax
andl $-0x10, %eax
movl %eax, -0x1a4(%rbp)
movl $0x0, -0x18c(%rbp)
movl -0x18c(%rbp), %eax
cmpl -0x174(%rbp), %eax
jge 0x156aa2
movl $0x0, -0x188(%rbp)
movl -0x188(%rbp), %eax
cmpl -0x1a4(%rbp), %eax
jge 0x156a0f
movq -0x168(%rbp), %rax
movslq -0x188(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x1c0(%rbp)
movaps -0x1a0(%rbp), %xmm1
movaps -0x1c0(%rbp), %xmm0
movaps %xmm1, -0x140(%rbp)
movaps %xmm0, -0x150(%rbp)
movaps -0x140(%rbp), %xmm0
movaps -0x150(%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, -0x1d0(%rbp)
movaps -0x1a0(%rbp), %xmm1
movaps -0x1c0(%rbp), %xmm0
movaps %xmm1, -0x110(%rbp)
movaps %xmm0, -0x120(%rbp)
movaps -0x110(%rbp), %xmm0
movaps -0x120(%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, -0x1e0(%rbp)
movaps -0x1d0(%rbp), %xmm1
movaps -0x1a0(%rbp), %xmm0
movaps %xmm1, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
movaps -0x50(%rbp), %xmm0
movaps -0x60(%rbp), %xmm1
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
movaps %xmm0, -0x1f0(%rbp)
movaps -0x1e0(%rbp), %xmm1
movaps -0x1a0(%rbp), %xmm0
movaps %xmm1, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
movaps -0x70(%rbp), %xmm0
movaps -0x80(%rbp), %xmm1
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
movaps %xmm0, -0x200(%rbp)
movaps -0x1d0(%rbp), %xmm1
movaps -0x1a0(%rbp), %xmm0
movaps %xmm1, -0x10(%rbp)
movaps %xmm0, -0x20(%rbp)
movaps -0x10(%rbp), %xmm0
movaps -0x20(%rbp), %xmm1
punpckhwd %xmm1, %xmm0    # xmm0 = xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
movaps %xmm0, -0x210(%rbp)
movaps -0x1e0(%rbp), %xmm1
movaps -0x1a0(%rbp), %xmm0
movaps %xmm1, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
movaps -0x30(%rbp), %xmm0
movaps -0x40(%rbp), %xmm1
punpckhwd %xmm1, %xmm0    # xmm0 = xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
movdqa %xmm0, -0x220(%rbp)
movq -0x180(%rbp), %rax
movl -0x188(%rbp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movdqa -0x1f0(%rbp), %xmm0
movq %rax, -0x88(%rbp)
movdqa %xmm0, -0xa0(%rbp)
movdqa -0xa0(%rbp), %xmm0
movq -0x88(%rbp), %rax
movdqu %xmm0, (%rax)
movq -0x180(%rbp), %rax
movl -0x188(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movdqa -0x210(%rbp), %xmm0
movq %rax, -0xa8(%rbp)
movdqa %xmm0, -0xc0(%rbp)
movdqa -0xc0(%rbp), %xmm0
movq -0xa8(%rbp), %rax
movdqu %xmm0, (%rax)
movq -0x180(%rbp), %rax
movl -0x188(%rbp), %ecx
addl $0x8, %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movdqa -0x200(%rbp), %xmm0
movq %rax, -0xc8(%rbp)
movdqa %xmm0, -0xe0(%rbp)
movdqa -0xe0(%rbp), %xmm0
movq -0xc8(%rbp), %rax
movdqu %xmm0, (%rax)
movq -0x180(%rbp), %rax
movl -0x188(%rbp), %ecx
addl $0xc, %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movdqa -0x220(%rbp), %xmm0
movq %rax, -0xe8(%rbp)
movdqa %xmm0, -0x100(%rbp)
movdqa -0x100(%rbp), %xmm0
movq -0xe8(%rbp), %rax
movdqu %xmm0, (%rax)
movl -0x188(%rbp), %eax
addl $0x10, %eax
movl %eax, -0x188(%rbp)
jmp 0x1567a1
jmp 0x156a11
movl -0x188(%rbp), %eax
cmpl -0x170(%rbp), %eax
jge 0x156a56
movq -0x168(%rbp), %rax
movslq -0x188(%rbp), %rcx
movzbl (%rax,%rcx), %edx
shll $0x8, %edx
movq -0x180(%rbp), %rax
movslq -0x188(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x188(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x188(%rbp)
jmp 0x156a11
movl -0x16c(%rbp), %ecx
movq -0x168(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x168(%rbp)
movl -0x184(%rbp), %ecx
movq -0x180(%rbp), %rax
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x180(%rbp)
movl -0x18c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18c(%rbp)
jmp 0x156785
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
nopl (%rax,%rax)