// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/rescaler_sse2.c
// Function: RescalerExportRowExpand_SSE2
static void RescalerExportRowExpand_SSE2(WebPRescaler* const wrk) {
  int x_out;
  uint8_t* const dst = wrk->dst;
  rescaler_t* const irow = wrk->irow;
  const int x_out_max = wrk->dst_width * wrk->num_channels;
  const rescaler_t* const frow = wrk->frow;
  const __m128i mult = _mm_set_epi32(0, wrk->fy_scale, 0, wrk->fy_scale);

  assert(!WebPRescalerOutputDone(wrk));
  assert(wrk->y_accum <= 0 && wrk->y_sub + wrk->y_accum >= 0);
  assert(wrk->y_expand);
  if (wrk->y_accum == 0) {
    for (x_out = 0; x_out + 8 <= x_out_max; x_out += 8) {
      __m128i A0, A1, A2, A3;
      LoadDispatchAndMult_SSE2(frow + x_out, NULL, &A0, &A1, &A2, &A3);
      ProcessRow_SSE2(&A0, &A1, &A2, &A3, &mult, dst + x_out);
    }
    for (; x_out < x_out_max; ++x_out) {
      const uint32_t J = frow[x_out];
      const int v = (int)MULT_FIX(J, wrk->fy_scale);
      dst[x_out] = (v > 255) ? 255u : (uint8_t)v;
    }
  } else {
    const uint32_t B = WEBP_RESCALER_FRAC(-wrk->y_accum, wrk->y_sub);
    const uint32_t A = (uint32_t)(WEBP_RESCALER_ONE - B);
    const __m128i mA = _mm_set_epi32(0, A, 0, A);
    const __m128i mB = _mm_set_epi32(0, B, 0, B);
    const __m128i rounder = _mm_set_epi32(0, ROUNDER, 0, ROUNDER);
    for (x_out = 0; x_out + 8 <= x_out_max; x_out += 8) {
      __m128i A0, A1, A2, A3, B0, B1, B2, B3;
      LoadDispatchAndMult_SSE2(frow + x_out, &mA, &A0, &A1, &A2, &A3);
      LoadDispatchAndMult_SSE2(irow + x_out, &mB, &B0, &B1, &B2, &B3);
      {
        const __m128i C0 = _mm_add_epi64(A0, B0);
        const __m128i C1 = _mm_add_epi64(A1, B1);
        const __m128i C2 = _mm_add_epi64(A2, B2);
        const __m128i C3 = _mm_add_epi64(A3, B3);
        const __m128i D0 = _mm_add_epi64(C0, rounder);
        const __m128i D1 = _mm_add_epi64(C1, rounder);
        const __m128i D2 = _mm_add_epi64(C2, rounder);
        const __m128i D3 = _mm_add_epi64(C3, rounder);
        const __m128i E0 = _mm_srli_epi64(D0, WEBP_RESCALER_RFIX);
        const __m128i E1 = _mm_srli_epi64(D1, WEBP_RESCALER_RFIX);
        const __m128i E2 = _mm_srli_epi64(D2, WEBP_RESCALER_RFIX);
        const __m128i E3 = _mm_srli_epi64(D3, WEBP_RESCALER_RFIX);
        ProcessRow_SSE2(&E0, &E1, &E2, &E3, &mult, dst + x_out);
      }
    }
    for (; x_out < x_out_max; ++x_out) {
      const uint64_t I = (uint64_t)A * frow[x_out]
                       + (uint64_t)B * irow[x_out];
      const uint32_t J = (uint32_t)((I + ROUNDER) >> WEBP_RESCALER_RFIX);
      const int v = (int)MULT_FIX(J, wrk->fy_scale);
      dst[x_out] = (v > 255) ? 255u : (uint8_t)v;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x420, %rsp            # imm = 0x420
movq %rdi, -0x208(%rbp)
movq -0x208(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x218(%rbp)
movq -0x208(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x220(%rbp)
movq -0x208(%rbp), %rax
movl 0x8(%rax), %ecx
movl 0x34(%rax), %eax
imull %ecx, %eax
movl %eax, -0x224(%rbp)
movq -0x208(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x230(%rbp)
movq -0x208(%rbp), %rax
movl 0x10(%rax), %eax
movl $0x0, -0x178(%rbp)
movl %eax, -0x17c(%rbp)
movl $0x0, -0x180(%rbp)
movl %eax, -0x184(%rbp)
movd -0x178(%rbp), %xmm0
movd -0x17c(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd -0x180(%rbp), %xmm2
movd -0x184(%rbp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movdqa %xmm0, -0x1a0(%rbp)
movdqa -0x1a0(%rbp), %xmm0
movdqa %xmm0, -0x240(%rbp)
movq -0x208(%rbp), %rdi
callq 0x16e280
cmpl $0x0, %eax
jne 0x16cfcf
jmp 0x16cfee
leaq 0x52f75(%rip), %rdi     # 0x1bff4b
leaq 0x53be3(%rip), %rsi     # 0x1c0bc0
movl $0xec, %edx
leaq 0x53c7f(%rip), %rcx     # 0x1c0c68
callq 0x598a0
movq -0x208(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jg 0x16d016
movq -0x208(%rbp), %rax
movl 0x20(%rax), %eax
movq -0x208(%rbp), %rcx
addl 0x18(%rcx), %eax
cmpl $0x0, %eax
jl 0x16d016
jmp 0x16d035
leaq 0x53c82(%rip), %rdi     # 0x1c0c9f
leaq 0x53b9c(%rip), %rsi     # 0x1c0bc0
movl $0xed, %edx
leaq 0x53c38(%rip), %rcx     # 0x1c0c68
callq 0x598a0
movq -0x208(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x16d044
jmp 0x16d063
leaq 0x52fb0(%rip), %rdi     # 0x1bfffb
leaq 0x53b6e(%rip), %rsi     # 0x1c0bc0
movl $0xee, %edx
leaq 0x53c0a(%rip), %rcx     # 0x1c0c68
callq 0x598a0
movq -0x208(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jne 0x16d1ca
movl $0x0, -0x20c(%rbp)
movl -0x20c(%rbp), %eax
addl $0x8, %eax
cmpl -0x224(%rbp), %eax
jg 0x16d11a
movq -0x230(%rbp), %rdi
movslq -0x20c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
leaq -0x250(%rbp), %rdx
leaq -0x260(%rbp), %rcx
leaq -0x270(%rbp), %r8
leaq -0x280(%rbp), %r9
callq 0x16e2a0
movq -0x218(%rbp), %r9
movslq -0x20c(%rbp), %rax
addq %rax, %r9
leaq -0x250(%rbp), %rdi
leaq -0x260(%rbp), %rsi
leaq -0x270(%rbp), %rdx
leaq -0x280(%rbp), %rcx
leaq -0x240(%rbp), %r8
callq 0x16e4c0
movl -0x20c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x20c(%rbp)
jmp 0x16d07e
jmp 0x16d11c
movl -0x20c(%rbp), %eax
cmpl -0x224(%rbp), %eax
jge 0x16d1c5
movq -0x230(%rbp), %rax
movslq -0x20c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x284(%rbp)
movl -0x284(%rbp), %eax
movq -0x208(%rbp), %rcx
movl 0x10(%rcx), %ecx
imulq %rcx, %rax
movabsq $0x80000000, %rcx       # imm = 0x80000000
addq %rcx, %rax
shrq $0x20, %rax
movl %eax, -0x288(%rbp)
cmpl $0xff, -0x288(%rbp)
jle 0x16d189
movl $0xff, %eax
movl %eax, -0x414(%rbp)
jmp 0x16d198
movl -0x288(%rbp), %eax
movzbl %al, %eax
movl %eax, -0x414(%rbp)
movl -0x414(%rbp), %eax
movb %al, %dl
movq -0x218(%rbp), %rax
movslq -0x20c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x20c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20c(%rbp)
jmp 0x16d11c
jmp 0x16d77a
movq -0x208(%rbp), %rcx
movl 0x18(%rcx), %edx
negl %edx
movl %edx, %eax
shlq $0x20, %rax
movslq 0x20(%rcx), %rcx
xorl %edx, %edx
divq %rcx
movl %eax, -0x28c(%rbp)
movl -0x28c(%rbp), %eax
negl %eax
movl %eax, -0x290(%rbp)
movl -0x290(%rbp), %eax
movl $0x0, -0x1a4(%rbp)
movl %eax, -0x1a8(%rbp)
movl $0x0, -0x1ac(%rbp)
movl %eax, -0x1b0(%rbp)
movd -0x1a4(%rbp), %xmm0
movd -0x1a8(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd -0x1ac(%rbp), %xmm2
movd -0x1b0(%rbp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movaps %xmm0, -0x1c0(%rbp)
movaps -0x1c0(%rbp), %xmm0
movaps %xmm0, -0x2a0(%rbp)
movl -0x28c(%rbp), %eax
movl $0x0, -0x1c4(%rbp)
movl %eax, -0x1c8(%rbp)
movl $0x0, -0x1cc(%rbp)
movl %eax, -0x1d0(%rbp)
movd -0x1c4(%rbp), %xmm0
movd -0x1c8(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd -0x1cc(%rbp), %xmm2
movd -0x1d0(%rbp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movaps %xmm0, -0x1e0(%rbp)
movaps -0x1e0(%rbp), %xmm0
movaps %xmm0, -0x2b0(%rbp)
movl $0x0, -0x1e4(%rbp)
movl $0x80000000, -0x1e8(%rbp) # imm = 0x80000000
movl $0x0, -0x1ec(%rbp)
movl $0x80000000, -0x1f0(%rbp) # imm = 0x80000000
movd -0x1e4(%rbp), %xmm0
movd -0x1e8(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd -0x1ec(%rbp), %xmm2
movd -0x1f0(%rbp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movdqa %xmm0, -0x200(%rbp)
movdqa -0x200(%rbp), %xmm0
movdqa %xmm0, -0x2c0(%rbp)
movl $0x0, -0x20c(%rbp)
movl -0x20c(%rbp), %eax
addl $0x8, %eax
cmpl -0x224(%rbp), %eax
jg 0x16d689
movq -0x230(%rbp), %rdi
movslq -0x20c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
leaq -0x2a0(%rbp), %rsi
leaq -0x2d0(%rbp), %rdx
leaq -0x2e0(%rbp), %rcx
leaq -0x2f0(%rbp), %r8
leaq -0x300(%rbp), %r9
callq 0x16e2a0
movq -0x220(%rbp), %rdi
movslq -0x20c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
leaq -0x2b0(%rbp), %rsi
leaq -0x310(%rbp), %rdx
leaq -0x320(%rbp), %rcx
leaq -0x330(%rbp), %r8
leaq -0x340(%rbp), %r9
callq 0x16e2a0
movdqa -0x2d0(%rbp), %xmm1
movdqa -0x310(%rbp), %xmm0
movdqa %xmm1, -0x10(%rbp)
movdqa %xmm0, -0x20(%rbp)
movdqa -0x10(%rbp), %xmm0
paddq -0x20(%rbp), %xmm0
movdqa %xmm0, -0x350(%rbp)
movdqa -0x2e0(%rbp), %xmm1
movdqa -0x320(%rbp), %xmm0
movdqa %xmm1, -0x30(%rbp)
movdqa %xmm0, -0x40(%rbp)
movdqa -0x30(%rbp), %xmm0
paddq -0x40(%rbp), %xmm0
movdqa %xmm0, -0x360(%rbp)
movdqa -0x2f0(%rbp), %xmm1
movdqa -0x330(%rbp), %xmm0
movdqa %xmm1, -0x50(%rbp)
movdqa %xmm0, -0x60(%rbp)
movdqa -0x50(%rbp), %xmm0
paddq -0x60(%rbp), %xmm0
movdqa %xmm0, -0x370(%rbp)
movdqa -0x300(%rbp), %xmm1
movdqa -0x340(%rbp), %xmm0
movdqa %xmm1, -0x70(%rbp)
movdqa %xmm0, -0x80(%rbp)
movdqa -0x70(%rbp), %xmm0
paddq -0x80(%rbp), %xmm0
movdqa %xmm0, -0x380(%rbp)
movdqa -0x350(%rbp), %xmm1
movdqa -0x2c0(%rbp), %xmm0
movdqa %xmm1, -0x90(%rbp)
movdqa %xmm0, -0xa0(%rbp)
movdqa -0x90(%rbp), %xmm0
paddq -0xa0(%rbp), %xmm0
movdqa %xmm0, -0x390(%rbp)
movdqa -0x360(%rbp), %xmm1
movdqa -0x2c0(%rbp), %xmm0
movdqa %xmm1, -0xb0(%rbp)
movdqa %xmm0, -0xc0(%rbp)
movdqa -0xb0(%rbp), %xmm0
paddq -0xc0(%rbp), %xmm0
movdqa %xmm0, -0x3a0(%rbp)
movdqa -0x370(%rbp), %xmm1
movdqa -0x2c0(%rbp), %xmm0
movdqa %xmm1, -0xd0(%rbp)
movdqa %xmm0, -0xe0(%rbp)
movdqa -0xd0(%rbp), %xmm0
paddq -0xe0(%rbp), %xmm0
movdqa %xmm0, -0x3b0(%rbp)
movdqa -0x380(%rbp), %xmm1
movdqa -0x2c0(%rbp), %xmm0
movdqa %xmm1, -0xf0(%rbp)
movdqa %xmm0, -0x100(%rbp)
movdqa -0xf0(%rbp), %xmm0
paddq -0x100(%rbp), %xmm0
movdqa %xmm0, -0x3c0(%rbp)
movdqa -0x390(%rbp), %xmm0
movdqa %xmm0, -0x110(%rbp)
movl $0x20, -0x114(%rbp)
movdqa -0x110(%rbp), %xmm0
movl -0x114(%rbp), %eax
movd %eax, %xmm1
psrlq %xmm1, %xmm0
movdqa %xmm0, -0x3d0(%rbp)
movdqa -0x3a0(%rbp), %xmm0
movdqa %xmm0, -0x130(%rbp)
movl $0x20, -0x134(%rbp)
movdqa -0x130(%rbp), %xmm0
movl -0x134(%rbp), %eax
movd %eax, %xmm1
psrlq %xmm1, %xmm0
movdqa %xmm0, -0x3e0(%rbp)
movdqa -0x3b0(%rbp), %xmm0
movdqa %xmm0, -0x150(%rbp)
movl $0x20, -0x154(%rbp)
movdqa -0x150(%rbp), %xmm0
movl -0x154(%rbp), %eax
movd %eax, %xmm1
psrlq %xmm1, %xmm0
movdqa %xmm0, -0x3f0(%rbp)
movdqa -0x3c0(%rbp), %xmm0
movdqa %xmm0, -0x170(%rbp)
movl $0x20, -0x174(%rbp)
movdqa -0x170(%rbp), %xmm0
movl -0x174(%rbp), %eax
movd %eax, %xmm1
psrlq %xmm1, %xmm0
movdqa %xmm0, -0x400(%rbp)
movq -0x218(%rbp), %r9
movslq -0x20c(%rbp), %rax
addq %rax, %r9
leaq -0x3d0(%rbp), %rdi
leaq -0x3e0(%rbp), %rsi
leaq -0x3f0(%rbp), %rdx
leaq -0x400(%rbp), %rcx
leaq -0x240(%rbp), %r8
callq 0x16e4c0
movl -0x20c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x20c(%rbp)
jmp 0x16d33d
jmp 0x16d68b
movl -0x20c(%rbp), %eax
cmpl -0x224(%rbp), %eax
jge 0x16d778
movl -0x290(%rbp), %eax
movq -0x230(%rbp), %rcx
movslq -0x20c(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
imulq %rcx, %rax
movl -0x28c(%rbp), %ecx
movq -0x220(%rbp), %rdx
movslq -0x20c(%rbp), %rsi
movl (%rdx,%rsi,4), %edx
imulq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x408(%rbp)
movabsq $0x80000000, %rax       # imm = 0x80000000
addq -0x408(%rbp), %rax
shrq $0x20, %rax
movl %eax, -0x40c(%rbp)
movl -0x40c(%rbp), %eax
movq -0x208(%rbp), %rcx
movl 0x10(%rcx), %ecx
imulq %rcx, %rax
movabsq $0x80000000, %rcx       # imm = 0x80000000
addq %rcx, %rax
shrq $0x20, %rax
movl %eax, -0x410(%rbp)
cmpl $0xff, -0x410(%rbp)
jle 0x16d73c
movl $0xff, %eax
movl %eax, -0x418(%rbp)
jmp 0x16d74b
movl -0x410(%rbp), %eax
movzbl %al, %eax
movl %eax, -0x418(%rbp)
movl -0x418(%rbp), %eax
movb %al, %dl
movq -0x218(%rbp), %rax
movslq -0x20c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x20c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20c(%rbp)
jmp 0x16d68b
jmp 0x16d77a
addq $0x420, %rsp            # imm = 0x420
popq %rbp
retq
nopw %cs:(%rax,%rax)