// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/io_dec.c
// Function: EmitRescaledRGB
static int EmitRescaledRGB(const VP8Io* const io, WebPDecParams* const p) {
  const int mb_h = io->mb_h;
  const int uv_mb_h = (mb_h + 1) >> 1;
  int j = 0, uv_j = 0;
  int num_lines_out = 0;
  while (j < mb_h) {
    const int y_lines_in =
        WebPRescalerImport(p->scaler_y, mb_h - j,
                           io->y + (size_t)j * io->y_stride, io->y_stride);
    j += y_lines_in;
    if (WebPRescaleNeededLines(p->scaler_u, uv_mb_h - uv_j)) {
      const int u_lines_in = WebPRescalerImport(
          p->scaler_u, uv_mb_h - uv_j, io->u + (size_t)uv_j * io->uv_stride,
          io->uv_stride);
      const int v_lines_in = WebPRescalerImport(
          p->scaler_v, uv_mb_h - uv_j, io->v + (size_t)uv_j * io->uv_stride,
          io->uv_stride);
      (void)v_lines_in;   // remove a gcc warning
      assert(u_lines_in == v_lines_in);
      uv_j += u_lines_in;
    }
    num_lines_out += ExportRGB(p, p->last_y + num_lines_out);
  }
  return num_lines_out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl 0x10(%rdi), %eax
testl %eax, %eax
jle 0xd2065
movq %rsi, %rbx
movq %rdi, %r13
leal 0x1(%rax), %ecx
sarl %ecx
movl %ecx, 0x1c(%rsp)
xorl %ebp, %ebp
xorl %r14d, %r14d
movl $0x0, 0xc(%rsp)
movq %rdi, 0x30(%rsp)
movq %rax, 0x28(%rsp)
movq 0x30(%rbx), %rdi
movl %eax, %esi
subl %ebp, %esi
movslq %ebp, %rdx
movslq 0x30(%r13), %rcx
imulq %rcx, %rdx
addq 0x18(%r13), %rdx
callq 0xcf8ab
movl %eax, 0x20(%rsp)
movq 0x38(%rbx), %rdi
movl 0x1c(%rsp), %r15d
subl %r14d, %r15d
movl %r15d, %esi
callq 0xcf898
testl %eax, %eax
movl %ebp, 0x24(%rsp)
je 0xd1f69
movq 0x38(%rbx), %rdi
movslq %r14d, %rax
movq %rax, 0x10(%rsp)
movslq 0x34(%r13), %rcx
movq %rcx, %rdx
imulq %rax, %rdx
addq 0x20(%r13), %rdx
movl %r15d, %esi
callq 0xcf8ab
movl %eax, %r12d
movq 0x40(%rbx), %rdi
movslq 0x34(%r13), %rcx
movq %rcx, %rdx
imulq 0x10(%rsp), %rdx
addq 0x28(%r13), %rdx
movl %r15d, %esi
callq 0xcf8ab
cmpl %eax, %r12d
jne 0xd20b8
addl %r12d, %r14d
movl %r14d, 0x10(%rsp)
movq 0x30(%rbx), %rdi
movl 0x40(%rdi), %eax
xorl %r15d, %r15d
cmpl 0x38(%rdi), %eax
jge 0xd203a
movl 0x20(%rbx), %r14d
addl 0xc(%rsp), %r14d
movq (%rbx), %rbp
movl (%rbp), %eax
leaq 0xaa6d9(%rip), %rcx     # 0x17c670
movq (%rcx,%rax,8), %r13
movslq 0x18(%rbp), %rax
movslq %r14d, %r12
imulq %rax, %r12
addq 0x10(%rbp), %r12
xorl %r15d, %r15d
cmpl $0x0, 0x18(%rdi)
jg 0xd203a
movq 0x38(%rbx), %rax
movl 0x40(%rax), %ecx
cmpl 0x38(%rax), %ecx
jge 0xd203a
movl 0x18(%rax), %eax
testl %eax, %eax
jg 0xd203a
leal (%r14,%r15), %ecx
movq (%rbx), %rdx
cmpl 0x8(%rdx), %ecx
jge 0xd2099
movq 0x40(%rbx), %rcx
cmpl 0x18(%rcx), %eax
jne 0xd207a
callq 0xdcbcf
movq 0x38(%rbx), %rdi
callq 0xdcbcf
movq 0x40(%rbx), %rdi
callq 0xdcbcf
movq 0x30(%rbx), %rax
movq 0x38(%rbx), %rcx
movq 0x48(%rax), %rdi
movq 0x48(%rcx), %rsi
movq 0x40(%rbx), %rcx
movq 0x48(%rcx), %rdx
movl 0x34(%rax), %r8d
movq %r12, %rcx
callq *%r13
movslq 0x18(%rbp), %rax
addq %rax, %r12
incl %r15d
movq 0x30(%rbx), %rdi
movl 0x40(%rdi), %eax
cmpl 0x38(%rdi), %eax
jl 0xd1fad
movl 0x24(%rsp), %ebp
addl 0x20(%rsp), %ebp
addl 0xc(%rsp), %r15d
movl %r15d, 0xc(%rsp)
movq 0x28(%rsp), %rax
cmpl %eax, %ebp
movq 0x30(%rsp), %r13
movl 0x10(%rsp), %r14d
jl 0xd1ede
jmp 0xd2068
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x57fb7(%rip), %rdi     # 0x12a038
leaq 0x57ed8(%rip), %rsi     # 0x129f60
leaq 0x57f80(%rip), %rcx     # 0x12a00f
movl $0x174, %edx            # imm = 0x174
callq 0x55710
leaq 0x57f45(%rip), %rdi     # 0x129fe5
leaq 0x57eb9(%rip), %rsi     # 0x129f60
leaq 0x57f61(%rip), %rcx     # 0x12a00f
movl $0x173, %edx            # imm = 0x173
callq 0x55710
leaq 0x57ecf(%rip), %rdi     # 0x129f8e
leaq 0x57e9a(%rip), %rsi     # 0x129f60
leaq 0x57eda(%rip), %rcx     # 0x129fa7
movl $0x192, %edx            # imm = 0x192
callq 0x55710