// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/lossless_sse2.c
// Function: ConvertBGRAToBGR_SSE2
static void ConvertBGRAToBGR_SSE2(const uint32_t* src,
                                  int num_pixels, uint8_t* dst) {
  const __m128i mask_l = _mm_set_epi32(0, 0x00ffffff, 0, 0x00ffffff);
  const __m128i mask_h = _mm_set_epi32(0x00ffffff, 0, 0x00ffffff, 0);
  const __m128i* in = (const __m128i*)src;
  const uint8_t* const end = dst + num_pixels * 3;
  // the last storel_epi64 below writes 8 bytes starting at offset 18
  while (dst + 26 <= end) {
    const __m128i bgra0 = _mm_loadu_si128(in++);     // bgra0|bgra1|bgra2|bgra3
    const __m128i bgra4 = _mm_loadu_si128(in++);     // bgra4|bgra5|bgra6|bgra7
    const __m128i a0l = _mm_and_si128(bgra0, mask_l);   // bgr0|0|bgr0|0
    const __m128i a4l = _mm_and_si128(bgra4, mask_l);   // bgr0|0|bgr0|0
    const __m128i a0h = _mm_and_si128(bgra0, mask_h);   // 0|bgr0|0|bgr0
    const __m128i a4h = _mm_and_si128(bgra4, mask_h);   // 0|bgr0|0|bgr0
    const __m128i b0h = _mm_srli_epi64(a0h, 8);         // 000b|gr00|000b|gr00
    const __m128i b4h = _mm_srli_epi64(a4h, 8);         // 000b|gr00|000b|gr00
    const __m128i c0 = _mm_or_si128(a0l, b0h);          // rgbrgb00|rgbrgb00
    const __m128i c4 = _mm_or_si128(a4l, b4h);          // rgbrgb00|rgbrgb00
    const __m128i c2 = _mm_srli_si128(c0, 8);
    const __m128i c6 = _mm_srli_si128(c4, 8);
    _mm_storel_epi64((__m128i*)(dst +   0), c0);
    _mm_storel_epi64((__m128i*)(dst +   6), c2);
    _mm_storel_epi64((__m128i*)(dst +  12), c4);
    _mm_storel_epi64((__m128i*)(dst +  18), c6);
    dst += 24;
    num_pixels -= 8;
  }
  // left-overs
  if (num_pixels > 0) {
    VP8LConvertBGRAToBGR_C((const uint32_t*)in, num_pixels, dst);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2e0, %rsp            # imm = 0x2E0
movq %rdi, -0x1d8(%rbp)
movl %esi, -0x1dc(%rbp)
movq %rdx, -0x1e8(%rbp)
movl $0x0, -0xb8(%rbp)
movl $0xffffff, -0xbc(%rbp)  # imm = 0xFFFFFF
movl $0x0, -0xc0(%rbp)
movl $0xffffff, -0xc4(%rbp)  # imm = 0xFFFFFF
movd -0xb8(%rbp), %xmm0
movd -0xbc(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd -0xc0(%rbp), %xmm2
movd -0xc4(%rbp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movaps %xmm0, -0xe0(%rbp)
movaps -0xe0(%rbp), %xmm0
movaps %xmm0, -0x200(%rbp)
movl $0xffffff, -0xe4(%rbp)  # imm = 0xFFFFFF
movl $0x0, -0xe8(%rbp)
movl $0xffffff, -0xec(%rbp)  # imm = 0xFFFFFF
movl $0x0, -0xf0(%rbp)
movd -0xe4(%rbp), %xmm0
movd -0xe8(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd -0xec(%rbp), %xmm2
movd -0xf0(%rbp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movdqa %xmm0, -0x100(%rbp)
movdqa -0x100(%rbp), %xmm0
movdqa %xmm0, -0x210(%rbp)
movq -0x1d8(%rbp), %rax
movq %rax, -0x218(%rbp)
movq -0x1e8(%rbp), %rax
imull $0x3, -0x1dc(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x220(%rbp)
movq -0x1e8(%rbp), %rax
addq $0x1a, %rax
cmpq -0x220(%rbp), %rax
ja 0x169a3d
movq -0x218(%rbp), %rax
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, -0x218(%rbp)
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x230(%rbp)
movq -0x218(%rbp), %rax
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, -0x218(%rbp)
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x240(%rbp)
movaps -0x230(%rbp), %xmm1
movaps -0x200(%rbp), %xmm0
movaps %xmm1, -0x160(%rbp)
movaps %xmm0, -0x170(%rbp)
movaps -0x160(%rbp), %xmm0
movaps -0x170(%rbp), %xmm1
pand %xmm1, %xmm0
movaps %xmm0, -0x250(%rbp)
movaps -0x240(%rbp), %xmm1
movaps -0x200(%rbp), %xmm0
movaps %xmm1, -0x180(%rbp)
movaps %xmm0, -0x190(%rbp)
movaps -0x180(%rbp), %xmm0
movaps -0x190(%rbp), %xmm1
pand %xmm1, %xmm0
movaps %xmm0, -0x260(%rbp)
movaps -0x230(%rbp), %xmm1
movaps -0x210(%rbp), %xmm0
movaps %xmm1, -0x1a0(%rbp)
movaps %xmm0, -0x1b0(%rbp)
movaps -0x1a0(%rbp), %xmm0
movaps -0x1b0(%rbp), %xmm1
pand %xmm1, %xmm0
movaps %xmm0, -0x270(%rbp)
movaps -0x240(%rbp), %xmm1
movaps -0x210(%rbp), %xmm0
movaps %xmm1, -0x1c0(%rbp)
movaps %xmm0, -0x1d0(%rbp)
movaps -0x1c0(%rbp), %xmm0
movaps -0x1d0(%rbp), %xmm1
pand %xmm1, %xmm0
movaps %xmm0, -0x280(%rbp)
movaps -0x270(%rbp), %xmm0
movaps %xmm0, -0x90(%rbp)
movl $0x8, -0x94(%rbp)
movaps -0x90(%rbp), %xmm0
movd -0x94(%rbp), %xmm1
psrlq %xmm1, %xmm0
movaps %xmm0, -0x290(%rbp)
movaps -0x280(%rbp), %xmm0
movaps %xmm0, -0xb0(%rbp)
movl $0x8, -0xb4(%rbp)
movaps -0xb0(%rbp), %xmm0
movd -0xb4(%rbp), %xmm1
psrlq %xmm1, %xmm0
movaps %xmm0, -0x2a0(%rbp)
movaps -0x250(%rbp), %xmm1
movaps -0x290(%rbp), %xmm0
movaps %xmm1, -0x120(%rbp)
movaps %xmm0, -0x130(%rbp)
movaps -0x120(%rbp), %xmm0
movaps -0x130(%rbp), %xmm1
por %xmm1, %xmm0
movaps %xmm0, -0x2b0(%rbp)
movaps -0x260(%rbp), %xmm1
movaps -0x2a0(%rbp), %xmm0
movaps %xmm1, -0x140(%rbp)
movaps %xmm0, -0x150(%rbp)
movaps -0x140(%rbp), %xmm0
movaps -0x150(%rbp), %xmm1
por %xmm1, %xmm0
movaps %xmm0, -0x2c0(%rbp)
movaps -0x2b0(%rbp), %xmm0
psrldq $0x8, %xmm0             # xmm0 = xmm0[8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero
movaps %xmm0, -0x2d0(%rbp)
movaps -0x2c0(%rbp), %xmm0
psrldq $0x8, %xmm0             # xmm0 = xmm0[8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero
movaps %xmm0, -0x2e0(%rbp)
movq -0x1e8(%rbp), %rax
movaps -0x2b0(%rbp), %xmm0
movq %rax, -0x8(%rbp)
movaps %xmm0, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x1e8(%rbp), %rax
addq $0x6, %rax
movaps -0x2d0(%rbp), %xmm0
movq %rax, -0x28(%rbp)
movaps %xmm0, -0x40(%rbp)
movq -0x40(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x1e8(%rbp), %rax
addq $0xc, %rax
movaps -0x2c0(%rbp), %xmm0
movq %rax, -0x48(%rbp)
movaps %xmm0, -0x60(%rbp)
movq -0x60(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movq -0x1e8(%rbp), %rax
addq $0x12, %rax
movaps -0x2e0(%rbp), %xmm0
movq %rax, -0x68(%rbp)
movaps %xmm0, -0x80(%rbp)
movq -0x80(%rbp), %rcx
movq -0x68(%rbp), %rax
movq %rcx, (%rax)
movq -0x1e8(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x1e8(%rbp)
movl -0x1dc(%rbp), %eax
subl $0x8, %eax
movl %eax, -0x1dc(%rbp)
jmp 0x16974d
cmpl $0x0, -0x1dc(%rbp)
jle 0x169a5f
movq -0x218(%rbp), %rdi
movl -0x1dc(%rbp), %esi
movq -0x1e8(%rbp), %rdx
callq 0x14f410
addq $0x2e0, %rsp            # imm = 0x2E0
popq %rbp
retq
nopl (%rax,%rax)