// File: /workspace/github_c_makefile_star2_O3/enzo1982[P]smooth/libraries/libwebp/src/dec/frame_dec.c
// Function: FinishRow
static int FinishRow(void* arg1, void* arg2) {
  VP8Decoder* const dec = (VP8Decoder*)arg1;
  VP8Io* const io = (VP8Io*)arg2;
  int ok = 1;
  const VP8ThreadContext* const ctx = &dec->thread_ctx_;
  const int cache_id = ctx->id_;
  const int extra_y_rows = kFilterExtraRows[dec->filter_type_];
  const int ysize = extra_y_rows * dec->cache_y_stride_;
  const int uvsize = (extra_y_rows / 2) * dec->cache_uv_stride_;
  const int y_offset = cache_id * 16 * dec->cache_y_stride_;
  const int uv_offset = cache_id * 8 * dec->cache_uv_stride_;
  uint8_t* const ydst = dec->cache_y_ - ysize + y_offset;
  uint8_t* const udst = dec->cache_u_ - uvsize + uv_offset;
  uint8_t* const vdst = dec->cache_v_ - uvsize + uv_offset;
  const int mb_y = ctx->mb_y_;
  const int is_first_row = (mb_y == 0);
  const int is_last_row = (mb_y >= dec->br_mb_y_ - 1);

  if (dec->mt_method_ == 2) {
    ReconstructRow(dec, ctx);
  }

  if (ctx->filter_row_) {
    FilterRow(dec);
  }

  if (dec->dither_) {
    DitherRow(dec);
  }

  if (io->put != NULL) {
    int y_start = MACROBLOCK_VPOS(mb_y);
    int y_end = MACROBLOCK_VPOS(mb_y + 1);
    if (!is_first_row) {
      y_start -= extra_y_rows;
      io->y = ydst;
      io->u = udst;
      io->v = vdst;
    } else {
      io->y = dec->cache_y_ + y_offset;
      io->u = dec->cache_u_ + uv_offset;
      io->v = dec->cache_v_ + uv_offset;
    }

    if (!is_last_row) {
      y_end -= extra_y_rows;
    }
    if (y_end > io->crop_bottom) {
      y_end = io->crop_bottom;    // make sure we don't overflow on last row.
    }
    // If dec->alpha_data_ is not NULL, we have some alpha plane present.
    io->a = NULL;
    if (dec->alpha_data_ != NULL && y_start < y_end) {
      io->a = VP8DecompressAlphaRows(dec, io, y_start, y_end - y_start);
      if (io->a == NULL) {
        return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR,
                           "Could not decode alpha data.");
      }
    }
    if (y_start < io->crop_top) {
      const int delta_y = io->crop_top - y_start;
      y_start = io->crop_top;
      assert(!(delta_y & 1));
      io->y += dec->cache_y_stride_ * delta_y;
      io->u += dec->cache_uv_stride_ * (delta_y >> 1);
      io->v += dec->cache_uv_stride_ * (delta_y >> 1);
      if (io->a != NULL) {
        io->a += io->width * delta_y;
      }
    }
    if (y_start < y_end) {
      io->y += io->crop_left;
      io->u += io->crop_left >> 1;
      io->v += io->crop_left >> 1;
      if (io->a != NULL) {
        io->a += io->crop_left;
      }
      io->mb_y = y_start - io->crop_top;
      io->mb_w = io->crop_right - io->crop_left;
      io->mb_h = y_end - y_start;
      ok = io->put(io);
    }
  }
  // rotate top samples if needed
  if (cache_id + 1 == dec->num_caches_) {
    if (!is_last_row) {
      memcpy(dec->cache_y_ - ysize, ydst + 16 * dec->cache_y_stride_, ysize);
      memcpy(dec->cache_u_ - uvsize, udst + 8 * dec->cache_uv_stride_, uvsize);
      memcpy(dec->cache_v_ - uvsize, vdst + 8 * dec->cache_uv_stride_, uvsize);
    }
  }

  return ok;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, 0x30(%rsp)
