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

cbuffer buffer2 : 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);
  float4 FC_WaterNormalUvScrollSpeed : packoffset(c15);
  float4 FC_WaterDiffuseUvScrollSpeed : packoffset(c16);
  float4 FC_WaterMiddleUvScrollSpeed : packoffset(c17);
  float4 FC_WaterFogParam0 : packoffset(c18);
  float4 FC_WaterFogParam1 : packoffset(c19);
  float4 FC_WaterFresnel : packoffset(c20);
  float4 FC_WaterFadeParam : packoffset(c21);
  float4 FC_SAT_DUMMMY_P3_2 : packoffset(c22);
  float4 FC_SAT_DUMMMY_P3_3 : packoffset(c23);
  float4 FC_SAT_DUMMMY_P3_4 : packoffset(c24);
  float4 FC_SAT_DUMMMY_P3_5 : packoffset(c25);
  float4 FC_SAT_DUMMMY_P3_6 : packoffset(c26);
  float4 FC_SAT_DUMMMY_P3_7 : packoffset(c27);
  float4 FC_SAT_DUMMMY_P3_8 : packoffset(c28);
  float MultiBlend4_et1_p_snp_0_float_0_0 : packoffset(c29);
  float MultiBlend4_et1_p_snp_0_float_1_0 : packoffset(c29.y);
  float MultiBlend4_et1_p_snp_0_float_2_0 : packoffset(c29.z);
  float MultiBlend4_et1_p_snp_0_float_3_0 : packoffset(c29.w);
}

cbuffer cbSceneParam : register(b8)
{
  float4 FC_FarClipInfo : packoffset(c0);
  float4 FC_ScreenSize : packoffset(c1);
  float4x3 FC_MatrixView : packoffset(c2);
  float4x4 FC_MatrixInvViewProj : packoffset(c5);
  float4x4 FC_MatrixInvProj : packoffset(c9);
  float4x4 FC_MatrixProj : packoffset(c13);
  float4 FC_DepthComputeParam : packoffset(c17);
  float4 FC_ShadowMapParam : packoffset(c18);
  float4 FC_ShadowColor : packoffset(c19);
  float4 FC_ShadowDir : packoffset(c20);
  float4x4 VC_ShadowMapMatrix : packoffset(c21);
  float FC_ShadowDepthRate : packoffset(c25);
  float FC_ShadowDepthScale : packoffset(c25.y);
  float FC_ShadowKernelScale : packoffset(c25.z);
  float FC_ShadowRandTexInvScale : packoffset(c25.w);
  float FC_ShadowTexInvScaleX : packoffset(c26);
  float FC_ShadowTexInvScaleY : packoffset(c26.y);
  float FC_ShadowDepthOffsetScale : packoffset(c26.z);
  float4 FC_ShadowViewKernelScale : packoffset(c27);
  float4x4 FC_ProjSpaceToShadowMatrix[4] : packoffset(c28);
  float4 FC_CascadeSelectDist : packoffset(c44);
  float4x4 FC_MatrixInvView : packoffset(c45);
  float4 VC_ClipPlane : packoffset(c49);
  float4x4 VC_MatrixViewProj : packoffset(c50);
}

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);
  float4 FC_SnowDir : packoffset(c4);
  float4 FC_SnowTilingScale : packoffset(c5);
  float4 FC_SnowAlbedo : packoffset(c6);
  float FC_SnowReflectance : packoffset(c7);
  float FC_GroundPlaneHeight : packoffset(c7.y);
  float FC_RcpSnowHeightRange : packoffset(c7.z);
  float FC_SnowNormalScale : packoffset(c7.w);
  float4 FC_SnowSpakleTinlingScale : packoffset(c8);
  float FC_GlobalTime : packoffset(c9);
  float FC_DominantSharpnesMinValue : packoffset(c10);
  float FC_DominantSharpnesOffset : packoffset(c10.y);
  float FC_DominantSharpnesExponent : packoffset(c10.z);
  float FC_DominantColorScale : packoffset(c10.w);
}

cbuffer cbInstanceData : register(b4)
{

  struct
  {
    float4x3 mWorld;
    float4 atlasUvScaleOffset;
    float4 userClipPlane;
    uint4 matricesData;
    uint4 envData;
    float4 mulCol;
    float envMapInterpRatio;
    float envMapColorScale0;
    float envMapColorScale1;
    float giOcclusionMask;
    float4 aSh[3];
  } 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);
}

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

SamplerState SS_DiffuseMap_s : register(s0);
SamplerState SS_WrapLinear_s : register(s8);
SamplerState SS_ClampLinear_s : register(s9);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_16 : register(t1);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_15 : register(t2);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_14 : register(t3);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_13 : register(t4);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_4 : register(t5);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_3 : register(t6);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_1 : register(t7);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_2 : register(t8);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_0 : register(t9);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_6 : register(t10);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_5 : register(t11);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_9 : register(t12);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_10 : register(t13);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_11 : register(t14);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_12 : register(t15);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_8 : register(t16);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_7 : register(t17);
TextureCube<float4> g_IBLTexture : register(t30);
TextureCube<float4> g_IBLTexture2 : register(t31);
Texture2D<float4> g_ShadowTexture : register(t32);
Texture2D<float4> g_SSAOTexture : register(t33);
Texture2D<float4> g_RLRTexture : register(t44);


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


