// File: /workspace/github_c_makefile_star2_O3/enzo1982[P]smooth/libraries/libwebp/src/dec/vp8l_dec.c
// Function: VP8LDecodeImage
int VP8LDecodeImage(VP8LDecoder* const dec) {
  VP8Io* io = NULL;
  WebPDecParams* params = NULL;

  if (dec == NULL) return 0;

  assert(dec->hdr_.huffman_tables_.root.start != NULL);
  assert(dec->hdr_.htree_groups_ != NULL);
  assert(dec->hdr_.num_htree_groups_ > 0);

  io = dec->io_;
  assert(io != NULL);
  params = (WebPDecParams*)io->opaque;
  assert(params != NULL);

  // Initialization.
  if (dec->state_ != READ_DATA) {
    dec->output_ = params->output;
    assert(dec->output_ != NULL);

    if (!WebPIoInitFromOptions(params->options, io, MODE_BGRA)) {
      VP8LSetError(dec, VP8_STATUS_INVALID_PARAM);
      goto Err;
    }

    if (!AllocateInternalBuffers32b(dec, io->width)) goto Err;

#if !defined(WEBP_REDUCE_SIZE)
    if (io->use_scaling && !AllocateAndInitRescaler(dec, io)) goto Err;
#else
    if (io->use_scaling) {
      VP8LSetError(dec, VP8_STATUS_INVALID_PARAM);
      goto Err;
    }
#endif
    if (io->use_scaling || WebPIsPremultipliedMode(dec->output_->colorspace)) {
      // need the alpha-multiply functions for premultiplied output or rescaling
      WebPInitAlphaProcessing();
    }

    if (!WebPIsRGBMode(dec->output_->colorspace)) {
      WebPInitConvertARGBToYUV();
      if (dec->output_->u.YUVA.a != NULL) WebPInitAlphaProcessing();
    }
    if (dec->incremental_) {
      if (dec->hdr_.color_cache_size_ > 0 &&
          dec->hdr_.saved_color_cache_.colors_ == NULL) {
        if (!VP8LColorCacheInit(&dec->hdr_.saved_color_cache_,
                                dec->hdr_.color_cache_.hash_bits_)) {
          VP8LSetError(dec, VP8_STATUS_OUT_OF_MEMORY);
          goto Err;
        }
      }
    }
    dec->state_ = READ_DATA;
  }

  // Decode.
  if (!DecodeImageData(dec, dec->pixels_, dec->width_, dec->height_,
                       io->crop_bottom, ProcessRows)) {
    goto Err;
  }

  params->last_y = dec->last_out_row_;
  return 1;

 Err:
  VP8LClear(dec);
  assert(dec->status_ != VP8_STATUS_OK);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorl %ebx, %ebx
testq %rdi, %rdi
je 0xd60db
movq %rdi, %r14
cmpq $0x0, 0xe8(%rdi)
je 0xd60ec
cmpq $0x0, 0xe0(%r14)
je 0xd610b
cmpl $0x0, 0xd8(%r14)
jle 0xd612a
movq 0x8(%r14), %r15
testq %r15, %r15
je 0xd6149
movq 0x38(%r15), %r13
testq %r13, %r13
je 0xd6168
cmpl $0x0, 0x4(%r14)
je 0xd606d
movq (%r13), %rax
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0xd61a6
movq 0x28(%r13), %rdi
movq %r15, %rsi
movl $0x3, %edx
callq 0xce305
testl %eax, %eax
je 0xd60ab
movl (%r15), %esi
movq %r14, %rdi
callq 0xd4884
testl %eax, %eax
je 0xd60c9
cmpl $0x0, 0x88(%r15)
je 0xd6000
movl 0xc(%r15), %eax
movl %eax, 0x10(%rsp)
movl 0x10(%r15), %eax
movl %eax, 0xc(%rsp)
movslq 0x8c(%r15), %rbp
movl 0x90(%r15), %eax
movl %eax, 0x14(%rsp)
movq %rbp, %r12
shlq $0x5, %r12
leaq (%r12,%rbp,4), %rdi
addq $0x68, %rdi
movl $0x1, %esi
callq 0x56b20
testq %rax, %rax
je 0xd60b5
cmpq $0x0, 0x180(%r14)
jne 0xd61c5
movq %rax, 0x180(%r14)
movq %rax, 0x188(%r14)
leaq (%rax,%r12), %rcx
addq $0x68, %rcx
movq %rax, %r10
addq $0x68, %r10
subq $0x8, %rsp
movq %rax, %rdi
movl 0x18(%rsp), %esi
movl 0x14(%rsp), %edx
movl %ebp, %r8d
movl 0x1c(%rsp), %r9d
pushq %r10
pushq $0x4
pushq $0x0
callq 0xce768
addq $0x20, %rsp
testl %eax, %eax
je 0xd60c9
cmpl $0x0, 0x88(%r15)
jne 0xd600e
movq 0x10(%r14), %rax
movl (%rax), %eax
leal -0xb(%rax), %ecx
cmpl $-0x4, %ecx
jb 0xd6019
callq 0xd6da2
movq 0x10(%r14), %rax
movl (%rax), %eax
cmpl $0xb, %eax
jb 0xd6033
callq 0xe091c
movq 0x10(%r14), %rax
cmpq $0x0, 0x28(%rax)
je 0xd6033
callq 0xd6da2
cmpl $0x0, 0x50(%r14)
je 0xd6065
cmpl $0x0, 0x98(%r14)
jle 0xd6065
cmpq $0x0, 0xb0(%r14)
jne 0xd6065
leaq 0xb0(%r14), %rdi
movl 0xac(%r14), %esi
callq 0xf0010
testl %eax, %eax
je 0xd60b5
movl $0x0, 0x4(%r14)
movq 0x18(%r14), %rsi
movl 0x84(%r14), %edx
movl 0x88(%r14), %ecx
movl 0x84(%r15), %r8d
leaq 0x157(%rip), %r9        # 0xd61e4
movq %r14, %rdi
callq 0xd5158
testl %eax, %eax
je 0xd60c9
movl 0x94(%r14), %eax
movl %eax, 0x20(%r13)
movl $0x1, %ebx
jmp 0xd60db
movl (%r14), %ecx
movl $0x2, %eax
jmp 0xd60bd
movl (%r14), %ecx
movl $0x1, %eax
testl %ecx, %ecx
je 0xd60c6
cmpl $0x5, %ecx
jne 0xd60c9
movl %eax, (%r14)
movq %r14, %rdi
callq 0xd3e97
cmpl $0x0, (%r14)
je 0xd6187
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x538fb(%rip), %rdi     # 0x1299ee
leaq 0x537ef(%rip), %rsi     # 0x1298e9
leaq 0x5391a(%rip), %rcx     # 0x129a1b
movl $0x6b0, %edx            # imm = 0x6B0
callq 0x55710
leaq 0x53931(%rip), %rdi     # 0x129a43
leaq 0x537d0(%rip), %rsi     # 0x1298e9
leaq 0x538fb(%rip), %rcx     # 0x129a1b
movl $0x6b1, %edx            # imm = 0x6B1
callq 0x55710
leaq 0x53932(%rip), %rdi     # 0x129a63
leaq 0x537b1(%rip), %rsi     # 0x1298e9
leaq 0x538dc(%rip), %rcx     # 0x129a1b
movl $0x6b2, %edx            # imm = 0x6B2
callq 0x55710
leaq 0x5809e(%rip), %rdi     # 0x12e1ee
leaq 0x53792(%rip), %rsi     # 0x1298e9
leaq 0x538bd(%rip), %rcx     # 0x129a1b
movl $0x6b5, %edx            # imm = 0x6B5
callq 0x55710
leaq 0x52a9b(%rip), %rdi     # 0x128c0a
leaq 0x53773(%rip), %rsi     # 0x1298e9
leaq 0x5389e(%rip), %rcx     # 0x129a1b
movl $0x6b7, %edx            # imm = 0x6B7
callq 0x55710
leaq 0x5380b(%rip), %rdi     # 0x129999
leaq 0x53754(%rip), %rsi     # 0x1298e9
leaq 0x5387f(%rip), %rcx     # 0x129a1b
movl $0x6ee, %edx            # imm = 0x6EE
callq 0x55710
leaq 0x538d6(%rip), %rdi     # 0x129a83
leaq 0x53735(%rip), %rsi     # 0x1298e9
leaq 0x53860(%rip), %rcx     # 0x129a1b
movl $0x6bc, %edx            # imm = 0x6BC
callq 0x55710
leaq 0x54106(%rip), %rdi     # 0x12a2d2
leaq 0x53716(%rip), %rsi     # 0x1298e9
leaq 0x54115(%rip), %rcx     # 0x12a2ef
movl $0x243, %edx            # imm = 0x243
callq 0x55710