// File: /workspace/github_c_makefile_star2_O1/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 0xd7118
movq %rdi, %r14
cmpq $0x0, 0xe8(%rdi)
je 0xd7129
cmpq $0x0, 0xe0(%r14)
je 0xd7148
cmpl $0x0, 0xd8(%r14)
jle 0xd7167
movq 0x8(%r14), %r15
testq %r15, %r15
je 0xd7186
movq 0x38(%r15), %r13
testq %r13, %r13
je 0xd71a5
cmpl $0x0, 0x4(%r14)
je 0xd70aa
movq (%r13), %rax
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0xd71e3
movq 0x28(%r13), %rdi
movq %r15, %rsi
movl $0x3, %edx
callq 0xcf20f
testl %eax, %eax
je 0xd70e8
movl (%r15), %esi
movq %r14, %rdi
callq 0xd587c
testl %eax, %eax
je 0xd7106
cmpl $0x0, 0x88(%r15)
je 0xd7035
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 0xd70f2
cmpq $0x0, 0x180(%r14)
jne 0xd7202
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 0xcf6a0
addq $0x20, %rsp
testl %eax, %eax
je 0xd7106
cmpl $0x0, 0x88(%r15)
jne 0xd704d
movq 0x10(%r14), %rax
movl (%rax), %eax
addl $-0xb, %eax
cmpl $-0x4, %eax
jb 0xd7052
callq 0xd7d82
movq 0x10(%r14), %rax
cmpl $0xb, (%rax)
jb 0xd7070
callq 0xe1801
movq 0x10(%r14), %rax
cmpq $0x0, 0x28(%rax)
je 0xd7070
callq 0xd7d82
cmpl $0x0, 0x50(%r14)
je 0xd70a2
cmpl $0x0, 0x98(%r14)
jle 0xd70a2
cmpq $0x0, 0xb0(%r14)
jne 0xd70a2
leaq 0xb0(%r14), %rdi
movl 0xac(%r14), %esi
callq 0xf0de4
testl %eax, %eax
je 0xd70f2
movl $0x0, 0x4(%r14)
movq 0x18(%r14), %rsi
movl 0x84(%r14), %edx
movl 0x88(%r14), %ecx
movl 0x84(%r15), %r8d
leaq 0x157(%rip), %r9        # 0xd7221
movq %r14, %rdi
callq 0xd60a2
testl %eax, %eax
je 0xd7106
movl 0x94(%r14), %eax
movl %eax, 0x20(%r13)
movl $0x1, %ebx
jmp 0xd7118
movl (%r14), %ecx
movl $0x2, %eax
jmp 0xd70fa
movl (%r14), %ecx
movl $0x1, %eax
testl %ecx, %ecx
je 0xd7103
cmpl $0x5, %ecx
jne 0xd7106
movl %eax, (%r14)
movq %r14, %rdi
callq 0xd4e3a
cmpl $0x0, (%r14)
je 0xd71c4
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5368e(%rip), %rdi     # 0x12a7be
leaq 0x53582(%rip), %rsi     # 0x12a6b9
leaq 0x536ad(%rip), %rcx     # 0x12a7eb
movl $0x6b0, %edx            # imm = 0x6B0
callq 0x55710
leaq 0x536c4(%rip), %rdi     # 0x12a813
leaq 0x53563(%rip), %rsi     # 0x12a6b9
leaq 0x5368e(%rip), %rcx     # 0x12a7eb
movl $0x6b1, %edx            # imm = 0x6B1
callq 0x55710
leaq 0x536c5(%rip), %rdi     # 0x12a833
leaq 0x53544(%rip), %rsi     # 0x12a6b9
leaq 0x5366f(%rip), %rcx     # 0x12a7eb
movl $0x6b2, %edx            # imm = 0x6B2
callq 0x55710
leaq 0x57e6d(%rip), %rdi     # 0x12effa
leaq 0x53525(%rip), %rsi     # 0x12a6b9
leaq 0x53650(%rip), %rcx     # 0x12a7eb
movl $0x6b5, %edx            # imm = 0x6B5
callq 0x55710
leaq 0x5283e(%rip), %rdi     # 0x1299ea
leaq 0x53506(%rip), %rsi     # 0x12a6b9
leaq 0x53631(%rip), %rcx     # 0x12a7eb
movl $0x6b7, %edx            # imm = 0x6B7
callq 0x55710
leaq 0x5359e(%rip), %rdi     # 0x12a769
leaq 0x534e7(%rip), %rsi     # 0x12a6b9
leaq 0x53612(%rip), %rcx     # 0x12a7eb
movl $0x6ee, %edx            # imm = 0x6EE
callq 0x55710
leaq 0x53669(%rip), %rdi     # 0x12a853
leaq 0x534c8(%rip), %rsi     # 0x12a6b9
leaq 0x535f3(%rip), %rcx     # 0x12a7eb
movl $0x6bc, %edx            # imm = 0x6BC
callq 0x55710
leaq 0x53eb7(%rip), %rdi     # 0x12b0c0
leaq 0x534a9(%rip), %rsi     # 0x12a6b9
leaq 0x53ec6(%rip), %rcx     # 0x12b0dd
movl $0x243, %edx            # imm = 0x243
callq 0x55710