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

cbuffer cbModelParam : register(b7)
{
  float4 FC_DifColMul : packoffset(c0);
  float FC_EnvMapInterpRatio : packoffset(c1);
  float FC_EnvMapColorScale0 : packoffset(c1.y);
  float FC_EnvMapColorScale1 : packoffset(c1.z);
  float FC_DitherEnable : packoffset(c2);
  float FC_FROZEN_RATE : packoffset(c2.w);
  float FC_Perlin_Freq : packoffset(c3);
  float FC_Perlin_Amp : packoffset(c3.y);
  float FC_Perlin_Lacunarity : packoffset(c3.z);
  float FC_Perlin_Gain : packoffset(c3.w);
  float FC_SnowRate : packoffset(c4);
  float FC_SnowMinDot : packoffset(c4.y);
  float FC_SnowMaxDot : packoffset(c4.z);
  float FC_SparkleExponent : packoffset(c5);
  float FC_SparkleThreshold : packoffset(c5.y);
  float FC_SparkleMul : packoffset(c5.z);
  float FC_SparkleMaskExponent : packoffset(c5.w);
  float4 FC_SkinMatchColor : packoffset(c6);
  int FC_EnvId : packoffset(c7);
  float4 FC_ParallaxCorrectedCubemapOriginA : packoffset(c8);
  float4 FC_ParallaxCorrectedCubemapOriginB : packoffset(c9);
  float4x4 FC_ParallaxCorrectedCubemapObbA : packoffset(c10);
  float4x4 FC_ParallaxCorrectedCubemapInvObbA : packoffset(c14);
  float4x4 FC_ParallaxCorrectedCubemapObbB : packoffset(c18);
  float4x4 FC_ParallaxCorrectedCubemapInvObbB : packoffset(c22);
  float FC_ParallaxCorrectedCubemapObbAEnable : packoffset(c26);
  float FC_ParallaxCorrectedCubemapObbBEnable : packoffset(c26.y);
}

