// File: /workspace/github_c_makefile_star2_O2/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 0xcde7d
movq %rdi, %r14
cmpq $0x0, 0xe8(%rdi)
je 0xcde8e
cmpq $0x0, 0xe0(%r14)
je 0xcdead
cmpl $0x0, 0xd8(%r14)
jle 0xcdecc
movq 0x8(%r14), %r15
testq %r15, %r15
je 0xcdeeb
movq 0x38(%r15), %r13
testq %r13, %r13
je 0xcdf0a
cmpl $0x0, 0x4(%r14)
je 0xcde16
movq (%r13), %rax
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0xcdf48
movq 0x28(%r13), %rdi
pushq $0x3
popq %rdx
movq %r15, %rsi
callq 0xc772c
testl %eax, %eax
je 0xcde52
movl (%r15), %esi
movq %r14, %rdi
callq 0xccbef
testl %eax, %eax
je 0xcde6b
cmpl $0x0, 0x88(%r15)
je 0xcddac
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
pushq $0x1
popq %rsi
callq 0x57c90
testq %rax, %rax
je 0xcde59
cmpq $0x0, 0x180(%r14)
jne 0xcdf67
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 0xc78d0
addq $0x20, %rsp
testl %eax, %eax
je 0xcde6b
cmpl $0x0, 0x88(%r15)
jne 0xcddba
movq 0x10(%r14), %rax
movl (%rax), %eax
leal -0xb(%rax), %ecx
cmpl $-0x4, %ecx
jb 0xcddc5
callq 0xcead0
movq 0x10(%r14), %rax
movl (%rax), %eax
cmpl $0xb, %eax
jb 0xcdddf
callq 0xd597d
movq 0x10(%r14), %rax
cmpq $0x0, 0x28(%rax)
je 0xcdddf
callq 0xcead0
cmpl $0x0, 0x50(%r14)
je 0xcde11
cmpl $0x0, 0x98(%r14)
jle 0xcde11
cmpq $0x0, 0xb0(%r14)
jne 0xcde11
leaq 0xb0(%r14), %rdi
movl 0xac(%r14), %esi
callq 0xe0a70
testl %eax, %eax
je 0xcde59
andl $0x0, 0x4(%r14)
movq 0x18(%r14), %rsi
movl 0x84(%r14), %edx
movl 0x88(%r14), %ecx
movl 0x84(%r15), %r8d
leaq 0x150(%rip), %r9        # 0xcdf86
movq %r14, %rdi
callq 0xcd1a4
testl %eax, %eax
je 0xcde6b
movl 0x94(%r14), %eax
movl %eax, 0x20(%r13)
pushq $0x1
popq %rbx
jmp 0xcde7d
movl (%r14), %ecx
pushq $0x2
jmp 0xcde5e
movl (%r14), %ecx
pushq $0x1
popq %rax
testl %ecx, %ecx
je 0xcde68
cmpl $0x5, %ecx
jne 0xcde6b
movl %eax, (%r14)
movq %r14, %rdi
callq 0xcc2e0
cmpl $0x0, (%r14)
je 0xcdf29
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4b889(%rip), %rdi     # 0x11971e
leaq 0x4b77d(%rip), %rsi     # 0x119619
leaq 0x4b8a8(%rip), %rcx     # 0x11974b
movl $0x6b0, %edx            # imm = 0x6B0
callq 0x56770
leaq 0x4b8bf(%rip), %rdi     # 0x119773
leaq 0x4b75e(%rip), %rsi     # 0x119619
leaq 0x4b889(%rip), %rcx     # 0x11974b
movl $0x6b1, %edx            # imm = 0x6B1
callq 0x56770
leaq 0x4b8c0(%rip), %rdi     # 0x119793
leaq 0x4b73f(%rip), %rsi     # 0x119619
leaq 0x4b86a(%rip), %rcx     # 0x11974b
movl $0x6b2, %edx            # imm = 0x6B2
callq 0x56770
leaq 0x50068(%rip), %rdi     # 0x11df5a
leaq 0x4b720(%rip), %rsi     # 0x119619
leaq 0x4b84b(%rip), %rcx     # 0x11974b
movl $0x6b5, %edx            # imm = 0x6B5
callq 0x56770
leaq 0x4aa33(%rip), %rdi     # 0x118944
leaq 0x4b701(%rip), %rsi     # 0x119619
leaq 0x4b82c(%rip), %rcx     # 0x11974b
movl $0x6b7, %edx            # imm = 0x6B7
callq 0x56770
leaq 0x4b799(%rip), %rdi     # 0x1196c9
leaq 0x4b6e2(%rip), %rsi     # 0x119619
leaq 0x4b80d(%rip), %rcx     # 0x11974b
movl $0x6ee, %edx            # imm = 0x6EE
callq 0x56770
leaq 0x4b864(%rip), %rdi     # 0x1197b3
leaq 0x4b6c3(%rip), %rsi     # 0x119619
leaq 0x4b7ee(%rip), %rcx     # 0x11974b
movl $0x6bc, %edx            # imm = 0x6BC
callq 0x56770
leaq 0x4c094(%rip), %rdi     # 0x11a002
leaq 0x4b6a4(%rip), %rsi     # 0x119619
leaq 0x4c0a3(%rip), %rcx     # 0x11a01f
movl $0x243, %edx            # imm = 0x243
callq 0x56770