// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/lossless.c
// Function: VP8LConvertFromBGRA
void VP8LConvertFromBGRA(const uint32_t* const in_data, int num_pixels,
                         WEBP_CSP_MODE out_colorspace, uint8_t* const rgba) {
  switch (out_colorspace) {
    case MODE_RGB:
      VP8LConvertBGRAToRGB(in_data, num_pixels, rgba);
      break;
    case MODE_RGBA:
      VP8LConvertBGRAToRGBA(in_data, num_pixels, rgba);
      break;
    case MODE_rgbA:
      VP8LConvertBGRAToRGBA(in_data, num_pixels, rgba);
      WebPApplyAlphaMultiply(rgba, 0, num_pixels, 1, 0);
      break;
    case MODE_BGR:
      VP8LConvertBGRAToBGR(in_data, num_pixels, rgba);
      break;
    case MODE_BGRA:
      CopyOrSwap(in_data, num_pixels, rgba, 1);
      break;
    case MODE_bgrA:
      CopyOrSwap(in_data, num_pixels, rgba, 1);
      WebPApplyAlphaMultiply(rgba, 0, num_pixels, 1, 0);
      break;
    case MODE_ARGB:
      CopyOrSwap(in_data, num_pixels, rgba, 0);
      break;
    case MODE_Argb:
      CopyOrSwap(in_data, num_pixels, rgba, 0);
      WebPApplyAlphaMultiply(rgba, 1, num_pixels, 1, 0);
      break;
    case MODE_RGBA_4444:
      VP8LConvertBGRAToRGBA4444(in_data, num_pixels, rgba);
      break;
    case MODE_rgbA_4444:
      VP8LConvertBGRAToRGBA4444(in_data, num_pixels, rgba);
      WebPApplyAlphaMultiply4444(rgba, num_pixels, 1, 0);
      break;
    case MODE_RGB_565:
      VP8LConvertBGRAToRGB565(in_data, num_pixels, rgba);
      break;
    default:
      assert(0);          // Code flow should not reach here.
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movl -0x10(%rbp), %eax
movq %rax, -0x20(%rbp)
subq $0xa, %rax
ja 0x14f663
movq -0x20(%rbp), %rax
leaq 0x7037a(%rip), %rcx     # 0x1bf85c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xc9b7e(%rip), %rax     # 0x219070
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq *%rax
jmp 0x14f682
movq 0xc9b6d(%rip), %rax     # 0x219078
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq *%rax
jmp 0x14f682
movq 0xc9b54(%rip), %rax     # 0x219078
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq *%rax
leaq 0xc9920(%rip), %rax     # 0x218e58
movq (%rax), %rax
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %edx
xorl %r8d, %r8d
movl $0x1, %ecx
movl %r8d, %esi
callq *%rax
jmp 0x14f682
movq 0xc9b25(%rip), %rax     # 0x219080
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq *%rax
jmp 0x14f682
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movl $0x1, %ecx
callq 0x14f690
jmp 0x14f682
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movl $0x1, %ecx
callq 0x14f690
leaq 0xc98b5(%rip), %rax     # 0x218e58
movq (%rax), %rax
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %edx
xorl %r8d, %r8d
movl $0x1, %ecx
movl %r8d, %esi
callq *%rax
jmp 0x14f682
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
xorl %ecx, %ecx
callq 0x14f690
jmp 0x14f682
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
xorl %ecx, %ecx
callq 0x14f690
leaq 0xc9869(%rip), %rax     # 0x218e58
movq (%rax), %rax
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %edx
movl $0x1, %ecx
xorl %r8d, %r8d
movl %ecx, %esi
callq *%rax
jmp 0x14f682
movq 0xc9a7a(%rip), %rax     # 0x219088
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq *%rax
jmp 0x14f682
movq 0xc9a64(%rip), %rax     # 0x219088
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq *%rax
leaq 0xc9828(%rip), %rax     # 0x218e60
movq (%rax), %rax
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq *%rax
jmp 0x14f682
movq 0xc9a3c(%rip), %rax     # 0x219090
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq *%rax
jmp 0x14f682
leaq 0x70956(%rip), %rdi     # 0x1bffc0
leaq 0x7022d(%rip), %rsi     # 0x1bf89e
movl $0x237, %edx            # imm = 0x237
leaq 0x702b9(%rip), %rcx     # 0x1bf936
callq 0x598a0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)