// File: /workspace/github_c_makefile_star2_O3/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), %ebp
testl %ebp, %ebp
jle 0xd1187
movq %rsi, %rbx
movq %rdi, %r13
leal 0x1(%rbp), %eax
sarl %eax
movl %eax, 0x1c(%rsp)
movq 0x30(%rsi), %rdi
xorl %eax, %eax
xorl %r14d, %r14d
movl $0x0, 0xc(%rsp)
movq %r13, 0x30(%rsp)
movq %rbp, 0x28(%rsp)
movl %ebp, %esi
subl %eax, %esi
movl %eax, 0x24(%rsp)
movslq %eax, %rdx
movslq 0x30(%r13), %rcx
imulq %rcx, %rdx
addq 0x18(%r13), %rdx
callq 0xce96f
movl %eax, 0x20(%rsp)
movq 0x38(%rbx), %rdi
movl 0x1c(%rsp), %r15d
subl %r14d, %r15d
movl %r15d, %esi
callq 0xce95c
testl %eax, %eax
je 0xd108b
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 0xce96f
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 0xce96f
cmpl %eax, %r12d
jne 0xd11da
addl %r12d, %r14d
movl %r14d, 0x10(%rsp)
movq 0x30(%rbx), %rdi
movl 0x40(%rdi), %eax
xorl %r15d, %r15d
cmpl 0x38(%rdi), %eax
jge 0xd115c
movl 0x20(%rbx), %r14d
addl 0xc(%rsp), %r14d
movq (%rbx), %rbp
movl (%rbp), %eax
leaq 0xaa5b7(%rip), %rcx     # 0x17b670
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 0xd115c
movq 0x38(%rbx), %rax
movl 0x40(%rax), %ecx
cmpl 0x38(%rax), %ecx
jge 0xd115c
movl 0x18(%rax), %eax
testl %eax, %eax
jg 0xd115c
leal (%r14,%r15), %ecx
movq (%rbx), %rdx
cmpl 0x8(%rdx), %ecx
jge 0xd11bb
movq 0x40(%rbx), %rcx
cmpl 0x18(%rcx), %eax
jne 0xd119c
callq 0xdbd07
movq 0x38(%rbx), %rdi
callq 0xdbd07
movq 0x40(%rbx), %rdi
callq 0xdbd07
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 0xd10cf
movl 0x24(%rsp), %eax
addl 0x20(%rsp), %eax
addl 0xc(%rsp), %r15d
movl %r15d, 0xc(%rsp)
movq 0x28(%rsp), %rbp
cmpl %ebp, %eax
movq 0x30(%rsp), %r13
movl 0x10(%rsp), %r14d
jl 0xd1004
jmp 0xd118a
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x580c5(%rip), %rdi     # 0x129268
leaq 0x57fe6(%rip), %rsi     # 0x129190
leaq 0x5808e(%rip), %rcx     # 0x12923f
movl $0x174, %edx            # imm = 0x174
callq 0x55710
leaq 0x58053(%rip), %rdi     # 0x129215
leaq 0x57fc7(%rip), %rsi     # 0x129190
leaq 0x5806f(%rip), %rcx     # 0x12923f
movl $0x173, %edx            # imm = 0x173
callq 0x55710
leaq 0x57fdd(%rip), %rdi     # 0x1291be
leaq 0x57fa8(%rip), %rsi     # 0x129190
leaq 0x57fe8(%rip), %rcx     # 0x1291d7
movl $0x192, %edx            # imm = 0x192
callq 0x55710