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