movq %rdi, %r11
movslq 0xd8(%rdi), %rax
movq %rax, 0x68(%rsp)
movslq 0xb68(%rdi), %rax
leaq 0x59a4b(%rip), %rcx     # 0x128eec
movzbl (%rax,%rcx), %eax
movq %rax, 0x80(%rsp)
movslq 0xb40(%rdi), %rax
movq %rax, 0x90(%rsp)
movl 0xb44(%rdi), %eax
movl %eax, 0x64(%rsp)
movq 0xb28(%rdi), %rax
movq %rax, 0x70(%rsp)
movq 0xb30(%rdi), %rax
movq %rax, 0x78(%rsp)
movq 0xb38(%rdi), %rax
movq %rax, 0x48(%rsp)
movl 0xdc(%rdi), %eax
movl %eax, 0x40(%rsp)
movl 0x1ac(%rdi), %eax
movl %eax, 0x2c(%rsp)
cmpl $0x2, 0xc8(%rdi)
movq %rdi, 0x8(%rsp)
jne 0xcf520
leaq 0xd8(%r11), %rsi
movq %r11, %rdi
callq 0xceefa
movq 0x8(%rsp), %r11
cmpl $0x0, 0xe0(%r11)
je 0xcf7f0
movslq 0x1a0(%r11), %rbp
cmpl 0x1a8(%r11), %ebp
jge 0xcf7f0
movl 0xdc(%r11), %eax
movl %eax, 0x44(%rsp)
leaq (,%rbp,8), %rbx
movq %rbp, %r14
shlq $0x4, %r14
movq 0xe8(%r11), %r15
movzbl (%r15,%rbp,4), %r12d
testl %r12d, %r12d
je 0xcf7d5
cmpb $0x2, %r12b
jbe 0xcfb8f
movl 0xd8(%r11), %eax
movl 0xb40(%r11), %edx
movl %eax, %ecx
movl %edx, 0x4(%rsp)
imull %edx, %ecx
shll $0x4, %ecx
movslq %ecx, %r13
addq 0xb28(%r11), %r13
addq %r14, %r13
cmpl $0x1, 0xb68(%r11)
jne 0xcf634
testq %rbp, %rbp
jle 0xcf5cf
leal 0x4(%r12), %edx
movq %r13, %rdi
movl 0x4(%rsp), %esi
leaq 0xabde0(%rip), %rax     # 0x17b3a8
callq *(%rax)
movq 0x8(%rsp), %r11
cmpb $0x0, 0x2(%r15,%rbp,4)
je 0xcf5ef
movq %r13, %rdi
movl 0x4(%rsp), %esi
movl %r12d, %edx
leaq 0xabdd0(%rip), %rax     # 0x17b3b8
callq *(%rax)
movq 0x8(%rsp), %r11
cmpl $0x0, 0x44(%rsp)
jle 0xcf610
leal 0x4(%r12), %edx
movq %r13, %rdi
movl 0x4(%rsp), %esi
leaq 0xabd97(%rip), %rax     # 0x17b3a0
callq *(%rax)
movq 0x8(%rsp), %r11
cmpb $0x0, 0x2(%r15,%rbp,4)
je 0xcf7d5
movq %r13, %rdi
movl 0x4(%rsp), %esi
movl %r12d, %edx
leaq 0xabd83(%rip), %rax     # 0x17b3b0
callq *(%rax)
jmp 0xcf7d0
movq %r12, 0x88(%rsp)
movzbl 0x1(%r15,%rbp,4), %ecx
movl 0xb44(%r11), %esi
imull %esi, %eax
shll $0x3, %eax
movq %r15, %rdx
movslq %eax, %r15
movq 0xb30(%r11), %r12
addq %r15, %r12
addq 0xb38(%r11), %r15
addq %rbx, %r12
addq %rbx, %r15
movq %rdx, 0x50(%rsp)
movzbl 0x3(%rdx,%rbp,4), %r8d
testq %rbp, %rbp
movl %ecx, 0x18(%rsp)
movl %r8d, 0x10(%rsp)
movl %esi, 0x38(%rsp)
jle 0xcf6d7
movq 0x88(%rsp), %rax
leal 0x4(%rax), %edx
movl %edx, 0x20(%rsp)
movq %r13, %rdi
movl 0x4(%rsp), %esi
leaq 0xabcc2(%rip), %rax     # 0x17b368
callq *(%rax)
movq %r12, %rdi
movq %r15, %rsi
movl 0x38(%rsp), %edx
movl 0x20(%rsp), %ecx
movl 0x18(%rsp), %r8d
movl 0x10(%rsp), %r9d
leaq 0xabcb1(%rip), %rax     # 0x17b378
callq *(%rax)
movl 0x10(%rsp), %r8d
movl 0x18(%rsp), %ecx
movq 0x8(%rsp), %r11
movq %r12, 0x20(%rsp)
movq 0x50(%rsp), %rax
cmpb $0x0, 0x2(%rax,%rbp,4)
movq %r15, 0x58(%rsp)
movq 0x88(%rsp), %r12
je 0xcf73a
movq %r13, %rdi
movl 0x4(%rsp), %esi
movl %r12d, %edx
leaq 0xabc82(%rip), %rax     # 0x17b388
callq *(%rax)
movq 0x20(%rsp), %rdi
movq 0x58(%rsp), %rsi
movl 0x38(%rsp), %edx
movl %r12d, %ecx
movl 0x18(%rsp), %r8d
movl 0x10(%rsp), %r9d
leaq 0xabc6e(%rip), %rax     # 0x17b398
callq *(%rax)
movl 0x10(%rsp), %r8d
movl 0x18(%rsp), %ecx
movq 0x8(%rsp), %r11
cmpl $0x0, 0x44(%rsp)
jle 0xcf78b
leal 0x4(%r12), %r15d
movq %r13, %rdi
movl 0x4(%rsp), %esi
movl %r15d, %edx
leaq 0xabc09(%rip), %rax     # 0x17b360
callq *(%rax)
movq 0x20(%rsp), %rdi
movq 0x58(%rsp), %rsi
movl 0x38(%rsp), %edx
movl %r15d, %ecx
movl 0x18(%rsp), %r8d
movl 0x10(%rsp), %r9d
leaq 0xabbf5(%rip), %rax     # 0x17b370
callq *(%rax)
movl 0x10(%rsp), %r8d
movl 0x18(%rsp), %ecx
movq 0x8(%rsp), %r11
movq 0x50(%rsp), %rax
cmpb $0x0, 0x2(%rax,%rbp,4)
je 0xcf7d5
movq %r13, %rdi
movl 0x4(%rsp), %esi
movl %r12d, %edx
leaq 0xabbd8(%rip), %rax     # 0x17b380
movl %ecx, %r13d
movl %r8d, %r15d
callq *(%rax)
movq 0x20(%rsp), %rdi
movq 0x58(%rsp), %rsi
movl 0x38(%rsp), %edx
movl %r12d, %ecx
movl %r13d, %r8d
movl %r15d, %r9d
leaq 0xabbc2(%rip), %rax     # 0x17b390
callq *(%rax)
movq 0x8(%rsp), %r11
incq %rbp
movslq 0x1a8(%r11), %rax
addq $0x8, %rbx
addq $0x10, %r14
cmpq %rax, %rbp
jl 0xcf55c
movq 0x80(%rsp), %r15
movl %r15d, %eax
shrl %eax
movl 0x64(%rsp), %edx
imull %edx, %eax
movq 0x68(%rsp), %rcx
imull %ecx, %edx
movq %rcx, %rdi
movq 0x90(%rsp), %rsi
imulq %rsi, %rdi
movq %r15, %rcx
imulq %rsi, %rcx
shll $0x3, %edx
cltq
shlq $0x4, %rdi
movq %rdi, 0x10(%rsp)
movq %rcx, 0x20(%rsp)
subq %rcx, 0x70(%rsp)
subq %rax, 0x78(%rsp)
movslq %edx, %rcx
movq %rcx, 0x38(%rsp)
movq %rax, 0x50(%rsp)
subq %rax, 0x48(%rsp)
cmpl $0x0, 0x338(%r11)
je 0xcf924
movslq 0x1a0(%r11), %rbx
movl 0x1a8(%r11), %eax
cmpl %eax, %ebx
jge 0xcf924
leaq 0x33c(%r11), %rcx
movq %rcx, 0x18(%rsp)
leaq (,%rbx,8), %r13
imulq $0x64, %rbx, %r12
movq 0x18(%rsp), %rbp
movq 0xf0(%r11), %r14
movzbl 0x31c(%r14,%r12,8), %ecx
cmpl $0x4, %ecx
jb 0xcf90d
movl 0xb44(%r11), %edx
movl 0xd8(%r11), %eax
imull %edx, %eax
movl %edx, 0x4(%rsp)
shll $0x3, %eax
movslq %eax, %r15
movq 0xb30(%r11), %rsi
addq %r15, %rsi
addq %r13, %rsi
addq 0xb38(%r11), %r15
addq %r13, %r15
movq %rbp, %rdi
callq 0xd028e
movzbl 0x31c(%r14,%r12,8), %ecx
movq %rbp, %rdi
movq %r15, %rsi
movq 0x80(%rsp), %r15
movl 0x4(%rsp), %edx
callq 0xd028e
movq 0x8(%rsp), %r11
movl 0x1a8(%r11), %eax
incq %rbx
movslq %eax, %rcx
addq $0x8, %r13
addq $0x64, %r12
cmpq %rcx, %rbx
jl 0xcf892
movq 0x70(%rsp), %r13
movq 0x10(%rsp), %rsi
addq %rsi, %r13
movq 0x78(%rsp), %r12
movq 0x38(%rsp), %rdi
addq %rdi, %r12
addq %rdi, 0x48(%rsp)
decl 0x2c(%rsp)
movl $0x1, %r10d
movq 0x30(%rsp), %rax
cmpq $0x0, 0x40(%rax)
je 0xcf97c
movl 0x40(%rsp), %r14d
movl %r14d, %ebp
shll $0x4, %ebp
leal 0x10(%rbp), %ebx
testl %r14d, %r14d
je 0xcf986
subl %r15d, %ebp
movq %r13, %rsi
movq %r12, %rcx
movq 0x48(%rsp), %rdi
jmp 0xcf9a0
movl 0x40(%rsp), %r14d
jmp 0xcfae2
addq 0xb28(%r11), %rsi
movq 0xb30(%r11), %rcx
addq %rdi, %rcx
addq 0xb38(%r11), %rdi
xorl %ebp, %ebp
xorl %eax, %eax
cmpl 0x2c(%rsp), %r14d
movq 0x30(%rsp), %rdx
movq %rsi, 0x18(%rdx)
movq %rcx, 0x20(%rdx)
movq %rdi, 0x28(%rdx)
cmovgel %eax, %r15d
subl %r15d, %ebx
movl 0x84(%rdx), %ecx
cmpl %ecx, %ebx
cmovgel %ecx, %ebx
movq $0x0, 0x98(%rdx)
cmpq $0x0, 0xb98(%r11)
je 0xcfa0e
movl %ebx, %ecx
subl %ebp, %ecx
jle 0xcfa0e
movq %r11, %rdi
movq 0x30(%rsp), %r15
movq %r15, %rsi
movl %ebp, %edx
callq 0xf14ef
movl $0x1, %r10d
movq 0x8(%rsp), %r11
movq %rax, 0x98(%r15)
testq %rax, %rax
je 0xcfa6f
movq 0x30(%rsp), %rcx
movl 0x80(%rcx), %ecx
movl %ecx, %edx
subl %ebp, %edx
jle 0xcfa98
testb $0x1, %dl
jne 0xcfbae
movslq 0xb40(%r11), %rdi
movslq %edx, %rsi
imulq %rsi, %rdi
movq 0x30(%rsp), %r9
addq %rdi, 0x18(%r9)
movslq 0xb44(%r11), %rdi
sarl %edx
movslq %edx, %rdx
imulq %rdi, %rdx
addq %rdx, 0x20(%r9)
addq %rdx, 0x28(%r9)
testq %rax, %rax
je 0xcfa94
movslq (%r9), %rdx
imulq %rsi, %rdx
addq %rdx, %rax
movq %rax, 0x98(%r9)
jmp 0xcfa96
leaq 0x595c0(%rip), %rdx     # 0x129036
movq %r11, %rdi
movl $0x3, %esi
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd18d5
xorl %eax, %eax
movl %ecx, %ebp
subl %ebp, %ebx
jle 0xcfae2
movq 0x30(%rsp), %rdi
movslq 0x78(%rdi), %rdx
addq %rdx, 0x18(%rdi)
movl %edx, %esi
sarl %esi
movslq %esi, %rsi
addq %rsi, 0x20(%rdi)
addq %rsi, 0x28(%rdi)
testq %rax, %rax
je 0xcfac7
addq %rdx, %rax
movq %rax, 0x98(%rdi)
subl %ecx, %ebp
movl %ebp, 0x8(%rdi)
movl 0x7c(%rdi), %eax
subl %edx, %eax
movl %eax, 0xc(%rdi)
movl %ebx, 0x10(%rdi)
callq *0x40(%rdi)
movl %eax, %r10d
movq 0x8(%rsp), %r11
cmpl 0x2c(%rsp), %r14d
setge %al
movq 0x68(%rsp), %rcx
incl %ecx
cmpl 0xd0(%r11), %ecx
setne %cl
orb %al, %cl
jne 0xcfb7a
movq 0x20(%rsp), %rdx
movq %rdx, %rdi
negq %rdi
movq 0x50(%rsp), %r15
movq %r15, %r14
addq 0xb28(%r11), %rdi
negq %r14
movslq 0xb40(%r11), %rax
shlq $0x4, %rax
addq %rax, %r13
movq %r13, %rsi
movq %r11, %rbx
movl %r10d, %ebp
callq 0x552d0
movq 0xb30(%rbx), %rdi
addq %r14, %rdi
movslq 0xb44(%rbx), %rax
leaq (%r12,%rax,8), %rsi
movq %r15, %rdx
callq 0x552d0
addq 0xb38(%rbx), %r14
movslq 0xb44(%rbx), %rax
movq 0x48(%rsp), %rcx
leaq (%rcx,%rax,8), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x552d0
movl %ebp, %r10d
movl %r10d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x594ea(%rip), %rdi     # 0x129080
leaq 0x59352(%rip), %rsi     # 0x128eef
leaq 0x594e7(%rip), %rcx     # 0x12908b
movl $0xd6, %edx
callq 0x55710
leaq 0x5949e(%rip), %rdi     # 0x129053
leaq 0x59333(%rip), %rsi     # 0x128eef
leaq 0x5949f(%rip), %rcx     # 0x129062
movl $0x1d0, %edx            # imm = 0x1D0
callq 0x55710