// ---- Created with 3Dmigoto v1.2.35 on Tue Apr 26 22:31:08 2016

cbuffer cbTextureTilingScale : register(b1)
{
  float4 FC_TextureTilingScale[25] : packoffset(c0);
}

cbuffer cbMatDynParam : register(b2)
{
  bool FC_isDitherAlpha : packoffset(c0);
  float FC_TranslucencyScale : packoffset(c1);
  float4 FC_EmissiveColor : packoffset(c2);
  float4 FC_BlendMaskParam : packoffset(c3);
  float FC_PomHeightScale : packoffset(c4);
  float FC_PomHeightBias : packoffset(c4.y);
  float FC_PomMinSamples : packoffset(c4.z);
  float FC_PomMaxSamples : packoffset(c4.w);
  float FC_PomShadowSoftening : packoffset(c5);
  bool FC_bPomDisplayShadows : packoffset(c5.y);
  float4 FC_ParallaxParam : packoffset(c6);
  float FC_Pom2HeightScale : packoffset(c7);
  float FC_Pom2HeightBias : packoffset(c7.y);
  float FC_Pom2MinSamples : packoffset(c7.z);
  float FC_Pom2MaxSamples : packoffset(c7.w);
  bool VC_isEnableCloth : packoffset(c8);
  float FC_EnvMapDolBlendRate : packoffset(c9);
  float4 FC_SnowMaskParam : packoffset(c10);
  float FC_FROZEN_THRESHOLD : packoffset(c11);
  float FC_FROZEN_POW : packoffset(c11.y);
  float FC_BlendRate : packoffset(c12);
  float4 FC_FlowMapUvTiling : packoffset(c13);
  float4 FC_FlowMapIntencity : packoffset(c14);
  float FC_SoftVolume : packoffset(c15);
  float FC_PointCloudRate : packoffset(c16);
  float4 FC_WaterNormalUvScrollSpeed : packoffset(c17);
  float4 FC_WaterDiffuseUvScrollSpeed : packoffset(c18);
  float4 FC_WaterMiddleUvScrollSpeed : packoffset(c19);
  float4 FC_WaterFogParam0 : packoffset(c20);
  float4 FC_WaterFogParam1 : packoffset(c21);
  float4 FC_WaterFresnel : packoffset(c22);
  float4 FC_WaterFadeParam : packoffset(c23);
  float4 FC_DynamicDiffuseColor : packoffset(c24);
  float FC_SSS_ID : packoffset(c25);
  float4 FC_PhantomEdgeColor : packoffset(c26);
  float4 FC_PhantomFrontColor : packoffset(c27);
  float4 FC_PhantomDiffColor : packoffset(c28);
  float4 FC_PhantomSpecColor : packoffset(c29);
  float4 FC_PhantomLightColor : packoffset(c30);
  float VC_VelocityOffset : packoffset(c31);
  float4 FC_DamagedNormalParam : packoffset(c32);
  float4 FC_DamagedNormalUvTiling : packoffset(c33);
  float4 FC_DamagedNormal2UvTiling : packoffset(c34);
  float4 FC_WetDiffuseColor : packoffset(c35);
  float4 FC_WetParam1 : packoffset(c36);
  float4 FC_WetRefrectanceColor : packoffset(c37);
  float4 FC_WetParam2 : packoffset(c38);
  float SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_float_0_0 : packoffset(c39);
  float SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_float_1_0 : packoffset(c39.y);
  float SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_float_2_0 : packoffset(c39.z);
  float SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_float_3_0 : packoffset(c39.w);
}

