// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/alpha_processing_sse2.c
// Function: ExtractGreen_SSE2
static void ExtractGreen_SSE2(const uint32_t* WEBP_RESTRICT argb,
                              uint8_t* WEBP_RESTRICT alpha, int size) {
  int i;
  const __m128i mask = _mm_set1_epi32(0xff);
  const __m128i* src = (const __m128i*)argb;

  for (i = 0; i + 16 <= size; i += 16, src += 4) {
    const __m128i a0 = _mm_loadu_si128(src + 0);
    const __m128i a1 = _mm_loadu_si128(src + 1);
    const __m128i a2 = _mm_loadu_si128(src + 2);
    const __m128i a3 = _mm_loadu_si128(src + 3);
    const __m128i b0 = _mm_srli_epi32(a0, 8);
    const __m128i b1 = _mm_srli_epi32(a1, 8);
    const __m128i b2 = _mm_srli_epi32(a2, 8);
    const __m128i b3 = _mm_srli_epi32(a3, 8);
    const __m128i c0 = _mm_and_si128(b0, mask);
    const __m128i c1 = _mm_and_si128(b1, mask);
    const __m128i c2 = _mm_and_si128(b2, mask);
    const __m128i c3 = _mm_and_si128(b3, mask);
    const __m128i d0 = _mm_packs_epi32(c0, c1);
    const __m128i d1 = _mm_packs_epi32(c2, c3);
    const __m128i e = _mm_packus_epi16(d0, d1);
    // store
    _mm_storeu_si128((__m128i*)&alpha[i], e);
  }
  if (i + 8 <= size) {
    const __m128i a0 = _mm_loadu_si128(src + 0);
    const __m128i a1 = _mm_loadu_si128(src + 1);
    const __m128i b0 = _mm_srli_epi32(a0, 8);
    const __m128i b1 = _mm_srli_epi32(a1, 8);
    const __m128i c0 = _mm_and_si128(b0, mask);
    const __m128i c1 = _mm_and_si128(b1, mask);
    const __m128i d = _mm_packs_epi32(c0, c1);
    const __m128i e = _mm_packus_epi16(d, d);
    _mm_storel_epi64((__m128i*)&alpha[i], e);
    i += 8;
  }
  for (; i < size; ++i) alpha[i] = argb[i] >> 8;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3e0, %rsp            # imm = 0x3E0
movq %rdi, -0x2b8(%rbp)
movq %rsi, -0x2c0(%rbp)
movl %edx, -0x2c4(%rbp)
movl $0xff, -0x204(%rbp)
movl -0x204(%rbp), %eax
movl %eax, -0x1e4(%rbp)
movl %eax, -0x1e8(%rbp)
movl %eax, -0x1ec(%rbp)
movl %eax, -0x1f0(%rbp)
movd -0x1e4(%rbp), %xmm0
movd -0x1e8(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd -0x1ec(%rbp), %xmm2
movd -0x1f0(%rbp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movdqa %xmm0, -0x200(%rbp)
movdqa -0x200(%rbp), %xmm0
movdqa %xmm0, -0x2e0(%rbp)
movq -0x2b8(%rbp), %rax
movq %rax, -0x2e8(%rbp)
movl $0x0, -0x2c8(%rbp)
movl -0x2c8(%rbp), %eax
addl $0x10, %eax
cmpl -0x2c4(%rbp), %eax
jg 0x1572ad
movq -0x2e8(%rbp), %rax
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x300(%rbp)
movq -0x2e8(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x230(%rbp)
movq -0x230(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x310(%rbp)
movq -0x2e8(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x238(%rbp)
movq -0x238(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x320(%rbp)
movq -0x2e8(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x240(%rbp)
movq -0x240(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x330(%rbp)
movdqa -0x300(%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, -0x340(%rbp)
movdqa -0x310(%rbp), %xmm0
movdqa %xmm0, -0x30(%rbp)
movl $0x8, -0x34(%rbp)
movdqa -0x30(%rbp), %xmm0
movl -0x34(%rbp), %eax
movd %eax, %xmm1
psrld %xmm1, %xmm0
movdqa %xmm0, -0x350(%rbp)
movdqa -0x320(%rbp), %xmm0
movdqa %xmm0, -0x50(%rbp)
movl $0x8, -0x54(%rbp)
movdqa -0x50(%rbp), %xmm0
movl -0x54(%rbp), %eax
movd %eax, %xmm1
psrld %xmm1, %xmm0
movdqa %xmm0, -0x360(%rbp)
movdqa -0x330(%rbp), %xmm0
movdqa %xmm0, -0x70(%rbp)
movl $0x8, -0x74(%rbp)
movdqa -0x70(%rbp), %xmm0
movl -0x74(%rbp), %eax
movd %eax, %xmm1
psrld %xmm1, %xmm0
movdqa %xmm0, -0x370(%rbp)
movdqa -0x340(%rbp), %xmm1
movdqa -0x2e0(%rbp), %xmm0
movdqa %xmm1, -0x130(%rbp)
movdqa %xmm0, -0x140(%rbp)
movdqa -0x130(%rbp), %xmm0
pand -0x140(%rbp), %xmm0
movdqa %xmm0, -0x380(%rbp)
movdqa -0x350(%rbp), %xmm1
movdqa -0x2e0(%rbp), %xmm0
movdqa %xmm1, -0x150(%rbp)
movdqa %xmm0, -0x160(%rbp)
movdqa -0x150(%rbp), %xmm0
pand -0x160(%rbp), %xmm0
movdqa %xmm0, -0x390(%rbp)
movdqa -0x360(%rbp), %xmm1
movdqa -0x2e0(%rbp), %xmm0
movdqa %xmm1, -0x170(%rbp)
movdqa %xmm0, -0x180(%rbp)
movdqa -0x170(%rbp), %xmm0
pand -0x180(%rbp), %xmm0
movdqa %xmm0, -0x3a0(%rbp)
movdqa -0x370(%rbp), %xmm1
movdqa -0x2e0(%rbp), %xmm0
movdqa %xmm1, -0x190(%rbp)
movdqa %xmm0, -0x1a0(%rbp)
movdqa -0x190(%rbp), %xmm0
pand -0x1a0(%rbp), %xmm0
movdqa %xmm0, -0x3b0(%rbp)
movdqa -0x380(%rbp), %xmm1
movdqa -0x390(%rbp), %xmm0
movdqa %xmm1, -0xd0(%rbp)
movdqa %xmm0, -0xe0(%rbp)
movdqa -0xd0(%rbp), %xmm0
movdqa -0xe0(%rbp), %xmm1
packssdw %xmm1, %xmm0
movdqa %xmm0, -0x3c0(%rbp)
movdqa -0x3a0(%rbp), %xmm1
movdqa -0x3b0(%rbp), %xmm0
movdqa %xmm1, -0xf0(%rbp)
movdqa %xmm0, -0x100(%rbp)
movdqa -0xf0(%rbp), %xmm0
movdqa -0x100(%rbp), %xmm1
packssdw %xmm1, %xmm0
movdqa %xmm0, -0x3d0(%rbp)
movdqa -0x3c0(%rbp), %xmm1
movdqa -0x3d0(%rbp), %xmm0
movdqa %xmm1, -0x280(%rbp)
movdqa %xmm0, -0x290(%rbp)
movdqa -0x280(%rbp), %xmm0
movdqa -0x290(%rbp), %xmm1
packuswb %xmm1, %xmm0
movdqa %xmm0, -0x3e0(%rbp)
movq -0x2c0(%rbp), %rax
movslq -0x2c8(%rbp), %rcx
addq %rcx, %rax
movdqa -0x3e0(%rbp), %xmm0
movq %rax, -0x210(%rbp)
movdqa %xmm0, -0x220(%rbp)
movdqa -0x220(%rbp), %xmm0
movq -0x210(%rbp), %rax
movdqu %xmm0, (%rax)
movl -0x2c8(%rbp), %eax
addl $0x10, %eax
movl %eax, -0x2c8(%rbp)
movq -0x2e8(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x2e8(%rbp)
jmp 0x156f63
movl -0x2c8(%rbp), %eax
addl $0x8, %eax
cmpl -0x2c4(%rbp), %eax
jg 0x15747b
movq -0x2e8(%rbp), %rax
movq %rax, -0x248(%rbp)
movq -0x248(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x3f0(%rbp)
movq -0x2e8(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x250(%rbp)
movq -0x250(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x400(%rbp)
movaps -0x3f0(%rbp), %xmm0
movaps %xmm0, -0x90(%rbp)
movl $0x8, -0x94(%rbp)
movaps -0x90(%rbp), %xmm0
movd -0x94(%rbp), %xmm1
psrld %xmm1, %xmm0
movaps %xmm0, -0x410(%rbp)
movaps -0x400(%rbp), %xmm0
movaps %xmm0, -0xb0(%rbp)
movl $0x8, -0xb4(%rbp)
movaps -0xb0(%rbp), %xmm0
movd -0xb4(%rbp), %xmm1
psrld %xmm1, %xmm0
movaps %xmm0, -0x420(%rbp)
movaps -0x410(%rbp), %xmm1
movaps -0x2e0(%rbp), %xmm0
movaps %xmm1, -0x1b0(%rbp)
movaps %xmm0, -0x1c0(%rbp)
movaps -0x1b0(%rbp), %xmm0
movaps -0x1c0(%rbp), %xmm1
pand %xmm1, %xmm0
movaps %xmm0, -0x430(%rbp)
movaps -0x420(%rbp), %xmm1
movaps -0x2e0(%rbp), %xmm0
movaps %xmm1, -0x1d0(%rbp)
movaps %xmm0, -0x1e0(%rbp)
movaps -0x1d0(%rbp), %xmm0
movaps -0x1e0(%rbp), %xmm1
pand %xmm1, %xmm0
movaps %xmm0, -0x440(%rbp)
movaps -0x430(%rbp), %xmm1
movaps -0x440(%rbp), %xmm0
movaps %xmm1, -0x110(%rbp)
movaps %xmm0, -0x120(%rbp)
movaps -0x110(%rbp), %xmm0
movaps -0x120(%rbp), %xmm1
packssdw %xmm1, %xmm0
movaps %xmm0, -0x450(%rbp)
movaps -0x450(%rbp), %xmm0
movaps %xmm0, -0x2a0(%rbp)
movaps %xmm0, -0x2b0(%rbp)
movaps -0x2a0(%rbp), %xmm0
movaps -0x2b0(%rbp), %xmm1
packuswb %xmm1, %xmm0
movaps %xmm0, -0x460(%rbp)
movq -0x2c0(%rbp), %rax
movslq -0x2c8(%rbp), %rcx
addq %rcx, %rax
movaps -0x460(%rbp), %xmm0
movq %rax, -0x258(%rbp)
movaps %xmm0, -0x270(%rbp)
movq -0x270(%rbp), %rcx
movq -0x258(%rbp), %rax
movq %rcx, (%rax)
movl -0x2c8(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x2c8(%rbp)
jmp 0x15747d
movl -0x2c8(%rbp), %eax
cmpl -0x2c4(%rbp), %eax
jge 0x1574c3
movq -0x2b8(%rbp), %rax
movslq -0x2c8(%rbp), %rcx
movl (%rax,%rcx,4), %eax
shrl $0x8, %eax
movb %al, %dl
movq -0x2c0(%rbp), %rax
movslq -0x2c8(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x2c8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c8(%rbp)
jmp 0x15747d
addq $0x3e0, %rsp            # imm = 0x3E0
popq %rbp
retq
nopl (%rax)