// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dec/webp_dec.c
// Function: DecodeInto
WEBP_NODISCARD static VP8StatusCode DecodeInto(const uint8_t* const data,
                                               size_t data_size,
                                               WebPDecParams* const params) {
  VP8StatusCode status;
  VP8Io io;
  WebPHeaderStructure headers;

  headers.data = data;
  headers.data_size = data_size;
  headers.have_all_data = 1;
  status = WebPParseHeaders(&headers);   // Process Pre-VP8 chunks.
  if (status != VP8_STATUS_OK) {
    return status;
  }

  assert(params != NULL);
  if (!VP8InitIo(&io)) {
    return VP8_STATUS_INVALID_PARAM;
  }
  io.data = headers.data + headers.offset;
  io.data_size = headers.data_size - headers.offset;
  WebPInitCustomIo(params, &io);  // Plug the I/O functions.

  if (!headers.is_lossless) {
    VP8Decoder* const dec = VP8New();
    if (dec == NULL) {
      return VP8_STATUS_OUT_OF_MEMORY;
    }
    dec->alpha_data_ = headers.alpha_data;
    dec->alpha_data_size_ = headers.alpha_data_size;

    // Decode bitstream header, update io->width/io->height.
    if (!VP8GetHeaders(dec, &io)) {
      status = dec->status_;   // An error occurred. Grab error status.
    } else {
      // Allocate/check output buffers.
      status = WebPAllocateDecBuffer(io.width, io.height, params->options,
                                     params->output);
      if (status == VP8_STATUS_OK) {  // Decode
        // This change must be done before calling VP8Decode()
        dec->mt_method_ = VP8GetThreadMethod(params->options, &headers,
                                             io.width, io.height);
        VP8InitDithering(params->options, dec);
        if (!VP8Decode(dec, &io)) {
          status = dec->status_;
        }
      }
    }
    VP8Delete(dec);
  } else {
    VP8LDecoder* const dec = VP8LNew();
    if (dec == NULL) {
      return VP8_STATUS_OUT_OF_MEMORY;
    }
    if (!VP8LDecodeHeader(dec, &io)) {
      status = dec->status_;   // An error occurred. Grab error status.
    } else {
      // Allocate/check output buffers.
      status = WebPAllocateDecBuffer(io.width, io.height, params->options,
                                     params->output);
      if (status == VP8_STATUS_OK) {  // Decode
        if (!VP8LDecodeImage(dec)) {
          status = dec->status_;
        }
      }
    }
    VP8LDelete(dec);
  }

  if (status != VP8_STATUS_OK) {
    WebPFreeDecBuffer(params->output);
  } else {
    if (params->options != NULL && params->options->flip) {
      // This restores the original stride values if options->flip was used
      // during the call to WebPAllocateDecBuffer above.
      status = WebPFlipBuffer(params->output);
    }
  }
  return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x108(%rbp)
movl $0x1, -0x100(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x13b4e0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x13be07
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x13c089
cmpq $0x0, -0x20(%rbp)
je 0x13be10
jmp 0x13be2f
leaq 0x80856(%rip), %rdi     # 0x1bc66d
leaq 0x80435(%rip), %rsi     # 0x1bc253
movl $0x1d1, %edx            # imm = 0x1D1
leaq 0x80852(%rip), %rcx     # 0x1bc67c
callq 0x598a0
leaq -0xc8(%rbp), %rdi
callq 0x13d390
cmpl $0x0, %eax
jne 0x13be4c
movl $0x2, -0x4(%rbp)
jmp 0x13c089
movq -0x110(%rbp), %rax
addq -0xf8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x108(%rbp), %rax
subq -0xf8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x140200
cmpl $0x0, -0xd0(%rbp)
jne 0x13bfa7
callq 0x142360
movq %rax, -0x118(%rbp)
cmpq $0x0, -0x118(%rbp)
jne 0x13beaf
movl $0x1, -0x4(%rbp)
jmp 0x13c089
movq -0xf0(%rbp), %rcx
movq -0x118(%rbp), %rax
movq %rcx, 0xb98(%rax)
movq -0xe8(%rbp), %rcx
movq -0x118(%rbp), %rax
movq %rcx, 0xba0(%rax)
movq -0x118(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x1427d0
cmpl $0x0, %eax
jne 0x13bf02
movq -0x118(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
jmp 0x13bf96
movl -0xc8(%rbp), %edi
movl -0xc4(%rbp), %esi
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rdx
movq -0x20(%rbp), %rax
movq (%rax), %rcx
callq 0x13a880
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x13bf94
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rdi
movl -0xc8(%rbp), %edx
movl -0xc4(%rbp), %ecx
leaq -0x110(%rbp), %rsi
callq 0x13f250
movl %eax, %ecx
movq -0x118(%rbp), %rax
movl %ecx, 0xc8(%rax)
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x118(%rbp), %rsi
callq 0x13de50
movq -0x118(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x143a00
cmpl $0x0, %eax
jne 0x13bf92
movq -0x118(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
jmp 0x13bf94
jmp 0x13bf96
movq -0x118(%rbp), %rdi
callq 0x1424c0
jmp 0x13c045
callq 0x144f40
movq %rax, -0x120(%rbp)
cmpq $0x0, -0x120(%rbp)
jne 0x13bfc9
movl $0x1, -0x4(%rbp)
jmp 0x13c089
movq -0x120(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x146750
cmpl $0x0, %eax
jne 0x13bfef
movq -0x120(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
jmp 0x13c039
movl -0xc8(%rbp), %edi
movl -0xc4(%rbp), %esi
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rdx
movq -0x20(%rbp), %rax
movq (%rax), %rcx
callq 0x13a880
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x13c037
movq -0x120(%rbp), %rdi
callq 0x146880
cmpl $0x0, %eax
jne 0x13c035
movq -0x120(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
jmp 0x13c037
jmp 0x13c039
movq -0x120(%rbp), %rdi
callq 0x145130
cmpl $0x0, -0x24(%rbp)
je 0x13c059
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x5c520
jmp 0x13c083
movq -0x20(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x13c081
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
cmpl $0x0, 0x30(%rax)
je 0x13c081
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x13a6f0
movl %eax, -0x24(%rbp)
jmp 0x13c083
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw %cs:(%rax,%rax)