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_float_curve.oso
shader node_float_curve
param	float[]	ramp	0		%read{5,60} %write{2147483647,-1}
param	float	min_x	0		%read{0,1} %write{2147483647,-1}
param	float	max_x	1		%read{1,1} %write{2147483647,-1}
param	int	extrapolate	1		%read{14,14} %write{2147483647,-1}
param	float	ValueIn	0		%read{0,64} %write{2147483647,-1}
param	float	Factor	0		%read{64,64} %write{2147483647,-1}
oparam	float	ValueOut	0		%read{64,64} %write{33,64}
local	float	___334_f	%read{6,49} %write{4,40}
local	int	___334_table_size	%read{23,47} %write{5,5}
local	float	___335_t0	%read{21,33} %write{19,24}
local	float	___335_dy	%read{29,29} %write{21,27}
local	int	___334_i	%read{42,59} %write{41,47}
local	float	___334_t	%read{53,61} %write{49,49}
local	float	___334_result	%read{58,63} %write{50,62}
local	float	c	%read{4,36} %write{2,2}
temp	float	$tmp1	%read{2,2} %write{0,0}
temp	float	$tmp2	%read{2,2} %write{1,1}
const	int	$const1	1		%read{20,59} %write{2147483647,-1}
const	string	$const2	"rgb_ramp_lookup"		%read{3,3} %write{2147483647,-1}
const	float	$const3	0		%read{6,53} %write{2147483647,-1}
temp	int	$tmp3	%read{7,7} %write{6,6}
temp	int	$tmp4	%read{8,12} %write{7,11}
const	int	$const4	0		%read{7,54} %write{2147483647,-1}
const	float	$const5	1		%read{9,57} %write{2147483647,-1}
temp	int	$tmp5	%read{10,10} %write{9,9}
temp	int	$tmp6	%read{11,11} %write{10,10}
temp	int	$tmp7	%read{13,16} %write{12,15}
temp	int	$tmp8	%read{15,15} %write{14,14}
temp	int	$tmp9	%read{18,18} %write{17,17}
temp	float	$tmp10	%read{21,21} %write{20,20}
temp	int	$tmp11	%read{24,24} %write{23,23}
const	int	$const6	2		%read{25,25} %write{2147483647,-1}
temp	int	$tmp12	%read{26,26} %write{25,25}
temp	float	$tmp13	%read{27,27} %write{26,26}
temp	float	$tmp14	%read{32,32} %write{29,29}
temp	int	$tmp15	%read{31,31} %write{30,30}
temp	float	$tmp16	%read{33,33} %write{32,32}
temp	float	$tmp17	%read{32,32} %write{31,31}
temp	float	$tmp18	%read{40,40} %write{37,37}
const	string	$const7	"clamp"		%read{35,35} %write{2147483647,-1}
temp	float	$tmp19	%read{37,37} %write{36,36}
temp	int	$tmp20	%read{39,39} %write{38,38}
temp	float	$tmp21	%read{40,40} %write{39,39}
temp	int	$tmp22	%read{43,43} %write{42,42}
temp	int	$tmp23	%read{46,46} %write{45,45}
temp	float	$tmp24	%read{49,49} %write{48,48}
temp	int	$tmp25	%read{52,56} %write{51,55}
temp	int	$tmp26	%read{54,54} %write{53,53}
temp	int	$tmp27	%read{55,55} %write{54,54}
temp	float	$tmp28	%read{58,58} %write{57,57}
temp	float	$tmp29	%read{62,62} %write{58,58}
temp	int	$tmp30	%read{60,60} %write{59,59}
temp	float	$tmp31	%read{61,61} %write{60,60}
temp	float	$tmp32	%read{62,62} %write{61,61}
code ___main___
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_float_curve.osl:16
#   float c = (ValueIn - min_x) / (max_x - min_x);
	sub		$tmp1 ValueIn min_x 	%filename{"/build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_float_curve.osl"} %line{16} %argrw{"wrr"}
	sub		$tmp2 max_x min_x 	%argrw{"wrr"}
	div		c $tmp1 $tmp2 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_float_curve.osl:18
#   ValueOut = rgb_ramp_lookup(ramp, c, 1, extrapolate);
	functioncall	$const2 64 	%line{18} %argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:46
#   float f = at;
	assign		___334_f c 	%filename{"/build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h"} %line{46} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:47
#   int table_size = arraylength(ramp);
	arraylength	___334_table_size ramp 	%line{47} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:49
#   if ((f < 0.0 || f > 1.0) && extrapolate) {
	lt		$tmp3 ___334_f $const3 	%line{49} %argrw{"wrr"}
	neq		$tmp4 $tmp3 $const4 	%argrw{"wrr"}
	if		$tmp4 9 12 	%argrw{"r"}
	gt		$tmp5 ___334_f $const5 	%argrw{"wrr"}
	neq		$tmp6 $tmp5 $const4 	%argrw{"wrr"}
	assign		$tmp4 $tmp6 	%argrw{"wr"}
	neq		$tmp7 $tmp4 $const4 	%argrw{"wrr"}
	if		$tmp7 16 16 	%argrw{"r"}
	neq		$tmp8 extrapolate $const4 	%argrw{"wrr"}
	assign		$tmp7 $tmp8 	%argrw{"wr"}
	if		$tmp7 35 35 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:51
