// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/lossless_sse2.c
// Function: ConvertBGRAToRGB_SSE2
static void ConvertBGRAToRGB_SSE2(const uint32_t* src, int num_pixels,
                                  uint8_t* dst) {
  const __m128i* in = (const __m128i*)src;
  __m128i* out = (__m128i*)dst;

  while (num_pixels >= 32) {
    // Load the BGRA buffers.
    __m128i in0 = _mm_loadu_si128(in + 0);
    __m128i in1 = _mm_loadu_si128(in + 1);
    __m128i in2 = _mm_loadu_si128(in + 2);
    __m128i in3 = _mm_loadu_si128(in + 3);
    __m128i in4 = _mm_loadu_si128(in + 4);
    __m128i in5 = _mm_loadu_si128(in + 5);
    __m128i in6 = _mm_loadu_si128(in + 6);
    __m128i in7 = _mm_loadu_si128(in + 7);
    VP8L32bToPlanar_SSE2(&in0, &in1, &in2, &in3);
    VP8L32bToPlanar_SSE2(&in4, &in5, &in6, &in7);
    // At this points, in1/in5 contains red only, in2/in6 green only ...
    // Pack the colors in 24b RGB.
    VP8PlanarTo24b_SSE2(&in1, &in5, &in2, &in6, &in3, &in7);
    _mm_storeu_si128(out + 0, in1);
    _mm_storeu_si128(out + 1, in5);
    _mm_storeu_si128(out + 2, in2);
    _mm_storeu_si128(out + 3, in6);
    _mm_storeu_si128(out + 4, in3);
    _mm_storeu_si128(out + 5, in7);
    in += 8;
    out += 6;
    num_pixels -= 32;
  }
  // left-overs
  if (num_pixels > 0) {
    VP8LConvertBGRAToRGB_C((const uint32_t*)in, num_pixels, (uint8_t*)out);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x108(%rbp)
movl %esi, -0x10c(%rbp)
movq %rdx, -0x118(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x118(%rbp), %rax
movq %rax, -0x128(%rbp)
cmpl $0x20, -0x10c(%rbp)
jl 0x168369
movq -0x120(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x140(%rbp)
movq -0x120(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x150(%rbp)
movq -0x120(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x160(%rbp)
movq -0x120(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x170(%rbp)
movq -0x120(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x180(%rbp)
movq -0x120(%rbp), %rax
addq $0x50, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x190(%rbp)
movq -0x120(%rbp), %rax
addq $0x60, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x1a0(%rbp)
movq -0x120(%rbp), %rax
addq $0x70, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movdqu (%rax), %xmm0
movdqa %xmm0, -0x1b0(%rbp)
leaq -0x140(%rbp), %rdi
leaq -0x150(%rbp), %rsi
leaq -0x160(%rbp), %rdx
leaq -0x170(%rbp), %rcx
callq 0x16a9f0
leaq -0x180(%rbp), %rdi
leaq -0x190(%rbp), %rsi
leaq -0x1a0(%rbp), %rdx
leaq -0x1b0(%rbp), %rcx
callq 0x16a9f0
leaq -0x150(%rbp), %rdi
leaq -0x190(%rbp), %rsi
leaq -0x160(%rbp), %rdx
leaq -0x1a0(%rbp), %rcx
leaq -0x170(%rbp), %r8
leaq -0x1b0(%rbp), %r9
callq 0x16ad70
movq -0x128(%rbp), %rax
movdqa -0x150(%rbp), %xmm0
movq %rax, -0x48(%rbp)
movdqa %xmm0, -0x60(%rbp)
movdqa -0x60(%rbp), %xmm0
movq -0x48(%rbp), %rax
movdqu %xmm0, (%rax)
movq -0x128(%rbp), %rax
addq $0x10, %rax
movdqa -0x190(%rbp), %xmm0
movq %rax, -0x68(%rbp)
movdqa %xmm0, -0x80(%rbp)
movdqa -0x80(%rbp), %xmm0
movq -0x68(%rbp), %rax
movdqu %xmm0, (%rax)
movq -0x128(%rbp), %rax
addq $0x20, %rax
movdqa -0x160(%rbp), %xmm0
movq %rax, -0x88(%rbp)
movdqa %xmm0, -0xa0(%rbp)
movdqa -0xa0(%rbp), %xmm0
movq -0x88(%rbp), %rax
movdqu %xmm0, (%rax)
movq -0x128(%rbp), %rax
addq $0x30, %rax
movdqa -0x1a0(%rbp), %xmm0
movq %rax, -0xa8(%rbp)
movdqa %xmm0, -0xc0(%rbp)
movdqa -0xc0(%rbp), %xmm0
movq -0xa8(%rbp), %rax
movdqu %xmm0, (%rax)
movq -0x128(%rbp), %rax
addq $0x40, %rax
movdqa -0x170(%rbp), %xmm0
movq %rax, -0xc8(%rbp)
movdqa %xmm0, -0xe0(%rbp)
movdqa -0xe0(%rbp), %xmm0
movq -0xc8(%rbp), %rax
movdqu %xmm0, (%rax)
movq -0x128(%rbp), %rax
addq $0x50, %rax
movdqa -0x1b0(%rbp), %xmm0
movq %rax, -0xe8(%rbp)
movdqa %xmm0, -0x100(%rbp)
movdqa -0x100(%rbp), %xmm0
movq -0xe8(%rbp), %rax
movdqu %xmm0, (%rax)
movq -0x120(%rbp), %rax
addq $0x80, %rax
movq %rax, -0x120(%rbp)
movq -0x128(%rbp), %rax
addq $0x60, %rax
movq %rax, -0x128(%rbp)
movl -0x10c(%rbp), %eax
subl $0x20, %eax
movl %eax, -0x10c(%rbp)
jmp 0x16809b
cmpl $0x0, -0x10c(%rbp)
jle 0x16838b
movq -0x120(%rbp), %rdi
movl -0x10c(%rbp), %esi
movq -0x128(%rbp), %rdx
callq 0x14f160
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
nopw %cs:(%rax,%rax)