OpenShadingLanguage 1.00
# Compiled by oslc 1.11.17
# options: -q -O2 -I/build/blender/src/blender/intern/cycles/kernel/osl/shaders -I/usr/share/OSL/shaders -o /build/blender/src/blender/build/intern/cycles/kernel/osl/shaders/node_hsv.oso
shader node_hsv
param	float	Hue	0.5		%read{47,47} %write{2147483647,-1}
param	float	Saturation	1		%read{52,52} %write{2147483647,-1}
param	float	Value	1		%read{58,58} %write{2147483647,-1}
param	float	Fac	0.5		%read{109,109} %write{2147483647,-1}
param	color	ColorIn	0 0 0		%read{1,109} %write{2147483647,-1}
oparam	color	ColorOut	0 0 0		%read{2147483647,-1} %write{109,109}
local	float	___337_cmax	%read{11,31} %write{5,5}
local	float	___337_cmin	%read{11,11} %write{10,10}
local	float	___337_h	%read{41,45} %write{17,44}
local	float	___337_s	%read{18,45} %write{15,16}
local	float	___337_v	%read{45,45} %write{12,12}
local	float	___337_cdelta	%read{15,23} %write{11,11}
local	color	___337_c	%read{27,39} %write{23,23}
local	float	___342_i	%read{72,95} %write{71,71}
local	float	___342_f	%read{73,79} %write{72,72}
local	float	___342_p	%read{85,98} %write{75,75}
local	float	___342_q	%read{88,98} %write{78,78}
local	float	___342_t	%read{85,97} %write{82,82}
local	float	___342_h	%read{67,72} %write{61,70}
local	float	___342_s	%read{64,80} %write{62,62}
local	float	___342_v	%read{66,98} %write{63,63}
local	color	___342_rgb	%read{99,99} %write{66,98}
local	color	Color	%read{46,109} %write{45,108}
const	string	$const1	"rgb_to_hsv"		%read{0,0} %write{2147483647,-1}
const	int	$const2	0		%read{1,102} %write{2147483647,-1}
temp	float	$tmp1	%read{5,5} %write{1,1}
temp	float	$tmp2	%read{5,5} %write{4,4}
const	int	$const3	1		%read{2,105} %write{2147483647,-1}
temp	float	$tmp3	%read{4,4} %write{2,2}
const	int	$const4	2		%read{3,108} %write{2147483647,-1}
temp	float	$tmp4	%read{4,4} %write{3,3}
temp	float	$tmp5	%read{10,10} %write{6,6}
temp	float	$tmp6	%read{10,10} %write{9,9}
temp	float	$tmp7	%read{9,9} %write{7,7}
temp	float	$tmp8	%read{9,9} %write{8,8}
const	float	$const5	0		%read{13,107} %write{2147483647,-1}
temp	int	$tmp9	%read{14,14} %write{13,13}
temp	int	$tmp10	%read{19,19} %write{18,18}
temp	color	$tmp11	%read{22,22} %write{21,21}
temp	color	$tmp12	%read{23,23} %write{22,22}
temp	float	$tmp13	%read{25,25} %write{24,24}
temp	int	$tmp14	%read{26,26} %write{25,25}
temp	float	$tmp15	%read{29,29} %write{27,27}
temp	float	$tmp16	%read{29,29} %write{28,28}
temp	float	$tmp17	%read{31,31} %write{30,30}
temp	int	$tmp18	%read{32,32} %write{31,31}
const	float	$const6	2		%read{34,89} %write{2147483647,-1}
temp	float	$tmp19	%read{34,34} %write{33,33}
temp	float	$tmp20	%read{36,36} %write{34,34}
temp	float	$tmp21	%read{36,36} %write{35,35}
const	float	$const7	4		%read{38,95} %write{2147483647,-1}
temp	float	$tmp22	%read{38,38} %write{37,37}
temp	float	$tmp23	%read{40,40} %write{38,38}
temp	float	$tmp24	%read{40,40} %write{39,39}
const	float	$const8	6		%read{41,70} %write{2147483647,-1}
temp	int	$tmp25	%read{43,43} %write{42,42}
const	float	$const9	1		%read{44,86} %write{2147483647,-1}
temp	float	$tmp26	%read{50,50} %write{49,49}
temp	float	$tmp27	%read{47,47} %write{46,46}
temp	float	$tmp28	%read{48,48} %write{47,47}
const	float	$const10	0.5		%read{48,48} %write{2147483647,-1}
temp	float	$tmp29	%read{49,49} %write{48,48}
temp	float	$tmp30	%read{56,56} %write{55,55}
temp	float	$tmp31	%read{52,52} %write{51,51}
temp	float	$tmp32	%read{54,54} %write{52,52}
const	string	$const11	"clamp"		%read{53,53} %write{2147483647,-1}
temp	float	$tmp33	%read{55,55} %write{54,54}
temp	float	$tmp34	%read{58,58} %write{57,57}
temp	float	$tmp35	%read{59,59} %write{58,58}
const	string	$const12	"hsv_to_rgb"		%read{60,60} %write{2147483647,-1}
temp	int	$tmp36	%read{65,65} %write{64,64}
temp	int	$tmp37	%read{68,68} %write{67,67}
temp	float	$tmp38	%read{75,75} %write{74,74}
temp	float	$tmp39	%read{77,77} %write{76,76}
temp	float	$tmp40	%read{78,78} %write{77,77}
temp	float	$tmp41	%read{80,80} %write{79,79}
temp	float	$tmp42	%read{81,81} %write{80,80}
temp	float	$tmp43	%read{82,82} %write{81,81}
temp	int	$tmp44	%read{84,84} %write{83,83}
temp	int	$tmp45	%read{87,87} %write{86,86}
temp	int	$tmp46	%read{90,90} %write{89,89}
const	float	$const13	3		%read{92,92} %write{2147483647,-1}
temp	int	$tmp47	%read{93,93} %write{92,92}
temp	int	$tmp48	%read{96,96} %write{95,95}
temp	float	$tmp49	%read{102,102} %write{101,101}
temp	float	$tmp50	%read{101,101} %write{100,100}
temp	float	$tmp51	%read{105,105} %write{104,104}
temp	float	$tmp52	%read{104,104} %write{103,103}
temp	float	$tmp53	%read{108,108} %write{107,107}
temp	float	$tmp54	%read{107,107} %write{106,106}
code ___main___
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_hsv.osl:14
#   color Color = rgb_to_hsv(ColorIn);
	functioncall	$const1 46 	%filename{"/build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_hsv.osl"} %line{14} %argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:75