SamplerState SS_DiffuseMap_s : register(s0);
SamplerState SS_SpecularMap_s : register(s1);
SamplerState SS_BumpMap_s : register(s2);
SamplerState SS_WrapLinear_s : register(s8);
SamplerState SS_ClampLinear_s : register(s9);
SamplerState SS_WrapAniso_s : register(s10);
SamplerComparisonState SS_Shadow_s : register(s12);
Texture2D<float4> g_DiffuseTexture : register(t0);
Texture2D<float4> g_SpecularTexture : register(t1);
Texture2D<float4> g_BumpmapTexture : register(t3);
Texture2D<float4> g_EmissiveTexture : register(t6);
Texture2D<float4> g_DiffuseTexture2 : register(t7);
Texture2D<float4> g_SpecularTexture2 : register(t8);
Texture2D<float4> g_BumpmapTexture2 : register(t10);
Texture2D<float4> g_EmissiveTexture2 : register(t13);
Texture2D<float4> g_BlendMaskTexture : register(t14);
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);
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 : TEXCOORD4,
  float4 v4 : COLOR1,
  float4 v5 : TEXCOORD6,
  float4 v6 : TEXCOORD7,
  float4 v7 : TEXCOORD9,
  uint v8 : SV_IsFrontFace0,
  out float4 o0 : SV_Target0,
  out float4 o1 : SV_Target1)
{
// 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;
  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 = v2.yzx * v1.zxy;
  r2.xyz = v1.yzx * v2.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 = dot(v3.xyz, v3.xyz);
  r0.w = rsqrt(r0.w);
  r3.xyz = v3.xyz * r0.www;
  r4.xyz = v3.yzx * v1.zxy;
  r4.xyz = v1.yzx * v3.zxy + -r4.xyz;
  r4.xyz = v3.www * r4.xyz;
  r0.w = dot(r4.xyz, r4.xyz);
  r0.w = rsqrt(r0.w);
  r4.xyz = r4.xyz * r0.www;
  r0.w = round(v1.w);
  r0.w = (uint)r0.w;
  r5.x = dot(v7.xyzw, FC_MatrixInvViewProj._m00_m10_m20_m30);
  r5.y = dot(v7.xyzw, FC_MatrixInvViewProj._m01_m11_m21_m31);
  r5.z = dot(v7.xyzw, FC_MatrixInvViewProj._m02_m12_m22_m32);
  r1.w = dot(v7.xyzw, FC_MatrixInvViewProj._m03_m13_m23_m33);
  r6.xyz = r5.xyz / r1.www;
  r7.x = FC_MatrixInvView._m30 + -r6.x;
  r7.y = FC_MatrixInvView._m31 + -r6.y;
  r7.z = FC_MatrixInvView._m32 + -r6.z;
  r1.w = dot(r7.xyz, r7.xyz);
  r1.w = rsqrt(r1.w);
  r6.xyz = r7.xyz * r1.www;
  r8.xy = FC_ScreenSize.zw * v0.xy;
  r8.zw = v6.xy * FC_TextureTilingScale[14].xy + FC_TextureTilingScale[14].zw;
  r2.w = g_BlendMaskTexture.Sample(SS_WrapAniso_s, r8.zw).x;
  r9.y = r2.w * FC_BlendMaskParam.x + FC_BlendMaskParam.z;
  r8.zw = float2(0,1) + -v4.ww;
  r9.x = -r9.y;
  r8.zw = r9.xy * r8.zw + v4.ww;
  r2.w = cmp(0 < r9.y);
  r2.w = saturate(r2.w ? r8.z : r8.w);
  r3.w = r2.w * r2.w;
  r2.w = -r2.w * 2 + 3;
  r2.w = r3.w * r2.w;
  r0.xyz = v8.xxx ? r0.xyz : -r0.xyz;
  r8.zw = v5.xy * FC_TextureTilingScale[3].xy + FC_TextureTilingScale[3].zw;
  r9.xyw = g_BumpmapTexture.Sample(SS_BumpMap_s, r8.zw).xyz;
  r8.zw = r9.xy * float2(2,2) + float2(-1,-1);
  r3.w = dot(r8.zw, r8.zw);
  r3.w = min(1, r3.w);
  r3.w = 1 + -r3.w;
  r3.w = sqrt(r3.w);
  r10.xy = v5.zw * FC_TextureTilingScale[10].xy + FC_TextureTilingScale[10].zw;
  r10.xyw = g_BumpmapTexture2.Sample(SS_BumpMap_s, r10.xy).xyz;
  r11.xy = r10.xy * float2(2,2) + float2(-1,-1);
  r4.w = dot(r11.xy, r11.xy);
  r4.w = min(1, r4.w);
  r4.w = 1 + -r4.w;
  r4.w = sqrt(r4.w);
  r1.xyz = r8.www * r1.xyz;
  r1.xyz = r8.zzz * r2.xyz + r1.xyz;
  r1.xyz = r3.www * r0.xyz + r1.xyz;
  r2.xyz = r11.yyy * r3.xyz;
  r2.xyz = r11.xxx * r4.xyz + r2.xyz;
  r2.xyz = r4.www * r0.xyz + r2.xyz;
  r2.xyz = r2.xyz + -r1.xyz;
  r1.xyz = r2.www * r2.xyz + r1.xyz;
  r2.x = dot(r1.xyz, r1.xyz);
  r2.x = rsqrt(r2.x);
  r3.xyz = r2.xxx * r1.xyz;
  r1.xy = v5.xy * FC_TextureTilingScale[1].xy + FC_TextureTilingScale[1].zw;
  r9.xyz = g_SpecularTexture.Sample(SS_SpecularMap_s, r1.xy).xyz;
  r1.xy = v5.zw * FC_TextureTilingScale[8].xy + FC_TextureTilingScale[8].zw;
  r10.xyz = g_SpecularTexture2.Sample(SS_SpecularMap_s, r1.xy).xyz;
  r4.xyzw = r10.xyzw + -r9.xyzw;
  r4.xyzw = r2.wwww * r4.xyzw + r9.xyzw;
  r1.x = FC_SpcParam.x * 0.00390625;
  r1.x = r4.w * r1.x;
  r1.y = 13 * r1.x;
  r1.y = exp2(r1.y);
  r2.xy = v5.xy * FC_TextureTilingScale[0].xy + FC_TextureTilingScale[0].zw;
  r8.zw = v5.zw * FC_TextureTilingScale[7].xy + FC_TextureTilingScale[7].zw;
  r9.xyzw = g_DiffuseTexture.Sample(SS_DiffuseMap_s, r2.xy).xyzw;
  r10.xyzw = g_DiffuseTexture2.Sample(SS_DiffuseMap_s, r8.zw).xyzw;
  r10.xyzw = r10.xyzw + -r9.xyzw;
  r9.xyzw = r2.wwww * r10.xyzw + r9.xyzw;
  r2.xyz = FC_DifMapMulCol.xyz * r9.xyz;
  r1.z = g_SSAOTexture.Sample(SS_WrapLinear_s, r8.xy).x;
  r1.z = r1.z * FC_SSAOParam.x + 1;
  r1.z = -FC_SSAOParam.x + r1.z;
  r4.w = cmp(v4.x == 0.000000);
  r4.w = r4.w ? 1 : v4.x;
  r6.w = r4.w * r1.z;
  r7.w = dot(r3.xyz, r6.xyz);
  r8.z = r1.z * r4.w + r7.w;
  r8.z = r8.z * r8.z + -1;
  r4.w = saturate(r1.z * r4.w + r8.z);
  r8.z = saturate(r7.w);
  r8.z = 1 + -r8.z;
  r8.w = r7.w + r7.w;
  r10.xyz = r8.www * r3.xyz + -r6.xyz;
  r8.w = r8.z * r8.z;
  r8.w = r8.w * r8.w;
  r8.z = r8.z * r8.w;
  r4.w = r8.z * r4.w;
  r8.z = -r1.x * 6.5 + 6.5;
  r8.z = min(6, r8.z);
  r11.xyz = float3(1,1,1) + -r4.xyz;
  r12.xyz = r11.xyz * r4.www;
  r1.x = r1.x * r1.x;
  r12.xyz = r12.xyz * r1.xxx + r4.xyz;
  r0.w = (int)r0.w * 17;
  r13.xy = cmp(float2(0,0) < FC_ParallaxCorrectedCubemapObbAEnable);
  r5.w = 1;
  r14.x = dot(r5.xyzw, FC_ParallaxCorrectedCubemapInvObbA._m00_m10_m20_m30);
  r14.y = dot(r5.xyzw, FC_ParallaxCorrectedCubemapInvObbA._m01_m11_m21_m31);
  r14.z = dot(r5.xyzw, FC_ParallaxCorrectedCubemapInvObbA._m02_m12_m22_m32);
  r15.x = dot(r10.xyz, FC_ParallaxCorrectedCubemapInvObbA._m00_m10_m20);
  r15.y = dot(r10.xyz, FC_ParallaxCorrectedCubemapInvObbA._m01_m11_m21);
  r15.z = dot(r10.xyz, FC_ParallaxCorrectedCubemapInvObbA._m02_m12_m22);
  r16.xyz = cmp(float3(0,0,0) < r15.xyz);
  r17.xyz = ~(int3)r16.xyz;
  r16.xyz = r13.xxx ? r16.xyz : 0;
  r18.xyz = float3(1,1,1) + -r14.xyz;
  r18.xyz = r18.xyz / r15.xyz;
  r16.xyz = r16.xyz ? abs(r18.xyz) : float3(5000,5000,5000);
  r17.xyz = r13.xxx ? r17.xyz : 0;
  r18.xyz = cmp(r15.xyz < float3(0,0,0));
  r17.xyz = r18.xyz ? r17.xyz : 0;
  r18.xyz = float3(1,1,1) + r14.xyz;
  r18.xyz = r18.xyz / r15.xyz;
  r16.xyz = r17.xyz ? abs(r18.xyz) : r16.xyz;
  r1.x = min(r16.x, r16.y);
  r1.x = min(r1.x, r16.z);
  r14.xyz = r15.xyz * r1.xxx + r14.xyz;
  r4.w = -r1.x * 9.99999975e-005 + -1;
  r15.xyz = cmp(r14.xyz < r4.www);
  r1.x = r1.x * 9.99999975e-005 + 1;
  r16.xyz = cmp(r1.xxx < r14.xyz);
  r1.x = (int)r15.x | (int)r16.x;
  r1.x = (int)r15.y | (int)r1.x;
  r1.x = (int)r16.y | (int)r1.x;
  r1.x = (int)r15.z | (int)r1.x;
  r1.x = (int)r16.z | (int)r1.x;
  r14.w = 1;
  r15.x = dot(r14.xyzw, FC_ParallaxCorrectedCubemapObbA._m00_m10_m20_m30);
  r15.y = dot(r14.xyzw, FC_ParallaxCorrectedCubemapObbA._m01_m11_m21_m31);
  r15.z = dot(r14.xyzw, FC_ParallaxCorrectedCubemapObbA._m02_m12_m22_m32);
  r14.xyz = -FC_ParallaxCorrectedCubemapOriginA.xyz + r15.xyz;
  r14.xyz = g_IBLTexture.SampleLevel(SS_WrapLinear_s, r14.xyz, r8.z).xyz;
  r14.xyz = VC_InstanceData[r0.w].parallaxCorrectedCubemapAabbMin_envMapColorScale0.www * r14.xyz;
  r14.xyz = r1.xxx ? float3(0,0,0) : r14.xyz;
  r15.xyz = g_IBLTexture.SampleLevel(SS_WrapLinear_s, r10.xyz, r8.z).xyz;
  r15.xyz = VC_InstanceData[r0.w].parallaxCorrectedCubemapAabbMin_envMapColorScale0.www * r15.xyz;
  r13.xzw = r13.xxx ? r14.xyz : r15.xyz;
  r14.x = dot(r5.xyzw, FC_ParallaxCorrectedCubemapInvObbB._m00_m10_m20_m30);
  r14.y = dot(r5.xyzw, FC_ParallaxCorrectedCubemapInvObbB._m01_m11_m21_m31);
  r14.z = dot(r5.xyzw, FC_ParallaxCorrectedCubemapInvObbB._m02_m12_m22_m32);
  r5.x = dot(r10.xyz, FC_ParallaxCorrectedCubemapInvObbB._m00_m10_m20);
  r5.y = dot(r10.xyz, FC_ParallaxCorrectedCubemapInvObbB._m01_m11_m21);
  r5.z = dot(r10.xyz, FC_ParallaxCorrectedCubemapInvObbB._m02_m12_m22);
  r15.xyz = cmp(float3(0,0,0) < r5.xyz);
  r16.xyz = ~(int3)r15.xyz;
  r15.xyz = r13.yyy ? r15.xyz : 0;
  r17.xyz = float3(1,1,1) + -r14.xyz;
  r17.xyz = r17.xyz / r5.xyz;
  r15.xyz = r15.xyz ? abs(r17.xyz) : float3(5000,5000,5000);
  r16.xyz = r13.yyy ? r16.xyz : 0;
  r17.xyz = cmp(r5.xyz < float3(0,0,0));
  r16.xyz = r16.xyz ? r17.xyz : 0;
  r17.xyz = float3(1,1,1) + r14.xyz;
  r17.xyz = r17.xyz / r5.xyz;
  r15.xyz = r16.xyz ? abs(r17.xyz) : r15.xyz;
  r1.x = min(r15.x, r15.y);
  r1.x = min(r1.x, r15.z);
  r5.xyz = r5.xyz * r1.xxx + r14.xyz;
  r4.w = -r1.x * 9.99999975e-005 + -1;
  r14.xyz = cmp(r5.xyz < r4.www);
  r1.x = r1.x * 9.99999975e-005 + 1;
  r15.xyz = cmp(r1.xxx < r5.xyz);
  r1.x = (int)r14.x | (int)r15.x;
  r1.x = (int)r14.y | (int)r1.x;
  r1.x = (int)r15.y | (int)r1.x;
  r1.x = (int)r14.z | (int)r1.x;
  r1.x = (int)r15.z | (int)r1.x;
  r5.w = 1;
  r14.x = dot(r5.xyzw, FC_ParallaxCorrectedCubemapObbB._m00_m10_m20_m30);
  r14.y = dot(r5.xyzw, FC_ParallaxCorrectedCubemapObbB._m01_m11_m21_m31);
  r14.z = dot(r5.xyzw, FC_ParallaxCorrectedCubemapObbB._m02_m12_m22_m32);
  r5.xyz = -FC_ParallaxCorrectedCubemapOriginB.xyz + r14.xyz;
  r5.xyz = g_IBLTexture2.SampleLevel(SS_WrapLinear_s, r5.xyz, r8.z).xyz;
  r5.xyz = VC_InstanceData[r0.w].parallaxCorrectedCubemapAabbMax_envMapColorScale1.www * r5.xyz;
  r5.xyz = r1.xxx ? float3(0,0,0) : r5.xyz;
  r14.xyz = g_IBLTexture2.SampleLevel(SS_WrapLinear_s, r10.xyz, r8.z).xyz;
  r14.xyz = VC_InstanceData[r0.w].parallaxCorrectedCubemapAabbMax_envMapColorScale1.www * r14.xyz;
  r5.xyz = r13.yyy ? r5.xyz : r14.xyz;
  r5.xyz = r5.xyz + -r13.xzw;
  r5.xyz = VC_InstanceData[r0.w].parallaxCorrectedCubemapOrigin_envMapInterpRatio.www * r5.xyz + r13.xzw;
  r5.xyz = r5.xyz * r12.xyz;
  r5.xyz = r5.xyz * r6.www;
  r0.x = dot(r10.xyz, r0.xyz);
  r0.x = saturate(1 + r0.x);
  r0.x = r0.x * r0.x;
  r0.xyz = r5.xyz * r0.xxx;
  r3.w = 1;
  r5.x = dot(r3.xyzw, VC_InstanceData[r0.w].aSh[0].xyzw);
  r5.y = dot(r3.xyzw, VC_InstanceData[r0.w].aSh[1].xyzw);
  r5.z = dot(r3.xyzw, VC_InstanceData[r0.w].aSh[2].xyzw);
  r5.xyz = max(float3(0,0,0), r5.xyz);
  r5.xyz = r5.xyz * r11.xyz;
  r10.xyzw = g_RLRTexture.SampleLevel(SS_ClampLinear_s, r8.xy, r8.z).xyzw;
  r12.xyz = r12.xyz * r6.www;
  r10.xyz = r12.xyz * r10.xyz;
  r1.x = 1 + -r10.w;
  r0.xyz = r0.xyz * r1.xxx + r10.xyz;
  r10.x = dot(v7.xyzw, FC_MatrixInvProj._m00_m10_m20_m30);
  r10.y = dot(v7.xyzw, FC_MatrixInvProj._m01_m11_m21_m31);
  r10.z = dot(v7.xyzw, FC_MatrixInvProj._m02_m12_m22_m32);
  r10.w = dot(v7.xyzw, FC_MatrixInvProj._m03_m13_m23_m33);
  r12.xyz = r10.xyz / r10.www;
  r13.xyz = cmp(FC_CascadeSelectDist.xyz < r12.zzz);
  r13.xyz = r13.xyz ? float3(1,1,1) : 0;
  r1.x = (int)r13.y + (int)r13.x;
  r1.x = (int)r13.z + (int)r1.x;
  r1.x = (uint)r1.x << 2;
  r13.x = dot(r10.xyzw, FC_ProjSpaceToShadowMatrix[r1.x/4]._m00_m10_m20_m30);
  r13.y = dot(r10.xyzw, FC_ProjSpaceToShadowMatrix[r1.x/4]._m01_m11_m21_m31);
  r13.z = dot(r10.xyzw, FC_ProjSpaceToShadowMatrix[r1.x/4]._m02_m12_m22_m32);
  r13.w = dot(r10.xyzw, FC_ProjSpaceToShadowMatrix[r1.x/4]._m03_m13_m23_m33);
  r10.xy = FC_ShadowMapParam.zw * r13.ww;
  r10.z = 0;
  r14.xyzw = r13.xyzw + r10.xyzz;
  r14.xyz = r14.xyz / r14.www;
  r14.x = g_ShadowTexture.SampleCmpLevelZero(SS_Shadow_s, r14.xy, r14.z).x;
  r10.w = -r10.x;
  r15.xyzw = r13.xyzw + r10.ywzz;
  r15.xyz = r15.xyz / r15.www;
  r14.y = g_ShadowTexture.SampleCmpLevelZero(SS_Shadow_s, r15.xy, r15.z).x;
  r15.xyzw = r10.xyzz * float4(-1,-1,1,1) + r13.xyzw;
  r15.xyz = r15.xyz / r15.www;
  r14.z = g_ShadowTexture.SampleCmpLevelZero(SS_Shadow_s, r15.xy, r15.z).x;
  r10.xyzw = r10.yxzz * float4(-1,1,1,1) + r13.xyzw;
  r10.xyz = r10.xyz / r10.www;
  r14.w = g_ShadowTexture.SampleCmpLevelZero(SS_Shadow_s, r10.xy, r10.z).x;
  r1.x = dot(r14.xyzw, float4(0.25,0.25,0.25,0.25));
  r1.x = 1 + -r1.x;
  r3.w = dot(r12.xyz, r12.xyz);
  r4.w = sqrt(r3.w);
  r4.w = FC_ShadowMapParam.x + -r4.w;
  r4.w = saturate(FC_ShadowMapParam.y * r4.w);
  r10.xyz = FC_ShadowColor.xyz * r4.www;
  r10.xyz = -r10.xyz * r1.xxx + float3(1,1,1);
  r10.xyz = VC_InstanceData[r0.w].ShLightMask.xxx * r10.xyz;
  r13.xyz = FC_DirLightCol_0.xyz * r10.xyz;
  r14.x = dot(FC_DirLightVec_0.xyz, r3.xyz);
  r14.y = dot(FC_DirLightVec_1.xyz, r3.xyz);
  r8.zw = saturate(r14.xy);
  r15.xyz = r8.zzz * r11.xyz;
  r16.xyz = r8.www * r11.xyz;
  r16.xyz = FC_DirLightCol_1.xyz * r16.xyz;
  r13.xyz = r13.xyz * r15.xyz + r16.xyz;
  r14.zw = cmp(int2(0,0) < (uint2)FC_bLocalLight.xy);
  if (FC_bLocalLight.x != 0) {
    r1.x = dot(FC_DirLightVec_2.xyz, r3.xyz);
    r1.x = r1.x * 0.5 + 0.5;
    r1.x = r1.x * r1.x;
    r1.x = min(1, r1.x);
    r15.xyz = r1.xxx * r11.xyz;
    r13.xyz = FC_DirLightCol_2.xyz * r15.xyz + r13.xyz;
  }
  if (FC_bLocalLight.y != 0) {
    r1.x = dot(FC_DirLightVec_3.xyz, r3.xyz);
    r1.x = r1.x * 0.5 + 0.5;
    r1.x = r1.x * r1.x;
    r1.x = min(1, r1.x);
    r15.xyz = r1.xxx * r11.xyz;
    r13.xyz = FC_DirLightCol_3.xyz * r15.xyz + r13.xyz;
  }
  r10.xyz = FC_DirLightSpc_0.xyz * r10.xyz;
  r15.xyz = r7.xyz * r1.www + FC_DirLightVec_0.xyz;
  r1.x = dot(r15.xyz, r15.xyz);
  r1.x = rsqrt(r1.x);
  r15.xyz = r15.xyz * r1.xxx;
  r16.xyz = r7.xyz * r1.www + FC_DirLightVec_1.xyz;
  r1.x = dot(r16.xyz, r16.xyz);
  r1.x = rsqrt(r1.x);
  r16.xyz = r16.xyz * r1.xxx;
  r17.x = saturate(dot(r15.xyz, r3.xyz));
  r17.y = saturate(dot(r16.xyz, r3.xyz));
  r1.x = FC_DirLightVec_0.w * r1.y;
  r4.w = r1.y * 0.00999999978 + FC_DirLightVec_0.w;
  r1.x = r1.x / r4.w;
  r18.x = max(1, r1.x);
  r1.x = FC_DirLightVec_1.w * r1.y;
  r4.w = r1.y * 0.00999999978 + FC_DirLightVec_1.w;
  r1.x = r1.x / r4.w;
  r18.y = max(1, r1.x);
  r17.xy = log2(r17.xy);
  r17.xy = r18.xy * r17.xy;
  r17.xy = exp2(r17.xy);
  r15.x = saturate(dot(r6.xyz, r15.xyz));
  r15.y = saturate(dot(r6.xyz, r16.xyz));
  r15.xy = float2(1,1) + -r15.xy;
  r15.zw = r15.xy * r15.xy;
  r15.zw = r15.zw * r15.zw;
  r15.xy = r15.xy * r15.zw;
  r15.xzw = r15.xxx * r11.xyz + r4.xyz;
  r16.xyz = r15.yyy * r11.xyz + r4.xyz;
  r14.xy = max(r14.xy, r7.ww);
  r14.xy = max(float2(9.99999975e-005,9.99999975e-005), r14.xy);
  r8.zw = r8.zw / r14.xy;
  r15.xyz = r17.xxx * r15.xzw;
  r15.xyz = r15.xyz * r8.zzz;
  r16.xyz = r17.yyy * r16.xyz;
  r16.xyz = r16.xyz * r8.www;
  r8.zw = r18.xy * float2(0.125,0.125) + float2(0.25,0.25);
  r10.xyz = r8.zzz * r10.xyz;
  r17.xyz = FC_DirLightSpc_1.xyz * r8.www;
  r16.xyz = r17.xyz * r16.xyz;
  r10.xyz = r10.xyz * r15.xyz + r16.xyz;
  r1.x = dot(r3.xyz, FC_DirLightVec_2.xyz);
  r15.xyz = r7.xyz * r1.www + FC_DirLightVec_2.xyz;
  r4.w = dot(r15.xyz, r15.xyz);
  r4.w = rsqrt(r4.w);
  r15.xyz = r15.xyz * r4.www;
  r4.w = saturate(dot(r15.xyz, r3.xyz));
  r5.w = FC_DirLightVec_2.w * r1.y;
  r8.z = r1.y * 0.00999999978 + FC_DirLightVec_2.w;
  r5.w = r5.w / r8.z;
  r5.w = max(1, r5.w);
  r4.w = log2(r4.w);
  r4.w = r5.w * r4.w;
  r4.w = exp2(r4.w);
  r8.z = saturate(dot(r6.xyz, r15.xyz));
  r8.z = 1 + -r8.z;
  r8.w = r8.z * r8.z;
  r8.w = r8.w * r8.w;
  r8.z = r8.z * r8.w;
  r15.xyz = r8.zzz * r11.xyz + r4.xyz;
  r8.z = saturate(r1.x);
  r1.x = max(r1.x, r7.w);
  r1.x = max(9.99999975e-005, r1.x);
  r1.x = r8.z / r1.x;
  r15.xyz = r15.xyz * r4.www;
  r15.xyz = r15.xyz * r1.xxx;
  r1.x = r5.w * 0.125 + 0.25;
  r16.xyz = FC_DirLightSpc_2.xyz * r1.xxx;
  r15.xyz = r16.xyz * r15.xyz + r10.xyz;
  r10.xyz = r14.zzz ? r15.xyz : r10.xyz;
  r1.x = dot(r3.xyz, FC_DirLightVec_3.xyz);
  r14.xyz = r7.xyz * r1.www + FC_DirLightVec_3.xyz;
  r1.w = dot(r14.xyz, r14.xyz);
  r1.w = rsqrt(r1.w);
  r14.xyz = r14.xyz * r1.www;
  r1.w = saturate(dot(r14.xyz, r3.xyz));
  r4.w = FC_DirLightVec_3.w * r1.y;
  r5.w = r1.y * 0.00999999978 + FC_DirLightVec_3.w;
  r4.w = r4.w / r5.w;
  r4.w = max(1, r4.w);
  r1.w = log2(r1.w);
  r1.w = r4.w * r1.w;
  r1.w = exp2(r1.w);
  r5.w = saturate(dot(r6.xyz, r14.xyz));
  r5.w = 1 + -r5.w;
  r6.x = r5.w * r5.w;
  r6.x = r6.x * r6.x;
  r5.w = r6.x * r5.w;
  r6.xyz = r5.www * r11.xyz + r4.xyz;
  r5.w = saturate(r1.x);
  r1.x = max(r1.x, r7.w);
  r1.x = max(9.99999975e-005, r1.x);
  r1.x = r5.w / r1.x;
  r6.xyz = r6.xyz * r1.www;
  r6.xyz = r6.xyz * r1.xxx;
  r1.x = r4.w * 0.125 + 0.25;
  r11.xyz = FC_DirLightSpc_3.xyz * r1.xxx;
  r6.xyz = r11.xyz * r6.xyz + r10.xyz;
  r6.xyz = r14.www ? r6.xyz : r10.xyz;
  r10.xyz = FC_GlobalSpecularMask * FC_SpcMapMulCol.xyz;
  if (VC_InstanceData[r0.w].dynamicLightDisable == 0) {
    r11.x = dot(r3.xyz, FC_MatrixView._m00_m10_m20);
    r11.y = dot(r3.xyz, FC_MatrixView._m01_m11_m21);
    r11.z = dot(r3.xyz, FC_MatrixView._m02_m12_m22);
    r1.xw = FC_ScreenSize.xy * r8.xy;
    r1.xw = (uint2)r1.xw;
    uiDest.xw = (uint2)r1.xw / FC_LightTile_Width;
    r1.xw = uiDest.xw;
    r1.xw = (uint2)r1.xw;
    r3.x = FC_LightTile_NumCellX;
    r1.x = r1.w * r3.x + r1.x;
    r1.w = -FC_FrustumNear + r12.z;
    r1.w = log2(r1.w);
    r1.w = -FC_FrustumSliceBias + r1.w;
    r1.w = r1.w / FC_FrustumSliceScale;
    r1.w = max(0, r1.w);
    r1.w = min(14, r1.w);
    r1.xw = (uint2)r1.xw;
    r1.w = 1 << (int)r1.w;
  // Known bad code for instruction (needs manual fix):
    ld_structured_indexable(structured_buffer, stride=12)(mixed,mixed,mixed,mixed) r3.xyz, r1.x, l(0), t60.xyzx
  r3.x = SS_DiffuseMap[]..swiz;
  r3.y = SS_DiffuseMap[]..swiz;
  r3.z = SS_DiffuseMap[]..swiz;
    r1.x = dot(-r12.xyz, -r12.xyz);
    r1.x = rsqrt(r1.x);
    r8.xyz = -r12.xyz * r1.xxx;
    r14.xyz = float3(0,0,0);
    r15.xyz = float3(0,0,0);
    r1.x = r3.x;
    r4.w = 0;
    while (true) {
      r5.w = cmp((uint)r4.w >= (uint)r3.y);
      if (r5.w != 0) break;
    // Known bad code for instruction (needs manual fix):
        ld_structured_indexable(structured_buffer, stride=8)(mixed,mixed,mixed,mixed) r16.xy, r1.x, l(0), t59.xyxx
    r16.x = SS_DiffuseMap[]..swiz;
    r16.y = SS_DiffuseMap[]..swiz;
      r5.w = (int)r1.x + 1;
      r7.w = (int)r1.w & (int)r16.y;
      r8.w = (int)r4.w + 1;
      r4.w = r7.w ? r4.w : r8.w;
      r1.x = r5.w;
      if (r7.w == 0) continue;
    // Known bad code for instruction (needs manual fix):
        ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r17.xyzw, r16.x, l(0), t61.xyzw
    r17.x = SS_DiffuseMap[]..swiz;
    r17.y = SS_DiffuseMap[]..swiz;
    r17.z = SS_DiffuseMap[]..swiz;
    r17.w = SS_DiffuseMap[]..swiz;
    // Known bad code for instruction (needs manual fix):
        ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r18.xyzw, r16.x, l(16), t61.xyzw
    r18.x = SS_DiffuseMap[]..swiz;
    r18.y = SS_DiffuseMap[]..swiz;
    r18.z = SS_DiffuseMap[]..swiz;
    r18.w = SS_DiffuseMap[]..swiz;
    // Known bad code for instruction (needs manual fix):
        ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r16.xyz, r16.x, l(32), t61.xyzx
    r16.x = SS_DiffuseMap[]..swiz;
    r16.y = SS_DiffuseMap[]..swiz;
    r16.z = SS_DiffuseMap[]..swiz;
      r17.xyz = r17.xyz + -r12.xyz;
      r7.w = dot(r17.xyz, r17.xyz);
      r10.w = rsqrt(r7.w);
      r19.xyz = r17.xyz * r10.www;
      r11.w = saturate(dot(r11.xyz, r19.xyz));
      r7.w = saturate(r7.w * r17.w);
      r7.w = sqrt(r7.w);
      r7.w = 1 + -r7.w;
      r7.w = r7.w * r7.w;
      r17.xyz = r17.xyz * r10.www + r8.xyz;
      r10.w = dot(r17.xyz, r17.xyz);
      r10.w = rsqrt(r10.w);
      r17.xyz = r17.xyz * r10.www;
      r10.w = r18.w * r1.y;
      r13.w = r1.y * 0.00999999978 + r18.w;
      r10.w = r10.w / r13.w;
      r10.w = max(1, r10.w);
      r13.w = saturate(dot(r17.xyz, r11.xyz));
      r13.w = log2(r13.w);
      r13.w = r13.w * r10.w;
      r13.w = exp2(r13.w);
      r17.xyz = r18.xyz * r11.www;
      r16.xyz = r16.xyz * r13.www;
      r11.w = log2(r11.w);
      r11.w = 0.100000001 * r11.w;
      r11.w = exp2(r11.w);
      r16.xyz = r16.xyz * r11.www;
      r16.xyz = r16.xyz * r7.www;
      r10.w = r10.w * 0.125 + 0.25;
      r14.xyz = r17.xyz * r7.www + r14.xyz;
      r15.xyz = r16.xyz * r10.www + r15.xyz;
      r4.w = r8.w;
      r1.x = r5.w;
    }
    r3.x = rsqrt(r3.w);
    r3.xyw = r12.xyz * r3.xxx;
    r4.w = dot(r3.xyw, r11.xyz);
    r4.w = r4.w + r4.w;
    r3.xyw = r11.xyz * -r4.www + r3.xyw;
    r3.z = (uint)r3.z >> 16;
    r12.w = 1;
    r16.zw = float2(1,1);
    r17.xyz = r14.xyz;
    r18.xyz = r15.xyz;
    r4.w = r1.x;
    r5.w = 0;
    while (true) {
      r7.w = cmp((uint)r5.w >= (uint)r3.z);
      if (r7.w != 0) break;
    // Known bad code for instruction (needs manual fix):
        ld_structured_indexable(structured_buffer, stride=8)(mixed,mixed,mixed,mixed) r19.xy, r4.w, l(0), t59.xyxx
    r19.x = SS_DiffuseMap[]..swiz;
    r19.y = SS_DiffuseMap[]..swiz;
      r7.w = (int)r4.w + 1;
      r8.w = (int)r1.w & (int)r19.y;
      r10.w = (int)r5.w + 1;
      r5.w = r8.w ? r5.w : r10.w;
      r4.w = r7.w;
      if (r8.w == 0) continue;
    // Known bad code for instruction (needs manual fix):
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r20.xyzw, r19.x, l(0), t62.xyzw
    r20.x = SS_DiffuseMap[]..swiz;
    r20.y = SS_DiffuseMap[]..swiz;
    r20.z = SS_DiffuseMap[]..swiz;
    r20.w = SS_DiffuseMap[]..swiz;
    // Known bad code for instruction (needs manual fix):
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r21.xyzw, r19.x, l(16), t62.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=128)(mixed,mixed,mixed,mixed) r19.yzw, r19.x, l(32), t62.xxyz
    r19.y = SS_DiffuseMap[]..swiz;
    r19.z = SS_DiffuseMap[]..swiz;
    r19.w = SS_DiffuseMap[]..swiz;
    // Known bad code for instruction (needs manual fix):
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r22.xyzw, r19.x, l(60), t62.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=128)(mixed,mixed,mixed,mixed) r23.xyzw, r19.x, l(76), t62.yzwx
    r23.x = SS_DiffuseMap[]..swiz;
    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) r24.xyzw, r19.x, l(92), t62.yzwx
    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, r19.x, l(108), 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) r26.w, r19.x, l(124), t62.xxxx
    r26.w = SS_DiffuseMap[]..swiz;
      r27.xyz = r22.yzw;
      r27.w = r23.w;
      r27.x = dot(r12.xyzw, r27.xyzw);
      r23.w = r24.w;
      r27.y = dot(r12.xyzw, r23.xyzw);
      r24.w = r25.x;
      r8.w = dot(r12.xyzw, r24.xyzw);
      r26.xyz = r25.yzw;
      r11.w = dot(r12.xyzw, r26.xyzw);
      r8.w = cmp(0 < r8.w);
      r20.xyz = r20.xyz + -r12.xyz;
      r13.w = dot(r20.xyz, r20.xyz);
      r14.w = rsqrt(r13.w);
      r22.yzw = r20.xyz * r14.www;
      r15.w = cmp(0 < r22.x);
      r17.w = r20.w * r20.w;
      r17.w = 1 / r17.w;
      r23.x = 1 / r13.w;
      r18.w = r23.x + -r17.w;
      r23.w = max(0, r18.w);
      r18.w = saturate(dot(r22.yzw, r11.xyz));
      r24.xy = r27.xy / r11.ww;
      r19.x = dot(r24.xy, r24.xy);
      r19.x = 1 + -r19.x;
      r23.y = max(0, r19.x);
      r13.w = r17.w * r13.w;
      r13.w = min(1, r13.w);
      r23.z = 1 + -r13.w;
      r11.w = r11.w / r20.w;
      r11.w = saturate(1 + -r11.w);
      r16.y = r23.y * r23.y;
      r16.x = r11.w * r11.w;
      r23.xyzw = r15.wwww ? r23.xyzw : r16.xyzw;
      r20.xyz = r20.xyz * r14.www + r8.xyz;
      r11.w = dot(r20.xyz, r20.xyz);
      r11.w = rsqrt(r11.w);
      r20.xyz = r20.xyz * r11.www;
      r11.w = r21.w * r1.y;
      r13.w = r1.y * 0.00999999978 + r21.w;
      r11.w = r11.w / r13.w;
      r11.w = max(1, r11.w);
      r13.w = saturate(dot(r20.xyz, r11.xyz));
      r13.w = log2(r13.w);
      r13.w = r13.w * r11.w;
      r13.w = exp2(r13.w);
      r20.xyz = r23.yyy * r23.wzx;
      r21.xyz = r21.xyz * r18.www;
      r23.xyz = r21.xyz * r20.xxx;
      r24.xyz = r19.yzw * r13.www;
      r13.w = log2(r18.w);
      r13.w = 0.100000001 * r13.w;
      r13.w = exp2(r13.w);
      r24.xyz = r24.xyz * r13.www;
      r20.xyw = r24.xyz * r20.yyy;
      r13.w = 0.25 * r11.w;
      r11.w = r11.w * 0.125 + 0.25;
      r20.xyw = r20.xyw * r11.www;
      r14.w = saturate(dot(r22.yzw, r3.xyw));
      r14.w = log2(r14.w);
      r13.w = r14.w * r13.w;
      r13.w = exp2(r13.w);
      r11.w = r13.w * r11.w;
      r21.xyz = r21.xyz * r20.zzz;
      r19.xyz = r19.yzw * r11.www;
      r19.xyz = r19.xyz * r20.zzz;
      r21.xyz = r15.www ? r23.xyz : r21.xyz;
      r19.xyz = r15.www ? r20.xyw : r19.xyz;
      r20.xyz = r8.www ? r21.xyz : 0;
      r19.xyz = r8.www ? r19.xyz : 0;
      r17.xyz = r20.xyz + r17.xyz;
      r18.xyz = r19.xyz + r18.xyz;
      r5.w = r10.w;
      r4.w = r7.w;
    }
    r1.xyw = -r4.xyz * float3(0.5,0.5,0.5) + float3(1,1,1);
    r1.xyw = r17.xyz * r1.xyw;
    r3.xyz = r18.xyz * r4.xyz;
    r13.xyz = r1.xyw * r1.zzz + r13.xyz;
    r6.xyz = r3.xyz * r1.zzz + r6.xyz;
  }
  r1.xy = v5.xy * FC_TextureTilingScale[6].xy + FC_TextureTilingScale[6].zw;
  r1.xyz = g_EmissiveTexture.Sample(SS_WrapLinear_s, r1.xy).xyz;
  r3.xy = v5.zw * FC_TextureTilingScale[13].xy + FC_TextureTilingScale[13].zw;
  r3.xyz = g_EmissiveTexture2.Sample(SS_WrapLinear_s, r3.xy).xyz;
  r3.xyz = r3.xyz + -r1.xyz;
  r1.xyz = r2.www * r3.xyz + r1.xyz;
  r3.xyz = FC_EmissiveColor.xyz * r1.xyz;
  r0.xyz = r6.xyz + r0.xyz;
  r4.xyz = r5.xyz * r6.www + r13.xyz;
  r0.xyz = r10.xyz * r0.xyz;
  r0.xyz = r2.xyz * r4.xyz + r0.xyz;
  r9.xyz = r1.xyz * FC_EmissiveColor.xyz + r0.xyz;
  o1.xyz = FC_GlowScale.xyz * r3.xyz;
  r0.x = saturate(FC_GlowScale.w);
  r1.xyzw = VC_InstanceData[r0.w].mulCol.xyzw * r9.xyzw;
  r0.y = FC_HeightFogParam.w + -r7.y;
  r0.y = -FC_HeightFogParam.y + r0.y;
  r0.y = saturate(FC_HeightFogParam.z * r0.y);
  r0.z = dot(-r7.xz, -r7.xz);
  r0.z = sqrt(r0.z);
  r0.z = -FC_ExtFogParam.y + r0.z;
  r0.z = FC_ExtFogParam.z * r0.z;
  r0.z = exp2(-r0.z);
  r0.z = saturate(-r0.z * FC_ExtFogParam.x + FC_ExtFogParam.x);
  r0.y = saturate(FC_HeightFogParam.x * r0.y);
  r0.w = dot(r1.xyz, float3(0.298909992,0.586610019,0.114480004));
  r0.w = -1 + r0.w;
  r2.x = FC_FogCol.w * r0.w + 1;
  r0.w = FC_HeightFogCol.w * r0.w + 1;
  r2.xyz = FC_FogCol.xyz * r2.xxx + -r1.xyz;
  r1.xyz = r0.zzz * r2.xyz + r1.xyz;
  r2.xyz = FC_HeightFogCol.xyz * r0.www + -r1.xyz;
  o0.xyz = r0.yyy * r2.xyz + r1.xyz;
  o1.w = r1.w * r0.x;
  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
