#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_RGBA16161616_to_RGBA_FLOAT(float *(*output), uint16_t *input) {
  *(*output)++ = (float)*input++ / 0xffff;
  *(*output)++ = (float)*input++ / 0xffff;
  *(*output)++ = (float)*input++ / 0xffff;
  *(*output)++ = (float)*input / 0xffff;
}


x86 assembly (clang, -O0):
<transfer_RGBA16161616_to_RGBA_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
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cvtsi2ssq (%rax),%xmm0
movss  0xe6e(%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  0xe44(%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_RGBA16161616_to_RGBA_FLOAT>:
movdqu 0x10(%rsi),%xmm0
movq   %xmm0,%rax
cvtsi2ss %rax,%xmm1
pshufd $0xee,%xmm0,%xmm0
movq   %xmm0,%rax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movdqu (%rsi),%xmm2
unpcklps %xmm0,%xmm1
movq   %xmm2,%rax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pshufd $0xee,%xmm2,%xmm2
movq   %xmm2,%rax
xorps  %xmm2,%xmm2
cvtsi2ss %rax,%xmm2
unpcklps %xmm2,%xmm0
movlhps %xmm1,%xmm0
divps  0xeac(%rip),%xmm0
mov    (%rdi),%rax
lea    0x10(%rax),%rcx
mov    %rcx,(%rdi)
movups %xmm0,(%rax)
ret

LLVM IR (-O0):
define void @transfer_RGBA16161616_to_RGBA_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 = getelementptr inbounds i64, i64* %21, i32 1
store i64* %22, i64** %4
%23 = load i64, i64* %21
%24 = sitofp i64 %23 to float
%25 = fdiv float %24, 6.553500e+04
%26 = load float**, float*** %3
%27 = load float*, float** %26
%28 = getelementptr inbounds float, float* %27, i32 1
store float* %28, float** %26
store float %25, float* %27
%29 = load i64*, i64** %4
%30 = load i64, i64* %29
%31 = sitofp i64 %30 to float
%32 = fdiv float %31, 6.553500e+04
%33 = load float**, float*** %3
%34 = load float*, float** %33
%35 = getelementptr inbounds float, float* %34, i32 1
store float* %35, float** %33
store float %32, float* %34
ret void
}

LLVM IR (-O2):
define void @transfer_RGBA16161616_to_RGBA_FLOAT(float** nocapture %0, i64* nocapture %1) {
%3 = load float*, float** %0
%4 = bitcast i64* %1 to <4 x i64>*
%5 = load <4 x i64>, <4 x i64>* %4
%6 = sitofp <4 x i64> %5 to <4 x float>
%7 = fdiv <4 x float> %6, <float 6.553500e+04, float 6.553500e+04, float 6.553500e+04, float 6.553500e+04>
%8 = getelementptr inbounds float, float* %3, i64 4
store float* %8, float** %0
%9 = bitcast float* %3 to <4 x float>*
store <4 x float> %7, <4 x float>* %9
ret void
}