void main( 
  float4 v0 : SV_Position0,
  float4 v1 : COLOR0,
  float3 v2 : NORMAL0,
  float3 v3 : TANGENT0,
  float3 v4 : BINORMAL0,
  float4 v5 : POSITION1,
  float4 v6 : POSITION2,
  float4 v7 : TEXCOORD29,
  float4 v8 : TEXCOORD0,
  float3 v9 : TEXCOORD17,
  uint v10 : SV_IsFrontFace0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xy = MultiBlend4_et1_p_snp_0_float_2_0 * v8.xy;
  r0.xy = r0.xy * FC_TextureTilingScale[0].xy + FC_TextureTilingScale[0].zw;
  r0.x = MultiBlend4_et1_p_snp_0_Texture2D_0.Sample(SS_DiffuseMap_s, r0.xy).x;
  r1.x = dot(v7.xyz, v4.xyz);
  r1.y = dot(v7.xyz, v3.xyz);
  r1.z = dot(v7.xyz, v2.xyz);
  r0.yz = v8.xy * FC_TextureTilingScale[14].xy + FC_TextureTilingScale[14].zw;
  r0.w = dot(-r1.xy, -r1.xy);
  r0.w = rsqrt(r0.w);
  r2.xy = -r1.xy * r0.ww;
  r0.w = dot(-r1.xyz, -r1.xyz);
  r0.w = -r1.z * r1.z + r0.w;
  r0.w = sqrt(r0.w);
  r0.w = r0.w / -r1.z;
  r1.xy = r2.xy * r0.ww;
  r1.xy = MultiBlend4_et1_p_snp_0_float_3_0 * r1.xy;
  r0.w = dot(-v7.xyz, -v7.xyz);
  r0.w = rsqrt(r0.w);
  r2.xyz = -v7.xyz * r0.www;
  r0.w = dot(v2.xyz, v2.xyz);
  r0.w = rsqrt(r0.w);
  r3.xyz = v2.xyz * r0.www;
  r1.zw = ddx_coarse(r0.yz);
  r4.xy = ddy_coarse(r0.yz);
  r4.zw = abs(r4.xy) + abs(r1.zw);
  MultiBlend4_et1_p_snp_0_Texture2D_14.GetDimensions(0, uiDest.x, uiDest.y, uiDest.z);
  r5.xy = uiDest.xy;
  r5.xy = (uint2)r5.xy;
  r4.zw = r5.xy * r4.zw;
  r0.w = max(r4.z, r4.w);
  r0.w = log2(r0.w);
  r0.w = max(0, r0.w);
  r2.w = cmp(4 >= r0.w);
  if (r2.w != 0) {
    r2.w = dot(r2.xyz, r3.xyz);
    r2.w = abs(r2.w) * -12 + 16;
    r3.w = (int)r2.w;
    r2.w = trunc(r2.w);
    r2.w = 1 / r2.w;
    r4.zw = r0.yz;
    r6.x = 0;
    r5.zw = float2(1,1);
    r7.xyzw = float4(0,0,0,0);
    while (true) {
      r6.y = cmp((int)r6.x >= (int)r3.w);
      if (r6.y != 0) break;
      r4.zw = -r2.ww * r1.xy + r4.zw;
      r6.y = MultiBlend4_et1_p_snp_0_Texture2D_14.SampleGrad(SS_DiffuseMap_s, r4.zw, r1.w, r4.y).w;
      r5.x = r5.z + -r2.w;
      r6.z = cmp(r5.x < r6.y);
      r6.w = r6.z ? r3.w : r6.x;
      r5.y = r6.y;
      r7.xyzw = r6.zzzz ? r5.xyzw : r7.xyzw;
      r6.x = (int)r6.w + 1;
      r5.w = r6.y;
      r5.z = r5.x;
    }
    r1.zw = r7.zx + -r7.wy;
    r2.w = r1.z + -r1.w;
    r1.w = r7.z * r1.w;
    r1.z = r7.x * r1.z + -r1.w;
    r1.z = r1.z / r2.w;
    r1.z = 1 + -r1.z;
    r1.zw = -r1.xy * r1.zz + r0.yz;
    r2.w = cmp(3 < r0.w);
    r3.w = trunc(r0.w);
    r0.w = -r3.w + r0.w;
    r4.xy = -r1.zw + r0.yz;
    r4.xy = r0.ww * r4.xy + r1.zw;
    r1.zw = r2.ww ? r4.xy : r1.zw;
  } else {
    r1.zw = r0.yz;
  }
  r0.yz = r1.zw + -r0.yz;
  r0.yz = v8.xy + r0.yz;
  r1.zw = r0.yz * FC_TextureTilingScale[2].xy + FC_TextureTilingScale[2].zw;
  r4.xyz = MultiBlend4_et1_p_snp_0_Texture2D_2.Sample(SS_DiffuseMap_s, r1.zw).xyz;
  r1.zw = v8.xy * FC_TextureTilingScale[13].xy + FC_TextureTilingScale[13].zw;
  r5.xy = ddx_coarse(r1.zw);
  r5.zw = ddy_coarse(r1.zw);
  r6.xy = abs(r5.xy) + abs(r5.zw);
  MultiBlend4_et1_p_snp_0_Texture2D_13.GetDimensions(0, uiDest.x, uiDest.y, uiDest.z);
  r6.zw = uiDest.xy;
  r6.zw = (uint2)r6.zw;
  r6.xy = r6.xy * r6.zw;
  r0.w = max(r6.x, r6.y);
  r0.w = log2(r0.w);
  r0.w = max(0, r0.w);
  r2.w = cmp(4 >= r0.w);
  if (r2.w != 0) {
    r2.w = dot(r2.xyz, r3.xyz);
    r2.w = abs(r2.w) * -12 + 16;
    r3.w = (int)r2.w;
    r2.w = trunc(r2.w);
    r2.w = 1 / r2.w;
    r6.xy = r1.zw;
    r4.w = 0;
    r7.zw = float2(1,1);
    r8.xyzw = float4(0,0,0,0);
    while (true) {
      r6.z = cmp((int)r4.w >= (int)r3.w);
      if (r6.z != 0) break;
      r6.xy = -r2.ww * r1.xy + r6.xy;
      r6.z = MultiBlend4_et1_p_snp_0_Texture2D_13.SampleGrad(SS_DiffuseMap_s, r6.xy, r5.x, r5.z).w;
      r7.x = r7.z + -r2.w;
      r6.w = cmp(r7.x < r6.z);
      r9.x = r6.w ? r3.w : r4.w;
      r7.y = r6.z;
      r8.xyzw = r6.wwww ? r7.xyzw : r8.xyzw;
      r4.w = (int)r9.x + 1;
      r7.w = r6.z;
      r7.z = r7.x;
    }
    r2.w = r8.z + -r8.w;
    r3.w = r8.x + -r8.y;
    r4.w = -r3.w + r2.w;
    r3.w = r8.z * r3.w;
    r2.w = r8.x * r2.w + -r3.w;
    r2.w = r2.w / r4.w;
    r2.w = 1 + -r2.w;
    r5.xy = -r1.xy * r2.ww + r1.zw;
    r2.w = cmp(3 < r0.w);
    r3.w = trunc(r0.w);
    r0.w = -r3.w + r0.w;
    r5.zw = -r5.xy + r1.zw;
    r5.zw = r0.ww * r5.zw + r5.xy;
    r5.xy = r2.ww ? r5.zw : r5.xy;
  } else {
    r5.xy = r1.zw;
  }
  r1.zw = r5.xy + -r1.zw;
  r1.zw = v8.xy + r1.zw;
  r5.xy = r1.zw * FC_TextureTilingScale[1].xy + FC_TextureTilingScale[1].zw;
  r5.xyz = MultiBlend4_et1_p_snp_0_Texture2D_1.Sample(SS_DiffuseMap_s, r5.xy).xyz;
  r6.xy = v8.xy * FC_TextureTilingScale[16].xy + FC_TextureTilingScale[16].zw;
  r6.zw = ddx_coarse(r6.xy);
  r7.xy = ddy_coarse(r6.xy);
  r7.zw = abs(r7.xy) + abs(r6.zw);
  MultiBlend4_et1_p_snp_0_Texture2D_16.GetDimensions(0, uiDest.x, uiDest.y, uiDest.z);
  r8.xy = uiDest.xy;
  r8.xy = (uint2)r8.xy;
  r7.zw = r8.xy * r7.zw;
  r0.w = max(r7.z, r7.w);
  r0.w = log2(r0.w);
  r0.w = max(0, r0.w);
  r2.w = cmp(4 >= r0.w);
  if (r2.w != 0) {
    r2.w = dot(r2.xyz, r3.xyz);
    r2.w = abs(r2.w) * -12 + 16;
    r3.w = (int)r2.w;
    r2.w = trunc(r2.w);
    r2.w = 1 / r2.w;
    r7.zw = r6.xy;
    r4.w = 0;
    r8.zw = float2(1,1);
    r9.xyzw = float4(0,0,0,0);
    while (true) {
      r5.w = cmp((int)r4.w >= (int)r3.w);
      if (r5.w != 0) break;
      r7.zw = -r2.ww * r1.xy + r7.zw;
      r5.w = MultiBlend4_et1_p_snp_0_Texture2D_16.SampleGrad(SS_DiffuseMap_s, r7.zw, r6.z, r7.x).w;
      r8.x = r8.z + -r2.w;
      r10.x = cmp(r8.x < r5.w);
      r10.y = r10.x ? r3.w : r4.w;
      r8.y = r5.w;
      r9.xyzw = r10.xxxx ? r8.xyzw : r9.xyzw;
      r4.w = (int)r10.y + 1;
      r8.w = r5.w;
      r8.z = r8.x;
    }
    r2.w = r9.z + -r9.w;
    r3.w = r9.x + -r9.y;
    r4.w = -r3.w + r2.w;
    r3.w = r9.z * r3.w;
    r2.w = r9.x * r2.w + -r3.w;
    r2.w = r2.w / r4.w;
    r2.w = 1 + -r2.w;
    r6.zw = -r1.xy * r2.ww + r6.xy;
    r2.w = cmp(3 < r0.w);
    r3.w = trunc(r0.w);
    r0.w = -r3.w + r0.w;
    r7.xy = r6.xy + -r6.zw;
    r7.xy = r0.ww * r7.xy + r6.zw;
    r6.zw = r2.ww ? r7.xy : r6.zw;
  } else {
    r6.zw = r6.xy;
  }
  r6.xy = r6.zw + -r6.xy;
  r6.xy = v8.xy + r6.xy;
  r6.zw = r6.xy * FC_TextureTilingScale[4].xy + FC_TextureTilingScale[4].zw;
  r7.xyz = MultiBlend4_et1_p_snp_0_Texture2D_4.Sample(SS_DiffuseMap_s, r6.zw).xyz;
  r6.zw = v8.xy * FC_TextureTilingScale[15].xy + FC_TextureTilingScale[15].zw;
  r8.xy = ddx_coarse(r6.zw);
  r8.zw = ddy_coarse(r6.zw);
  r9.xy = abs(r8.xy) + abs(r8.zw);
  MultiBlend4_et1_p_snp_0_Texture2D_15.GetDimensions(0, uiDest.x, uiDest.y, uiDest.z);
  r9.zw = uiDest.xy;
  r9.zw = (uint2)r9.zw;
  r9.xy = r9.xy * r9.zw;
  r0.w = max(r9.x, r9.y);
  r0.w = log2(r0.w);
  r0.w = max(0, r0.w);
  r2.w = cmp(4 >= r0.w);
  if (r2.w != 0) {
    r2.x = dot(r2.xyz, r3.xyz);
    r2.x = abs(r2.x) * -12 + 16;
    r2.y = (int)r2.x;
    r2.x = trunc(r2.x);
    r2.x = 1 / r2.x;
    r2.zw = r6.zw;
    r3.w = 0;
    r9.zw = float2(1,1);
    r10.xyzw = float4(0,0,0,0);
    while (true) {
      r4.w = cmp((int)r3.w >= (int)r2.y);
      if (r4.w != 0) break;
      r2.zw = -r2.xx * r1.xy + r2.zw;
      r4.w = MultiBlend4_et1_p_snp_0_Texture2D_15.SampleGrad(SS_DiffuseMap_s, r2.zw, r8.x, r8.z).w;
      r9.x = r9.z + -r2.x;
      r5.w = cmp(r9.x < r4.w);
      r7.w = r5.w ? r2.y : r3.w;
      r9.y = r4.w;
      r10.xyzw = r5.wwww ? r9.xyzw : r10.xyzw;
      r3.w = (int)r7.w + 1;
      r9.w = r4.w;
      r9.z = r9.x;
    }
    r2.xy = r10.zx + -r10.wy;
    r2.z = r2.x + -r2.y;
    r2.y = r10.z * r2.y;
    r2.x = r10.x * r2.x + -r2.y;
    r2.x = r2.x / r2.z;
    r2.x = 1 + -r2.x;
    r1.xy = -r1.xy * r2.xx + r6.zw;
    r2.x = cmp(3 < r0.w);
    r2.y = trunc(r0.w);
    r0.w = -r2.y + r0.w;
    r2.yz = r6.zw + -r1.xy;
    r2.yz = r0.ww * r2.yz + r1.xy;
    r1.xy = r2.xx ? r2.yz : r1.xy;
  } else {
    r1.xy = r6.zw;
  }
  r1.xy = r1.xy + -r6.zw;
  r1.xy = v8.xy + r1.xy;
  r2.xy = r1.xy * FC_TextureTilingScale[3].xy + FC_TextureTilingScale[3].zw;
  r2.xyz = MultiBlend4_et1_p_snp_0_Texture2D_3.Sample(SS_DiffuseMap_s, r2.xy).xyz;
  r0.x = 0.00999999978 + r0.x;
  r0.x = MultiBlend4_et1_p_snp_0_float_0_0 * r0.x;
  r8.xyz = float3(1,1,1) + -v9.xyz;
  r8.xyz = -r0.xxx * r8.xyz + v9.xyz;
  r0.x = v1.w * MultiBlend4_et1_p_snp_0_float_1_0 + 1;
  r8.xyz = saturate(r8.xyz * r0.xxx);
  r4.xyz = -r5.xyz + r4.xyz;
  r4.xyz = r8.xxx * r4.xyz + r5.xyz;
  r2.xyz = -r4.xyz + r2.xyz;
  r2.xyz = r8.yyy * r2.xyz + r4.xyz;
  r4.xyz = r7.xyz + -r2.xyz;
  r2.xyz = r8.zzz * r4.xyz + r2.xyz;
  r0.xw = r1.zw * FC_TextureTilingScale[13].xy + FC_TextureTilingScale[13].zw;
  r0.xw = MultiBlend4_et1_p_snp_0_Texture2D_13.Sample(SS_DiffuseMap_s, r0.xw).xy;
  r0.xw = r0.xw * float2(2,2) + float2(-1,-1);
  r2.w = dot(r0.xw, r0.xw);
  r2.w = 1 + -r2.w;
  r2.w = max(0, r2.w);
  r2.w = sqrt(r2.w);
  r4.xyz = v3.xyz * r0.www;
  r4.xyz = r0.xxx * v4.xyz + r4.xyz;
  r4.xyz = r2.www * v2.xyz + r4.xyz;
  r0.x = dot(r4.xyz, r4.xyz);
  r0.x = rsqrt(r0.x);
  r4.xyz = r4.xyz * r0.xxx;
  r0.xw = r0.yz * FC_TextureTilingScale[14].xy + FC_TextureTilingScale[14].zw;
  r0.xw = MultiBlend4_et1_p_snp_0_Texture2D_14.Sample(SS_DiffuseMap_s, r0.xw).xy;
  r0.xw = r0.xw * float2(2,2) + float2(-1,-1);
  r2.w = dot(r0.xw, r0.xw);
  r2.w = 1 + -r2.w;
  r2.w = max(0, r2.w);
  r2.w = sqrt(r2.w);
  r5.xyz = v3.xyz * r0.www;
  r5.xyz = r0.xxx * v4.xyz + r5.xyz;
  r5.xyz = r2.www * v2.xyz + r5.xyz;
  r0.x = dot(r5.xyz, r5.xyz);
  r0.x = rsqrt(r0.x);
  r6.zw = r1.xy * FC_TextureTilingScale[15].xy + FC_TextureTilingScale[15].zw;
  r6.zw = MultiBlend4_et1_p_snp_0_Texture2D_15.Sample(SS_DiffuseMap_s, r6.zw).xy;
  r6.zw = r6.zw * float2(2,2) + float2(-1,-1);
  r0.w = dot(r6.zw, r6.zw);
  r0.w = 1 + -r0.w;
  r0.w = max(0, r0.w);
  r0.w = sqrt(r0.w);
  r7.xyz = v3.xyz * r6.www;
  r7.xyz = r6.zzz * v4.xyz + r7.xyz;
  r7.xyz = r0.www * v2.xyz + r7.xyz;
  r0.w = dot(r7.xyz, r7.xyz);
  r0.w = rsqrt(r0.w);
  r6.zw = r6.xy * FC_TextureTilingScale[16].xy + FC_TextureTilingScale[16].zw;
  r6.zw = MultiBlend4_et1_p_snp_0_Texture2D_16.Sample(SS_DiffuseMap_s, r6.zw).xy;
  r6.zw = r6.zw * float2(2,2) + float2(-1,-1);
  r2.w = dot(r6.zw, r6.zw);
  r2.w = 1 + -r2.w;
  r2.w = max(0, r2.w);
  r2.w = sqrt(r2.w);
  r9.xyz = v3.xyz * r6.www;
  r9.xyz = r6.zzz * v4.xyz + r9.xyz;
  r9.xyz = r2.www * v2.xyz + r9.xyz;
  r2.w = dot(r9.xyz, r9.xyz);
  r2.w = rsqrt(r2.w);
  r5.xyz = r5.xyz * r0.xxx + -r4.xyz;
  r4.xyz = r8.xxx * r5.xyz + r4.xyz;
  r5.xyz = r7.xyz * r0.www + -r4.xyz;
  r4.xyz = r8.yyy * r5.xyz + r4.xyz;
  r5.xyz = r9.xyz * r2.www + -r4.xyz;
  r4.xyz = r8.zzz * r5.xyz + r4.xyz;
  r0.xw = r0.yz * FC_TextureTilingScale[6].xy + FC_TextureTilingScale[6].zw;
  r5.xyz = MultiBlend4_et1_p_snp_0_Texture2D_6.Sample(SS_DiffuseMap_s, r0.xw).xyz;
  r0.xw = r1.zw * FC_TextureTilingScale[5].xy + FC_TextureTilingScale[5].zw;
  r7.xyz = MultiBlend4_et1_p_snp_0_Texture2D_5.Sample(SS_DiffuseMap_s, r0.xw).xyz;
  r0.xw = r1.xy * FC_TextureTilingScale[7].xy + FC_TextureTilingScale[7].zw;
  r9.xyz = MultiBlend4_et1_p_snp_0_Texture2D_7.Sample(SS_DiffuseMap_s, r0.xw).xyz;
  r0.xw = r6.xy * FC_TextureTilingScale[8].xy + FC_TextureTilingScale[8].zw;
  r10.xyz = MultiBlend4_et1_p_snp_0_Texture2D_8.Sample(SS_DiffuseMap_s, r0.xw).xyz;
  r5.xyz = -r7.xyz + r5.xyz;
  r5.xyz = r8.xxx * r5.xyz + r7.xyz;
  r7.xyz = r9.xyz + -r5.xyz;
  r5.xyz = r8.yyy * r7.xyz + r5.xyz;
  r7.xyz = r10.xyz + -r5.xyz;
  r5.xyz = r8.zzz * r7.xyz + r5.xyz;
  r0.xw = r1.xy * FC_TextureTilingScale[11].xy + FC_TextureTilingScale[11].zw;
  r0.x = MultiBlend4_et1_p_snp_0_Texture2D_11.Sample(SS_DiffuseMap_s, r0.xw).x;
  r1.xy = r1.zw * FC_TextureTilingScale[9].xy + FC_TextureTilingScale[9].zw;
  r0.w = MultiBlend4_et1_p_snp_0_Texture2D_9.Sample(SS_DiffuseMap_s, r1.xy).x;
  r0.yz = r0.yz * FC_TextureTilingScale[10].xy + FC_TextureTilingScale[10].zw;
  r0.y = MultiBlend4_et1_p_snp_0_Texture2D_10.Sample(SS_DiffuseMap_s, r0.yz).x;
  r1.xy = r6.xy * FC_TextureTilingScale[12].xy + FC_TextureTilingScale[12].zw;
  r0.z = MultiBlend4_et1_p_snp_0_Texture2D_12.Sample(SS_DiffuseMap_s, r1.xy).x;
  r0.y = r0.y + -r0.w;
  r0.y = r8.x * r0.y + r0.w;
  r0.x = r0.x + -r0.y;
  r0.x = r8.y * r0.x + r0.y;
  r0.y = r0.z + -r0.x;
  r0.x = r8.z * r0.y + r0.x;
  r0.y = dot(v7.xyz, v7.xyz);
  r0.y = rsqrt(r0.y);
  r1.xyz = v7.xyz * r0.yyy;
  r0.zw = v5.xy / v5.ww;
  r0.zw = r0.zw * float2(0.5,-0.5) + float2(0.5,0.5);
  r1.w = dot(r4.xyz, r4.xyz);
  r1.w = rsqrt(r1.w);
  r4.xyz = r4.xyz * r1.www;
  r1.w = FC_GlobalReflectanceScale * FC_GlobalReflectanceScale;
  r6.xyz = r5.xyz * r1.www;
  r0.x = FC_GlobalShininessScale * r0.x;
  r2.w = 13 * r0.x;
  r2.w = exp2(r2.w);
  r3.w = g_SSAOTexture.Sample(SS_WrapLinear_s, r0.zw).x;
  r5.w = dot(r4.xyz, r1.xyz);
  r6.w = r5.w + r3.w;
  r6.w = r6.w * r6.w + r3.w;
  r6.w = saturate(-1 + r6.w);
  r7.x = saturate(r5.w);
  r7.x = 1 + -r7.x;
  r5.w = r5.w + r5.w;
  r7.yzw = r5.www * r4.xyz + -r1.xyz;
  r5.w = r7.x * r7.x;
  r5.w = r5.w * r5.w;
  r5.w = r7.x * r5.w;
  r5.w = r5.w * r6.w;
  r6.w = -r0.x * 6.5 + 6.5;
  r6.w = min(6, r6.w);
  r5.xyz = -r5.xyz * r1.www + float3(1,1,1);
  r8.xyz = r5.xyz * r5.www;
  r0.x = r0.x * r0.x;
  r8.xyz = r8.xyz * r0.xxx + r6.xyz;
  r9.xyz = g_IBLTexture.SampleLevel(SS_WrapLinear_s, r7.yzw, r6.w).xyz;
  r9.xyz = VC_InstanceData[0].envMapColorScale0 * r9.xyz;
  r10.xyz = g_IBLTexture2.SampleLevel(SS_WrapLinear_s, r7.yzw, r6.w).xyz;
  r10.xyz = r10.xyz * VC_InstanceData[0].envMapColorScale1 + -r9.xyz;
  r9.xyz = VC_InstanceData[0].envMapInterpRatio * r10.xyz + r9.xyz;
  r9.xyz = r9.xyz * r8.xyz;
  r9.xyz = r9.xyz * r3.www;
  r0.x = dot(r7.yzw, r3.xyz);
  r0.x = saturate(1 + r0.x);
  r0.x = r0.x * r0.x;
  r3.xyz = r9.xyz * r0.xxx;
  r4.w = 1;
  r7.x = dot(r4.xyzw, VC_InstanceData[0].aSh[0].xyzw);
  r7.y = dot(r4.xyzw, VC_InstanceData[0].aSh[1].xyzw);
  r7.z = dot(r4.xyzw, VC_InstanceData[0].aSh[2].xyzw);
  r7.xyz = max(float3(0,0,0), r7.xyz);
  r7.xyz = r7.xyz * r5.xyz;
  r7.xyz = r7.xyz * r3.www;
  r9.xyzw = g_RLRTexture.SampleLevel(SS_ClampLinear_s, r0.zw, r6.w).xyzw;
  r8.xyz = r8.xyz * r3.www;
  r8.xyz = r9.xyz * r8.xyz;
  r0.x = 1 + -r9.w;
  r3.xyz = r3.xyz * r0.xxx + r8.xyz;
  r0.x = g_ShadowTexture.Sample(SS_WrapLinear_s, r0.zw).w;
  r8.xyz = -FC_ShadowColor.xyz + float3(1,1,1);
  r9.xyz = float3(1,1,1) + -r8.xyz;
  r0.xzw = r0.xxx * r9.xyz + r8.xyz;
  r8.xyz = float3(-1,-1,-1) + r0.xzw;
  r8.xyz = VC_InstanceData[0].giOcclusionMask * r8.xyz + float3(1,1,1);
  r9.xyz = FC_DirLightCol_0.xyz * r0.xzw;
  r10.x = dot(FC_DirLightVec_0.xyz, r4.xyz);
  r10.y = dot(FC_DirLightVec_1.xyz, r4.xyz);
  r10.zw = saturate(r10.xy);
  r11.xyz = r10.zzz * r5.xyz;
  r12.xyz = r10.www * r5.xyz;
  r12.xyz = FC_DirLightCol_1.xyz * r12.xyz;
  r9.xyz = r9.xyz * r11.xyz + r12.xyz;
  r10.zw = cmp(int2(0,0) < (uint2)FC_bLocalLight.xy);
  r1.w = dot(FC_DirLightVec_2.xyz, r4.xyz);
  r1.w = r1.w * 0.5 + 0.5;
  r1.w = r1.w * r1.w;
  r1.w = min(1, r1.w);
  r11.xyz = r1.www * r5.xyz;
  r11.xyz = FC_DirLightCol_2.xyz * r11.xyz + r9.xyz;
  r9.xyz = r10.zzz ? r11.xyz : r9.xyz;
  r1.w = dot(FC_DirLightVec_3.xyz, r4.xyz);
  r1.w = r1.w * 0.5 + 0.5;
  r1.w = r1.w * r1.w;
  r1.w = min(1, r1.w);
  r11.xyz = r1.www * r5.xyz;
  r11.xyz = FC_DirLightCol_3.xyz * r11.xyz + r9.xyz;
  r9.xyz = r10.www ? r11.xyz : r9.xyz;
  r0.xzw = FC_DirLightSpc_0.xyz * r0.xzw;
  r11.xyz = v7.xyz * r0.yyy + FC_DirLightVec_0.xyz;
  r1.w = dot(r11.xyz, r11.xyz);
  r1.w = rsqrt(r1.w);
  r11.xyz = r11.xyz * r1.www;
  r12.xyz = v7.xyz * r0.yyy + FC_DirLightVec_1.xyz;
  r1.w = dot(r12.xyz, r12.xyz);
  r1.w = rsqrt(r1.w);
  r12.xyz = r12.xyz * r1.www;
  r13.x = saturate(dot(r11.xyz, r4.xyz));
  r13.y = saturate(dot(r12.xyz, r4.xyz));
  r1.w = FC_DirLightVec_0.w * r2.w;
  r3.w = r2.w * 0.00999999978 + FC_DirLightVec_0.w;
  r1.w = r1.w / r3.w;
  r14.x = max(1, r1.w);
  r1.w = FC_DirLightVec_1.w * r2.w;
  r3.w = r2.w * 0.00999999978 + FC_DirLightVec_1.w;
  r1.w = r1.w / r3.w;
  r14.y = max(1, r1.w);
  r13.xy = log2(r13.xy);
  r13.xy = r14.xy * r13.xy;
  r13.xy = exp2(r13.xy);
  r11.x = saturate(dot(r1.xyz, r11.xyz));
  r11.y = saturate(dot(r1.xyz, r12.xyz));
  r11.xy = float2(1,1) + -r11.xy;
  r11.zw = r11.xy * r11.xy;
  r11.zw = r11.zw * r11.zw;
  r11.xy = r11.xy * r11.zw;
  r11.xzw = r11.xxx * r5.xyz + r6.xyz;
  r12.xyz = r11.yyy * r5.xyz + r6.xyz;
  r10.xy = saturate(float2(16,16) * r10.xy);
  r11.xyz = r13.xxx * r11.xzw;
  r11.xyz = r11.xyz * r10.xxx;
  r12.xyz = r13.yyy * r12.xyz;
  r12.xyz = r12.xyz * r10.yyy;
  r10.xy = r14.xy * float2(0.125,0.125) + float2(0.25,0.25);
  r0.xzw = r10.xxx * r0.xzw;
  r13.xyz = FC_DirLightSpc_1.xyz * r10.yyy;
  r12.xyz = r13.xyz * r12.xyz;
  r0.xzw = r0.xzw * r11.xyz + r12.xyz;
  r11.xyz = v7.xyz * r0.yyy + FC_DirLightVec_2.xyz;
  r1.w = dot(r11.xyz, r11.xyz);
  r1.w = rsqrt(r1.w);
  r11.xyz = r11.xyz * r1.www;
  r1.w = saturate(dot(r11.xyz, r4.xyz));
  r3.w = FC_DirLightVec_2.w * r2.w;
  r4.w = r2.w * 0.00999999978 + FC_DirLightVec_2.w;
  r3.w = r3.w / r4.w;
  r3.w = max(1, r3.w);
  r1.w = log2(r1.w);
  r1.w = r3.w * r1.w;
  r1.w = exp2(r1.w);
  r4.w = saturate(dot(r1.xyz, r11.xyz));
  r4.w = 1 + -r4.w;
  r5.w = r4.w * r4.w;
  r5.w = r5.w * r5.w;
  r4.w = r5.w * r4.w;
  r11.xyz = r4.www * r5.xyz + r6.xyz;
  r11.xyz = r11.xyz * r1.www;
  r1.w = r3.w * 0.125 + 0.25;
  r12.xyz = FC_DirLightSpc_2.xyz * r1.www;
  r11.xyz = r12.xyz * r11.xyz + r0.xzw;
  r0.xzw = r10.zzz ? r11.xyz : r0.xzw;
  r10.xyz = v7.xyz * r0.yyy + FC_DirLightVec_3.xyz;
  r0.y = dot(r10.xyz, r10.xyz);
  r0.y = rsqrt(r0.y);
  r10.xyz = r10.xyz * r0.yyy;
  r0.y = saturate(dot(r10.xyz, r4.xyz));
  r1.w = FC_DirLightVec_3.w * r2.w;
  r2.w = r2.w * 0.00999999978 + FC_DirLightVec_3.w;
  r1.w = r1.w / r2.w;
  r1.w = max(1, r1.w);
  r0.y = log2(r0.y);
  r0.y = r1.w * r0.y;
  r0.y = exp2(r0.y);
  r1.x = saturate(dot(r1.xyz, r10.xyz));
  r1.x = 1 + -r1.x;
  r1.y = r1.x * r1.x;
  r1.y = r1.y * r1.y;
  r1.x = r1.x * r1.y;
  r1.xyz = r1.xxx * r5.xyz + r6.xyz;
  r1.xyz = r1.xyz * r0.yyy;
  r0.y = r1.w * 0.125 + 0.25;
  r4.xyz = FC_DirLightSpc_3.xyz * r0.yyy;
  r1.xyz = r4.xyz * r1.xyz + r0.xzw;
  r0.xyz = r10.www ? r1.xyz : r0.xzw;
  r0.xyz = r3.xyz * r8.xyz + r0.xyz;
  r1.xyz = r7.xyz * r8.xyz + r9.xyz;
  r0.xyz = r2.xyz * r1.xyz + r0.xyz;
  r0.xyz = VC_InstanceData[0].mulCol.xyz * r0.xyz;
  r0.w = FC_HeightFogParam.w + -v7.y;
  r0.w = -FC_HeightFogParam.y + r0.w;
  r0.w = saturate(FC_HeightFogParam.z * r0.w);
  r1.x = dot(-v7.xz, -v7.xz);
  r1.x = sqrt(r1.x);
  r1.x = -FC_ExtFogParam.y + r1.x;
  r1.x = FC_ExtFogParam.z * r1.x;
  r1.x = exp2(-r1.x);
  r1.x = saturate(-r1.x * FC_ExtFogParam.x + FC_ExtFogParam.x);
  r0.w = saturate(FC_HeightFogParam.x * r0.w);
  r1.y = dot(r0.xyz, float3(0.298909992,0.586610019,0.114480004));
  r1.y = -1 + r1.y;
  r1.z = FC_FogCol.w * r1.y + 1;
  r1.y = FC_HeightFogCol.w * r1.y + 1;
  r2.xyz = FC_FogCol.xyz * r1.zzz + -r0.xyz;
  r0.xyz = r1.xxx * r2.xyz + r0.xyz;
  r1.xyz = FC_HeightFogCol.xyz * r1.yyy + -r0.xyz;
  o0.xyz = r0.www * r1.xyz + r0.xyz;
  o0.w = VC_InstanceData[0].mulCol.w;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//
// Buffer Definitions: 
//
// cbuffer buffer2
// {
//
//   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]
//   float4 FC_WaterNormalUvScrollSpeed;// Offset:  240 Size:    16 [unused]
//   float4 FC_WaterDiffuseUvScrollSpeed;// Offset:  256 Size:    16 [unused]
//   float4 FC_WaterMiddleUvScrollSpeed;// Offset:  272 Size:    16 [unused]
//   float4 FC_WaterFogParam0;          // Offset:  288 Size:    16 [unused]
//   float4 FC_WaterFogParam1;          // Offset:  304 Size:    16 [unused]
//   float4 FC_WaterFresnel;            // Offset:  320 Size:    16 [unused]
//   float4 FC_WaterFadeParam;          // Offset:  336 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P3_2;         // Offset:  352 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P3_3;         // Offset:  368 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P3_4;         // Offset:  384 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P3_5;         // Offset:  400 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P3_6;         // Offset:  416 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P3_7;         // Offset:  432 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P3_8;         // Offset:  448 Size:    16 [unused]
//   float MultiBlend4_et1_p_snp_0_float_0_0;// Offset:  464 Size:     4
//   float MultiBlend4_et1_p_snp_0_float_1_0;// Offset:  468 Size:     4
//   float MultiBlend4_et1_p_snp_0_float_2_0;// Offset:  472 Size:     4
//   float MultiBlend4_et1_p_snp_0_float_3_0;// Offset:  476 Size:     4
//
// }
//
// cbuffer cbSceneParam
// {
//
//   float4 FC_FarClipInfo;             // Offset:    0 Size:    16 [unused]
//   float4 FC_ScreenSize;              // Offset:   16 Size:    16 [unused]
//   float4x3 FC_MatrixView;            // Offset:   32 Size:    48 [unused]
//   float4x4 FC_MatrixInvViewProj;     // Offset:   80 Size:    64 [unused]
//   float4x4 FC_MatrixInvProj;         // Offset:  144 Size:    64 [unused]
//   float4x4 FC_MatrixProj;            // Offset:  208 Size:    64 [unused]
//   float4 FC_DepthComputeParam;       // Offset:  272 Size:    16 [unused]
//   float4 FC_ShadowMapParam;          // Offset:  288 Size:    16 [unused]
//   float4 FC_ShadowColor;             // Offset:  304 Size:    16
//   float4 FC_ShadowDir;               // Offset:  320 Size:    16 [unused]
//   float4x4 VC_ShadowMapMatrix;       // Offset:  336 Size:    64 [unused]
//   float FC_ShadowDepthRate;          // Offset:  400 Size:     4 [unused]
//   float FC_ShadowDepthScale;         // Offset:  404 Size:     4 [unused]
//   float FC_ShadowKernelScale;        // Offset:  408 Size:     4 [unused]
//   float FC_ShadowRandTexInvScale;    // Offset:  412 Size:     4 [unused]
//   float FC_ShadowTexInvScaleX;       // Offset:  416 Size:     4 [unused]
//   float FC_ShadowTexInvScaleY;       // Offset:  420 Size:     4 [unused]
//   float FC_ShadowDepthOffsetScale;   // Offset:  424 Size:     4 [unused]
//   float4 FC_ShadowViewKernelScale;   // Offset:  432 Size:    16 [unused]
//   float4x4 FC_ProjSpaceToShadowMatrix[4];// Offset:  448 Size:   256 [unused]
//   float4 FC_CascadeSelectDist;       // Offset:  704 Size:    16 [unused]
//   float4x4 FC_MatrixInvView;         // Offset:  720 Size:    64 [unused]
//   float4 VC_ClipPlane;               // Offset:  784 Size:    16 [unused]
//   float4x4 VC_MatrixViewProj;        // Offset:  800 Size:    64 [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 [unused]
//   float FC_GlobalReflectanceScale;   // Offset:   52 Size:     4
//   float FC_GlobalShininessScale;     // Offset:   56 Size:     4
//   float4 FC_SnowDir;                 // Offset:   64 Size:    16 [unused]
//   float4 FC_SnowTilingScale;         // Offset:   80 Size:    16 [unused]
//   float4 FC_SnowAlbedo;              // Offset:   96 Size:    16 [unused]
//   float FC_SnowReflectance;          // Offset:  112 Size:     4 [unused]
//   float FC_GroundPlaneHeight;        // Offset:  116 Size:     4 [unused]
//   float FC_RcpSnowHeightRange;       // Offset:  120 Size:     4 [unused]
//   float FC_SnowNormalScale;          // Offset:  124 Size:     4 [unused]
//   float4 FC_SnowSpakleTinlingScale;  // Offset:  128 Size:    16 [unused]
//   float FC_GlobalTime;               // Offset:  144 Size:     4 [unused]
//   float FC_DominantSharpnesMinValue; // Offset:  160 Size:     4 [unused]
//   float FC_DominantSharpnesOffset;   // Offset:  164 Size:     4 [unused]
//   float FC_DominantSharpnesExponent; // Offset:  168 Size:     4 [unused]
//   float FC_DominantColorScale;       // Offset:  172 Size:     4 [unused]
//
// }
//
// cbuffer cbInstanceData
// {
//
//   struct PerInstanceData
//   {
//       
//       float4x3 mWorld;               // Offset:    0
//       float4 atlasUvScaleOffset;     // Offset:   48
//       float4 userClipPlane;          // Offset:   64
//       uint4 matricesData;            // Offset:   80
//       uint4 envData;                 // Offset:   96
//       float4 mulCol;                 // Offset:  112
//       float envMapInterpRatio;       // Offset:  128
//       float envMapColorScale0;       // Offset:  132
//       float envMapColorScale1;       // Offset:  136
//       float giOcclusionMask;         // Offset:  140
//       float4 aSh[3];                 // Offset:  144
//
//   } VC_InstanceData[2];              // Offset:    0 Size:   384
//
// }
//
// 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
//   float4 FC_DirLightVec_3;           // Offset:   48 Size:    16
//   float4 FC_DirLightCol_0;           // Offset:   64 Size:    16
//   float4 FC_DirLightCol_1;           // Offset:   80 Size:    16
//   float4 FC_DirLightCol_2;           // Offset:   96 Size:    16
//   float4 FC_DirLightCol_3;           // Offset:  112 Size:    16
//   float4 FC_DirLightSpc_0;           // Offset:  128 Size:    16
//   float4 FC_DirLightSpc_1;           // Offset:  144 Size:    16
//   float4 FC_DirLightSpc_2;           // Offset:  160 Size:    16
//   float4 FC_DirLightSpc_3;           // Offset:  176 Size:    16
//   float4 FC_AmbientSH[3];            // Offset:  192 Size:    48 [unused]
//   float4 FC_AmbientReflection;       // Offset:  240 Size:    16 [unused]
//   uint4 FC_bLocalLight;              // Offset:  256 Size:    16
//   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]
//
// }
//
// cbuffer cbTextureTilingScale
// {
//
//   float4 FC_TextureTilingScale[25];  // Offset:    0 Size:   400
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SS_DiffuseMap                     sampler      NA          NA    0        1
// SS_WrapLinear                     sampler      NA          NA    8        1
// SS_ClampLinear                    sampler      NA          NA    9        1
// MultiBlend4_et1_p_snp_0_Texture2D_16    texture  float4          2d    1        1
// MultiBlend4_et1_p_snp_0_Texture2D_15    texture  float4          2d    2        1
// MultiBlend4_et1_p_snp_0_Texture2D_14    texture  float4          2d    3        1
// MultiBlend4_et1_p_snp_0_Texture2D_13    texture  float4          2d    4        1
// MultiBlend4_et1_p_snp_0_Texture2D_4    texture  float4          2d    5        1
// MultiBlend4_et1_p_snp_0_Texture2D_3    texture  float4          2d    6        1
// MultiBlend4_et1_p_snp_0_Texture2D_1    texture  float4          2d    7        1
// MultiBlend4_et1_p_snp_0_Texture2D_2    texture  float4          2d    8        1
// MultiBlend4_et1_p_snp_0_Texture2D_0    texture  float4          2d    9        1
// MultiBlend4_et1_p_snp_0_Texture2D_6    texture  float4          2d   10        1
// MultiBlend4_et1_p_snp_0_Texture2D_5    texture  float4          2d   11        1
// MultiBlend4_et1_p_snp_0_Texture2D_9    texture  float4          2d   12        1
// MultiBlend4_et1_p_snp_0_Texture2D_10    texture  float4          2d   13        1
// MultiBlend4_et1_p_snp_0_Texture2D_11    texture  float4          2d   14        1
// MultiBlend4_et1_p_snp_0_Texture2D_12    texture  float4          2d   15        1
// MultiBlend4_et1_p_snp_0_Texture2D_8    texture  float4          2d   16        1
// MultiBlend4_et1_p_snp_0_Texture2D_7    texture  float4          2d   17        1
// g_IBLTexture                      texture  float4        cube   30        1
// g_IBLTexture2                     texture  float4        cube   31        1
// g_ShadowTexture                   texture  float4          2d   32        1
// g_SSAOTexture                     texture  float4          2d   33        1
// g_RLRTexture                      texture  float4          2d   44        1
// cbTextureTilingScale              cbuffer      NA          NA    1        1
// buffer2                           cbuffer      NA          NA    2        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       
// COLOR                    0   xyzw        1     NONE   float      w
// NORMAL                   0   xyz         2     NONE   float   xyz 
// TANGENT                  0   xyz         3     NONE   float   xyz 
// BINORMAL                 0   xyz         4     NONE   float   xyz 
// POSITION                 1   xyzw        5     NONE   float   xy w
// POSITION                 2   xyzw        6     NONE   float       
// TEXCOORD                29   xyz         7     NONE   float   xyz 
// TEXCOORD                 0   xy          8     NONE   float   xy  
// TEXCOORD                17   xyz         9     NONE   float   xyz 
// SV_IsFrontFace           0   x          10    FFACE    uint       
//
//
// 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 cb2[30], immediateIndexed
dcl_constantbuffer cb8[20], immediateIndexed
dcl_constantbuffer cb9[4], immediateIndexed
dcl_constantbuffer cb4[12], immediateIndexed
dcl_constantbuffer cb5[17], immediateIndexed
dcl_constantbuffer cb6[5], immediateIndexed
dcl_constantbuffer cb1[17], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s8, mode_default
dcl_sampler s9, mode_default
dcl_resource_texture2d (float,float,float,float) t1
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) t9
dcl_resource_texture2d (float,float,float,float) t10
dcl_resource_texture2d (float,float,float,float) t11
dcl_resource_texture2d (float,float,float,float) t12
dcl_resource_texture2d (float,float,float,float) t13
dcl_resource_texture2d (float,float,float,float) t14
dcl_resource_texture2d (float,float,float,float) t15
dcl_resource_texture2d (float,float,float,float) t16
dcl_resource_texture2d (float,float,float,float) t17
dcl_resource_texturecube (float,float,float,float) t30
dcl_resource_texturecube (float,float,float,float) t31
dcl_resource_texture2d (float,float,float,float) t32
dcl_resource_texture2d (float,float,float,float) t33
dcl_resource_texture2d (float,float,float,float) t44
dcl_input_ps linear v1.w
dcl_input_ps linear v2.xyz
dcl_input_ps linear v3.xyz
dcl_input_ps linear v4.xyz
dcl_input_ps linear v5.xyw
dcl_input_ps linear v7.xyz
dcl_input_ps linear v8.xy
dcl_input_ps linear v9.xyz
dcl_output o0.xyzw
dcl_temps 15
mul r0.xy, v8.xyxx, cb2[29].zzzz
mad r0.xy, r0.xyxx, cb1[0].xyxx, cb1[0].zwzz
sample_indexable(texture2d)(float,float,float,float) r0.x, r0.xyxx, t9.xyzw, s0
dp3 r1.x, v7.xyzx, v4.xyzx
dp3 r1.y, v7.xyzx, v3.xyzx
dp3 r1.z, v7.xyzx, v2.xyzx
mad r0.yz, v8.xxyx, cb1[14].xxyx, cb1[14].zzwz
dp2 r0.w, -r1.xyxx, -r1.xyxx
rsq r0.w, r0.w
mul r2.xy, r0.wwww, -r1.xyxx
dp3 r0.w, -r1.xyzx, -r1.xyzx
mad r0.w, -r1.z, r1.z, r0.w
sqrt r0.w, r0.w
div r0.w, r0.w, -r1.z
mul r1.xy, r0.wwww, r2.xyxx
mul r1.xy, r1.xyxx, cb2[29].wwww
dp3 r0.w, -v7.xyzx, -v7.xyzx
rsq r0.w, r0.w
mul r2.xyz, r0.wwww, -v7.xyzx
dp3 r0.w, v2.xyzx, v2.xyzx
rsq r0.w, r0.w
mul r3.xyz, r0.wwww, v2.xyzx
deriv_rtx_coarse r1.zw, r0.yyyz
deriv_rty_coarse r4.xy, r0.yzyy
add r4.zw, |r1.zzzw|, |r4.xxxy|
resinfo_indexable(texture2d)(float,float,float,float)_uint r5.xy, l(0), t3.xyzw
utof r5.xy, r5.xyxx
mul r4.zw, r4.zzzw, r5.xxxy
max r0.w, r4.w, r4.z
log r0.w, r0.w
max r0.w, r0.w, l(0.000000)
ge r2.w, l(4.000000), r0.w
if_nz r2.w
  dp3 r2.w, r2.xyzx, r3.xyzx
  mad r2.w, |r2.w|, l(-12.000000), l(16.000000)
  ftoi r3.w, r2.w
  round_z r2.w, r2.w
  div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w
  mov r4.zw, r0.yyyz
  mov r6.x, l(0)
  mov r5.zw, l(0,0,1.000000,1.000000)
  mov r7.xyzw, l(0,0,0,0)
  loop 
    ige r6.y, r6.x, r3.w
    breakc_nz r6.y
    mad r4.zw, -r2.wwww, r1.xxxy, r4.zzzw
    sample_d_indexable(texture2d)(float,float,float,float) r6.y, r4.zwzz, t3.xwyz, s0, r1.zwzz, r4.xyxx
    add r5.x, -r2.w, r5.z
    lt r6.z, r5.x, r6.y
    movc r6.w, r6.z, r3.w, r6.x
    mov r5.y, r6.y
    movc r7.xyzw, r6.zzzz, r5.xyzw, r7.xyzw
    iadd r6.x, r6.w, l(1)
    mov r5.w, r6.y
    mov r5.z, r5.x
  endloop 
  add r1.zw, -r7.wwwy, r7.zzzx
  add r2.w, -r1.w, r1.z
  mul r1.w, r1.w, r7.z
  mad r1.z, r7.x, r1.z, -r1.w
  div r1.z, r1.z, r2.w
  add r1.z, -r1.z, l(1.000000)
  mad r1.zw, -r1.xxxy, r1.zzzz, r0.yyyz
  lt r2.w, l(3.000000), r0.w
  round_z r3.w, r0.w
  add r0.w, r0.w, -r3.w
  add r4.xy, r0.yzyy, -r1.zwzz
  mad r4.xy, r0.wwww, r4.xyxx, r1.zwzz
  movc r1.zw, r2.wwww, r4.xxxy, r1.zzzw
