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

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

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

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 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_WrapLinear_s : register(s8);
SamplerState SS_ClampLinear_s : register(s9);
Texture2D<float4> MultiBlend4_et1_snp_0_Texture2D_8 : register(t2);
Texture2D<float4> MultiBlend4_et1_snp_0_Texture2D_7 : register(t3);
Texture2D<float4> MultiBlend4_et1_snp_0_Texture2D_6 : register(t4);
Texture2D<float4> MultiBlend4_et1_snp_0_Texture2D_5 : register(t5);
Texture2D<float4> MultiBlend4_et1_snp_0_Texture2D_4 : register(t6);
Texture2D<float4> MultiBlend4_et1_snp_0_Texture2D_3 : register(t7);
Texture2D<float4> MultiBlend4_et1_snp_0_Texture2D_2 : register(t8);
Texture2D<float4> MultiBlend4_et1_snp_0_Texture2D_16 : register(t9);
Texture2D<float4> MultiBlend4_et1_snp_0_Texture2D_15 : register(t10);
Texture2D<float4> MultiBlend4_et1_snp_0_Texture2D_14 : register(t11);
Texture2D<float4> MultiBlend4_et1_snp_0_Texture2D_13 : register(t12);
Texture2D<float4> MultiBlend4_et1_snp_0_Texture2D_1 : register(t16);
Texture2D<float4> MultiBlend4_et1_snp_0_Texture2D_0 : 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);
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 : NORMAL0,
  float4 v2 : TANGENT0,
  float4 v3 : POSITION1,
  float4 v4 : COLOR0,
  float4 v5 : TEXCOORD0,
  float4 v6 : TEXCOORD1,
  uint v7 : SV_ISFRONTFACE0,
  out float4 o0 : SV_TARGET0)
{
// Needs manual fix for instruction: 
// unknown dcl_: dcl_resource_structured t59, 8 
// Needs manual fix for instruction: 
// unknown dcl_: dcl_resource_structured t60, 12 
// Needs manual fix for instruction: 
// unknown dcl_: dcl_resource_structured t61, 64 
// Needs manual fix for instruction: 
// unknown dcl_: dcl_resource_structured t62, 128 
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r16,r17,r18,r19,r20,r21,r22,r23,r24;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyz = v2.yzx * v1.zxy;
  r0.xyz = v1.yzx * v2.zxy + -r0.xyz;
  r0.xyz = v2.www * r0.xyz;
  r0.w = dot(r0.xyz, r0.xyz);
  r0.w = rsqrt(r0.w);
  r0.xyz = r0.xyz * r0.www;
  r0.w = dot(v1.xyz, v1.xyz);
  r0.w = rsqrt(r0.w);
  r1.xyz = v1.xyz * r0.www;
  r0.w = dot(v2.xyz, v2.xyz);
  r0.w = rsqrt(r0.w);
  r2.xyz = v2.xyz * r0.www;
  r1.xyz = v7.xxx ? r1.xyz : -r1.xyz;
  r3.xy = v5.xy * FC_TextureTilingScale[1].xy + FC_TextureTilingScale[1].zw;
  r3.xyz = MultiBlend4_et1_snp_0_Texture2D_1.Sample(SS_DiffuseMap_s, r3.xy).xyz;
  r4.xy = v5.xy * FC_TextureTilingScale[2].xy + FC_TextureTilingScale[2].zw;
  r4.xyz = MultiBlend4_et1_snp_0_Texture2D_2.Sample(SS_DiffuseMap_s, r4.xy).xyz;
  r5.xy = v5.xy * FC_TextureTilingScale[3].xy + FC_TextureTilingScale[3].zw;
  r5.xyz = MultiBlend4_et1_snp_0_Texture2D_3.Sample(SS_DiffuseMap_s, r5.xy).xyz;
  r6.xy = v5.xy * FC_TextureTilingScale[4].xy + FC_TextureTilingScale[4].zw;
  r6.xyz = MultiBlend4_et1_snp_0_Texture2D_4.Sample(SS_DiffuseMap_s, r6.xy).xyz;
  r7.xy = MultiBlend4_et1_snp_0_float_2_0 * v5.xy;
  r7.xy = r7.xy * FC_TextureTilingScale[0].xy + FC_TextureTilingScale[0].zw;
  r0.w = MultiBlend4_et1_snp_0_Texture2D_0.Sample(SS_DiffuseMap_s, r7.xy).x;
  r0.w = 0.00999999978 + r0.w;
  r0.w = MultiBlend4_et1_snp_0_float_0_0 * r0.w;
  r7.xyz = float3(1,1,1) + -v6.xyz;
  r7.xyz = -r0.www * r7.xyz + v6.xyz;
  r0.w = v4.w * MultiBlend4_et1_snp_0_float_1_0 + 1;
  r7.xyz = saturate(r7.xyz * r0.www);
  r4.xyz = r4.xyz + -r3.xyz;
  r3.xyz = r7.xxx * r4.xyz + r3.xyz;
  r4.xyz = r5.xyz + -r3.xyz;
  r3.xyz = r7.yyy * r4.xyz + r3.xyz;
  r4.xyz = r6.xyz + -r3.xyz;
  r3.xyz = r7.zzz * r4.xyz + r3.xyz;
  r4.xy = v5.xy * FC_TextureTilingScale[13].xy + FC_TextureTilingScale[13].zw;
  r4.xyz = MultiBlend4_et1_snp_0_Texture2D_13.Sample(SS_DiffuseMap_s, r4.xy).xyz;
  r5.xy = v5.xy * FC_TextureTilingScale[14].xy + FC_TextureTilingScale[14].zw;
  r5.xyz = MultiBlend4_et1_snp_0_Texture2D_14.Sample(SS_DiffuseMap_s, r5.xy).xyz;
  r6.xy = v5.xy * FC_TextureTilingScale[15].xy + FC_TextureTilingScale[15].zw;
  r6.xyz = MultiBlend4_et1_snp_0_Texture2D_15.Sample(SS_DiffuseMap_s, r6.xy).xyz;
  r8.xy = v5.xy * FC_TextureTilingScale[16].xy + FC_TextureTilingScale[16].zw;
  r8.xyz = MultiBlend4_et1_snp_0_Texture2D_16.Sample(SS_DiffuseMap_s, r8.xy).xyz;
  r5.xyz = r5.xyz + -r4.xyz;
  r4.xyz = r7.xxx * r5.xyz + r4.xyz;
  r5.xyz = r6.xyz + -r4.xyz;
  r4.xyz = r7.yyy * r5.xyz + r4.xyz;
  r5.xyz = r8.xyz + -r4.xyz;
  r4.xyz = r7.zzz * r5.xyz + r4.xyz;
  r4.xy = r4.xy * float2(2,2) + float2(-1,-1);
  r0.w = dot(r4.xy, r4.xy);
  r0.w = min(1, r0.w);
  r0.w = 1 + -r0.w;
  r0.w = sqrt(r0.w);
  r2.xyz = r4.yyy * r2.xyz;
  r0.xyz = r4.xxx * r0.xyz + r2.xyz;
  r0.xyz = r0.www * r1.xyz + r0.xyz;
  r0.w = dot(r0.xyz, r0.xyz);
  r0.w = rsqrt(r0.w);
  r0.xyz = r0.xyz * r0.www;
  r2.xy = v5.xy * FC_TextureTilingScale[5].xy + FC_TextureTilingScale[5].zw;
  r2.xyz = MultiBlend4_et1_snp_0_Texture2D_5.Sample(SS_DiffuseMap_s, r2.xy).xyz;
  r4.xy = v5.xy * FC_TextureTilingScale[6].xy + FC_TextureTilingScale[6].zw;
  r4.xyw = MultiBlend4_et1_snp_0_Texture2D_6.Sample(SS_DiffuseMap_s, r4.xy).xyz;
  r5.xy = v5.xy * FC_TextureTilingScale[7].xy + FC_TextureTilingScale[7].zw;
  r5.xyz = MultiBlend4_et1_snp_0_Texture2D_7.Sample(SS_DiffuseMap_s, r5.xy).xyz;
  r6.xy = v5.xy * FC_TextureTilingScale[8].xy + FC_TextureTilingScale[8].zw;
  r6.xyz = MultiBlend4_et1_snp_0_Texture2D_8.Sample(SS_DiffuseMap_s, r6.xy).xyz;
  r4.xyw = r4.xyw + -r2.xyz;
  r2.xyz = r7.xxx * r4.xyw + r2.xyz;
  r4.xyw = r5.xyz + -r2.xyz;
  r2.xyz = r7.yyy * r4.xyw + r2.xyz;
  r4.xyw = r6.xyz + -r2.xyz;
  r2.xyz = r7.zzz * r4.xyw + r2.xyz;
  r1.w = round(v1.w);
  r1.w = (uint)r1.w;
  r5.x = dot(v3.xyzw, FC_MatrixInvViewProj._m00_m10_m20_m30);
  r5.y = dot(v3.xyzw, FC_MatrixInvViewProj._m01_m11_m21_m31);
  r5.z = dot(v3.xyzw, FC_MatrixInvViewProj._m02_m12_m22_m32);
  r2.w = dot(v3.xyzw, FC_MatrixInvViewProj._m03_m13_m23_m33);
  r4.xyw = r5.xyz / r2.www;
  r6.x = FC_MatrixInvView._m30 + -r4.x;
  r6.y = FC_MatrixInvView._m31 + -r4.y;
  r6.z = FC_MatrixInvView._m32 + -r4.w;
  r2.w = dot(r6.xyz, r6.xyz);
  r2.w = rsqrt(r2.w);
  r4.xyw = r6.xyz * r2.www;
  r7.xy = FC_ScreenSize.zw * v0.xy;
  r3.w = 13 * r4.z;
  r3.w = exp2(r3.w);
  r6.w = g_SSAOTexture.Sample(SS_WrapLinear_s, r7.xy).x;
  r7.z = dot(r0.xyz, r4.xyw);
  r7.w = r7.z + r6.w;
  r7.w = r7.w * r7.w + -1;
  r7.w = saturate(r7.w + r6.w);
  r8.x = saturate(r7.z);
  r8.x = 1 + -r8.x;
  r8.y = r7.z + r7.z;
  r8.yzw = r8.yyy * r0.xyz + -r4.xyw;
  r9.x = r8.x * r8.x;
  r9.x = r9.x * r9.x;
  r8.x = r9.x * r8.x;
  r7.w = r8.x * r7.w;
  r8.x = -r4.z * 6.5 + 6.5;
  r8.x = min(6, r8.x);
  r9.xyz = float3(1,1,1) + -r2.xyz;
  r10.xyz = r9.xyz * r7.www;
  r4.z = r4.z * r4.z;
  r10.xyz = r10.xyz * r4.zzz + r2.xyz;
  r1.w = (int)r1.w * 17;
  r11.xy = cmp(float2(0,0) < FC_ParallaxCorrectedCubemapObbAEnable);
  r5.w = 1;
  r12.x = dot(r5.xyzw, FC_ParallaxCorrectedCubemapInvObbA._m00_m10_m20_m30);
  r12.y = dot(r5.xyzw, FC_ParallaxCorrectedCubemapInvObbA._m01_m11_m21_m31);
  r12.z = dot(r5.xyzw, FC_ParallaxCorrectedCubemapInvObbA._m02_m12_m22_m32);
  r13.x = dot(r8.yzw, FC_ParallaxCorrectedCubemapInvObbA._m00_m10_m20);
  r13.y = dot(r8.yzw, FC_ParallaxCorrectedCubemapInvObbA._m01_m11_m21);
  r13.z = dot(r8.yzw, FC_ParallaxCorrectedCubemapInvObbA._m02_m12_m22);
  r14.xyz = cmp(float3(0,0,0) < r13.xyz);
  r15.xyz = ~(int3)r14.xyz;
  r14.xyz = r11.xxx ? r14.xyz : 0;
  r16.xyz = float3(1,1,1) + -r12.xyz;
  r16.xyz = r16.xyz / r13.xyz;
  r14.xyz = r14.xyz ? abs(r16.xyz) : float3(5000,5000,5000);
  r15.xyz = r11.xxx ? r15.xyz : 0;
  r16.xyz = cmp(r13.xyz < float3(0,0,0));
  r15.xyz = r16.xyz ? r15.xyz : 0;
  r16.xyz = float3(1,1,1) + r12.xyz;
  r16.xyz = r16.xyz / r13.xyz;
  r14.xyz = r15.xyz ? abs(r16.xyz) : r14.xyz;
  r4.z = min(r14.x, r14.y);
  r4.z = min(r4.z, r14.z);
  r12.xyz = r13.xyz * r4.zzz + r12.xyz;
  r7.w = -r4.z * 9.99999975e-005 + -1;
  r13.xyz = cmp(r12.xyz < r7.www);
  r4.z = r4.z * 9.99999975e-005 + 1;
  r14.xyz = cmp(r4.zzz < r12.xyz);
  r4.z = (int)r13.x | (int)r14.x;
  r4.z = (int)r13.y | (int)r4.z;
  r4.z = (int)r14.y | (int)r4.z;
  r4.z = (int)r13.z | (int)r4.z;
  r4.z = (int)r14.z | (int)r4.z;
  r12.w = 1;
  r13.x = dot(r12.xyzw, FC_ParallaxCorrectedCubemapObbA._m00_m10_m20_m30);
  r13.y = dot(r12.xyzw, FC_ParallaxCorrectedCubemapObbA._m01_m11_m21_m31);
  r13.z = dot(r12.xyzw, FC_ParallaxCorrectedCubemapObbA._m02_m12_m22_m32);
  r12.xyz = -FC_ParallaxCorrectedCubemapOriginA.xyz + r13.xyz;
  r12.xyz = g_IBLTexture.SampleLevel(SS_WrapLinear_s, r12.xyz, r8.x).xyz;
  r12.xyz = VC_InstanceData[r1.w].parallaxCorrectedCubemapAabbMin_envMapColorScale0.www * r12.xyz;
  r12.xyz = r4.zzz ? float3(0,0,0) : r12.xyz;
  r13.xyz = g_IBLTexture.SampleLevel(SS_WrapLinear_s, r8.yzw, r8.x).xyz;
  r13.xyz = VC_InstanceData[r1.w].parallaxCorrectedCubemapAabbMin_envMapColorScale0.www * r13.xyz;
  r11.xzw = r11.xxx ? r12.xyz : r13.xyz;
  r12.x = dot(r5.xyzw, FC_ParallaxCorrectedCubemapInvObbB._m00_m10_m20_m30);
  r12.y = dot(r5.xyzw, FC_ParallaxCorrectedCubemapInvObbB._m01_m11_m21_m31);
  r12.z = dot(r5.xyzw, FC_ParallaxCorrectedCubemapInvObbB._m02_m12_m22_m32);
  r5.x = dot(r8.yzw, FC_ParallaxCorrectedCubemapInvObbB._m00_m10_m20);
  r5.y = dot(r8.yzw, FC_ParallaxCorrectedCubemapInvObbB._m01_m11_m21);
  r5.z = dot(r8.yzw, FC_ParallaxCorrectedCubemapInvObbB._m02_m12_m22);
  r13.xyz = cmp(float3(0,0,0) < r5.xyz);
  r14.xyz = ~(int3)r13.xyz;
  r13.xyz = r11.yyy ? r13.xyz : 0;
  r15.xyz = float3(1,1,1) + -r12.xyz;
  r15.xyz = r15.xyz / r5.xyz;
  r13.xyz = r13.xyz ? abs(r15.xyz) : float3(5000,5000,5000);
  r14.xyz = r11.yyy ? r14.xyz : 0;
  r15.xyz = cmp(r5.xyz < float3(0,0,0));
  r14.xyz = r14.xyz ? r15.xyz : 0;
  r15.xyz = float3(1,1,1) + r12.xyz;
  r15.xyz = r15.xyz / r5.xyz;
  r13.xyz = r14.xyz ? abs(r15.xyz) : r13.xyz;
  r4.z = min(r13.x, r13.y);
  r4.z = min(r4.z, r13.z);
  r5.xyz = r5.xyz * r4.zzz + r12.xyz;
  r7.w = -r4.z * 9.99999975e-005 + -1;
  r12.xyz = cmp(r5.xyz < r7.www);
  r4.z = r4.z * 9.99999975e-005 + 1;
  r13.xyz = cmp(r4.zzz < r5.xyz);
  r4.z = (int)r12.x | (int)r13.x;
  r4.z = (int)r12.y | (int)r4.z;
  r4.z = (int)r13.y | (int)r4.z;
  r4.z = (int)r12.z | (int)r4.z;
  r4.z = (int)r13.z | (int)r4.z;
  r5.w = 1;
  r12.x = dot(r5.xyzw, FC_ParallaxCorrectedCubemapObbB._m00_m10_m20_m30);
  r12.y = dot(r5.xyzw, FC_ParallaxCorrectedCubemapObbB._m01_m11_m21_m31);
  r12.z = dot(r5.xyzw, FC_ParallaxCorrectedCubemapObbB._m02_m12_m22_m32);
  r5.xyz = -FC_ParallaxCorrectedCubemapOriginB.xyz + r12.xyz;
  r5.xyz = g_IBLTexture2.SampleLevel(SS_WrapLinear_s, r5.xyz, r8.x).xyz;
  r5.xyz = VC_InstanceData[r1.w].parallaxCorrectedCubemapAabbMax_envMapColorScale1.www * r5.xyz;
  r5.xyz = r4.zzz ? float3(0,0,0) : r5.xyz;
  r12.xyz = g_IBLTexture2.SampleLevel(SS_WrapLinear_s, r8.yzw, r8.x).xyz;
  r12.xyz = VC_InstanceData[r1.w].parallaxCorrectedCubemapAabbMax_envMapColorScale1.www * r12.xyz;
  r5.xyz = r11.yyy ? r5.xyz : r12.xyz;
  r5.xyz = r5.xyz + -r11.xzw;
  r5.xyz = VC_InstanceData[r1.w].parallaxCorrectedCubemapOrigin_envMapInterpRatio.www * r5.xyz + r11.xzw;
  r5.xyz = r5.xyz * r10.xyz;
  r5.xyz = r5.xyz * r6.www;
  r1.x = dot(r8.yzw, r1.xyz);
  r1.x = saturate(1 + r1.x);
  r1.x = r1.x * r1.x;
  r1.xyz = r5.xyz * r1.xxx;
  r0.w = 1;
  r5.x = dot(r0.xyzw, VC_InstanceData[r1.w].aSh[0].xyzw);
  r5.y = dot(r0.xyzw, VC_InstanceData[r1.w].aSh[1].xyzw);
  r5.z = dot(r0.xyzw, VC_InstanceData[r1.w].aSh[2].xyzw);
  r5.xyz = max(float3(0,0,0), r5.xyz);
  r5.xyz = r5.xyz * r9.xyz;
  r8.xyzw = g_RLRTexture.SampleLevel(SS_ClampLinear_s, r7.xy, r8.x).xyzw;
  r10.xyz = r10.xyz * r6.www;
  r8.xyz = r10.xyz * r8.xyz;
  r0.w = 1 + -r8.w;
  r1.xyz = r1.xyz * r0.www + r8.xyz;
  r0.w = g_ShadowTexture.Sample(SS_WrapLinear_s, r7.xy).w;
  r8.xyz = -FC_ShadowColor.xyz + float3(1,1,1);
  r10.xyz = float3(1,1,1) + -r8.xyz;
  r8.xyz = r0.www * r10.xyz + r8.xyz;
  r8.xyz = VC_InstanceData[r1.w].ShLightMask.xxx * r8.xyz;
  r10.xyz = FC_DirLightCol_0.xyz * r8.xyz;
  r11.x = dot(FC_DirLightVec_0.xyz, r0.xyz);
  r11.y = dot(FC_DirLightVec_1.xyz, r0.xyz);
  r11.zw = saturate(r11.xy);
  r12.xyz = r11.zzz * r9.xyz;
  r13.xyz = r11.www * r9.xyz;
  r13.xyz = FC_DirLightCol_1.xyz * r13.xyz;
  r10.xyz = r10.xyz * r12.xyz + r13.xyz;
  r12.xy = cmp(int2(0,0) < (uint2)FC_bLocalLight.xy);
  if (FC_bLocalLight.x != 0) {
    r0.w = dot(FC_DirLightVec_2.xyz, r0.xyz);
    r0.w = r0.w * 0.5 + 0.5;
    r0.w = r0.w * r0.w;
    r0.w = min(1, r0.w);
    r13.xyz = r0.www * r9.xyz;
    r10.xyz = FC_DirLightCol_2.xyz * r13.xyz + r10.xyz;
  }
  if (FC_bLocalLight.y != 0) {
    r0.w = dot(FC_DirLightVec_3.xyz, r0.xyz);
    r0.w = r0.w * 0.5 + 0.5;
    r0.w = r0.w * r0.w;
    r0.w = min(1, r0.w);
    r13.xyz = r0.www * r9.xyz;
    r10.xyz = FC_DirLightCol_3.xyz * r13.xyz + r10.xyz;
  }
  r8.xyz = FC_DirLightSpc_0.xyz * r8.xyz;
  r13.xyz = r6.xyz * r2.www + FC_DirLightVec_0.xyz;
  r0.w = dot(r13.xyz, r13.xyz);
  r0.w = rsqrt(r0.w);
  r13.xyz = r13.xyz * r0.www;
  r14.xyz = r6.xyz * r2.www + FC_DirLightVec_1.xyz;
  r0.w = dot(r14.xyz, r14.xyz);
  r0.w = rsqrt(r0.w);
  r14.xyz = r14.xyz * r0.www;
  r15.x = saturate(dot(r13.xyz, r0.xyz));
  r15.y = saturate(dot(r14.xyz, r0.xyz));
  r0.w = FC_DirLightVec_0.w * r3.w;
  r4.z = r3.w * 0.00999999978 + FC_DirLightVec_0.w;
  r0.w = r0.w / r4.z;
  r16.x = max(1, r0.w);
  r0.w = FC_DirLightVec_1.w * r3.w;
  r4.z = r3.w * 0.00999999978 + FC_DirLightVec_1.w;
  r0.w = r0.w / r4.z;
  r16.y = max(1, r0.w);
  r12.zw = log2(r15.xy);
  r12.zw = r16.xy * r12.zw;
  r12.zw = exp2(r12.zw);
  r13.x = saturate(dot(r4.xyw, r13.xyz));
  r13.y = saturate(dot(r4.xyw, r14.xyz));
  r13.xy = float2(1,1) + -r13.xy;
  r13.zw = r13.xy * r13.xy;
  r13.zw = r13.zw * r13.zw;
  r13.xy = r13.xy * r13.zw;
  r13.xzw = r13.xxx * r9.xyz + r2.xyz;
  r14.xyz = r13.yyy * r9.xyz + r2.xyz;
  r11.xy = max(r11.xy, r7.zz);
  r11.xy = max(float2(9.99999975e-005,9.99999975e-005), r11.xy);
  r11.xy = r11.zw / r11.xy;
  r13.xyz = r13.xzw * r12.zzz;
  r11.xzw = r13.xyz * r11.xxx;
  r13.xyz = r14.xyz * r12.www;
  r13.xyz = r13.xyz * r11.yyy;
  r12.zw = r16.xy * float2(0.125,0.125) + float2(0.25,0.25);
  r8.xyz = r12.zzz * r8.xyz;
  r14.xyz = FC_DirLightSpc_1.xyz * r12.www;
  r13.xyz = r14.xyz * r13.xyz;
  r8.xyz = r8.xyz * r11.xzw + r13.xyz;
  r0.w = dot(r0.xyz, FC_DirLightVec_2.xyz);
  r11.xyz = r6.xyz * r2.www + FC_DirLightVec_2.xyz;
  r4.z = dot(r11.xyz, r11.xyz);
  r4.z = rsqrt(r4.z);
  r11.xyz = r11.xyz * r4.zzz;
  r4.z = saturate(dot(r11.xyz, r0.xyz));
  r5.w = FC_DirLightVec_2.w * r3.w;
  r7.w = r3.w * 0.00999999978 + FC_DirLightVec_2.w;
  r5.w = r5.w / r7.w;
  r5.w = max(1, r5.w);
  r4.z = log2(r4.z);
  r4.z = r5.w * r4.z;
  r4.z = exp2(r4.z);
  r7.w = saturate(dot(r4.xyw, r11.xyz));
  r7.w = 1 + -r7.w;
  r8.w = r7.w * r7.w;
  r8.w = r8.w * r8.w;
  r7.w = r8.w * r7.w;
  r11.xyz = r7.www * r9.xyz + r2.xyz;
  r7.w = saturate(r0.w);
  r0.w = max(r0.w, r7.z);
  r0.w = max(9.99999975e-005, r0.w);
  r0.w = r7.w / r0.w;
  r11.xyz = r11.xyz * r4.zzz;
  r11.xyz = r11.xyz * r0.www;
  r0.w = r5.w * 0.125 + 0.25;
  r13.xyz = FC_DirLightSpc_2.xyz * r0.www;
  r11.xyz = r13.xyz * r11.xyz + r8.xyz;
  r8.xyz = r12.xxx ? r11.xyz : r8.xyz;
  r0.w = dot(r0.xyz, FC_DirLightVec_3.xyz);
  r11.xyz = r6.xyz * r2.www + FC_DirLightVec_3.xyz;
  r2.w = dot(r11.xyz, r11.xyz);
  r2.w = rsqrt(r2.w);
  r11.xyz = r11.xyz * r2.www;
  r2.w = saturate(dot(r11.xyz, r0.xyz));
  r4.z = FC_DirLightVec_3.w * r3.w;
  r5.w = r3.w * 0.00999999978 + FC_DirLightVec_3.w;
  r4.z = r4.z / r5.w;
  r4.z = max(1, r4.z);
  r2.w = log2(r2.w);
  r2.w = r4.z * r2.w;
  r2.w = exp2(r2.w);
  r4.x = saturate(dot(r4.xyw, r11.xyz));
  r4.x = 1 + -r4.x;
  r4.y = r4.x * r4.x;
  r4.y = r4.y * r4.y;
  r4.x = r4.x * r4.y;
  r4.xyw = r4.xxx * r9.xyz + r2.xyz;
  r5.w = saturate(r0.w);
  r0.w = max(r0.w, r7.z);
  r0.w = max(9.99999975e-005, r0.w);
  r0.w = r5.w / r0.w;
  r4.xyw = r4.xyw * r2.www;
  r4.xyw = r4.xyw * r0.www;
  r0.w = r4.z * 0.125 + 0.25;
  r9.xyz = FC_DirLightSpc_3.xyz * r0.www;
  r4.xyz = r9.xyz * r4.xyw + r8.xyz;
  r4.xyz = r12.yyy ? r4.xyz : r8.xyz;
  if (VC_InstanceData[r1.w].dynamicLightDisable == 0) {
    r8.x = dot(r0.xyz, FC_MatrixView._m00_m10_m20);
    r8.y = dot(r0.xyz, FC_MatrixView._m01_m11_m21);
    r8.z = dot(r0.xyz, FC_MatrixView._m02_m12_m22);
    r0.x = dot(v3.xyzw, FC_MatrixInvProj._m00_m10_m20_m30);
    r0.y = dot(v3.xyzw, FC_MatrixInvProj._m01_m11_m21_m31);
    r0.z = dot(v3.xyzw, FC_MatrixInvProj._m02_m12_m22_m32);
    r0.w = dot(v3.xyzw, FC_MatrixInvProj._m03_m13_m23_m33);
    r0.xyz = r0.xyz / r0.www;
    r7.xy = FC_ScreenSize.xy * r7.xy;
    r7.xy = (uint2)r7.xy;
    uiDest.xy = (uint2)r7.xy / FC_LightTile_Width;
    r7.xy = uiDest.xy;
    r7.xy = (uint2)r7.xy;
    r2.w = FC_LightTile_NumCellX;
    r2.w = r7.y * r2.w + r7.x;
    r2.w = (uint)r2.w;
    r4.w = -FC_FrustumNear + r0.z;
    r4.w = log2(r4.w);
    r4.w = -FC_FrustumSliceBias + r4.w;
    r4.w = r4.w / FC_FrustumSliceScale;
    r4.w = max(0, r4.w);
    r4.w = min(14, r4.w);
    r4.w = (uint)r4.w;
    r4.w = 1 << (int)r4.w;
  // Known bad code for instruction (needs manual fix):
    ld_structured_indexable(structured_buffer, stride=12)(mixed,mixed,mixed,mixed) r7.xyz, r2.w, l(0), t60.xyzx
  r7.x = SS_DiffuseMap[]..swiz;
  r7.y = SS_DiffuseMap[]..swiz;
  r7.z = SS_DiffuseMap[]..swiz;
    r2.w = dot(-r0.xyz, -r0.xyz);
    r2.w = rsqrt(r2.w);
    r9.xyz = r2.www * -r0.xyz;
    r11.xyz = float3(0,0,0);
    r12.xyz = float3(0,0,0);
    r2.w = r7.x;
    r5.w = 0;
    while (true) {
      r7.w = cmp((uint)r5.w >= (uint)r7.y);
      if (r7.w != 0) break;
    // Known bad code for instruction (needs manual fix):
        ld_structured_indexable(structured_buffer, stride=8)(mixed,mixed,mixed,mixed) r13.xy, r2.w, l(0), t59.xyxx
    r13.x = SS_DiffuseMap[]..swiz;
    r13.y = SS_DiffuseMap[]..swiz;
      r7.w = (int)r2.w + 1;
      r8.w = (int)r4.w & (int)r13.y;
      r9.w = (int)r5.w + 1;
      r5.w = r8.w ? r5.w : r9.w;
      r2.w = r7.w;
      if (r8.w == 0) continue;
    // Known bad code for instruction (needs manual fix):
        ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r14.xyzw, r13.x, l(0), t61.xyzw
    r14.x = SS_DiffuseMap[]..swiz;
    r14.y = SS_DiffuseMap[]..swiz;
    r14.z = SS_DiffuseMap[]..swiz;
    r14.w = SS_DiffuseMap[]..swiz;
    // Known bad code for instruction (needs manual fix):
        ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r15.xyzw, r13.x, l(16), t61.xyzw
    r15.x = SS_DiffuseMap[]..swiz;
    r15.y = SS_DiffuseMap[]..swiz;
    r15.z = SS_DiffuseMap[]..swiz;
    r15.w = SS_DiffuseMap[]..swiz;
    // Known bad code for instruction (needs manual fix):
        ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r13.xyz, r13.x, l(32), t61.xyzx
    r13.x = SS_DiffuseMap[]..swiz;
    r13.y = SS_DiffuseMap[]..swiz;
    r13.z = SS_DiffuseMap[]..swiz;
      r14.xyz = r14.xyz + -r0.xyz;
      r8.w = dot(r14.xyz, r14.xyz);
      r10.w = rsqrt(r8.w);
      r16.xyz = r14.xyz * r10.www;
      r11.w = saturate(dot(r8.xyz, r16.xyz));
      r8.w = saturate(r8.w * r14.w);
      r8.w = sqrt(r8.w);
      r8.w = 1 + -r8.w;
      r8.w = r8.w * r8.w;
      r14.xyz = r14.xyz * r10.www + r9.xyz;
      r10.w = dot(r14.xyz, r14.xyz);
      r10.w = rsqrt(r10.w);
      r14.xyz = r14.xyz * r10.www;
      r10.w = r15.w * r3.w;
      r12.w = r3.w * 0.00999999978 + r15.w;
      r10.w = r10.w / r12.w;
      r10.w = max(1, r10.w);
      r12.w = saturate(dot(r14.xyz, r8.xyz));
      r12.w = log2(r12.w);
      r12.w = r12.w * r10.w;
      r12.w = exp2(r12.w);
      r14.xyz = r15.xyz * r11.www;
      r13.xyz = r13.xyz * r12.www;
      r11.w = log2(r11.w);
      r11.w = 0.100000001 * r11.w;
      r11.w = exp2(r11.w);
      r13.xyz = r13.xyz * r11.www;
      r13.xyz = r13.xyz * r8.www;
      r10.w = r10.w * 0.125 + 0.25;
      r11.xyz = r14.xyz * r8.www + r11.xyz;
      r12.xyz = r13.xyz * r10.www + r12.xyz;
      r5.w = r9.w;
      r2.w = r7.w;
    }
    r5.w = dot(r0.xyz, r0.xyz);
    r5.w = rsqrt(r5.w);
    r7.xyw = r5.www * r0.xyz;
    r5.w = dot(r7.xyw, r8.xyz);
    r5.w = r5.w + r5.w;
    r7.xyw = r8.xyz * -r5.www + r7.xyw;
    r5.w = (uint)r7.z >> 16;
    r0.w = 1;
    r13.zw = float2(1,1);
    r14.xyz = r11.xyz;
    r15.xyz = r12.xyz;
    r7.z = r2.w;
    r8.w = 0;
    while (true) {
      r9.w = cmp((uint)r8.w >= (uint)r5.w);
      if (r9.w != 0) break;
    // Known bad code for instruction (needs manual fix):
        ld_structured_indexable(structured_buffer, stride=8)(mixed,mixed,mixed,mixed) r16.xy, r7.z, l(0), t59.xyxx
    r16.x = SS_DiffuseMap[]..swiz;
    r16.y = SS_DiffuseMap[]..swiz;
      r9.w = (int)r7.z + 1;
      r10.w = (int)r4.w & (int)r16.y;
      r11.w = (int)r8.w + 1;
      r8.w = r10.w ? r8.w : r11.w;
      r7.z = r9.w;
      if (r10.w == 0) continue;
    // Known bad code for instruction (needs manual fix):
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r17.xyzw, r16.x, l(0), t62.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=128)(mixed,mixed,mixed,mixed) r18.xyzw, r16.x, l(16), t62.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=128)(mixed,mixed,mixed,mixed) r16.yzw, r16.x, l(32), t62.xxyz
    r16.y = SS_DiffuseMap[]..swiz;
    r16.z = SS_DiffuseMap[]..swiz;
    r16.w = SS_DiffuseMap[]..swiz;
    // Known bad code for instruction (needs manual fix):
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r19.xyzw, r16.x, l(60), t62.xyzw
    r19.x = SS_DiffuseMap[]..swiz;
    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) r20.xyzw, r16.x, l(76), t62.yzwx
    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, r16.x, l(92), t62.yzwx
    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) r22.xyzw, r16.x, l(108), 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.w, r16.x, l(124), t62.xxxx
    r23.w = SS_DiffuseMap[]..swiz;
      r24.xyz = r19.yzw;
      r24.w = r20.w;
      r24.x = dot(r0.xyzw, r24.xyzw);
      r20.w = r21.w;
      r24.y = dot(r0.xyzw, r20.xyzw);
      r21.w = r22.x;
      r10.w = dot(r0.xyzw, r21.xyzw);
      r23.xyz = r22.yzw;
      r12.w = dot(r0.xyzw, r23.xyzw);
      r10.w = cmp(0 < r10.w);
      r17.xyz = r17.xyz + -r0.xyz;
      r14.w = dot(r17.xyz, r17.xyz);
      r15.w = rsqrt(r14.w);
      r19.yzw = r17.xyz * r15.www;
      r16.x = cmp(0 < r19.x);
      r19.x = r17.w * r17.w;
      r19.x = 1 / r19.x;
      r20.x = 1 / r14.w;
      r21.x = r20.x + -r19.x;
      r20.w = max(0, r21.x);
      r21.x = saturate(dot(r19.yzw, r8.xyz));
      r21.yz = r24.xy / r12.ww;
      r21.y = dot(r21.yz, r21.yz);
      r21.y = 1 + -r21.y;
      r20.y = max(0, r21.y);
      r14.w = r19.x * r14.w;
      r14.w = min(1, r14.w);
      r20.z = 1 + -r14.w;
      r12.w = r12.w / r17.w;
      r12.w = saturate(1 + -r12.w);
      r13.y = r20.y * r20.y;
      r13.x = r12.w * r12.w;
      r20.xyzw = r16.xxxx ? r20.xyzw : r13.xyzw;
      r17.xyz = r17.xyz * r15.www + r9.xyz;
      r12.w = dot(r17.xyz, r17.xyz);
      r12.w = rsqrt(r12.w);
      r17.xyz = r17.xyz * r12.www;
      r12.w = r18.w * r3.w;
      r13.x = r3.w * 0.00999999978 + r18.w;
      r12.w = r12.w / r13.x;
      r12.w = max(1, r12.w);
      r13.x = saturate(dot(r17.xyz, r8.xyz));
      r13.x = log2(r13.x);
      r13.x = r13.x * r12.w;
      r13.x = exp2(r13.x);
      r17.xyz = r20.yyy * r20.wzx;
      r18.xyz = r21.xxx * r18.xyz;
      r20.xyz = r18.xyz * r17.xxx;
      r21.yzw = r16.yzw * r13.xxx;
      r13.x = log2(r21.x);
      r13.x = 0.100000001 * r13.x;
      r13.x = exp2(r13.x);
      r21.xyz = r21.yzw * r13.xxx;
      r17.xyw = r21.xyz * r17.yyy;
      r13.x = 0.25 * r12.w;
      r12.w = r12.w * 0.125 + 0.25;
      r17.xyw = r17.xyw * r12.www;
      r13.y = saturate(dot(r19.yzw, r7.xyw));
      r13.y = log2(r13.y);
      r13.x = r13.x * r13.y;
      r13.x = exp2(r13.x);
      r12.w = r13.x * r12.w;
      r18.xyz = r18.xyz * r17.zzz;
      r16.yzw = r16.yzw * r12.www;
      r16.yzw = r16.yzw * r17.zzz;
      r18.xyz = r16.xxx ? r20.xyz : r18.xyz;
      r16.xyz = r16.xxx ? r17.xyw : r16.yzw;
      r17.xyz = r10.www ? r18.xyz : 0;
      r16.xyz = r10.www ? r16.xyz : 0;
      r14.xyz = r17.xyz + r14.xyz;
      r15.xyz = r16.xyz + r15.xyz;
      r8.w = r11.w;
      r7.z = r9.w;
    }
    r0.xyz = -r2.xyz * float3(0.5,0.5,0.5) + float3(1,1,1);
    r0.xyz = r14.xyz * r0.xyz;
    r2.xyz = r15.xyz * r2.xyz;
    r10.xyz = r0.xyz * r6.www + r10.xyz;
    r4.xyz = r2.xyz * r6.www + r4.xyz;
  }
  r0.xyz = r4.xyz + r1.xyz;
  r1.xyz = r5.xyz * r6.www + r10.xyz;
  r0.xyz = r3.xyz * r1.xyz + r0.xyz;
  r0.xyz = VC_InstanceData[r1.w].mulCol.xyz * r0.xyz;
  r0.w = FC_HeightFogParam.w + -r6.y;
  r0.w = -FC_HeightFogParam.y + r0.w;
  r0.w = saturate(FC_HeightFogParam.z * r0.w);
  r1.x = dot(-r6.xz, -r6.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[r1.w].mulCol.w;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//
// Buffer Definitions: 
//
// cbuffer cbTextureTilingScale
// {
//
//   float4 FC_TextureTilingScale[25];  // Offset:    0 Size:   400
//
// }
//
// cbuffer cbMatDynParam
// {
//
//   bool FC_isDitherAlpha;             // Offset:    0 Size:     4 [unused]
//   float FC_TranslucencyScale;        // Offset:   16 Size:     4 [unused]
//   float4 FC_EmissiveColor;           // Offset:   32 Size:    16 [unused]
//   float4 FC_BlendMaskParam;          // Offset:   48 Size:    16 [unused]
//   float FC_PomHeightScale;           // Offset:   64 Size:     4 [unused]
//   float FC_PomHeightBias;            // Offset:   68 Size:     4 [unused]
//   float FC_PomMinSamples;            // Offset:   72 Size:     4 [unused]
//   float FC_PomMaxSamples;            // Offset:   76 Size:     4 [unused]
//   float FC_PomShadowSoftening;       // Offset:   80 Size:     4 [unused]
//   bool FC_bPomDisplayShadows;        // Offset:   84 Size:     4 [unused]
//   float4 FC_ParallaxParam;           // Offset:   96 Size:    16 [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]
//   float MultiBlend4_et1_snp_0_float_0_0;// Offset:  624 Size:     4
//   float MultiBlend4_et1_snp_0_float_1_0;// Offset:  628 Size:     4
//   float MultiBlend4_et1_snp_0_float_2_0;// Offset:  632 Size:     4
//
// }
//
// 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 [unused]
//   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 [unused]
//   float4 FC_CascadeSelectDist;       // Offset:  864 Size:    16 [unused]
//   float FC_FrustumNear;              // Offset:  880 Size:     4
//   float FC_FrustumSliceScale;        // Offset:  884 Size:     4
//   float FC_FrustumSliceBias;         // Offset:  888 Size:     4
//   uint FC_LightTile_Width;           // Offset:  896 Size:     4
//   uint FC_LightTile_NumCellX;        // Offset:  900 Size:     4
//   float4 FC_CloudShadowParam0;       // Offset:  912 Size:    16 [unused]
//   float4 FC_CloudShadowParam1;       // Offset:  928 Size:    16 [unused]
//   float FC_ShadowScale0;             // Offset:  944 Size:     4 [unused]
//   float FC_ShadowScale1;             // Offset:  948 Size:     4 [unused]
//
// }
//
// cbuffer 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_WrapLinear                     sampler      NA          NA    8        1
// SS_ClampLinear                    sampler      NA          NA    9        1
// MultiBlend4_et1_snp_0_Texture2D_8    texture  float4          2d    2        1
// MultiBlend4_et1_snp_0_Texture2D_7    texture  float4          2d    3        1
// MultiBlend4_et1_snp_0_Texture2D_6    texture  float4          2d    4        1
// MultiBlend4_et1_snp_0_Texture2D_5    texture  float4          2d    5        1
// MultiBlend4_et1_snp_0_Texture2D_4    texture  float4          2d    6        1
// MultiBlend4_et1_snp_0_Texture2D_3    texture  float4          2d    7        1
// MultiBlend4_et1_snp_0_Texture2D_2    texture  float4          2d    8        1
// MultiBlend4_et1_snp_0_Texture2D_16    texture  float4          2d    9        1
// MultiBlend4_et1_snp_0_Texture2D_15    texture  float4          2d   10        1
// MultiBlend4_et1_snp_0_Texture2D_14    texture  float4          2d   11        1
// MultiBlend4_et1_snp_0_Texture2D_13    texture  float4          2d   12        1
// MultiBlend4_et1_snp_0_Texture2D_1    texture  float4          2d   16        1
// MultiBlend4_et1_snp_0_Texture2D_0    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
// 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
// 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
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy  
// NORMAL                   0   xyzw        1     NONE   float   xyzw
// TANGENT                  0   xyzw        2     NONE   float   xyzw
// POSITION                 1   xyzw        3     NONE   float   xyzw
// COLOR                    0   xyzw        4     NONE   float      w
// TEXCOORD                 0   xy          5     NONE   float   xy  
// TEXCOORD                 1   xyzw        6     NONE   float   xyz 
// SV_ISFRONTFACE           0   x           7    FFACE    uint   x   
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[17], immediateIndexed
dcl_constantbuffer cb2[40], immediateIndexed
dcl_constantbuffer cb8[57], 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 s8, mode_default
dcl_sampler s9, mode_default
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_resource_texture2d (float,float,float,float) t7
dcl_resource_texture2d (float,float,float,float) t8
dcl_resource_texture2d (float,float,float,float) 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) 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_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.w
dcl_input_ps linear v5.xy
dcl_input_ps linear v6.xyz
dcl_input_ps_sgv v7.x, is_front_face
dcl_output o0.xyzw
dcl_temps 25
mul r0.xyz, v1.zxyz, v2.yzxy
mad r0.xyz, v1.yzxy, v2.zxyz, -r0.xyzx
mul r0.xyz, r0.xyzx, v2.wwww
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
dp3 r0.w, v1.xyzx, v1.xyzx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, v1.xyzx
dp3 r0.w, v2.xyzx, v2.xyzx
rsq r0.w, r0.w
mul r2.xyz, r0.wwww, v2.xyzx
movc r1.xyz, v7.xxxx, r1.xyzx, -r1.xyzx
mad r3.xy, v5.xyxx, cb1[1].xyxx, cb1[1].zwzz
sample_indexable(texture2d)(float,float,float,float) r3.xyz, r3.xyxx, t16.xyzw, s0
mad r4.xy, v5.xyxx, cb1[2].xyxx, cb1[2].zwzz
sample_indexable(texture2d)(float,float,float,float) r4.xyz, r4.xyxx, t8.xyzw, s0
mad r5.xy, v5.xyxx, cb1[3].xyxx, cb1[3].zwzz
sample_indexable(texture2d)(float,float,float,float) r5.xyz, r5.xyxx, t7.xyzw, s0
mad r6.xy, v5.xyxx, cb1[4].xyxx, cb1[4].zwzz
sample_indexable(texture2d)(float,float,float,float) r6.xyz, r6.xyxx, t6.xyzw, s0
mul r7.xy, v5.xyxx, cb2[39].zzzz
mad r7.xy, r7.xyxx, cb1[0].xyxx, cb1[0].zwzz
sample_indexable(texture2d)(float,float,float,float) r0.w, r7.xyxx, t17.yzwx, s0
add r0.w, r0.w, l(0.010000)
mul r0.w, r0.w, cb2[39].x
add r7.xyz, -v6.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mad r7.xyz, -r0.wwww, r7.xyzx, v6.xyzx
mad r0.w, v4.w, cb2[39].y, l(1.000000)
mul_sat r7.xyz, r0.wwww, r7.xyzx
add r4.xyz, -r3.xyzx, r4.xyzx
mad r3.xyz, r7.xxxx, r4.xyzx, r3.xyzx
add r4.xyz, -r3.xyzx, r5.xyzx
mad r3.xyz, r7.yyyy, r4.xyzx, r3.xyzx
add r4.xyz, -r3.xyzx, r6.xyzx
mad r3.xyz, r7.zzzz, r4.xyzx, r3.xyzx
mad r4.xy, v5.xyxx, cb1[13].xyxx, cb1[13].zwzz
sample_indexable(texture2d)(float,float,float,float) r4.xyz, r4.xyxx, t12.xyzw, s0
mad r5.xy, v5.xyxx, cb1[14].xyxx, cb1[14].zwzz
sample_indexable(texture2d)(float,float,float,float) r5.xyz, r5.xyxx, t11.xyzw, s0
mad r6.xy, v5.xyxx, cb1[15].xyxx, cb1[15].zwzz
sample_indexable(texture2d)(float,float,float,float) r6.xyz, r6.xyxx, t10.xyzw, s0
mad r8.xy, v5.xyxx, cb1[16].xyxx, cb1[16].zwzz
sample_indexable(texture2d)(float,float,float,float) r8.xyz, r8.xyxx, t9.xyzw, s0
add r5.xyz, -r4.xyzx, r5.xyzx
mad r4.xyz, r7.xxxx, r5.xyzx, r4.xyzx
add r5.xyz, -r4.xyzx, r6.xyzx
mad r4.xyz, r7.yyyy, r5.xyzx, r4.xyzx
add r5.xyz, -r4.xyzx, r8.xyzx
mad r4.xyz, r7.zzzz, r5.xyzx, r4.xyzx
mad r4.xy, r4.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r0.w, r4.xyxx, r4.xyxx
min r0.w, r0.w, l(1.000000)
add r0.w, -r0.w, l(1.000000)
sqrt r0.w, r0.w
mul r2.xyz, r2.xyzx, r4.yyyy
mad r0.xyz, r4.xxxx, r0.xyzx, r2.xyzx
mad r0.xyz, r0.wwww, r1.xyzx, r0.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
mad r2.xy, v5.xyxx, cb1[5].xyxx, cb1[5].zwzz
sample_indexable(texture2d)(float,float,float,float) r2.xyz, r2.xyxx, t5.xyzw, s0
mad r4.xy, v5.xyxx, cb1[6].xyxx, cb1[6].zwzz
sample_indexable(texture2d)(float,float,float,float) r4.xyw, r4.xyxx, t4.xywz, s0
mad r5.xy, v5.xyxx, cb1[7].xyxx, cb1[7].zwzz
sample_indexable(texture2d)(float,float,float,float) r5.xyz, r5.xyxx, t3.xyzw, s0
mad r6.xy, v5.xyxx, cb1[8].xyxx, cb1[8].zwzz
sample_indexable(texture2d)(float,float,float,float) r6.xyz, r6.xyxx, t2.xyzw, s0
add r4.xyw, -r2.xyxz, r4.xyxw
mad r2.xyz, r7.xxxx, r4.xywx, r2.xyzx
add r4.xyw, -r2.xyxz, r5.xyxz
mad r2.xyz, r7.yyyy, r4.xywx, r2.xyzx
add r4.xyw, -r2.xyxz, r6.xyxz
mad r2.xyz, r7.zzzz, r4.xywx, r2.xyzx
round_ne r1.w, v1.w
ftou r1.w, r1.w
dp4 r5.x, v3.xyzw, cb8[8].xyzw
dp4 r5.y, v3.xyzw, cb8[9].xyzw
dp4 r5.z, v3.xyzw, cb8[10].xyzw
dp4 r2.w, v3.xyzw, cb8[11].xyzw
div r4.xyw, r5.xyxz, r2.wwww
add r6.x, -r4.x, cb8[20].w
add r6.y, -r4.y, cb8[21].w
add r6.z, -r4.w, cb8[22].w
dp3 r2.w, r6.xyzx, r6.xyzx
rsq r2.w, r2.w
mul r4.xyw, r2.wwww, r6.xyxz
mul r7.xy, v0.xyxx, cb8[1].zwzz
mul r3.w, r4.z, l(13.000000)
exp r3.w, r3.w
sample_indexable(texture2d)(float,float,float,float) r6.w, r7.xyxx, t33.yzwx, s8
dp3 r7.z, r0.xyzx, r4.xywx
add r7.w, r6.w, r7.z
mad r7.w, r7.w, r7.w, l(-1.000000)
add_sat r7.w, r6.w, r7.w
mov_sat r8.x, r7.z
add r8.x, -r8.x, l(1.000000)
add r8.y, r7.z, r7.z
mad r8.yzw, r8.yyyy, r0.xxyz, -r4.xxyw
mul r9.x, r8.x, r8.x
mul r9.x, r9.x, r9.x
mul r8.x, r8.x, r9.x
mul r7.w, r7.w, r8.x
mad r8.x, -r4.z, l(6.500000), l(6.500000)
min r8.x, r8.x, l(6.000000)
add r9.xyz, -r2.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r10.xyz, r7.wwww, r9.xyzx
mul r4.z, r4.z, r4.z
mad r10.xyz, r10.xyzx, r4.zzzz, r2.xyzx
imul null, r1.w, r1.w, l(17)
lt r11.xy, l(0.000000, 0.000000, 0.000000, 0.000000), cb7[26].xyxx
mov r5.w, l(1.000000)
dp4 r12.x, r5.xyzw, cb7[14].xyzw
dp4 r12.y, r5.xyzw, cb7[15].xyzw
dp4 r12.z, r5.xyzw, cb7[16].xyzw
dp3 r13.x, r8.yzwy, cb7[14].xyzx
dp3 r13.y, r8.yzwy, cb7[15].xyzx
dp3 r13.z, r8.yzwy, cb7[16].xyzx
lt r14.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), r13.xyzx
not r15.xyz, r14.xyzx
and r14.xyz, r11.xxxx, r14.xyzx
add r16.xyz, -r12.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
div r16.xyz, r16.xyzx, r13.xyzx
movc r14.xyz, r14.xyzx, |r16.xyzx|, l(5000.000000,5000.000000,5000.000000,0)
and r15.xyz, r11.xxxx, r15.xyzx
lt r16.xyz, r13.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
and r15.xyz, r15.xyzx, r16.xyzx
add r16.xyz, r12.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
div r16.xyz, r16.xyzx, r13.xyzx
movc r14.xyz, r15.xyzx, |r16.xyzx|, r14.xyzx
min r4.z, r14.y, r14.x
min r4.z, r14.z, r4.z
mad r12.xyz, r13.xyzx, r4.zzzz, r12.xyzx
mad r7.w, -r4.z, l(0.000100), l(-1.000000)
lt r13.xyz, r12.xyzx, r7.wwww
mad r4.z, r4.z, l(0.000100), l(1.000000)
lt r14.xyz, r4.zzzz, r12.xyzx
or r4.z, r13.x, r14.x
or r4.z, r13.y, r4.z
or r4.z, r14.y, r4.z
or r4.z, r13.z, r4.z
or r4.z, r14.z, r4.z
mov r12.w, l(1.000000)
dp4 r13.x, r12.xyzw, cb7[10].xyzw
dp4 r13.y, r12.xyzw, cb7[11].xyzw
dp4 r13.z, r12.xyzw, cb7[12].xyzw
add r12.xyz, r13.xyzx, -cb7[8].xyzx
sample_l_indexable(texturecube)(float,float,float,float) r12.xyz, r12.xyzx, t30.xyzw, s8, r8.x
mul r12.xyz, r12.xyzx, cb4[r1.w + 14].wwww
movc r12.xyz, r4.zzzz, l(0,0,0,0), r12.xyzx
sample_l_indexable(texturecube)(float,float,float,float) r13.xyz, r8.yzwy, t30.xyzw, s8, r8.x
mul r13.xyz, r13.xyzx, cb4[r1.w + 14].wwww
movc r11.xzw, r11.xxxx, r12.xxyz, r13.xxyz
dp4 r12.x, r5.xyzw, cb7[22].xyzw
dp4 r12.y, r5.xyzw, cb7[23].xyzw
dp4 r12.z, r5.xyzw, cb7[24].xyzw
dp3 r5.x, r8.yzwy, cb7[22].xyzx
dp3 r5.y, r8.yzwy, cb7[23].xyzx
dp3 r5.z, r8.yzwy, cb7[24].xyzx
lt r13.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), r5.xyzx
not r14.xyz, r13.xyzx
and r13.xyz, r11.yyyy, r13.xyzx
add r15.xyz, -r12.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
div r15.xyz, r15.xyzx, r5.xyzx
movc r13.xyz, r13.xyzx, |r15.xyzx|, l(5000.000000,5000.000000,5000.000000,0)
and r14.xyz, r11.yyyy, r14.xyzx
lt r15.xyz, r5.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
and r14.xyz, r14.xyzx, r15.xyzx
add r15.xyz, r12.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
div r15.xyz, r15.xyzx, r5.xyzx
movc r13.xyz, r14.xyzx, |r15.xyzx|, r13.xyzx
min r4.z, r13.y, r13.x
min r4.z, r13.z, r4.z
mad r5.xyz, r5.xyzx, r4.zzzz, r12.xyzx
mad r7.w, -r4.z, l(0.000100), l(-1.000000)
lt r12.xyz, r5.xyzx, r7.wwww
mad r4.z, r4.z, l(0.000100), l(1.000000)
lt r13.xyz, r4.zzzz, r5.xyzx
or r4.z, r12.x, r13.x
or r4.z, r12.y, r4.z
or r4.z, r13.y, r4.z
or r4.z, r12.z, r4.z
or r4.z, r13.z, r4.z
mov r5.w, l(1.000000)
dp4 r12.x, r5.xyzw, cb7[18].xyzw
dp4 r12.y, r5.xyzw, cb7[19].xyzw
dp4 r12.z, r5.xyzw, cb7[20].xyzw
add r5.xyz, r12.xyzx, -cb7[9].xyzx
sample_l_indexable(texturecube)(float,float,float,float) r5.xyz, r5.xyzx, t31.xyzw, s8, r8.x
mul r5.xyz, r5.xyzx, cb4[r1.w + 15].wwww
movc r5.xyz, r4.zzzz, l(0,0,0,0), r5.xyzx
sample_l_indexable(texturecube)(float,float,float,float) r12.xyz, r8.yzwy, t31.xyzw, s8, r8.x
mul r12.xyz, r12.xyzx, cb4[r1.w + 15].wwww
movc r5.xyz, r11.yyyy, r5.xyzx, r12.xyzx
add r5.xyz, -r11.xzwx, r5.xyzx
mad r5.xyz, cb4[r1.w + 13].wwww, r5.xyzx, r11.xzwx
mul r5.xyz, r10.xyzx, r5.xyzx
mul r5.xyz, r6.wwww, r5.xyzx
dp3 r1.x, r8.yzwy, r1.xyzx
add_sat r1.x, r1.x, l(1.000000)
mul r1.x, r1.x, r1.x
mul r1.xyz, r1.xxxx, r5.xyzx
mov r0.w, l(1.000000)
dp4 r5.x, r0.xyzw, cb4[r1.w + 8].xyzw
dp4 r5.y, r0.xyzw, cb4[r1.w + 9].xyzw
dp4 r5.z, r0.xyzw, cb4[r1.w + 10].xyzw
max r5.xyz, r5.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mul r5.xyz, r9.xyzx, r5.xyzx
sample_l_indexable(texture2d)(float,float,float,float) r8.xyzw, r7.xyxx, t44.xyzw, s9, r8.x
mul r10.xyz, r6.wwww, r10.xyzx
mul r8.xyz, r8.xyzx, r10.xyzx
add r0.w, -r8.w, l(1.000000)
mad r1.xyz, r1.xyzx, r0.wwww, r8.xyzx
sample_indexable(texture2d)(float,float,float,float) r0.w, r7.xyxx, t32.xyzw, s8
add r8.xyz, l(1.000000, 1.000000, 1.000000, 0.000000), -cb8[29].xyzx
add r10.xyz, -r8.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mad r8.xyz, r0.wwww, r10.xyzx, r8.xyzx
mul r8.xyz, r8.xyzx, cb4[r1.w + 11].xxxx
mul r10.xyz, r8.xyzx, cb5[4].xyzx
dp3 r11.x, cb5[0].xyzx, r0.xyzx
dp3 r11.y, cb5[1].xyzx, r0.xyzx
mov_sat r11.zw, r11.xxxy
mul r12.xyz, r9.xyzx, r11.zzzz
mul r13.xyz, r9.xyzx, r11.wwww
mul r13.xyz, r13.xyzx, cb5[5].xyzx
mad r10.xyz, r10.xyzx, r12.xyzx, r13.xyzx
ult r12.xy, l(0, 0, 0, 0), cb5[16].xyxx
if_nz cb5[16].x
  dp3 r0.w, cb5[2].xyzx, r0.xyzx
  mad r0.w, r0.w, l(0.500000), l(0.500000)
  mul r0.w, r0.w, r0.w
  min r0.w, r0.w, l(1.000000)
  mul r13.xyz, r9.xyzx, r0.wwww
  mad r10.xyz, cb5[6].xyzx, r13.xyzx, r10.xyzx