//   float4 FC_BlendMaskParam;          // Offset:   48 Size:    16
//   float FC_PomHeightScale;           // Offset:   64 Size:     4 [unused]
//   float FC_PomHeightBias;            // Offset:   68 Size:     4 [unused]
//   float FC_PomMinSamples;            // Offset:   72 Size:     4 [unused]
//   float FC_PomMaxSamples;            // Offset:   76 Size:     4 [unused]
//   float FC_PomShadowSoftening;       // Offset:   80 Size:     4 [unused]
//   bool FC_bPomDisplayShadows;        // Offset:   84 Size:     4 [unused]
//   float4 FC_ParallaxParam;           // Offset:   96 Size:    16 [unused]
//   float FC_Pom2HeightScale;          // Offset:  112 Size:     4 [unused]
//   float FC_Pom2HeightBias;           // Offset:  116 Size:     4 [unused]
//   float FC_Pom2MinSamples;           // Offset:  120 Size:     4 [unused]
//   float FC_Pom2MaxSamples;           // Offset:  124 Size:     4 [unused]
//   bool VC_isEnableCloth;             // Offset:  128 Size:     4 [unused]
//   float FC_EnvMapDolBlendRate;       // Offset:  144 Size:     4 [unused]
//   float4 FC_SnowMaskParam;           // Offset:  160 Size:    16 [unused]
//   float FC_FROZEN_THRESHOLD;         // Offset:  176 Size:     4 [unused]
//   float FC_FROZEN_POW;               // Offset:  180 Size:     4 [unused]
//   float FC_BlendRate;                // Offset:  192 Size:     4 [unused]
//   float4 FC_FlowMapUvTiling;         // Offset:  208 Size:    16 [unused]
//   float4 FC_FlowMapIntencity;        // Offset:  224 Size:    16 [unused]
//   float FC_SoftVolume;               // Offset:  240 Size:     4 [unused]
//   float FC_PointCloudRate;           // Offset:  256 Size:     4 [unused]
//   float4 FC_WaterNormalUvScrollSpeed;// Offset:  272 Size:    16 [unused]
//   float4 FC_WaterDiffuseUvScrollSpeed;// Offset:  288 Size:    16 [unused]
//   float4 FC_WaterMiddleUvScrollSpeed;// Offset:  304 Size:    16 [unused]
//   float4 FC_WaterFogParam0;          // Offset:  320 Size:    16 [unused]
//   float4 FC_WaterFogParam1;          // Offset:  336 Size:    16 [unused]
//   float4 FC_WaterFresnel;            // Offset:  352 Size:    16 [unused]
//   float4 FC_WaterFadeParam;          // Offset:  368 Size:    16 [unused]
//   float4 FC_DynamicDiffuseColor;     // Offset:  384 Size:    16 [unused]
//   float FC_SSS_ID;                   // Offset:  400 Size:     4 [unused]
//   float4 FC_PhantomEdgeColor;        // Offset:  416 Size:    16 [unused]
//   float4 FC_PhantomFrontColor;       // Offset:  432 Size:    16 [unused]
//   float4 FC_PhantomDiffColor;        // Offset:  448 Size:    16 [unused]
//   float4 FC_PhantomSpecColor;        // Offset:  464 Size:    16 [unused]
//   float4 FC_PhantomLightColor;       // Offset:  480 Size:    16 [unused]
//   float VC_VelocityOffset;           // Offset:  496 Size:     4 [unused]
//   float4 FC_DamagedNormalParam;      // Offset:  512 Size:    16 [unused]
//   float4 FC_DamagedNormalUvTiling;   // Offset:  528 Size:    16 [unused]
//   float4 FC_DamagedNormal2UvTiling;  // Offset:  544 Size:    16 [unused]
//   float4 FC_WetDiffuseColor;         // Offset:  560 Size:    16 [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
//   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
//   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 [unused]
//   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
//   float4 FC_ShadowColor;             // Offset:  464 Size:    16
//   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
//   float4 FC_CascadeSelectDist;       // Offset:  864 Size:    16
//   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 [unused]
//   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
//   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 cbModelParam
// {
//
//   float4 FC_DifColMul;               // Offset:    0 Size:    16 [unused]
//   float FC_EnvMapInterpRatio;        // Offset:   16 Size:     4 [unused]
//   float FC_EnvMapColorScale0;        // Offset:   20 Size:     4 [unused]
//   float FC_EnvMapColorScale1;        // Offset:   24 Size:     4 [unused]
//   float FC_DitherEnable;             // Offset:   32 Size:     4 [unused]
//   float FC_FROZEN_RATE;              // Offset:   44 Size:     4 [unused]
//   float FC_Perlin_Freq;              // Offset:   48 Size:     4 [unused]
//   float FC_Perlin_Amp;               // Offset:   52 Size:     4 [unused]
//   float FC_Perlin_Lacunarity;        // Offset:   56 Size:     4 [unused]
//   float FC_Perlin_Gain;              // Offset:   60 Size:     4 [unused]
//   float FC_SnowRate;                 // Offset:   64 Size:     4 [unused]
//   float FC_SnowMinDot;               // Offset:   68 Size:     4 [unused]
//   float FC_SnowMaxDot;               // Offset:   72 Size:     4 [unused]
//   float FC_SparkleExponent;          // Offset:   80 Size:     4 [unused]
//   float FC_SparkleThreshold;         // Offset:   84 Size:     4 [unused]
//   float FC_SparkleMul;               // Offset:   88 Size:     4 [unused]
//   float FC_SparkleMaskExponent;      // Offset:   92 Size:     4 [unused]
//   float4 FC_SkinMatchColor;          // Offset:   96 Size:    16 [unused]
//   int FC_EnvId;                      // Offset:  112 Size:     4 [unused]
//   float4 FC_ParallaxCorrectedCubemapOriginA;// Offset:  128 Size:    16
//   float4 FC_ParallaxCorrectedCubemapOriginB;// Offset:  144 Size:    16
//   float4x4 FC_ParallaxCorrectedCubemapObbA;// Offset:  160 Size:    64
//   float4x4 FC_ParallaxCorrectedCubemapInvObbA;// Offset:  224 Size:    64
//   float4x4 FC_ParallaxCorrectedCubemapObbB;// Offset:  288 Size:    64
//   float4x4 FC_ParallaxCorrectedCubemapInvObbB;// Offset:  352 Size:    64
//   float FC_ParallaxCorrectedCubemapObbAEnable;// Offset:  416 Size:     4
//   float FC_ParallaxCorrectedCubemapObbBEnable;// Offset:  420 Size:     4
//
// }
//
// 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_WrapLinear                     sampler      NA          NA    8        1
// SS_ClampLinear                    sampler      NA          NA    9        1
// SS_WrapAniso                      sampler      NA          NA   10        1
// SS_Shadow                       sampler_c      NA          NA   12        1
// g_DiffuseTexture                  texture  float4          2d    0        1
// g_SpecularTexture                 texture  float4          2d    1        1
// g_BumpmapTexture                  texture  float4          2d    3        1
// g_EmissiveTexture                 texture  float4          2d    6        1
// g_DiffuseTexture2                 texture  float4          2d    7        1
// g_SpecularTexture2                texture  float4          2d    8        1
// g_BumpmapTexture2                 texture  float4          2d   10        1
// g_EmissiveTexture2                texture  float4          2d   13        1
// g_BlendMaskTexture                texture  float4          2d   14        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
// 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
// cbModelParam                      cbuffer      NA          NA    7        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                 4   xyzw        3     NONE   float   xyzw
// COLOR                    1   xyzw        4     NONE   float   x  w
// TEXCOORD                 6   xyzw        5     NONE   float   xyzw
// TEXCOORD                 7   xy          6     NONE   float   xy  
// TEXCOORD                 9   xyzw        7     NONE   float   xyzw
// SV_IsFrontFace           0   x           8    FFACE    uint   x   
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
// SV_Target                1   xyzw        1   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[15], immediateIndexed
dcl_constantbuffer cb2[4], immediateIndexed
dcl_constantbuffer cb3[10], immediateIndexed
dcl_constantbuffer cb8[57], dynamicIndexed
dcl_constantbuffer cb9[4], immediateIndexed
dcl_constantbuffer cb4[34], dynamicIndexed
dcl_constantbuffer cb5[17], immediateIndexed
dcl_constantbuffer cb6[5], immediateIndexed
dcl_constantbuffer cb7[27], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s8, mode_default
dcl_sampler s9, mode_default
dcl_sampler s10, mode_default
dcl_sampler s12, mode_comparison
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) t6
dcl_resource_texture2d (float,float,float,float) t7
dcl_resource_texture2d (float,float,float,float) t8
dcl_resource_texture2d (float,float,float,float) t10
dcl_resource_texture2d (float,float,float,float) t13
dcl_resource_texture2d (float,float,float,float) t14
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_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 v3.xyzw
dcl_input_ps linear v4.xw
dcl_input_ps linear v5.xyzw
dcl_input_ps linear v6.xy
dcl_input_ps linear v7.xyzw
dcl_input_ps_sgv v8.x, is_front_face
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_temps 28
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, v1.zxyz, v2.yzxy
mad r2.xyz, v1.yzxy, v2.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
dp3 r0.w, v3.xyzx, v3.xyzx
rsq r0.w, r0.w
mul r3.xyz, r0.wwww, v3.xyzx
mul r4.xyz, v1.zxyz, v3.yzxy
mad r4.xyz, v1.yzxy, v3.zxyz, -r4.xyzx
mul r4.xyz, r4.xyzx, v3.wwww
dp3 r0.w, r4.xyzx, r4.xyzx
rsq r0.w, r0.w
mul r4.xyz, r0.wwww, r4.xyzx
round_ne r0.w, v1.w
ftou r0.w, r0.w
dp4 r5.x, v7.xyzw, cb8[8].xyzw
dp4 r5.y, v7.xyzw, cb8[9].xyzw
dp4 r5.z, v7.xyzw, cb8[10].xyzw
dp4 r1.w, v7.xyzw, cb8[11].xyzw
div r6.xyz, r5.xyzx, r1.wwww
add r7.x, -r6.x, cb8[20].w
add r7.y, -r6.y, cb8[21].w
add r7.z, -r6.z, cb8[22].w
dp3 r1.w, r7.xyzx, r7.xyzx
rsq r1.w, r1.w
mul r6.xyz, r1.wwww, r7.xyzx
mul r8.xy, v0.xyxx, cb8[1].zwzz
mad r8.zw, v6.xxxy, cb1[14].xxxy, cb1[14].zzzw
sample_indexable(texture2d)(float,float,float,float) r2.w, r8.zwzz, t14.yzwx, s10
mad r9.y, r2.w, cb2[3].x, cb2[3].z
add r8.zw, -v4.wwww, l(0.000000, 0.000000, 0.000000, 1.000000)
mov r9.x, -r9.y
mad r8.zw, r9.xxxy, r8.zzzw, v4.wwww
lt r2.w, l(0.000000), r9.y
movc_sat r2.w, r2.w, r8.z, r8.w
mul r3.w, r2.w, r2.w
mad r2.w, -r2.w, l(2.000000), l(3.000000)
mul r2.w, r2.w, r3.w
movc r0.xyz, v8.xxxx, r0.xyzx, -r0.xyzx
mad r8.zw, v5.xxxy, cb1[3].xxxy, cb1[3].zzzw
sample_indexable(texture2d)(float,float,float,float) r9.xyw, r8.zwzz, t3.xywz, s2
mad r8.zw, r9.xxxy, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
dp2 r3.w, r8.zwzz, r8.zwzz
min r3.w, r3.w, l(1.000000)
add r3.w, -r3.w, l(1.000000)
sqrt r3.w, r3.w
mad r10.xy, v5.zwzz, cb1[10].xyxx, cb1[10].zwzz
sample_indexable(texture2d)(float,float,float,float) r10.xyw, r10.xyxx, t10.xywz, s2
mad r11.xy, r10.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r4.w, r11.xyxx, r11.xyxx
min r4.w, r4.w, l(1.000000)
add r4.w, -r4.w, l(1.000000)
sqrt r4.w, r4.w
mul r1.xyz, r1.xyzx, r8.wwww
mad r1.xyz, r8.zzzz, r2.xyzx, r1.xyzx
mad r1.xyz, r3.wwww, r0.xyzx, r1.xyzx
mul r2.xyz, r3.xyzx, r11.yyyy
mad r2.xyz, r11.xxxx, r4.xyzx, r2.xyzx
mad r2.xyz, r4.wwww, r0.xyzx, r2.xyzx
add r2.xyz, -r1.xyzx, r2.xyzx
mad r1.xyz, r2.wwww, r2.xyzx, r1.xyzx
dp3 r2.x, r1.xyzx, r1.xyzx
rsq r2.x, r2.x
mul r3.xyz, r1.xyzx, r2.xxxx
mad r1.xy, v5.xyxx, cb1[1].xyxx, cb1[1].zwzz
sample_indexable(texture2d)(float,float,float,float) r9.xyz, r1.xyxx, t1.xyzw, s1
mad r1.xy, v5.zwzz, cb1[8].xyxx, cb1[8].zwzz
sample_indexable(texture2d)(float,float,float,float) r10.xyz, r1.xyxx, t8.xyzw, s1
add r4.xyzw, -r9.xyzw, r10.xyzw
mad r4.xyzw, r2.wwww, r4.xyzw, r9.xyzw
mul r1.x, l(0.003906), cb3[2].x
mul r1.x, r1.x, r4.w
mul r1.y, r1.x, l(13.000000)
exp r1.y, r1.y
mad r2.xy, v5.xyxx, cb1[0].xyxx, cb1[0].zwzz
mad r8.zw, v5.zzzw, cb1[7].xxxy, cb1[7].zzzw
sample_indexable(texture2d)(float,float,float,float) r9.xyzw, r2.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r10.xyzw, r8.zwzz, t7.xyzw, s0
add r10.xyzw, -r9.xyzw, r10.xyzw
mad r9.xyzw, r2.wwww, r10.xyzw, r9.xyzw
mul r2.xyz, r9.xyzx, cb3[0].xyzx
sample_indexable(texture2d)(float,float,float,float) r1.z, r8.xyxx, t33.yzxw, s8
mad r1.z, r1.z, cb3[3].x, l(1.000000)
add r1.z, r1.z, -cb3[3].x
eq r4.w, v4.x, l(0.000000)
movc r4.w, r4.w, l(1.000000), v4.x
mul r6.w, r1.z, r4.w
dp3 r7.w, r3.xyzx, r6.xyzx
mad r8.z, r1.z, r4.w, r7.w
mad r8.z, r8.z, r8.z, l(-1.000000)
mad_sat r4.w, r1.z, r4.w, r8.z
mov_sat r8.z, r7.w
add r8.z, -r8.z, l(1.000000)
add r8.w, r7.w, r7.w
mad r10.xyz, r8.wwww, r3.xyzx, -r6.xyzx
mul r8.w, r8.z, r8.z
mul r8.w, r8.w, r8.w
mul r8.z, r8.w, r8.z
mul r4.w, r4.w, r8.z
mad r8.z, -r1.x, l(6.500000), l(6.500000)
min r8.z, r8.z, l(6.000000)
add r11.xyz, -r4.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r12.xyz, r4.wwww, r11.xyzx
mul r1.x, r1.x, r1.x
mad r12.xyz, r12.xyzx, r1.xxxx, r4.xyzx
imul null, r0.w, r0.w, l(17)
lt r13.xy, l(0.000000, 0.000000, 0.000000, 0.000000), cb7[26].xyxx
mov r5.w, l(1.000000)
dp4 r14.x, r5.xyzw, cb7[14].xyzw
dp4 r14.y, r5.xyzw, cb7[15].xyzw
dp4 r14.z, r5.xyzw, cb7[16].xyzw
dp3 r15.x, r10.xyzx, cb7[14].xyzx
dp3 r15.y, r10.xyzx, cb7[15].xyzx
dp3 r15.z, r10.xyzx, cb7[16].xyzx
lt r16.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), r15.xyzx
not r17.xyz, r16.xyzx
and r16.xyz, r13.xxxx, r16.xyzx
add r18.xyz, -r14.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
div r18.xyz, r18.xyzx, r15.xyzx
movc r16.xyz, r16.xyzx, |r18.xyzx|, l(5000.000000,5000.000000,5000.000000,0)
and r17.xyz, r13.xxxx, r17.xyzx
lt r18.xyz, r15.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
and r17.xyz, r17.xyzx, r18.xyzx
add r18.xyz, r14.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
div r18.xyz, r18.xyzx, r15.xyzx
movc r16.xyz, r17.xyzx, |r18.xyzx|, r16.xyzx
min r1.x, r16.y, r16.x
min r1.x, r16.z, r1.x
mad r14.xyz, r15.xyzx, r1.xxxx, r14.xyzx
mad r4.w, -r1.x, l(0.000100), l(-1.000000)
lt r15.xyz, r14.xyzx, r4.wwww
mad r1.x, r1.x, l(0.000100), l(1.000000)
lt r16.xyz, r1.xxxx, r14.xyzx
or r1.x, r15.x, r16.x
or r1.x, r15.y, r1.x
or r1.x, r16.y, r1.x
or r1.x, r15.z, r1.x
or r1.x, r16.z, r1.x
mov r14.w, l(1.000000)
dp4 r15.x, r14.xyzw, cb7[10].xyzw
dp4 r15.y, r14.xyzw, cb7[11].xyzw
dp4 r15.z, r14.xyzw, cb7[12].xyzw
add r14.xyz, r15.xyzx, -cb7[8].xyzx
sample_l_indexable(texturecube)(float,float,float,float) r14.xyz, r14.xyzx, t30.xyzw, s8, r8.z
mul r14.xyz, r14.xyzx, cb4[r0.w + 14].wwww
movc r14.xyz, r1.xxxx, l(0,0,0,0), r14.xyzx
sample_l_indexable(texturecube)(float,float,float,float) r15.xyz, r10.xyzx, t30.xyzw, s8, r8.z
mul r15.xyz, r15.xyzx, cb4[r0.w + 14].wwww
movc r13.xzw, r13.xxxx, r14.xxyz, r15.xxyz
dp4 r14.x, r5.xyzw, cb7[22].xyzw
dp4 r14.y, r5.xyzw, cb7[23].xyzw
dp4 r14.z, r5.xyzw, cb7[24].xyzw
dp3 r5.x, r10.xyzx, cb7[22].xyzx
dp3 r5.y, r10.xyzx, cb7[23].xyzx
dp3 r5.z, r10.xyzx, cb7[24].xyzx
lt r15.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), r5.xyzx
not r16.xyz, r15.xyzx
and r15.xyz, r13.yyyy, r15.xyzx
add r17.xyz, -r14.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
div r17.xyz, r17.xyzx, r5.xyzx
movc r15.xyz, r15.xyzx, |r17.xyzx|, l(5000.000000,5000.000000,5000.000000,0)
and r16.xyz, r13.yyyy, r16.xyzx
lt r17.xyz, r5.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
and r16.xyz, r16.xyzx, r17.xyzx
add r17.xyz, r14.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
div r17.xyz, r17.xyzx, r5.xyzx
movc r15.xyz, r16.xyzx, |r17.xyzx|, r15.xyzx
min r1.x, r15.y, r15.x
min r1.x, r15.z, r1.x
mad r5.xyz, r5.xyzx, r1.xxxx, r14.xyzx
mad r4.w, -r1.x, l(0.000100), l(-1.000000)
lt r14.xyz, r5.xyzx, r4.wwww
mad r1.x, r1.x, l(0.000100), l(1.000000)
lt r15.xyz, r1.xxxx, r5.xyzx
or r1.x, r14.x, r15.x
or r1.x, r14.y, r1.x
or r1.x, r15.y, r1.x
or r1.x, r14.z, r1.x
or r1.x, r15.z, r1.x
mov r5.w, l(1.000000)
dp4 r14.x, r5.xyzw, cb7[18].xyzw
dp4 r14.y, r5.xyzw, cb7[19].xyzw
dp4 r14.z, r5.xyzw, cb7[20].xyzw
add r5.xyz, r14.xyzx, -cb7[9].xyzx
sample_l_indexable(texturecube)(float,float,float,float) r5.xyz, r5.xyzx, t31.xyzw, s8, r8.z
mul r5.xyz, r5.xyzx, cb4[r0.w + 15].wwww
movc r5.xyz, r1.xxxx, l(0,0,0,0), r5.xyzx
sample_l_indexable(texturecube)(float,float,float,float) r14.xyz, r10.xyzx, t31.xyzw, s8, r8.z
mul r14.xyz, r14.xyzx, cb4[r0.w + 15].wwww
movc r5.xyz, r13.yyyy, r5.xyzx, r14.xyzx
add r5.xyz, -r13.xzwx, r5.xyzx
mad r5.xyz, cb4[r0.w + 13].wwww, r5.xyzx, r13.xzwx
mul r5.xyz, r12.xyzx, r5.xyzx
mul r5.xyz, r6.wwww, r5.xyzx
dp3 r0.x, r10.xyzx, r0.xyzx
add_sat r0.x, r0.x, l(1.000000)
mul r0.x, r0.x, r0.x
mul r0.xyz, r0.xxxx, r5.xyzx
mov r3.w, l(1.000000)
dp4 r5.x, r3.xyzw, cb4[r0.w + 8].xyzw
dp4 r5.y, r3.xyzw, cb4[r0.w + 9].xyzw
dp4 r5.z, r3.xyzw, cb4[r0.w + 10].xyzw
max r5.xyz, r5.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mul r5.xyz, r11.xyzx, r5.xyzx
sample_l_indexable(texture2d)(float,float,float,float) r10.xyzw, r8.xyxx, t44.xyzw, s9, r8.z
mul r12.xyz, r6.wwww, r12.xyzx
mul r10.xyz, r10.xyzx, r12.xyzx
add r1.x, -r10.w, l(1.000000)
mad r0.xyz, r0.xyzx, r1.xxxx, r10.xyzx
dp4 r10.x, v7.xyzw, cb8[12].xyzw
dp4 r10.y, v7.xyzw, cb8[13].xyzw
dp4 r10.z, v7.xyzw, cb8[14].xyzw
dp4 r10.w, v7.xyzw, cb8[15].xyzw
div r12.xyz, r10.xyzx, r10.wwww
lt r13.xyz, cb8[54].xyzx, r12.zzzz
and r13.xyz, r13.xyzx, l(1, 1, 1, 0)
iadd r1.x, r13.y, r13.x
iadd r1.x, r13.z, r1.x
ishl r1.x, r1.x, l(2)
dp4 r13.x, r10.xyzw, cb8[r1.x + 38].xyzw
dp4 r13.y, r10.xyzw, cb8[r1.x + 39].xyzw
dp4 r13.z, r10.xyzw, cb8[r1.x + 40].xyzw
dp4 r13.w, r10.xyzw, cb8[r1.x + 41].xyzw
mul r10.xy, r13.wwww, cb8[28].zwzz
mov r10.z, l(0)
add r14.xyzw, r10.xyzz, r13.xyzw
div r14.xyz, r14.xyzx, r14.wwww
sample_c_lz_indexable(texture2d)(float,float,float,float) r14.x, r14.xyxx, t32.xxxx, s12, r14.z
mov r10.w, -r10.x
add r15.xyzw, r10.ywzz, r13.xyzw
div r15.xyz, r15.xyzx, r15.wwww
sample_c_lz_indexable(texture2d)(float,float,float,float) r14.y, r15.xyxx, t32.xxxx, s12, r15.z
mad r15.xyzw, r10.xyzz, l(-1.000000, -1.000000, 1.000000, 1.000000), r13.xyzw
div r15.xyz, r15.xyzx, r15.wwww
sample_c_lz_indexable(texture2d)(float,float,float,float) r14.z, r15.xyxx, t32.xxxx, s12, r15.z
mad r10.xyzw, r10.yxzz, l(-1.000000, 1.000000, 1.000000, 1.000000), r13.xyzw
div r10.xyz, r10.xyzx, r10.wwww
sample_c_lz_indexable(texture2d)(float,float,float,float) r14.w, r10.xyxx, t32.xxxx, s12, r10.z
dp4 r1.x, r14.xyzw, l(0.250000, 0.250000, 0.250000, 0.250000)
add r1.x, -r1.x, l(1.000000)
dp3 r3.w, r12.xyzx, r12.xyzx
sqrt r4.w, r3.w
add r4.w, -r4.w, cb8[28].x
mul_sat r4.w, r4.w, cb8[28].y
mul r10.xyz, r4.wwww, cb8[29].xyzx
mad r10.xyz, -r10.xyzx, r1.xxxx, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r10.xyz, r10.xyzx, cb4[r0.w + 11].xxxx
mul r13.xyz, r10.xyzx, cb5[4].xyzx
dp3 r14.x, cb5[0].xyzx, r3.xyzx
dp3 r14.y, cb5[1].xyzx, r3.xyzx
mov_sat r8.zw, r14.xxxy
mul r15.xyz, r11.xyzx, r8.zzzz
mul r16.xyz, r11.xyzx, r8.wwww
mul r16.xyz, r16.xyzx, cb5[5].xyzx
mad r13.xyz, r13.xyzx, r15.xyzx, r16.xyzx
ult r14.zw, l(0, 0, 0, 0), cb5[16].xxxy
if_nz cb5[16].x
  dp3 r1.x, cb5[2].xyzx, r3.xyzx
  mad r1.x, r1.x, l(0.500000), l(0.500000)
  mul r1.x, r1.x, r1.x
  min r1.x, r1.x, l(1.000000)
  mul r15.xyz, r11.xyzx, r1.xxxx
  mad r13.xyz, cb5[6].xyzx, r15.xyzx, r13.xyzx
