// File: /workspace/github_c_makefile_star2_O1/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
pushq %rbx
pushq %rax
cmpl $0xa, %edx
ja 0xdb9c4
movq %rcx, %rbx
movl %esi, %ebp
movq %rdi, %rsi
movl %edx, %eax
leaq 0x510f9(%rip), %rcx     # 0x12c998
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xa0b71(%rip), %rax     # 0x17c420
jmp 0xdb958
testl %ebp, %ebp
jle 0xdb8d2
movslq %ebp, %rax
leaq (%rsi,%rax,4), %rax
movl (%rsi), %ecx
addq $0x4, %rsi
bswapl %ecx
movl %ecx, (%rbx)
addq $0x4, %rbx
cmpq %rax, %rsi
jb 0xdb8bf
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
testl %ebp, %ebp
jle 0xdb8fa
movslq %ebp, %rax
leaq (%rsi,%rax,4), %rax
movq %rbx, %rcx
movl (%rsi), %edx
addq $0x4, %rsi
bswapl %edx
movl %edx, (%rcx)
addq $0x4, %rcx
cmpq %rax, %rsi
jb 0xdb8e7
leaq 0xa0907(%rip), %rax     # 0x17c208
movq (%rax), %rax
movq %rbx, %rdi
movl $0x1, %esi
jmp 0xdb9b2
movq 0xa0b18(%rip), %rax     # 0x17c430
jmp 0xdb958
movslq %ebp, %rdx
shlq $0x2, %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x552d0
movq %rsi, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq *0xa0aeb(%rip)          # 0x17c428
jmp 0xdb9a3
movq 0xa0ae2(%rip), %rax     # 0x17c428
jmp 0xdb958
movq 0xa0ae9(%rip), %rax     # 0x17c438
jmp 0xdb958
movq 0xa0ae8(%rip), %rax     # 0x17c440
movq %rsi, %rdi
movl %ebp, %esi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *%rax
movq %rsi, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq *0xa0ac2(%rip)          # 0x17c438
leaq 0xa0893(%rip), %rax     # 0x17c210
movq (%rax), %rax
movq %rbx, %rdi
movl %ebp, %esi
movl $0x1, %edx
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *%rax
movslq %ebp, %rdx
shlq $0x2, %rdx
movq %rbx, %rdi
callq 0x552d0
leaq 0xa085e(%rip), %rax     # 0x17c208
movq (%rax), %rax
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *%rax
leaq 0x5172f(%rip), %rdi     # 0x12d0fa
leaq 0x51006(%rip), %rsi     # 0x12c9d8
leaq 0x51097(%rip), %rcx     # 0x12ca70
movl $0x237, %edx            # imm = 0x237
callq 0x55710