// File: /workspace/github_c_makefile_star2_O1/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, 0x18(%rsp)
movq %rdi, %r9
movslq 0xd8(%rdi), %rax
movq %rax, 0x68(%rsp)
movslq 0xb68(%rdi), %rax
leaq 0x59915(%rip), %rcx     # 0x129cbc
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, 0x48(%rsp)
movq 0xb30(%rdi), %rax
movq %rax, 0x70(%rsp)
movq 0xb38(%rdi), %rax
movq %rax, 0x78(%rsp)
movl 0xdc(%rdi), %eax
movl %eax, 0x3c(%rsp)
movl 0x1ac(%rdi), %eax
movl %eax, 0x40(%rsp)
cmpl $0x2, 0xc8(%rdi)
movq %rdi, 0x8(%rsp)
jne 0xd0426
leaq 0xd8(%r9), %rsi
movq %r9, %rdi
callq 0xcfe32
movq 0x8(%rsp), %r9
cmpl $0x0, 0xe0(%r9)
je 0xd06f6
movslq 0x1a0(%r9), %rbp
cmpl 0x1a8(%r9), %ebp
jge 0xd06f6
movl 0xdc(%r9), %eax
movl %eax, 0x44(%rsp)
leaq (,%rbp,8), %rbx
movq %rbp, %r14
shlq $0x4, %r14
movq 0xe8(%r9), %r15
movzbl (%r15,%rbp,4), %r12d
testl %r12d, %r12d
je 0xd06db
cmpb $0x2, %r12b
jbe 0xd0ac6
movl 0xd8(%r9), %eax
movl 0xb40(%r9), %edx
movl %eax, %ecx
movl %edx, 0x4(%rsp)
imull %edx, %ecx
shll $0x4, %ecx
movslq %ecx, %r13
addq 0xb28(%r9), %r13
addq %r14, %r13
cmpl $0x1, 0xb68(%r9)
jne 0xd053a
testq %rbp, %rbp
jle 0xd04d5
leal 0x4(%r12), %edx
movq %r13, %rdi
movl 0x4(%rsp), %esi
leaq 0xabeda(%rip), %rax     # 0x17c3a8
callq *(%rax)
movq 0x8(%rsp), %r9
cmpb $0x0, 0x2(%r15,%rbp,4)
je 0xd04f5
movq %r13, %rdi
movl 0x4(%rsp), %esi
movl %r12d, %edx
leaq 0xabeca(%rip), %rax     # 0x17c3b8
callq *(%rax)
movq 0x8(%rsp), %r9
cmpl $0x0, 0x44(%rsp)
jle 0xd0516
leal 0x4(%r12), %edx
movq %r13, %rdi
movl 0x4(%rsp), %esi
leaq 0xabe91(%rip), %rax     # 0x17c3a0
callq *(%rax)
movq 0x8(%rsp), %r9
cmpb $0x0, 0x2(%r15,%rbp,4)
je 0xd06db
movq %r13, %rdi
movl 0x4(%rsp), %esi
movl %r12d, %edx
leaq 0xabe7d(%rip), %rax     # 0x17c3b0
callq *(%rax)
jmp 0xd06d6
movq %r12, 0x88(%rsp)
movzbl 0x1(%r15,%rbp,4), %ecx
movl 0xb44(%r9), %esi
imull %esi, %eax
shll $0x3, %eax
movq %r15, %rdx
movslq %eax, %r15
movq 0xb30(%r9), %r12
addq %r15, %r12
addq 0xb38(%r9), %r15
addq %rbx, %r12
addq %rbx, %r15
movq %rdx, 0x50(%rsp)
movzbl 0x3(%rdx,%rbp,4), %r8d
testq %rbp, %rbp
movl %ecx, 0x20(%rsp)
movl %r8d, 0x10(%rsp)
movl %esi, 0x30(%rsp)
jle 0xd05dd
movq 0x88(%rsp), %rax
leal 0x4(%rax), %edx
movl %edx, 0x28(%rsp)
movq %r13, %rdi
movl 0x4(%rsp), %esi
leaq 0xabdbc(%rip), %rax     # 0x17c368
callq *(%rax)
movq %r12, %rdi
movq %r15, %rsi
movl 0x30(%rsp), %edx
movl 0x28(%rsp), %ecx
movl 0x20(%rsp), %r8d
movl 0x10(%rsp), %r9d
leaq 0xabdab(%rip), %rax     # 0x17c378
callq *(%rax)
movl 0x10(%rsp), %r8d
movl 0x20(%rsp), %ecx
movq 0x8(%rsp), %r9
movq %r12, 0x28(%rsp)
movq 0x50(%rsp), %rax
cmpb $0x0, 0x2(%rax,%rbp,4)
movq %r15, 0x58(%rsp)
movq 0x88(%rsp), %r12
je 0xd0640
movq %r13, %rdi
movl 0x4(%rsp), %esi
movl %r12d, %edx
leaq 0xabd7c(%rip), %rax     # 0x17c388
callq *(%rax)
movq 0x28(%rsp), %rdi
movq 0x58(%rsp), %rsi
movl 0x30(%rsp), %edx
movl %r12d, %ecx
movl 0x20(%rsp), %r8d
movl 0x10(%rsp), %r9d
leaq 0xabd68(%rip), %rax     # 0x17c398
callq *(%rax)
movl 0x10(%rsp), %r8d
movl 0x20(%rsp), %ecx
movq 0x8(%rsp), %r9
cmpl $0x0, 0x44(%rsp)
jle 0xd0691
leal 0x4(%r12), %r15d
movq %r13, %rdi
movl 0x4(%rsp), %esi
movl %r15d, %edx
leaq 0xabd03(%rip), %rax     # 0x17c360
callq *(%rax)
movq 0x28(%rsp), %rdi
movq 0x58(%rsp), %rsi
movl 0x30(%rsp), %edx
movl %r15d, %ecx
movl 0x20(%rsp), %r8d
movl 0x10(%rsp), %r9d
leaq 0xabcef(%rip), %rax     # 0x17c370
callq *(%rax)
movl 0x10(%rsp), %r8d
movl 0x20(%rsp), %ecx
movq 0x8(%rsp), %r9
movq 0x50(%rsp), %rax
cmpb $0x0, 0x2(%rax,%rbp,4)
je 0xd06db
movq %r13, %rdi
movl 0x4(%rsp), %esi
movl %r12d, %edx
leaq 0xabcd2(%rip), %rax     # 0x17c380
movl %ecx, %r13d
movl %r8d, %r15d
callq *(%rax)
movq 0x28(%rsp), %rdi
movq 0x58(%rsp), %rsi
movl 0x30(%rsp), %edx
movl %r12d, %ecx
movl %r13d, %r8d
movl %r15d, %r9d
leaq 0xabcbc(%rip), %rax     # 0x17c390
callq *(%rax)
movq 0x8(%rsp), %r9
incq %rbp
movslq 0x1a8(%r9), %rax
addq $0x8, %rbx
addq $0x10, %r14
cmpq %rax, %rbp
jl 0xd0462
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, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
subq %rcx, 0x48(%rsp)
subq %rax, 0x70(%rsp)
movslq %edx, %rcx
movq %rcx, 0x10(%rsp)
movq %rax, 0x50(%rsp)
subq %rax, 0x78(%rsp)
cmpl $0x0, 0x338(%r9)
je 0xd0825
movslq 0x1a0(%r9), %rbx
cmpl 0x1a8(%r9), %ebx
jge 0xd0825
leaq 0x33c(%r9), %rax
movq %rax, 0x20(%rsp)
leaq (,%rbx,8), %r12
imulq $0x64, %rbx, %r13
movq 0x20(%rsp), %rbp
movq 0xf0(%r9), %r14
movzbl 0x31c(%r14,%r13,8), %ecx
cmpl $0x4, %ecx
jb 0xd080a
movl 0xb44(%r9), %edx
movl 0xd8(%r9), %eax
imull %edx, %eax
movl %edx, 0x4(%rsp)
shll $0x3, %eax
movslq %eax, %r15
movq 0xb30(%r9), %rsi
addq %r15, %rsi
addq %r12, %rsi
addq 0xb38(%r9), %r15
addq %r12, %r15
movq %rbp, %rdi
callq 0xd1187
movzbl 0x31c(%r14,%r13,8), %ecx
movq %rbp, %rdi
movq %r15, %rsi
movq 0x80(%rsp), %r15
movl 0x4(%rsp), %edx
callq 0xd1187
movq 0x8(%rsp), %r9
incq %rbx
movslq 0x1a8(%r9), %rax
addq $0x8, %r12
addq $0x64, %r13
cmpq %rax, %rbx
jl 0xd0796
movq 0x48(%rsp), %rax
addq 0x30(%rsp), %rax
movq 0x70(%rsp), %r13
movq 0x10(%rsp), %rcx
addq %rcx, %r13
movq 0x78(%rsp), %r12
addq %rcx, %r12
decl 0x40(%rsp)
movq 0x18(%rsp), %rcx
cmpq $0x0, 0x40(%rcx)
movq %rax, 0x48(%rsp)
je 0xd0881
movl 0x3c(%rsp), %ecx
movl %ecx, %r14d
shll $0x4, %r14d
leal 0x10(%r14), %ebx
testl %ecx, %ecx
je 0xd088b
subl %r15d, %r14d
movq 0x18(%rsp), %rdx
movq %rax, 0x18(%rdx)
movq %r13, 0x20(%rdx)
movq %r12, %rsi
jmp 0xd08ba
movl $0x1, %ebp
jmp 0xd0a19
movq 0x30(%rsp), %rax
addq 0xb28(%r9), %rax
movq 0x18(%rsp), %rdx
movq %rax, 0x18(%rdx)
movq 0xb30(%r9), %rax
movq 0x10(%rsp), %rsi
addq %rsi, %rax
movq %rax, 0x20(%rdx)
addq 0xb38(%r9), %rsi
xorl %eax, %eax
movl 0x40(%rsp), %ecx
cmpl %ecx, 0x3c(%rsp)
movq %rsi, 0x28(%rdx)
cmovgel %eax, %r15d
subl %r15d, %ebx
movl 0x84(%rdx), %eax
cmpl %eax, %ebx
cmovgel %eax, %ebx
movq $0x0, 0x98(%rdx)
cmpq $0x0, 0xb98(%r9)
je 0xd091e
movl %ebx, %ecx
subl %r14d, %ecx
jle 0xd091e
movq %r9, %rdi
movq 0x18(%rsp), %r15
movq %r15, %rsi
movl %r14d, %edx
callq 0xf228b
movq 0x8(%rsp), %r9
movq %rax, 0x98(%r15)
testq %rax, %rax
je 0xd09ef
movq 0x18(%rsp), %rax
movl 0x80(%rax), %eax
movl %eax, %edx
subl %r14d, %edx
jle 0xd0990
testb $0x1, %dl
jne 0xd0ae5
movslq 0xb40(%r9), %rsi
movslq %edx, %rcx
imulq %rcx, %rsi
movq 0x18(%rsp), %rdi
addq %rsi, 0x18(%rdi)
movslq 0xb44(%r9), %rsi
sarl %edx
movslq %edx, %rdx
imulq %rsi, %rdx
addq %rdx, 0x20(%rdi)
addq %rdx, 0x28(%rdi)
movq 0x98(%rdi), %rdx
movl %eax, %r14d
testq %rdx, %rdx
je 0xd0990
movq 0x18(%rsp), %rdi
movslq (%rdi), %rsi
imulq %rcx, %rsi
addq %rsi, %rdx
movq %rdx, 0x98(%rdi)
movl %eax, %r14d
movb $0x1, %r15b
subl %r14d, %ebx
jle 0xd09e8
movq 0x18(%rsp), %rdi
movslq 0x78(%rdi), %rcx
addq %rcx, 0x18(%rdi)
movl %ecx, %edx
sarl %edx
movslq %edx, %rdx
addq %rdx, 0x20(%rdi)
addq %rdx, 0x28(%rdi)
movq 0x98(%rdi), %rdx
testq %rdx, %rdx
je 0xd09ca
addq %rcx, %rdx
movq %rdx, 0x98(%rdi)
subl %eax, %r14d
movl %r14d, 0x8(%rdi)
movl 0x7c(%rdi), %eax
subl %ecx, %eax
movl %eax, 0xc(%rdi)
movl %ebx, 0x10(%rdi)
callq *0x40(%rdi)
movl %eax, %ebp
movq 0x8(%rsp), %r9
jmp 0xd0a10
movl $0x1, %ebp
jmp 0xd0a10
leaq 0x59410(%rip), %rdx     # 0x129e06
movq %r9, %rdi
movl $0x3, %esi
callq 0xd2755
movq 0x8(%rsp), %r9
movl $0x1, %ebp
xorl %r15d, %r15d
testb %r15b, %r15b
je 0xd0ab4
movl 0x40(%rsp), %eax
cmpl %eax, 0x3c(%rsp)
setge %al
movq 0x68(%rsp), %rcx
incl %ecx
cmpl 0xd0(%r9), %ecx
setne %cl
orb %al, %cl
jne 0xd0ab2
movq 0x28(%rsp), %rdx
movq %rdx, %rdi
negq %rdi
movq 0x50(%rsp), %r15
movq %r15, %r14
addq 0xb28(%r9), %rdi
negq %r14
movslq 0xb40(%r9), %rax
shlq $0x4, %rax
movq 0x48(%rsp), %rsi
addq %rax, %rsi
movq %r9, %rbx
callq 0x552d0
movq 0xb30(%rbx), %rdi
addq %r14, %rdi
movslq 0xb44(%rbx), %rax
leaq (,%rax,8), %rsi
addq %r13, %rsi
movq %r15, %rdx
callq 0x552d0
addq 0xb38(%rbx), %r14
movslq 0xb44(%rbx), %rax
leaq (%r12,%rax,8), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x552d0
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x59383(%rip), %rdi     # 0x129e50
leaq 0x591eb(%rip), %rsi     # 0x129cbf
leaq 0x59380(%rip), %rcx     # 0x129e5b
movl $0xd6, %edx
callq 0x55710
leaq 0x59337(%rip), %rdi     # 0x129e23
leaq 0x591cc(%rip), %rsi     # 0x129cbf
leaq 0x59338(%rip), %rcx     # 0x129e32
movl $0x1d0, %edx            # imm = 0x1D0
callq 0x55710