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_ies_light.oso
shader node_ies_light
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	string	filename	""		%read{12,12} %write{2147483647,-1}
param	float	Strength	1		%read{13,13} %write{2147483647,-1}
param	point	Vector	0 0 0		%read{1,1} %write{0,0} %derivs %initexpr
oparam	float	Fac	0		%read{2147483647,-1} %write{13,13}
global	vector	I	%read{0,0} %write{2147483647,-1} %derivs
local	point	p	%read{3,9} %write{1,4} %derivs
local	float	v_angle	%read{12,12} %write{7,7} %derivs
local	float	h_angle	%read{12,12} %write{11,11} %derivs
const	int	$const1	2		%read{5,5} %write{2147483647,-1}
temp	float	$tmp1	%read{6,6} %write{5,5} %derivs
temp	float	$tmp2	%read{7,7} %write{6,6} %derivs
temp	float	$tmp3	%read{11,11} %write{10,10} %derivs
const	int	$const2	0		%read{8,8} %write{2147483647,-1}
temp	float	$tmp4	%read{10,10} %write{8,8} %derivs
const	int	$const3	1		%read{9,9} %write{2147483647,-1}
temp	float	$tmp5	%read{10,10} %write{9,9} %derivs
const	float	$const4	3.14159274		%read{11,11} %write{2147483647,-1}
temp	float	$tmp6	%read{13,13} %write{12,12}
code Vector
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ies_light.osl:12
#                       point Vector = I,
	assign		Vector I 	%filename{"/build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ies_light.osl"} %line{12} %argrw{"wr"}
code ___main___
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ies_light.osl:15
#   point p = Vector;
	assign		p Vector 	%filename{"/build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ies_light.osl"} %line{15} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ies_light.osl:17
#   if (use_mapping) {
	if		use_mapping 4 4 	%line{17} %argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ies_light.osl:18
#     p = transform(mapping, p);
	transform	p mapping p 	%line{18} %argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ies_light.osl:21
#   p = normalize((vector)p);
	normalize	p p 	%line{21} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ies_light.osl:23
#   float v_angle = acos(-p[2]);
	compref		$tmp1 p $const1 	%line{23} %argrw{"wrr"}
	neg		$tmp2 $tmp1 	%argrw{"wr"}
	acos		v_angle $tmp2 	%argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ies_light.osl:24
#   float h_angle = atan2(p[0], p[1]) + M_PI;
	compref		$tmp4 p $const2 	%line{24} %argrw{"wrr"}
	compref		$tmp5 p $const3 	%argrw{"wrr"}
	atan2		$tmp3 $tmp4 $tmp5 	%argrw{"wrr"}
	add		h_angle $tmp3 $const4 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ies_light.osl:26
#   Fac = Strength * texture(filename, h_angle, v_angle);
	texture		$tmp6 filename h_angle v_angle 	%line{26} %argrw{"wrrr"} %argderivs{2,3}
	mul		Fac Strength $tmp6 	%argrw{"wrr"}
	end
