// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/alpha_processing_sse2.c
// Function: HasAlpha32b_SSE2
static int HasAlpha32b_SSE2(const uint8_t* src, int length) {
  const __m128i alpha_mask = _mm_set1_epi32(0xff);
  const __m128i all_0xff = _mm_set1_epi8((char)0xff);
  int i = 0;
  // We don't know if we can access the last 3 bytes after the last alpha
  // value 'src[4 * length - 4]' (because we don't know if alpha is the first
  // or the last byte of the quadruplet). Hence the '-3' protection below.
  length = length * 4 - 3;   // size in bytes
  for (; i + 64 <= length; i += 64) {
    const __m128i a0 = _mm_loadu_si128((const __m128i*)(src + i +  0));
    const __m128i a1 = _mm_loadu_si128((const __m128i*)(src + i + 16));
    const __m128i a2 = _mm_loadu_si128((const __m128i*)(src + i + 32));
    const __m128i a3 = _mm_loadu_si128((const __m128i*)(src + i + 48));
    const __m128i b0 = _mm_and_si128(a0, alpha_mask);
    const __m128i b1 = _mm_and_si128(a1, alpha_mask);
    const __m128i b2 = _mm_and_si128(a2, alpha_mask);
    const __m128i b3 = _mm_and_si128(a3, alpha_mask);
    const __m128i c0 = _mm_packs_epi32(b0, b1);
    const __m128i c1 = _mm_packs_epi32(b2, b3);
    const __m128i d  = _mm_packus_epi16(c0, c1);
    const __m128i bits = _mm_cmpeq_epi8(d, all_0xff);
    const int mask = _mm_movemask_epi8(bits);
    if (mask != 0xffff) return 1;
  }
  for (; i + 32 <= length; i += 32) {
    const __m128i a0 = _mm_loadu_si128((const __m128i*)(src + i +  0));
    const __m128i a1 = _mm_loadu_si128((const __m128i*)(src + i + 16));
    const __m128i b0 = _mm_and_si128(a0, alpha_mask);
    const __m128i b1 = _mm_and_si128(a1, alpha_mask);
    const __m128i c  = _mm_packs_epi32(b0, b1);
    const __m128i d  = _mm_packus_epi16(c, c);
    const __m128i bits = _mm_cmpeq_epi8(d, all_0xff);
    const int mask = _mm_movemask_epi8(bits);
    if (mask != 0xffff) return 1;
  }
  for (; i <= length; i += 4) if (src[i] != 0xff) return 1;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x370, %rsp            # imm = 0x370
movq %rdi, -0x260(%rbp)
movl %esi, -0x264(%rbp)
movl $0xff, -0x1d4(%rbp)
movl -0x1d4(%rbp), %eax
movl %eax, -0x1b4(%rbp)
movl %eax, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
movl %eax, -0x1c0(%rbp)
movd -0x1b4(%rbp), %xmm0
movd -0x1b8(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd -0x1bc(%rbp), %xmm2
movd -0x1c0(%rbp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movaps %xmm0, -0x1d0(%rbp)
movaps -0x1d0(%rbp), %xmm0
movaps %xmm0, -0x280(%rbp)
movb $-0x1, -0x21(%rbp)
movb -0x21(%rbp), %al
movb %al, -0x3e5(%rbp)
movb %al, -0x1(%rbp)
movb %al, -0x2(%rbp)
movb %al, -0x3(%rbp)
movb %al, -0x4(%rbp)
movb %al, -0x5(%rbp)
movb %al, -0x6(%rbp)
movb %al, -0x7(%rbp)
movb %al, -0x8(%rbp)
movb %al, -0x9(%rbp)
movb %al, -0xa(%rbp)
movb %al, -0xb(%rbp)
movb %al, -0xc(%rbp)
movb %al, -0xd(%rbp)
movb %al, -0xe(%rbp)
movb %al, -0xf(%rbp)
movb %al, -0x10(%rbp)
movzbl -0x1(%rbp), %eax
movd %eax, %xmm0
movzbl -0x2(%rbp), %eax
movd %eax, %xmm1
punpcklbw %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
movzbl -0x3(%rbp), %eax
movd %eax, %xmm2
movzbl -0x4(%rbp), %eax
movd %eax, %xmm0
punpcklbw %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7]
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
movzbl -0x5(%rbp), %eax
movd %eax, %xmm1
movzbl -0x6(%rbp), %eax
movd %eax, %xmm2
punpcklbw %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3],xmm2[4],xmm1[4],xmm2[5],xmm1[5],xmm2[6],xmm1[6],xmm2[7],xmm1[7]
movzbl -0x7(%rbp), %eax
movd %eax, %xmm3
movzbl -0x8(%rbp), %eax
movd %eax, %xmm1
punpcklbw %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1],xmm1[2],xmm3[2],xmm1[3],xmm3[3],xmm1[4],xmm3[4],xmm1[5],xmm3[5],xmm1[6],xmm3[6],xmm1[7],xmm3[7]
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]
movzbl -0x9(%rbp), %eax
movd %eax, %xmm2
movzbl -0xa(%rbp), %eax
movd %eax, %xmm0
punpcklbw %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3],xmm0[4],xmm2[4],xmm0[5],xmm2[5],xmm0[6],xmm2[6],xmm0[7],xmm2[7]
movzbl -0xb(%rbp), %eax
movd %eax, %xmm3
movzbl -0xc(%rbp), %eax
movd %eax, %xmm2
punpcklbw %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1],xmm2[2],xmm3[2],xmm2[3],xmm3[3],xmm2[4],xmm3[4],xmm2[5],xmm3[5],xmm2[6],xmm3[6],xmm2[7],xmm3[7]
punpcklwd %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
movzbl -0xd(%rbp), %eax
movd %eax, %xmm0
movzbl -0xe(%rbp), %eax
movd %eax, %xmm3
punpcklbw %xmm0, %xmm3    # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1],xmm3[2],xmm0[2],xmm3[3],xmm0[3],xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
movzbl -0xf(%rbp), %eax
movd %eax, %xmm4
movzbl -0x10(%rbp), %eax
movd %eax, %xmm0
punpcklbw %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1],xmm0[2],xmm4[2],xmm0[3],xmm4[3],xmm0[4],xmm4[4],xmm0[5],xmm4[5],xmm0[6],xmm4[6],xmm0[7],xmm4[7]
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, -0x20(%rbp)
movdqa -0x20(%rbp), %xmm0
movdqa %xmm0, -0x290(%rbp)
movl $0x0, -0x294(%rbp)
movl -0x264(%rbp), %eax
shll $0x2, %eax
subl $0x3, %eax
movl %eax, -0x264(%rbp)
movl -0x294(%rbp), %eax
addl $0x40, %eax
cmpl -0x264(%rbp), %eax
jg 0x157b3b
movq -0x260(%rbp), %rax
movslq -0x294(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x2b0(%rbp)
movq -0x260(%rbp), %rax
movslq -0x294(%rbp), %rcx
leaq 0x10(%rax,%rcx), %rax
movq %rax, -0x1e8(%rbp)
movq -0x1e8(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x2c0(%rbp)
movq -0x260(%rbp), %rax
movslq -0x294(%rbp), %rcx
leaq 0x20(%rax,%rcx), %rax
movq %rax, -0x1f0(%rbp)
movq -0x1f0(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x2d0(%rbp)
movq -0x260(%rbp), %rax
movslq -0x294(%rbp), %rcx
leaq 0x30(%rax,%rcx), %rax
movq %rax, -0x1f8(%rbp)
movq -0x1f8(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x2e0(%rbp)
movaps -0x2b0(%rbp), %xmm1
movaps -0x280(%rbp), %xmm0
movaps %xmm1, -0x100(%rbp)
movaps %xmm0, -0x110(%rbp)
movaps -0x100(%rbp), %xmm0
movaps -0x110(%rbp), %xmm1
pand %xmm1, %xmm0
movaps %xmm0, -0x2f0(%rbp)
movaps -0x2c0(%rbp), %xmm1
movaps -0x280(%rbp), %xmm0
movaps %xmm1, -0x120(%rbp)
movaps %xmm0, -0x130(%rbp)
movaps -0x120(%rbp), %xmm0
movaps -0x130(%rbp), %xmm1
pand %xmm1, %xmm0
movaps %xmm0, -0x300(%rbp)
movaps -0x2d0(%rbp), %xmm1
movaps -0x280(%rbp), %xmm0
movaps %xmm1, -0x140(%rbp)
movaps %xmm0, -0x150(%rbp)
movaps -0x140(%rbp), %xmm0
movaps -0x150(%rbp), %xmm1
pand %xmm1, %xmm0
movaps %xmm0, -0x310(%rbp)
movaps -0x2e0(%rbp), %xmm1
movaps -0x280(%rbp), %xmm0
movaps %xmm1, -0x160(%rbp)
movaps %xmm0, -0x170(%rbp)
movaps -0x160(%rbp), %xmm0
movaps -0x170(%rbp), %xmm1
pand %xmm1, %xmm0
movaps %xmm0, -0x320(%rbp)
movaps -0x2f0(%rbp), %xmm1
movaps -0x300(%rbp), %xmm0
movaps %xmm1, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movaps -0x40(%rbp), %xmm0
movaps -0x50(%rbp), %xmm1
packssdw %xmm1, %xmm0
movaps %xmm0, -0x330(%rbp)
movaps -0x310(%rbp), %xmm1
movaps -0x320(%rbp), %xmm0
movaps %xmm1, -0x60(%rbp)
movaps %xmm0, -0x70(%rbp)
movaps -0x60(%rbp), %xmm0
movaps -0x70(%rbp), %xmm1
packssdw %xmm1, %xmm0
movaps %xmm0, -0x340(%rbp)
movaps -0x330(%rbp), %xmm1
movaps -0x340(%rbp), %xmm0
movaps %xmm1, -0x220(%rbp)
movaps %xmm0, -0x230(%rbp)
movaps -0x220(%rbp), %xmm0
movaps -0x230(%rbp), %xmm1
packuswb %xmm1, %xmm0
movaps %xmm0, -0x350(%rbp)
movaps -0x350(%rbp), %xmm1
movaps -0x290(%rbp), %xmm0
movaps %xmm1, -0xa0(%rbp)
movaps %xmm0, -0xb0(%rbp)
movaps -0xa0(%rbp), %xmm0
movaps -0xb0(%rbp), %xmm1
pcmpeqb %xmm1, %xmm0
movdqa %xmm0, -0x360(%rbp)
movdqa -0x360(%rbp), %xmm0
movdqa %xmm0, -0xe0(%rbp)
movdqa -0xe0(%rbp), %xmm0
pmovmskb %xmm0, %eax
movl %eax, -0x364(%rbp)
cmpl $0xffff, -0x364(%rbp)   # imm = 0xFFFF
je 0x157b25
movl $0x1, -0x254(%rbp)
jmp 0x157d45
jmp 0x157b27
movl -0x294(%rbp), %eax
addl $0x40, %eax
movl %eax, -0x294(%rbp)
jmp 0x157898
jmp 0x157b3d
movl -0x294(%rbp), %eax
addl $0x20, %eax
cmpl -0x264(%rbp), %eax
jg 0x157cf3
movq -0x260(%rbp), %rax
movslq -0x294(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x200(%rbp)
movq -0x200(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x380(%rbp)
movq -0x260(%rbp), %rax
movslq -0x294(%rbp), %rcx
leaq 0x10(%rax,%rcx), %rax
movq %rax, -0x208(%rbp)
movq -0x208(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x390(%rbp)
movaps -0x380(%rbp), %xmm1
movaps -0x280(%rbp), %xmm0
movaps %xmm1, -0x180(%rbp)
movaps %xmm0, -0x190(%rbp)
movaps -0x180(%rbp), %xmm0
movaps -0x190(%rbp), %xmm1
pand %xmm1, %xmm0
movaps %xmm0, -0x3a0(%rbp)
movaps -0x390(%rbp), %xmm1
movaps -0x280(%rbp), %xmm0
movaps %xmm1, -0x1a0(%rbp)
movaps %xmm0, -0x1b0(%rbp)
movaps -0x1a0(%rbp), %xmm0
movaps -0x1b0(%rbp), %xmm1
pand %xmm1, %xmm0
movaps %xmm0, -0x3b0(%rbp)
movaps -0x3a0(%rbp), %xmm1
movaps -0x3b0(%rbp), %xmm0
movaps %xmm1, -0x80(%rbp)
movaps %xmm0, -0x90(%rbp)
movaps -0x80(%rbp), %xmm0
movaps -0x90(%rbp), %xmm1
packssdw %xmm1, %xmm0
movaps %xmm0, -0x3c0(%rbp)
movaps -0x3c0(%rbp), %xmm0
movaps %xmm0, -0x240(%rbp)
movaps %xmm0, -0x250(%rbp)
movaps -0x240(%rbp), %xmm0
movaps -0x250(%rbp), %xmm1
packuswb %xmm1, %xmm0
movaps %xmm0, -0x3d0(%rbp)
movaps -0x3d0(%rbp), %xmm1
movaps -0x290(%rbp), %xmm0
movaps %xmm1, -0xc0(%rbp)
movaps %xmm0, -0xd0(%rbp)
movaps -0xc0(%rbp), %xmm0
movaps -0xd0(%rbp), %xmm1
pcmpeqb %xmm1, %xmm0
movdqa %xmm0, -0x3e0(%rbp)
movdqa -0x3e0(%rbp), %xmm0
movdqa %xmm0, -0xf0(%rbp)
movdqa -0xf0(%rbp), %xmm0
pmovmskb %xmm0, %eax
movl %eax, -0x3e4(%rbp)
cmpl $0xffff, -0x3e4(%rbp)   # imm = 0xFFFF
je 0x157cdd
movl $0x1, -0x254(%rbp)
jmp 0x157d45
jmp 0x157cdf
movl -0x294(%rbp), %eax
addl $0x20, %eax
movl %eax, -0x294(%rbp)
jmp 0x157b3d
jmp 0x157cf5
movl -0x294(%rbp), %eax
cmpl -0x264(%rbp), %eax
jg 0x157d3b
movq -0x260(%rbp), %rax
movslq -0x294(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0xff, %eax
je 0x157d28
movl $0x1, -0x254(%rbp)
jmp 0x157d45
jmp 0x157d2a
movl -0x294(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x294(%rbp)
jmp 0x157cf5
movl $0x0, -0x254(%rbp)
movl -0x254(%rbp), %eax
addq $0x370, %rsp            # imm = 0x370
popq %rbp
retq
nopw %cs:(%rax,%rax)