else 
  mov r1.zw, r0.yyyz
endif 
add r0.yz, -r0.yyzy, r1.zzwz
add r0.yz, r0.yyzy, v8.xxyx
mad r1.zw, r0.yyyz, cb1[2].xxxy, cb1[2].zzzw
sample_indexable(texture2d)(float,float,float,float) r4.xyz, r1.zwzz, t8.xyzw, s0
mad r1.zw, v8.xxxy, cb1[13].xxxy, cb1[13].zzzw
deriv_rtx_coarse r5.xy, r1.zwzz
deriv_rty_coarse r5.zw, r1.zzzw
add r6.xy, |r5.zwzz|, |r5.xyxx|
resinfo_indexable(texture2d)(float,float,float,float)_uint r6.zw, l(0), t4.zwxy
utof r6.zw, r6.zzzw
mul r6.xy, r6.zwzz, r6.xyxx
max r0.w, r6.y, r6.x
log r0.w, r0.w
max r0.w, r0.w, l(0.000000)
ge r2.w, l(4.000000), r0.w
if_nz r2.w
  dp3 r2.w, r2.xyzx, r3.xyzx
  mad r2.w, |r2.w|, l(-12.000000), l(16.000000)
  ftoi r3.w, r2.w
  round_z r2.w, r2.w
  div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w
  mov r6.xy, r1.zwzz
  mov r4.w, l(0)
  mov r7.zw, l(0,0,1.000000,1.000000)
  mov r8.xyzw, l(0,0,0,0)
  loop 
    ige r6.z, r4.w, r3.w
    breakc_nz r6.z
    mad r6.xy, -r2.wwww, r1.xyxx, r6.xyxx
    sample_d_indexable(texture2d)(float,float,float,float) r6.z, r6.xyxx, t4.xywz, s0, r5.xyxx, r5.zwzz
    add r7.x, -r2.w, r7.z
    lt r6.w, r7.x, r6.z
    movc r9.x, r6.w, r3.w, r4.w
    mov r7.y, r6.z
    movc r8.xyzw, r6.wwww, r7.xyzw, r8.xyzw
    iadd r4.w, r9.x, l(1)
    mov r7.w, r6.z
    mov r7.z, r7.x
  endloop 
  add r2.w, -r8.w, r8.z
  add r3.w, -r8.y, r8.x
  add r4.w, r2.w, -r3.w
  mul r3.w, r3.w, r8.z
  mad r2.w, r8.x, r2.w, -r3.w
  div r2.w, r2.w, r4.w
  add r2.w, -r2.w, l(1.000000)
  mad r5.xy, -r1.xyxx, r2.wwww, r1.zwzz
  lt r2.w, l(3.000000), r0.w
  round_z r3.w, r0.w
  add r0.w, r0.w, -r3.w
  add r5.zw, r1.zzzw, -r5.xxxy
  mad r5.zw, r0.wwww, r5.zzzw, r5.xxxy
  movc r5.xy, r2.wwww, r5.zwzz, r5.xyxx