#   cmax = max(rgb[0], max(rgb[1], rgb[2]));
	compref		$tmp1 ColorIn $const2 	%filename{"/build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h"} %line{75} %argrw{"wrr"}
	compref		$tmp3 ColorIn $const3 	%argrw{"wrr"}
	compref		$tmp4 ColorIn $const4 	%argrw{"wrr"}
	max		$tmp2 $tmp3 $tmp4 	%argrw{"wrr"}
	max		___337_cmax $tmp1 $tmp2 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:76
#   cmin = min(rgb[0], min(rgb[1], rgb[2]));
	compref		$tmp5 ColorIn $const2 	%line{76} %argrw{"wrr"}
	compref		$tmp7 ColorIn $const3 	%argrw{"wrr"}
	compref		$tmp8 ColorIn $const4 	%argrw{"wrr"}
	min		$tmp6 $tmp7 $tmp8 	%argrw{"wrr"}
	min		___337_cmin $tmp5 $tmp6 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:77
#   cdelta = cmax - cmin;
	sub		___337_cdelta ___337_cmax ___337_cmin 	%line{77} %argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:79
#   v = cmax;
	assign		___337_v ___337_cmax 	%line{79} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:81
#   if (cmax != 0.0) {
	neq		$tmp9 ___337_cmax $const5 	%line{81} %argrw{"wrr"}
	if		$tmp9 16 18 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:82
#     s = cdelta / cmax;
	div		___337_s ___337_cdelta ___337_cmax 	%line{82} %argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:85
#     s = 0.0;
	assign		___337_s $const5 	%line{85} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:86
#     h = 0.0;
	assign		___337_h $const5 	%line{86} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:89
#   if (s == 0.0) {
	eq		$tmp10 ___337_s $const5 	%line{89} %argrw{"wrr"}
	if		$tmp10 21 45 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:90
#     h = 0.0;
	assign		___337_h $const5 	%line{90} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:93
#     c = (color(cmax, cmax, cmax) - rgb) / cdelta;
	color		$tmp11 ___337_cmax ___337_cmax ___337_cmax 	%line{93} %argrw{"wrrr"}
	sub		$tmp12 $tmp11 ColorIn 	%argrw{"wrr"}
	div		___337_c $tmp12 ___337_cdelta 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:95
