OpenShadingLanguage 1.00
# Compiled by oslc 1.5.11
shader node_brick_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}
param	float	Offset	0.5 		 %read{27,27} %write{2147483647,-1}
param	int	OffsetFrequency	2 		 %read{14,24} %write{2147483647,-1}
param	float	Squash	1 		 %read{22,22} %write{2147483647,-1}
param	int	SquashFrequency	1 		 %read{16,19} %write{2147483647,-1}
param	point	Vector	0 0 0 		 %read{1,1} %write{0,0}
param	color	Color1	0.2 0.2 0.2 		 %read{5,88} %write{2147483647,-1}
param	color	Color2	0.80000001 0.80000001 0.80000001 		 %read{89,89} %write{2147483647,-1}
param	color	Mortar	0 0 0 		 %read{93,93} %write{2147483647,-1}
param	float	Scale	5 		 %read{6,6} %write{2147483647,-1}
param	float	MortarSize	0.02 		 %read{63,77} %write{2147483647,-1}
param	float	Bias	0 		 %read{59,59} %write{2147483647,-1}
param	float	BrickWidth	0.5 		 %read{9,9} %write{2147483647,-1}
param	float	RowHeight	0.25 		 %read{11,77} %write{2147483647,-1}
oparam	float	Fac	0 		 %read{85,91} %write{82,83}
oparam	color	Color	0.2 0.2 0.2 		 %read{2147483647,-1} %write{93,94}
global	point	P	 %read{0,0} %write{2147483647,-1}
local	int	___655_nn	 %read{56,56} %write{55,55}
local	int	___656_bricknum	 %read{35,43} %write{32,32}
local	int	___656_rownum	 %read{19,42} %write{13,13}
local	float	___656_offset	 %read{29,34} %write{8,27}
local	float	___656_brick_width	 %read{23,71} %write{9,23}
local	float	___656_x	 %read{63,72} %write{37,37}
local	float	___656_y	 %read{66,78} %write{41,41}
local	point	p	 %read{3,6} %write{1,3}
local	float	tint	 %read{87,89} %write{4,62}
local	color	Col	 %read{94,94} %write{5,90}
local	float	___658_facm	 %read{88,88} %write{87,87}
const	float	$const1	0		 %read{4,83} %write{2147483647,-1}
temp	point	$tmp1	 %read{10,38} %write{6,6}
const	string	$const2	"brick"		 %read{7,7} %write{2147483647,-1}
temp	float	$tmp2	 %read{13,13} %write{12,12}
const	int	$const3	1		 %read{10,38} %write{2147483647,-1}
temp	float	$tmp3	 %read{11,11} %write{10,10}
temp	float	$tmp4	 %read{12,12} %write{11,11}
temp	int	$tmp5	 %read{15,18} %write{14,17}
const	int	$const4	0		 %read{14,79} %write{2147483647,-1}
temp	int	$tmp6	 %read{17,17} %write{16,16}
temp	float	$tmp7	 %read{23,23} %write{21,22}
temp	int	$tmp8	 %read{20,20} %write{19,19}
const	float	$const5	1		 %read{21,91} %write{2147483647,-1}
temp	int	$tmp9	 %read{25,25} %write{24,24}
temp	float	$tmp10	 %read{32,32} %write{31,31}
temp	float	$tmp11	 %read{29,29} %write{28,28}
temp	float	$tmp12	 %read{30,30} %write{29,29}
temp	float	$tmp13	 %read{31,31} %write{30,30}
temp	float	$tmp14	 %read{34,34} %write{33,33}
temp	float	$tmp15	 %read{37,37} %write{34,34}
temp	float	$tmp16	 %read{37,37} %write{36,36}
temp	float	$tmp17	 %read{36,36} %write{35,35}
temp	float	$tmp18	 %read{41,41} %write{38,38}
temp	float	$tmp19	 %read{41,41} %write{40,40}
temp	float	$tmp20	 %read{40,40} %write{39,39}
temp	float	$tmp21	 %read{59,59} %write{58,58}
const	int	$const6	16		 %read{42,42} %write{2147483647,-1}
temp	int	$tmp22	 %read{44,44} %write{42,42}
const	int	$const7	65535		 %read{43,43} %write{2147483647,-1}
temp	int	$tmp23	 %read{44,44} %write{43,43}
temp	int	$tmp24	 %read{46,53} %write{44,49}
const	string	$const8	"brick_noise"		 %read{45,45} %write{2147483647,-1}
const	int	$const9	1013		 %read{46,46} %write{2147483647,-1}
temp	int	$tmp25	 %read{47,47} %write{46,46}
const	int	$const10	2147483647		 %read{47,55} %write{2147483647,-1}
const	int	$const11	13		 %read{48,48} %write{2147483647,-1}
temp	int	$tmp26	 %read{49,49} %write{48,48}
temp	int	$tmp27	 %read{51,51} %write{50,50}
const	int	$const12	60493		 %read{51,51} %write{2147483647,-1}
temp	int	$tmp28	 %read{52,52} %write{51,51}
const	int	$const13	19990303		 %read{52,52} %write{2147483647,-1}
temp	int	$tmp29	 %read{53,53} %write{52,52}
temp	int	$tmp30	 %read{54,54} %write{53,53}
const	int	$const14	1376312589		 %read{54,54} %write{2147483647,-1}
temp	int	$tmp31	 %read{55,55} %write{54,54}
const	float	$const15	0.5		 %read{58,58} %write{2147483647,-1}
temp	float	$tmp32	 %read{57,57} %write{56,56}
const	float	$const16	1.0737418e+009		 %read{57,57} %write{2147483647,-1}
temp	float	$tmp33	 %read{58,58} %write{57,57}
temp	float	$tmp34	 %read{61,61} %write{59,59}
const	string	$const17	"clamp"		 %read{60,60} %write{2147483647,-1}
temp	float	$tmp35	 %read{62,62} %write{61,61}
temp	int	$tmp36	 %read{64,64} %write{63,63}
temp	int	$tmp37	 %read{65,69} %write{64,68}
temp	int	$tmp38	 %read{67,67} %write{66,66}
temp	int	$tmp39	 %read{68,68} %write{67,67}
temp	int	$tmp40	 %read{70,75} %write{69,74}
temp	float	$tmp41	 %read{72,72} %write{71,71}
temp	int	$tmp42	 %read{73,73} %write{72,72}
temp	int	$tmp43	 %read{74,74} %write{73,73}
temp	int	$tmp44	 %read{76,81} %write{75,80}
temp	float	$tmp45	 %read{78,78} %write{77,77}
temp	int	$tmp46	 %read{79,79} %write{78,78}
temp	int	$tmp47	 %read{80,80} %write{79,79}
temp	int	$tmp48	 %read{86,86} %write{85,85}
temp	color	$tmp49	 %read{90,90} %write{88,88}
temp	color	$tmp50	 %read{90,90} %write{89,89}
temp	int	$tmp51	 %read{92,92} %write{91,91}
code Vector
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:66
# 	point Vector = P,
	assign		Vector P 	%filename{"C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl"} %line{66} %argrw{"wr"}
