// ---- Created with 3Dmigoto v1.2.35 on Tue Apr 26 22:30:55 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);
}

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_HairSpecularParam0 : packoffset(c20);
  float4 FC_HairSpecularParam1 : packoffset(c21);
  float4 FC_HairSpecularParam2 : packoffset(c22);
  float4 FC_RimLightingParam : packoffset(c23);
}

cbuffer cbSceneParam : register(b8)
{
  float4 FC_FarClipInfo : packoffset(c0);
  float4 FC_ScreenSize : packoffset(c1);
  float4 FC_DepthComputeParam : packoffset(c2);
  float4 SC_CameraPos : packoffset(c3);
  float4 VC_ClipPlane : packoffset(c4);
  float4x3 FC_MatrixView : packoffset(c5);
  float4x4 FC_MatrixInvViewProj : packoffset(c8);
  float4x4 FC_MatrixInvProj : packoffset(c12);
  float4x4 FC_MatrixProj : packoffset(c16);
  float4x4 FC_MatrixInvView : packoffset(c20);
  float4x4 VC_MatrixViewProj : packoffset(c24);
  float4 FC_ShadowMapParam : packoffset(c28);
  float4 FC_ShadowColor : packoffset(c29);
  float4 FC_ShadowDir : packoffset(c30);
  float4x4 VC_ShadowMapMatrix : packoffset(c31);
  float FC_ShadowDepthRate : packoffset(c35);
  float FC_ShadowDepthScale : packoffset(c35.y);
  float FC_ShadowKernelScale : packoffset(c35.z);
  float FC_ShadowRandTexInvScale : packoffset(c35.w);
  float FC_ShadowTexInvScaleX : packoffset(c36);
  float FC_ShadowTexInvScaleY : packoffset(c36.y);
  float FC_ShadowDepthOffsetScale : packoffset(c36.z);
  float4 FC_ShadowViewKernelScale : packoffset(c37);
  float4x4 FC_ProjSpaceToShadowMatrix[4] : packoffset(c38);
  float4 FC_CascadeSelectDist : packoffset(c54);
  float FC_FrustumNear : packoffset(c55);
  float FC_FrustumSliceScale : packoffset(c55.y);
  float FC_FrustumSliceBias : packoffset(c55.z);
  uint FC_LightTile_Width : packoffset(c56);
  uint FC_LightTile_NumCellX : packoffset(c56.y);
  float4 FC_CloudShadowParam0 : packoffset(c57);
  float4 FC_CloudShadowParam1 : packoffset(c58);
  float FC_ShadowScale0 : packoffset(c59);
  float FC_ShadowScale1 : packoffset(c59.y);
}

cbuffer cbPerFrame : register(b9)
{
  float4 FC_DebugParam : packoffset(c0);
  float4 FC_DebugOutputMode : packoffset(c1);
  float4 FC_DebugParam2 : packoffset(c2);
  float FC_GlobalSpecularMask : packoffset(c3);
  float FC_GlobalReflectanceScale : packoffset(c3.y);
  float FC_GlobalShininessScale : packoffset(c3.z);
  float FC_GlobalAlbedoOffset : packoffset(c3.w);
  float4 FC_GlobalRefRectanceRGBScale : packoffset(c4);
  float4 FC_GlobalAlbedoOffsetRGB : packoffset(c5);
  float4 FC_SnowDir : packoffset(c6);
  float4 FC_SnowTilingScale : packoffset(c7);
  float4 FC_SnowAlbedo : packoffset(c8);
  float FC_SnowReflectance : packoffset(c9);
  float FC_GroundPlaneHeight : packoffset(c9.y);
  float FC_RcpSnowHeightRange : packoffset(c9.z);
  float FC_SnowNormalScale : packoffset(c9.w);
  float4 FC_SnowSpakleTinlingScale : packoffset(c10);
  float FC_GlobalTime : packoffset(c11);
  float FC_DominantSharpnesMinValue : packoffset(c12);
  float FC_DominantSharpnesOffset : packoffset(c12.y);
  float FC_DominantSharpnesExponent : packoffset(c12.z);
  float FC_DominantColorScale : packoffset(c12.w);
  float4 FC_DominantRgbScale : packoffset(c13);
}

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);

}

cbuffer cbLight : register(b5)
{
  float4 FC_DirLightVec_0 : packoffset(c0);
  float4 FC_DirLightVec_1 : packoffset(c1);
  float4 FC_DirLightVec_2 : packoffset(c2);
  float4 FC_DirLightVec_3 : packoffset(c3);
  float4 FC_DirLightCol_0 : packoffset(c4);
  float4 FC_DirLightCol_1 : packoffset(c5);
  float4 FC_DirLightCol_2 : packoffset(c6);
  float4 FC_DirLightCol_3 : packoffset(c7);
  float4 FC_DirLightSpc_0 : packoffset(c8);
  float4 FC_DirLightSpc_1 : packoffset(c9);
  float4 FC_DirLightSpc_2 : packoffset(c10);
  float4 FC_DirLightSpc_3 : packoffset(c11);
  float4 FC_AmbientSH[3] : packoffset(c12);
  float4 FC_AmbientReflection : packoffset(c15);
  uint4 FC_bLocalLight : packoffset(c16);
  float4 FC_SsaoWeight : packoffset(c17);
}

cbuffer cbFog : register(b6)
{
  float4 FC_FogParam : packoffset(c0);
  float4 FC_FogCol : packoffset(c1);
  float4 FC_ExtFogParam : packoffset(c2);
  float4 FC_HeightFogParam : packoffset(c3);
  float4 FC_HeightFogCol : packoffset(c4);
  bool FC_FogType : packoffset(c5);
  float4 FC_LsBeta1PlusBeta2 : packoffset(c6);
  float4 FC_LsTerrainReflectance : packoffset(c7);
  float4 FC_LsOneOverBeta1PlusBeta2 : packoffset(c8);
  float4 FC_LsHGg : packoffset(c9);
  float4 FC_LsBetaDash1 : packoffset(c10);
  float4 FC_LsBetaDash2 : packoffset(c11);
  float4 FC_LsSunColor : packoffset(c12);
  float4 FC_LsLightDir : packoffset(c13);
}

SamplerState SS_DiffuseMap_s : register(s0);
SamplerState SS_SpecularMap_s : register(s1);
SamplerState SS_BumpMap_s : register(s2);
SamplerState SS_ClampPoint_s : register(s7);
SamplerState SS_ClampLinear_s : register(s9);
Texture2D<float4> g_DiffuseTexture : register(t0);
Texture2D<float4> g_SpecularTexture : register(t1);
Texture2D<float4> g_BumpmapTexture : register(t3);
Texture2D<float4> g_DiffuseTexture2 : register(t7);
Texture2D<float4> g_SpecularTexture2 : register(t8);
Texture2D<float4> g_BumpmapTexture2 : register(t10);
Texture2D<float4> g_BumpmapTexture3 : register(t16);
Texture2D<float4> g_ReflectionTexture : register(t54);
Texture2D<float4> g_RefractionTexture : register(t55);
Texture2D<float4> g_DepthTexture : register(t56);
Texture2D<float4> g_WaterInteractTexture : register(t57);
Texture2D<float4> g_WaterNormalTexture : register(t58);
StructuredBuffer<g_LightIndices> g_LightIndices : register(t59);
StructuredBuffer<g_LightLookupBuffer> g_LightLookupBuffer : register(t60);
StructuredBuffer<g_LightBuffer> g_LightBuffer : register(t61);
StructuredBuffer<g_SpotLightBuffer> g_SpotLightBuffer : register(t62);


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