else 
  mov r5.xy, r1.zwzz
endif 
add r1.zw, -r1.zzzw, r5.xxxy
add r1.zw, r1.zzzw, v8.xxxy
mad r5.xy, r1.zwzz, cb1[1].xyxx, cb1[1].zwzz
sample_indexable(texture2d)(float,float,float,float) r5.xyz, r5.xyxx, t7.xyzw, s0
mad r6.xy, v8.xyxx, cb1[16].xyxx, cb1[16].zwzz
deriv_rtx_coarse r6.zw, r6.xxxy
deriv_rty_coarse r7.xy, r6.xyxx
add r7.zw, |r6.zzzw|, |r7.xxxy|
resinfo_indexable(texture2d)(float,float,float,float)_uint r8.xy, l(0), t1.xyzw
utof r8.xy, r8.xyxx
mul r7.zw, r7.zzzw, r8.xxxy
max r0.w, r7.w, r7.z
log r0.w, r0.w
max r0.w, r0.w, l(0.000000)
ge r2.w, l(4.000000), r0.w
if_nz r2.w
  dp3 r2.w, r2.xyzx, r3.xyzx
  mad r2.w, |r2.w|, l(-12.000000), l(16.000000)
  ftoi r3.w, r2.w
  round_z r2.w, r2.w
  div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w
  mov r7.zw, r6.xxxy
  mov r4.w, l(0)
  mov r8.zw, l(0,0,1.000000,1.000000)
  mov r9.xyzw, l(0,0,0,0)
  loop 
    ige r5.w, r4.w, r3.w
    breakc_nz r5.w
    mad r7.zw, -r2.wwww, r1.xxxy, r7.zzzw
    sample_d_indexable(texture2d)(float,float,float,float) r5.w, r7.zwzz, t1.xyzw, s0, r6.zwzz, r7.xyxx
    add r8.x, -r2.w, r8.z
    lt r10.x, r8.x, r5.w
    movc r10.y, r10.x, r3.w, r4.w
    mov r8.y, r5.w
    movc r9.xyzw, r10.xxxx, r8.xyzw, r9.xyzw
    iadd r4.w, r10.y, l(1)
    mov r8.w, r5.w
    mov r8.z, r8.x
  endloop 
  add r2.w, -r9.w, r9.z
  add r3.w, -r9.y, r9.x
  add r4.w, r2.w, -r3.w
  mul r3.w, r3.w, r9.z
  mad r2.w, r9.x, r2.w, -r3.w
  div r2.w, r2.w, r4.w
  add r2.w, -r2.w, l(1.000000)
  mad r6.zw, -r1.xxxy, r2.wwww, r6.xxxy
  lt r2.w, l(3.000000), r0.w
  round_z r3.w, r0.w
  add r0.w, r0.w, -r3.w
  add r7.xy, -r6.zwzz, r6.xyxx
  mad r7.xy, r0.wwww, r7.xyxx, r6.zwzz
  movc r6.zw, r2.wwww, r7.xxxy, r6.zzzw