cbuffer cbMtdParam : register(b3)
{
  float4 FC_DifMapMulCol : packoffset(c0);
  float4 FC_SpcMapMulCol : packoffset(c1);
  float4 FC_SpcParam : packoffset(c2);
  float4 FC_SSAOParam : packoffset(c3);
  float3 FC_CDRFParam : packoffset(c4);
  float4 FC_AlphaRef : packoffset(c5);
  float FC_BloodAmount : packoffset(c6);
  float4 old_FC_ParallaxParam : packoffset(c7);
  float FC_IOR : packoffset(c8);
  float4 FC_GlowScale : packoffset(c9);
  float4 FC_GhostEdgeColor : packoffset(c10);
  float4 FC_GhostEdgeParam : packoffset(c11);
  float4 FC_BmpBlendParam0 : packoffset(c12);
  float4 FC_BmpBlendParam1 : packoffset(c13);
  float FC_UNUSED_SSS_ID : packoffset(c14);
  float4 FC_Falloff_InsideColor : packoffset(c15);
  float4 FC_Falloff_OutsideColor : packoffset(c16);
  float4 FC_Falloff_Offset : packoffset(c17);
  float4 FC_Falloff_EdgePower : packoffset(c18);
  float4 FC_Falloff_HeightFade : packoffset(c19);
  float4 FC_HairSpecularParam0 : packoffset(c20);
  float4 FC_HairSpecularParam1 : packoffset(c21);
  float4 FC_HairSpecularParam2 : packoffset(c22);
  float4 FC_RimLightingParam : packoffset(c23);
  float4 FC_SAT_DUMMMY_P7_8 : packoffset(c24);
  float4 FC_SAT_DUMMMY_P7_9 : packoffset(c25);
  float4 FC_SAT_DUMMMY_P7_10 : packoffset(c26);
}

cbuffer cbInstanceData : register(b4)
{

  struct
  {
    float4x3 mWorld;
    float4 atlasUvScaleOffset;
    float4 userClipPlane;
    uint4 matricesData;
    uint envData;
    bool dynamicLightDisable;
    uint2 envPad;
    float4 mulCol;
    float4 aSh[3];
    float4 ShLightMask;
    float4 vDominantRotateParam;
    float4 parallaxCorrectedCubemapOrigin_envMapInterpRatio;
    float4 parallaxCorrectedCubemapAabbMin_envMapColorScale0;
    float4 parallaxCorrectedCubemapAabbMax_envMapColorScale1;
    float ditherFadeAlpha;
  } VC_InstanceData[2] : packoffset(c0);

}

SamplerState SS_DiffuseMap_s : register(s0);
SamplerState SS_SpecularMap_s : register(s1);
SamplerState SS_BumpMap_s : register(s2);
SamplerState SS_WrapLinear_s : register(s8);
Texture2D<float4> SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_7 : register(t2);
Texture2D<float4> SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_6 : register(t3);
Texture2D<float4> SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_5 : register(t4);
Texture2D<float4> SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_3 : register(t5);
Texture2D<float4> SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_2 : register(t6);
Texture2D<float4> SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_14 : register(t7);
Texture2D<float4> SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_13 : register(t8);
Texture2D<float4> SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_1 : register(t10);
Texture2D<float4> SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_0 : register(t11);
Texture2D<float4> g_DecalDiffuseTexture : register(t41);
Texture2D<float4> g_DecalSpecularTexture : register(t42);


// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main( 
  float4 v0 : SV_POSITION0,
  float4 v1 : NORMAL0,
  float4 v2 : TANGENT0,
  float4 v3 : COLOR0,
  float4 v4 : TEXCOORD0,
  float4 v5 : TEXCOORD2,
  float4 v6 : TEXCOORD3,
  uint v7 : SV_ISFRONTFACE0,
  out float4 o0 : SV_TARGET0,
  out float4 o1 : SV_TARGET1,
  out float4 o2 : SV_TARGET2,
  out float4 o3 : SV_TARGET3,
  out float4 o4 : SV_TARGET4)
{
  float4 r0,r1,r2,r3,r4,r5,r6;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyz = v2.yzx * v1.zxy;
  r0.xyz = v1.yzx * v2.zxy + -r0.xyz;
  r0.xyz = v2.www * r0.xyz;
  r0.w = dot(r0.xyz, r0.xyz);
  r0.w = rsqrt(r0.w);
  r0.xyz = r0.xyz * r0.www;
  r1.xy = v4.xy * FC_TextureTilingScale[7].xy + FC_TextureTilingScale[7].zw;
  r1.xy = SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_7.Sample(SS_BumpMap_s, r1.xy).xy;
  r1.xy = r1.xy * float2(2,2) + float2(-1,-1);
  r1.xy = SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_float_3_0 * r1.xy;
  r2.xy = SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_float_2_0 * v4.xy;
  r2.xy = r2.xy * FC_TextureTilingScale[0].xy + FC_TextureTilingScale[0].zw;
  r0.w = SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_0.Sample(SS_WrapLinear_s, r2.xy).x;
  r0.w = 0.00999999978 + r0.w;
  r0.w = SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_float_0_0 * r0.w;
  r1.w = 1 + -v6.x;
  r0.w = -r0.w * r1.w + v6.x;
  r1.w = v3.w * SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_float_1_0 + 1;
  r0.w = saturate(r1.w * r0.w);
  r2.xy = v4.xy * FC_TextureTilingScale[14].xy + FC_TextureTilingScale[14].zw;
  r2.xyz = SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_14.Sample(SS_BumpMap_s, r2.xy).xyz;
  r3.xy = v4.xy * FC_TextureTilingScale[13].xy + FC_TextureTilingScale[13].zw;
  r3.xyz = SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_13.Sample(SS_BumpMap_s, r3.xy).xyz;
  r2.xyz = -r3.xyz + r2.xyz;
  r2.xyw = r0.www * r2.xyz + r3.xyz;
  r3.xy = r2.xy * float2(2,2) + float2(-1,-1);
  r1.w = dot(r3.xy, r3.xy);
  r1.w = min(1, r1.w);
  r1.w = 1 + -r1.w;
  r3.z = sqrt(r1.w);
  r1.z = 0;
  r1.xyz = r3.xyz + r1.xyz;
  r1.w = dot(v2.xyz, v2.xyz);
  r1.w = rsqrt(r1.w);
  r3.xyz = v2.xyz * r1.www;
  r3.xyz = r3.xyz * r1.yyy;
  r0.xyz = r1.xxx * r0.xyz + r3.xyz;
  r1.x = dot(v1.xyz, v1.xyz);
  r1.x = rsqrt(r1.x);
  r1.xyw = v1.xyz * r1.xxx;
  r1.xyw = v7.xxx ? r1.xyw : -r1.xyw;
  r0.xyz = r1.zzz * r1.xyw + r0.xyz;
  r1.x = dot(r0.xyz, r0.xyz);
  r1.x = rsqrt(r1.x);
  r1.xyz = r1.xxx * r0.xyz;
  o0.xyz = r1.xyz * float3(0.5,0.5,0.5) + float3(0.500488758,0.500488758,0.500488758);
  r0.x = cmp(0 != FC_AlphaRef.z);
  r3.xz = float2(0,1);
  r0.yz = v4.xy * FC_TextureTilingScale[3].xy + FC_TextureTilingScale[3].zw;
  r0.y = SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_3.Sample(SS_DiffuseMap_s, r0.yz).x;
  r4.xy = v4.xy * FC_TextureTilingScale[1].xy + FC_TextureTilingScale[1].zw;
  r4.xyzw = SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_1.Sample(SS_DiffuseMap_s, r4.xy).xyzw;
  r0.y = r4.w * r0.y;
  r0.z = round(v1.w);
  r0.z = (uint)r0.z;
  r0.z = (int)r0.z * 17;
  r0.y = VC_InstanceData[r0.z].mulCol.w * r0.y;
  r3.w = (uint7)VC_InstanceData[r0.z].envData;
  r3.y = 0.00392156886 * r3.w;
  r3.xyw = r0.xxx ? r0.yyy : r3.yzx;
  o2.w = r0.y;
  o0.w = r3.w;
  o1.w = r3.w;
  r0.xy = v4.xy * FC_TextureTilingScale[6].xy + FC_TextureTilingScale[6].zw;
  r5.xyz = SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_6.Sample(SS_SpecularMap_s, r0.xy).xyz;
  r0.xy = v4.xy * FC_TextureTilingScale[5].xy + FC_TextureTilingScale[5].zw;
  r6.xyz = SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_5.Sample(SS_SpecularMap_s, r0.xy).xyz;
  r5.xyz = -r6.xyz + r5.xyz;
  r2.xyz = r0.www * r5.xyz + r6.xyz;
  r5.xw = g_DecalSpecularTexture.Sample(SS_SpecularMap_s, v4.zw).yx;
  r5.xyz = r5.xxx * r5.xxx;
  r6.xyzw = g_DecalDiffuseTexture.Sample(SS_DiffuseMap_s, v4.zw).xyzw;
  r5.xyzw = r2.xyzw * r6.wwww + r5.xyzw;
  r5.xyzw = r5.xyzw + -r2.xyzw;
  r2.xyzw = FC_BloodAmount * r5.xyzw + r2.xyzw;
  r0.x = FC_WetParam2.x + -r2.w;
  r0.y = dot(r2.xyz, float3(0.298909992,0.586610019,0.114480004));
  r3.z = FC_WetParam1.y + -FC_WetParam1.x;
  r0.y = r0.y * r3.z + FC_WetParam1.x;
  r0.y = r0.y * 1.20000005 + -v5.x;
  r0.y = saturate(10 * r0.y);
  r3.z = FC_WetParam2.z * r0.y;
  o1.x = r3.z * r0.x + r2.w;
  o1.y = 0;
  o1.z = VC_InstanceData[r0.z].ShLightMask.x;
  r3.zw = v4.xy * FC_TextureTilingScale[2].xy + FC_TextureTilingScale[2].zw;
  r5.xyz = SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_2.Sample(SS_DiffuseMap_s, r3.zw).xyz;
  r5.xyz = r5.xyz + -r4.xyz;
  r4.xyz = r0.www * r5.xyz + r4.xyz;
  r5.xyz = FC_WetDiffuseColor.xyz + -r4.xyz;
  r0.x = FC_WetDiffuseColor.w * r0.y;
  r0.y = FC_WetRefrectanceColor.w * r0.y;
  r4.xyz = r0.xxx * r5.xyz + r4.xyz;
  r5.xyz = r4.xyz * r6.www + r6.xyz;
  r5.xyz = r5.xyz + -r4.xyz;
  o2.xyz = FC_BloodAmount * r5.xyz + r4.xyz;
  r4.xyz = FC_WetRefrectanceColor.xyz + -r2.xyz;
  r0.xyw = r0.yyy * r4.xyz + r2.xyz;
  o3.xyz = sqrt(r0.xyw);
  r0.xyw = float3(1,1,1) + -r0.xyw;
  o3.w = r3.x;
  o4.w = r3.y;
  r1.w = 1;
  r2.x = dot(r1.xyzw, VC_InstanceData[r0.z].aSh[0].xyzw);
  r2.y = dot(r1.xyzw, VC_InstanceData[r0.z].aSh[1].xyzw);
  r2.z = dot(r1.xyzw, VC_InstanceData[r0.z].aSh[2].xyzw);
  r1.xyz = max(float3(0,0,0), r2.xyz);
  o4.xyz = r1.xyz * r0.xyw;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//
// Buffer Definitions: 
//
// cbuffer cbTextureTilingScale
// {
//
//   float4 FC_TextureTilingScale[25];  // Offset:    0 Size:   400
//
// }
//
// cbuffer cbMatDynParam
// {
//
//   bool FC_isDitherAlpha;             // Offset:    0 Size:     4 [unused]
//   float FC_TranslucencyScale;        // Offset:   16 Size:     4 [unused]
//   float4 FC_EmissiveColor;           // Offset:   32 Size:    16 [unused]
//   float4 FC_BlendMaskParam;          // Offset:   48 Size:    16 [unused]
//   float FC_PomHeightScale;           // Offset:   64 Size:     4 [unused]
//   float FC_PomHeightBias;            // Offset:   68 Size:     4 [unused]
//   float FC_PomMinSamples;            // Offset:   72 Size:     4 [unused]
//   float FC_PomMaxSamples;            // Offset:   76 Size:     4 [unused]
//   float FC_PomShadowSoftening;       // Offset:   80 Size:     4 [unused]
//   bool FC_bPomDisplayShadows;        // Offset:   84 Size:     4 [unused]
//   float4 FC_ParallaxParam;           // Offset:   96 Size:    16 [unused]
//   float FC_Pom2HeightScale;          // Offset:  112 Size:     4 [unused]
//   float FC_Pom2HeightBias;           // Offset:  116 Size:     4 [unused]
//   float FC_Pom2MinSamples;           // Offset:  120 Size:     4 [unused]
//   float FC_Pom2MaxSamples;           // Offset:  124 Size:     4 [unused]
//   bool VC_isEnableCloth;             // Offset:  128 Size:     4 [unused]
//   float FC_EnvMapDolBlendRate;       // Offset:  144 Size:     4 [unused]
//   float4 FC_SnowMaskParam;           // Offset:  160 Size:    16 [unused]
//   float FC_FROZEN_THRESHOLD;         // Offset:  176 Size:     4 [unused]
//   float FC_FROZEN_POW;               // Offset:  180 Size:     4 [unused]
//   float FC_BlendRate;                // Offset:  192 Size:     4 [unused]
//   float4 FC_FlowMapUvTiling;         // Offset:  208 Size:    16 [unused]
//   float4 FC_FlowMapIntencity;        // Offset:  224 Size:    16 [unused]
//   float FC_SoftVolume;               // Offset:  240 Size:     4 [unused]
//   float FC_PointCloudRate;           // Offset:  256 Size:     4 [unused]
//   float4 FC_WaterNormalUvScrollSpeed;// Offset:  272 Size:    16 [unused]
//   float4 FC_WaterDiffuseUvScrollSpeed;// Offset:  288 Size:    16 [unused]
//   float4 FC_WaterMiddleUvScrollSpeed;// Offset:  304 Size:    16 [unused]
//   float4 FC_WaterFogParam0;          // Offset:  320 Size:    16 [unused]
//   float4 FC_WaterFogParam1;          // Offset:  336 Size:    16 [unused]
//   float4 FC_WaterFresnel;            // Offset:  352 Size:    16 [unused]
//   float4 FC_WaterFadeParam;          // Offset:  368 Size:    16 [unused]
//   float4 FC_DynamicDiffuseColor;     // Offset:  384 Size:    16 [unused]
//   float FC_SSS_ID;                   // Offset:  400 Size:     4 [unused]
//   float4 FC_PhantomEdgeColor;        // Offset:  416 Size:    16 [unused]
//   float4 FC_PhantomFrontColor;       // Offset:  432 Size:    16 [unused]
//   float4 FC_PhantomDiffColor;        // Offset:  448 Size:    16 [unused]
//   float4 FC_PhantomSpecColor;        // Offset:  464 Size:    16 [unused]
//   float4 FC_PhantomLightColor;       // Offset:  480 Size:    16 [unused]
//   float VC_VelocityOffset;           // Offset:  496 Size:     4 [unused]
//   float4 FC_DamagedNormalParam;      // Offset:  512 Size:    16 [unused]
//   float4 FC_DamagedNormalUvTiling;   // Offset:  528 Size:    16 [unused]
//   float4 FC_DamagedNormal2UvTiling;  // Offset:  544 Size:    16 [unused]
//   float4 FC_WetDiffuseColor;         // Offset:  560 Size:    16
//   float4 FC_WetParam1;               // Offset:  576 Size:    16
//   float4 FC_WetRefrectanceColor;     // Offset:  592 Size:    16
//   float4 FC_WetParam2;               // Offset:  608 Size:    16
//   float SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_float_0_0;// Offset:  624 Size:     4
//   float SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_float_1_0;// Offset:  628 Size:     4
//   float SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_float_2_0;// Offset:  632 Size:     4
//   float SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_float_3_0;// Offset:  636 Size:     4
//
// }
//
// cbuffer cbMtdParam
// {
//
//   float4 FC_DifMapMulCol;            // Offset:    0 Size:    16 [unused]
//   float4 FC_SpcMapMulCol;            // Offset:   16 Size:    16 [unused]
//   float4 FC_SpcParam;                // Offset:   32 Size:    16 [unused]
//   float4 FC_SSAOParam;               // Offset:   48 Size:    16 [unused]
//   float3 FC_CDRFParam;               // Offset:   64 Size:    12 [unused]
//   float4 FC_AlphaRef;                // Offset:   80 Size:    16
//   float FC_BloodAmount;              // Offset:   96 Size:     4
//   float4 old_FC_ParallaxParam;       // Offset:  112 Size:    16 [unused]
//   float FC_IOR;                      // Offset:  128 Size:     4 [unused]
//   float4 FC_GlowScale;               // Offset:  144 Size:    16 [unused]
//   float4 FC_GhostEdgeColor;          // Offset:  160 Size:    16 [unused]
//   float4 FC_GhostEdgeParam;          // Offset:  176 Size:    16 [unused]
//   float4 FC_BmpBlendParam0;          // Offset:  192 Size:    16 [unused]
//   float4 FC_BmpBlendParam1;          // Offset:  208 Size:    16 [unused]
//   float FC_UNUSED_SSS_ID;            // Offset:  224 Size:     4 [unused]
//   float4 FC_Falloff_InsideColor;     // Offset:  240 Size:    16 [unused]
//   float4 FC_Falloff_OutsideColor;    // Offset:  256 Size:    16 [unused]
//   float4 FC_Falloff_Offset;          // Offset:  272 Size:    16 [unused]
//   float4 FC_Falloff_EdgePower;       // Offset:  288 Size:    16 [unused]
//   float4 FC_Falloff_HeightFade;      // Offset:  304 Size:    16 [unused]
//   float4 FC_HairSpecularParam0;      // Offset:  320 Size:    16 [unused]
//   float4 FC_HairSpecularParam1;      // Offset:  336 Size:    16 [unused]
//   float4 FC_HairSpecularParam2;      // Offset:  352 Size:    16 [unused]
//   float4 FC_RimLightingParam;        // Offset:  368 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P7_8;         // Offset:  384 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P7_9;         // Offset:  400 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P7_10;        // Offset:  416 Size:    16 [unused]
//
// }
//
// cbuffer cbInstanceData
// {
//
//   struct PerInstanceData
//   {
//       
//       float4x3 mWorld;               // Offset:    0
//       float4 atlasUvScaleOffset;     // Offset:   48
//       float4 userClipPlane;          // Offset:   64
//       uint4 matricesData;            // Offset:   80
//       uint envData;                  // Offset:   96
//       bool dynamicLightDisable;      // Offset:  100
//       uint2 envPad;                  // Offset:  104
//       float4 mulCol;                 // Offset:  112
//       float4 aSh[3];                 // Offset:  128
//       float4 ShLightMask;            // Offset:  176
//       float4 vDominantRotateParam;   // Offset:  192
//       float4 parallaxCorrectedCubemapOrigin_envMapInterpRatio;// Offset:  208
//       float4 parallaxCorrectedCubemapAabbMin_envMapColorScale0;// Offset:  224
//       float4 parallaxCorrectedCubemapAabbMax_envMapColorScale1;// Offset:  240
//       float ditherFadeAlpha;         // Offset:  256
//
//   } VC_InstanceData[2];              // Offset:    0 Size:   532
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SS_DiffuseMap                     sampler      NA          NA    0        1
// SS_SpecularMap                    sampler      NA          NA    1        1
// SS_BumpMap                        sampler      NA          NA    2        1
// SS_WrapLinear                     sampler      NA          NA    8        1
// SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_7    texture  float4          2d    2        1
// SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_6    texture  float4          2d    3        1
// SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_5    texture  float4          2d    4        1
// SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_3    texture  float4          2d    5        1
// SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_2    texture  float4          2d    6        1
// SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_14    texture  float4          2d    7        1
// SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_13    texture  float4          2d    8        1
// SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_1    texture  float4          2d   10        1
// SAT_MultiBlend2_BlendOpacity_Bloody_snp_0_Texture2D_0    texture  float4          2d   11        1
// g_DecalDiffuseTexture             texture  float4          2d   41        1
// g_DecalSpecularTexture            texture  float4          2d   42        1
// cbTextureTilingScale              cbuffer      NA          NA    1        1
// cbMatDynParam                     cbuffer      NA          NA    2        1
// cbMtdParam                        cbuffer      NA          NA    3        1
// cbInstanceData                    cbuffer      NA          NA    4        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float       
// NORMAL                   0   xyzw        1     NONE   float   xyzw
// TANGENT                  0   xyzw        2     NONE   float   xyzw
// COLOR                    0   xyzw        3     NONE   float      w
// TEXCOORD                 0   xyzw        4     NONE   float   xyzw
// TEXCOORD                 2   xyzw        5     NONE   float   x   
// TEXCOORD                 3   xyzw        6     NONE   float   x   
// SV_ISFRONTFACE           0   x           7    FFACE    uint   x   
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
// SV_TARGET                1   xyzw        1   TARGET   float   xyzw
// SV_TARGET                2   xyzw        2   TARGET   float   xyzw
// SV_TARGET                3   xyzw        3   TARGET   float   xyzw
// SV_TARGET                4   xyzw        4   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[15], immediateIndexed
dcl_constantbuffer cb2[40], immediateIndexed
dcl_constantbuffer cb3[7], immediateIndexed
dcl_constantbuffer cb4[34], dynamicIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s8, mode_default
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_resource_texture2d (float,float,float,float) t7
dcl_resource_texture2d (float,float,float,float) t8
dcl_resource_texture2d (float,float,float,float) t10
dcl_resource_texture2d (float,float,float,float) t11
dcl_resource_texture2d (float,float,float,float) t41
dcl_resource_texture2d (float,float,float,float) t42
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xyzw
dcl_input_ps linear v3.w
dcl_input_ps linear v4.xyzw
dcl_input_ps linear v5.x
dcl_input_ps linear v6.x
dcl_input_ps_sgv v7.x, is_front_face
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_temps 7
mul r0.xyz, v1.zxyz, v2.yzxy
mad r0.xyz, v1.yzxy, v2.zxyz, -r0.xyzx
mul r0.xyz, r0.xyzx, v2.wwww
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
mad r1.xy, v4.xyxx, cb1[7].xyxx, cb1[7].zwzz
sample_indexable(texture2d)(float,float,float,float) r1.xy, r1.xyxx, t2.xyzw, s2
mad r1.xy, r1.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
mul r1.xy, r1.xyxx, cb2[39].wwww
mul r2.xy, v4.xyxx, cb2[39].zzzz
mad r2.xy, r2.xyxx, cb1[0].xyxx, cb1[0].zwzz
sample_indexable(texture2d)(float,float,float,float) r0.w, r2.xyxx, t11.yzwx, s8
add r0.w, r0.w, l(0.010000)
mul r0.w, r0.w, cb2[39].x
add r1.w, -v6.x, l(1.000000)
mad r0.w, -r0.w, r1.w, v6.x
mad r1.w, v3.w, cb2[39].y, l(1.000000)
mul_sat r0.w, r0.w, r1.w
mad r2.xy, v4.xyxx, cb1[14].xyxx, cb1[14].zwzz
sample_indexable(texture2d)(float,float,float,float) r2.xyz, r2.xyxx, t7.xyzw, s2
mad r3.xy, v4.xyxx, cb1[13].xyxx, cb1[13].zwzz
sample_indexable(texture2d)(float,float,float,float) r3.xyz, r3.xyxx, t8.xyzw, s2
add r2.xyz, r2.xyzx, -r3.xyzx
mad r2.xyw, r0.wwww, r2.xyxz, r3.xyxz
mad r3.xy, r2.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r1.w, r3.xyxx, r3.xyxx
min r1.w, r1.w, l(1.000000)
add r1.w, -r1.w, l(1.000000)
sqrt r3.z, r1.w
mov r1.z, l(0)
add r1.xyz, r1.xyzx, r3.xyzx
dp3 r1.w, v2.xyzx, v2.xyzx
rsq r1.w, r1.w
mul r3.xyz, r1.wwww, v2.xyzx
mul r3.xyz, r1.yyyy, r3.xyzx
mad r0.xyz, r1.xxxx, r0.xyzx, r3.xyzx
dp3 r1.x, v1.xyzx, v1.xyzx
rsq r1.x, r1.x
mul r1.xyw, r1.xxxx, v1.xyxz
movc r1.xyw, v7.xxxx, r1.xyxw, -r1.xyxw
mad r0.xyz, r1.zzzz, r1.xywx, r0.xyzx
dp3 r1.x, r0.xyzx, r0.xyzx
rsq r1.x, r1.x
mul r1.xyz, r0.xyzx, r1.xxxx
mad o0.xyz, r1.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500489, 0.500489, 0.500489, 0.000000)
ne r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb3[5].z
mov r3.xz, l(0,0,1.000000,0)
mad r0.yz, v4.xxyx, cb1[3].xxyx, cb1[3].zzwz
sample_indexable(texture2d)(float,float,float,float) r0.y, r0.yzyy, t5.yxzw, s0
mad r4.xy, v4.xyxx, cb1[1].xyxx, cb1[1].zwzz
sample_indexable(texture2d)(float,float,float,float) r4.xyzw, r4.xyxx, t10.xyzw, s0
mul r0.y, r0.y, r4.w
round_ne r0.z, v1.w
ftou r0.z, r0.z
imul null, r0.z, r0.z, l(17)
mul r0.y, r0.y, cb4[r0.z + 7].w
utof r3.w, cb4[r0.z + 6].x
mul r3.y, r3.w, l(0.003922)
movc r3.xyw, r0.xxxx, r0.yyyy, r3.yzyx
mov o2.w, r0.y
mov o0.w, r3.w
mov o1.w, r3.w
mad r0.xy, v4.xyxx, cb1[6].xyxx, cb1[6].zwzz
sample_indexable(texture2d)(float,float,float,float) r5.xyz, r0.xyxx, t3.xyzw, s1
mad r0.xy, v4.xyxx, cb1[5].xyxx, cb1[5].zwzz
sample_indexable(texture2d)(float,float,float,float) r6.xyz, r0.xyxx, t4.xyzw, s1
add r5.xyz, r5.xyzx, -r6.xyzx
mad r2.xyz, r0.wwww, r5.xyzx, r6.xyzx
sample_indexable(texture2d)(float,float,float,float) r5.xw, v4.zwzz, t42.yzwx, s1
mul r5.xyz, r5.xxxx, r5.xxxx
sample_indexable(texture2d)(float,float,float,float) r6.xyzw, v4.zwzz, t41.xyzw, s0
mad r5.xyzw, r2.xyzw, r6.wwww, r5.xyzw
add r5.xyzw, -r2.xyzw, r5.xyzw
mad r2.xyzw, cb3[6].xxxx, r5.xyzw, r2.xyzw
add r0.x, -r2.w, cb2[38].x
dp3 r0.y, r2.xyzx, l(0.298910, 0.586610, 0.114480, 0.000000)
add r3.z, -cb2[36].x, cb2[36].y
mad r0.y, r0.y, r3.z, cb2[36].x
mad r0.y, r0.y, l(1.200000), -v5.x
mul_sat r0.y, r0.y, l(10.000000)
mul r3.z, r0.y, cb2[38].z
mad o1.x, r3.z, r0.x, r2.w
mov o1.y, l(0)
mov o1.z, cb4[r0.z + 11].x
mad r3.zw, v4.xxxy, cb1[2].xxxy, cb1[2].zzzw
sample_indexable(texture2d)(float,float,float,float) r5.xyz, r3.zwzz, t6.xyzw, s0
add r5.xyz, -r4.xyzx, r5.xyzx
mad r4.xyz, r0.wwww, r5.xyzx, r4.xyzx
add r5.xyz, -r4.xyzx, cb2[35].xyzx
mul r0.x, r0.y, cb2[35].w
mul r0.y, r0.y, cb2[37].w
mad r4.xyz, r0.xxxx, r5.xyzx, r4.xyzx
mad r5.xyz, r4.xyzx, r6.wwww, r6.xyzx
add r5.xyz, -r4.xyzx, r5.xyzx
mad o2.xyz, cb3[6].xxxx, r5.xyzx, r4.xyzx
add r4.xyz, -r2.xyzx, cb2[37].xyzx
mad r0.xyw, r0.yyyy, r4.xyxz, r2.xyxz
sqrt o3.xyz, r0.xywx
add r0.xyw, -r0.xyxw, l(1.000000, 1.000000, 0.000000, 1.000000)
mov o3.w, r3.x
mov o4.w, r3.y
mov r1.w, l(1.000000)
dp4 r2.x, r1.xyzw, cb4[r0.z + 8].xyzw
dp4 r2.y, r1.xyzw, cb4[r0.z + 9].xyzw
dp4 r2.z, r1.xyzw, cb4[r0.z + 10].xyzw
max r1.xyz, r2.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mul o4.xyz, r0.xywx, r1.xyzx
ret 
// Approximately 109 instruction slots used

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
