//
// Generated by Microsoft (R) D3DX9 Shader Compiler 9.08.299.0000
//
//   vsa shaderdump19/SM3007.vso /Fcshaderdump19/SM3007.vso.dis
//
//
// Parameters:

float4 Bones[54] : register(c31);
float4 FogColor : register(c16);
float4 FogParam : register(c15);
row_major float4x4 ShadowProj : register(c21);
float4 ShadowProjData : register(c25);
float4 ShadowProjTransform : register(c26);
row_major float4x4 SkinModelViewProj : register(c1);
row_major float4x4 TESR_ShadowCameraToLightTransform : register(c85);

// Registers:
//
//   Name                Reg   Size
//   ------------------- ----- ----
//   SkinModelViewProj[0]   const_1        1
//   SkinModelViewProj[1]   const_2        1
//   SkinModelViewProj[2]   const_3        1
//   SkinModelViewProj[3]   const_4        1
//   FogParam            const_15      1
//   FogColor            const_16      1
//   ShadowProj[0]          const_21       1
//   ShadowProj[1]          const_22       1
//   ShadowProj[2]          const_23       1
//   ShadowProj[3]          const_24       1
//   ShadowProjData      const_25      1
//   ShadowProjTransform const_26      1
//   Bones[0]               const_31      18
//   Bones[1]               const_32      18
//   Bones[2]               const_33      18
//


// Structures:

struct VS_INPUT {
    float4 LPOSITION : POSITION;
    float3 LTANGENT : TANGENT;
    float3 LBINORMAL : BINORMAL;
    float3 LNORMAL : NORMAL;
    float4 LTEXCOORD_0 : TEXCOORD0;
    float4 LCOLOR_0 : COLOR0;
    float3 LBLENDWEIGHT : BLENDWEIGHT;
    float4 LBLENDINDICES : BLENDINDICES;
};

struct VS_OUTPUT {
    float4 LPOSITION : POSITION;
    float2 LTEXCOORD_0 : TEXCOORD0;
    float4 LCOLOR_0 : COLOR0;
    float3 LTEXCOORD_3 : TEXCOORD3;
    float3 LTEXCOORD_4 : TEXCOORD4;
    float3 LTEXCOORD_5 : TEXCOORD5;
    float3 LTEXCOORD_6 : TEXCOORD6;
    float4 LTEXCOORD_1 : TEXCOORD1;
    float4 LTEXCOORD_7 : TEXCOORD7;
};

// Code:

VS_OUTPUT main(VS_INPUT IN) {
    VS_OUTPUT OUT;

#define	weight(v)		dot(v, 1)
#define	sqr(v)			((v) * (v))

    const float4 const_0 = {1, 765.01001, 0, 0};

    float4 mdl11;
    float4 offset;
    float3 q0;
    float1 q1;
    float3 q10;
    float4 q5;
    float3 q6;
    float3 q7;
    float3 q8;
    float3 q9;
    float4 r0;
    float4 r1;
    float3 r2;

    offset.xyzw = 765.01001 * IN.LBLENDINDICES.zyxw;
    r0.z = dot(Bones[2 + offset.y].xyz, IN.LNORMAL.xyz);
    r0.y = dot(Bones[1 + offset.y].xyz, IN.LNORMAL.xyz);
    r0.x = dot(Bones[0 + offset.y].xyz, IN.LNORMAL.xyz);
    r1.xyz = r0.xyz * IN.LBLENDWEIGHT.y;
    r0.z = dot(Bones[2 + offset.x].xyz, IN.LNORMAL.xyz);
    r0.y = dot(Bones[1 + offset.x].xyz, IN.LNORMAL.xyz);
    r0.x = dot(Bones[0 + offset.x].xyz, IN.LNORMAL.xyz);
    r0.w = 1;
    q5.xyzw = (IN.LPOSITION.xyzx * const_0.xxxz) + const_0.zzzx;
    q10.xyz = mul(float3x4(Bones[0 + offset.w].xyzw, Bones[1 + offset.w].xyzw, Bones[2 + offset.w].xyzw), q5.xyzw);
    q8.xyz = mul(float3x4(Bones[0 + offset.z].xyzw, Bones[1 + offset.z].xyzw, Bones[2 + offset.z].xyzw), q5.xyzw);
    q7.xyz = mul(float3x4(Bones[0 + offset.x].xyzw, Bones[1 + offset.x].xyzw, Bones[2 + offset.x].xyzw), q5.xyzw);
    q6.xyz = mul(float3x4(Bones[0 + offset.y].xyzw, Bones[1 + offset.y].xyzw, Bones[2 + offset.y].xyzw), q5.xyzw);
    OUT.LTEXCOORD_0.xy = IN.LTEXCOORD_0.xy;
    OUT.LCOLOR_0.xyzw = IN.LCOLOR_0.xyzw;
    q9.xyz = (IN.LBLENDWEIGHT.z * q8.xyz) + ((IN.LBLENDWEIGHT.x * q7.xyz) + (q6.xyz * IN.LBLENDWEIGHT.y));
    r1.xyz = (IN.LBLENDWEIGHT.x * r0.xyz) + r1.xyz;
    r0.z = dot(Bones[2 + offset.z].xyz, IN.LNORMAL.xyz);
    r0.y = dot(Bones[1 + offset.z].xyz, IN.LNORMAL.xyz);
    r0.x = dot(Bones[0 + offset.z].xyz, IN.LNORMAL.xyz);
    r1.xyz = (IN.LBLENDWEIGHT.z * r0.xyz) + r1.xyz;
    r0.z = dot(Bones[2 + offset.w].xyz, IN.LNORMAL.xyz);
    r0.y = dot(Bones[1 + offset.w].xyz, IN.LNORMAL.xyz);
    r0.x = dot(Bones[0 + offset.w].xyz, IN.LNORMAL.xyz);
    q0.xyz = ((1 - weight(IN.LBLENDWEIGHT.xyz)) * r0.xyz) + r1.xyz;
    r0.z = dot(Bones[2 + offset.y].xyz, IN.LTANGENT.xyz);
    r0.y = dot(Bones[1 + offset.y].xyz, IN.LTANGENT.xyz);
    r0.x = dot(Bones[0 + offset.y].xyz, IN.LTANGENT.xyz);
    r2.xyz = r0.xyz * IN.LBLENDWEIGHT.y;
    r0.z = dot(Bones[2 + offset.x].xyz, IN.LTANGENT.xyz);
    r0.y = dot(Bones[1 + offset.x].xyz, IN.LTANGENT.xyz);
    r0.x = dot(Bones[0 + offset.x].xyz, IN.LTANGENT.xyz);
    r2.xyz = (IN.LBLENDWEIGHT.x * r0.xyz) + r2.xyz;
    r0.z = dot(Bones[2 + offset.z].xyz, IN.LTANGENT.xyz);
    r0.y = dot(Bones[1 + offset.z].xyz, IN.LTANGENT.xyz);
    r0.x = dot(Bones[0 + offset.z].xyz, IN.LTANGENT.xyz);
    r2.xyz = (IN.LBLENDWEIGHT.z * r0.xyz) + r2.xyz;
    r0.z = dot(Bones[2 + offset.w].xyz, IN.LTANGENT.xyz);
    r0.y = dot(Bones[1 + offset.w].xyz, IN.LTANGENT.xyz);
    r0.x = dot(Bones[0 + offset.w].xyz, IN.LTANGENT.xyz);
    r0.xyz = ((1 - weight(IN.LBLENDWEIGHT.xyz)) * r0.xyz) + r2.xyz;
    OUT.LTEXCOORD_3.xyz = normalize(r0.xyz);
    r0.z = dot(Bones[2 + offset.y].xyz, IN.LBINORMAL.xyz);
    r0.y = dot(Bones[1 + offset.y].xyz, IN.LBINORMAL.xyz);
    r0.x = dot(Bones[0 + offset.y].xyz, IN.LBINORMAL.xyz);
    r1.xyz = r0.xyz * IN.LBLENDWEIGHT.y;
    r0.z = dot(Bones[2 + offset.x].xyz, IN.LBINORMAL.xyz);
    r0.y = dot(Bones[1 + offset.x].xyz, IN.LBINORMAL.xyz);
    r0.x = dot(Bones[0 + offset.x].xyz, IN.LBINORMAL.xyz);
    r1.xyz = (IN.LBLENDWEIGHT.x * r0.xyz) + r1.xyz;
    r0.z = dot(Bones[2 + offset.z].xyz, IN.LBINORMAL.xyz);
    r0.y = dot(Bones[1 + offset.z].xyz, IN.LBINORMAL.xyz);
    r0.x = dot(Bones[0 + offset.z].xyz, IN.LBINORMAL.xyz);
    r2.xyz = (IN.LBLENDWEIGHT.z * r0.xyz) + r1.xyz;
    r1.z = dot(Bones[2 + offset.w].xyz, IN.LBINORMAL.xyz);
    r1.y = dot(Bones[1 + offset.w].xyz, IN.LBINORMAL.xyz);
    r1.x = dot(Bones[0 + offset.w].xyz, IN.LBINORMAL.xyz);
    r2.xyz = ((1 - weight(IN.LBLENDWEIGHT.xyz)) * r1.xyz) + r2.xyz;
    r0.xyz = ((1 - weight(IN.LBLENDWEIGHT.xyz)) * q10.xyz) + q9.xyz;
    mdl11 = mul(SkinModelViewProj, r0.xyzw);
	r1 = mul(mdl11, TESR_ShadowCameraToLightTransform);
    OUT.LPOSITION = mdl11;
    q1.x = 1 - saturate((FogParam.x - length(mdl11.xyz)) / FogParam.y);
    OUT.LTEXCOORD_1 = r1;
    OUT.LTEXCOORD_4.xyz = normalize(r2.xyz);
    OUT.LTEXCOORD_5.xyz = normalize(q0.xyz);
    OUT.LTEXCOORD_6.xyz = r0.xyz;
    OUT.LTEXCOORD_7.w = q1.x * FogParam.z;
    OUT.LTEXCOORD_7.xyz = FogColor.rgb;

    return OUT;
};

// approximately 109 instruction slots used
