// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/vp8_dec.c
// Function: VP8Decode
int VP8Decode(VP8Decoder* const dec, VP8Io* const io) {
  int ok = 0;
  if (dec == NULL) {
    return 0;
  }
  if (io == NULL) {
    return VP8SetError(dec, VP8_STATUS_INVALID_PARAM,
                       "NULL VP8Io parameter in VP8Decode().");
  }

  if (!dec->ready_) {
    if (!VP8GetHeaders(dec, io)) {
      return 0;
    }
  }
  assert(dec->ready_);

  // Finish setting up the decoding parameter. Will call io->setup().
  ok = (VP8EnterCritical(dec, io) == VP8_STATUS_OK);
  if (ok) {   // good to go.
    // Will allocate memory and prepare everything.
    if (ok) ok = VP8InitFrame(dec, io);

    // Main decoding loop
    if (ok) ok = ParseFrame(dec, io);

    // Exit.
    ok &= VP8ExitCritical(dec, io);
  }

  if (!ok) {
    VP8Clear(dec);
    return 0;
  }

  dec->ready_ = 0;
  return ok;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testq %rdi, %rdi
je 0xd350f
movq %rsi, %r15
movq %rdi, %r14
testq %rsi, %rsi
je 0xd339a
cmpl $0x0, 0x4(%r14)
jne 0xd3372
movq %r14, %rdi
movq %r15, %rsi
callq 0xd2848
testl %eax, %eax
je 0xd350f
cmpl $0x0, 0x4(%r14)
je 0xd3550
movq %r14, %rdi
movq %r15, %rsi
callq 0xd0b04
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %cl
je 0xd33bb
movb %cl, %al
jmp 0xd34f7
cmpl $0x0, (%r14)
jne 0xd350f
movq $0x2, (%r14)
leaq 0x5708e(%rip), %rax     # 0x12a440
movq %rax, 0x8(%r14)
jmp 0xd350f
movq %r14, %rdi
movq %r15, %rsi
callq 0xd0d6f
xorl %ebp, %ebp
testl %eax, %eax
je 0xd34ea
movl $0x0, 0xb5c(%r14)
cmpl $0x0, 0x1ac(%r14)
jle 0xd34ac
leaq 0x1b8(%r14), %rax
movq %rax, (%rsp)
leaq 0x10(%r14), %r12
xorl %r13d, %r13d
andl 0x1b0(%r14), %r13d
movq %r12, %rdi
movq %r14, %rsi
callq 0xf2ade
testl %eax, %eax
je 0xd3520
movl 0xb58(%r14), %eax
cmpl 0x198(%r14), %eax
jge 0xd345e
leaq (%r13,%r13,2), %r13
shlq $0x4, %r13
addq (%rsp), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0xd2eb6
testl %eax, %eax
je 0xd34d0
movl 0xb58(%r14), %eax
incl %eax
movl %eax, 0xb58(%r14)
cmpl 0x198(%r14), %eax
jl 0xd3432
movq 0xb10(%r14), %rax
movw $0x0, -0x2(%rax)
xorl %eax, %eax
movl %eax, 0xb00(%r14)
movl %eax, 0xb58(%r14)
movq %r14, %rdi
movq %r15, %rsi
callq 0xcfca8
testl %eax, %eax
je 0xd3538
movl 0xb5c(%r14), %r13d
incl %r13d
movl %r13d, 0xb5c(%r14)
cmpl 0x1ac(%r14), %r13d
jl 0xd33fb
cmpl $0x0, 0xc8(%r14)
jle 0xd34c9
callq 0x56690
leaq 0x98(%r14), %rdi
callq *0x10(%rax)
testl %eax, %eax
je 0xd34ea
movl $0x1, %ebp
jmp 0xd34ea
xorl %ebp, %ebp
cmpl $0x0, (%r14)
jne 0xd34ea
movq $0x7, (%r14)
leaq 0x570a0(%rip), %rax     # 0x12a586
movq %rax, 0x8(%r14)
movq %r14, %rdi
movq %r15, %rsi
callq 0xd0cf3
andl %ebp, %eax
testl %eax, %eax
je 0xd3507
movl $0x0, 0x4(%r14)
movl %eax, %ebx
jmp 0xd350f
movq %r14, %rdi
callq 0xd270a
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
cmpl $0x0, (%r14)
jne 0xd34ea
movq $0x7, (%r14)
leaq 0x57027(%rip), %rax     # 0x12a55d
jmp 0xd34e6
xorl %ebp, %ebp
cmpl $0x0, (%r14)
jne 0xd34ea
movq $0x6, (%r14)
leaq 0x5705b(%rip), %rax     # 0x12a5a9
jmp 0xd34e6
leaq 0x56f0e(%rip), %rdi     # 0x12a465
leaq 0x56d7f(%rip), %rsi     # 0x12a2dd
leaq 0x56f0c(%rip), %rcx     # 0x12a471
movl $0x2b3, %edx            # imm = 0x2B3
callq 0x55710