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_environment_texture.oso
shader node_environment_texture
param	int	use_mapping	0		%read{2,2} %write{2147483647,-1}
param	matrix	mapping	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0		%read{3,3} %write{2147483647,-1} %derivs
param	vector	Vector	0 0 0		%read{1,1} %write{0,0} %derivs %initexpr
param	string	filename	""		%read{49,49} %write{2147483647,-1}
param	string	projection	"equirectangular"		%read{5,5} %write{2147483647,-1}
param	string	interpolation	"linear"		%read{49,49} %write{2147483647,-1}
param	int	compress_as_srgb	0		%read{68,68} %write{2147483647,-1}
param	int	ignore_alpha	0		%read{50,50} %write{2147483647,-1}
param	int	unassociate_alpha	0		%read{52,52} %write{2147483647,-1}
param	int	is_float	1		%read{64,64} %write{2147483647,-1}
oparam	color	Color	0 0 0		%read{61,100} %write{49,115}
oparam	float	Alpha	1		%read{54,61} %write{49,51}
global	point	P	%read{0,0} %write{2147483647,-1} %derivs
local	float	___390_u	%read{25,25} %write{13,13} %derivs
local	float	___390_v	%read{25,25} %write{24,24} %derivs
local	vector	___391_dir	%read{28,42} %write{27,38} %derivs
local	float	___391_div	%read{36,38} %write{35,35} %derivs
local	float	___391_u	%read{45,45} %write{41,41} %derivs
local	float	___391_v	%read{45,45} %write{44,44} %derivs
local	vector	p	%read{3,47} %write{1,45} %derivs
const	string	$const1	"equirectangular"		%read{5,5} %write{2147483647,-1}
temp	int	$tmp1	%read{6,6} %write{5,5}
const	string	$const2	"environment_texture_direction_to_equirectangular"		%read{7,7} %write{2147483647,-1}
temp	float	$tmp2	%read{11,11} %write{10,10} %derivs
const	int	$const3	1		%read{8,85} %write{2147483647,-1}
temp	float	$tmp3	%read{10,10} %write{8,8} %derivs
const	int	$const4	0		%read{9,70} %write{2147483647,-1}
temp	float	$tmp4	%read{10,10} %write{9,9} %derivs
temp	float	$tmp5	%read{12,12} %write{11,11} %derivs
const	float	$const5	6.28318548		%read{12,12} %write{2147483647,-1}
temp	float	$tmp6	%read{13,13} %write{12,12} %derivs
const	float	$const6	0.5		%read{13,44} %write{2147483647,-1}
temp	float	$tmp7	%read{23,23} %write{22,22} %derivs
const	int	$const7	2		%read{14,100} %write{2147483647,-1}
temp	float	$tmp8	%read{22,22} %write{14,14} %derivs
temp	float	$tmp9	%read{22,22} %write{21,21} %derivs
temp	float	$tmp10	%read{18,18} %write{15,15} %derivs
temp	float	$tmp11	%read{19,19} %write{16,16} %derivs
const	string	$const8	"hypot"		%read{17,17} %write{2147483647,-1}
temp	float	$tmp12	%read{20,20} %write{18,18} %derivs
temp	float	$tmp13	%read{20,20} %write{19,19} %derivs
temp	float	$tmp14	%read{21,21} %write{20,20} %derivs
const	float	$const9	3.14159274		%read{23,23} %write{2147483647,-1}
temp	float	$tmp15	%read{24,24} %write{23,23} %derivs
const	float	$const10	0		%read{25,106} %write{2147483647,-1}
const	string	$const11	"environment_texture_direction_to_mirrorball"		%read{26,26} %write{2147483647,-1}
temp	float	$tmp16	%read{29,29} %write{28,28} %derivs
const	float	$const12	1		%read{29,111} %write{2147483647,-1}
temp	float	$tmp17	%read{30,30} %write{29,29} %derivs
const	float	$const13	2		%read{35,35} %write{2147483647,-1}
temp	float	$tmp18	%read{35,35} %write{34,34} %derivs
temp	float	$tmp19	%read{34,34} %write{33,33} %derivs
const	float	$const14	-0.5		%read{32,32} %write{2147483647,-1}
temp	float	$tmp20	%read{32,32} %write{31,31} %derivs
temp	float	$tmp21	%read{33,33} %write{32,32} %derivs
temp	int	$tmp22	%read{37,37} %write{36,36}
temp	float	$tmp23	%read{40,40} %write{39,39} %derivs
temp	float	$tmp24	%read{41,41} %write{40,40} %derivs
temp	float	$tmp25	%read{43,43} %write{42,42} %derivs
temp	float	$tmp26	%read{44,44} %write{43,43} %derivs
temp	float	$tmp27	%read{49,49} %write{46,46} %derivs
temp	float	$tmp28	%read{48,48} %write{47,47} %derivs
temp	float	$tmp29	%read{49,49} %write{48,48} %derivs
const	string	$const15	"wrap"		%read{49,49} %write{2147483647,-1}
const	string	$const16	"periodic"		%read{49,49} %write{2147483647,-1}
const	string	$const17	"interp"		%read{49,49} %write{2147483647,-1}
const	string	$const18	"alpha"		%read{49,49} %write{2147483647,-1}
const	string	$const19	"color_unpremultiply"		%read{53,53} %write{2147483647,-1}
temp	int	$tmp30	%read{55,55} %write{54,54}
temp	int	$tmp31	%read{56,60} %write{55,59}
temp	int	$tmp32	%read{58,58} %write{57,57}
temp	int	$tmp33	%read{59,59} %write{58,58}
temp	int	$tmp34	%read{65,65} %write{64,64}
temp	color	$tmp35	%read{67,67} %write{66,66}
const	string	$const20	"color_srgb_to_scene_linear"		%read{69,101} %write{2147483647,-1}
temp	float	$tmp36	%read{115,115} %write{76,83}
temp	float	$tmp37	%read{72,80} %write{70,70}
const	float	$const21	0.0404499993		%read{72,102} %write{2147483647,-1}
temp	int	$tmp38	%read{73,73} %write{72,72}
temp	int	$tmp39	%read{75,75} %write{74,74}
const	float	$const22	12.9200001		%read{77,107} %write{2147483647,-1}
temp	float	$tmp40	%read{78,78} %write{77,77}
const	float	$const23	0.0549999997		%read{80,110} %write{2147483647,-1}
temp	float	$tmp41	%read{82,82} %write{80,80}
const	float	$const24	1.05499995		%read{81,111} %write{2147483647,-1}
temp	float	$tmp42	%read{82,82} %write{81,81}
temp	float	$tmp43	%read{83,83} %write{82,82}
const	float	$const25	2.4000001		%read{83,113} %write{2147483647,-1}
temp	float	$tmp44	%read{115,115} %write{91,98}
temp	float	$tmp45	%read{87,95} %write{85,85}
temp	int	$tmp46	%read{88,88} %write{87,87}
temp	int	$tmp47	%read{90,90} %write{89,89}
temp	float	$tmp48	%read{93,93} %write{92,92}
temp	float	$tmp49	%read{97,97} %write{95,95}
temp	float	$tmp50	%read{97,97} %write{96,96}
temp	float	$tmp51	%read{98,98} %write{97,97}
temp	float	$tmp52	%read{115,115} %write{106,113}
temp	float	$tmp53	%read{102,110} %write{100,100}
temp	int	$tmp54	%read{103,103} %write{102,102}
temp	int	$tmp55	%read{105,105} %write{104,104}
temp	float	$tmp56	%read{108,108} %write{107,107}
temp	float	$tmp57	%read{112,112} %write{110,110}
temp	float	$tmp58	%read{112,112} %write{111,111}
temp	float	$tmp59	%read{113,113} %write{112,112}
code Vector
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:33
#     vector Vector = P,
	assign		Vector P 	%filename{"/build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl"} %line{33} %argrw{"wr"}
