#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 */

/* Variables and functions */
float fclampf(float, float, float);
float floorf(float);
void rct2srgb(float *io) {
  float Y = io[0];
  float U = io[1];
  float V = io[2];
  float G = Y - floorf((U + V) / 4.f);
  float R = U + G;
  float B = V + G;
  io[0] = fclampf(R, 0.f, 255.f);
  io[1] = fclampf(G, 0.f, 255.f);
  io[2] = fclampf(B, 0.f, 255.f);
  ;
}


x86 assembly (clang, -O0):
<rct2srgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  0xe93(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <floorf@plt>
movaps %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
xorps  %xmm1,%xmm1
movss  0xe47(%rip),%xmm2
call   1040 <fclampf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
movss  0xe2a(%rip),%xmm2
call   1040 <fclampf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
movss  0xe0c(%rip),%xmm2
call   1040 <fclampf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rct2srgb>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movss  (%rdi),%xmm0
movss  %xmm0,0x4(%rsp)
movss  0x4(%rdi),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x8(%rdi),%xmm1
movss  %xmm1,0x8(%rsp)
addss  %xmm1,%xmm0
mulss  0xeac(%rip),%xmm0
call   1030 <floorf@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
movss  0xc(%rsp),%xmm3
addss  %xmm1,%xmm3
movss  0x8(%rsp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0x8(%rsp)
movss  0xe79(%rip),%xmm2
xorps  %xmm1,%xmm1
movaps %xmm3,%xmm0
call   1040 <fclampf@plt>
movss  %xmm0,(%rbx)
xorps  %xmm1,%xmm1
movss  0x4(%rsp),%xmm0
movss  0xe59(%rip),%xmm2
call   1040 <fclampf@plt>
movss  %xmm0,0x4(%rbx)
xorps  %xmm1,%xmm1
movss  0x8(%rsp),%xmm0
movss  0xe3e(%rip),%xmm2
call   1040 <fclampf@plt>
movss  %xmm0,0x8(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @rct2srgb(float* %0) {
%2 = alloca float*
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float* %0, float** %2
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 0
%11 = load float, float* %10
store float %11, float* %3
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
store float %14, float* %4
%15 = load float*, float** %2
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
store float %17, float* %5
%18 = load float, float* %3
%19 = load float, float* %4
%20 = load float, float* %5
%21 = fadd float %19, %20
%22 = fdiv float %21, 4.000000e+00
%23 = call float @llvm.floor.f32(float %22)
%24 = fsub float %18, %23
store float %24, float* %6
%25 = load float, float* %4
%26 = load float, float* %6
%27 = fadd float %25, %26
store float %27, float* %7
%28 = load float, float* %5
%29 = load float, float* %6
%30 = fadd float %28, %29
store float %30, float* %8
%31 = load float, float* %7
%32 = call float @fclampf(float %31, float 0.000000e+00, float 2.550000e+02)
%33 = load float*, float** %2
%34 = getelementptr inbounds float, float* %33, i64 0
store float %32, float* %34
%35 = load float, float* %6
%36 = call float @fclampf(float %35, float 0.000000e+00, float 2.550000e+02)
%37 = load float*, float** %2
%38 = getelementptr inbounds float, float* %37, i64 1
store float %36, float* %38
%39 = load float, float* %8
%40 = call float @fclampf(float %39, float 0.000000e+00, float 2.550000e+02)
%41 = load float*, float** %2
%42 = getelementptr inbounds float, float* %41, i64 2
store float %40, float* %42
ret void
}

LLVM IR (-O2):
define void @rct2srgb(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = getelementptr inbounds float, float* %0, i64 2
%6 = load float, float* %5
%7 = fadd float %4, %6
%8 = fmul float %7, 2.500000e-01
%9 = tail call float @llvm.floor.f32(float %8)
%10 = fsub float %2, %9
%11 = fadd float %4, %10
%12 = fadd float %6, %10
%13 = tail call float @fclampf(float %11, float 0.000000e+00, float 2.550000e+02)
store float %13, float* %0
%14 = tail call float @fclampf(float %10, float 0.000000e+00, float 2.550000e+02)
store float %14, float* %3
%15 = tail call float @fclampf(float %12, float 0.000000e+00, float 2.550000e+02)
store float %15, float* %5
ret void
}