// Geometric Tools, Inc.
// http://www.geometrictools.com
// Copyright (c) 1998-2005.  All Rights Reserved
//
// The Wild Magic Library (WM3) source code is supplied under the terms of
// the license agreement
//     http://www.geometrictools.com/License/WildMagic3License.pdf
// and may not be copied or disclosed except in accordance with the terms
// of that agreement.

#include "Wm3VertexNoiseVShader.h"
using namespace Wm3;

WM3_IMPLEMENT_RTTI(Wm3,VertexNoiseVShader,VertexShader);
WM3_IMPLEMENT_STREAM(VertexNoiseVShader);
WM3_IMPLEMENT_DEFAULT_STREAM(VertexNoiseVShader,VertexShader);
WM3_IMPLEMENT_DEFAULT_NAME_ID(VertexNoiseVShader,VertexShader);

//----------------------------------------------------------------------------
VertexNoiseVShader::VertexNoiseVShader ()
{
    // shader program (load the type of the current renderer)
    m_acProgram = ms_aacProgram[Renderer::GetType()];

    // shader constants
    int iType, iOption, iReg, iRegQuantity;
    ShaderConstant* pkConst;

    // model-to-view * projection matrix (4x4)
    iType = ShaderConstant::SC_TRANSFORM_MVP;
    iOption = ShaderConstant::SCO_MATRIX;
    iReg = 0;
    iRegQuantity = 4;
    pkConst = new ShaderConstant(iType,iOption,iReg,iRegQuantity);
    m_kConstant.Append(pkConst);

    // user defined vector (register 4)
    // NoiseTranslate
    iType = ShaderConstant::SC_USER_DEFINED;
    iOption = ShaderConstant::SCO_NONE;
    iReg = 4;
    iRegQuantity = 1;
    pkConst = new ShaderConstant(iType,iOption,iReg,iRegQuantity);
    m_kConstant.Append(pkConst);

    // user defined vector (register 5)
    // NoiseScale
    iType = ShaderConstant::SC_USER_DEFINED;
    iOption = ShaderConstant::SCO_NONE;
    iReg = 5;
    iRegQuantity = 1;
    pkConst = new ShaderConstant(iType,iOption,iReg,iRegQuantity);
    m_kConstant.Append(pkConst);

    // user defined vector (register 6)
    // Displacement
    iType = ShaderConstant::SC_USER_DEFINED;
    iOption = ShaderConstant::SCO_NONE;
    iReg = 6;
    iRegQuantity = 1;
    pkConst = new ShaderConstant(iType,iOption,iReg,iRegQuantity);
    m_kConstant.Append(pkConst);

    // user defined array (register 7)
    // Pg
    iType = ShaderConstant::SC_USER_DEFINED;
    iOption = ShaderConstant::SCO_NONE;
    iReg = 7;
    iRegQuantity = 66;
    pkConst = new ShaderConstant(iType,iOption,iReg,iRegQuantity);
    m_kConstant.Append(pkConst);

    // user defined vector (register 73)
    // BaseColor
    iType = ShaderConstant::SC_USER_DEFINED;
    iOption = ShaderConstant::SCO_NONE;
    iReg = 73;
    iRegQuantity = 1;
    pkConst = new ShaderConstant(iType,iOption,iReg,iRegQuantity);
    m_kConstant.Append(pkConst);

    // numerical constant vector (register 74)
    iType = ShaderConstant::SC_NUMERICAL_CONSTANT;
    iOption = ShaderConstant::SCO_NONE;
    iReg = 74;
    iRegQuantity = 1;
    pkConst = new ShaderConstant(iType,iOption,iReg,iRegQuantity);
    pkConst->SetRegisterData(0,(float)10000,(float)10000,(float)10000,(float)0);
    m_kConstant.Append(pkConst);

    // numerical constant vector (register 76)
    iType = ShaderConstant::SC_NUMERICAL_CONSTANT;
    iOption = ShaderConstant::SCO_NONE;
    iReg = 76;
    iRegQuantity = 1;
    pkConst = new ShaderConstant(iType,iOption,iReg,iRegQuantity);
    pkConst->SetRegisterData(0,(float)1,(float)0,(float)0,(float)0);
    m_kConstant.Append(pkConst);

    // numerical constant vector (register 77)
    iType = ShaderConstant::SC_NUMERICAL_CONSTANT;
    iOption = ShaderConstant::SCO_NONE;
    iReg = 77;
    iRegQuantity = 1;
    pkConst = new ShaderConstant(iType,iOption,iReg,iRegQuantity);
    pkConst->SetRegisterData(0,(float)3,(float)3,(float)3,(float)0);
    m_kConstant.Append(pkConst);

    // numerical constant vector (register 78)
    iType = ShaderConstant::SC_NUMERICAL_CONSTANT;
    iOption = ShaderConstant::SCO_NONE;
    iReg = 78;
    iRegQuantity = 1;
    pkConst = new ShaderConstant(iType,iOption,iReg,iRegQuantity);
    pkConst->SetRegisterData(0,(float)2,(float)2,(float)2,(float)0);
    m_kConstant.Append(pkConst);

    // numerical constant vector (register 75)
    iType = ShaderConstant::SC_NUMERICAL_CONSTANT;
    iOption = ShaderConstant::SCO_NONE;
    iReg = 75;
    iRegQuantity = 1;
    pkConst = new ShaderConstant(iType,iOption,iReg,iRegQuantity);
    pkConst->SetRegisterData(0,(float)0.03125,(float)32,(float)0.5,(float)0.3);
    m_kConstant.Append(pkConst);

}
//----------------------------------------------------------------------------
VertexNoiseVShader::~VertexNoiseVShader ()
{
    // empty
}
//----------------------------------------------------------------------------
const char* VertexNoiseVShader::ms_aacProgram[Renderer::RT_QUANTITY] =
{
"!!ARBvp1.0\n"
"# ARB_vertex_program generated by NVIDIA Cg compiler\n"
"# cgc version 1.1.0003, build date Mar  4 2003  12:32:10\n"
"# command line args: -q -profile arbvp1 -entry vmain\n"
"# nv30vp backend compiling 'vmain' program\n"
"PARAM c74 = { 10000, 10000, 10000, 0 };\n"
"PARAM c76 = { 1, 0, 0, 0 };\n"
"PARAM c77 = { 3, 3, 3, 0 };\n"
"PARAM c78 = { 2, 2, 2, 0 };\n"
"PARAM c75 = { 0.03125, 32, 0.5, 0.3 };\n"
"#vendor NVIDIA Corporation\n"
"#version 1.0.02\n"
"#profile arbvp1\n"
"#program vmain\n"
"#semantic vmain.Wm3TransformMVP\n"
"#semantic vmain.NoiseTranslate\n"
"#semantic vmain.NoiseScale\n"
"#semantic vmain.Displacement\n"
"#semantic vmain.pg\n"
"#semantic vmain.BaseColor\n"
"#var float4 iPosition : $vin.POSITION : POSITION : 0 : 1\n"
"#var float4 iNormal : $vin.NORMAL0 : NORMAL0 : 1 : 1\n"
"#var float4 oColor0 : $vout.COLOR : COLOR : 2 : 1\n"
"#var float4 oPosition : $vout.POSITION : POSITION : 3 : 1\n"
"#var float4x4 Wm3TransformMVP :  : c[0], 4 : 4 : 1\n"
"#var float4 NoiseTranslate :  : c[4] : 5 : 1\n"
"#var float NoiseScale :  : c[5] : 6 : 1\n"
"#var float Displacement :  : c[6] : 7 : 1\n"
"#var float4 pg[0] :  : c[7] : 8 : 1\n"
"#var float4 pg[1] :  : c[8] : 8 : 1\n"
"#var float4 pg[2] :  : c[9] : 8 : 1\n"
"#var float4 pg[3] :  : c[10] : 8 : 1\n"
"#var float4 pg[4] :  : c[11] : 8 : 1\n"
"#var float4 pg[5] :  : c[12] : 8 : 1\n"
"#var float4 pg[6] :  : c[13] : 8 : 1\n"
"#var float4 pg[7] :  : c[14] : 8 : 1\n"
"#var float4 pg[8] :  : c[15] : 8 : 1\n"
"#var float4 pg[9] :  : c[16] : 8 : 1\n"
"#var float4 pg[10] :  : c[17] : 8 : 1\n"
"#var float4 pg[11] :  : c[18] : 8 : 1\n"
"#var float4 pg[12] :  : c[19] : 8 : 1\n"
"#var float4 pg[13] :  : c[20] : 8 : 1\n"
"#var float4 pg[14] :  : c[21] : 8 : 1\n"
"#var float4 pg[15] :  : c[22] : 8 : 1\n"
"#var float4 pg[16] :  : c[23] : 8 : 1\n"
"#var float4 pg[17] :  : c[24] : 8 : 1\n"
"#var float4 pg[18] :  : c[25] : 8 : 1\n"
"#var float4 pg[19] :  : c[26] : 8 : 1\n"
"#var float4 pg[20] :  : c[27] : 8 : 1\n"
"#var float4 pg[21] :  : c[28] : 8 : 1\n"
"#var float4 pg[22] :  : c[29] : 8 : 1\n"
"#var float4 pg[23] :  : c[30] : 8 : 1\n"
"#var float4 pg[24] :  : c[31] : 8 : 1\n"
"#var float4 pg[25] :  : c[32] : 8 : 1\n"
"#var float4 pg[26] :  : c[33] : 8 : 1\n"
"#var float4 pg[27] :  : c[34] : 8 : 1\n"
"#var float4 pg[28] :  : c[35] : 8 : 1\n"
"#var float4 pg[29] :  : c[36] : 8 : 1\n"
"#var float4 pg[30] :  : c[37] : 8 : 1\n"
"#var float4 pg[31] :  : c[38] : 8 : 1\n"
"#var float4 pg[32] :  : c[39] : 8 : 1\n"
"#var float4 pg[33] :  : c[40] : 8 : 1\n"
"#var float4 pg[34] :  : c[41] : 8 : 1\n"
"#var float4 pg[35] :  : c[42] : 8 : 1\n"
"#var float4 pg[36] :  : c[43] : 8 : 1\n"
"#var float4 pg[37] :  : c[44] : 8 : 1\n"
"#var float4 pg[38] :  : c[45] : 8 : 1\n"
"#var float4 pg[39] :  : c[46] : 8 : 1\n"
"#var float4 pg[40] :  : c[47] : 8 : 1\n"
"#var float4 pg[41] :  : c[48] : 8 : 1\n"
"#var float4 pg[42] :  : c[49] : 8 : 1\n"
"#var float4 pg[43] :  : c[50] : 8 : 1\n"
"#var float4 pg[44] :  : c[51] : 8 : 1\n"
"#var float4 pg[45] :  : c[52] : 8 : 1\n"
"#var float4 pg[46] :  : c[53] : 8 : 1\n"
"#var float4 pg[47] :  : c[54] : 8 : 1\n"
"#var float4 pg[48] :  : c[55] : 8 : 1\n"
"#var float4 pg[49] :  : c[56] : 8 : 1\n"
"#var float4 pg[50] :  : c[57] : 8 : 1\n"
"#var float4 pg[51] :  : c[58] : 8 : 1\n"
"#var float4 pg[52] :  : c[59] : 8 : 1\n"
"#var float4 pg[53] :  : c[60] : 8 : 1\n"
"#var float4 pg[54] :  : c[61] : 8 : 1\n"
"#var float4 pg[55] :  : c[62] : 8 : 1\n"
"#var float4 pg[56] :  : c[63] : 8 : 1\n"
"#var float4 pg[57] :  : c[64] : 8 : 1\n"
"#var float4 pg[58] :  : c[65] : 8 : 1\n"
"#var float4 pg[59] :  : c[66] : 8 : 1\n"
"#var float4 pg[60] :  : c[67] : 8 : 1\n"
"#var float4 pg[61] :  : c[68] : 8 : 1\n"
"#var float4 pg[62] :  : c[69] : 8 : 1\n"
"#var float4 pg[63] :  : c[70] : 8 : 1\n"
"#var float4 pg[64] :  : c[71] : 8 : 1\n"
"#var float4 pg[65] :  : c[72] : 8 : 1\n"
"#var float4 BaseColor :  : c[73] : 9 : 1\n"
"TEMP R0, R1, R2, R3, R4, R5;\n"
"ADDRESS A0;\n"
"ATTRIB v18 = vertex.normal;\n"
"ATTRIB v16 = vertex.position;\n"
"PARAM c0[4] = { program.local[0..3] };\n"
"PARAM c6 = program.local[6];\n"
"PARAM c73 = program.local[73];\n"
"PARAM c7[66] = { program.local[7..72] };\n"
"PARAM c5 = program.local[5];\n"
"PARAM c4 = program.local[4];\n"
"	ADD R0.yzw, v16.xxyz, c4.xxyz;\n"
"	MOV R0.x, c5;\n"
"	MAD R1.xyz, R0.yzwy, R0.x, c74.xyzx;\n"
"	FRC R0.xyz, R1.xyzx;\n"
"	ADD R4.xyz, R0.xyzx, -c76.yyxy;\n"
"	MUL R1.xyz, R1.xyzx, c75.x;\n"
"	FRC R1.xyz, R1.xyzx;\n"
"	MUL R3.xyz, R1.xyzx, c75.y;\n"
"	ARL A0.x, R3.x;\n"
"	MOV R1.x, c7[A0.x].w;\n"
"	MOV R1.y, c7[A0.x + 1].w;\n"
"	ADD R2.xy, R1.xyxx, R3.y;\n"
"	ARL A0.x, R2.x;\n"
"	MOV R0.w, c7[A0.x];\n"
"	ARL A0.x, R2.y;\n"
"	MOV R1.x, R0.w;\n"
"	MOV R1.y, c7[A0.x].w;\n"
"	ARL A0.x, R2.x;\n"
"	MOV R1.z, c7[A0.x + 1].w;\n"
"	ARL A0.x, R2.y;\n"
"	MOV R1.w, c7[A0.x + 1].w;\n"
"	ADD R3, R1, R3.z;\n"
"	ARL A0.x, R3.x;\n"
"	DP3 R2.x, c7[A0.x + 1].xyzx, R4.xyzx;\n"
"	ADD R1.xyz, R0.xyzx, -c76.xyxx;\n"
"	ARL A0.x, R3.y;\n"
"	DP3 R2.y, c7[A0.x + 1].xyzx, R1.xyzx;\n"
"	ADD R1.xyz, R0.xyzx, -c76.yxxy;\n"
"	ARL A0.x, R3.z;\n"
"	DP3 R2.z, c7[A0.x + 1].xyzx, R1.xyzx;\n"
"	ADD R1.xyz, R0.xyzx, -c76.x;\n"
"	ARL A0.x, R3.w;\n"
"	DP3 R2.w, c7[A0.x + 1].xyzx, R1.xyzx;\n"
"	ARL A0.x, R3.x;\n"
"	DP3 R5.x, c7[A0.x].xyzx, R0.xyzx;\n"
"	ADD R1.xyz, R0.xyzx, -c76.xyzx;\n"
"	ARL A0.x, R3.y;\n"
"	DP3 R5.y, c7[A0.x].xyzx, R1.xyzx;\n"
"	ADD R1.xyz, R0.xyzx, -c76.yxyy;\n"
"	ARL A0.x, R3.z;\n"
"	DP3 R5.z, c7[A0.x].xyzx, R1.xyzx;\n"
"	ADD R1.xyz, R0.xyzx, -c76.xxyx;\n"
"	ARL A0.x, R3.w;\n"
"	DP3 R5.w, c7[A0.x].xyzx, R1.xyzx;\n"
"	ADD R4, R2, -R5;\n"
"	MUL R1.xyz, R0.xyzx, R0.xyzx;\n"
"	MOV R3.xyz, c78;\n"
"	MAD R0.xyz, -R3.xyzx, R0.xyzx, c77.xyzx;\n"
"	MUL R2.xyz, R1.xyzx, R0.xyzx;\n"
"	MAD R1, R2.z, R4, R5;\n"
"	ADD R0, R1.zwww, -R1.xyyy;\n"
"	MAD R0.yz, R2.y, R0.xxyz, R1.xxyy;\n"
"	ADD R0.x, R0.z, -R0.y;\n"
"	MAD R0.x, R2.x, R0.x, R0.y;\n"
"	ADD R0.x, R0.x, c76.x;\n"
"	MUL R0.y, R0.x, c75.z;\n"
"	RCP R0.x, R3.x;\n"
"	MAD R0.x, R0.y, R0.x, c75.w;\n"
"	MUL result.color.front.primary.xyz, c73.xyzx, R0.x;\n"
"	MOV result.color.front.primary.w, c76.x;\n"
"	MUL R0, v18, R0.y;\n"
"	MAD R0, R0, c6.x, v16;\n"
"	DPH result.position.x, R0, c0[0];\n"
"	DPH result.position.y, R0, c0[1];\n"
"	DPH result.position.z, R0, c0[2];\n"
"	DPH result.position.w, R0, c0[3];\n"
"END\n"
"# 66 instructions\n"
"# 6 temp registers\n"
"# End of program\n"
,
"vs_1_1\n"
"// DX9 Vertex shader generated by NVIDIA Cg compiler\n"
"// cgc version 1.1.0003, build date Mar  4 2003  12:32:10\n"
"// command line args: -q -profile vs_1_1 -entry vmain -profileopts dcls -strict\n"
"// nv30vp backend compiling 'vmain' program\n"
"def c74, 10000, 10000, 10000, 0\n"
"def c76, 1, 0, 0, 0\n"
"def c77, 3, 3, 3, 0\n"
"def c78, 2, 2, 2, 0\n"
"def c75, 0.03125, 32, 0.5, 0.3\n"
"//vendor NVIDIA Corporation\n"
"//version 1.0.02\n"
"//profile vs_1_1\n"
"//program vmain\n"
"//semantic vmain.Wm3TransformMVP\n"
"//semantic vmain.NoiseTranslate\n"
"//semantic vmain.NoiseScale\n"
"//semantic vmain.Displacement\n"
"//semantic vmain.pg\n"
"//semantic vmain.BaseColor\n"
"//var float4 iPosition : $vin.POSITION : POSITION : 0 : 1\n"
"//var float4 iNormal : $vin.NORMAL0 : NORMAL0 : 1 : 1\n"
"//var float4 oColor0 : $vout.COLOR : COLOR : 2 : 1\n"
"//var float4 oPosition : $vout.POSITION : POSITION : 3 : 1\n"
"//var float4x4 Wm3TransformMVP :  : c[0], 4 : 4 : 1\n"
"//var float4 NoiseTranslate :  : c[4] : 5 : 1\n"
"//var float NoiseScale :  : c[5] : 6 : 1\n"
"//var float Displacement :  : c[6] : 7 : 1\n"
"//var float4 pg[0] :  : c[7] : 8 : 1\n"
"//var float4 pg[1] :  : c[8] : 8 : 1\n"
"//var float4 pg[2] :  : c[9] : 8 : 1\n"
"//var float4 pg[3] :  : c[10] : 8 : 1\n"
"//var float4 pg[4] :  : c[11] : 8 : 1\n"
"//var float4 pg[5] :  : c[12] : 8 : 1\n"
"//var float4 pg[6] :  : c[13] : 8 : 1\n"
"//var float4 pg[7] :  : c[14] : 8 : 1\n"
"//var float4 pg[8] :  : c[15] : 8 : 1\n"
"//var float4 pg[9] :  : c[16] : 8 : 1\n"
"//var float4 pg[10] :  : c[17] : 8 : 1\n"
"//var float4 pg[11] :  : c[18] : 8 : 1\n"
"//var float4 pg[12] :  : c[19] : 8 : 1\n"
"//var float4 pg[13] :  : c[20] : 8 : 1\n"
"//var float4 pg[14] :  : c[21] : 8 : 1\n"
"//var float4 pg[15] :  : c[22] : 8 : 1\n"
"//var float4 pg[16] :  : c[23] : 8 : 1\n"
"//var float4 pg[17] :  : c[24] : 8 : 1\n"
"//var float4 pg[18] :  : c[25] : 8 : 1\n"
"//var float4 pg[19] :  : c[26] : 8 : 1\n"
"//var float4 pg[20] :  : c[27] : 8 : 1\n"
"//var float4 pg[21] :  : c[28] : 8 : 1\n"
"//var float4 pg[22] :  : c[29] : 8 : 1\n"
"//var float4 pg[23] :  : c[30] : 8 : 1\n"
"//var float4 pg[24] :  : c[31] : 8 : 1\n"
"//var float4 pg[25] :  : c[32] : 8 : 1\n"
"//var float4 pg[26] :  : c[33] : 8 : 1\n"
"//var float4 pg[27] :  : c[34] : 8 : 1\n"
"//var float4 pg[28] :  : c[35] : 8 : 1\n"
"//var float4 pg[29] :  : c[36] : 8 : 1\n"
"//var float4 pg[30] :  : c[37] : 8 : 1\n"
"//var float4 pg[31] :  : c[38] : 8 : 1\n"
"//var float4 pg[32] :  : c[39] : 8 : 1\n"
"//var float4 pg[33] :  : c[40] : 8 : 1\n"
"//var float4 pg[34] :  : c[41] : 8 : 1\n"
"//var float4 pg[35] :  : c[42] : 8 : 1\n"
"//var float4 pg[36] :  : c[43] : 8 : 1\n"
"//var float4 pg[37] :  : c[44] : 8 : 1\n"
"//var float4 pg[38] :  : c[45] : 8 : 1\n"
"//var float4 pg[39] :  : c[46] : 8 : 1\n"
"//var float4 pg[40] :  : c[47] : 8 : 1\n"
"//var float4 pg[41] :  : c[48] : 8 : 1\n"
"//var float4 pg[42] :  : c[49] : 8 : 1\n"
"//var float4 pg[43] :  : c[50] : 8 : 1\n"
"//var float4 pg[44] :  : c[51] : 8 : 1\n"
"//var float4 pg[45] :  : c[52] : 8 : 1\n"
"//var float4 pg[46] :  : c[53] : 8 : 1\n"
"//var float4 pg[47] :  : c[54] : 8 : 1\n"
"//var float4 pg[48] :  : c[55] : 8 : 1\n"
"//var float4 pg[49] :  : c[56] : 8 : 1\n"
"//var float4 pg[50] :  : c[57] : 8 : 1\n"
"//var float4 pg[51] :  : c[58] : 8 : 1\n"
"//var float4 pg[52] :  : c[59] : 8 : 1\n"
"//var float4 pg[53] :  : c[60] : 8 : 1\n"
"//var float4 pg[54] :  : c[61] : 8 : 1\n"
"//var float4 pg[55] :  : c[62] : 8 : 1\n"
"//var float4 pg[56] :  : c[63] : 8 : 1\n"
"//var float4 pg[57] :  : c[64] : 8 : 1\n"
"//var float4 pg[58] :  : c[65] : 8 : 1\n"
"//var float4 pg[59] :  : c[66] : 8 : 1\n"
"//var float4 pg[60] :  : c[67] : 8 : 1\n"
"//var float4 pg[61] :  : c[68] : 8 : 1\n"
"//var float4 pg[62] :  : c[69] : 8 : 1\n"
"//var float4 pg[63] :  : c[70] : 8 : 1\n"
"//var float4 pg[64] :  : c[71] : 8 : 1\n"
"//var float4 pg[65] :  : c[72] : 8 : 1\n"
"//var float4 BaseColor :  : c[73] : 9 : 1\n"
"//const c[74] = 10000 10000 10000 0\n"
"//const c[76] = 1 0 0 0\n"
"//const c[77] = 3 3 3 0\n"
"//const c[78] = 2 2 2 0\n"
"//const c[75] = 0.03125 32 0.5 0.3\n"
"dcl_normal0 v3\n"
"dcl_position v0\n"
"	add r0.yzw, v0.xxyz, c4.xxyz\n"
"	mov r0.x, c5\n"
"	mad r2.xyz, r0.yzw, r0.x, c74.xyz\n"
"	expp r0.y, r2.x\n"
"	expp r1.y, r2.y\n"
"	mov r1.x, r0.y\n"
"	expp r0.y, r2.z\n"
"	mov r1.z, r0.y\n"
"	add r0.xyz, r2.xyz, -r1.xyz\n"
"	add r1.xyz, r2.xyz, -r0.xyz\n"
"	add r0.xyz, r1.xyz, -c76.yyx\n"
"	mul r4.xyz, r2.xyz, c75.x\n"
"	expp r2.y, r4.x\n"
"	expp r3.y, r4.y\n"
"	mov r3.x, r2.y\n"
"	expp r2.y, r4.z\n"
"	mov r3.z, r2.y\n"
"	add r2.xyz, r4.xyz, -r3.xyz\n"
"	add r2.xyz, r4.xyz, -r2.xyz\n"
"	mul r4.xyz, r2.xyz, c75.y\n"
"	mov a0.x, r4.x\n"
"	mov r2.x, c[a0.x + 7].w\n"
"	mov r2.y, c[a0.x + 8].w\n"
"	add r3.xy, r2.xy, r4.y\n"
"	mov a0.x, r3.x\n"
"	mov r0.w, c[a0.x + 7]\n"
"	mov a0.x, r3.y\n"
"	mov r2.x, r0.w\n"
"	mov r2.y, c[a0.x + 7].w\n"
"	mov a0.x, r3.x\n"
"	mov r2.z, c[a0.x + 8].w\n"
"	mov a0.x, r3.y\n"
"	mov r2.w, c[a0.x + 8].w\n"
"	add r3, r2, r4.z\n"
"	mov a0.x, r3.x\n"
"	dp3 r2.x, c[a0.x + 8].xyz, r0.xyz\n"
"	add r0.xyz, r1.xyz, -c76.xyx\n"
"	mov a0.x, r3.y\n"
"	dp3 r2.y, c[a0.x + 8].xyz, r0.xyz\n"
"	add r0.xyz, r1.xyz, -c76.yxx\n"
"	mov a0.x, r3.z\n"
"	dp3 r2.z, c[a0.x + 8].xyz, r0.xyz\n"
"	add r0.xyz, r1.xyz, -c76.x\n"
"	mov a0.x, r3.w\n"
"	dp3 r2.w, c[a0.x + 8].xyz, r0.xyz\n"
"	mov a0.x, r3.x\n"
"	dp3 r5.x, c[a0.x + 7].xyz, r1.xyz\n"
"	add r0.xyz, r1.xyz, -c76.xyz\n"
"	mov a0.x, r3.y\n"
"	dp3 r5.y, c[a0.x + 7].xyz, r0.xyz\n"
"	add r0.xyz, r1.xyz, -c76.yxy\n"
"	mov a0.x, r3.z\n"
"	dp3 r5.z, c[a0.x + 7].xyz, r0.xyz\n"
"	add r0.xyz, r1.xyz, -c76.xxy\n"
"	mov a0.x, r3.w\n"
"	dp3 r5.w, c[a0.x + 7].xyz, r0.xyz\n"
"	add r4, r2, -r5\n"
"	mul r2.xyz, r1.xyz, r1.xyz\n"
"	mov r3.xyz, c78\n"
"	mad r0.xyz, -r3.xyz, r1.xyz, c77.xyz\n"
"	mul r2.xyz, r2.xyz, r0.xyz\n"
"	mad r1, r2.z, r4, r5\n"
"	add r0, r1.zwww, -r1.xyyy\n"
"	mad r0.yz, r2.y, r0.xxyz, r1.xxyy\n"
"	add r0.x, r0.z, -r0.y\n"
"	mad r0.x, r2.x, r0.x, r0.y\n"
"	add r0.x, r0.x, c76.x\n"
"	mul r0.y, r0.x, c75.z\n"
"	rcp r0.x, r3.x\n"
"	mad r0.x, r0.y, r0.x, c75.w\n"
"	mul oD0.xyz, c73.xyz, r0.x\n"
"	mov oD0.w, c76.x\n"
"	mul r0, v3, r0.y\n"
"	mad r0.xyz, r0, c6.x, v0\n"
"	mov r0.w, c76.x\n"
"	dp4 oPos.x, c0, r0\n"
"	dp4 oPos.y, c1, r0\n"
"	dp4 oPos.z, c2, r0\n"
"	dp4 oPos.w, c3, r0\n"
"// 79 instructions\n"
"// 6 temp registers\n"
"// End of program\n"
};