code ___main___
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:44
#   vector p = Vector;
	assign		p Vector 	%filename{"/build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl"} %line{44} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:46
#   if (use_mapping)
	if		use_mapping 4 4 	%line{46} %argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:47
#     p = transform(mapping, p);
	transformv	p mapping p 	%line{47} %argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:49
#   p = normalize(p);
	normalize	p p 	%line{49} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:51
#   if (projection == "equirectangular")
	eq		$tmp1 projection $const1 	%line{51} %argrw{"wrr"}
	if		$tmp1 26 46 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:52
#     p = environment_texture_direction_to_equirectangular(p);
	functioncall	$const2 26 	%line{52} %argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:9
#   float u = -atan2(dir[1], dir[0]) / (M_2PI) + 0.5;
	compref		$tmp3 p $const3 	%line{9} %argrw{"wrr"}
	compref		$tmp4 p $const4 	%argrw{"wrr"}
	atan2		$tmp2 $tmp3 $tmp4 	%argrw{"wrr"}
	neg		$tmp5 $tmp2 	%argrw{"wr"}
	div		$tmp6 $tmp5 $const5 	%argrw{"wrr"}
	add		___390_u $tmp6 $const6 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:10
#   float v = atan2(dir[2], hypot(dir[0], dir[1])) / M_PI + 0.5;
	compref		$tmp8 p $const7 	%line{10} %argrw{"wrr"}
	compref		$tmp10 p $const4 	%argrw{"wrr"}
	compref		$tmp11 p $const3 	%argrw{"wrr"}
	functioncall	$const8 22 	%argrw{"r"}
