void transfer_RGBA8888_to_RGB_FLOAT(float *(*output), unsigned char *input) {
  float opacity = (float)input[3];
  *(*output)++ = (float)*input++ * opacity / 0xff / 0xff;
  *(*output)++ = (float)*input++ * opacity / 0xff / 0xff;
  *(*output)++ = (float)*input * opacity / 0xff / 0xff;
}


x86 assembly (clang, -O0):
<transfer_RGBA8888_to_RGB_FLOAT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
cvtsi2ss %eax,%xmm0
movss  -0x14(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xebc(%rip),%xmm1
divss  %xmm1,%xmm0
divss  %xmm1,%xmm0
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,(%rcx)
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
cvtsi2ss %eax,%xmm0
movss  -0x14(%rbp),%xmm2
mulss  %xmm2,%xmm0
divss  %xmm1,%xmm0
divss  %xmm1,%xmm0
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,(%rcx)
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cvtsi2ss %eax,%xmm0
mulss  -0x14(%rbp),%xmm0
movss  0xe4b(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xe3f(%rip),%xmm1
divss  %xmm1,%xmm0
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,(%rcx)
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<transfer_RGBA8888_to_RGB_FLOAT>:
movzbl 0x3(%rsi),%eax
cvtsi2ss %eax,%xmm0
movzbl (%rsi),%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm0,%xmm1
movss  0xee5(%rip),%xmm2
divss  %xmm2,%xmm1
divss  %xmm2,%xmm1
mov    (%rdi),%rax
lea    0x4(%rax),%rcx
mov    %rcx,(%rdi)
movss  %xmm1,(%rax)
movzbl 0x1(%rsi),%ecx
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
mulss  %xmm0,%xmm1
divss  %xmm2,%xmm1
divss  %xmm2,%xmm1
lea    0x8(%rax),%rcx
mov    %rcx,(%rdi)
movss  %xmm1,0x4(%rax)
movzbl 0x2(%rsi),%ecx
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
mulss  %xmm0,%xmm1
divss  %xmm2,%xmm1
divss  %xmm2,%xmm1
lea    0xc(%rax),%rcx
mov    %rcx,(%rdi)
movss  %xmm1,0x8(%rax)
ret

LLVM IR (-O0):
define void @transfer_RGBA8888_to_RGB_FLOAT(float** %0, i8* %1) {
%3 = alloca float**
%4 = alloca i8*
%5 = alloca float
store float** %0, float*** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 3
%8 = load i8, i8* %7
%9 = uitofp i8 %8 to float
store float %9, float* %5
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
%12 = load i8, i8* %10
%13 = uitofp i8 %12 to float
%14 = load float, float* %5
%15 = fmul float %13, %14
%16 = fdiv float %15, 2.550000e+02
%17 = fdiv float %16, 2.550000e+02
%18 = load float**, float*** %3
%19 = load float*, float** %18
%20 = getelementptr inbounds float, float* %19, i32 1
store float* %20, float** %18
store float %17, float* %19
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %4
%23 = load i8, i8* %21
%24 = uitofp i8 %23 to float
%25 = load float, float* %5
%26 = fmul float %24, %25
%27 = fdiv float %26, 2.550000e+02
%28 = fdiv float %27, 2.550000e+02
%29 = load float**, float*** %3
%30 = load float*, float** %29
%31 = getelementptr inbounds float, float* %30, i32 1
store float* %31, float** %29
store float %28, float* %30
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = uitofp i8 %33 to float
%35 = load float, float* %5
%36 = fmul float %34, %35
%37 = fdiv float %36, 2.550000e+02
%38 = fdiv float %37, 2.550000e+02
%39 = load float**, float*** %3
%40 = load float*, float** %39
%41 = getelementptr inbounds float, float* %40, i32 1
store float* %41, float** %39
store float %38, float* %40
ret void
}

LLVM IR (-O2):
define void @transfer_RGBA8888_to_RGB_FLOAT(float** nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 3
%4 = load i8, i8* %3
%5 = uitofp i8 %4 to float
%6 = getelementptr inbounds i8, i8* %1, i64 1
%7 = load i8, i8* %1
%8 = uitofp i8 %7 to float
%9 = fmul float %5, %8
%10 = fdiv float %9, 2.550000e+02
%11 = fdiv float %10, 2.550000e+02
%12 = load float*, float** %0
%13 = getelementptr inbounds float, float* %12, i64 1
store float* %13, float** %0
store float %11, float* %12
%14 = getelementptr inbounds i8, i8* %1, i64 2
%15 = load i8, i8* %6
%16 = uitofp i8 %15 to float
%17 = fmul float %5, %16
%18 = fdiv float %17, 2.550000e+02
%19 = fdiv float %18, 2.550000e+02
%20 = getelementptr inbounds float, float* %12, i64 2
store float* %20, float** %0
store float %19, float* %13
%21 = load i8, i8* %14
%22 = uitofp i8 %21 to float
%23 = fmul float %5, %22
%24 = fdiv float %23, 2.550000e+02
%25 = fdiv float %24, 2.550000e+02
%26 = getelementptr inbounds float, float* %12, i64 3
store float* %26, float** %0
store float %25, float* %20
ret void
}