#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
void transfer_RGB161616_to_RGB_FLOAT(float *(*output), uint16_t *input) {
  *(*output)++ = (float)*input++ / 0xffff;
  *(*output)++ = (float)*input++ / 0xffff;
  *(*output)++ = (float)*input / 0xffff;
}


x86 assembly (clang, -O0):
<transfer_RGB161616_to_RGB_FLOAT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cvtsi2ssq (%rax),%xmm0
movss  0xed8(%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    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cvtsi2ssq (%rax),%xmm0
movss  0xea3(%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
cvtsi2ssq (%rax),%xmm0
movss  0xe79(%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_RGB161616_to_RGB_FLOAT>:
cvtsi2ssq (%rsi),%xmm0
movss  0xef3(%rip),%xmm1
divss  %xmm1,%xmm0
mov    (%rdi),%rax
movss  %xmm0,(%rax)
xorps  %xmm0,%xmm0
cvtsi2ssq 0x8(%rsi),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,0x4(%rax)
xorps  %xmm0,%xmm0
cvtsi2ssq 0x10(%rsi),%xmm0
divss  %xmm1,%xmm0
lea    0xc(%rax),%rcx
mov    %rcx,(%rdi)
movss  %xmm0,0x8(%rax)
ret

LLVM IR (-O0):
define void @transfer_RGB161616_to_RGB_FLOAT(float** %0, i64* %1) {
%3 = alloca float**
%4 = alloca i64*
store float** %0, float*** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i32 1
store i64* %6, i64** %4
%7 = load i64, i64* %5
%8 = sitofp i64 %7 to float
%9 = fdiv float %8, 6.553500e+04
%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 i64*, i64** %4
%14 = getelementptr inbounds i64, i64* %13, i32 1
store i64* %14, i64** %4
%15 = load i64, i64* %13
%16 = sitofp i64 %15 to float
%17 = fdiv float %16, 6.553500e+04
%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 i64*, i64** %4
%22 = load i64, i64* %21
%23 = sitofp i64 %22 to float
%24 = fdiv float %23, 6.553500e+04
%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
ret void
}

LLVM IR (-O2):
define void @transfer_RGB161616_to_RGB_FLOAT(float** nocapture %0, i64* nocapture %1) {
%3 = getelementptr inbounds i64, i64* %1, i64 1
%4 = load i64, i64* %1
%5 = sitofp i64 %4 to float
%6 = fdiv float %5, 6.553500e+04
%7 = load float*, float** %0
%8 = getelementptr inbounds float, float* %7, i64 1
store float %6, float* %7
%9 = getelementptr inbounds i64, i64* %1, i64 2
%10 = load i64, i64* %3
%11 = sitofp i64 %10 to float
%12 = fdiv float %11, 6.553500e+04
%13 = getelementptr inbounds float, float* %7, i64 2
store float %12, float* %8
%14 = load i64, i64* %9
%15 = sitofp i64 %14 to float
%16 = fdiv float %15, 6.553500e+04
%17 = getelementptr inbounds float, float* %7, i64 3
store float* %17, float** %0
store float %16, float* %13
ret void
}