endif 
if_nz cb5[16].y
  dp3 r1.x, cb5[3].xyzx, r3.xyzx
  mad r1.x, r1.x, l(0.500000), l(0.500000)
  mul r1.x, r1.x, r1.x
  min r1.x, r1.x, l(1.000000)
  mul r15.xyz, r11.xyzx, r1.xxxx
  mad r13.xyz, cb5[7].xyzx, r15.xyzx, r13.xyzx
endif 
mul r10.xyz, r10.xyzx, cb5[8].xyzx
mad r15.xyz, r7.xyzx, r1.wwww, cb5[0].xyzx
dp3 r1.x, r15.xyzx, r15.xyzx
rsq r1.x, r1.x
mul r15.xyz, r1.xxxx, r15.xyzx
mad r16.xyz, r7.xyzx, r1.wwww, cb5[1].xyzx
dp3 r1.x, r16.xyzx, r16.xyzx
rsq r1.x, r1.x
mul r16.xyz, r1.xxxx, r16.xyzx
dp3_sat r17.x, r15.xyzx, r3.xyzx
dp3_sat r17.y, r16.xyzx, r3.xyzx
mul r1.x, r1.y, cb5[0].w
mad r4.w, r1.y, l(0.010000), cb5[0].w
div r1.x, r1.x, r4.w
max r18.x, r1.x, l(1.000000)
mul r1.x, r1.y, cb5[1].w
mad r4.w, r1.y, l(0.010000), cb5[1].w
div r1.x, r1.x, r4.w
max r18.y, r1.x, l(1.000000)
log r17.xy, r17.xyxx
mul r17.xy, r17.xyxx, r18.xyxx
exp r17.xy, r17.xyxx
dp3_sat r15.x, r6.xyzx, r15.xyzx
dp3_sat r15.y, r6.xyzx, r16.xyzx
add r15.xy, -r15.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r15.zw, r15.xxxy, r15.xxxy
mul r15.zw, r15.zzzw, r15.zzzw
mul r15.xy, r15.zwzz, r15.xyxx
mad r15.xzw, r15.xxxx, r11.xxyz, r4.xxyz
mad r16.xyz, r15.yyyy, r11.xyzx, r4.xyzx
max r14.xy, r7.wwww, r14.xyxx
max r14.xy, r14.xyxx, l(0.000100, 0.000100, 0.000000, 0.000000)
div r8.zw, r8.zzzw, r14.xxxy
mul r15.xyz, r15.xzwx, r17.xxxx
mul r15.xyz, r8.zzzz, r15.xyzx
mul r16.xyz, r16.xyzx, r17.yyyy
mul r16.xyz, r8.wwww, r16.xyzx
mad r8.zw, r18.xxxy, l(0.000000, 0.000000, 0.125000, 0.125000), l(0.000000, 0.000000, 0.250000, 0.250000)
mul r10.xyz, r10.xyzx, r8.zzzz
mul r17.xyz, r8.wwww, cb5[9].xyzx
mul r16.xyz, r16.xyzx, r17.xyzx
mad r10.xyz, r10.xyzx, r15.xyzx, r16.xyzx
dp3 r1.x, r3.xyzx, cb5[2].xyzx
mad r15.xyz, r7.xyzx, r1.wwww, cb5[2].xyzx
dp3 r4.w, r15.xyzx, r15.xyzx
rsq r4.w, r4.w
mul r15.xyz, r4.wwww, r15.xyzx
dp3_sat r4.w, r15.xyzx, r3.xyzx
mul r5.w, r1.y, cb5[2].w
mad r8.z, r1.y, l(0.010000), cb5[2].w
div r5.w, r5.w, r8.z
max r5.w, r5.w, l(1.000000)
log r4.w, r4.w
mul r4.w, r4.w, r5.w
exp r4.w, r4.w
dp3_sat r8.z, r6.xyzx, r15.xyzx
add r8.z, -r8.z, l(1.000000)
mul r8.w, r8.z, r8.z
mul r8.w, r8.w, r8.w
mul r8.z, r8.w, r8.z
mad r15.xyz, r8.zzzz, r11.xyzx, r4.xyzx
mov_sat r8.z, r1.x
max r1.x, r7.w, r1.x
max r1.x, r1.x, l(0.000100)
div r1.x, r8.z, r1.x
mul r15.xyz, r4.wwww, r15.xyzx
mul r15.xyz, r1.xxxx, r15.xyzx
mad r1.x, r5.w, l(0.125000), l(0.250000)
mul r16.xyz, r1.xxxx, cb5[10].xyzx
mad r15.xyz, r16.xyzx, r15.xyzx, r10.xyzx
movc r10.xyz, r14.zzzz, r15.xyzx, r10.xyzx
dp3 r1.x, r3.xyzx, cb5[3].xyzx
mad r14.xyz, r7.xyzx, r1.wwww, cb5[3].xyzx
dp3 r1.w, r14.xyzx, r14.xyzx
rsq r1.w, r1.w
mul r14.xyz, r1.wwww, r14.xyzx
dp3_sat r1.w, r14.xyzx, r3.xyzx
mul r4.w, r1.y, cb5[3].w
mad r5.w, r1.y, l(0.010000), cb5[3].w
div r4.w, r4.w, r5.w
max r4.w, r4.w, l(1.000000)
log r1.w, r1.w
mul r1.w, r1.w, r4.w
exp r1.w, r1.w
dp3_sat r5.w, r6.xyzx, r14.xyzx
add r5.w, -r5.w, l(1.000000)
mul r6.x, r5.w, r5.w
mul r6.x, r6.x, r6.x
mul r5.w, r5.w, r6.x
mad r6.xyz, r5.wwww, r11.xyzx, r4.xyzx
mov_sat r5.w, r1.x
max r1.x, r7.w, r1.x
max r1.x, r1.x, l(0.000100)
div r1.x, r5.w, r1.x
mul r6.xyz, r1.wwww, r6.xyzx
mul r6.xyz, r1.xxxx, r6.xyzx
mad r1.x, r4.w, l(0.125000), l(0.250000)
mul r11.xyz, r1.xxxx, cb5[11].xyzx
mad r6.xyz, r11.xyzx, r6.xyzx, r10.xyzx
movc r6.xyz, r14.wwww, r6.xyzx, r10.xyzx
mul r10.xyz, cb3[1].xyzx, cb9[3].xxxx
if_z cb4[r0.w + 6].y
  dp3 r11.x, r3.xyzx, cb8[5].xyzx
  dp3 r11.y, r3.xyzx, cb8[6].xyzx
  dp3 r11.z, r3.xyzx, cb8[7].xyzx
  mul r1.xw, r8.xxxy, cb8[1].xxxy
  ftou r1.xw, r1.xxxw
  udiv r1.xw, null, r1.xxxw, cb8[56].xxxx
  utof r1.xw, r1.xxxw
  utof r3.x, cb8[56].y
  mad r1.x, r1.w, r3.x, r1.x
  add r1.w, r12.z, -cb8[55].x
  log r1.w, r1.w
  add r1.w, r1.w, -cb8[55].z
  div r1.w, r1.w, cb8[55].y
  max r1.w, r1.w, l(0.000000)
  min r1.w, r1.w, l(14.000000)
  ftou r1.xw, r1.xxxw
  ishl r1.w, l(1), r1.w
  ld_structured_indexable(structured_buffer, stride=12)(mixed,mixed,mixed,mixed) r3.xyz, r1.x, l(0), t60.xyzx
  dp3 r1.x, -r12.xyzx, -r12.xyzx
  rsq r1.x, r1.x
  mul r8.xyz, r1.xxxx, -r12.xyzx
  mov r14.xyz, l(0,0,0,0)
  mov r15.xyz, l(0,0,0,0)
  mov r1.x, r3.x
  mov r4.w, l(0)
  loop 
    uge r5.w, r4.w, r3.y
    breakc_nz r5.w
    ld_structured_indexable(structured_buffer, stride=8)(mixed,mixed,mixed,mixed) r16.xy, r1.x, l(0), t59.xyxx
    iadd r5.w, r1.x, l(1)
    and r7.w, r1.w, r16.y
    iadd r8.w, r4.w, l(1)
    movc r4.w, r7.w, r4.w, r8.w
    mov r1.x, r5.w
    continuec_z r7.w
    ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r17.xyzw, r16.x, l(0), t61.xyzw
    ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r18.xyzw, r16.x, l(16), t61.xyzw
    ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r16.xyz, r16.x, l(32), t61.xyzx
    add r17.xyz, -r12.xyzx, r17.xyzx
    dp3 r7.w, r17.xyzx, r17.xyzx
    rsq r10.w, r7.w
    mul r19.xyz, r10.wwww, r17.xyzx
    dp3_sat r11.w, r11.xyzx, r19.xyzx
    mul_sat r7.w, r17.w, r7.w
    sqrt r7.w, r7.w
    add r7.w, -r7.w, l(1.000000)
    mul r7.w, r7.w, r7.w
    mad r17.xyz, r17.xyzx, r10.wwww, r8.xyzx
    dp3 r10.w, r17.xyzx, r17.xyzx
    rsq r10.w, r10.w
    mul r17.xyz, r10.wwww, r17.xyzx
    mul r10.w, r1.y, r18.w
    mad r13.w, r1.y, l(0.010000), r18.w
    div r10.w, r10.w, r13.w
    max r10.w, r10.w, l(1.000000)
    dp3_sat r13.w, r17.xyzx, r11.xyzx
    log r13.w, r13.w
    mul r13.w, r10.w, r13.w
    exp r13.w, r13.w
    mul r17.xyz, r11.wwww, r18.xyzx
    mul r16.xyz, r13.wwww, r16.xyzx
    log r11.w, r11.w
    mul r11.w, r11.w, l(0.100000)
    exp r11.w, r11.w
    mul r16.xyz, r11.wwww, r16.xyzx
    mul r16.xyz, r7.wwww, r16.xyzx
    mad r10.w, r10.w, l(0.125000), l(0.250000)
    mad r14.xyz, r17.xyzx, r7.wwww, r14.xyzx
    mad r15.xyz, r16.xyzx, r10.wwww, r15.xyzx
    mov r4.w, r8.w
    mov r1.x, r5.w
  endloop 
  rsq r3.x, r3.w
  mul r3.xyw, r3.xxxx, r12.xyxz
  dp3 r4.w, r3.xywx, r11.xyzx
  add r4.w, r4.w, r4.w
  mad r3.xyw, r11.xyxz, -r4.wwww, r3.xyxw
  ushr r3.z, r3.z, l(16)
  mov r12.w, l(1.000000)
  mov r16.zw, l(0,0,1.000000,1.000000)
  mov r17.xyz, r14.xyzx
  mov r18.xyz, r15.xyzx
  mov r4.w, r1.x
  mov r5.w, l(0)
  loop 
    uge r7.w, r5.w, r3.z
    breakc_nz r7.w
    ld_structured_indexable(structured_buffer, stride=8)(mixed,mixed,mixed,mixed) r19.xy, r4.w, l(0), t59.xyxx
    iadd r7.w, r4.w, l(1)
    and r8.w, r1.w, r19.y
    iadd r10.w, r5.w, l(1)
    movc r5.w, r8.w, r5.w, r10.w
    mov r4.w, r7.w
    continuec_z r8.w
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r20.xyzw, r19.x, l(0), t62.xyzw
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r21.xyzw, r19.x, l(16), t62.xyzw
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r19.yzw, r19.x, l(32), t62.xxyz
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r22.xyzw, r19.x, l(60), t62.xyzw
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r23.xyzw, r19.x, l(76), t62.yzwx
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r24.xyzw, r19.x, l(92), t62.yzwx
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r25.xyzw, r19.x, l(108), t62.xyzw
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r26.w, r19.x, l(124), t62.xxxx
    mov r27.xyz, r22.yzwy
    mov r27.w, r23.w
    dp4 r27.x, r12.xyzw, r27.xyzw
    mov r23.w, r24.w
    dp4 r27.y, r12.xyzw, r23.xyzw
    mov r24.w, r25.x
    dp4 r8.w, r12.xyzw, r24.xyzw
    mov r26.xyz, r25.yzwy
    dp4 r11.w, r12.xyzw, r26.xyzw
    lt r8.w, l(0.000000), r8.w
    add r20.xyz, -r12.xyzx, r20.xyzx
    dp3 r13.w, r20.xyzx, r20.xyzx
    rsq r14.w, r13.w
    mul r22.yzw, r14.wwww, r20.xxyz
    lt r15.w, l(0.000000), r22.x
    mul r17.w, r20.w, r20.w
    div r17.w, l(1.000000, 1.000000, 1.000000, 1.000000), r17.w
    div r23.x, l(1.000000, 1.000000, 1.000000, 1.000000), r13.w
    add r18.w, -r17.w, r23.x
    max r23.w, r18.w, l(0.000000)
    dp3_sat r18.w, r22.yzwy, r11.xyzx
    div r24.xy, r27.xyxx, r11.wwww
    dp2 r19.x, r24.xyxx, r24.xyxx
    add r19.x, -r19.x, l(1.000000)
    max r23.y, r19.x, l(0.000000)
    mul r13.w, r13.w, r17.w
    min r13.w, r13.w, l(1.000000)
    add r23.z, -r13.w, l(1.000000)
    div r11.w, r11.w, r20.w
    add_sat r11.w, -r11.w, l(1.000000)
    mul r16.y, r23.y, r23.y
    mul r16.x, r11.w, r11.w
    movc r23.xyzw, r15.wwww, r23.xyzw, r16.xyzw
    mad r20.xyz, r20.xyzx, r14.wwww, r8.xyzx
    dp3 r11.w, r20.xyzx, r20.xyzx
    rsq r11.w, r11.w
    mul r20.xyz, r11.wwww, r20.xyzx
    mul r11.w, r1.y, r21.w
    mad r13.w, r1.y, l(0.010000), r21.w
    div r11.w, r11.w, r13.w
    max r11.w, r11.w, l(1.000000)
    dp3_sat r13.w, r20.xyzx, r11.xyzx
    log r13.w, r13.w
    mul r13.w, r11.w, r13.w
    exp r13.w, r13.w
    mul r20.xyz, r23.wzxw, r23.yyyy
    mul r21.xyz, r18.wwww, r21.xyzx
    mul r23.xyz, r20.xxxx, r21.xyzx
    mul r24.xyz, r13.wwww, r19.yzwy
    log r13.w, r18.w
    mul r13.w, r13.w, l(0.100000)
    exp r13.w, r13.w
    mul r24.xyz, r13.wwww, r24.xyzx
    mul r20.xyw, r20.yyyy, r24.xyxz
    mul r13.w, r11.w, l(0.250000)
    mad r11.w, r11.w, l(0.125000), l(0.250000)
    mul r20.xyw, r11.wwww, r20.xyxw
    dp3_sat r14.w, r22.yzwy, r3.xywx
    log r14.w, r14.w
    mul r13.w, r13.w, r14.w
    exp r13.w, r13.w
    mul r11.w, r11.w, r13.w
    mul r21.xyz, r20.zzzz, r21.xyzx
    mul r19.xyz, r11.wwww, r19.yzwy
    mul r19.xyz, r20.zzzz, r19.xyzx
    movc r21.xyz, r15.wwww, r23.xyzx, r21.xyzx
    movc r19.xyz, r15.wwww, r20.xywx, r19.xyzx
    and r20.xyz, r8.wwww, r21.xyzx
    and r19.xyz, r8.wwww, r19.xyzx
    add r17.xyz, r17.xyzx, r20.xyzx
    add r18.xyz, r18.xyzx, r19.xyzx
    mov r5.w, r10.w
    mov r4.w, r7.w
  endloop 
  mad r1.xyw, -r4.xyxz, l(0.500000, 0.500000, 0.000000, 0.500000), l(1.000000, 1.000000, 0.000000, 1.000000)
  mul r1.xyw, r1.xyxw, r17.xyxz
  mul r3.xyz, r4.xyzx, r18.xyzx
  mad r13.xyz, r1.xywx, r1.zzzz, r13.xyzx
  mad r6.xyz, r3.xyzx, r1.zzzz, r6.xyzx