code ___main___
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:78
# 	point p = Vector;
	assign		p Vector 	%filename{"C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl"} %line{78} %argrw{"wr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:80
# 	if (use_mapping)
	if		use_mapping 4 4 	%line{80} %argrw{"r"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:81
# 		p = transform(mapping, p);
	transform	p mapping p 	%line{81} %argrw{"wrr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:83
# 	float tint = 0.0;
	assign		tint $const1 	%line{83} %argrw{"wr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:84
# 	color Col = Color1;
	assign		Col Color1 	%line{84} %argrw{"wr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:86
# 	Fac = brick(p * Scale, MortarSize, Bias, BrickWidth, RowHeight,
	mul		$tmp1 p Scale 	%line{86} %argrw{"wrr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:87
# 		Offset, OffsetFrequency, Squash, SquashFrequency, tint);
	functioncall	$const2 85 	%line{87} %argrw{"r"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:36
# 	float offset = 0.0;
	assign		___656_offset $const1 	%line{36} %argrw{"wr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:37
# 	float brick_width = BrickWidth;
	assign		___656_brick_width BrickWidth 	%line{37} %argrw{"wr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:40
# 	rownum = (int)floor(p[1] / row_height);
	compref		$tmp3 $tmp1 $const3 	%line{40} %argrw{"wrr"}
	div		$tmp4 $tmp3 RowHeight 	%argrw{"wrr"}
	floor		$tmp2 $tmp4 	%argrw{"wr"}
	assign		___656_rownum $tmp2 	%argrw{"wr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:42
# 	if (offset_frequency && squash_frequency) {
	neq		$tmp5 OffsetFrequency $const4 	%line{42} %argrw{"wrr"}
	if		$tmp5 18 18 	%argrw{"r"}
	neq		$tmp6 SquashFrequency $const4 	%argrw{"wrr"}
	assign		$tmp5 $tmp6 	%argrw{"wr"}
	if		$tmp5 28 28 	%argrw{"r"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:43
# 		brick_width *= (rownum % squash_frequency) ? 1.0 : squash_amount;                /* squash */
	mod		$tmp8 ___656_rownum SquashFrequency 	%line{43} %argrw{"wrr"}
	if		$tmp8 22 23 	%argrw{"r"}
	assign		$tmp7 $const5 	%argrw{"wr"}
	assign		$tmp7 Squash 	%argrw{"wr"}
	mul		___656_brick_width ___656_brick_width $tmp7 	%argrw{"wrr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:44
# 		offset       = (rownum % offset_frequency) ? 0.0 : (brick_width * offset_amount);  /* offset */
	mod		$tmp9 ___656_rownum OffsetFrequency 	%line{44} %argrw{"wrr"}
	if		$tmp9 27 28 	%argrw{"r"}
	assign		___656_offset $const1 	%argrw{"wr"}
	mul		___656_offset ___656_brick_width Offset 	%argrw{"wrr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:47
# 	bricknum = (int)floor((p[0] + offset) / brick_width);
	compref		$tmp11 $tmp1 $const4 	%line{47} %argrw{"wrr"}
	add		$tmp12 $tmp11 ___656_offset 	%argrw{"wrr"}
	div		$tmp13 $tmp12 ___656_brick_width 	%argrw{"wrr"}
	floor		$tmp10 $tmp13 	%argrw{"wr"}
	assign		___656_bricknum $tmp10 	%argrw{"wr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:49
# 	x = (p[0] + offset) - brick_width * bricknum;
	compref		$tmp14 $tmp1 $const4 	%line{49} %argrw{"wrr"}
	add		$tmp15 $tmp14 ___656_offset 	%argrw{"wrr"}
	assign		$tmp17 ___656_bricknum 	%argrw{"wr"}
	mul		$tmp16 ___656_brick_width $tmp17 	%argrw{"wrr"}
	sub		___656_x $tmp15 $tmp16 	%argrw{"wrr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:50
# 	y = p[1] - row_height * rownum;
	compref		$tmp18 $tmp1 $const3 	%line{50} %argrw{"wrr"}
	assign		$tmp20 ___656_rownum 	%argrw{"wr"}
	mul		$tmp19 RowHeight $tmp20 	%argrw{"wrr"}
	sub		___656_y $tmp18 $tmp19 	%argrw{"wrr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:52
# 	tint = clamp((brick_noise((rownum << 16) + (bricknum & 65535)) + bias), 0.0, 1.0);
	shl		$tmp22 ___656_rownum $const6 	%line{52} %argrw{"wrr"}
	bitand		$tmp23 ___656_bricknum $const7 	%argrw{"wrr"}
	add		$tmp24 $tmp22 $tmp23 	%argrw{"wrr"}
	functioncall	$const8 59 	%argrw{"r"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:25
# 	n = (n + 1013) & 2147483647;
	add		$tmp25 $tmp24 $const9 	%line{25} %argrw{"wrr"}
	bitand		$tmp24 $tmp25 $const10 	%argrw{"wrr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:26
# 	n = (n >> 13) ^ n;
	shr		$tmp26 $tmp24 $const11 	%line{26} %argrw{"wrr"}
	xor		$tmp24 $tmp26 $tmp24 	%argrw{"wrr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:27
# 	nn = (n * (n * n * 60493 + 19990303) + 1376312589) & 2147483647;
	mul		$tmp27 $tmp24 $tmp24 	%line{27} %argrw{"wrr"}
	mul		$tmp28 $tmp27 $const12 	%argrw{"wrr"}
	add		$tmp29 $tmp28 $const13 	%argrw{"wrr"}
	mul		$tmp30 $tmp24 $tmp29 	%argrw{"wrr"}
	add		$tmp31 $tmp30 $const14 	%argrw{"wrr"}
	bitand		___655_nn $tmp31 $const10 	%argrw{"wrr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:28
# 	return 0.5 * ((float)nn / 1073741824.0);
	assign		$tmp32 ___655_nn 	%line{28} %argrw{"wr"}
	div		$tmp33 $tmp32 $const16 	%argrw{"wrr"}
	mul		$tmp21 $const15 $tmp33 	%argrw{"wrr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:52
# 	tint = clamp((brick_noise((rownum << 16) + (bricknum & 65535)) + bias), 0.0, 1.0);
	add		$tmp34 $tmp21 Bias 	%line{52} %argrw{"wrr"}
	functioncall	$const17 63 	%argrw{"r"}
# C:/dev\\blender\\intern\\cycles\\kernel\\shaders\\stdosl.h:144
# PERCOMP1 (acos)
	min		$tmp35 $tmp34 $const5 	%filename{"C:/dev\\blender\\intern\\cycles\\kernel\\shaders\\stdosl.h"} %line{144} %argrw{"wrr"}
	max		tint $tmp35 $const1 	%argrw{"wrr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:54
# 	return (x < mortar_size || y < mortar_size ||
	lt		$tmp36 ___656_x MortarSize 	%filename{"C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl"} %line{54} %argrw{"wrr"}
	neq		$tmp37 $tmp36 $const4 	%argrw{"wrr"}
	if		$tmp37 66 69 	%argrw{"r"}
	lt		$tmp38 ___656_y MortarSize 	%argrw{"wrr"}
	neq		$tmp39 $tmp38 $const4 	%argrw{"wrr"}
	assign		$tmp37 $tmp39 	%argrw{"wr"}
	neq		$tmp40 $tmp37 $const4 	%argrw{"wrr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:55
# 	        x > (brick_width - mortar_size) ||
	if		$tmp40 71 75 	%line{55} %argrw{"r"}
	sub		$tmp41 ___656_brick_width MortarSize 	%argrw{"wrr"}
	gt		$tmp42 ___656_x $tmp41 	%argrw{"wrr"}
	neq		$tmp43 $tmp42 $const4 	%argrw{"wrr"}
	assign		$tmp40 $tmp43 	%argrw{"wr"}
	neq		$tmp44 $tmp40 $const4 	%argrw{"wrr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:56
# 	        y > (row_height - mortar_size)) ? 1.0 : 0.0;
	if		$tmp44 77 81 	%line{56} %argrw{"r"}
	sub		$tmp45 RowHeight MortarSize 	%argrw{"wrr"}
	gt		$tmp46 ___656_y $tmp45 	%argrw{"wrr"}
	neq		$tmp47 $tmp46 $const4 	%argrw{"wrr"}
	assign		$tmp44 $tmp47 	%argrw{"wr"}
	if		$tmp44 83 84 	%argrw{"r"}
	assign		Fac $const5 	%argrw{"wr"}
	assign		Fac $const1 	%argrw{"wr"}
	return
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:89
# 	if (Fac != 1.0) {
	neq		$tmp48 Fac $const5 	%line{89} %argrw{"wrr"}
	if		$tmp48 91 91 	%argrw{"r"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:90
# 		float facm = 1.0 - tint;
	sub		___658_facm $const5 tint 	%line{90} %argrw{"wrr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:91
# 		Col = facm * Color1 + tint * Color2;
	mul		$tmp49 ___658_facm Color1 	%line{91} %argrw{"wrr"}
	mul		$tmp50 tint Color2 	%argrw{"wrr"}
	add		Col $tmp49 $tmp50 	%argrw{"wrr"}
# C:/dev/blender/intern/cycles/kernel/shaders/node_brick_texture.osl:94
# 	Color = (Fac == 1.0) ? Mortar : Col;
	eq		$tmp51 Fac $const5 	%line{94} %argrw{"wrr"}
	if		$tmp51 94 95 	%argrw{"r"}
	assign		Color Mortar 	%argrw{"wr"}
	assign		Color Col 	%argrw{"wr"}
	end
