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


x86 assembly (clang, -O0):
<transfer_RGBA16161616_to_RGB_FLOAT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cvtsi2ssq 0x18(%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cvtsi2ssq (%rax),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  0xec4(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xeb8(%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
mulss  -0x14(%rbp),%xmm0
movss  0xe7e(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xe72(%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
mulss  -0x14(%rbp),%xmm0
movss  0xe43(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xe37(%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_RGB_FLOAT>:
cvtsi2ssq 0x18(%rsi),%xmm0
cvtsi2ssq (%rsi),%xmm1
mulss  %xmm0,%xmm1
movss  0xee9(%rip),%xmm2
divss  %xmm2,%xmm1
divss  %xmm2,%xmm1
mov    (%rdi),%rax
movss  %xmm1,(%rax)
xorps  %xmm1,%xmm1
cvtsi2ssq 0x8(%rsi),%xmm1
mulss  %xmm0,%xmm1
divss  %xmm2,%xmm1
divss  %xmm2,%xmm1
movss  %xmm1,0x4(%rax)
xorps  %xmm1,%xmm1
cvtsi2ssq 0x10(%rsi),%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_RGBA16161616_to_RGB_FLOAT(float** %0, i64* %1) {
%3 = alloca float**
%4 = alloca i64*
%5 = alloca float
store float** %0, float*** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = getelementptr inbounds i64, i64* %6, i64 3
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to float
store float %9, float* %5
%10 = load i64*, i64** %4
%11 = getelementptr inbounds i64, i64* %10, i32 1
store i64* %11, i64** %4
%12 = load i64, i64* %10
%13 = sitofp i64 %12 to float
%14 = load float, float* %5
%15 = fmul float %13, %14
%16 = fdiv float %15, 6.553500e+04
%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 = load float, float* %5
%26 = fmul float %24, %25
%27 = fdiv float %26, 6.553500e+04
%28 = fdiv float %27, 6.553500e+04
%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 i64*, i64** %4
%33 = load i64, i64* %32
%34 = sitofp i64 %33 to float
%35 = load float, float* %5
%36 = fmul float %34, %35
%37 = fdiv float %36, 6.553500e+04
%38 = fdiv float %37, 6.553500e+04
%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_RGBA16161616_to_RGB_FLOAT(float** nocapture %0, i64* nocapture %1) {
%3 = getelementptr inbounds i64, i64* %1, i64 3
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to float
%6 = getelementptr inbounds i64, i64* %1, i64 1
%7 = load i64, i64* %1
%8 = sitofp i64 %7 to float
%9 = fmul float %5, %8
%10 = fdiv float %9, 6.553500e+04
%11 = fdiv float %10, 6.553500e+04
%12 = load float*, float** %0
%13 = getelementptr inbounds float, float* %12, i64 1
store float %11, float* %12
%14 = getelementptr inbounds i64, i64* %1, i64 2
%15 = load i64, i64* %6
%16 = sitofp i64 %15 to float
%17 = fmul float %5, %16
%18 = fdiv float %17, 6.553500e+04
%19 = fdiv float %18, 6.553500e+04
%20 = getelementptr inbounds float, float* %12, i64 2
store float %19, float* %13
%21 = load i64, i64* %14
%22 = sitofp i64 %21 to float
%23 = fmul float %5, %22
%24 = fdiv float %23, 6.553500e+04
%25 = fdiv float %24, 6.553500e+04
%26 = getelementptr inbounds float, float* %12, i64 3
store float* %26, float** %0
store float %25, float* %20
ret void
}