#     if (rgb[0] == cmax)
	compref		$tmp13 ColorIn $const2 	%line{95} %argrw{"wrr"}
	eq		$tmp14 $tmp13 ___337_cmax 	%argrw{"wrr"}
	if		$tmp14 30 41 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:96
#       h = c[2] - c[1];
	compref		$tmp15 ___337_c $const4 	%line{96} %argrw{"wrr"}
	compref		$tmp16 ___337_c $const3 	%argrw{"wrr"}
	sub		___337_h $tmp15 $tmp16 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:97
#     else if (rgb[1] == cmax)
	compref		$tmp17 ColorIn $const3 	%line{97} %argrw{"wrr"}
	eq		$tmp18 $tmp17 ___337_cmax 	%argrw{"wrr"}
	if		$tmp18 37 41 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:98
#       h = 2.0 + c[0] - c[2];
	compref		$tmp19 ___337_c $const2 	%line{98} %argrw{"wrr"}
	add		$tmp20 $const6 $tmp19 	%argrw{"wrr"}
	compref		$tmp21 ___337_c $const4 	%argrw{"wrr"}
	sub		___337_h $tmp20 $tmp21 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:100
#       h = 4.0 + c[1] - c[0];
	compref		$tmp22 ___337_c $const3 	%line{100} %argrw{"wrr"}
	add		$tmp23 $const7 $tmp22 	%argrw{"wrr"}
	compref		$tmp24 ___337_c $const2 	%argrw{"wrr"}
	sub		___337_h $tmp23 $tmp24 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:102
#     h /= 6.0;
	div		___337_h ___337_h $const8 	%line{102} %argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:104
#     if (h < 0.0)
	lt		$tmp25 ___337_h $const5 	%line{104} %argrw{"wrr"}
	if		$tmp25 45 45 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:105
#       h += 1.0;
	add		___337_h ___337_h $const9 	%line{105} %argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:108
