// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dec/alpha_dec.c
// Function: VP8DecompressAlphaRows
WEBP_NODISCARD const uint8_t* VP8DecompressAlphaRows(VP8Decoder* const dec,
                                                     const VP8Io* const io,
                                                     int row, int num_rows) {
  const int width = io->width;
  const int height = io->crop_bottom;

  assert(dec != NULL && io != NULL);

  if (row < 0 || num_rows <= 0 || row + num_rows > height) {
    return NULL;
  }

  if (!dec->is_alpha_decoded_) {
    if (dec->alph_dec_ == NULL) {    // Initialize decoder.
      dec->alph_dec_ = ALPHNew();
      if (dec->alph_dec_ == NULL) {
        VP8SetError(dec, VP8_STATUS_OUT_OF_MEMORY,
                    "Alpha decoder initialization failed.");
        return NULL;
      }
      if (!AllocateAlphaPlane(dec, io)) goto Error;
      if (!ALPHInit(dec->alph_dec_, dec->alpha_data_, dec->alpha_data_size_,
                    io, dec->alpha_plane_)) {
        VP8LDecoder* const vp8l_dec = dec->alph_dec_->vp8l_dec_;
        VP8SetError(dec,
                    (vp8l_dec == NULL) ? VP8_STATUS_OUT_OF_MEMORY
                                       : vp8l_dec->status_,
                    "Alpha decoder initialization failed.");
        goto Error;
      }
      // if we allowed use of alpha dithering, check whether it's needed at all
      if (dec->alph_dec_->pre_processing_ != ALPHA_PREPROCESSED_LEVELS) {
        dec->alpha_dithering_ = 0;   // disable dithering
      } else {
        num_rows = height - row;     // decode everything in one pass
      }
    }

    assert(dec->alph_dec_ != NULL);
    assert(row + num_rows <= height);
    if (!ALPHDecode(dec, row, num_rows)) goto Error;

    if (dec->is_alpha_decoded_) {   // finished?
      ALPHDelete(dec->alph_dec_);
      dec->alph_dec_ = NULL;
      if (dec->alpha_dithering_ > 0) {
        uint8_t* const alpha = dec->alpha_plane_ + io->crop_top * width
                             + io->crop_left;
        if (!WebPDequantizeLevels(alpha,
                                  io->crop_right - io->crop_left,
                                  io->crop_bottom - io->crop_top,
                                  width, dec->alpha_dithering_)) {
          goto Error;
        }
      }
    }
  }

  // Return a pointer to the current decoded row.
  return dec->alpha_plane_ + row * width;

 Error:
  WebPDeallocateAlphaMemory(dec);
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
movl 0x84(%rax), %eax
movl %eax, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x18483c
cmpq $0x0, -0x18(%rbp)
je 0x18483c
jmp 0x18485b
leaq 0x3d3b2(%rip), %rdi     # 0x1c1bf5
leaq 0x3d365(%rip), %rsi     # 0x1c1baf
movl $0xb5, %edx
leaq 0x3d3b9(%rip), %rcx     # 0x1c1c0f
callq 0x598a0
cmpl $0x0, -0x1c(%rbp)
jl 0x184872
cmpl $0x0, -0x20(%rbp)
jle 0x184872
movl -0x1c(%rbp), %eax
addl -0x20(%rbp), %eax
cmpl -0x28(%rbp), %eax
jle 0x18487f
movq $0x0, -0x8(%rbp)
jmp 0x184b03
movq -0x10(%rbp), %rax
cmpl $0x0, 0xba8(%rax)
jne 0x184ad4
movq -0x10(%rbp), %rax
cmpq $0x0, 0xb90(%rax)
jne 0x1849af
callq 0x184b10
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xb90(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0xb90(%rax)
jne 0x1848e5
movq -0x10(%rbp), %rdi
movl $0x1, %esi
leaq 0x3d393(%rip), %rdx     # 0x1c1c66
callq 0x142580
movq $0x0, -0x8(%rbp)
jmp 0x184b03
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x184b40
cmpl $0x0, %eax
jne 0x1848fc
jmp 0x184af2
movq -0x10(%rbp), %rax
movq 0xb90(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0xb98(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0xba0(%rax), %rdx
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0xbb8(%rax), %r8
callq 0x184c20
cmpl $0x0, %eax
jne 0x184983
movq -0x10(%rbp), %rax
movq 0xb90(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x184962
movl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x18496b
movq -0x30(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rdi
movl -0x44(%rbp), %esi
leaq 0x3d2ed(%rip), %rdx     # 0x1c1c66
callq 0x142580
jmp 0x184af2
movq -0x10(%rbp), %rax
movq 0xb90(%rax), %rax
cmpl $0x1, 0x10(%rax)
je 0x1849a4
movq -0x10(%rbp), %rax
movl $0x0, 0xbc8(%rax)
jmp 0x1849ad
movl -0x28(%rbp), %eax
subl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
jmp 0x1849af
movq -0x10(%rbp), %rax
cmpq $0x0, 0xb90(%rax)
je 0x1849bf
jmp 0x1849de
leaq 0x3d2c5(%rip), %rdi     # 0x1c1c8b
leaq 0x3d1e2(%rip), %rsi     # 0x1c1baf
movl $0xd5, %edx
leaq 0x3d236(%rip), %rcx     # 0x1c1c0f
callq 0x598a0
movl -0x1c(%rbp), %eax
addl -0x20(%rbp), %eax
cmpl -0x28(%rbp), %eax
jg 0x1849eb
jmp 0x184a0a
leaq 0x3ad9c(%rip), %rdi     # 0x1bf78e
leaq 0x3d1b6(%rip), %rsi     # 0x1c1baf
movl $0xd6, %edx
leaq 0x3d20a(%rip), %rcx     # 0x1c1c0f
callq 0x598a0
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x184ec0
cmpl $0x0, %eax
jne 0x184a23
jmp 0x184af2
movq -0x10(%rbp), %rax
cmpl $0x0, 0xba8(%rax)
je 0x184ad2
movq -0x10(%rbp), %rax
movq 0xb90(%rax), %rdi
callq 0x1847c0
movq -0x10(%rbp), %rax
movq $0x0, 0xb90(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0xbc8(%rax)
jle 0x184ad0
movq -0x10(%rbp), %rax
movq 0xbb8(%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x80(%rcx), %ecx
imull -0x24(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq -0x18(%rbp), %rcx
movslq 0x78(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x7c(%rax), %esi
movq -0x18(%rbp), %rax
subl 0x78(%rax), %esi
movq -0x18(%rbp), %rax
movl 0x84(%rax), %edx
movq -0x18(%rbp), %rax
subl 0x80(%rax), %edx
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movl 0xbc8(%rax), %r8d
callq 0x185c30
cmpl $0x0, %eax
jne 0x184ace
jmp 0x184af2
jmp 0x184ad0
jmp 0x184ad2
jmp 0x184ad4
movq -0x10(%rbp), %rax
movq 0xbb8(%rax), %rax
movl -0x1c(%rbp), %ecx
imull -0x24(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x184b03
movq -0x10(%rbp), %rdi
callq 0x184730
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)