void main( 
  float4 v0 : SV_Position0,
  float4 v1 : TEXCOORD0,
  float4 v2 : TEXCOORD2,
  float4 v3 : TEXCOORD3,
  float4 v4 : TEXCOORD4,
  float4 v5 : COLOR1,
  float4 v6 : TEXCOORD8,
  float2 v7 : TEXCOORD9,
  float2 w7 : TEXCOORD5,
  float4 v8 : TEXCOORD11,
  float v9 : TEXCOORD6,
  uint v10 : SV_IsFrontFace0,
  out float4 o0 : SV_Target0)
{
// Needs manual fix for instruction: 
// unknown dcl_: dcl_resource_structured t59, 8 
// Needs manual fix for instruction: 
// unknown dcl_: dcl_resource_structured t60, 12 
// Needs manual fix for instruction: 
// unknown dcl_: dcl_resource_structured t61, 64 
// Needs manual fix for instruction: 
// unknown dcl_: dcl_resource_structured t62, 128 
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r16,r17,r18,r19,r20,r21,r22,r23,r24,r25,r26,r27,r28,r29,r30,r31;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = dot(v1.xyz, v1.xyz);
  r0.x = rsqrt(r0.x);
  r0.xyz = v1.xyz * r0.xxx;
  r0.w = dot(v2.xyz, v2.xyz);
  r0.w = rsqrt(r0.w);
  r1.xyz = v2.xyz * r0.www;
  r2.xyz = r1.yzx * r0.zxy;
  r2.xyz = r0.yzx * r1.zxy + -r2.xyz;
  r2.xyz = v2.www * r2.xyz;
  r0.w = dot(r2.xyz, r2.xyz);
  r0.w = rsqrt(r0.w);
  r2.xyz = r2.xyz * r0.www;
  r0.w = round(v1.w);
  r0.w = (uint)r0.w;
  r3.x = dot(v8.xyzw, FC_MatrixInvViewProj._m00_m10_m20_m30);
  r3.y = dot(v8.xyzw, FC_MatrixInvViewProj._m01_m11_m21_m31);
  r3.z = dot(v8.xyzw, FC_MatrixInvViewProj._m02_m12_m22_m32);
  r1.w = dot(v8.xyzw, FC_MatrixInvViewProj._m03_m13_m23_m33);
  r3.xyz = r3.xyz / r1.www;
  r4.x = FC_MatrixInvView._m30 + -r3.x;
  r4.y = FC_MatrixInvView._m31 + -r3.y;
  r4.z = FC_MatrixInvView._m32 + -r3.z;
  r1.w = dot(r4.xyz, r4.xyz);
  r1.w = rsqrt(r1.w);
  r3.xyz = r4.xyz * r1.www;
  r5.x = dot(r2.xyz, r4.xyz);
  r5.y = dot(r1.xyz, r4.xyz);
  r5.z = dot(r0.xyz, r4.xyz);
  r2.w = dot(r5.xyz, r5.xyz);
  r2.w = rsqrt(r2.w);
  r5.xy = r5.xy * r2.ww;
  r6.xyzw = FC_WaterNormalUvScrollSpeed.xyzw * FC_GlobalTime + v6.xyzw;
  r5.zw = r6.xy * FC_TextureTilingScale[3].xy + FC_TextureTilingScale[3].zw;
  r2.w = g_BumpmapTexture.Sample(SS_BumpMap_s, r5.zw).w;
  r5.zw = r6.zw * FC_TextureTilingScale[10].xy + FC_TextureTilingScale[10].zw;
  r3.w = g_BumpmapTexture2.Sample(SS_BumpMap_s, r5.zw).w;
  r2.w = 1 + -r2.w;
  r3.w = 1 + -r3.w;
  r2.w = -r2.w * r3.w + 1;
  r5.zw = FC_WaterMiddleUvScrollSpeed.xy * FC_GlobalTime + v7.xy;
  r5.zw = r5.zw * FC_TextureTilingScale[16].xy + FC_TextureTilingScale[16].zw;
  r3.w = g_BumpmapTexture3.Sample(SS_BumpMap_s, r5.zw).w;
  r2.w = 1 + -r2.w;
  r3.w = 1 + -r3.w;
  r2.w = -r2.w * r3.w + 1;
  r3.w = r2.w * FC_ParallaxParam.x + FC_ParallaxParam.y;
  r2.w = -r2.w * r2.w + 1;
  r4.w = 1 + -v5.z;
  r2.w = -r2.w * r4.w + 1;
  r6.xyzw = r5.xyxy * r3.wwww + v6.xyzw;
  r5.xy = r5.xy * r3.ww + v7.xy;
  r7.yz = FC_ScreenSize.zw * v0.xy;
  r0.xyz = v10.xxx ? r0.xyz : -r0.xyz;
  r8.xyzw = FC_WaterNormalUvScrollSpeed.xyzw * FC_GlobalTime + r6.xyzw;
  r5.zw = r8.xy * FC_TextureTilingScale[3].xy + FC_TextureTilingScale[3].zw;
  r5.zw = g_BumpmapTexture.Sample(SS_BumpMap_s, r5.zw).xy;
  r8.xy = r8.zw * FC_TextureTilingScale[10].xy + FC_TextureTilingScale[10].zw;
  r8.xy = g_BumpmapTexture2.Sample(SS_BumpMap_s, r8.xy).xy;
  r5.xy = FC_WaterMiddleUvScrollSpeed.xy * FC_GlobalTime + r5.xy;
  r5.xy = r5.xy * FC_TextureTilingScale[16].xy + FC_TextureTilingScale[16].zw;
  r5.xy = g_BumpmapTexture3.Sample(SS_BumpMap_s, r5.xy).xy;
  r5.zw = r5.zw * float2(2,2) + float2(-1,-1);
  r5.zw = r8.xy * float2(2,2) + r5.zw;
  r5.xy = r5.xy * float2(2,2) + r5.zw;
  r5.xy = float2(-2,-2) + r5.xy;
  r3.w = dot(r5.xy, r5.xy);
  r3.w = min(1, r3.w);
  r3.w = 1 + -r3.w;
  r3.w = sqrt(r3.w);
  r1.xyz = r5.yyy * r1.xyz;
  r1.xyz = r5.xxx * r2.xyz + r1.xyz;
  r1.xyz = r3.www * r0.xyz + r1.xyz;
  r3.w = dot(r1.xyz, r1.xyz);
  r3.w = rsqrt(r3.w);
  r1.xyz = r3.www * r1.xyz;
  r3.w = g_WaterInteractTexture.Sample(SS_ClampLinear_s, r7.yz).x;
  r5.xyzw = FC_ScreenSize.zwzw * float4(2,0,0,2) + r7.yzyz;
  r4.w = g_WaterInteractTexture.Sample(SS_ClampLinear_s, r5.xy).x;
  r5.x = g_WaterInteractTexture.Sample(SS_ClampLinear_s, r5.zw).x;
  r5.y = -r4.w + r3.w;
  r5.z = -r5.x + r3.w;
  r3.w = r4.w + r3.w;
  r3.w = r3.w + r5.x;
  r3.w = r3.w * 0.6640625 + -1;
  r3.w = 1 + -abs(r3.w);
  r3.w = -r3.w * r3.w + 1;
  r8.xyz = -r4.xyz;
  r9.xyz = ddx_coarse(r8.xyz);
  r10.xyz = ddy_coarse(r8.xyz);
  r4.w = dot(r9.xyz, r9.xyz);
  r5.x = cmp(0 < r4.w);
  r4.w = rsqrt(r4.w);
  r9.xyz = r9.xyz * r4.www;
  r9.xyz = r5.xxx ? r9.xyz : 0;
  r4.w = dot(r10.xyz, r10.xyz);
  r5.x = cmp(0 < r4.w);
  r4.w = rsqrt(r4.w);
  r10.xyz = r10.xyz * r4.www;
  r10.xyz = r5.xxx ? r10.xyz : 0;
  r5.xzw = r10.xyz * r5.zzz;
  r5.xyz = r5.yyy * r9.xyz + r5.xzw;
  r5.xyz = float3(0,1,0) + r5.xyz;
  r4.w = dot(r5.xyz, r5.xyz);
  r4.w = rsqrt(r4.w);
  r5.xy = r5.xz * r4.ww;
  r3.w = 1 + -r3.w;
  r5.xy = float2(4,4) * r5.xy;
  r1.xz = r1.xz * r3.ww + r5.xy;
  r3.w = dot(r1.xyz, r1.xyz);
  r3.w = rsqrt(r3.w);
  r1.xyz = r3.www * r1.xyz;
  r5.xyz = g_WaterNormalTexture.Sample(SS_ClampLinear_s, w7.xy).xyz;
  r5.xyz = r5.xyz * float3(2,2,2) + float3(-1,-1,-1);
  r3.w = dot(r5.xyz, r5.xyz);
  r3.w = rsqrt(r3.w);
  r5.xyz = r5.xyz * r3.www;
  r3.w = 1 + -v9.x;
  r5.xyz = v9.xxx * r5.xyz;
  r5.xyz = r1.xyz * r3.www + r5.xyz;
  r1.x = dot(r5.xyz, FC_MatrixView._m00_m10_m20);
  r1.y = dot(r5.xyz, FC_MatrixView._m01_m11_m21);
  r1.z = dot(r5.xyz, FC_MatrixView._m02_m12_m22);
  r9.xy = r6.xy * FC_TextureTilingScale[1].xy + FC_TextureTilingScale[1].zw;
  r9.xyz = g_SpecularTexture.Sample(SS_SpecularMap_s, r9.xy).xyz;
  r10.xy = r6.zw * FC_TextureTilingScale[8].xy + FC_TextureTilingScale[8].zw;
  r10.xyz = g_SpecularTexture2.Sample(SS_SpecularMap_s, r10.xy).xyz;
  r11.xy = r6.xy * FC_TextureTilingScale[3].xy + FC_TextureTilingScale[3].zw;
  r9.w = g_BumpmapTexture.Sample(SS_BumpMap_s, r11.xy).z;
  r11.xy = r6.zw * FC_TextureTilingScale[10].xy + FC_TextureTilingScale[10].zw;
  r10.w = g_BumpmapTexture2.Sample(SS_BumpMap_s, r11.xy).z;
  r10.xyzw = r10.xyzw + -r9.xyzw;
  r9.xyzw = r2.wwww * r10.xyzw + r9.xyzw;
  r3.w = FC_SpcParam.x * 0.00390625;
  r3.w = r9.w * r3.w;
  r3.w = 13 * r3.w;
  r3.w = exp2(r3.w);
  r4.w = dot(r3.xyz, r5.xyz);
  r7.w = saturate(r4.w);
  r7.w = 1 + -r7.w;
  r8.w = r7.w * r7.w;
  r8.w = r8.w * r8.w;
  r7.w = r8.w * r7.w;
  r10.xyz = float3(1,1,1) + -r9.xyz;
  r11.xyz = r10.xyz * r7.www + r9.xyz;
  r7.w = 1 + -abs(r4.w);
  r7.w = max(0, r7.w);
  r8.w = r7.w * r7.w;
  r8.w = r8.w * r8.w;
  r7.w = r8.w * r7.w;
  r7.w = r7.w * FC_WaterFresnel.x + FC_WaterFresnel.y;
  r8.w = 10 + v8.w;
  r8.w = 10 / r8.w;
  r12.y = -v0.y * FC_ScreenSize.w + 1;
  r9.w = FC_WaterFogParam0.z * r5.x;
  r12.x = r9.w * r8.w + r7.y;
  r12.xyz = g_ReflectionTexture.Sample(SS_ClampLinear_s, r12.xy).xyz;
  r5.w = 1;
  r13.x = dot(r5.xyzw, FC_AmbientSH[0].xyzw);
  r13.y = dot(r5.xyzw, FC_AmbientSH[1].xyzw);
  r13.z = dot(r5.xyzw, FC_AmbientSH[2].xyzw);
  r13.xyz = max(float3(0,0,0), r13.xyz);
  r5.w = 1 + -r7.w;
  r0.w = (int)r0.w * 17;
  r14.xyz = VC_InstanceData[r0.w].ShLightMask.xxx * FC_DirLightCol_0.xyz;
  r14.xyz = v5.xxx * r14.xyz;
  r15.x = dot(FC_DirLightVec_0.xyz, r5.xyz);
  r15.y = dot(FC_DirLightVec_1.xyz, r5.xyz);
  r15.zw = saturate(r15.xy);
  r16.xyz = r15.zzz * r10.xyz;
  r17.xyz = r15.www * r10.xyz;
  r17.xyz = FC_DirLightCol_1.xyz * r17.xyz;
  r14.xyz = r14.xyz * r16.xyz + r17.xyz;
  r16.xyz = VC_InstanceData[r0.w].ShLightMask.xxx * FC_DirLightSpc_0.xyz;
  r16.xyz = v5.xxx * r16.xyz;
  r17.xyz = r4.xyz * r1.www + FC_DirLightVec_0.xyz;
  r9.w = dot(r17.xyz, r17.xyz);
  r9.w = rsqrt(r9.w);
  r17.xyz = r17.xyz * r9.www;
  r4.xyz = r4.xyz * r1.www + FC_DirLightVec_1.xyz;
  r1.w = dot(r4.xyz, r4.xyz);
  r1.w = rsqrt(r1.w);
  r4.xyz = r4.xyz * r1.www;
  r18.x = saturate(dot(r17.xyz, r5.xyz));
  r18.y = saturate(dot(r4.xyz, r5.xyz));
  r1.w = FC_DirLightVec_0.w * r3.w;
  r9.w = r3.w * 0.00999999978 + FC_DirLightVec_0.w;
  r1.w = r1.w / r9.w;
  r19.x = max(1, r1.w);
  r1.w = FC_DirLightVec_1.w * r3.w;
  r9.w = r3.w * 0.00999999978 + FC_DirLightVec_1.w;
  r1.w = r1.w / r9.w;
  r19.y = max(1, r1.w);
  r18.xy = log2(r18.xy);
  r18.xy = r19.xy * r18.xy;
  r18.xy = exp2(r18.xy);
  r17.x = saturate(dot(r3.xyz, r17.xyz));
  r17.y = saturate(dot(r3.xyz, r4.xyz));
  r4.xy = float2(1,1) + -r17.xy;
  r17.xy = r4.xy * r4.xy;
  r17.xy = r17.xy * r17.xy;
  r4.xy = r17.xy * r4.xy;
  r17.xyz = r4.xxx * r10.xyz + r9.xyz;
  r4.xyz = r4.yyy * r10.xyz + r9.xyz;
  r10.xy = max(r15.xy, r4.ww);
  r10.xy = max(float2(9.99999975e-005,9.99999975e-005), r10.xy);
  r10.xy = r15.zw / r10.xy;
  r15.xyz = r18.xxx * r17.xyz;
  r10.xzw = r15.xyz * r10.xxx;
  r4.xyz = r18.yyy * r4.xyz;
  r4.xyz = r4.xyz * r10.yyy;
  r15.xy = r19.xy * float2(0.125,0.125) + float2(0.25,0.25);
  r15.xzw = r15.xxx * r16.xyz;
  r16.xyz = FC_DirLightSpc_1.xyz * r15.yyy;
  r4.xyz = r16.xyz * r4.xyz;
  r4.xyz = r15.xzw * r10.xzw + r4.xyz;
  r10.xyz = FC_GlobalSpecularMask * FC_SpcMapMulCol.xyz;
  r15.x = dot(v8.xyzw, FC_MatrixInvProj._m00_m10_m20_m30);
  r15.y = dot(v8.xyzw, FC_MatrixInvProj._m01_m11_m21_m31);
  r15.z = dot(v8.xyzw, FC_MatrixInvProj._m02_m12_m22_m32);
  r1.w = dot(v8.xyzw, FC_MatrixInvProj._m03_m13_m23_m33);
  r15.xyz = r15.xyz / r1.www;
  r16.xy = FC_ScreenSize.xy * r7.yz;
  r16.xy = (uint2)r16.xy;
  uiDest.xy = (uint2)r16.xy / FC_LightTile_Width;
  r16.xy = uiDest.xy;
  r16.xy = (uint2)r16.xy;
  r1.w = FC_LightTile_NumCellX;
  r1.w = r16.y * r1.w + r16.x;
  r1.w = (uint)r1.w;
  r4.w = -FC_FrustumNear + r15.z;
  r4.w = log2(r4.w);
  r4.w = -FC_FrustumSliceBias + r4.w;
  r4.w = r4.w / FC_FrustumSliceScale;
  r4.w = max(0, r4.w);
  r4.w = min(14, r4.w);
  r4.w = (uint)r4.w;
  r4.w = 1 << (int)r4.w;
// Known bad code for instruction (needs manual fix):
ld_structured_indexable(structured_buffer, stride=12)(mixed,mixed,mixed,mixed) r16.xyz, r1.w, l(0), t60.xyzx
r16.x = SS_DiffuseMap[]..swiz;
r16.y = SS_DiffuseMap[]..swiz;
r16.z = SS_DiffuseMap[]..swiz;
  r1.w = dot(-r15.xyz, -r15.xyz);
  r1.w = rsqrt(r1.w);
  r17.xyz = -r15.xyz * r1.www;
  r18.xyz = float3(0,0,0);
  r19.xyz = float3(0,0,0);
  r1.w = r16.x;
  r9.w = 0;
  while (true) {
    r10.w = cmp((uint)r9.w >= (uint)r16.y);
    if (r10.w != 0) break;
  // Known bad code for instruction (needs manual fix):
    ld_structured_indexable(structured_buffer, stride=8)(mixed,mixed,mixed,mixed) r20.xy, r1.w, l(0), t59.xyxx
  r20.x = SS_DiffuseMap[]..swiz;
  r20.y = SS_DiffuseMap[]..swiz;
    r10.w = (int)r1.w + 1;
    r11.w = (int)r4.w & (int)r20.y;
    r12.w = (int)r9.w + 1;
    r9.w = r11.w ? r9.w : r12.w;
    r1.w = r10.w;
    if (r11.w == 0) continue;
  // Known bad code for instruction (needs manual fix):
    ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r21.xyzw, r20.x, l(0), t61.xyzw
  r21.x = SS_DiffuseMap[]..swiz;
  r21.y = SS_DiffuseMap[]..swiz;
  r21.z = SS_DiffuseMap[]..swiz;
  r21.w = SS_DiffuseMap[]..swiz;
  // Known bad code for instruction (needs manual fix):
    ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r22.xyzw, r20.x, l(16), t61.xyzw
  r22.x = SS_DiffuseMap[]..swiz;
  r22.y = SS_DiffuseMap[]..swiz;
  r22.z = SS_DiffuseMap[]..swiz;
  r22.w = SS_DiffuseMap[]..swiz;
  // Known bad code for instruction (needs manual fix):
    ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r20.xyz, r20.x, l(32), t61.xyzx
  r20.x = SS_DiffuseMap[]..swiz;
  r20.y = SS_DiffuseMap[]..swiz;
  r20.z = SS_DiffuseMap[]..swiz;
    r21.xyz = r21.xyz + -r15.xyz;
    r11.w = dot(r21.xyz, r21.xyz);
    r13.w = rsqrt(r11.w);
    r23.xyz = r21.xyz * r13.www;
    r14.w = saturate(dot(r1.xyz, r23.xyz));
    r11.w = saturate(r11.w * r21.w);
    r11.w = sqrt(r11.w);
    r11.w = 1 + -r11.w;
    r11.w = r11.w * r11.w;
    r21.xyz = r21.xyz * r13.www + r17.xyz;
    r13.w = dot(r21.xyz, r21.xyz);
    r13.w = rsqrt(r13.w);
    r21.xyz = r21.xyz * r13.www;
    r13.w = r22.w * r3.w;
    r16.w = r3.w * 0.00999999978 + r22.w;
    r13.w = r13.w / r16.w;
    r13.w = max(1, r13.w);
    r16.w = saturate(dot(r21.xyz, r1.xyz));
    r16.w = log2(r16.w);
    r16.w = r16.w * r13.w;
    r16.w = exp2(r16.w);
    r21.xyz = r22.xyz * r14.www;
    r20.xyz = r20.xyz * r16.www;
    r14.w = log2(r14.w);
    r14.w = 0.100000001 * r14.w;
    r14.w = exp2(r14.w);
    r20.xyz = r20.xyz * r14.www;
    r20.xyz = r20.xyz * r11.www;
    r13.w = r13.w * 0.125 + 0.25;
    r18.xyz = r21.xyz * r11.www + r18.xyz;
    r19.xyz = r20.xyz * r13.www + r19.xyz;
    r9.w = r12.w;
    r1.w = r10.w;
  }
  r9.w = dot(r15.xyz, r15.xyz);
  r9.w = rsqrt(r9.w);
  r16.xyw = r15.xyz * r9.www;
  r9.w = dot(r16.xyw, r1.xyz);
  r9.w = r9.w + r9.w;
  r16.xyw = r1.xyz * -r9.www + r16.xyw;
  r9.w = (uint)r16.z >> 16;
  r15.w = 1;
  r20.zw = float2(1,1);
  r21.xyz = r18.xyz;
  r22.xyz = r19.xyz;
  r10.w = r1.w;
  r11.w = 0;
  while (true) {
    r12.w = cmp((uint)r11.w >= (uint)r9.w);
    if (r12.w != 0) break;
  // Known bad code for instruction (needs manual fix):
    ld_structured_indexable(structured_buffer, stride=8)(mixed,mixed,mixed,mixed) r23.xy, r10.w, l(0), t59.xyxx
  r23.x = SS_DiffuseMap[]..swiz;
  r23.y = SS_DiffuseMap[]..swiz;
    r12.w = (int)r10.w + 1;
    r13.w = (int)r4.w & (int)r23.y;
    r14.w = (int)r11.w + 1;
    r11.w = r13.w ? r11.w : r14.w;
    r10.w = r12.w;
    if (r13.w == 0) continue;
  // Known bad code for instruction (needs manual fix):
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r24.xyzw, r23.x, l(0), t62.xyzw
  r24.x = SS_DiffuseMap[]..swiz;
  r24.y = SS_DiffuseMap[]..swiz;
  r24.z = SS_DiffuseMap[]..swiz;
  r24.w = SS_DiffuseMap[]..swiz;
  // Known bad code for instruction (needs manual fix):
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r25.xyzw, r23.x, l(16), t62.xyzw
  r25.x = SS_DiffuseMap[]..swiz;
  r25.y = SS_DiffuseMap[]..swiz;
  r25.z = SS_DiffuseMap[]..swiz;
  r25.w = SS_DiffuseMap[]..swiz;
  // Known bad code for instruction (needs manual fix):
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r23.yzw, r23.x, l(32), t62.xxyz
  r23.y = SS_DiffuseMap[]..swiz;
  r23.z = SS_DiffuseMap[]..swiz;
  r23.w = SS_DiffuseMap[]..swiz;
  // Known bad code for instruction (needs manual fix):
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r26.xyzw, r23.x, l(60), t62.xyzw
  r26.x = SS_DiffuseMap[]..swiz;
  r26.y = SS_DiffuseMap[]..swiz;
  r26.z = SS_DiffuseMap[]..swiz;
  r26.w = SS_DiffuseMap[]..swiz;
  // Known bad code for instruction (needs manual fix):
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r27.xyzw, r23.x, l(76), t62.yzwx
  r27.x = SS_DiffuseMap[]..swiz;
  r27.y = SS_DiffuseMap[]..swiz;
  r27.z = SS_DiffuseMap[]..swiz;
  r27.w = SS_DiffuseMap[]..swiz;
  // Known bad code for instruction (needs manual fix):
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r28.xyzw, r23.x, l(92), t62.yzwx
  r28.x = SS_DiffuseMap[]..swiz;
  r28.y = SS_DiffuseMap[]..swiz;
  r28.z = SS_DiffuseMap[]..swiz;
  r28.w = SS_DiffuseMap[]..swiz;
  // Known bad code for instruction (needs manual fix):
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r29.xyzw, r23.x, l(108), t62.xyzw
  r29.x = SS_DiffuseMap[]..swiz;
  r29.y = SS_DiffuseMap[]..swiz;
  r29.z = SS_DiffuseMap[]..swiz;
  r29.w = SS_DiffuseMap[]..swiz;
  // Known bad code for instruction (needs manual fix):
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r30.w, r23.x, l(124), t62.xxxx
  r30.w = SS_DiffuseMap[]..swiz;
    r31.xyz = r26.yzw;
    r31.w = r27.w;
    r31.x = dot(r15.xyzw, r31.xyzw);
    r27.w = r28.w;
    r31.y = dot(r15.xyzw, r27.xyzw);
    r28.w = r29.x;
    r13.w = dot(r15.xyzw, r28.xyzw);
    r30.xyz = r29.yzw;
    r16.z = dot(r15.xyzw, r30.xyzw);
    r13.w = cmp(0 < r13.w);
    r24.xyz = r24.xyz + -r15.xyz;
    r17.w = dot(r24.xyz, r24.xyz);
    r18.w = rsqrt(r17.w);
    r26.yzw = r24.xyz * r18.www;
    r19.w = cmp(0 < r26.x);
    r21.w = r24.w * r24.w;
    r21.w = 1 / r21.w;
    r27.x = 1 / r17.w;
    r22.w = r27.x + -r21.w;
    r27.w = max(0, r22.w);
    r22.w = saturate(dot(r26.yzw, r1.xyz));
    r28.xy = r31.xy / r16.zz;
    r23.x = dot(r28.xy, r28.xy);
    r23.x = 1 + -r23.x;
    r27.y = max(0, r23.x);
    r17.w = r21.w * r17.w;
    r17.w = min(1, r17.w);
    r27.z = 1 + -r17.w;
    r16.z = r16.z / r24.w;
    r16.z = saturate(1 + -r16.z);
    r20.y = r27.y * r27.y;
    r20.x = r16.z * r16.z;
    r27.xyzw = r19.wwww ? r27.xyzw : r20.xyzw;
    r24.xyz = r24.xyz * r18.www + r17.xyz;
    r16.z = dot(r24.xyz, r24.xyz);
    r16.z = rsqrt(r16.z);
    r24.xyz = r24.xyz * r16.zzz;
    r16.z = r25.w * r3.w;
    r17.w = r3.w * 0.00999999978 + r25.w;
    r16.z = r16.z / r17.w;
    r16.z = max(1, r16.z);
    r17.w = saturate(dot(r24.xyz, r1.xyz));
    r17.w = log2(r17.w);
    r17.w = r17.w * r16.z;
    r17.w = exp2(r17.w);
    r24.xyz = r27.yyy * r27.wzx;
    r25.xyz = r25.xyz * r22.www;
    r27.xyz = r25.xyz * r24.xxx;
    r28.xyz = r23.yzw * r17.www;
    r17.w = log2(r22.w);
    r17.w = 0.100000001 * r17.w;
    r17.w = exp2(r17.w);
    r28.xyz = r28.xyz * r17.www;
    r24.xyw = r28.xyz * r24.yyy;
    r17.w = 0.25 * r16.z;
    r16.z = r16.z * 0.125 + 0.25;
    r24.xyw = r24.xyw * r16.zzz;
    r18.w = saturate(dot(r26.yzw, r16.xyw));
    r18.w = log2(r18.w);
    r17.w = r18.w * r17.w;
    r17.w = exp2(r17.w);
    r16.z = r17.w * r16.z;
    r25.xyz = r25.xyz * r24.zzz;
    r23.xyz = r23.yzw * r16.zzz;
    r23.xyz = r23.xyz * r24.zzz;
    r25.xyz = r19.www ? r27.xyz : r25.xyz;
    r23.xyz = r19.www ? r24.xyw : r23.xyz;
    r24.xyz = r13.www ? r25.xyz : 0;
    r23.xyz = r13.www ? r23.xyz : 0;
    r21.xyz = r24.xyz + r21.xyz;
    r22.xyz = r23.xyz + r22.xyz;
    r11.w = r14.w;
    r10.w = r12.w;
  }
  r1.xyz = -r9.xyz * float3(0.5,0.5,0.5) + float3(1,1,1);
  r1.xyz = r21.xyz * r1.xyz + r14.xyz;
  r4.xyz = r22.xyz * r11.xyz + r4.xyz;
  r6.xyzw = FC_WaterDiffuseUvScrollSpeed.xyzw * FC_GlobalTime + r6.xyzw;
  r6.xy = r6.xy * FC_TextureTilingScale[0].xy + FC_TextureTilingScale[0].zw;
  r6.zw = r6.zw * FC_TextureTilingScale[7].xy + FC_TextureTilingScale[7].zw;
  r9.xyzw = g_DiffuseTexture.Sample(SS_DiffuseMap_s, r6.xy).xyzw;
  r6.xyzw = g_DiffuseTexture2.Sample(SS_DiffuseMap_s, r6.zw).xyzw;
  r6.xyzw = r6.xyzw + -r9.xyzw;
  r6.xyzw = r2.wwww * r6.xyzw + r9.xyzw;
  r9.xyz = r6.xyz;
  r9.w = v5.w;
  r11.x = 1;
  r11.w = v5.w;
  r9.xyzw = r11.xxxw * r9.xyzw;
  r6.xyz = FC_DifMapMulCol.xyz * r9.xyz;
  r9.w = r9.w * r6.w;
  r1.w = dot(r5.xyz, r2.xyz);
  r1.w = FC_WaterFogParam0.w * r1.w;
  r7.x = r1.w * r8.w + r7.y;
  r2.xyzw = g_RefractionTexture.Sample(SS_ClampLinear_s, r7.xz).xyzw;
  r5.xyz = g_RefractionTexture.Sample(SS_ClampLinear_s, r7.yz).xyz;
  r1.w = cmp(r2.w == 0.000000);
  r2.xyz = r1.www ? r2.xyz : r5.xyz;
  r4.xyz = r12.xyz * r7.www + r4.xyz;
  r1.xyz = r13.xyz * r5.www + r1.xyz;
  r2.xyz = r5.www * r2.xyz;
  r1.xyz = r6.xyz * r1.xyz + -r2.xyz;
  r1.xyz = FC_WaterFresnel.zzz * r1.xyz + r2.xyz;
  r9.xyz = r10.xyz * r4.xyz + r1.xyz;
  r1.xyzw = VC_InstanceData[r0.w].mulCol.xyzw * r9.xyzw;
  r0.w = FC_HeightFogParam.w + r8.y;
  r0.w = -FC_HeightFogParam.y + r0.w;
  r0.w = saturate(FC_HeightFogParam.z * r0.w);
  r2.x = dot(r8.xz, r8.xz);
  r2.x = sqrt(r2.x);
  r2.x = -FC_ExtFogParam.y + r2.x;
  r2.x = FC_ExtFogParam.z * r2.x;
  r2.x = exp2(-r2.x);
  r2.x = saturate(-r2.x * FC_ExtFogParam.x + FC_ExtFogParam.x);
  r0.w = saturate(FC_HeightFogParam.x * r0.w);
  r2.y = dot(r1.xyz, float3(0.298909992,0.586610019,0.114480004));
  r2.y = -1 + r2.y;
  r2.z = FC_FogCol.w * r2.y + 1;
  r2.y = FC_HeightFogCol.w * r2.y + 1;
  r4.xyz = FC_FogCol.xyz * r2.zzz + -r1.xyz;
  r1.xyz = r2.xxx * r4.xyz + r1.xyz;
  r2.xyz = FC_HeightFogCol.xyz * r2.yyy + -r1.xyz;
  r1.xyz = r0.www * r2.xyz + r1.xyz;
  r0.w = g_DepthTexture.Sample(SS_ClampPoint_s, r7.yz).x;
  r0.w = FC_DepthComputeParam.x + -r0.w;
  r0.w = -FC_DepthComputeParam.z / r0.w;
  r0.w = -v8.w + r0.w;
  r0.x = saturate(dot(r3.xyz, r0.xyz));
  r0.y = FC_WaterFadeParam.x + -FC_WaterFresnel.w;
  r0.x = r0.x * r0.y + FC_WaterFresnel.w;
  r0.x = saturate(r0.w * r0.x);
  r0.yzw = r1.xyz + -r5.xyz;
  o0.xyz = r0.xxx * r0.yzw + r5.xyz;
  o0.w = r1.w;
  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
//   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
//   float4 FC_WaterDiffuseUvScrollSpeed;// Offset:  288 Size:    16
//   float4 FC_WaterMiddleUvScrollSpeed;// Offset:  304 Size:    16
//   float4 FC_WaterFogParam0;          // Offset:  320 Size:    16
//   float4 FC_WaterFogParam1;          // Offset:  336 Size:    16 [unused]
//   float4 FC_WaterFresnel;            // Offset:  352 Size:    16
//   float4 FC_WaterFadeParam;          // Offset:  368 Size:    16
//   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 [unused]
//   float4 FC_WetParam1;               // Offset:  576 Size:    16 [unused]
//   float4 FC_WetRefrectanceColor;     // Offset:  592 Size:    16 [unused]
//   float4 FC_WetParam2;               // Offset:  608 Size:    16 [unused]
//
// }
//
// cbuffer cbMtdParam
// {
//
//   float4 FC_DifMapMulCol;            // Offset:    0 Size:    16
//   float4 FC_SpcMapMulCol;            // Offset:   16 Size:    16
//   float4 FC_SpcParam;                // Offset:   32 Size:    16
//   float4 FC_SSAOParam;               // Offset:   48 Size:    16 [unused]
//   float3 FC_CDRFParam;               // Offset:   64 Size:    12 [unused]
//   float4 FC_AlphaRef;                // Offset:   80 Size:    16 [unused]
//   float FC_BloodAmount;              // Offset:   96 Size:     4 [unused]
//   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_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]
//
// }
//
// cbuffer cbSceneParam
// {
//
//   float4 FC_FarClipInfo;             // Offset:    0 Size:    16 [unused]
//   float4 FC_ScreenSize;              // Offset:   16 Size:    16
//   float4 FC_DepthComputeParam;       // Offset:   32 Size:    16
//   float4 SC_CameraPos;               // Offset:   48 Size:    16 [unused]
//   float4 VC_ClipPlane;               // Offset:   64 Size:    16 [unused]
//   float4x3 FC_MatrixView;            // Offset:   80 Size:    48
//   float4x4 FC_MatrixInvViewProj;     // Offset:  128 Size:    64
//   float4x4 FC_MatrixInvProj;         // Offset:  192 Size:    64
//   float4x4 FC_MatrixProj;            // Offset:  256 Size:    64 [unused]
//   float4x4 FC_MatrixInvView;         // Offset:  320 Size:    64
//   float4x4 VC_MatrixViewProj;        // Offset:  384 Size:    64 [unused]
//   float4 FC_ShadowMapParam;          // Offset:  448 Size:    16 [unused]
//   float4 FC_ShadowColor;             // Offset:  464 Size:    16 [unused]
//   float4 FC_ShadowDir;               // Offset:  480 Size:    16 [unused]
//   float4x4 VC_ShadowMapMatrix;       // Offset:  496 Size:    64 [unused]
//   float FC_ShadowDepthRate;          // Offset:  560 Size:     4 [unused]
//   float FC_ShadowDepthScale;         // Offset:  564 Size:     4 [unused]
//   float FC_ShadowKernelScale;        // Offset:  568 Size:     4 [unused]
//   float FC_ShadowRandTexInvScale;    // Offset:  572 Size:     4 [unused]
//   float FC_ShadowTexInvScaleX;       // Offset:  576 Size:     4 [unused]
//   float FC_ShadowTexInvScaleY;       // Offset:  580 Size:     4 [unused]
//   float FC_ShadowDepthOffsetScale;   // Offset:  584 Size:     4 [unused]
//   float4 FC_ShadowViewKernelScale;   // Offset:  592 Size:    16 [unused]
//   float4x4 FC_ProjSpaceToShadowMatrix[4];// Offset:  608 Size:   256 [unused]
//   float4 FC_CascadeSelectDist;       // Offset:  864 Size:    16 [unused]
//   float FC_FrustumNear;              // Offset:  880 Size:     4
//   float FC_FrustumSliceScale;        // Offset:  884 Size:     4
//   float FC_FrustumSliceBias;         // Offset:  888 Size:     4
//   uint FC_LightTile_Width;           // Offset:  896 Size:     4
//   uint FC_LightTile_NumCellX;        // Offset:  900 Size:     4
//   float4 FC_CloudShadowParam0;       // Offset:  912 Size:    16 [unused]
//   float4 FC_CloudShadowParam1;       // Offset:  928 Size:    16 [unused]
//   float FC_ShadowScale0;             // Offset:  944 Size:     4 [unused]
//   float FC_ShadowScale1;             // Offset:  948 Size:     4 [unused]
//
// }
//
// cbuffer cbPerFrame
// {
//
//   float4 FC_DebugParam;              // Offset:    0 Size:    16 [unused]
//   float4 FC_DebugOutputMode;         // Offset:   16 Size:    16 [unused]
//   float4 FC_DebugParam2;             // Offset:   32 Size:    16 [unused]
//   float FC_GlobalSpecularMask;       // Offset:   48 Size:     4
//   float FC_GlobalReflectanceScale;   // Offset:   52 Size:     4 [unused]
//   float FC_GlobalShininessScale;     // Offset:   56 Size:     4 [unused]
//   float FC_GlobalAlbedoOffset;       // Offset:   60 Size:     4 [unused]
//   float4 FC_GlobalRefRectanceRGBScale;// Offset:   64 Size:    16 [unused]
//   float4 FC_GlobalAlbedoOffsetRGB;   // Offset:   80 Size:    16 [unused]
//   float4 FC_SnowDir;                 // Offset:   96 Size:    16 [unused]
//   float4 FC_SnowTilingScale;         // Offset:  112 Size:    16 [unused]
//   float4 FC_SnowAlbedo;              // Offset:  128 Size:    16 [unused]
//   float FC_SnowReflectance;          // Offset:  144 Size:     4 [unused]
//   float FC_GroundPlaneHeight;        // Offset:  148 Size:     4 [unused]
//   float FC_RcpSnowHeightRange;       // Offset:  152 Size:     4 [unused]
//   float FC_SnowNormalScale;          // Offset:  156 Size:     4 [unused]
//   float4 FC_SnowSpakleTinlingScale;  // Offset:  160 Size:    16 [unused]
//   float FC_GlobalTime;               // Offset:  176 Size:     4
//   float FC_DominantSharpnesMinValue; // Offset:  192 Size:     4 [unused]
//   float FC_DominantSharpnesOffset;   // Offset:  196 Size:     4 [unused]
//   float FC_DominantSharpnesExponent; // Offset:  200 Size:     4 [unused]
//   float FC_DominantColorScale;       // Offset:  204 Size:     4 [unused]
//   float4 FC_DominantRgbScale;        // Offset:  208 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
//
// }
//
// cbuffer cbLight
// {
//
//   float4 FC_DirLightVec_0;           // Offset:    0 Size:    16
//   float4 FC_DirLightVec_1;           // Offset:   16 Size:    16
//   float4 FC_DirLightVec_2;           // Offset:   32 Size:    16 [unused]
//   float4 FC_DirLightVec_3;           // Offset:   48 Size:    16 [unused]
//   float4 FC_DirLightCol_0;           // Offset:   64 Size:    16
//   float4 FC_DirLightCol_1;           // Offset:   80 Size:    16
//   float4 FC_DirLightCol_2;           // Offset:   96 Size:    16 [unused]
//   float4 FC_DirLightCol_3;           // Offset:  112 Size:    16 [unused]
//   float4 FC_DirLightSpc_0;           // Offset:  128 Size:    16
//   float4 FC_DirLightSpc_1;           // Offset:  144 Size:    16
//   float4 FC_DirLightSpc_2;           // Offset:  160 Size:    16 [unused]
//   float4 FC_DirLightSpc_3;           // Offset:  176 Size:    16 [unused]
//   float4 FC_AmbientSH[3];            // Offset:  192 Size:    48
//   float4 FC_AmbientReflection;       // Offset:  240 Size:    16 [unused]
//   uint4 FC_bLocalLight;              // Offset:  256 Size:    16 [unused]
//   float4 FC_SsaoWeight;              // Offset:  272 Size:    16 [unused]
//
// }
//
// cbuffer cbFog
// {
//
//   float4 FC_FogParam;                // Offset:    0 Size:    16 [unused]
//   float4 FC_FogCol;                  // Offset:   16 Size:    16
//   float4 FC_ExtFogParam;             // Offset:   32 Size:    16
//   float4 FC_HeightFogParam;          // Offset:   48 Size:    16
//   float4 FC_HeightFogCol;            // Offset:   64 Size:    16
//   bool FC_FogType;                   // Offset:   80 Size:     4 [unused]
//   float4 FC_LsBeta1PlusBeta2;        // Offset:   96 Size:    16 [unused]
//   float4 FC_LsTerrainReflectance;    // Offset:  112 Size:    16 [unused]
//   float4 FC_LsOneOverBeta1PlusBeta2; // Offset:  128 Size:    16 [unused]
//   float4 FC_LsHGg;                   // Offset:  144 Size:    16 [unused]
//   float4 FC_LsBetaDash1;             // Offset:  160 Size:    16 [unused]
//   float4 FC_LsBetaDash2;             // Offset:  176 Size:    16 [unused]
//   float4 FC_LsSunColor;              // Offset:  192 Size:    16 [unused]
//   float4 FC_LsLightDir;              // Offset:  208 Size:    16 [unused]
//
// }
//
// Resource bind info for g_LightIndices
// {
//
//   uint2 $Element;                    // Offset:    0 Size:     8
//
// }
//
// Resource bind info for g_LightLookupBuffer
// {
//
//   uint3 $Element;                    // Offset:    0 Size:    12
//
// }
//
// Resource bind info for g_LightBuffer
// {
//
//   struct PointLight
//   {
//       
//       float4 PositionAndRadius;      // Offset:    0
//       float4 DiffColor;              // Offset:   16
//       float4 SpecColor;              // Offset:   32
//       float4 TransLightParam;        // Offset:   48
//
//   } $Element;                        // Offset:    0 Size:    64
//
// }
//
// Resource bind info for g_SpotLightBuffer
// {
//
//   struct SpotLight
//   {
//       
//       float4 PositionAndRange;       // Offset:    0
//       float4 DiffColor;              // Offset:   16
//       float4 SpecColor;              // Offset:   32
//       float3 TransLightParam;        // Offset:   48
//       float ShadingMode;             // Offset:   60
//       float4x4 ViewToLightSpaceMatrix;// Offset:   64
//
//   } $Element;                        // Offset:    0 Size:   128
//
// }
//
//
// 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_ClampPoint                     sampler      NA          NA    7        1
// SS_ClampLinear                    sampler      NA          NA    9        1
// g_DiffuseTexture                  texture  float4          2d    0        1
// g_SpecularTexture                 texture  float4          2d    1        1
// g_BumpmapTexture                  texture  float4          2d    3        1
// g_DiffuseTexture2                 texture  float4          2d    7        1
// g_SpecularTexture2                texture  float4          2d    8        1
// g_BumpmapTexture2                 texture  float4          2d   10        1
// g_BumpmapTexture3                 texture  float4          2d   16        1
// g_ReflectionTexture               texture  float4          2d   54        1
// g_RefractionTexture               texture  float4          2d   55        1
// g_DepthTexture                    texture  float4          2d   56        1
// g_WaterInteractTexture            texture  float4          2d   57        1
// g_WaterNormalTexture              texture  float4          2d   58        1
// g_LightIndices                    texture  struct         r/o   59        1
// g_LightLookupBuffer               texture  struct         r/o   60        1
// g_LightBuffer                     texture  struct         r/o   61        1
// g_SpotLightBuffer                 texture  struct         r/o   62        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
// cbLight                           cbuffer      NA          NA    5        1
// cbFog                             cbuffer      NA          NA    6        1
// cbSceneParam                      cbuffer      NA          NA    8        1
// cbPerFrame                        cbuffer      NA          NA    9        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xy  
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 2   xyzw        2     NONE   float   xyzw
// TEXCOORD                 3   xyzw        3     NONE   float       
// TEXCOORD                 4   xyzw        4     NONE   float       
// COLOR                    1   xyzw        5     NONE   float   x zw
// TEXCOORD                 8   xyzw        6     NONE   float   xyzw
// TEXCOORD                 9   xy          7     NONE   float   xy  
// TEXCOORD                 5     zw        7     NONE   float     zw
// TEXCOORD                11   xyzw        8     NONE   float   xyzw
// TEXCOORD                 6   x           9     NONE   float   x   
// SV_IsFrontFace           0   x          10    FFACE    uint   x   
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[17], immediateIndexed
dcl_constantbuffer cb2[24], immediateIndexed
dcl_constantbuffer cb3[3], immediateIndexed
dcl_constantbuffer cb8[57], immediateIndexed
dcl_constantbuffer cb9[12], immediateIndexed
dcl_constantbuffer cb4[34], dynamicIndexed
dcl_constantbuffer cb5[15], immediateIndexed
dcl_constantbuffer cb6[5], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s7, mode_default
dcl_sampler s9, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t3
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) t16
dcl_resource_texture2d (float,float,float,float) t54
dcl_resource_texture2d (float,float,float,float) t55
dcl_resource_texture2d (float,float,float,float) t56
dcl_resource_texture2d (float,float,float,float) t57
dcl_resource_texture2d (float,float,float,float) t58
dcl_resource_structured t59, 8 
dcl_resource_structured t60, 12 
dcl_resource_structured t61, 64 
dcl_resource_structured t62, 128 
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xyzw
dcl_input_ps linear v5.xzw
dcl_input_ps linear v6.xyzw
dcl_input_ps linear v7.xy
dcl_input_ps linear v7.zw
dcl_input_ps linear v8.xyzw
dcl_input_ps linear v9.x
dcl_input_ps_sgv v10.x, is_front_face
dcl_output o0.xyzw
dcl_temps 32
dp3 r0.x, v1.xyzx, v1.xyzx
rsq r0.x, r0.x
mul r0.xyz, r0.xxxx, v1.xyzx
dp3 r0.w, v2.xyzx, v2.xyzx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, v2.xyzx
mul r2.xyz, r0.zxyz, r1.yzxy
mad r2.xyz, r0.yzxy, r1.zxyz, -r2.xyzx
mul r2.xyz, r2.xyzx, v2.wwww
dp3 r0.w, r2.xyzx, r2.xyzx
rsq r0.w, r0.w
mul r2.xyz, r0.wwww, r2.xyzx
round_ne r0.w, v1.w
ftou r0.w, r0.w
dp4 r3.x, v8.xyzw, cb8[8].xyzw
dp4 r3.y, v8.xyzw, cb8[9].xyzw
dp4 r3.z, v8.xyzw, cb8[10].xyzw
dp4 r1.w, v8.xyzw, cb8[11].xyzw
div r3.xyz, r3.xyzx, r1.wwww
add r4.x, -r3.x, cb8[20].w
add r4.y, -r3.y, cb8[21].w
add r4.z, -r3.z, cb8[22].w
dp3 r1.w, r4.xyzx, r4.xyzx
rsq r1.w, r1.w
mul r3.xyz, r1.wwww, r4.xyzx
dp3 r5.x, r2.xyzx, r4.xyzx
dp3 r5.y, r1.xyzx, r4.xyzx
dp3 r5.z, r0.xyzx, r4.xyzx
dp3 r2.w, r5.xyzx, r5.xyzx
rsq r2.w, r2.w
mul r5.xy, r2.wwww, r5.xyxx
mad r6.xyzw, cb2[17].xyzw, cb9[11].xxxx, v6.xyzw
mad r5.zw, r6.xxxy, cb1[3].xxxy, cb1[3].zzzw
sample_indexable(texture2d)(float,float,float,float) r2.w, r5.zwzz, t3.xyzw, s2
mad r5.zw, r6.zzzw, cb1[10].xxxy, cb1[10].zzzw
sample_indexable(texture2d)(float,float,float,float) r3.w, r5.zwzz, t10.xyzw, s2
add r2.w, -r2.w, l(1.000000)
add r3.w, -r3.w, l(1.000000)
mad r2.w, -r2.w, r3.w, l(1.000000)
mad r5.zw, cb2[19].xxxy, cb9[11].xxxx, v7.xxxy
mad r5.zw, r5.zzzw, cb1[16].xxxy, cb1[16].zzzw
sample_indexable(texture2d)(float,float,float,float) r3.w, r5.zwzz, t16.xyzw, s2
add r2.w, -r2.w, l(1.000000)
add r3.w, -r3.w, l(1.000000)
mad r2.w, -r2.w, r3.w, l(1.000000)
mad r3.w, r2.w, cb2[6].x, cb2[6].y
mad r2.w, -r2.w, r2.w, l(1.000000)
add r4.w, -v5.z, l(1.000000)
mad r2.w, -r2.w, r4.w, l(1.000000)
mad r6.xyzw, r5.xyxy, r3.wwww, v6.xyzw
mad r5.xy, r5.xyxx, r3.wwww, v7.xyxx
mul r7.yz, v0.xxyx, cb8[1].zzwz
movc r0.xyz, v10.xxxx, r0.xyzx, -r0.xyzx
mad r8.xyzw, cb2[17].xyzw, cb9[11].xxxx, r6.xyzw
mad r5.zw, r8.xxxy, cb1[3].xxxy, cb1[3].zzzw
sample_indexable(texture2d)(float,float,float,float) r5.zw, r5.zwzz, t3.zwxy, s2
mad r8.xy, r8.zwzz, cb1[10].xyxx, cb1[10].zwzz
sample_indexable(texture2d)(float,float,float,float) r8.xy, r8.xyxx, t10.xyzw, s2
mad r5.xy, cb2[19].xyxx, cb9[11].xxxx, r5.xyxx
mad r5.xy, r5.xyxx, cb1[16].xyxx, cb1[16].zwzz
sample_indexable(texture2d)(float,float,float,float) r5.xy, r5.xyxx, t16.xyzw, s2
mad r5.zw, r5.zzzw, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
mad r5.zw, r8.xxxy, l(0.000000, 0.000000, 2.000000, 2.000000), r5.zzzw
mad r5.xy, r5.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), r5.zwzz
add r5.xy, r5.xyxx, l(-2.000000, -2.000000, 0.000000, 0.000000)
dp2 r3.w, r5.xyxx, r5.xyxx
min r3.w, r3.w, l(1.000000)
add r3.w, -r3.w, l(1.000000)
sqrt r3.w, r3.w
mul r1.xyz, r1.xyzx, r5.yyyy
mad r1.xyz, r5.xxxx, r2.xyzx, r1.xyzx
mad r1.xyz, r3.wwww, r0.xyzx, r1.xyzx
dp3 r3.w, r1.xyzx, r1.xyzx
rsq r3.w, r3.w
mul r1.xyz, r1.xyzx, r3.wwww
sample_indexable(texture2d)(float,float,float,float) r3.w, r7.yzyy, t57.yzwx, s9
mad r5.xyzw, cb8[1].zwzw, l(2.000000, 0.000000, 0.000000, 2.000000), r7.yzyz
sample_indexable(texture2d)(float,float,float,float) r4.w, r5.xyxx, t57.yzwx, s9
sample_indexable(texture2d)(float,float,float,float) r5.x, r5.zwzz, t57.xyzw, s9
add r5.y, r3.w, -r4.w
add r5.z, r3.w, -r5.x
add r3.w, r3.w, r4.w
add r3.w, r5.x, r3.w
mad r3.w, r3.w, l(0.664063), l(-1.000000)
add r3.w, -|r3.w|, l(1.000000)
mad r3.w, -r3.w, r3.w, l(1.000000)
mov r8.xyz, -r4.xyzx
deriv_rtx_coarse r9.xyz, r8.xyzx
deriv_rty_coarse r10.xyz, r8.xyzx
dp3 r4.w, r9.xyzx, r9.xyzx
lt r5.x, l(0.000000), r4.w
rsq r4.w, r4.w
mul r9.xyz, r4.wwww, r9.xyzx
and r9.xyz, r5.xxxx, r9.xyzx
dp3 r4.w, r10.xyzx, r10.xyzx
lt r5.x, l(0.000000), r4.w
rsq r4.w, r4.w
mul r10.xyz, r4.wwww, r10.xyzx
and r10.xyz, r5.xxxx, r10.xyzx
mul r5.xzw, r5.zzzz, r10.xxyz
mad r5.xyz, r5.yyyy, r9.xyzx, r5.xzwx
add r5.xyz, r5.xyzx, l(0.000000, 1.000000, 0.000000, 0.000000)
dp3 r4.w, r5.xyzx, r5.xyzx
rsq r4.w, r4.w
mul r5.xy, r4.wwww, r5.xzxx
add r3.w, -r3.w, l(1.000000)
mul r5.xy, r5.xyxx, l(4.000000, 4.000000, 0.000000, 0.000000)
mad r1.xz, r1.xxzx, r3.wwww, r5.xxyx
dp3 r3.w, r1.xyzx, r1.xyzx
rsq r3.w, r3.w
mul r1.xyz, r1.xyzx, r3.wwww
sample_indexable(texture2d)(float,float,float,float) r5.xyz, v7.zwzz, t58.xyzw, s9
mad r5.xyz, r5.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r3.w, r5.xyzx, r5.xyzx
rsq r3.w, r3.w
mul r5.xyz, r3.wwww, r5.xyzx
add r3.w, -v9.x, l(1.000000)
mul r5.xyz, r5.xyzx, v9.xxxx
mad r5.xyz, r1.xyzx, r3.wwww, r5.xyzx
dp3 r1.x, r5.xyzx, cb8[5].xyzx
dp3 r1.y, r5.xyzx, cb8[6].xyzx
dp3 r1.z, r5.xyzx, cb8[7].xyzx
mad r9.xy, r6.xyxx, cb1[1].xyxx, cb1[1].zwzz
sample_indexable(texture2d)(float,float,float,float) r9.xyz, r9.xyxx, t1.xyzw, s1
mad r10.xy, r6.zwzz, cb1[8].xyxx, cb1[8].zwzz
sample_indexable(texture2d)(float,float,float,float) r10.xyz, r10.xyxx, t8.xyzw, s1
mad r11.xy, r6.xyxx, cb1[3].xyxx, cb1[3].zwzz
sample_indexable(texture2d)(float,float,float,float) r9.w, r11.xyxx, t3.xywz, s2
mad r11.xy, r6.zwzz, cb1[10].xyxx, cb1[10].zwzz
sample_indexable(texture2d)(float,float,float,float) r10.w, r11.xyxx, t10.xywz, s2
add r10.xyzw, -r9.xyzw, r10.xyzw
mad r9.xyzw, r2.wwww, r10.xyzw, r9.xyzw
mul r3.w, l(0.003906), cb3[2].x
mul r3.w, r3.w, r9.w
mul r3.w, r3.w, l(13.000000)
exp r3.w, r3.w
dp3 r4.w, r3.xyzx, r5.xyzx
mov_sat r7.w, r4.w
add r7.w, -r7.w, l(1.000000)
mul r8.w, r7.w, r7.w
mul r8.w, r8.w, r8.w
mul r7.w, r7.w, r8.w
add r10.xyz, -r9.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mad r11.xyz, r10.xyzx, r7.wwww, r9.xyzx
add r7.w, -|r4.w|, l(1.000000)
max r7.w, r7.w, l(0.000000)
mul r8.w, r7.w, r7.w
mul r8.w, r8.w, r8.w
mul r7.w, r7.w, r8.w
mad r7.w, r7.w, cb2[22].x, cb2[22].y
add r8.w, v8.w, l(10.000000)
div r8.w, l(10.000000), r8.w
mad r12.y, -v0.y, cb8[1].w, l(1.000000)
mul r9.w, r5.x, cb2[20].z
mad r12.x, r9.w, r8.w, r7.y
sample_indexable(texture2d)(float,float,float,float) r12.xyz, r12.xyxx, t54.xyzw, s9
mov r5.w, l(1.000000)
dp4 r13.x, r5.xyzw, cb5[12].xyzw
dp4 r13.y, r5.xyzw, cb5[13].xyzw
dp4 r13.z, r5.xyzw, cb5[14].xyzw
max r13.xyz, r13.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
add r5.w, -r7.w, l(1.000000)
imul null, r0.w, r0.w, l(17)
mul r14.xyz, cb5[4].xyzx, cb4[r0.w + 11].xxxx
mul r14.xyz, r14.xyzx, v5.xxxx
dp3 r15.x, cb5[0].xyzx, r5.xyzx
dp3 r15.y, cb5[1].xyzx, r5.xyzx
mov_sat r15.zw, r15.xxxy
mul r16.xyz, r10.xyzx, r15.zzzz
mul r17.xyz, r10.xyzx, r15.wwww
mul r17.xyz, r17.xyzx, cb5[5].xyzx
mad r14.xyz, r14.xyzx, r16.xyzx, r17.xyzx
mul r16.xyz, cb5[8].xyzx, cb4[r0.w + 11].xxxx
mul r16.xyz, r16.xyzx, v5.xxxx
mad r17.xyz, r4.xyzx, r1.wwww, cb5[0].xyzx
dp3 r9.w, r17.xyzx, r17.xyzx
rsq r9.w, r9.w
mul r17.xyz, r9.wwww, r17.xyzx
mad r4.xyz, r4.xyzx, r1.wwww, cb5[1].xyzx
dp3 r1.w, r4.xyzx, r4.xyzx
rsq r1.w, r1.w
mul r4.xyz, r1.wwww, r4.xyzx
dp3_sat r18.x, r17.xyzx, r5.xyzx
dp3_sat r18.y, r4.xyzx, r5.xyzx
mul r1.w, r3.w, cb5[0].w
mad r9.w, r3.w, l(0.010000), cb5[0].w
div r1.w, r1.w, r9.w
max r19.x, r1.w, l(1.000000)
mul r1.w, r3.w, cb5[1].w
mad r9.w, r3.w, l(0.010000), cb5[1].w
div r1.w, r1.w, r9.w
max r19.y, r1.w, l(1.000000)
log r18.xy, r18.xyxx
mul r18.xy, r18.xyxx, r19.xyxx
exp r18.xy, r18.xyxx
dp3_sat r17.x, r3.xyzx, r17.xyzx
dp3_sat r17.y, r3.xyzx, r4.xyzx
add r4.xy, -r17.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r17.xy, r4.xyxx, r4.xyxx
mul r17.xy, r17.xyxx, r17.xyxx
mul r4.xy, r4.xyxx, r17.xyxx
mad r17.xyz, r4.xxxx, r10.xyzx, r9.xyzx
mad r4.xyz, r4.yyyy, r10.xyzx, r9.xyzx
max r10.xy, r4.wwww, r15.xyxx
max r10.xy, r10.xyxx, l(0.000100, 0.000100, 0.000000, 0.000000)
div r10.xy, r15.zwzz, r10.xyxx
mul r15.xyz, r17.xyzx, r18.xxxx
mul r10.xzw, r10.xxxx, r15.xxyz
mul r4.xyz, r4.xyzx, r18.yyyy
mul r4.xyz, r10.yyyy, r4.xyzx
mad r15.xy, r19.xyxx, l(0.125000, 0.125000, 0.000000, 0.000000), l(0.250000, 0.250000, 0.000000, 0.000000)
mul r15.xzw, r16.xxyz, r15.xxxx
mul r16.xyz, r15.yyyy, cb5[9].xyzx
mul r4.xyz, r4.xyzx, r16.xyzx
mad r4.xyz, r15.xzwx, r10.xzwx, r4.xyzx
mul r10.xyz, cb3[1].xyzx, cb9[3].xxxx
dp4 r15.x, v8.xyzw, cb8[12].xyzw
dp4 r15.y, v8.xyzw, cb8[13].xyzw
dp4 r15.z, v8.xyzw, cb8[14].xyzw
dp4 r1.w, v8.xyzw, cb8[15].xyzw
div r15.xyz, r15.xyzx, r1.wwww
mul r16.xy, r7.yzyy, cb8[1].xyxx
ftou r16.xy, r16.xyxx
udiv r16.xy, null, r16.xyxx, cb8[56].xxxx
utof r16.xy, r16.xyxx
utof r1.w, cb8[56].y
mad r1.w, r16.y, r1.w, r16.x
ftou r1.w, r1.w
add r4.w, r15.z, -cb8[55].x
log r4.w, r4.w
add r4.w, r4.w, -cb8[55].z
div r4.w, r4.w, cb8[55].y
max r4.w, r4.w, l(0.000000)
min r4.w, r4.w, l(14.000000)
ftou r4.w, r4.w
ishl r4.w, l(1), r4.w
ld_structured_indexable(structured_buffer, stride=12)(mixed,mixed,mixed,mixed) r16.xyz, r1.w, l(0), t60.xyzx
dp3 r1.w, -r15.xyzx, -r15.xyzx
rsq r1.w, r1.w
mul r17.xyz, r1.wwww, -r15.xyzx
mov r18.xyz, l(0,0,0,0)
mov r19.xyz, l(0,0,0,0)
mov r1.w, r16.x
mov r9.w, l(0)
loop 
  uge r10.w, r9.w, r16.y
  breakc_nz r10.w
  ld_structured_indexable(structured_buffer, stride=8)(mixed,mixed,mixed,mixed) r20.xy, r1.w, l(0), t59.xyxx
  iadd r10.w, r1.w, l(1)
  and r11.w, r4.w, r20.y
  iadd r12.w, r9.w, l(1)
  movc r9.w, r11.w, r9.w, r12.w
  mov r1.w, r10.w
  continuec_z r11.w
  ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r21.xyzw, r20.x, l(0), t61.xyzw
  ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r22.xyzw, r20.x, l(16), t61.xyzw
  ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r20.xyz, r20.x, l(32), t61.xyzx
  add r21.xyz, -r15.xyzx, r21.xyzx
  dp3 r11.w, r21.xyzx, r21.xyzx
  rsq r13.w, r11.w
  mul r23.xyz, r13.wwww, r21.xyzx
  dp3_sat r14.w, r1.xyzx, r23.xyzx
  mul_sat r11.w, r21.w, r11.w
  sqrt r11.w, r11.w
  add r11.w, -r11.w, l(1.000000)
  mul r11.w, r11.w, r11.w
  mad r21.xyz, r21.xyzx, r13.wwww, r17.xyzx
  dp3 r13.w, r21.xyzx, r21.xyzx
  rsq r13.w, r13.w
  mul r21.xyz, r13.wwww, r21.xyzx
  mul r13.w, r3.w, r22.w
  mad r16.w, r3.w, l(0.010000), r22.w
  div r13.w, r13.w, r16.w
  max r13.w, r13.w, l(1.000000)
  dp3_sat r16.w, r21.xyzx, r1.xyzx
  log r16.w, r16.w
  mul r16.w, r13.w, r16.w
  exp r16.w, r16.w
  mul r21.xyz, r14.wwww, r22.xyzx
  mul r20.xyz, r16.wwww, r20.xyzx
  log r14.w, r14.w
  mul r14.w, r14.w, l(0.100000)
  exp r14.w, r14.w
  mul r20.xyz, r14.wwww, r20.xyzx
  mul r20.xyz, r11.wwww, r20.xyzx
  mad r13.w, r13.w, l(0.125000), l(0.250000)
  mad r18.xyz, r21.xyzx, r11.wwww, r18.xyzx
  mad r19.xyz, r20.xyzx, r13.wwww, r19.xyzx
  mov r9.w, r12.w
  mov r1.w, r10.w
