// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
addq $0x10, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movq -0x18(%rbp), %rdx
movslq 0x8(%rdx), %rdx
imulq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movb $0x1, %al
cmpl $0x4, -0x24(%rbp)
movb %al, -0x41(%rbp)
je 0x141bb0
cmpl $0x9, -0x24(%rbp)
sete %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl -0x28(%rbp), %esi
movl $0x3, %ecx
xorl %edx, %edx
cmpl $0x0, %esi
cmovnel %edx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x24(%rbp), %edi
callq 0x140640
movl %eax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x34(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x141ea0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x42(%rbp)
je 0x141c25
movl -0x34(%rbp), %eax
cmpl -0x10(%rbp), %eax
setl %al
movb %al, -0x42(%rbp)
movb -0x42(%rbp), %al
testb $0x1, %al
jne 0x141c31
jmp 0x141cc4
movl -0xc(%rbp), %eax
addl -0x34(%rbp), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x8(%rcx), %eax
jge 0x141c45
jmp 0x141c64
leaq 0x7b149(%rip), %rdi     # 0x1bcd95
leaq 0x7b0bd(%rip), %rsi     # 0x1bcd10
movl $0x1a8, %edx            # imm = 0x1A8
leaq 0x7b1ee(%rip), %rcx     # 0x1bce4d
callq 0x598a0
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x1511b0
leaq 0xd71f0(%rip), %rax     # 0x218e68
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x48(%rcx), %rcx
movq 0x48(%rcx), %rdi
movl -0x40(%rbp), %edx
movq -0x30(%rbp), %r8
xorl %r9d, %r9d
movl $0x1, %ecx
movl %r9d, %esi
callq *%rax
orl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x30(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x141c00
cmpl $0x0, -0x38(%rbp)
je 0x141cf1
cmpl $0x0, -0x3c(%rbp)
je 0x141cf1
leaq 0xd7181(%rip), %rax     # 0x218e58
movq (%rax), %rax
movq -0x20(%rbp), %rdi
movl -0x28(%rbp), %esi
movl -0x40(%rbp), %edx
movl -0x34(%rbp), %ecx
movq -0x18(%rbp), %r8
movl 0x8(%r8), %r8d
callq *%rax
movl -0x34(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)