// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/filters_sse2.c
// Function: HorizontalUnfilter_SSE2
static void HorizontalUnfilter_SSE2(const uint8_t* prev, const uint8_t* in,
                                    uint8_t* out, int width) {
  int i;
  __m128i last;
  out[0] = (uint8_t)(in[0] + (prev == NULL ? 0 : prev[0]));
  if (width <= 1) return;
  last = _mm_set_epi32(0, 0, 0, out[0]);
  for (i = 1; i + 8 <= width; i += 8) {
    const __m128i A0 = _mm_loadl_epi64((const __m128i*)(in + i));
    const __m128i A1 = _mm_add_epi8(A0, last);
    const __m128i A2 = _mm_slli_si128(A1, 1);
    const __m128i A3 = _mm_add_epi8(A1, A2);
    const __m128i A4 = _mm_slli_si128(A3, 2);
    const __m128i A5 = _mm_add_epi8(A3, A4);
    const __m128i A6 = _mm_slli_si128(A5, 4);
    const __m128i A7 = _mm_add_epi8(A5, A6);
    _mm_storel_epi64((__m128i*)(out + i), A7);
    last = _mm_srli_epi64(A7, 56);
  }
  for (; i < width; ++i) out[i] = (uint8_t)(in[i] + out[i - 1]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0xf8(%rbp)
movq %rsi, -0x100(%rbp)
movq %rdx, -0x108(%rbp)
movl %ecx, -0x10c(%rbp)
movq -0x100(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x1a4(%rbp)
cmpq $0x0, -0xf8(%rbp)
jne 0x16365a
xorl %eax, %eax
movl %eax, -0x1a8(%rbp)
jmp 0x16366a
movq -0xf8(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x1a8(%rbp)
movl -0x1a4(%rbp), %eax
movl -0x1a8(%rbp), %ecx
addl %ecx, %eax
movb %al, %cl
movq -0x108(%rbp), %rax
movb %cl, (%rax)
cmpl $0x1, -0x10c(%rbp)
jg 0x163691
jmp 0x163913
movq -0x108(%rbp), %rax
movzbl (%rax), %eax
movl $0x0, -0xd4(%rbp)
movl $0x0, -0xd8(%rbp)
movl $0x0, -0xdc(%rbp)
movl %eax, -0xe0(%rbp)
movd -0xd4(%rbp), %xmm0
movd -0xd8(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd -0xdc(%rbp), %xmm2
movd -0xe0(%rbp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movdqa %xmm0, -0xf0(%rbp)
movdqa -0xf0(%rbp), %xmm0
movdqa %xmm0, -0x120(%rbp)
movl $0x1, -0x110(%rbp)
movl -0x110(%rbp), %eax
addl $0x8, %eax
cmpl -0x10c(%rbp), %eax
jg 0x1638b4
movq -0x100(%rbp), %rax
movslq -0x110(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movq (%rax), %xmm0
movaps %xmm0, -0xd0(%rbp)
movaps -0xd0(%rbp), %xmm0
movaps %xmm0, -0x130(%rbp)
movaps -0x130(%rbp), %xmm1
movaps -0x120(%rbp), %xmm0
movaps %xmm1, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movaps -0x40(%rbp), %xmm0
movaps -0x50(%rbp), %xmm1
paddb %xmm1, %xmm0
movaps %xmm0, -0x140(%rbp)
movaps -0x140(%rbp), %xmm0
pslldq $0x1, %xmm0             # xmm0 = zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
movaps %xmm0, -0x150(%rbp)
movaps -0x140(%rbp), %xmm1
movaps -0x150(%rbp), %xmm0
movaps %xmm1, -0x60(%rbp)
movaps %xmm0, -0x70(%rbp)
movaps -0x60(%rbp), %xmm0
movaps -0x70(%rbp), %xmm1
paddb %xmm1, %xmm0
movaps %xmm0, -0x160(%rbp)
movaps -0x160(%rbp), %xmm0
pslldq $0x2, %xmm0             # xmm0 = zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
movaps %xmm0, -0x170(%rbp)
movaps -0x160(%rbp), %xmm1
movaps -0x170(%rbp), %xmm0
movaps %xmm1, -0x80(%rbp)
movaps %xmm0, -0x90(%rbp)
movaps -0x80(%rbp), %xmm0
movaps -0x90(%rbp), %xmm1
paddb %xmm1, %xmm0
movaps %xmm0, -0x180(%rbp)
movaps -0x180(%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, -0x190(%rbp)
movaps -0x180(%rbp), %xmm1
movaps -0x190(%rbp), %xmm0
movaps %xmm1, -0xa0(%rbp)
movaps %xmm0, -0xb0(%rbp)
movaps -0xa0(%rbp), %xmm0
movaps -0xb0(%rbp), %xmm1
paddb %xmm1, %xmm0
movaps %xmm0, -0x1a0(%rbp)
movq -0x108(%rbp), %rax
movslq -0x110(%rbp), %rcx
addq %rcx, %rax
movaps -0x1a0(%rbp), %xmm0
movq %rax, -0x20(%rbp)
movaps %xmm0, -0x30(%rbp)
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movdqa -0x1a0(%rbp), %xmm0
movdqa %xmm0, -0x10(%rbp)
movl $0x38, -0x14(%rbp)
movdqa -0x10(%rbp), %xmm0
movl -0x14(%rbp), %eax
movd %eax, %xmm1
psrlq %xmm1, %xmm0
movdqa %xmm0, -0x120(%rbp)
movl -0x110(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x110(%rbp)
jmp 0x16370d
jmp 0x1638b6
movl -0x110(%rbp), %eax
cmpl -0x10c(%rbp), %eax
jge 0x163913
movq -0x100(%rbp), %rax
movslq -0x110(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0x108(%rbp), %rcx
movl -0x110(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movb %al, %dl
movq -0x108(%rbp), %rax
movslq -0x110(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x110(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x110(%rbp)
jmp 0x1638b6
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopl (%rax)