// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/lossless_sse2.c
// Function: PredictorAdd1_SSE2
static void PredictorAdd1_SSE2(const uint32_t* in, const uint32_t* upper,
                               int num_pixels, uint32_t* out) {
  int i;
  __m128i prev = _mm_set1_epi32((int)out[-1]);
  for (i = 0; i + 4 <= num_pixels; i += 4) {
    // a | b | c | d
    const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]);
    // 0 | a | b | c
    const __m128i shift0 = _mm_slli_si128(src, 4);
    // a | a + b | b + c | c + d
    const __m128i sum0 = _mm_add_epi8(src, shift0);
    // 0 | 0 | a | a + b
    const __m128i shift1 = _mm_slli_si128(sum0, 8);
    // a | a + b | a + b + c | a + b + c + d
    const __m128i sum1 = _mm_add_epi8(sum0, shift1);
    const __m128i res = _mm_add_epi8(sum1, prev);
    _mm_storeu_si128((__m128i*)&out[i], res);
    // replicate prev output on the four lanes
    prev = _mm_shuffle_epi32(res, (3 << 0) | (3 << 2) | (3 << 4) | (3 << 6));
  }
  if (i != num_pixels) {
    VP8LPredictorsAdd_C[1](in + i, upper + i, num_pixels - i, out + i);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0xb8(%rbp)
movq %rsi, -0xc0(%rbp)
movl %edx, -0xc4(%rbp)
movq %rcx, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
movl -0x4(%rax), %eax
movl %eax, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl %eax, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl %eax, -0x10(%rbp)
movd -0x4(%rbp), %xmm0
movd -0x8(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd -0xc(%rbp), %xmm2
movd -0x10(%rbp), %xmm0
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, -0xf0(%rbp)
movl $0x0, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
addl $0x4, %eax
cmpl -0xc4(%rbp), %eax
jg 0x1658e4
movq -0xb8(%rbp), %rax
movslq -0xd4(%rbp), %rcx
leaq (%rax,%rcx,4), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x100(%rbp)
movaps -0x100(%rbp), %xmm0
pslldq $0x4, %xmm0             # xmm0 = zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11]
movaps %xmm0, -0x110(%rbp)
movaps -0x100(%rbp), %xmm1
movaps -0x110(%rbp), %xmm0
movaps %xmm1, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
movaps -0x30(%rbp), %xmm0
movaps -0x40(%rbp), %xmm1
paddb %xmm1, %xmm0
movaps %xmm0, -0x120(%rbp)
movaps -0x120(%rbp), %xmm0
pslldq $0x8, %xmm0             # xmm0 = zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7]
movaps %xmm0, -0x130(%rbp)
movaps -0x120(%rbp), %xmm1
movaps -0x130(%rbp), %xmm0
movaps %xmm1, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
movaps -0x50(%rbp), %xmm0
movaps -0x60(%rbp), %xmm1
paddb %xmm1, %xmm0
movaps %xmm0, -0x140(%rbp)
movaps -0x140(%rbp), %xmm1
movaps -0xf0(%rbp), %xmm0
movaps %xmm1, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
movaps -0x70(%rbp), %xmm0
movaps -0x80(%rbp), %xmm1
paddb %xmm1, %xmm0
movaps %xmm0, -0x150(%rbp)
movq -0xd0(%rbp), %rax
movslq -0xd4(%rbp), %rcx
leaq (%rax,%rcx,4), %rax
movaps -0x150(%rbp), %xmm0
movq %rax, -0x98(%rbp)
movaps %xmm0, -0xb0(%rbp)
movaps -0xb0(%rbp), %xmm0
movq -0x98(%rbp), %rax
movups %xmm0, (%rax)
movaps -0x150(%rbp), %xmm0
pshufd $0xff, %xmm0, %xmm0     # xmm0 = xmm0[3,3,3,3]
movdqa %xmm0, -0xf0(%rbp)
movl -0xd4(%rbp), %eax
addl $0x4, %eax
movl %eax, -0xd4(%rbp)
jmp 0x1657a4
movl -0xd4(%rbp), %eax
cmpl -0xc4(%rbp), %eax
je 0x16594a
leaq 0xb38a7(%rip), %rax     # 0x2191a0
movq 0x8(%rax), %rax
movq -0xb8(%rbp), %rdi
movslq -0xd4(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rdi
movq -0xc0(%rbp), %rsi
movslq -0xd4(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rsi
movl -0xc4(%rbp), %edx
subl -0xd4(%rbp), %edx
movq -0xd0(%rbp), %rcx
movslq -0xd4(%rbp), %r8
shlq $0x2, %r8
addq %r8, %rcx
callq *%rax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw %cs:(%rax,%rax)