endloop 
dp3 r9.w, r15.xyzx, r15.xyzx
rsq r9.w, r9.w
mul r16.xyw, r9.wwww, r15.xyxz
dp3 r9.w, r16.xywx, r1.xyzx
add r9.w, r9.w, r9.w
mad r16.xyw, r1.xyxz, -r9.wwww, r16.xyxw
ushr r9.w, r16.z, l(16)
mov r15.w, l(1.000000)
mov r20.zw, l(0,0,1.000000,1.000000)
mov r21.xyz, r18.xyzx
mov r22.xyz, r19.xyzx
mov r10.w, r1.w
mov r11.w, l(0)
loop 
  uge r12.w, r11.w, r9.w
  breakc_nz r12.w
  ld_structured_indexable(structured_buffer, stride=8)(mixed,mixed,mixed,mixed) r23.xy, r10.w, l(0), t59.xyxx
  iadd r12.w, r10.w, l(1)
  and r13.w, r4.w, r23.y
  iadd r14.w, r11.w, l(1)
  movc r11.w, r13.w, r11.w, r14.w
  mov r10.w, r12.w
  continuec_z r13.w
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r24.xyzw, r23.x, l(0), t62.xyzw
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r25.xyzw, r23.x, l(16), t62.xyzw
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r23.yzw, r23.x, l(32), t62.xxyz
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r26.xyzw, r23.x, l(60), t62.xyzw
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r27.xyzw, r23.x, l(76), t62.yzwx
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r28.xyzw, r23.x, l(92), t62.yzwx
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r29.xyzw, r23.x, l(108), t62.xyzw
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r30.w, r23.x, l(124), t62.xxxx
  mov r31.xyz, r26.yzwy
  mov r31.w, r27.w
  dp4 r31.x, r15.xyzw, r31.xyzw
  mov r27.w, r28.w
  dp4 r31.y, r15.xyzw, r27.xyzw
  mov r28.w, r29.x
  dp4 r13.w, r15.xyzw, r28.xyzw
  mov r30.xyz, r29.yzwy
  dp4 r16.z, r15.xyzw, r30.xyzw
  lt r13.w, l(0.000000), r13.w
  add r24.xyz, -r15.xyzx, r24.xyzx
  dp3 r17.w, r24.xyzx, r24.xyzx
  rsq r18.w, r17.w
  mul r26.yzw, r18.wwww, r24.xxyz
  lt r19.w, l(0.000000), r26.x
  mul r21.w, r24.w, r24.w
  div r21.w, l(1.000000, 1.000000, 1.000000, 1.000000), r21.w
  div r27.x, l(1.000000, 1.000000, 1.000000, 1.000000), r17.w
  add r22.w, -r21.w, r27.x
  max r27.w, r22.w, l(0.000000)
  dp3_sat r22.w, r26.yzwy, r1.xyzx
  div r28.xy, r31.xyxx, r16.zzzz
  dp2 r23.x, r28.xyxx, r28.xyxx
  add r23.x, -r23.x, l(1.000000)
  max r27.y, r23.x, l(0.000000)
  mul r17.w, r17.w, r21.w
  min r17.w, r17.w, l(1.000000)
  add r27.z, -r17.w, l(1.000000)
  div r16.z, r16.z, r24.w
  add_sat r16.z, -r16.z, l(1.000000)
  mul r20.y, r27.y, r27.y
  mul r20.x, r16.z, r16.z
  movc r27.xyzw, r19.wwww, r27.xyzw, r20.xyzw
  mad r24.xyz, r24.xyzx, r18.wwww, r17.xyzx
  dp3 r16.z, r24.xyzx, r24.xyzx
  rsq r16.z, r16.z
  mul r24.xyz, r16.zzzz, r24.xyzx
  mul r16.z, r3.w, r25.w
  mad r17.w, r3.w, l(0.010000), r25.w
  div r16.z, r16.z, r17.w
  max r16.z, r16.z, l(1.000000)
  dp3_sat r17.w, r24.xyzx, r1.xyzx
  log r17.w, r17.w
  mul r17.w, r16.z, r17.w
  exp r17.w, r17.w
  mul r24.xyz, r27.wzxw, r27.yyyy
  mul r25.xyz, r22.wwww, r25.xyzx
  mul r27.xyz, r24.xxxx, r25.xyzx
  mul r28.xyz, r17.wwww, r23.yzwy
  log r17.w, r22.w
  mul r17.w, r17.w, l(0.100000)
  exp r17.w, r17.w
  mul r28.xyz, r17.wwww, r28.xyzx
  mul r24.xyw, r24.yyyy, r28.xyxz
  mul r17.w, r16.z, l(0.250000)
  mad r16.z, r16.z, l(0.125000), l(0.250000)
  mul r24.xyw, r16.zzzz, r24.xyxw
  dp3_sat r18.w, r26.yzwy, r16.xywx
  log r18.w, r18.w
  mul r17.w, r17.w, r18.w
  exp r17.w, r17.w
  mul r16.z, r16.z, r17.w
  mul r25.xyz, r24.zzzz, r25.xyzx
  mul r23.xyz, r16.zzzz, r23.yzwy
  mul r23.xyz, r24.zzzz, r23.xyzx
  movc r25.xyz, r19.wwww, r27.xyzx, r25.xyzx
  movc r23.xyz, r19.wwww, r24.xywx, r23.xyzx
  and r24.xyz, r13.wwww, r25.xyzx
  and r23.xyz, r13.wwww, r23.xyzx
  add r21.xyz, r21.xyzx, r24.xyzx
  add r22.xyz, r22.xyzx, r23.xyzx
  mov r11.w, r14.w
  mov r10.w, r12.w
endloop 
mad r1.xyz, -r9.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(1.000000, 1.000000, 1.000000, 0.000000)
mad r1.xyz, r21.xyzx, r1.xyzx, r14.xyzx
mad r4.xyz, r22.xyzx, r11.xyzx, r4.xyzx
mad r6.xyzw, cb2[18].xyzw, cb9[11].xxxx, r6.xyzw
mad r6.xy, r6.xyxx, cb1[0].xyxx, cb1[0].zwzz
mad r6.zw, r6.zzzw, cb1[7].xxxy, cb1[7].zzzw
sample_indexable(texture2d)(float,float,float,float) r9.xyzw, r6.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r6.xyzw, r6.zwzz, t7.xyzw, s0
add r6.xyzw, -r9.xyzw, r6.xyzw
mad r6.xyzw, r2.wwww, r6.xyzw, r9.xyzw
mov r9.xyz, r6.xyzx
mov r9.w, v5.w
mov r11.x, l(1.000000)
mov r11.w, v5.w
mul r9.xyzw, r9.xyzw, r11.xxxw
mul r6.xyz, r9.xyzx, cb3[0].xyzx
mul r9.w, r6.w, r9.w
dp3 r1.w, r5.xyzx, r2.xyzx
mul r1.w, r1.w, cb2[20].w
mad r7.x, r1.w, r8.w, r7.y
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r7.xzxx, t55.xyzw, s9
sample_indexable(texture2d)(float,float,float,float) r5.xyz, r7.yzyy, t55.xyzw, s9
eq r1.w, r2.w, l(0.000000)
movc r2.xyz, r1.wwww, r2.xyzx, r5.xyzx
mad r4.xyz, r12.xyzx, r7.wwww, r4.xyzx
mad r1.xyz, r13.xyzx, r5.wwww, r1.xyzx
mul r2.xyz, r2.xyzx, r5.wwww
mad r1.xyz, r6.xyzx, r1.xyzx, -r2.xyzx
mad r1.xyz, cb2[22].zzzz, r1.xyzx, r2.xyzx
mad r9.xyz, r10.xyzx, r4.xyzx, r1.xyzx
mul r1.xyzw, r9.xyzw, cb4[r0.w + 7].xyzw
add r0.w, r8.y, cb6[3].w
add r0.w, r0.w, -cb6[3].y
mul_sat r0.w, r0.w, cb6[3].z
dp2 r2.x, r8.xzxx, r8.xzxx
sqrt r2.x, r2.x
add r2.x, r2.x, -cb6[2].y
mul r2.x, r2.x, cb6[2].z
exp r2.x, -r2.x
mad_sat r2.x, -r2.x, cb6[2].x, cb6[2].x
mul_sat r0.w, r0.w, cb6[3].x
dp3 r2.y, r1.xyzx, l(0.298910, 0.586610, 0.114480, 0.000000)
add r2.y, r2.y, l(-1.000000)
mad r2.z, cb6[1].w, r2.y, l(1.000000)
mad r2.y, cb6[4].w, r2.y, l(1.000000)
mad r4.xyz, cb6[1].xyzx, r2.zzzz, -r1.xyzx
mad r1.xyz, r2.xxxx, r4.xyzx, r1.xyzx
mad r2.xyz, cb6[4].xyzx, r2.yyyy, -r1.xyzx
mad r1.xyz, r0.wwww, r2.xyzx, r1.xyzx
sample_indexable(texture2d)(float,float,float,float) r0.w, r7.yzyy, t56.yzwx, s7
add r0.w, -r0.w, cb8[2].x
div r0.w, -cb8[2].z, r0.w
add r0.w, r0.w, -v8.w
dp3_sat r0.x, r3.xyzx, r0.xyzx
add r0.y, -cb2[22].w, cb2[23].x
mad r0.x, r0.x, r0.y, cb2[22].w
mul_sat r0.x, r0.x, r0.w
add r0.yzw, -r5.xxyz, r1.xxyz
mad o0.xyz, r0.xxxx, r0.yzwy, r5.xyzx
mov o0.w, r1.w
ret 
// Approximately 457 instruction slots used

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