// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/lossless_sse2.c
// Function: Average2_uint32_SSE2
static WEBP_INLINE void Average2_uint32_SSE2(const uint32_t a0,
                                             const uint32_t a1,
                                             __m128i* const avg) {
  // (a + b) >> 1 = ((a + b + 1) >> 1) - ((a ^ b) & 1)
  const __m128i ones = _mm_set1_epi8(1);
  const __m128i A0 = _mm_cvtsi32_si128((int)a0);
  const __m128i A1 = _mm_cvtsi32_si128((int)a1);
  const __m128i avg1 = _mm_avg_epu8(A0, A1);
  const __m128i one = _mm_and_si128(_mm_xor_si128(A0, A1), ones);
  *avg = _mm_sub_epi8(avg1, one);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movl %edi, -0xe4(%rbp)
movl %esi, -0xe8(%rbp)
movq %rdx, -0xf0(%rbp)
movb $0x1, -0xa1(%rbp)
movb -0xa1(%rbp), %al
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]
movaps %xmm0, -0x20(%rbp)
movaps -0x20(%rbp), %xmm0
movaps %xmm0, -0x100(%rbp)
movl -0xe4(%rbp), %eax
movl %eax, -0xa8(%rbp)
movd -0xa8(%rbp), %xmm0
movaps %xmm0, -0xc0(%rbp)
movaps -0xc0(%rbp), %xmm0
movaps %xmm0, -0x110(%rbp)
movl -0xe8(%rbp), %eax
movl %eax, -0xc4(%rbp)
movd -0xc4(%rbp), %xmm0
movdqa %xmm0, -0xe0(%rbp)
movdqa -0xe0(%rbp), %xmm0
movdqa %xmm0, -0x120(%rbp)
movdqa -0x110(%rbp), %xmm1
movdqa -0x120(%rbp), %xmm0
movdqa %xmm1, -0x90(%rbp)
movdqa %xmm0, -0xa0(%rbp)
movdqa -0x90(%rbp), %xmm0
movdqa -0xa0(%rbp), %xmm1
pavgb %xmm1, %xmm0
movdqa %xmm0, -0x130(%rbp)
movdqa -0x110(%rbp), %xmm1
movdqa -0x120(%rbp), %xmm0
movdqa %xmm1, -0x50(%rbp)
movdqa %xmm0, -0x60(%rbp)
movdqa -0x50(%rbp), %xmm1
pxor -0x60(%rbp), %xmm1
movdqa -0x100(%rbp), %xmm0
movdqa %xmm1, -0x70(%rbp)
movdqa %xmm0, -0x80(%rbp)
movdqa -0x70(%rbp), %xmm0
pand -0x80(%rbp), %xmm0
movdqa %xmm0, -0x140(%rbp)
movdqa -0x130(%rbp), %xmm1
movdqa -0x140(%rbp), %xmm0
movdqa %xmm1, -0x30(%rbp)
movdqa %xmm0, -0x40(%rbp)
movdqa -0x30(%rbp), %xmm0
movdqa -0x40(%rbp), %xmm1
psubb %xmm1, %xmm0
movq -0xf0(%rbp), %rax
movdqa %xmm0, (%rax)
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax,%rax)