endif 
mad r1.xy, v5.xyxx, cb1[6].xyxx, cb1[6].zwzz
sample_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyxx, t6.xyzw, s8
mad r3.xy, v5.zwzz, cb1[13].xyxx, cb1[13].zwzz
sample_indexable(texture2d)(float,float,float,float) r3.xyz, r3.xyxx, t13.xyzw, s8
add r3.xyz, -r1.xyzx, r3.xyzx
mad r1.xyz, r2.wwww, r3.xyzx, r1.xyzx
mul r3.xyz, r1.xyzx, cb2[2].xyzx
add r0.xyz, r0.xyzx, r6.xyzx
mad r4.xyz, r5.xyzx, r6.wwww, r13.xyzx
mul r0.xyz, r0.xyzx, r10.xyzx
mad r0.xyz, r2.xyzx, r4.xyzx, r0.xyzx
mad r9.xyz, r1.xyzx, cb2[2].xyzx, r0.xyzx
mul o1.xyz, r3.xyzx, cb3[9].xyzx
mov_sat r0.x, cb3[9].w
mul r1.xyzw, r9.xyzw, cb4[r0.w + 7].xyzw
add r0.y, -r7.y, cb6[3].w
add r0.y, r0.y, -cb6[3].y
mul_sat r0.y, r0.y, cb6[3].z
dp2 r0.z, -r7.xzxx, -r7.xzxx
sqrt r0.z, r0.z
add r0.z, r0.z, -cb6[2].y
mul r0.z, r0.z, cb6[2].z
exp r0.z, -r0.z
mad_sat r0.z, -r0.z, cb6[2].x, cb6[2].x
mul_sat r0.y, r0.y, cb6[3].x
dp3 r0.w, r1.xyzx, l(0.298910, 0.586610, 0.114480, 0.000000)
add r0.w, r0.w, l(-1.000000)
mad r2.x, cb6[1].w, r0.w, l(1.000000)
mad r0.w, cb6[4].w, r0.w, l(1.000000)
mad r2.xyz, cb6[1].xyzx, r2.xxxx, -r1.xyzx
mad r1.xyz, r0.zzzz, r2.xyzx, r1.xyzx
mad r2.xyz, cb6[4].xyzx, r0.wwww, -r1.xyzx
mad o0.xyz, r0.yyyy, r2.xyzx, r1.xyzx
mul o1.w, r0.x, r1.w
mov o0.w, r1.w
ret 
// Approximately 600 instruction slots used

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