else 
  mov r6.zw, r6.xxxy
endif 
add r6.xy, -r6.xyxx, r6.zwzz
add r6.xy, r6.xyxx, v8.xyxx
mad r6.zw, r6.xxxy, cb1[4].xxxy, cb1[4].zzzw
sample_indexable(texture2d)(float,float,float,float) r7.xyz, r6.zwzz, t5.xyzw, s0
mad r6.zw, v8.xxxy, cb1[15].xxxy, cb1[15].zzzw
deriv_rtx_coarse r8.xy, r6.zwzz
deriv_rty_coarse r8.zw, r6.zzzw
add r9.xy, |r8.zwzz|, |r8.xyxx|
resinfo_indexable(texture2d)(float,float,float,float)_uint r9.zw, l(0), t2.zwxy
utof r9.zw, r9.zzzw
mul r9.xy, r9.zwzz, r9.xyxx
max r0.w, r9.y, r9.x
log r0.w, r0.w
max r0.w, r0.w, l(0.000000)
ge r2.w, l(4.000000), r0.w
if_nz r2.w
  dp3 r2.x, r2.xyzx, r3.xyzx
  mad r2.x, |r2.x|, l(-12.000000), l(16.000000)
  ftoi r2.y, r2.x
  round_z r2.x, r2.x
  div r2.x, l(1.000000, 1.000000, 1.000000, 1.000000), r2.x
  mov r2.zw, r6.zzzw
  mov r3.w, l(0)
  mov r9.zw, l(0,0,1.000000,1.000000)
  mov r10.xyzw, l(0,0,0,0)
  loop 
    ige r4.w, r3.w, r2.y
    breakc_nz r4.w
    mad r2.zw, -r2.xxxx, r1.xxxy, r2.zzzw
    sample_d_indexable(texture2d)(float,float,float,float) r4.w, r2.zwzz, t2.xyzw, s0, r8.xyxx, r8.zwzz
    add r9.x, -r2.x, r9.z
    lt r5.w, r9.x, r4.w
    movc r7.w, r5.w, r2.y, r3.w
    mov r9.y, r4.w
    movc r10.xyzw, r5.wwww, r9.xyzw, r10.xyzw
    iadd r3.w, r7.w, l(1)
    mov r9.w, r4.w
    mov r9.z, r9.x
  endloop 
  add r2.xy, -r10.wyww, r10.zxzz
  add r2.z, -r2.y, r2.x
  mul r2.y, r2.y, r10.z
  mad r2.x, r10.x, r2.x, -r2.y
  div r2.x, r2.x, r2.z
  add r2.x, -r2.x, l(1.000000)
  mad r1.xy, -r1.xyxx, r2.xxxx, r6.zwzz
  lt r2.x, l(3.000000), r0.w
  round_z r2.y, r0.w
  add r0.w, r0.w, -r2.y
  add r2.yz, -r1.xxyx, r6.zzwz
  mad r2.yz, r0.wwww, r2.yyzy, r1.xxyx
  movc r1.xy, r2.xxxx, r2.yzyy, r1.xyxx