endif 
if_nz cb5[16].y
  dp3 r0.w, cb5[3].xyzx, r0.xyzx
  mad r0.w, r0.w, l(0.500000), l(0.500000)
  mul r0.w, r0.w, r0.w
  min r0.w, r0.w, l(1.000000)
  mul r13.xyz, r9.xyzx, r0.wwww
  mad r10.xyz, cb5[7].xyzx, r13.xyzx, r10.xyzx
endif 
mul r8.xyz, r8.xyzx, cb5[8].xyzx
mad r13.xyz, r6.xyzx, r2.wwww, cb5[0].xyzx
dp3 r0.w, r13.xyzx, r13.xyzx
rsq r0.w, r0.w
mul r13.xyz, r0.wwww, r13.xyzx
mad r14.xyz, r6.xyzx, r2.wwww, cb5[1].xyzx
dp3 r0.w, r14.xyzx, r14.xyzx
rsq r0.w, r0.w
mul r14.xyz, r0.wwww, r14.xyzx
dp3_sat r15.x, r13.xyzx, r0.xyzx
dp3_sat r15.y, r14.xyzx, r0.xyzx
mul r0.w, r3.w, cb5[0].w
mad r4.z, r3.w, l(0.010000), cb5[0].w
div r0.w, r0.w, r4.z
max r16.x, r0.w, l(1.000000)
mul r0.w, r3.w, cb5[1].w
mad r4.z, r3.w, l(0.010000), cb5[1].w
div r0.w, r0.w, r4.z
max r16.y, r0.w, l(1.000000)
log r12.zw, r15.xxxy
mul r12.zw, r12.zzzw, r16.xxxy
exp r12.zw, r12.zzzw
dp3_sat r13.x, r4.xywx, r13.xyzx
dp3_sat r13.y, r4.xywx, r14.xyzx
add r13.xy, -r13.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r13.zw, r13.xxxy, r13.xxxy
mul r13.zw, r13.zzzw, r13.zzzw
mul r13.xy, r13.zwzz, r13.xyxx
mad r13.xzw, r13.xxxx, r9.xxyz, r2.xxyz
mad r14.xyz, r13.yyyy, r9.xyzx, r2.xyzx
max r11.xy, r7.zzzz, r11.xyxx
max r11.xy, r11.xyxx, l(0.000100, 0.000100, 0.000000, 0.000000)
div r11.xy, r11.zwzz, r11.xyxx
mul r13.xyz, r12.zzzz, r13.xzwx
mul r11.xzw, r11.xxxx, r13.xxyz
mul r13.xyz, r12.wwww, r14.xyzx
mul r13.xyz, r11.yyyy, r13.xyzx
mad r12.zw, r16.xxxy, l(0.000000, 0.000000, 0.125000, 0.125000), l(0.000000, 0.000000, 0.250000, 0.250000)
mul r8.xyz, r8.xyzx, r12.zzzz
mul r14.xyz, r12.wwww, cb5[9].xyzx
mul r13.xyz, r13.xyzx, r14.xyzx
mad r8.xyz, r8.xyzx, r11.xzwx, r13.xyzx
dp3 r0.w, r0.xyzx, cb5[2].xyzx
mad r11.xyz, r6.xyzx, r2.wwww, cb5[2].xyzx
dp3 r4.z, r11.xyzx, r11.xyzx
rsq r4.z, r4.z
mul r11.xyz, r4.zzzz, r11.xyzx
dp3_sat r4.z, r11.xyzx, r0.xyzx
mul r5.w, r3.w, cb5[2].w
mad r7.w, r3.w, l(0.010000), cb5[2].w
div r5.w, r5.w, r7.w
max r5.w, r5.w, l(1.000000)
log r4.z, r4.z
mul r4.z, r4.z, r5.w
exp r4.z, r4.z
dp3_sat r7.w, r4.xywx, r11.xyzx
add r7.w, -r7.w, l(1.000000)
mul r8.w, r7.w, r7.w
mul r8.w, r8.w, r8.w
mul r7.w, r7.w, r8.w
mad r11.xyz, r7.wwww, r9.xyzx, r2.xyzx
mov_sat r7.w, r0.w
max r0.w, r7.z, r0.w
max r0.w, r0.w, l(0.000100)
div r0.w, r7.w, r0.w
mul r11.xyz, r4.zzzz, r11.xyzx
mul r11.xyz, r0.wwww, r11.xyzx
mad r0.w, r5.w, l(0.125000), l(0.250000)
mul r13.xyz, r0.wwww, cb5[10].xyzx
mad r11.xyz, r13.xyzx, r11.xyzx, r8.xyzx
movc r8.xyz, r12.xxxx, r11.xyzx, r8.xyzx
dp3 r0.w, r0.xyzx, cb5[3].xyzx
mad r11.xyz, r6.xyzx, r2.wwww, cb5[3].xyzx
dp3 r2.w, r11.xyzx, r11.xyzx
rsq r2.w, r2.w
mul r11.xyz, r2.wwww, r11.xyzx
dp3_sat r2.w, r11.xyzx, r0.xyzx
mul r4.z, r3.w, cb5[3].w
mad r5.w, r3.w, l(0.010000), cb5[3].w
div r4.z, r4.z, r5.w
max r4.z, r4.z, l(1.000000)
log r2.w, r2.w
mul r2.w, r2.w, r4.z
exp r2.w, r2.w
dp3_sat r4.x, r4.xywx, r11.xyzx
add r4.x, -r4.x, l(1.000000)
mul r4.y, r4.x, r4.x
mul r4.y, r4.y, r4.y
mul r4.x, r4.y, r4.x
mad r4.xyw, r4.xxxx, r9.xyxz, r2.xyxz
mov_sat r5.w, r0.w
max r0.w, r7.z, r0.w
max r0.w, r0.w, l(0.000100)
div r0.w, r5.w, r0.w
mul r4.xyw, r2.wwww, r4.xyxw
mul r4.xyw, r0.wwww, r4.xyxw
mad r0.w, r4.z, l(0.125000), l(0.250000)
mul r9.xyz, r0.wwww, cb5[11].xyzx
mad r4.xyz, r9.xyzx, r4.xywx, r8.xyzx
movc r4.xyz, r12.yyyy, r4.xyzx, r8.xyzx
if_z cb4[r1.w + 6].y
  dp3 r8.x, r0.xyzx, cb8[5].xyzx
  dp3 r8.y, r0.xyzx, cb8[6].xyzx
  dp3 r8.z, r0.xyzx, cb8[7].xyzx
  dp4 r0.x, v3.xyzw, cb8[12].xyzw
  dp4 r0.y, v3.xyzw, cb8[13].xyzw
  dp4 r0.z, v3.xyzw, cb8[14].xyzw
  dp4 r0.w, v3.xyzw, cb8[15].xyzw
  div r0.xyz, r0.xyzx, r0.wwww
  mul r7.xy, r7.xyxx, cb8[1].xyxx
  ftou r7.xy, r7.xyxx
  udiv r7.xy, null, r7.xyxx, cb8[56].xxxx
  utof r7.xy, r7.xyxx
  utof r2.w, cb8[56].y
  mad r2.w, r7.y, r2.w, r7.x
  ftou r2.w, r2.w
  add r4.w, r0.z, -cb8[55].x
  log r4.w, r4.w
  add r4.w, r4.w, -cb8[55].z
  div r4.w, r4.w, cb8[55].y
  max r4.w, r4.w, l(0.000000)
  min r4.w, r4.w, l(14.000000)
  ftou r4.w, r4.w
  ishl r4.w, l(1), r4.w
  ld_structured_indexable(structured_buffer, stride=12)(mixed,mixed,mixed,mixed) r7.xyz, r2.w, l(0), t60.xyzx
  dp3 r2.w, -r0.xyzx, -r0.xyzx
  rsq r2.w, r2.w
  mul r9.xyz, -r0.xyzx, r2.wwww
  mov r11.xyz, l(0,0,0,0)
  mov r12.xyz, l(0,0,0,0)
  mov r2.w, r7.x
  mov r5.w, l(0)
  loop 
    uge r7.w, r5.w, r7.y
    breakc_nz r7.w
    ld_structured_indexable(structured_buffer, stride=8)(mixed,mixed,mixed,mixed) r13.xy, r2.w, l(0), t59.xyxx
    iadd r7.w, r2.w, l(1)
    and r8.w, r4.w, r13.y
    iadd r9.w, r5.w, l(1)
    movc r5.w, r8.w, r5.w, r9.w
    mov r2.w, r7.w
    continuec_z r8.w
    ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r14.xyzw, r13.x, l(0), t61.xyzw
    ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r15.xyzw, r13.x, l(16), t61.xyzw
    ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r13.xyz, r13.x, l(32), t61.xyzx
    add r14.xyz, -r0.xyzx, r14.xyzx
    dp3 r8.w, r14.xyzx, r14.xyzx
    rsq r10.w, r8.w
    mul r16.xyz, r10.wwww, r14.xyzx
    dp3_sat r11.w, r8.xyzx, r16.xyzx
    mul_sat r8.w, r14.w, r8.w
    sqrt r8.w, r8.w
    add r8.w, -r8.w, l(1.000000)
    mul r8.w, r8.w, r8.w
    mad r14.xyz, r14.xyzx, r10.wwww, r9.xyzx
    dp3 r10.w, r14.xyzx, r14.xyzx
    rsq r10.w, r10.w
    mul r14.xyz, r10.wwww, r14.xyzx
    mul r10.w, r3.w, r15.w
    mad r12.w, r3.w, l(0.010000), r15.w
    div r10.w, r10.w, r12.w
    max r10.w, r10.w, l(1.000000)
    dp3_sat r12.w, r14.xyzx, r8.xyzx
    log r12.w, r12.w
    mul r12.w, r10.w, r12.w
    exp r12.w, r12.w
    mul r14.xyz, r11.wwww, r15.xyzx
    mul r13.xyz, r12.wwww, r13.xyzx
    log r11.w, r11.w
    mul r11.w, r11.w, l(0.100000)
    exp r11.w, r11.w
    mul r13.xyz, r11.wwww, r13.xyzx
    mul r13.xyz, r8.wwww, r13.xyzx
    mad r10.w, r10.w, l(0.125000), l(0.250000)
    mad r11.xyz, r14.xyzx, r8.wwww, r11.xyzx
    mad r12.xyz, r13.xyzx, r10.wwww, r12.xyzx
    mov r5.w, r9.w
    mov r2.w, r7.w
  endloop 
  dp3 r5.w, r0.xyzx, r0.xyzx
  rsq r5.w, r5.w
  mul r7.xyw, r0.xyxz, r5.wwww
  dp3 r5.w, r7.xywx, r8.xyzx
  add r5.w, r5.w, r5.w
  mad r7.xyw, r8.xyxz, -r5.wwww, r7.xyxw
  ushr r5.w, r7.z, l(16)
  mov r0.w, l(1.000000)
  mov r13.zw, l(0,0,1.000000,1.000000)
  mov r14.xyz, r11.xyzx
  mov r15.xyz, r12.xyzx
  mov r7.z, r2.w
  mov r8.w, l(0)
  loop 
    uge r9.w, r8.w, r5.w
    breakc_nz r9.w
    ld_structured_indexable(structured_buffer, stride=8)(mixed,mixed,mixed,mixed) r16.xy, r7.z, l(0), t59.xyxx
    iadd r9.w, r7.z, l(1)
    and r10.w, r4.w, r16.y
    iadd r11.w, r8.w, l(1)
    movc r8.w, r10.w, r8.w, r11.w
    mov r7.z, r9.w
    continuec_z r10.w
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r17.xyzw, r16.x, l(0), t62.xyzw
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r18.xyzw, r16.x, l(16), t62.xyzw
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r16.yzw, r16.x, l(32), t62.xxyz
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r19.xyzw, r16.x, l(60), t62.xyzw
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r20.xyzw, r16.x, l(76), t62.yzwx
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r21.xyzw, r16.x, l(92), t62.yzwx
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r22.xyzw, r16.x, l(108), t62.xyzw
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r23.w, r16.x, l(124), t62.xxxx
    mov r24.xyz, r19.yzwy
    mov r24.w, r20.w
    dp4 r24.x, r0.xyzw, r24.xyzw
    mov r20.w, r21.w
    dp4 r24.y, r0.xyzw, r20.xyzw
    mov r21.w, r22.x
    dp4 r10.w, r0.xyzw, r21.xyzw
    mov r23.xyz, r22.yzwy
    dp4 r12.w, r0.xyzw, r23.xyzw
    lt r10.w, l(0.000000), r10.w
    add r17.xyz, -r0.xyzx, r17.xyzx
    dp3 r14.w, r17.xyzx, r17.xyzx
    rsq r15.w, r14.w
    mul r19.yzw, r15.wwww, r17.xxyz
    lt r16.x, l(0.000000), r19.x
    mul r19.x, r17.w, r17.w
    div r19.x, l(1.000000, 1.000000, 1.000000, 1.000000), r19.x
    div r20.x, l(1.000000, 1.000000, 1.000000, 1.000000), r14.w
    add r21.x, -r19.x, r20.x
    max r20.w, r21.x, l(0.000000)
    dp3_sat r21.x, r19.yzwy, r8.xyzx
    div r21.yz, r24.xxyx, r12.wwww
    dp2 r21.y, r21.yzyy, r21.yzyy
    add r21.y, -r21.y, l(1.000000)
    max r20.y, r21.y, l(0.000000)
    mul r14.w, r14.w, r19.x
    min r14.w, r14.w, l(1.000000)
    add r20.z, -r14.w, l(1.000000)
    div r12.w, r12.w, r17.w
    add_sat r12.w, -r12.w, l(1.000000)
    mul r13.y, r20.y, r20.y
    mul r13.x, r12.w, r12.w
    movc r20.xyzw, r16.xxxx, r20.xyzw, r13.xyzw
    mad r17.xyz, r17.xyzx, r15.wwww, r9.xyzx
    dp3 r12.w, r17.xyzx, r17.xyzx
    rsq r12.w, r12.w
    mul r17.xyz, r12.wwww, r17.xyzx
    mul r12.w, r3.w, r18.w
    mad r13.x, r3.w, l(0.010000), r18.w
    div r12.w, r12.w, r13.x
    max r12.w, r12.w, l(1.000000)
    dp3_sat r13.x, r17.xyzx, r8.xyzx
    log r13.x, r13.x
    mul r13.x, r12.w, r13.x
    exp r13.x, r13.x
    mul r17.xyz, r20.wzxw, r20.yyyy
    mul r18.xyz, r18.xyzx, r21.xxxx
    mul r20.xyz, r17.xxxx, r18.xyzx
    mul r21.yzw, r13.xxxx, r16.yyzw
    log r13.x, r21.x
    mul r13.x, r13.x, l(0.100000)
    exp r13.x, r13.x
    mul r21.xyz, r13.xxxx, r21.yzwy
    mul r17.xyw, r17.yyyy, r21.xyxz
    mul r13.x, r12.w, l(0.250000)
    mad r12.w, r12.w, l(0.125000), l(0.250000)
    mul r17.xyw, r12.wwww, r17.xyxw
    dp3_sat r13.y, r19.yzwy, r7.xywx
    log r13.y, r13.y
    mul r13.x, r13.y, r13.x
    exp r13.x, r13.x
    mul r12.w, r12.w, r13.x
    mul r18.xyz, r17.zzzz, r18.xyzx
    mul r16.yzw, r12.wwww, r16.yyzw
    mul r16.yzw, r17.zzzz, r16.yyzw
    movc r18.xyz, r16.xxxx, r20.xyzx, r18.xyzx
    movc r16.xyz, r16.xxxx, r17.xywx, r16.yzwy
    and r17.xyz, r10.wwww, r18.xyzx
    and r16.xyz, r10.wwww, r16.xyzx
    add r14.xyz, r14.xyzx, r17.xyzx
    add r15.xyz, r15.xyzx, r16.xyzx
    mov r8.w, r11.w
    mov r7.z, r9.w
  endloop 
  mad r0.xyz, -r2.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(1.000000, 1.000000, 1.000000, 0.000000)
  mul r0.xyz, r0.xyzx, r14.xyzx
  mul r2.xyz, r2.xyzx, r15.xyzx
  mad r10.xyz, r0.xyzx, r6.wwww, r10.xyzx
  mad r4.xyz, r2.xyzx, r6.wwww, r4.xyzx
endif 
add r0.xyz, r1.xyzx, r4.xyzx
mad r1.xyz, r5.xyzx, r6.wwww, r10.xyzx
mad r0.xyz, r3.xyzx, r1.xyzx, r0.xyzx
mul r0.xyz, r0.xyzx, cb4[r1.w + 7].xyzx
add r0.w, -r6.y, cb6[3].w
add r0.w, r0.w, -cb6[3].y
mul_sat r0.w, r0.w, cb6[3].z
dp2 r1.x, -r6.xzxx, -r6.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[r1.w + 7].w
ret 
// Approximately 558 instruction slots used

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