// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dec/io_dec.c
// Function: EmitFancyRGB
static int EmitFancyRGB(const VP8Io* const io, WebPDecParams* const p) {
  int num_lines_out = io->mb_h;   // a priori guess
  const WebPRGBABuffer* const buf = &p->output->u.RGBA;
  uint8_t* dst = buf->rgba + (size_t)io->mb_y * buf->stride;
  WebPUpsampleLinePairFunc upsample = WebPUpsamplers[p->output->colorspace];
  const uint8_t* cur_y = io->y;
  const uint8_t* cur_u = io->u;
  const uint8_t* cur_v = io->v;
  const uint8_t* top_u = p->tmp_u;
  const uint8_t* top_v = p->tmp_v;
  int y = io->mb_y;
  const int y_end = io->mb_y + io->mb_h;
  const int mb_w = io->mb_w;
  const int uv_w = (mb_w + 1) / 2;

  if (y == 0) {
    // First line is special cased. We mirror the u/v samples at boundary.
    upsample(cur_y, NULL, cur_u, cur_v, cur_u, cur_v, dst, NULL, mb_w);
  } else {
    // We can finish the left-over line from previous call.
    upsample(p->tmp_y, cur_y, top_u, top_v, cur_u, cur_v,
             dst - buf->stride, dst, mb_w);
    ++num_lines_out;
  }
  // Loop over each output pairs of row.
  for (; y + 2 < y_end; y += 2) {
    top_u = cur_u;
    top_v = cur_v;
    cur_u += io->uv_stride;
    cur_v += io->uv_stride;
    dst += 2 * buf->stride;
    cur_y += 2 * io->y_stride;
    upsample(cur_y - io->y_stride, cur_y,
             top_u, top_v, cur_u, cur_v,
             dst - buf->stride, dst, mb_w);
  }
  // move to last row
  cur_y += io->y_stride;
  if (io->crop_top + y_end < io->crop_bottom) {
    // Save the unfinished samples for next call (as we're not done yet).
    memcpy(p->tmp_y, cur_y, mb_w * sizeof(*p->tmp_y));
    memcpy(p->tmp_u, cur_u, uv_w * sizeof(*p->tmp_u));
    memcpy(p->tmp_v, cur_v, uv_w * sizeof(*p->tmp_v));
    // The fancy upsampler leaves a row unfinished behind
    // (except for the very last row)
    num_lines_out--;
  } else {
    // Process the very last row of even-sized picture
    if (!(y_end & 1)) {
      upsample(cur_y, NULL, cur_u, cur_v, cur_u, cur_v,
               dst + buf->stride, NULL, mb_w);
    }
  }
  return num_lines_out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x88, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
addq $0x10, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movq -0x28(%rbp), %rdx
movslq 0x8(%rdx), %rdx
imulq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, %ecx
leaq 0xd836f(%rip), %rax     # 0x219250
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
addl 0x10(%rcx), %eax
movl %eax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x70(%rbp)
cmpl $0x0, -0x64(%rbp)
jne 0x140f99
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rdx
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %r8
movq -0x50(%rbp), %r9
movq -0x30(%rbp), %r11
movl -0x6c(%rbp), %r10d
xorl %esi, %esi
movq %r11, (%rsp)
movq $0x0, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
callq *%rax
jmp 0x140fef
movq -0x38(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x40(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
movq -0x48(%rbp), %r8
movq -0x50(%rbp), %r9
movq -0x30(%rbp), %rbx
movq -0x28(%rbp), %r10
movslq 0x8(%r10), %r11
xorl %r10d, %r10d
subq %r11, %r10
addq %r10, %rbx
movq -0x30(%rbp), %r11
movl -0x6c(%rbp), %r10d
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
callq *%rax
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x140ff1
movl -0x64(%rbp), %eax
addl $0x2, %eax
cmpl -0x68(%rbp), %eax
jge 0x1410cf
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movl 0x34(%rax), %ecx
movq -0x48(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movl 0x34(%rax), %ecx
movq -0x50(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
shll %ecx
movq -0x30(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x30(%rax), %ecx
shll %ecx
movq -0x40(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rcx
movslq 0x30(%rcx), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rdi
movq -0x40(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
movq -0x48(%rbp), %r8
movq -0x50(%rbp), %r9
movq -0x30(%rbp), %rbx
movq -0x28(%rbp), %r10
movslq 0x8(%r10), %r11
xorl %r10d, %r10d
subq %r11, %r10
addq %r10, %rbx
movq -0x30(%rbp), %r11
movl -0x6c(%rbp), %r10d
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
callq *%rax
movl -0x64(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x64(%rbp)
jmp 0x140ff1
movq -0x10(%rbp), %rax
movl 0x30(%rax), %ecx
movq -0x40(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movl 0x80(%rax), %eax
addl -0x68(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x84(%rcx), %eax
jge 0x141153
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x40(%rbp), %rsi
movslq -0x6c(%rbp), %rdx
shlq $0x0, %rdx
callq 0x593a0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x48(%rbp), %rsi
movslq -0x70(%rbp), %rdx
shlq $0x0, %rdx
callq 0x593a0
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x50(%rbp), %rsi
movslq -0x70(%rbp), %rdx
shlq $0x0, %rdx
callq 0x593a0
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1411a1
movl -0x68(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x14119f
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rdx
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %r8
movq -0x50(%rbp), %r9
movq -0x30(%rbp), %r11
movq -0x28(%rbp), %rsi
movslq 0x8(%rsi), %rsi
addq %rsi, %r11
movl -0x6c(%rbp), %r10d
xorl %esi, %esi
movq %r11, (%rsp)
movq $0x0, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
callq *%rax
jmp 0x1411a1
movl -0x1c(%rbp), %eax
addq $0x88, %rsp
popq %rbx
popq %rbp
retq
nop