// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/lossless_sse2.c
// Function: Select_SSE2
static WEBP_INLINE uint32_t Select_SSE2(uint32_t a, uint32_t b, uint32_t c) {
  int pa_minus_pb;
  const __m128i zero = _mm_setzero_si128();
  const __m128i A0 = _mm_cvtsi32_si128((int)a);
  const __m128i B0 = _mm_cvtsi32_si128((int)b);
  const __m128i C0 = _mm_cvtsi32_si128((int)c);
  const __m128i AC0 = _mm_subs_epu8(A0, C0);
  const __m128i CA0 = _mm_subs_epu8(C0, A0);
  const __m128i BC0 = _mm_subs_epu8(B0, C0);
  const __m128i CB0 = _mm_subs_epu8(C0, B0);
  const __m128i AC = _mm_or_si128(AC0, CA0);
  const __m128i BC = _mm_or_si128(BC0, CB0);
  const __m128i pa = _mm_unpacklo_epi8(AC, zero);  // |a - c|
  const __m128i pb = _mm_unpacklo_epi8(BC, zero);  // |b - c|
  const __m128i diff = _mm_sub_epi16(pb, pa);
  {
    int16_t out[8];
    _mm_storeu_si128((__m128i*)out, diff);
    pa_minus_pb = out[0] + out[1] + out[2] + out[3];
  }
  return (pa_minus_pb <= 0) ? a : b;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movl %edi, -0x1b4(%rbp)
movl %esi, -0x1b8(%rbp)
movl %edx, -0x1bc(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x1b0(%rbp)
movaps -0x1b0(%rbp), %xmm0
movaps %xmm0, -0x1d0(%rbp)
movl -0x1b4(%rbp), %eax
movl %eax, -0x104(%rbp)
movd -0x104(%rbp), %xmm0
movaps %xmm0, -0x120(%rbp)
movaps -0x120(%rbp), %xmm0
movaps %xmm0, -0x1e0(%rbp)
movl -0x1b8(%rbp), %eax
movl %eax, -0x124(%rbp)
movd -0x124(%rbp), %xmm0
movaps %xmm0, -0x140(%rbp)
movaps -0x140(%rbp), %xmm0
movaps %xmm0, -0x1f0(%rbp)
movl -0x1bc(%rbp), %eax
movl %eax, -0x144(%rbp)
movd -0x144(%rbp), %xmm0
movaps %xmm0, -0x160(%rbp)
movaps -0x160(%rbp), %xmm0
movaps %xmm0, -0x200(%rbp)
movaps -0x1e0(%rbp), %xmm1
movaps -0x200(%rbp), %xmm0
movaps %xmm1, -0x90(%rbp)
movaps %xmm0, -0xa0(%rbp)
movaps -0x90(%rbp), %xmm0
movaps -0xa0(%rbp), %xmm1
psubusb %xmm1, %xmm0
movaps %xmm0, -0x210(%rbp)
movaps -0x200(%rbp), %xmm1
movaps -0x1e0(%rbp), %xmm0
movaps %xmm1, -0xb0(%rbp)
movaps %xmm0, -0xc0(%rbp)
movaps -0xb0(%rbp), %xmm0
movaps -0xc0(%rbp), %xmm1
psubusb %xmm1, %xmm0
movaps %xmm0, -0x220(%rbp)
movaps -0x1f0(%rbp), %xmm1
movaps -0x200(%rbp), %xmm0
movaps %xmm1, -0xd0(%rbp)
movaps %xmm0, -0xe0(%rbp)
movaps -0xd0(%rbp), %xmm0
movaps -0xe0(%rbp), %xmm1
psubusb %xmm1, %xmm0
movaps %xmm0, -0x230(%rbp)
movaps -0x200(%rbp), %xmm1
movaps -0x1f0(%rbp), %xmm0
movaps %xmm1, -0xf0(%rbp)
movaps %xmm0, -0x100(%rbp)
movaps -0xf0(%rbp), %xmm0
movaps -0x100(%rbp), %xmm1
psubusb %xmm1, %xmm0
movaps %xmm0, -0x240(%rbp)
movaps -0x210(%rbp), %xmm1
movaps -0x220(%rbp), %xmm0
movaps %xmm1, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
movaps -0x50(%rbp), %xmm0
movaps -0x60(%rbp), %xmm1
por %xmm1, %xmm0
movaps %xmm0, -0x250(%rbp)
movaps -0x230(%rbp), %xmm1
movaps -0x240(%rbp), %xmm0
movaps %xmm1, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
movaps -0x70(%rbp), %xmm0
movaps -0x80(%rbp), %xmm1
por %xmm1, %xmm0
movaps %xmm0, -0x260(%rbp)
movaps -0x250(%rbp), %xmm1
movaps -0x1d0(%rbp), %xmm0
movaps %xmm1, -0x170(%rbp)
movaps %xmm0, -0x180(%rbp)
movaps -0x170(%rbp), %xmm0
movaps -0x180(%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, -0x270(%rbp)
movaps -0x260(%rbp), %xmm1
movaps -0x1d0(%rbp), %xmm0
movaps %xmm1, -0x190(%rbp)
movaps %xmm0, -0x1a0(%rbp)
movaps -0x190(%rbp), %xmm0
movaps -0x1a0(%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]
movdqa %xmm0, -0x280(%rbp)
movdqa -0x280(%rbp), %xmm1
movdqa -0x270(%rbp), %xmm0
movdqa %xmm1, -0x30(%rbp)
movdqa %xmm0, -0x40(%rbp)
movdqa -0x30(%rbp), %xmm0
movdqa -0x40(%rbp), %xmm1
psubw %xmm1, %xmm0
movdqa %xmm0, -0x290(%rbp)
leaq -0x2a0(%rbp), %rax
movdqa -0x290(%rbp), %xmm0
movq %rax, -0x8(%rbp)
movdqa %xmm0, -0x20(%rbp)
movdqa -0x20(%rbp), %xmm0
movq -0x8(%rbp), %rax
movdqu %xmm0, (%rax)
movswl -0x2a0(%rbp), %eax
movswl -0x29e(%rbp), %ecx
addl %ecx, %eax
movswl -0x29c(%rbp), %ecx
addl %ecx, %eax
movswl -0x29a(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x1c0(%rbp)
cmpl $0x0, -0x1c0(%rbp)
jg 0x16a305
movl -0x1b4(%rbp), %eax
movl %eax, -0x2a4(%rbp)
jmp 0x16a311
movl -0x1b8(%rbp), %eax
movl %eax, -0x2a4(%rbp)
movl -0x2a4(%rbp), %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq