void transfer_RGB888_to_RGBA_FLOAT(float *(*output), unsigned char *input) {
  *(*output)++ = (float)*input++ / 0xff;
  *(*output)++ = (float)*input++ / 0xff;
  *(*output)++ = (float)*input / 0xff;
  *(*output)++ = 1.0;
}


x86 assembly (clang, -O0):
<transfer_RGB888_to_RGBA_FLOAT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
cvtsi2ss %eax,%xmm0
movss  0xeda(%rip),%xmm1
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
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
movss  0xe7f(%rip),%xmm1
divss  %xmm1,%xmm0
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,(%rcx)
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,(%rcx)
movss  0xe49(%rip),%xmm0
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<transfer_RGB888_to_RGBA_FLOAT>:
movzbl (%rsi),%eax
cvtsi2ss %eax,%xmm0
movss  0xef1(%rip),%xmm1
divss  %xmm1,%xmm0
mov    (%rdi),%rax
lea    0x4(%rax),%rcx
mov    %rcx,(%rdi)
movss  %xmm0,(%rax)
movzbl 0x1(%rsi),%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
divss  %xmm1,%xmm0
lea    0x8(%rax),%rcx
mov    %rcx,(%rdi)
movss  %xmm0,0x4(%rax)
movzbl 0x2(%rsi),%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,0x8(%rax)
lea    0x10(%rax),%rcx
mov    %rcx,(%rdi)
movl   $0x3f800000,0xc(%rax)
ret

LLVM IR (-O0):
define void @transfer_RGB888_to_RGBA_FLOAT(float** %0, i8* %1) {
%3 = alloca float**
%4 = alloca i8*
store float** %0, float*** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %4
%7 = load i8, i8* %5
%8 = uitofp i8 %7 to float
%9 = fdiv float %8, 2.550000e+02
%10 = load float**, float*** %3
%11 = load float*, float** %10
%12 = getelementptr inbounds float, float* %11, i32 1
store float* %12, float** %10
store float %9, float* %11
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %4
%15 = load i8, i8* %13
%16 = uitofp i8 %15 to float
%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 = load i8, i8* %21
%23 = uitofp i8 %22 to float
%24 = fdiv float %23, 2.550000e+02
%25 = load float**, float*** %3
%26 = load float*, float** %25
%27 = getelementptr inbounds float, float* %26, i32 1
store float* %27, float** %25
store float %24, float* %26
%28 = load float**, float*** %3
%29 = load float*, float** %28
%30 = getelementptr inbounds float, float* %29, i32 1
store float* %30, float** %28
store float 1.000000e+00, float* %29
ret void
}

LLVM IR (-O2):
define void @transfer_RGB888_to_RGBA_FLOAT(float** nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = load i8, i8* %1
%5 = uitofp i8 %4 to float
%6 = fdiv float %5, 2.550000e+02
%7 = load float*, float** %0
%8 = getelementptr inbounds float, float* %7, i64 1
store float* %8, float** %0
store float %6, float* %7
%9 = getelementptr inbounds i8, i8* %1, i64 2
%10 = load i8, i8* %3
%11 = uitofp i8 %10 to float
%12 = fdiv float %11, 2.550000e+02
%13 = getelementptr inbounds float, float* %7, i64 2
store float* %13, float** %0
store float %12, float* %8
%14 = load i8, i8* %9
%15 = uitofp i8 %14 to float
%16 = fdiv float %15, 2.550000e+02
%17 = getelementptr inbounds float, float* %7, i64 3
store float %16, float* %13
%18 = getelementptr inbounds float, float* %7, i64 4
store float* %18, float** %0
store float 1.000000e+00, float* %17
ret void
}