else 
  mov r1.xy, r6.zwzz
endif 
add r1.xy, -r6.zwzz, r1.xyxx
add r1.xy, r1.xyxx, v8.xyxx
mad r2.xy, r1.xyxx, cb1[3].xyxx, cb1[3].zwzz
sample_indexable(texture2d)(float,float,float,float) r2.xyz, r2.xyxx, t6.xyzw, s0
add r0.x, r0.x, l(0.010000)
mul r0.x, r0.x, cb2[29].x
add r8.xyz, -v9.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mad r8.xyz, -r0.xxxx, r8.xyzx, v9.xyzx
mad r0.x, v1.w, cb2[29].y, l(1.000000)
mul_sat r8.xyz, r0.xxxx, r8.xyzx
add r4.xyz, r4.xyzx, -r5.xyzx
mad r4.xyz, r8.xxxx, r4.xyzx, r5.xyzx
add r2.xyz, r2.xyzx, -r4.xyzx
mad r2.xyz, r8.yyyy, r2.xyzx, r4.xyzx
add r4.xyz, -r2.xyzx, r7.xyzx
mad r2.xyz, r8.zzzz, r4.xyzx, r2.xyzx
mad r0.xw, r1.zzzw, cb1[13].xxxy, cb1[13].zzzw
sample_indexable(texture2d)(float,float,float,float) r0.xw, r0.xwxx, t4.xzwy, s0
mad r0.xw, r0.xxxw, l(2.000000, 0.000000, 0.000000, 2.000000), l(-1.000000, 0.000000, 0.000000, -1.000000)
dp2 r2.w, r0.xwxx, r0.xwxx
add r2.w, -r2.w, l(1.000000)
max r2.w, r2.w, l(0.000000)
sqrt r2.w, r2.w
mul r4.xyz, r0.wwww, v3.xyzx
mad r4.xyz, r0.xxxx, v4.xyzx, r4.xyzx
mad r4.xyz, r2.wwww, v2.xyzx, r4.xyzx
dp3 r0.x, r4.xyzx, r4.xyzx
rsq r0.x, r0.x
mul r4.xyz, r0.xxxx, r4.xyzx
mad r0.xw, r0.yyyz, cb1[14].xxxy, cb1[14].zzzw
sample_indexable(texture2d)(float,float,float,float) r0.xw, r0.xwxx, t3.xzwy, s0
mad r0.xw, r0.xxxw, l(2.000000, 0.000000, 0.000000, 2.000000), l(-1.000000, 0.000000, 0.000000, -1.000000)
dp2 r2.w, r0.xwxx, r0.xwxx
add r2.w, -r2.w, l(1.000000)
max r2.w, r2.w, l(0.000000)
sqrt r2.w, r2.w
mul r5.xyz, r0.wwww, v3.xyzx
mad r5.xyz, r0.xxxx, v4.xyzx, r5.xyzx
mad r5.xyz, r2.wwww, v2.xyzx, r5.xyzx
dp3 r0.x, r5.xyzx, r5.xyzx
rsq r0.x, r0.x
mad r6.zw, r1.xxxy, cb1[15].xxxy, cb1[15].zzzw
sample_indexable(texture2d)(float,float,float,float) r6.zw, r6.zwzz, t2.zwxy, s0
mad r6.zw, r6.zzzw, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
dp2 r0.w, r6.zwzz, r6.zwzz
add r0.w, -r0.w, l(1.000000)
max r0.w, r0.w, l(0.000000)
sqrt r0.w, r0.w
mul r7.xyz, r6.wwww, v3.xyzx
mad r7.xyz, r6.zzzz, v4.xyzx, r7.xyzx
mad r7.xyz, r0.wwww, v2.xyzx, r7.xyzx
dp3 r0.w, r7.xyzx, r7.xyzx
rsq r0.w, r0.w
mad r6.zw, r6.xxxy, cb1[16].xxxy, cb1[16].zzzw
sample_indexable(texture2d)(float,float,float,float) r6.zw, r6.zwzz, t1.zwxy, s0
mad r6.zw, r6.zzzw, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
dp2 r2.w, r6.zwzz, r6.zwzz
add r2.w, -r2.w, l(1.000000)
max r2.w, r2.w, l(0.000000)
sqrt r2.w, r2.w
mul r9.xyz, r6.wwww, v3.xyzx
mad r9.xyz, r6.zzzz, v4.xyzx, r9.xyzx
mad r9.xyz, r2.wwww, v2.xyzx, r9.xyzx
dp3 r2.w, r9.xyzx, r9.xyzx
rsq r2.w, r2.w
mad r5.xyz, r5.xyzx, r0.xxxx, -r4.xyzx
mad r4.xyz, r8.xxxx, r5.xyzx, r4.xyzx
mad r5.xyz, r7.xyzx, r0.wwww, -r4.xyzx
mad r4.xyz, r8.yyyy, r5.xyzx, r4.xyzx
mad r5.xyz, r9.xyzx, r2.wwww, -r4.xyzx
mad r4.xyz, r8.zzzz, r5.xyzx, r4.xyzx
mad r0.xw, r0.yyyz, cb1[6].xxxy, cb1[6].zzzw
sample_indexable(texture2d)(float,float,float,float) r5.xyz, r0.xwxx, t10.xyzw, s0
mad r0.xw, r1.zzzw, cb1[5].xxxy, cb1[5].zzzw
sample_indexable(texture2d)(float,float,float,float) r7.xyz, r0.xwxx, t11.xyzw, s0
mad r0.xw, r1.xxxy, cb1[7].xxxy, cb1[7].zzzw
sample_indexable(texture2d)(float,float,float,float) r9.xyz, r0.xwxx, t17.xyzw, s0
mad r0.xw, r6.xxxy, cb1[8].xxxy, cb1[8].zzzw
sample_indexable(texture2d)(float,float,float,float) r10.xyz, r0.xwxx, t16.xyzw, s0
add r5.xyz, r5.xyzx, -r7.xyzx
mad r5.xyz, r8.xxxx, r5.xyzx, r7.xyzx
add r7.xyz, -r5.xyzx, r9.xyzx
mad r5.xyz, r8.yyyy, r7.xyzx, r5.xyzx
add r7.xyz, -r5.xyzx, r10.xyzx
mad r5.xyz, r8.zzzz, r7.xyzx, r5.xyzx
mad r0.xw, r1.xxxy, cb1[11].xxxy, cb1[11].zzzw
sample_indexable(texture2d)(float,float,float,float) r0.x, r0.xwxx, t14.xyzw, s0
mad r1.xy, r1.zwzz, cb1[9].xyxx, cb1[9].zwzz
sample_indexable(texture2d)(float,float,float,float) r0.w, r1.xyxx, t12.yzwx, s0
mad r0.yz, r0.yyzy, cb1[10].xxyx, cb1[10].zzwz
sample_indexable(texture2d)(float,float,float,float) r0.y, r0.yzyy, t13.yxzw, s0
mad r1.xy, r6.xyxx, cb1[12].xyxx, cb1[12].zwzz
sample_indexable(texture2d)(float,float,float,float) r0.z, r1.xyxx, t15.yzxw, s0
add r0.y, -r0.w, r0.y
mad r0.y, r8.x, r0.y, r0.w
add r0.x, -r0.y, r0.x
mad r0.x, r8.y, r0.x, r0.y
add r0.y, -r0.x, r0.z
mad r0.x, r8.z, r0.y, r0.x
dp3 r0.y, v7.xyzx, v7.xyzx
rsq r0.y, r0.y
mul r1.xyz, r0.yyyy, v7.xyzx
div r0.zw, v5.xxxy, v5.wwww
mad r0.zw, r0.zzzw, l(0.000000, 0.000000, 0.500000, -0.500000), l(0.000000, 0.000000, 0.500000, 0.500000)
dp3 r1.w, r4.xyzx, r4.xyzx
rsq r1.w, r1.w
mul r4.xyz, r1.wwww, r4.xyzx
mul r1.w, cb9[3].y, cb9[3].y
mul r6.xyz, r1.wwww, r5.xyzx
mul r0.x, r0.x, cb9[3].z
mul r2.w, r0.x, l(13.000000)
exp r2.w, r2.w
sample_indexable(texture2d)(float,float,float,float) r3.w, r0.zwzz, t33.yzwx, s8
dp3 r5.w, r4.xyzx, r1.xyzx
add r6.w, r3.w, r5.w
mad r6.w, r6.w, r6.w, r3.w
add_sat r6.w, r6.w, l(-1.000000)
mov_sat r7.x, r5.w
add r7.x, -r7.x, l(1.000000)
add r5.w, r5.w, r5.w
mad r7.yzw, r5.wwww, r4.xxyz, -r1.xxyz
mul r5.w, r7.x, r7.x
mul r5.w, r5.w, r5.w
mul r5.w, r5.w, r7.x
mul r5.w, r6.w, r5.w
mad r6.w, -r0.x, l(6.500000), l(6.500000)
min r6.w, r6.w, l(6.000000)
mad r5.xyz, -r5.xyzx, r1.wwww, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r8.xyz, r5.wwww, r5.xyzx
mul r0.x, r0.x, r0.x
mad r8.xyz, r8.xyzx, r0.xxxx, r6.xyzx
sample_l_indexable(texturecube)(float,float,float,float) r9.xyz, r7.yzwy, t30.xyzw, s8, r6.w
mul r9.xyz, r9.xyzx, cb4[8].yyyy
sample_l_indexable(texturecube)(float,float,float,float) r10.xyz, r7.yzwy, t31.xyzw, s8, r6.w
mad r10.xyz, r10.xyzx, cb4[8].zzzz, -r9.xyzx
mad r9.xyz, cb4[8].xxxx, r10.xyzx, r9.xyzx
mul r9.xyz, r8.xyzx, r9.xyzx
mul r9.xyz, r3.wwww, r9.xyzx
dp3 r0.x, r7.yzwy, r3.xyzx
add_sat r0.x, r0.x, l(1.000000)
mul r0.x, r0.x, r0.x
mul r3.xyz, r0.xxxx, r9.xyzx
mov r4.w, l(1.000000)
dp4 r7.x, r4.xyzw, cb4[9].xyzw
dp4 r7.y, r4.xyzw, cb4[10].xyzw
dp4 r7.z, r4.xyzw, cb4[11].xyzw
max r7.xyz, r7.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mul r7.xyz, r5.xyzx, r7.xyzx
mul r7.xyz, r3.wwww, r7.xyzx
sample_l_indexable(texture2d)(float,float,float,float) r9.xyzw, r0.zwzz, t44.xyzw, s9, r6.w
mul r8.xyz, r3.wwww, r8.xyzx
mul r8.xyz, r8.xyzx, r9.xyzx
add r0.x, -r9.w, l(1.000000)
mad r3.xyz, r3.xyzx, r0.xxxx, r8.xyzx
sample_indexable(texture2d)(float,float,float,float) r0.x, r0.zwzz, t32.wxyz, s8
add r8.xyz, l(1.000000, 1.000000, 1.000000, 0.000000), -cb8[19].xyzx
add r9.xyz, -r8.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mad r0.xzw, r0.xxxx, r9.xxyz, r8.xxyz
add r8.xyz, r0.xzwx, l(-1.000000, -1.000000, -1.000000, 0.000000)
mad r8.xyz, cb4[8].wwww, r8.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r9.xyz, r0.xzwx, cb5[4].xyzx
dp3 r10.x, cb5[0].xyzx, r4.xyzx
dp3 r10.y, cb5[1].xyzx, r4.xyzx
mov_sat r10.zw, r10.xxxy
mul r11.xyz, r5.xyzx, r10.zzzz
mul r12.xyz, r5.xyzx, r10.wwww
mul r12.xyz, r12.xyzx, cb5[5].xyzx
mad r9.xyz, r9.xyzx, r11.xyzx, r12.xyzx
ult r10.zw, l(0, 0, 0, 0), cb5[16].xxxy
dp3 r1.w, cb5[2].xyzx, r4.xyzx
mad r1.w, r1.w, l(0.500000), l(0.500000)
mul r1.w, r1.w, r1.w
min r1.w, r1.w, l(1.000000)
mul r11.xyz, r5.xyzx, r1.wwww
mad r11.xyz, cb5[6].xyzx, r11.xyzx, r9.xyzx
movc r9.xyz, r10.zzzz, r11.xyzx, r9.xyzx
dp3 r1.w, cb5[3].xyzx, r4.xyzx
mad r1.w, r1.w, l(0.500000), l(0.500000)
mul r1.w, r1.w, r1.w
min r1.w, r1.w, l(1.000000)
mul r11.xyz, r5.xyzx, r1.wwww
mad r11.xyz, cb5[7].xyzx, r11.xyzx, r9.xyzx
movc r9.xyz, r10.wwww, r11.xyzx, r9.xyzx
mul r0.xzw, r0.xxzw, cb5[8].xxyz
mad r11.xyz, v7.xyzx, r0.yyyy, cb5[0].xyzx
dp3 r1.w, r11.xyzx, r11.xyzx
rsq r1.w, r1.w
mul r11.xyz, r1.wwww, r11.xyzx
mad r12.xyz, v7.xyzx, r0.yyyy, cb5[1].xyzx
dp3 r1.w, r12.xyzx, r12.xyzx
rsq r1.w, r1.w
mul r12.xyz, r1.wwww, r12.xyzx
dp3_sat r13.x, r11.xyzx, r4.xyzx
dp3_sat r13.y, r12.xyzx, r4.xyzx
mul r1.w, r2.w, cb5[0].w
mad r3.w, r2.w, l(0.010000), cb5[0].w
div r1.w, r1.w, r3.w
max r14.x, r1.w, l(1.000000)
mul r1.w, r2.w, cb5[1].w
mad r3.w, r2.w, l(0.010000), cb5[1].w
div r1.w, r1.w, r3.w
max r14.y, r1.w, l(1.000000)
log r13.xy, r13.xyxx
mul r13.xy, r13.xyxx, r14.xyxx
exp r13.xy, r13.xyxx
dp3_sat r11.x, r1.xyzx, r11.xyzx
dp3_sat r11.y, r1.xyzx, r12.xyzx
add r11.xy, -r11.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r11.zw, r11.xxxy, r11.xxxy
mul r11.zw, r11.zzzw, r11.zzzw
mul r11.xy, r11.zwzz, r11.xyxx
mad r11.xzw, r11.xxxx, r5.xxyz, r6.xxyz
mad r12.xyz, r11.yyyy, r5.xyzx, r6.xyzx
mul_sat r10.xy, r10.xyxx, l(16.000000, 16.000000, 0.000000, 0.000000)
mul r11.xyz, r11.xzwx, r13.xxxx
mul r11.xyz, r10.xxxx, r11.xyzx
mul r12.xyz, r12.xyzx, r13.yyyy
mul r12.xyz, r10.yyyy, r12.xyzx
mad r10.xy, r14.xyxx, l(0.125000, 0.125000, 0.000000, 0.000000), l(0.250000, 0.250000, 0.000000, 0.000000)
mul r0.xzw, r0.xxzw, r10.xxxx
mul r13.xyz, r10.yyyy, cb5[9].xyzx
mul r12.xyz, r12.xyzx, r13.xyzx
mad r0.xzw, r0.xxzw, r11.xxyz, r12.xxyz
mad r11.xyz, v7.xyzx, r0.yyyy, cb5[2].xyzx
dp3 r1.w, r11.xyzx, r11.xyzx
rsq r1.w, r1.w
mul r11.xyz, r1.wwww, r11.xyzx
dp3_sat r1.w, r11.xyzx, r4.xyzx
mul r3.w, r2.w, cb5[2].w
mad r4.w, r2.w, l(0.010000), cb5[2].w
div r3.w, r3.w, r4.w
max r3.w, r3.w, l(1.000000)
log r1.w, r1.w
mul r1.w, r1.w, r3.w
exp r1.w, r1.w
dp3_sat r4.w, r1.xyzx, r11.xyzx
add r4.w, -r4.w, l(1.000000)
mul r5.w, r4.w, r4.w
mul r5.w, r5.w, r5.w
mul r4.w, r4.w, r5.w
mad r11.xyz, r4.wwww, r5.xyzx, r6.xyzx
mul r11.xyz, r1.wwww, r11.xyzx
mad r1.w, r3.w, l(0.125000), l(0.250000)
mul r12.xyz, r1.wwww, cb5[10].xyzx
mad r11.xyz, r12.xyzx, r11.xyzx, r0.xzwx
movc r0.xzw, r10.zzzz, r11.xxyz, r0.xxzw
mad r10.xyz, v7.xyzx, r0.yyyy, cb5[3].xyzx
dp3 r0.y, r10.xyzx, r10.xyzx
rsq r0.y, r0.y
mul r10.xyz, r0.yyyy, r10.xyzx
dp3_sat r0.y, r10.xyzx, r4.xyzx
mul r1.w, r2.w, cb5[3].w
mad r2.w, r2.w, l(0.010000), cb5[3].w
div r1.w, r1.w, r2.w
max r1.w, r1.w, l(1.000000)
log r0.y, r0.y
mul r0.y, r0.y, r1.w
exp r0.y, r0.y
dp3_sat r1.x, r1.xyzx, r10.xyzx
add r1.x, -r1.x, l(1.000000)
mul r1.y, r1.x, r1.x
mul r1.y, r1.y, r1.y
mul r1.x, r1.y, r1.x
mad r1.xyz, r1.xxxx, r5.xyzx, r6.xyzx
mul r1.xyz, r0.yyyy, r1.xyzx
mad r0.y, r1.w, l(0.125000), l(0.250000)
mul r4.xyz, r0.yyyy, cb5[11].xyzx
mad r1.xyz, r4.xyzx, r1.xyzx, r0.xzwx
movc r0.xyz, r10.wwww, r1.xyzx, r0.xzwx
mad r0.xyz, r3.xyzx, r8.xyzx, r0.xyzx
mad r1.xyz, r7.xyzx, r8.xyzx, r9.xyzx
mad r0.xyz, r2.xyzx, r1.xyzx, r0.xyzx
mul r0.xyz, r0.xyzx, cb4[7].xyzx
add r0.w, -v7.y, cb6[3].w
add r0.w, r0.w, -cb6[3].y
mul_sat r0.w, r0.w, cb6[3].z
dp2 r1.x, -v7.xzxx, -v7.xzxx
sqrt r1.x, r1.x
add r1.x, r1.x, -cb6[2].y
mul r1.x, r1.x, cb6[2].z
exp r1.x, -r1.x
mad_sat r1.x, -r1.x, cb6[2].x, cb6[2].x
mul_sat r0.w, r0.w, cb6[3].x
dp3 r1.y, r0.xyzx, l(0.298910, 0.586610, 0.114480, 0.000000)
add r1.y, r1.y, l(-1.000000)
mad r1.z, cb6[1].w, r1.y, l(1.000000)
mad r1.y, cb6[4].w, r1.y, l(1.000000)
mad r2.xyz, cb6[1].xyzx, r1.zzzz, -r0.xyzx
mad r0.xyz, r1.xxxx, r2.xyzx, r0.xyzx
mad r1.xyz, cb6[4].xyzx, r1.yyyy, -r0.xyzx
mad o0.xyz, r0.wwww, r1.xyzx, r0.xyzx
mov o0.w, cb4[7].w
ret 
// Approximately 532 instruction slots used

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