LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/utils/rescaler_utils.c
// Function: WebPRescalerGetScaledDimensions
int WebPRescalerGetScaledDimensions(int src_width, int src_height,
                                    int* const scaled_width,
                                    int* const scaled_height) {
  assert(scaled_width != NULL);
  assert(scaled_height != NULL);
  {
    int width = *scaled_width;
    int height = *scaled_height;
    const int max_size = INT_MAX / 2;

    // if width is unspecified, scale original proportionally to height ratio.
    if (width == 0 && src_height > 0) {
      width =
          (int)(((uint64_t)src_width * height + src_height - 1) / src_height);
    }
    // if height is unspecified, scale original proportionally to width ratio.
    if (height == 0 && src_width > 0) {
      height =
          (int)(((uint64_t)src_height * width + src_width - 1) / src_width);
    }
    // Check if the overall dimensions still make sense.
    if (width <= 0 || height <= 0 || width > max_size || height > max_size) {
      return 0;
    }

    *scaled_width = width;
    *scaled_height = height;
    return 1;
  }
}

// Assembly:
pushq %rax
testq %rdx, %rdx
je 0xcf85a
testq %rcx, %rcx
je 0xcf879
movq %rdx, %r8
movl (%rdx), %r9d
movl (%rcx), %r10d
testl %r9d, %r9d
setne %al
testl %esi, %esi
setle %dl
orb %al, %dl
jne 0xcf805
movslq %r10d, %rax
movslq %edi, %rdx
imulq %rax, %rdx
movl %esi, %r9d
leaq (%r9,%rdx), %rax
decq %rax
xorl %edx, %edx
divq %r9
movq %rax, %r9
testl %r10d, %r10d
setne %al
testl %edi, %edi
setle %dl
orb %al, %dl
jne 0xcf82f
movslq %esi, %rax
movslq %r9d, %rdx
imulq %rax, %rdx
movl %edi, %esi
leaq (%rsi,%rdx), %rax
decq %rax
xorl %edx, %edx
divq %rsi
movq %rax, %r10
movl $0xc0000000, %edx       # imm = 0xC0000000
leal (%r9,%rdx), %esi
xorl %eax, %eax
cmpl $0xc0000001, %esi       # imm = 0xC0000001
jb 0xcf858
addl %r10d, %edx
cmpl $0xc0000001, %edx       # imm = 0xC0000001
jb 0xcf858
movl %r9d, (%r8)
movl %r10d, (%rcx)
movl $0x1, %eax
popq %rcx
retq
leaq 0x5a1e5(%rip), %rdi     # 0x129a46
leaq 0x5a1f3(%rip), %rsi     # 0x129a5b
leaq 0x5a207(%rip), %rcx     # 0x129a76
movl $0x58, %edx
callq 0x55710
leaq 0x5a23c(%rip), %rdi     # 0x129abc
leaq 0x5a1d4(%rip), %rsi     # 0x129a5b
leaq 0x5a1e8(%rip), %rcx     # 0x129a76
movl $0x59, %edx
callq 0x55710
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/utils/rescaler_utils.c
// Function: WebPRescalerImport
int WebPRescalerImport(WebPRescaler* const rescaler, int num_lines,
                       const uint8_t* src, int src_stride) {
  int total_imported = 0;
  while (total_imported < num_lines &&
         !WebPRescalerHasPendingOutput(rescaler)) {
    if (rescaler->y_expand) {
      rescaler_t* const tmp = rescaler->irow;
      rescaler->irow = rescaler->frow;
      rescaler->frow = tmp;
    }
    WebPRescalerImportRow(rescaler, src);
    if (!rescaler->y_expand) {    // Accumulate the contribution of the new row.
      int x;
      for (x = 0; x < rescaler->num_channels * rescaler->dst_width; ++x) {
        rescaler->irow[x] += rescaler->frow[x];
      }
    }
    ++rescaler->src_y;
    src += src_stride;
    ++total_imported;
    rescaler->y_accum -= rescaler->y_sub;
  }
  return total_imported;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testl %esi, %esi
jle 0xcf94c
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
movslq %ecx, %r12
xorl %ebx, %ebx
movl 0x40(%r15), %eax
cmpl 0x38(%r15), %eax
jge 0xcf8d9
cmpl $0x0, 0x18(%r15)
jle 0xcf94e
cmpl $0x0, 0x4(%r15)
je 0xcf8f0
movq 0x58(%r15), %rax
movq 0x60(%r15), %rcx
movq %rcx, 0x58(%r15)
movq %rax, 0x60(%r15)
movq %r15, %rdi
movq %r14, %rsi
callq 0xdcb8d
cmpl $0x0, 0x4(%r15)
jne 0xcf933
movl 0x34(%r15), %eax
imull 0x8(%r15), %eax
testl %eax, %eax
jle 0xcf933
movq 0x58(%r15), %rax
movq 0x60(%r15), %rcx
xorl %edx, %edx
movl (%rcx,%rdx,4), %esi
addl %esi, (%rax,%rdx,4)
incq %rdx
movslq 0x8(%r15), %rsi
movslq 0x34(%r15), %rdi
imulq %rsi, %rdi
cmpq %rdi, %rdx
jl 0xcf919
incl 0x3c(%r15)
addq %r12, %r14
incl %ebx
movl 0x20(%r15), %eax
subl %eax, 0x18(%r15)
cmpl %ebp, %ebx
jne 0xcf8c8
movl %ebp, %ebx
jmp 0xcf94e
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/utils/rescaler_utils.c
// Function: WebPRescalerExport
int WebPRescalerExport(WebPRescaler* const rescaler) {
  int total_exported = 0;
  while (WebPRescalerHasPendingOutput(rescaler)) {
    WebPRescalerExportRow(rescaler);
    ++total_exported;
  }
  return total_exported;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x40(%rdi), %eax
xorl %ebx, %ebx
cmpl 0x38(%rdi), %eax
jge 0xcf987
movq %rdi, %r14
xorl %ebx, %ebx
cmpl $0x0, 0x18(%r14)
jg 0xcf987
movq %r14, %rdi
callq 0xdcbcf
incl %ebx
movl 0x40(%r14), %eax
cmpl 0x38(%r14), %eax
jl 0xcf96c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/utils/utils.c
// Function: WebPSafeMalloc
void* WebPSafeMalloc(uint64_t nmemb, size_t size) {
  void* ptr;
  Increment(&num_malloc_calls);
  if (!CheckSizeArgumentsOverflow(nmemb, size)) return NULL;
  assert(nmemb * size > 0);
  ptr = malloc((size_t)(nmemb * size));
  AddMem(ptr, (size_t)(nmemb * size));
  return ptr;
}

// Assembly:
testq %rdi, %rdi
je 0xcf9b0
movabsq $0x400000000, %rax      # imm = 0x400000000
xorl %edx, %edx
divq %rdi
cmpq %rsi, %rax
jae 0xcf9b0
xorl %eax, %eax
retq
imulq %rdi, %rsi
testq %rsi, %rsi
je 0xcf9c1
movq %rsi, %rdi
jmp 0x57ff0
pushq %rax
leaq 0x5a109(%rip), %rdi     # 0x129ad2
leaq 0x5a113(%rip), %rsi     # 0x129ae3
leaq 0x5a11e(%rip), %rcx     # 0x129af5
movl $0xc6, %edx
callq 0x55710
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/utils/utils.c
// Function: WebPSafeCalloc
void* WebPSafeCalloc(uint64_t nmemb, size_t size) {
  void* ptr;
  Increment(&num_calloc_calls);
  if (!CheckSizeArgumentsOverflow(nmemb, size)) return NULL;
  assert(nmemb * size > 0);
  ptr = calloc((size_t)nmemb, size);
  AddMem(ptr, (size_t)(nmemb * size));
  return ptr;
}

// Assembly:
testq %rdi, %rdi
je 0xcf9fd
movabsq $0x400000000, %rax      # imm = 0x400000000
xorl %edx, %edx
divq %rdi
cmpq %rsi, %rax
jae 0xcf9fd
xorl %eax, %eax
retq
movq %rsi, %rax
imulq %rdi, %rax
testq %rax, %rax
je 0xcfa0e
jmp 0x57cd0
pushq %rax
leaq 0x5a0bc(%rip), %rdi     # 0x129ad2
leaq 0x5a0c6(%rip), %rsi     # 0x129ae3
leaq 0x5a0f8(%rip), %rcx     # 0x129b1c
movl $0xd0, %edx
callq 0x55710
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/utils/utils.c
// Function: WebPCopyPlane
void WebPCopyPlane(const uint8_t* src, int src_stride,
                   uint8_t* dst, int dst_stride, int width, int height) {
  assert(src != NULL && dst != NULL);
  assert(abs(src_stride) >= width && abs(dst_stride) >= width);
  while (height-- > 0) {
    memcpy(dst, src, width);
    src += src_stride;
    dst += dst_stride;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xcfab5
movq %rdx, %r14
testq %rdx, %rdx
je 0xcfab5
movl %esi, %edx
negl %edx
cmovsl %esi, %edx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
cmpl %r8d, %edx
jl 0xcfad4
cmpl %r8d, %eax
jl 0xcfad4
movl %r9d, %ebx
testl %r9d, %r9d
jle 0xcfaa6
movq %rdi, %r15
movslq %r8d, %r12
movslq %esi, %r13
movslq %ecx, %rbp
incl %ebx
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x552d0
addq %r13, %r15
addq %rbp, %r14
decl %ebx
cmpl $0x1, %ebx
jg 0xcfa8b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5a087(%rip), %rdi     # 0x129b43
leaq 0x5a020(%rip), %rsi     # 0x129ae3
leaq 0x5a094(%rip), %rcx     # 0x129b5e
movl $0xec, %edx
callq 0x55710
leaq 0x5a0c6(%rip), %rdi     # 0x129ba1
leaq 0x5a001(%rip), %rsi     # 0x129ae3
leaq 0x5a075(%rip), %rcx     # 0x129b5e
movl $0xed, %edx
callq 0x55710
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/utils/utils.c
// Function: WebPCopyPixels
void WebPCopyPixels(const WebPPicture* const src, WebPPicture* const dst) {
  assert(src != NULL && dst != NULL);
  assert(src->width == dst->width && src->height == dst->height);
  assert(src->use_argb && dst->use_argb);
  WebPCopyPlane((uint8_t*)src->argb, 4 * src->argb_stride, (uint8_t*)dst->argb,
                4 * dst->argb_stride, 4 * src->width, src->height);
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0xcfb88
testq %rsi, %rsi
je 0xcfb88
movl 0x8(%rdi), %r8d
cmpl 0x8(%rsi), %r8d
jne 0xcfb4a
movl 0xc(%rdi), %r9d
cmpl 0xc(%rsi), %r9d
jne 0xcfb4a
cmpl $0x0, (%rdi)
je 0xcfb69
cmpl $0x0, (%rsi)
je 0xcfb69
movq 0x48(%rdi), %rax
movl 0x50(%rdi), %r10d
shll $0x2, %r10d
movq 0x48(%rsi), %rdx
movl 0x50(%rsi), %ecx
shll $0x2, %ecx
shll $0x2, %r8d
movq %rax, %rdi
movl %r10d, %esi
popq %rax
jmp 0x582e0
leaq 0x5a0c7(%rip), %rdi     # 0x129c18
leaq 0x59f8b(%rip), %rsi     # 0x129ae3
leaq 0x5a077(%rip), %rcx     # 0x129bd6
movl $0xf7, %edx
callq 0x55710
leaq 0x5a0df(%rip), %rdi     # 0x129c4f
leaq 0x59f6c(%rip), %rsi     # 0x129ae3
leaq 0x5a058(%rip), %rcx     # 0x129bd6
movl $0xf8, %edx
callq 0x55710
leaq 0x59fb4(%rip), %rdi     # 0x129b43
leaq 0x59f4d(%rip), %rsi     # 0x129ae3
leaq 0x5a039(%rip), %rcx     # 0x129bd6
movl $0xf6, %edx
callq 0x55710
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/frame_dec.c
// Function: VP8InitDithering
void VP8InitDithering(const WebPDecoderOptions* const options,
                      VP8Decoder* const dec) {
  assert(dec != NULL);
  if (options != NULL) {
    const int d = options->dithering_strength;
    const int max_amp = (1 << VP8_RANDOM_DITHER_FIX) - 1;
    const int f = (d < 0) ? 0 : (d > 100) ? max_amp : (d * max_amp / 100);
    if (f > 0) {
      int s;
      int all_amp = 0;
      for (s = 0; s < NUM_MB_SEGMENTS; ++s) {
        VP8QuantMatrix* const dqm = &dec->dqm_[s];
        if (dqm->uv_quant_ < DITHER_AMP_TAB_SIZE) {
          const int idx = (dqm->uv_quant_ < 0) ? 0 : dqm->uv_quant_;
          dqm->dither_ = (f * kQuantToDitherAmp[idx]) >> 3;
        }
        all_amp |= dqm->dither_;
      }
      if (all_amp != 0) {
        VP8InitRandom(&dec->dithering_rg_, 1.0f);
        dec->dither_ = 1;
      }
    }
    // potentially allow alpha dithering
    dec->alpha_dithering_ = options->alpha_dithering_strength;
    if (dec->alpha_dithering_ > 100) {
      dec->alpha_dithering_ = 100;
    } else if (dec->alpha_dithering_ < 0) {
      dec->alpha_dithering_ = 0;
    }
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0xcfc89
movq %rdi, %r14
testq %rdi, %rdi
je 0xcfc81
movq %rsi, %rbx
movl 0x2c(%r14), %ecx
testl %ecx, %ecx
js 0xcfbee
movl $0xff, %eax
cmpl $0x64, %ecx
jg 0xcfbf0
movl %ecx, %eax
shll $0x8, %eax
subl %ecx, %eax
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
shrq $0x25, %rax
jmp 0xcfbf0
xorl %eax, %eax
testl %eax, %eax
je 0xcfc61
xorl %ecx, %ecx
leaq 0x5a0b3(%rip), %rdx     # 0x129cb0
xorl %edi, %edi
xorl %esi, %esi
movl 0x43c(%rbx,%rdi), %r8d
cmpl $0xb, %r8d
jg 0xcfc2b
testl %r8d, %r8d
cmovlel %ecx, %r8d
movzbl (%r8,%rdx), %r8d
imull %eax, %r8d
shrl $0x3, %r8d
movl %r8d, 0x440(%rbx,%rdi)
orl 0x440(%rbx,%rdi), %esi
addq $0x20, %rdi
cmpq $0x80, %rdi
jne 0xcfc01
testl %esi, %esi
je 0xcfc61
leaq 0x33c(%rbx), %rdi
movss 0x5a01e(%rip), %xmm0    # 0x129c70
callq 0xf2020
movl $0x1, 0x338(%rbx)
movl 0x34(%r14), %ecx
movl %ecx, 0xbc8(%rbx)
movl $0x64, %eax
cmpl $0x64, %ecx
jg 0xcfc7b
testl %ecx, %ecx
jns 0xcfc81
xorl %eax, %eax
movl %eax, 0xbc8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x5aa1d(%rip), %rdi     # 0x12a6ad
leaq 0x5a028(%rip), %rsi     # 0x129cbf
leaq 0x5a035(%rip), %rcx     # 0x129cd3
movl $0x14a, %edx            # imm = 0x14A
callq 0x55710
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/frame_dec.c
// Function: VP8ExitCritical
int VP8ExitCritical(VP8Decoder* const dec, VP8Io* const io) {
  int ok = 1;
  if (dec->mt_method_ > 0) {
    ok = WebPGetWorkerInterface()->Sync(&dec->worker_);
  }

  if (io->teardown != NULL) {
    io->teardown(io);
  }
  return ok;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
cmpl $0x0, 0xc8(%rdi)
jle 0xd0d1c
movq %rdi, %r14
callq 0x56690
addq $0x98, %r14
movq %r14, %rdi
callq *0x10(%rax)
movl %eax, %ebp
jmp 0xd0d21
movl $0x1, %ebp
movq 0x50(%rbx), %rax
testq %rax, %rax
je 0xd0d2f
movq %rbx, %rdi
callq *%rax
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/frame_dec.c
// Function: VP8GetThreadMethod
int VP8GetThreadMethod(const WebPDecoderOptions* const options,
                       const WebPHeaderStructure* const headers,
                       int width, int height) {
  if (options == NULL || options->use_threads == 0) {
    return 0;
  }
  (void)headers;
  (void)width;
  (void)height;
  assert(headers == NULL || !headers->is_lossless);
#if defined(WEBP_USE_THREAD)
  if (width >= MIN_WIDTH_FOR_THREADS) return 2;
#endif
  return 0;
}

// Assembly:
testq %rdi, %rdi
je 0xd0d4c
testq %rsi, %rsi
je 0xd0d4c
cmpl $0x0, 0x28(%rdi)
je 0xd0d4c
cmpl $0x0, 0x40(%rsi)
jne 0xd0d4f
xorl %eax, %eax
retq
pushq %rax
leaq 0x59022(%rip), %rdi     # 0x129d79
leaq 0x58f61(%rip), %rsi     # 0x129cbf
leaq 0x5903d(%rip), %rcx     # 0x129da2
movl $0x29d, %edx            # imm = 0x29D
callq 0x55710
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/frame_dec.c
// Function: Dither8x8
static void Dither8x8(VP8Random* const rg, uint8_t* dst, int bps, int amp) {
  uint8_t dither[64];
  int i;
  for (i = 0; i < 8 * 8; ++i) {
    dither[i] = VP8RandomBits2(rg, VP8_DITHER_AMP_BITS + 1, amp);
  }
  VP8DitherCombine8x8(dither, dst, bps);
}

// Assembly:
subq $0x48, %rsp
xorl %eax, %eax
xorl %r8d, %r8d
movslq (%rdi), %r9
movl 0x8(%rdi,%r9,4), %r10d
movslq 0x4(%rdi), %r11
subl 0x8(%rdi,%r11,4), %r10d
movl %r10d, %r11d
andl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
movl %r11d, 0x8(%rdi,%r9,4)
movl (%rdi), %r9d
movl 0x4(%rdi), %r11d
incl %r9d
cmpl $0x37, %r9d
cmovel %eax, %r9d
movl %r9d, (%rdi)
incl %r11d
cmpl $0x37, %r11d
cmovel %eax, %r11d
movl %r11d, 0x4(%rdi)
shrl $0x17, %r10d
movsbl %r10b, %r9d
imull %ecx, %r9d
shrl $0x8, %r9d
addb $-0x80, %r9b
movb %r9b, (%rsp,%r8)
incq %r8
cmpq $0x40, %r8
jne 0xd1190
leaq 0xab1c4(%rip), %rax     # 0x17c3c0
movq %rsp, %rdi
callq *(%rax)
addq $0x48, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/io_dec.c
// Function: WebPInitCustomIo
void WebPInitCustomIo(WebPDecParams* const params, VP8Io* const io) {
  io->put      = CustomPut;
  io->setup    = CustomSetup;
  io->teardown = CustomTeardown;
  io->opaque   = params;
}

// Assembly:
leaq 0x1f(%rip), %rax        # 0xd122e
movq %rax, 0x40(%rsi)
leaq 0x7f(%rip), %rax        # 0xd1299
movq %rax, 0x48(%rsi)
leaq 0x688(%rip), %rax       # 0xd18ad
movq %rax, 0x50(%rsi)
movq %rdi, 0x38(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/io_dec.c
// Function: CustomPut
static int CustomPut(const VP8Io* io) {
  WebPDecParams* const p = (WebPDecParams*)io->opaque;
  const int mb_w = io->mb_w;
  const int mb_h = io->mb_h;
  int num_lines_out;
  assert(!(io->mb_y & 1));

  if (mb_w <= 0 || mb_h <= 0) {
    return 0;
  }
  num_lines_out = p->emit(io, p);
  if (p->emit_alpha != NULL) {
    p->emit_alpha(io, p, num_lines_out);
  }
  p->last_y += num_lines_out;
  return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testb $0x1, 0x8(%rdi)
jne 0xd127a
movq %rdi, %rbx
xorl %eax, %eax
cmpl $0x0, 0xc(%rdi)
jle 0xd1275
cmpl $0x0, 0x10(%rbx)
jle 0xd1275
movq 0x38(%rbx), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq *0x58(%r14)
movl %eax, %ebp
movq 0x60(%r14), %rax
testq %rax, %rax
je 0xd126c
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq *%rax
addl %ebp, 0x20(%r14)
movl $0x1, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x58ccf(%rip), %rdi     # 0x129f50
leaq 0x58cd8(%rip), %rsi     # 0x129f60
leaq 0x58ce2(%rip), %rcx     # 0x129f71
movl $0x277, %edx            # imm = 0x277
callq 0x55710
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/io_dec.c
// Function: EmitSampledRGB
static int EmitSampledRGB(const VP8Io* const io, WebPDecParams* const p) {
  WebPDecBuffer* const output = p->output;
  WebPRGBABuffer* const buf = &output->u.RGBA;
  uint8_t* const dst = buf->rgba + (size_t)io->mb_y * buf->stride;
  WebPSamplerProcessPlane(io->y, io->y_stride,
                          io->u, io->v, io->uv_stride,
                          dst, buf->stride, io->mb_w, io->mb_h,
                          WebPSamplers[output->colorspace]);
  return io->mb_h;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rsi), %r10
movslq 0x8(%rdi), %r9
movslq 0x18(%r10), %rax
imulq %rax, %r9
addq 0x10(%r10), %r9
movq 0x18(%rdi), %rdi
movl 0x30(%rbx), %esi
movq 0x20(%rbx), %rdx
movq 0x28(%rbx), %rcx
movl 0x34(%rbx), %r8d
movl 0xc(%rbx), %r11d
movl 0x10(%rbx), %r14d
movl (%r10), %r10d
leaq 0xaaddb(%rip), %r15     # 0x17c6e0
pushq (%r15,%r10,8)
pushq %r14
pushq %r11
pushq %rax
callq 0xe1450
addq $0x20, %rsp
movl 0x10(%rbx), %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/io_dec.c
// Function: EmitYUV
static int EmitYUV(const VP8Io* const io, WebPDecParams* const p) {
  WebPDecBuffer* output = p->output;
  const WebPYUVABuffer* const buf = &output->u.YUVA;
  uint8_t* const y_dst = buf->y + (size_t)io->mb_y * buf->y_stride;
  uint8_t* const u_dst = buf->u + (size_t)(io->mb_y >> 1) * buf->u_stride;
  uint8_t* const v_dst = buf->v + (size_t)(io->mb_y >> 1) * buf->v_stride;
  const int mb_w = io->mb_w;
  const int mb_h = io->mb_h;
  const int uv_w = (mb_w + 1) / 2;
  const int uv_h = (mb_h + 1) / 2;
  WebPCopyPlane(io->y, io->y_stride, y_dst, buf->y_stride, mb_w, mb_h);
  WebPCopyPlane(io->u, io->uv_stride, u_dst, buf->u_stride, uv_w, uv_h);
  WebPCopyPlane(io->v, io->uv_stride, v_dst, buf->v_stride, uv_w, uv_h);
  return io->mb_h;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %r13
movslq 0x8(%rdi), %rax
movslq 0x30(%r13), %rcx
movq %rcx, %rdx
imulq %rax, %rdx
addq 0x10(%r13), %rdx
sarl %eax
cltq
movslq 0x34(%r13), %r15
imulq %rax, %r15
addq 0x18(%r13), %r15
movslq 0x38(%r13), %r14
imulq %rax, %r14
addq 0x20(%r13), %r14
movl 0xc(%rdi), %r8d
movl 0x10(%rdi), %r9d
leal 0x1(%r8), %eax
shrl $0x1f, %eax
leal (%r8,%rax), %ebp
incl %ebp
sarl %ebp
leal 0x1(%r9), %eax
shrl $0x1f, %eax
leal (%r9,%rax), %r12d
incl %r12d
sarl %r12d
movq 0x18(%rdi), %rdi
movl 0x30(%rbx), %esi
callq 0x582e0
movq 0x20(%rbx), %rdi
movl 0x34(%rbx), %esi
movl 0x34(%r13), %ecx
movq %r15, %rdx
movl %ebp, %r8d
movl %r12d, %r9d
callq 0x582e0
movq 0x28(%rbx), %rdi
movl 0x34(%rbx), %esi
movl 0x38(%r13), %ecx
movq %r14, %rdx
movl %ebp, %r8d
movl %r12d, %r9d
callq 0x582e0
movl 0x10(%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/io_dec.c
// Function: EmitAlphaRGBA4444
static int EmitAlphaRGBA4444(const VP8Io* const io, WebPDecParams* const p,
                             int expected_num_lines_out) {
  const uint8_t* alpha = io->a;
  if (alpha != NULL) {
    const int mb_w = io->mb_w;
    const WEBP_CSP_MODE colorspace = p->output->colorspace;
    const WebPRGBABuffer* const buf = &p->output->u.RGBA;
    int num_rows;
    const size_t start_y = GetAlphaSourceRow(io, &alpha, &num_rows);
    uint8_t* const base_rgba = buf->rgba + start_y * buf->stride;
#if (WEBP_SWAP_16BIT_CSP == 1)
    uint8_t* alpha_dst = base_rgba;
#else
    uint8_t* alpha_dst = base_rgba + 1;
#endif
    uint32_t alpha_mask = 0x0f;
    int i, j;
    for (j = 0; j < num_rows; ++j) {
      for (i = 0; i < mb_w; ++i) {
        // Fill in the alpha value (converted to 4 bits).
        const uint32_t alpha_value = alpha[i] >> 4;
        alpha_dst[2 * i] = (alpha_dst[2 * i] & 0xf0) | alpha_value;
        alpha_mask &= alpha_value;
      }
      alpha += io->width;
      alpha_dst += buf->stride;
    }
    (void)expected_num_lines_out;
    assert(expected_num_lines_out == num_rows);
    if (alpha_mask != 0x0f && WebPIsPremultipliedMode(colorspace)) {
      WebPApplyAlphaMultiply4444(base_rgba, mb_w, num_rows, buf->stride);
    }
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x98(%rdi), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0xd1cb8
movq %rdi, %r14
movl %edx, 0x4(%rsp)
movl 0xc(%rdi), %ebx
movq (%rsi), %r13
movl (%r13), %ebp
leaq 0x8(%rsp), %r15
leaq 0x14(%rsp), %r12
movq %r15, %rsi
movq %r12, %rdx
callq 0xd25b8
cltq
movslq 0x18(%r13), %rdi
imulq %rax, %rdi
addq 0x10(%r13), %rdi
movl (%r12), %edx
movq (%r15), %rax
testl %edx, %edx
jle 0xd1c8f
leaq 0x1(%rdi), %rsi
movl $0xf, %ecx
xorl %r8d, %r8d
testl %ebx, %ebx
jle 0xd1c72
xorl %r9d, %r9d
movzbl (%rax,%r9), %r10d
shrl $0x4, %r10d
movb (%rsi,%r9,2), %r11b
andb $-0x10, %r11b
orb %r10b, %r11b
movb %r11b, (%rsi,%r9,2)
andl %r10d, %ecx
incq %r9
cmpq %r9, %rbx
jne 0xd1c4f
movslq (%r14), %r9
addq %r9, %rax
movslq 0x18(%r13), %r9
addq %r9, %rsi
incl %r8d
cmpl %edx, %r8d
jne 0xd1c48
cmpl $0xf, %ecx
sete %cl
jmp 0xd1c91
movb $0x1, %cl
movq %rax, 0x8(%rsp)
cmpl 0x4(%rsp), %edx
jne 0xd1cc9
addl $-0xb, %ebp
cmpl $-0x4, %ebp
setb %al
orb %al, %cl
jne 0xd1cb8
leaq 0xaa560(%rip), %rax     # 0x17c210
movl 0x18(%r13), %ecx
movl %ebx, %esi
callq *(%rax)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x584a5(%rip), %rdi     # 0x12a175
leaq 0x58289(%rip), %rsi     # 0x129f60
leaq 0x584ba(%rip), %rcx     # 0x12a198
movl $0xe4, %edx
callq 0x55710
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/io_dec.c
// Function: EmitAlphaRGB
static int EmitAlphaRGB(const VP8Io* const io, WebPDecParams* const p,
                        int expected_num_lines_out) {
  const uint8_t* alpha = io->a;
  if (alpha != NULL) {
    const int mb_w = io->mb_w;
    const WEBP_CSP_MODE colorspace = p->output->colorspace;
    const int alpha_first =
        (colorspace == MODE_ARGB || colorspace == MODE_Argb);
    const WebPRGBABuffer* const buf = &p->output->u.RGBA;
    int num_rows;
    const size_t start_y = GetAlphaSourceRow(io, &alpha, &num_rows);
    uint8_t* const base_rgba = buf->rgba + start_y * buf->stride;
    uint8_t* const dst = base_rgba + (alpha_first ? 0 : 3);
    const int has_alpha = WebPDispatchAlpha(alpha, io->width, mb_w,
                                            num_rows, dst, buf->stride);
    (void)expected_num_lines_out;
    assert(expected_num_lines_out == num_rows);
    // has_alpha is true if there's non-trivial alpha to premultiply with.
    if (has_alpha && WebPIsPremultipliedMode(colorspace)) {
      WebPApplyAlphaMultiply(base_rgba, alpha_first,
                             mb_w, num_rows, buf->stride);
    }
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x98(%rdi), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0xd1db2
movq %rdi, %r15
movl 0xc(%rdi), %ebp
movq (%rsi), %rbx
movl (%rbx), %r12d
cmpl $0x4, %r12d
sete %al
cmpl $0x9, %r12d
sete %r13b
orb %al, %r13b
leaq 0x10(%rsp), %rsi
leaq 0xc(%rsp), %rax
movl %edx, 0x8(%rsp)
movq %rax, %rdx
callq 0xd25b8
movslq %eax, %r14
movslq 0x18(%rbx), %r9
imulq %r9, %r14
addq 0x10(%rbx), %r14
movl %r13d, %eax
xorb $0x1, %al
movzbl %al, %eax
leaq (%rax,%rax,2), %r8
addq %r14, %r8
leaq 0xaa4b4(%rip), %rax     # 0x17c218
leaq 0x10(%rsp), %rcx
movq (%rcx), %rdi
movl (%r15), %esi
leaq 0xc(%rsp), %rcx
movl (%rcx), %r15d
movl %ebp, 0x4(%rsp)
movl %ebp, %edx
movl %r15d, %ecx
callq *(%rax)
cmpl 0x8(%rsp), %r15d
jne 0xd1dc3
addl $-0xb, %r12d
cmpl $-0x4, %r12d
jb 0xd1db2
testl %eax, %eax
je 0xd1db2
movzbl %r13b, %esi
leaq 0xaa466(%rip), %rax     # 0x17c208
movl 0x18(%rbx), %r8d
movq %r14, %rdi
movl 0x4(%rsp), %edx
movl %r15d, %ecx
callq *(%rax)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x583ab(%rip), %rdi     # 0x12a175
leaq 0x5818f(%rip), %rsi     # 0x129f60
leaq 0x58405(%rip), %rcx     # 0x12a1dd
movl $0xbe, %edx
callq 0x55710
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/io_dec.c
// Function: EmitAlphaYUV
static int EmitAlphaYUV(const VP8Io* const io, WebPDecParams* const p,
                        int expected_num_lines_out) {
  const uint8_t* alpha = io->a;
  const WebPYUVABuffer* const buf = &p->output->u.YUVA;
  const int mb_w = io->mb_w;
  const int mb_h = io->mb_h;
  uint8_t* dst = buf->a + (size_t)io->mb_y * buf->a_stride;
  int j;
  (void)expected_num_lines_out;
  assert(expected_num_lines_out == mb_h);
  if (alpha != NULL) {
    for (j = 0; j < mb_h; ++j) {
      memcpy(dst, alpha, mb_w * sizeof(*dst));
      alpha += io->width;
      dst += buf->a_stride;
    }
  } else if (buf->a != NULL) {
    // the user requested alpha, but there is none, set it to opaque.
    FillAlphaPlane(dst, mb_w, mb_h, buf->a_stride);
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x10(%rdi), %ebp
cmpl %edx, %ebp
jne 0xd1e80
movq %rdi, %r15
movq (%rsi), %r13
movslq 0xc(%rdi), %rbx
movq 0x28(%r13), %rax
movslq 0x8(%rdi), %r14
movslq 0x3c(%r13), %rdx
imulq %rdx, %r14
addq %rax, %r14
movq 0x98(%rdi), %r12
testq %r12, %r12
je 0xd1e46
testl %ebp, %ebp
jle 0xd1e6f
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x552d0
movslq (%r15), %rax
addq %rax, %r12
movslq 0x3c(%r13), %rax
addq %rax, %r14
decl %ebp
jne 0xd1e25
jmp 0xd1e6f
testq %rax, %rax
sete %al
testl %ebp, %ebp
setle %cl
orb %al, %cl
jne 0xd1e6f
movq %rdx, %r15
movq %r14, %rdi
movl $0xff, %esi
movq %rbx, %rdx
callq 0x55f20
addq %r15, %r14
decl %ebp
jne 0xd1e58
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x58396(%rip), %rdi     # 0x12a21d
leaq 0x580d2(%rip), %rsi     # 0x129f60
leaq 0x583a7(%rip), %rcx     # 0x12a23c
movl $0x86, %edx
callq 0x55710
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/io_dec.c
// Function: EmitRescaledAlphaRGB
static int EmitRescaledAlphaRGB(const VP8Io* const io, WebPDecParams* const p,
                                int expected_num_out_lines) {
  if (io->a != NULL) {
    WebPRescaler* const scaler = p->scaler_a;
    int lines_left = expected_num_out_lines;
    const int y_end = p->last_y + lines_left;
    while (lines_left > 0) {
      const int64_t row_offset = (int64_t)scaler->src_y - io->mb_y;
      WebPRescalerImport(scaler, io->mb_h + io->mb_y - scaler->src_y,
                         io->a + row_offset * io->width, io->width);
      lines_left -= p->emit_alpha_row(p, y_end - lines_left, lines_left);
    }
  }
  return 0;
}

// Assembly:
cmpq $0x0, 0x98(%rdi)
je 0xd2142
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
testl %edx, %edx
jle 0xd213a
movq %rsi, %r14
movq %rdi, %r15
movq 0x48(%rsi), %r12
movl 0x20(%rsi), %ebp
addl %ebx, %ebp
movslq 0x3c(%r12), %rax
movslq 0x8(%r15), %rsi
movq %rax, %rdx
subq %rsi, %rdx
subl %eax, %esi
addl 0x10(%r15), %esi
movslq (%r15), %rcx
imulq %rcx, %rdx
addq 0x98(%r15), %rdx
movq %r12, %rdi
callq 0xcf8ab
movl %ebp, %esi
subl %ebx, %esi
movq %r14, %rdi
movl %ebx, %edx
callq *0x68(%r14)
subl %eax, %ebx
jg 0xd20fe
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/io_dec.c
// Function: ExportAlphaRGBA4444
static int ExportAlphaRGBA4444(WebPDecParams* const p, int y_pos,
                               int max_lines_out) {
  const WebPRGBABuffer* const buf = &p->output->u.RGBA;
  uint8_t* const base_rgba = buf->rgba + (size_t)y_pos * buf->stride;
#if (WEBP_SWAP_16BIT_CSP == 1)
  uint8_t* alpha_dst = base_rgba;
#else
  uint8_t* alpha_dst = base_rgba + 1;
#endif
  int num_lines_out = 0;
  const WEBP_CSP_MODE colorspace = p->output->colorspace;
  const int width = p->scaler_a->dst_width;
  const int is_premult_alpha = WebPIsPremultipliedMode(colorspace);
  uint32_t alpha_mask = 0x0f;

  while (WebPRescalerHasPendingOutput(p->scaler_a) &&
         num_lines_out < max_lines_out) {
    int i;
    assert(y_pos + num_lines_out < p->output->height);
    WebPRescalerExportRow(p->scaler_a);
    for (i = 0; i < width; ++i) {
      // Fill in the alpha value (converted to 4 bits).
      const uint32_t alpha_value = p->scaler_a->dst[i] >> 4;
      alpha_dst[2 * i] = (alpha_dst[2 * i] & 0xf0) | alpha_value;
      alpha_mask &= alpha_value;
    }
    alpha_dst += buf->stride;
    ++num_lines_out;
  }
  if (is_premult_alpha && alpha_mask != 0x0f) {
    WebPApplyAlphaMultiply4444(base_rgba, width, num_lines_out, buf->stride);
  }
  return num_lines_out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, 0x4(%rsp)
movl %esi, %r12d
movq %rdi, %r13
movq (%rdi), %rdi
movq 0x48(%r13), %rax
movq 0x10(%rdi), %rcx
movslq %esi, %rdx
movslq 0x18(%rdi), %rsi
imulq %rdx, %rsi
leaq (%rcx,%rsi), %rdx
movq %rdx, 0x10(%rsp)
leaq (%rcx,%rsi), %rbp
incq %rbp
movq %rdi, 0x8(%rsp)
movl (%rdi), %ecx
movl 0x34(%rax), %r15d
addl $-0x7, %ecx
movl %ecx, (%rsp)
movl $0xf, %ebx
xorl %r14d, %r14d
movq 0x48(%r13), %rdi
movl 0x40(%rdi), %eax
cmpl 0x38(%rdi), %eax
jge 0xd21b1
cmpl $0x0, 0x18(%rdi)
setle %al
jmp 0xd21b3
xorl %eax, %eax
testb %al, %al
je 0xd220e
cmpl 0x4(%rsp), %r14d
jge 0xd220e
leal (%r14,%r12), %eax
movq (%r13), %rcx
cmpl 0x8(%rcx), %eax
jge 0xd2247
callq 0xdcbcf
testl %r15d, %r15d
jle 0xd21fd
xorl %eax, %eax
movq 0x48(%r13), %rcx
movq 0x48(%rcx), %rcx
movzbl (%rcx,%rax), %ecx
shrl $0x4, %ecx
movb (%rbp,%rax,2), %dl
andb $-0x10, %dl
orb %cl, %dl
movb %dl, (%rbp,%rax,2)
andl %ecx, %ebx
incq %rax
cmpq %rax, %r15
jne 0xd21d7
movq 0x8(%rsp), %rax
movslq 0x18(%rax), %rax
addq %rax, %rbp
incl %r14d
jmp 0xd219c
cmpl $0x3, (%rsp)
ja 0xd2235
cmpl $0xf, %ebx
je 0xd2235
leaq 0xa9ff0(%rip), %rax     # 0x17c210
movq 0x8(%rsp), %rcx
movl 0x18(%rcx), %ecx
movq 0x10(%rsp), %rdi
movl %r15d, %esi
movl %r14d, %edx
callq *(%rax)
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x57d97(%rip), %rdi     # 0x129fe5
leaq 0x57d0b(%rip), %rsi     # 0x129f60
leaq 0x57e09(%rip), %rcx     # 0x12a065
movl $0x1c7, %edx            # imm = 0x1C7
callq 0x55710
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/io_dec.c
// Function: ExportAlpha
static int ExportAlpha(WebPDecParams* const p, int y_pos, int max_lines_out) {
  const WebPRGBABuffer* const buf = &p->output->u.RGBA;
  uint8_t* const base_rgba = buf->rgba + (size_t)y_pos * buf->stride;
  const WEBP_CSP_MODE colorspace = p->output->colorspace;
  const int alpha_first =
      (colorspace == MODE_ARGB || colorspace == MODE_Argb);
  uint8_t* dst = base_rgba + (alpha_first ? 0 : 3);
  int num_lines_out = 0;
  const int is_premult_alpha = WebPIsPremultipliedMode(colorspace);
  uint32_t non_opaque = 0;
  const int width = p->scaler_a->dst_width;

  while (WebPRescalerHasPendingOutput(p->scaler_a) &&
         num_lines_out < max_lines_out) {
    assert(y_pos + num_lines_out < p->output->height);
    WebPRescalerExportRow(p->scaler_a);
    non_opaque |= WebPDispatchAlpha(p->scaler_a->dst, 0, width, 1, dst, 0);
    dst += buf->stride;
    ++num_lines_out;
  }
  if (is_premult_alpha && non_opaque) {
    WebPApplyAlphaMultiply(base_rgba, alpha_first,
                           width, num_lines_out, buf->stride);
  }
  return num_lines_out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, 0x14(%rsp)
movl %esi, %r14d
movq %rdi, %r15
movq (%rdi), %rdx
movq 0x48(%rdi), %rax
movslq %esi, %rcx
movslq 0x18(%rdx), %rsi
imulq %rcx, %rsi
addq 0x10(%rdx), %rsi
movq %rdx, 0x18(%rsp)
movl (%rdx), %edi
cmpl $0x4, %edi
sete %cl
cmpl $0x9, %edi
sete %dl
orb %cl, %dl
movzbl %dl, %ecx
movl %ecx, 0xc(%rsp)
xorb $0x1, %cl
movzbl %cl, %ecx
leaq (%rcx,%rcx,2), %rbx
movq %rsi, 0x20(%rsp)
addq %rsi, %rbx
addl $-0x7, %edi
movl %edi, 0x10(%rsp)
movl 0x34(%rax), %r12d
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x48(%r15), %rdi
movl 0x40(%rdi), %eax
cmpl 0x38(%rdi), %eax
jge 0xd22e7
cmpl $0x0, 0x18(%rdi)
setle %al
jmp 0xd22e9
xorl %eax, %eax
testb %al, %al
je 0xd2339
cmpl 0x14(%rsp), %r13d
jge 0xd2339
leal (%r14,%r13), %eax
movq (%r15), %rcx
cmpl 0x8(%rcx), %eax
jge 0xd2377
callq 0xdcbcf
movq 0x48(%r15), %rax
movq 0x48(%rax), %rdi
xorl %esi, %esi
movl %r12d, %edx
movl $0x1, %ecx
movq %rbx, %r8
xorl %r9d, %r9d
leaq 0xa9ef4(%rip), %rax     # 0x17c218
callq *(%rax)
orl %eax, %ebp
movq 0x18(%rsp), %rax
movslq 0x18(%rax), %rax
addq %rax, %rbx
incl %r13d
jmp 0xd22d2
cmpl $0x3, 0x10(%rsp)
ja 0xd2365
testl %ebp, %ebp
je 0xd2365
leaq 0xa9ebd(%rip), %rax     # 0x17c208
movq 0x18(%rsp), %rcx
movl 0x18(%rcx), %r8d
movq 0x20(%rsp), %rdi
movl 0xc(%rsp), %esi
movl %r12d, %edx
movl %r13d, %ecx
callq *(%rax)
movl %r13d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x57c67(%rip), %rdi     # 0x129fe5
leaq 0x57bdb(%rip), %rsi     # 0x129f60
leaq 0x57d11(%rip), %rcx     # 0x12a09d
movl $0x1a8, %edx            # imm = 0x1A8
callq 0x55710
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/io_dec.c
// Function: EmitRescaledYUV
static int EmitRescaledYUV(const VP8Io* const io, WebPDecParams* const p) {
  const int mb_h = io->mb_h;
  const int uv_mb_h = (mb_h + 1) >> 1;
  WebPRescaler* const scaler = p->scaler_y;
  int num_lines_out = 0;
  if (WebPIsAlphaMode(p->output->colorspace) && io->a != NULL) {
    // Before rescaling, we premultiply the luma directly into the io->y
    // internal buffer. This is OK since these samples are not used for
    // intra-prediction (the top samples are saved in cache_y_/u_/v_).
    // But we need to cast the const away, though.
    WebPMultRows((uint8_t*)io->y, io->y_stride,
                 io->a, io->width, io->mb_w, mb_h, 0);
  }
  num_lines_out = Rescale(io->y, io->y_stride, mb_h, scaler);
  Rescale(io->u, io->uv_stride, uv_mb_h, p->scaler_u);
  Rescale(io->v, io->uv_stride, uv_mb_h, p->scaler_v);
  return num_lines_out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl 0x10(%rdi), %r15d
movq (%rsi), %rax
movq 0x30(%rsi), %r12
movl (%rax), %eax
cmpl $0xc, %eax
ja 0xd2444
movl $0x103a, %ecx           # imm = 0x103A
btl %eax, %ecx
jae 0xd2444
movq 0x98(%r14), %rdx
testq %rdx, %rdx
je 0xd23f2
movq 0x18(%r14), %rdi
movl 0x30(%r14), %esi
movl (%r14), %ecx
movl 0xc(%r14), %r8d
movl $0x0, (%rsp)
movl %r15d, %r9d
callq 0xd7d35
leal 0x1(%r15), %ebp
sarl %ebp
movq 0x18(%r14), %rdi
movl 0x30(%r14), %esi
movl %r15d, %edx
movq %r12, %rcx
callq 0xd2558
movl %eax, %r15d
movq 0x20(%r14), %rdi
movl 0x34(%r14), %esi
movq 0x38(%rbx), %rcx
movl %ebp, %edx
callq 0xd2558
movq 0x28(%r14), %rdi
movl 0x34(%r14), %esi
movq 0x40(%rbx), %rcx
movl %ebp, %edx
callq 0xd2558
movl %r15d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
addl $-0xb, %eax
cmpl $-0x4, %eax
jae 0xd23c8
jmp 0xd23f2
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/io_dec.c
// Function: EmitRescaledAlphaYUV
static int EmitRescaledAlphaYUV(const VP8Io* const io, WebPDecParams* const p,
                                int expected_num_lines_out) {
  const WebPYUVABuffer* const buf = &p->output->u.YUVA;
  uint8_t* const dst_a = buf->a + (size_t)p->last_y * buf->a_stride;
  if (io->a != NULL) {
    uint8_t* const dst_y = buf->y + (size_t)p->last_y * buf->y_stride;
    const int num_lines_out = Rescale(io->a, io->width, io->mb_h, p->scaler_a);
    assert(expected_num_lines_out == num_lines_out);
    if (num_lines_out > 0) {   // unmultiply the Y
      WebPMultRows(dst_y, buf->y_stride, dst_a, buf->a_stride,
                   p->scaler_a->dst_width, num_lines_out, 1);
    }
  } else if (buf->a != NULL) {
    // the user requested alpha, but there is none, set it to opaque.
    assert(p->last_y + expected_num_lines_out <= io->scaled_height);
    FillAlphaPlane(dst_a, io->scaled_width, expected_num_lines_out,
                   buf->a_stride);
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq (%rsi), %r12
movq 0x28(%r12), %rdx
movslq 0x20(%rsi), %rcx
movslq 0x3c(%r12), %r15
movq %r15, %rbx
imulq %rcx, %rbx
addq %rdx, %rbx
movq 0x98(%rdi), %rax
testq %rax, %rax
je 0xd24da
movq %rsi, %r14
movslq 0x30(%r12), %r15
imulq %rcx, %r15
addq 0x10(%r12), %r15
movl (%rdi), %esi
movl 0x10(%rdi), %edx
movq 0x48(%r14), %rcx
movq %rax, %rdi
callq 0xd2558
cmpl %ebp, %eax
jne 0xd251a
testl %eax, %eax
jle 0xd250b
movl 0x30(%r12), %esi
movl 0x3c(%r12), %ecx
movq 0x48(%r14), %rdx
movl 0x34(%rdx), %r8d
movl $0x1, (%rsp)
movq %r15, %rdi
movq %rbx, %rdx
movl %eax, %r9d
callq 0xd7d35
jmp 0xd250b
testq %rdx, %rdx
je 0xd250b
addl %ebp, %ecx
cmpl 0x90(%rdi), %ecx
jg 0xd2539
testl %ebp, %ebp
jle 0xd250b
movslq 0x8c(%rdi), %r14
movq %rbx, %rdi
movl $0xff, %esi
movq %r14, %rdx
callq 0x55f20
addq %r15, %rbx
decl %ebp
jne 0xd24f4
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x57bac(%rip), %rdi     # 0x12a0cd
leaq 0x57a38(%rip), %rsi     # 0x129f60
leaq 0x57bc6(%rip), %rcx     # 0x12a0f5
movl $0x116, %edx            # imm = 0x116
callq 0x55710
leaq 0x57bfd(%rip), %rdi     # 0x12a13d
leaq 0x57a19(%rip), %rsi     # 0x129f60
leaq 0x57ba7(%rip), %rcx     # 0x12a0f5
movl $0x11d, %edx            # imm = 0x11D
callq 0x55710
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/io_dec.c
// Function: Rescale
static int Rescale(const uint8_t* src, int src_stride,
                   int new_lines, WebPRescaler* const wrk) {
  int num_lines_out = 0;
  while (new_lines > 0) {    // import new contributions of source rows.
    const int lines_in = WebPRescalerImport(wrk, new_lines, src, src_stride);
    src += lines_in * src_stride;
    new_lines -= lines_in;
    num_lines_out += WebPRescalerExport(wrk);    // emit output row(s)
  }
  return num_lines_out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testl %edx, %edx
jle 0xd25a3
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %r12
xorl %r15d, %r15d
movq %rbx, %rdi
movl %ebp, %esi
movq %r12, %rdx
movl %r14d, %ecx
callq 0xcf8ab
movl %eax, %r13d
imull %r14d, %eax
cltq
addq %rax, %r12
movq %rbx, %rdi
callq 0xcf959
addl %eax, %r15d
subl %r13d, %ebp
jg 0xd2575
jmp 0xd25a6
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/io_dec.c
// Function: GetAlphaSourceRow
static int GetAlphaSourceRow(const VP8Io* const io,
                             const uint8_t** alpha, int* const num_rows) {
  int start_y = io->mb_y;
  *num_rows = io->mb_h;

  // Compensate for the 1-line delay of the fancy upscaler.
  // This is similar to EmitFancyRGB().
  if (io->fancy_upsampling) {
    if (start_y == 0) {
      // We don't process the last row yet. It'll be done during the next call.
      --*num_rows;
    } else {
      --start_y;
      // Fortunately, *alpha data is persistent, so we can go back
      // one row and finish alpha blending, now that the fancy upscaler
      // completed the YUV->RGB interpolation.
      *alpha -= io->width;
    }
    if (io->crop_top + io->mb_y + io->mb_h == io->crop_bottom) {
      // If it's the very last call, we process all the remaining rows!
      *num_rows = io->crop_bottom - io->crop_top - start_y;
    }
  }
  return start_y;
}

// Assembly:
movl 0x8(%rdi), %eax
movl 0x10(%rdi), %ecx
movl %ecx, (%rdx)
cmpl $0x0, 0x58(%rdi)
je 0xd25fc
testl %eax, %eax
je 0xd25d4
decl %eax
movslq (%rdi), %rcx
subq %rcx, (%rsi)
jmp 0xd25da
decl %ecx
movl %ecx, (%rdx)
xorl %eax, %eax
movl 0x80(%rdi), %ecx
movl 0x84(%rdi), %esi
movl 0x8(%rdi), %r8d
addl %ecx, %r8d
addl 0x10(%rdi), %r8d
cmpl %esi, %r8d
jne 0xd25fc
addl %eax, %ecx
subl %ecx, %esi
movl %esi, (%rdx)
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/vp8_dec.c
// Function: VP8InitIoInternal
int VP8InitIoInternal(VP8Io* const io, int version) {
  if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_DECODER_ABI_VERSION)) {
    return 0;  // mismatch error
  }
  if (io != NULL) {
    memset(io, 0, sizeof(*io));
  }
  return 1;
}

// Assembly:
pushq %rbx
andl $0xffffff00, %esi       # imm = 0xFFFFFF00
xorl %ebx, %ebx
cmpl $0x200, %esi            # imm = 0x200
jne 0xd262d
movl $0x1, %ebx
testq %rdi, %rdi
je 0xd262d
movl $0xa0, %edx
xorl %esi, %esi
callq 0x55f20
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/vp8_dec.c
// Function: VP8New
VP8Decoder* VP8New(void) {
  VP8Decoder* const dec = (VP8Decoder*)WebPSafeCalloc(1ULL, sizeof(*dec));
  if (dec != NULL) {
    SetOk(dec);
    WebPGetWorkerInterface()->Init(&dec->worker_);
    dec->ready_ = 0;
    dec->num_parts_minus_one_ = 0;
    InitGetCoeffs();
  }
  return dec;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl $0x1, %edi
movl $0xbd0, %esi            # imm = 0xBD0
callq 0x56580
movq %rax, %rbx
testq %rax, %rax
je 0xd26bc
xorl %ebp, %ebp
movl %ebp, (%rbx)
leaq 0x5c8fd(%rip), %rax     # 0x12ef54
movq %rax, 0x8(%rbx)
callq 0x56690
movq %rbx, %rdi
addq $0x98, %rdi
callq *(%rax)
movl %ebp, 0x4(%rbx)
movl %ebp, 0x1b0(%rbx)
movq 0x9ccec(%rip), %rcx     # 0x16f368
movq 0x9a0d5(%rip), %r14     # 0x16c758
movq (%r14), %rax
cmpq %rax, %rcx
je 0xd26bc
testq %rax, %rax
je 0xd26a4
movl $0x2, %edi
callq *%rax
testl %eax, %eax
je 0xd26a4
leaq 0xecd(%rip), %rax       # 0xd356f
jmp 0xd26ab
leaq 0x130f(%rip), %rax      # 0xd39ba
movq %rax, 0xa9b3e(%rip)     # 0x17c1f0
movq (%r14), %rax
movq %rax, 0x9ccac(%rip)     # 0x16f368
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/vp8_dec.c
// Function: VP8Clear
void VP8Clear(VP8Decoder* const dec) {
  if (dec == NULL) {
    return;
  }
  WebPGetWorkerInterface()->End(&dec->worker_);
  WebPDeallocateAlphaMemory(dec);
  WebPSafeFree(dec->mem_);
  dec->mem_ = NULL;
  dec->mem_size_ = 0;
  memset(&dec->br_, 0, sizeof(dec->br_));
  dec->ready_ = 0;
}

// Assembly:
testq %rdi, %rdi
je 0xd2754
pushq %rbx
movq %rdi, %rbx
callq 0x56690
leaq 0x98(%rbx), %rdi
callq *0x28(%rax)
movq %rbx, %rdi
callq 0xf2210
movq 0xb48(%rbx), %rdi
callq 0x57290
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movl $0x0, 0x4(%rbx)
movups %xmm0, 0xb48(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/vp8_dec.c
// Function: VP8SetError
int VP8SetError(VP8Decoder* const dec,
                VP8StatusCode error, const char* const msg) {
  // VP8_STATUS_SUSPENDED is only meaningful in incremental decoding.
  assert(dec->incremental_ || error != VP8_STATUS_SUSPENDED);
  // The oldest error reported takes precedence over the new one.
  if (dec->status_ == VP8_STATUS_OK) {
    dec->status_ = error;
    dec->error_msg_ = msg;
    dec->ready_ = 0;
  }
  return 0;
}

// Assembly:
cmpl $0x5, %esi
jne 0xd2760
cmpl $0x0, 0x40(%rdi)
je 0xd2775
cmpl $0x0, (%rdi)
jne 0xd2772
movl %esi, (%rdi)
movq %rdx, 0x8(%rdi)
movl $0x0, 0x4(%rdi)
xorl %eax, %eax
retq
pushq %rax
leaq 0x57b2d(%rip), %rdi     # 0x12a2aa
leaq 0x57b59(%rip), %rsi     # 0x12a2dd
leaq 0x57b64(%rip), %rcx     # 0x12a2ef
movl $0x5a, %edx
callq 0x55710
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/vp8_dec.c
// Function: VP8GetInfo
int VP8GetInfo(const uint8_t* data, size_t data_size, size_t chunk_size,
               int* const width, int* const height) {
  if (data == NULL || data_size < VP8_FRAME_HEADER_SIZE) {
    return 0;         // not enough data
  }
  // check signature
  if (!VP8CheckSignature(data + 3, data_size - 3)) {
    return 0;         // Wrong signature.
  } else {
    const uint32_t bits = data[0] | (data[1] << 8) | (data[2] << 16);
    const int key_frame = !(bits & 1);
    const int w = ((data[7] << 8) | data[6]) & 0x3fff;
    const int h = ((data[9] << 8) | data[8]) & 0x3fff;

    if (!key_frame) {   // Not a keyframe.
      return 0;
    }

    if (((bits >> 1) & 7) > 3) {
      return 0;         // unknown profile
    }
    if (!((bits >> 4) & 1)) {
      return 0;         // first frame is invisible!
    }
    if (((bits >> 5)) >= chunk_size) {  // partition_length
      return 0;         // inconsistent size information.
    }
    if (w == 0 || h == 0) {
      return 0;         // We don't support both width and height to be zero.
    }

    if (width) {
      *width = w;
    }
    if (height) {
      *height = h;
    }

    return 1;
  }
}

// Assembly:
testq %rdi, %rdi
sete %r9b
cmpq $0xa, %rsi
setb %sil
xorl %eax, %eax
orb %r9b, %sil
jne 0xd2847
cmpb $-0x63, 0x3(%rdi)
jne 0xd2847
cmpb $0x1, 0x4(%rdi)
jne 0xd2847
cmpb $0x2a, 0x5(%rdi)
jne 0xd2847
movzbl (%rdi), %esi
movl %esi, %r9d
andl $0x19, %r9d
cmpl $0x10, %r9d
jne 0xd2847
movzbl 0x1(%rdi), %r9d
shll $0x8, %r9d
movzbl 0x2(%rdi), %r10d
shll $0x10, %r10d
orl %r9d, %r10d
orl %esi, %r10d
shrl $0x5, %r10d
cmpq %rdx, %r10
jae 0xd2847
movzbl 0x7(%rdi), %edx
movzbl 0x6(%rdi), %esi
andl $0x3f, %edx
shll $0x8, %edx
orl %esi, %edx
testl %edx, %edx
je 0xd2847
movzbl 0x9(%rdi), %esi
movzbl 0x8(%rdi), %edi
andl $0x3f, %esi
shll $0x8, %esi
orl %edi, %esi
testl %esi, %esi
je 0xd2847
testq %rcx, %rcx
je 0xd283a
movl %edx, (%rcx)
movl $0x1, %eax
testq %r8, %r8
je 0xd2847
movl %esi, (%r8)
retq
// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/libraries/libwebp/src/dec/vp8_dec.c
// Function: ParseFilterHeader
static int ParseFilterHeader(VP8BitReader* br, VP8Decoder* const dec) {
  VP8FilterHeader* const hdr = &dec->filter_hdr_;
  hdr->simple_    = VP8Get(br, "global-header");
  hdr->level_     = VP8GetValue(br, 6, "global-header");
  hdr->sharpness_ = VP8GetValue(br, 3, "global-header");
  hdr->use_lf_delta_ = VP8Get(br, "global-header");
  if (hdr->use_lf_delta_) {
    if (VP8Get(br, "global-header")) {   // update lf-delta?
      int i;
      for (i = 0; i < NUM_REF_LF_DELTAS; ++i) {
        if (VP8Get(br, "global-header")) {
          hdr->ref_lf_delta_[i] = VP8GetSignedValue(br, 6, "global-header");
        }
      }
      for (i = 0; i < NUM_MODE_LF_DELTAS; ++i) {
        if (VP8Get(br, "global-header")) {
          hdr->mode_lf_delta_[i] = VP8GetSignedValue(br, 6, "global-header");
        }
      }
    }
  }
  dec->filter_type_ = (hdr->level_ == 0) ? 0 : hdr->simple_ ? 1 : 2;
  return !br->eof_;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0x1, %esi
callq 0xf09dd
movl %eax, 0x54(%r14)
movq %rbx, %rdi
movl $0x6, %esi
callq 0xf09dd
movl %eax, 0x58(%r14)
movq %rbx, %rdi
movl $0x3, %esi
callq 0xf09dd
movl %eax, 0x5c(%r14)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf09dd
movl %eax, 0x60(%r14)
testl %eax, %eax
je 0xd2d82
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf09dd
testl %eax, %eax
je 0xd2d82
xorl %r15d, %r15d
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf09dd
testl %eax, %eax
je 0xd2d4a
movq %rbx, %rdi
movl $0x6, %esi
callq 0xf0ada
movl %eax, 0x64(%r14,%r15,4)
incq %r15
cmpq $0x4, %r15
jne 0xd2d27
xorl %r15d, %r15d
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf09dd
testl %eax, %eax
je 0xd2d79
movq %rbx, %rdi
movl $0x6, %esi
callq 0xf0ada
movl %eax, 0x74(%r14,%r15,4)
incq %r15
cmpq $0x4, %r15
jne 0xd2d56
cmpl $0x0, 0x58(%r14)
je 0xd2d95
xorl %eax, %eax
cmpl $0x1, 0x54(%r14)
adcl $0x1, %eax
jmp 0xd2d97
xorl %eax, %eax
movl %eax, 0xb68(%r14)
xorl %eax, %eax
cmpl $0x0, 0x28(%rbx)
sete %al
popq %rbx
popq %r14
popq %r15
retq