#     if (f < 0.0) {
	lt		$tmp9 ___334_f $const3 	%line{51} %argrw{"wrr"}
	if		$tmp9 23 29 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:52
#       t0 = ramp[0];
	aref		___335_t0 ramp $const4 	%line{52} %argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:53
#       dy = t0 - ramp[1];
	aref		$tmp10 ramp $const1 	%line{53} %argrw{"wrr"}
	sub		___335_dy ___335_t0 $tmp10 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:54
#       f = -f;
	neg		___334_f ___334_f 	%line{54} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:57
#       t0 = ramp[table_size - 1];
	sub		$tmp11 ___334_table_size $const1 	%line{57} %argrw{"wrr"}
	aref		___335_t0 ramp $tmp11 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:58
#       dy = t0 - ramp[table_size - 2];
	sub		$tmp12 ___334_table_size $const6 	%line{58} %argrw{"wrr"}
	aref		$tmp13 ramp $tmp12 	%argrw{"wrr"}
	sub		___335_dy ___335_t0 $tmp13 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:59
#       f = f - 1.0;
	sub		___334_f ___334_f $const5 	%line{59} %argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:61
#     return t0 + dy * f * (table_size - 1);
	mul		$tmp14 ___335_dy ___334_f 	%line{61} %argrw{"wrr"}
	sub		$tmp15 ___334_table_size $const1 	%argrw{"wrr"}
	assign		$tmp17 $tmp15 	%argrw{"wr"}
	mul		$tmp16 $tmp14 $tmp17 	%argrw{"wrr"}
	add		ValueOut ___335_t0 $tmp16 	%argrw{"wrr"}
	return
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:64
#   f = clamp(at, 0.0, 1.0) * (table_size - 1);
	functioncall	$const7 38 	%line{64} %argrw{"r"}
# /usr/share/OSL/shaders/stdosl.h:141
# float  clamp (float x, float minval, float maxval) { return max(min(x,maxval),minval); }
	min		$tmp19 c $const5 	%filename{"/usr/share/OSL/shaders/stdosl.h"} %line{141} %argrw{"wrr"}
	max		$tmp18 $tmp19 $const3 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:64
#   f = clamp(at, 0.0, 1.0) * (table_size - 1);
	sub		$tmp20 ___334_table_size $const1 	%filename{"/build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h"} %line{64} %argrw{"wrr"}
	assign		$tmp21 $tmp20 	%argrw{"wr"}
	mul		___334_f $tmp18 $tmp21 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:67
#   int i = (int)f;
	assign		___334_i ___334_f 	%line{67} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:68
#   if (i < 0)
	lt		$tmp22 ___334_i $const4 	%line{68} %argrw{"wrr"}
	if		$tmp22 45 45 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:69
#     i = 0;
	assign		___334_i $const4 	%line{69} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:70
#   if (i >= table_size)
	ge		$tmp23 ___334_i ___334_table_size 	%line{70} %argrw{"wrr"}
	if		$tmp23 48 48 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:71
#     i = table_size - 1;
	sub		___334_i ___334_table_size $const1 	%line{71} %argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:72
#   float t = f - (float)i;
	assign		$tmp24 ___334_i 	%line{72} %argrw{"wr"}
	sub		___334_t ___334_f $tmp24 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:74
#   float result = ramp[i];
	aref		___334_result ramp ___334_i 	%line{74} %argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:76
#   if (interpolate && t > 0.0)
	neq		$tmp25 $const1 $const4 	%line{76} %argrw{"wrr"}
	if		$tmp25 56 56 	%argrw{"r"}
	gt		$tmp26 ___334_t $const3 	%argrw{"wrr"}
	neq		$tmp27 $tmp26 $const4 	%argrw{"wrr"}
	assign		$tmp25 $tmp27 	%argrw{"wr"}
	if		$tmp25 63 63 	%argrw{"r"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:77
#     result = (1.0 - t) * result + t * ramp[i + 1];
	sub		$tmp28 $const5 ___334_t 	%line{77} %argrw{"wrr"}
	mul		$tmp29 $tmp28 ___334_result 	%argrw{"wrr"}
	add		$tmp30 ___334_i $const1 	%argrw{"wrr"}
	aref		$tmp31 ramp $tmp30 	%argrw{"wrr"}
	mul		$tmp32 ___334_t $tmp31 	%argrw{"wrr"}
	add		___334_result $tmp29 $tmp32 	%argrw{"wrr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_ramp_util.h:79
#   return result;
	assign		ValueOut ___334_result 	%line{79} %argrw{"wr"}
# /build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_float_curve.osl:20
#   ValueOut = mix(ValueIn, ValueOut, Factor);
	mix		ValueOut ValueIn ValueOut Factor 	%filename{"/build/blender/src/blender/intern/cycles/kernel/osl/shaders/node_float_curve.osl"} %line{20} %argrw{"wrrr"}
	end