# /usr/share/OSL/shaders/stdosl.h:101
# float hypot (float a, float b) { return sqrt (a*a + b*b); }
	mul		$tmp12 $tmp10 $tmp10 	%filename{"/usr/share/OSL/shaders/stdosl.h"} %line{101} %argrw{"wrr"}
	mul		$tmp13 $tmp11 $tmp11 	%argrw{"wrr"}
	add		$tmp14 $tmp12 $tmp13 	%argrw{"wrr"}
	sqrt		$tmp9 $tmp14 	%argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:10
#   float v = atan2(dir[2], hypot(dir[0], dir[1])) / M_PI + 0.5;
	atan2		$tmp7 $tmp8 $tmp9 	%filename{"/build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl"} %line{10} %argrw{"wrr"}
	div		$tmp15 $tmp7 $const9 	%argrw{"wrr"}
	add		___390_v $tmp15 $const6 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:12
#   return vector(u, v, 0.0);
	vector		p ___390_u ___390_v $const10 	%line{12} %argrw{"wrrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:54
#     p = environment_texture_direction_to_mirrorball(p);
	functioncall	$const11 46 	%line{54} %argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:17
#   vector dir = idir;
	assign		___391_dir p 	%line{17} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:18
#   dir[1] -= 1.0;
	compref		$tmp16 ___391_dir $const3 	%line{18} %argrw{"wrr"}
	sub		$tmp17 $tmp16 $const12 	%argrw{"wrr"}
	compassign	___391_dir $const3 $tmp17 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:20
#   float div = 2.0 * sqrt(max(-0.5 * dir[1], 0.0));
	compref		$tmp20 ___391_dir $const3 	%line{20} %argrw{"wrr"}
	mul		$tmp21 $const14 $tmp20 	%argrw{"wrr"}
	max		$tmp19 $tmp21 $const10 	%argrw{"wrr"}
	sqrt		$tmp18 $tmp19 	%argrw{"wr"}
	mul		___391_div $const13 $tmp18 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:21
#   if (div > 0.0)
	gt		$tmp22 ___391_div $const10 	%line{21} %argrw{"wrr"}
	if		$tmp22 39 39 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:22
#     dir /= div;
	div		___391_dir ___391_dir ___391_div 	%line{22} %argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:24
#   float u = 0.5 * (dir[0] + 1.0);
	compref		$tmp23 ___391_dir $const4 	%line{24} %argrw{"wrr"}
	add		$tmp24 $tmp23 $const12 	%argrw{"wrr"}
	mul		___391_u $const6 $tmp24 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:25
#   float v = 0.5 * (dir[2] + 1.0);
	compref		$tmp25 ___391_dir $const7 	%line{25} %argrw{"wrr"}
	add		$tmp26 $tmp25 $const12 	%argrw{"wrr"}
	mul		___391_v $const6 $tmp26 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:27
#   return vector(u, v, 0.0);
	vector		p ___391_u ___391_v $const10 	%line{27} %argrw{"wrrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:58
#       filename, p[0], 1.0 - p[1], "wrap", "periodic", "interp", interpolation, "alpha", Alpha);
	compref		$tmp27 p $const4 	%line{58} %argrw{"wrr"}
	compref		$tmp28 p $const3 	%argrw{"wrr"}
	sub		$tmp29 $const12 $tmp28 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:57
#   Color = (color)texture(
	texture		Color filename $tmp27 $tmp29 $const15 $const16 $const17 interpolation $const18 Alpha 	%line{57} %argrw{"wrrrrrrrrw"} %argderivs{2,3}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:60
#   if (ignore_alpha) {
	if		ignore_alpha 52 68 	%line{60} %argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:61
#     Alpha = 1.0;
	assign		Alpha $const12 	%line{61} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:63
#   else if (unassociate_alpha) {
	if		unassociate_alpha 68 68 	%line{63} %argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:64
#     Color = color_unpremultiply(Color, Alpha);
	functioncall	$const19 64 	%line{64} %argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:38
#   if (alpha != 1.0 && alpha != 0.0)
	neq		$tmp30 Alpha $const12 	%filename{"/build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h"} %line{38} %argrw{"wrr"}
	neq		$tmp31 $tmp30 $const4 	%argrw{"wrr"}
	if		$tmp31 60 60 	%argrw{"r"}
	neq		$tmp32 Alpha $const10 	%argrw{"wrr"}
	neq		$tmp33 $tmp32 $const4 	%argrw{"wrr"}
	assign		$tmp31 $tmp33 	%argrw{"wr"}
	if		$tmp31 63 63 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:39
#     return c / alpha;
	div		Color Color Alpha 	%line{39} %argrw{"wrr"}
	return
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:41
#   return c;
	assign		Color Color 	%line{41} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:66
#     if (!is_float)
	eq		$tmp34 is_float $const4 	%filename{"/build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl"} %line{66} %argrw{"wrr"}
	if		$tmp34 68 68 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:67
#       Color = min(Color, 1.0);
	assign		$tmp35 $const12 	%line{67} %argrw{"wr"}
	min		Color Color $tmp35 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:70
#   if (compress_as_srgb)
	if		compress_as_srgb 116 116 	%line{70} %argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_environment_texture.osl:71
#     Color = color_srgb_to_scene_linear(Color);
	functioncall	$const20 116 	%line{71} %argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:24
#   return color(color_srgb_to_scene_linear(c[0]),
	compref		$tmp37 Color $const4 	%filename{"/build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h"} %line{24} %argrw{"wrr"}
	functioncall	$const20 85 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:8
#   if (c < 0.04045)
	lt		$tmp38 $tmp37 $const21 	%line{8} %argrw{"wrr"}
	if		$tmp38 80 85 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:9
#     return (c < 0.0) ? 0.0 : c * (1.0 / 12.92);
	lt		$tmp39 $tmp37 $const10 	%line{9} %argrw{"wrr"}
	if		$tmp39 77 79 	%argrw{"r"}
	assign		$tmp36 $const10 	%argrw{"wr"}
	div		$tmp40 $const12 $const22 	%argrw{"wrr"}
	mul		$tmp36 $tmp37 $tmp40 	%argrw{"wrr"}
	return
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:11
#     return pow((c + 0.055) * (1.0 / 1.055), 2.4);
	add		$tmp41 $tmp37 $const23 	%line{11} %argrw{"wrr"}
	div		$tmp42 $const12 $const24 	%argrw{"wrr"}
	mul		$tmp43 $tmp41 $tmp42 	%argrw{"wrr"}
	pow		$tmp36 $tmp43 $const25 	%argrw{"wrr"}
	return
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:25
#                color_srgb_to_scene_linear(c[1]),
	compref		$tmp45 Color $const3 	%line{25} %argrw{"wrr"}
	functioncall	$const20 100 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:8
#   if (c < 0.04045)
	lt		$tmp46 $tmp45 $const21 	%line{8} %argrw{"wrr"}
	if		$tmp46 95 100 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:9
#     return (c < 0.0) ? 0.0 : c * (1.0 / 12.92);
	lt		$tmp47 $tmp45 $const10 	%line{9} %argrw{"wrr"}
	if		$tmp47 92 94 	%argrw{"r"}
	assign		$tmp44 $const10 	%argrw{"wr"}
	div		$tmp48 $const12 $const22 	%argrw{"wrr"}
	mul		$tmp44 $tmp45 $tmp48 	%argrw{"wrr"}
	return
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:11
#     return pow((c + 0.055) * (1.0 / 1.055), 2.4);
	add		$tmp49 $tmp45 $const23 	%line{11} %argrw{"wrr"}
	div		$tmp50 $const12 $const24 	%argrw{"wrr"}
	mul		$tmp51 $tmp49 $tmp50 	%argrw{"wrr"}
	pow		$tmp44 $tmp51 $const25 	%argrw{"wrr"}
	return
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:26
#                color_srgb_to_scene_linear(c[2]));
	compref		$tmp53 Color $const7 	%line{26} %argrw{"wrr"}
	functioncall	$const20 115 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:8
#   if (c < 0.04045)
	lt		$tmp54 $tmp53 $const21 	%line{8} %argrw{"wrr"}
	if		$tmp54 110 115 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:9
#     return (c < 0.0) ? 0.0 : c * (1.0 / 12.92);
	lt		$tmp55 $tmp53 $const10 	%line{9} %argrw{"wrr"}
	if		$tmp55 107 109 	%argrw{"r"}
	assign		$tmp52 $const10 	%argrw{"wr"}
	div		$tmp56 $const12 $const22 	%argrw{"wrr"}
	mul		$tmp52 $tmp53 $tmp56 	%argrw{"wrr"}
	return
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:11
#     return pow((c + 0.055) * (1.0 / 1.055), 2.4);
	add		$tmp57 $tmp53 $const23 	%line{11} %argrw{"wrr"}
	div		$tmp58 $const12 $const24 	%argrw{"wrr"}
	mul		$tmp59 $tmp57 $tmp58 	%argrw{"wrr"}
	pow		$tmp52 $tmp59 $const25 	%argrw{"wrr"}
	return
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_color.h:24
#   return color(color_srgb_to_scene_linear(c[0]),
	color		Color $tmp36 $tmp44 $tmp52 	%line{24} %argrw{"wrrr"}
	end
