// File: /workspace/github_c_makefile_star2_O0/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
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 -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x34(%rax), %eax
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %edi
callq 0x140640
movl %eax, -0x38(%rbp)
movl $0xf, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x141ea0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x45(%rbp)
je 0x141a43
movl -0x2c(%rbp), %eax
cmpl -0x10(%rbp), %eax
setl %al
movb %al, -0x45(%rbp)
movb -0x45(%rbp), %al
testb $0x1, %al
jne 0x141a4f
jmp 0x141b18
movl -0xc(%rbp), %eax
addl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x8(%rcx), %eax
jge 0x141a63
jmp 0x141a82
leaq 0x7b32b(%rip), %rdi     # 0x1bcd95
leaq 0x7b29f(%rip), %rsi     # 0x1bcd10
movl $0x1c7, %edx            # imm = 0x1C7
leaq 0x7b398(%rip), %rcx     # 0x1bce15
callq 0x598a0
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x1511b0
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x141af5
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x48(%rax), %rax
movslq -0x40(%rbp), %rcx
movzbl (%rax,%rcx), %eax
sarl $0x4, %eax
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rax
movl -0x40(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
andl $0xf0, %eax
orl -0x44(%rbp), %eax
movb %al, %dl
movq -0x28(%rbp), %rax
movl -0x40(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x44(%rbp), %eax
andl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x141a96
movq -0x18(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x28(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x141a1e
cmpl $0x0, -0x38(%rbp)
je 0x141b41
cmpl $0xf, -0x3c(%rbp)
je 0x141b41
leaq 0xd7335(%rip), %rax     # 0x218e60
movq (%rax), %rax
movq -0x20(%rbp), %rdi
movl -0x34(%rbp), %esi
movl -0x2c(%rbp), %edx
movq -0x18(%rbp), %rcx
movl 0x8(%rcx), %ecx
callq *%rax
movl -0x2c(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)