#   return color(h, s, v);
	color		Color ___337_h ___337_s ___337_v 	%line{108} %argrw{"wrrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_hsv.osl:17
#   Color[0] = fmod(Color[0] + Hue + 0.5, 1.0);
	compref		$tmp27 Color $const2 	%filename{"/build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_hsv.osl"} %line{17} %argrw{"wrr"}
	add		$tmp28 $tmp27 Hue 	%argrw{"wrr"}
	add		$tmp29 $tmp28 $const10 	%argrw{"wrr"}
	fmod		$tmp26 $tmp29 $const9 	%argrw{"wrr"}
	compassign	Color $const2 $tmp26 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_hsv.osl:18
#   Color[1] = clamp(Color[1] * Saturation, 0.0, 1.0);
	compref		$tmp31 Color $const3 	%line{18} %argrw{"wrr"}
	mul		$tmp32 $tmp31 Saturation 	%argrw{"wrr"}
	functioncall	$const11 56 	%argrw{"r"}
# /usr/share/OSL/shaders/stdosl.h:141
# float  clamp (float x, float minval, float maxval) { return max(min(x,maxval),minval); }
	min		$tmp33 $tmp32 $const9 	%filename{"/usr/share/OSL/shaders/stdosl.h"} %line{141} %argrw{"wrr"}
	max		$tmp30 $tmp33 $const5 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_hsv.osl:18
#   Color[1] = clamp(Color[1] * Saturation, 0.0, 1.0);
	compassign	Color $const3 $tmp30 	%filename{"/build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_hsv.osl"} %line{18} %argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_hsv.osl:19
#   Color[2] *= Value;
	compref		$tmp34 Color $const4 	%line{19} %argrw{"wrr"}
	mul		$tmp35 $tmp34 Value 	%argrw{"wrr"}
	compassign	Color $const4 $tmp35 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_hsv.osl:21
#   Color = hsv_to_rgb(Color);
	functioncall	$const12 100 	%line{21} %argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:116
#   h = hsv[0];
	compref		___342_h Color $const2 	%filename{"/build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h"} %line{116} %argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:117
#   s = hsv[1];
	compref		___342_s Color $const3 	%line{117} %argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:118
#   v = hsv[2];
	compref		___342_v Color $const4 	%line{118} %argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:120
#   if (s == 0.0) {
	eq		$tmp36 ___342_s $const5 	%line{120} %argrw{"wrr"}
	if		$tmp36 67 99 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:121
#     rgb = color(v, v, v);
	color		___342_rgb ___342_v ___342_v ___342_v 	%line{121} %argrw{"wrrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:124
#     if (h == 1.0)
	eq		$tmp37 ___342_h $const9 	%line{124} %argrw{"wrr"}
	if		$tmp37 70 70 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:125
#       h = 0.0;
	assign		___342_h $const5 	%line{125} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:127
#     h *= 6.0;
	mul		___342_h ___342_h $const8 	%line{127} %argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:128
#     i = floor(h);
	floor		___342_i ___342_h 	%line{128} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:129
#     f = h - i;
	sub		___342_f ___342_h ___342_i 	%line{129} %argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:130
#     rgb = color(f, f, f);
	color		___342_rgb ___342_f ___342_f ___342_f 	%line{130} %argrw{"wrrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:131
#     p = v * (1.0 - s);
	sub		$tmp38 $const9 ___342_s 	%line{131} %argrw{"wrr"}
	mul		___342_p ___342_v $tmp38 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:132
#     q = v * (1.0 - (s * f));
	mul		$tmp39 ___342_s ___342_f 	%line{132} %argrw{"wrr"}
	sub		$tmp40 $const9 $tmp39 	%argrw{"wrr"}
	mul		___342_q ___342_v $tmp40 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:133
#     t = v * (1.0 - (s * (1.0 - f)));
	sub		$tmp41 $const9 ___342_f 	%line{133} %argrw{"wrr"}
	mul		$tmp42 ___342_s $tmp41 	%argrw{"wrr"}
	sub		$tmp43 $const9 $tmp42 	%argrw{"wrr"}
	mul		___342_t ___342_v $tmp43 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:135
#     if (i == 0.0)
	eq		$tmp44 ___342_i $const5 	%line{135} %argrw{"wrr"}
	if		$tmp44 86 99 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:136
#       rgb = color(v, t, p);
	color		___342_rgb ___342_v ___342_t ___342_p 	%line{136} %argrw{"wrrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:137
#     else if (i == 1.0)
	eq		$tmp45 ___342_i $const9 	%line{137} %argrw{"wrr"}
	if		$tmp45 89 99 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:138
#       rgb = color(q, v, p);
	color		___342_rgb ___342_q ___342_v ___342_p 	%line{138} %argrw{"wrrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:139
#     else if (i == 2.0)
	eq		$tmp46 ___342_i $const6 	%line{139} %argrw{"wrr"}
	if		$tmp46 92 99 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:140
#       rgb = color(p, v, t);
	color		___342_rgb ___342_p ___342_v ___342_t 	%line{140} %argrw{"wrrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:141
#     else if (i == 3.0)
	eq		$tmp47 ___342_i $const13 	%line{141} %argrw{"wrr"}
	if		$tmp47 95 99 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:142
#       rgb = color(p, q, v);
	color		___342_rgb ___342_p ___342_q ___342_v 	%line{142} %argrw{"wrrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:143
#     else if (i == 4.0)
	eq		$tmp48 ___342_i $const7 	%line{143} %argrw{"wrr"}
	if		$tmp48 98 99 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:144
#       rgb = color(t, p, v);
	color		___342_rgb ___342_t ___342_p ___342_v 	%line{144} %argrw{"wrrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:146
#       rgb = color(v, p, q);
	color		___342_rgb ___342_v ___342_p ___342_q 	%line{146} %argrw{"wrrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:149
#   return rgb;
	assign		Color ___342_rgb 	%line{149} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_hsv.osl:24
#   Color[0] = max(Color[0], 0.0);
	compref		$tmp50 Color $const2 	%filename{"/build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_hsv.osl"} %line{24} %argrw{"wrr"}
	max		$tmp49 $tmp50 $const5 	%argrw{"wrr"}
	compassign	Color $const2 $tmp49 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_hsv.osl:25
#   Color[1] = max(Color[1], 0.0);
	compref		$tmp52 Color $const3 	%line{25} %argrw{"wrr"}
	max		$tmp51 $tmp52 $const5 	%argrw{"wrr"}
	compassign	Color $const3 $tmp51 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_hsv.osl:26
#   Color[2] = max(Color[2], 0.0);
	compref		$tmp54 Color $const4 	%line{26} %argrw{"wrr"}
	max		$tmp53 $tmp54 $const5 	%argrw{"wrr"}
	compassign	Color $const4 $tmp53 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_hsv.osl:28
#   ColorOut = mix(ColorIn, Color, Fac);
	mix		ColorOut ColorIn Color Fac 	%line{28} %argrw{"wrrr"}
	end
