#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 */
int /*<<< orphan*/ assert(int);
void NormalToRGB(float *v) {
  v[0] = v[0] * 0.5f + 0.5f;
  v[1] = v[1] * 0.5f + 0.5f;
  v[2] = v[2] * 0.5f + 0.5f;
  assert(v[0] >= 0 && v[0] <= 1 && v[1] >= 0 && v[1] <= 1 && v[2] >= 0 &&
         v[2] <= 1);
}


x86 assembly (clang, -O0):
<NormalToRGB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  0xed4(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  0xeb3(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  0xe91(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jb     1218 <NormalToRGB+0x108>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
movss  0xe5d(%rip),%xmm0
ucomiss (%rcx),%xmm0
mov    %al,-0x9(%rbp)
jb     1218 <NormalToRGB+0x108>
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jb     1218 <NormalToRGB+0x108>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
movss  0xe29(%rip),%xmm0
ucomiss 0x4(%rcx),%xmm0
mov    %al,-0x9(%rbp)
jb     1218 <NormalToRGB+0x108>
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jb     1218 <NormalToRGB+0x108>
mov    -0x8(%rbp),%rax
movss  0xdf6(%rip),%xmm0
ucomiss 0x8(%rax),%xmm0
setae  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NormalToRGB>:
movss  0xee8(%rip),%xmm0
movss  (%rdi),%xmm2
mulss  %xmm0,%xmm2
addss  %xmm0,%xmm2
movss  %xmm2,(%rdi)
movsd  0x4(%rdi),%xmm1
movaps 0xedc(%rip),%xmm0
mulps  %xmm0,%xmm1
addps  %xmm0,%xmm1
movaps %xmm1,%xmm0
shufps $0x55,%xmm1,%xmm0
movss  %xmm1,0x4(%rdi)
movss  %xmm0,0x8(%rdi)
xor    %edi,%edi
xorps  %xmm3,%xmm3
ucomiss %xmm3,%xmm2
jb     1186 <NormalToRGB+0x76>
movss  0xea7(%rip),%xmm3
ucomiss %xmm2,%xmm3
jb     1186 <NormalToRGB+0x76>
xorps  %xmm2,%xmm2
cmpnleps %xmm1,%xmm2
unpcklps %xmm2,%xmm2
movmskpd %xmm2,%eax
test   $0x1,%al
jne    1186 <NormalToRGB+0x76>
ucomiss %xmm1,%xmm3
jb     1186 <NormalToRGB+0x76>
shr    %al
jne    1186 <NormalToRGB+0x76>
xor    %edi,%edi
ucomiss %xmm0,%xmm3
setae  %dil
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @NormalToRGB(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = call float @llvm.fmuladd.f32(float %5, float 5.000000e-01, float 5.000000e-01)
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 0
store float %6, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = call float @llvm.fmuladd.f32(float %11, float 5.000000e-01, float 5.000000e-01)
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float*, float** %2
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
%18 = call float @llvm.fmuladd.f32(float %17, float 5.000000e-01, float 5.000000e-01)
%19 = load float*, float** %2
%20 = getelementptr inbounds float, float* %19, i64 2
store float %18, float* %20
%21 = load float*, float** %2
%22 = getelementptr inbounds float, float* %21, i64 0
%23 = load float, float* %22
%24 = fcmp oge float %23, 0.000000e+00
br i1 %24, label %25, label %50
25: ; preds = %1
%26 = load float*, float** %2
%27 = getelementptr inbounds float, float* %26, i64 0
%28 = load float, float* %27
%29 = fcmp ole float %28, 1.000000e+00
br i1 %29, label %30, label %50
30: ; preds = %25
%31 = load float*, float** %2
%32 = getelementptr inbounds float, float* %31, i64 1
%33 = load float, float* %32
%34 = fcmp oge float %33, 0.000000e+00
br i1 %34, label %35, label %50
35: ; preds = %30
%36 = load float*, float** %2
%37 = getelementptr inbounds float, float* %36, i64 1
%38 = load float, float* %37
%39 = fcmp ole float %38, 1.000000e+00
br i1 %39, label %40, label %50
40: ; preds = %35
%41 = load float*, float** %2
%42 = getelementptr inbounds float, float* %41, i64 2
%43 = load float, float* %42
%44 = fcmp oge float %43, 0.000000e+00
br i1 %44, label %45, label %50
45: ; preds = %40
%46 = load float*, float** %2
%47 = getelementptr inbounds float, float* %46, i64 2
%48 = load float, float* %47
%49 = fcmp ole float %48, 1.000000e+00
br label %50
50: ; preds = %45, %40, %35, %30, %25, %1
%51 = phi i1 [ false, %40 ], [ false, %35 ], [ false, %30 ], [ false, %25 ], [ false, %1 ], [ %49, %45 ]
%52 = zext i1 %51 to i32
%53 = call i32 @assert(i32 %52)
ret void
}

LLVM IR (-O2):
define void @NormalToRGB(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @llvm.fmuladd.f32(float %2, float 5.000000e-01, float 5.000000e-01)
store float %3, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = getelementptr inbounds float, float* %0, i64 2
%6 = bitcast float* %4 to <2 x float>*
%7 = load <2 x float>, <2 x float>* %6
%8 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %7, <2 x float> <float 5.000000e-01, float 5.000000e-01>, <2 x float> <float 5.000000e-01, float 5.000000e-01>)
%9 = extractelement <2 x float> %8, i64 0
store float %9, float* %4
%10 = extractelement <2 x float> %8, i64 1
store float %10, float* %5
%11 = fcmp ult float %3, 0.000000e+00
%12 = fcmp ugt float %3, 1.000000e+00
%13 = or i1 %11, %12
br i1 %13, label %24, label %14
14: ; preds = %1
%15 = fcmp ugt float %9, 1.000000e+00
%16 = fcmp ult <2 x float> %8, zeroinitializer
%17 = extractelement <2 x i1> %16, i64 0
%18 = or i1 %17, %15
%19 = extractelement <2 x i1> %16, i64 1
%20 = select i1 %18, i1 true, i1 %19
br i1 %20, label %24, label %21
21: ; preds = %14
%22 = fcmp ole float %10, 1.000000e+00
%23 = zext i1 %22 to i32
br label %24
24: ; preds = %21, %14, %1
%25 = phi i32 [ 0, %14 ], [ 0, %1 ], [ %23, %21 ]
%26 = tail call i32 @assert(i32 %25)
ret void
}