// ---- Created with 3Dmigoto v1.2.35 on Tue Apr 26 22:31:33 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 C_ARSN_cinder_snp_0_float_4_0 : packoffset(c39);
}

cbuffer cbMtdParam : register(b3)
{
  float4 FC_DifMapMulCol : packoffset(c0);
  float4 FC_SpcMapMulCol : packoffset(c1);
  float4 FC_SpcParam : packoffset(c2);
  float4 FC_SSAOParam : packoffset(c3);
  float3 FC_CDRFParam : packoffset(c4);
  float4 FC_AlphaRef : packoffset(c5);
  float FC_BloodAmount : packoffset(c6);
  float4 old_FC_ParallaxParam : packoffset(c7);
  float FC_IOR : packoffset(c8);
  float4 FC_GlowScale : packoffset(c9);
  float4 FC_GhostEdgeColor : packoffset(c10);
  float4 FC_GhostEdgeParam : packoffset(c11);
  float4 FC_BmpBlendParam0 : packoffset(c12);
  float4 FC_BmpBlendParam1 : packoffset(c13);
  float FC_UNUSED_SSS_ID : packoffset(c14);
  float4 FC_Falloff_InsideColor : packoffset(c15);
  float4 FC_Falloff_OutsideColor : packoffset(c16);
  float4 FC_Falloff_Offset : packoffset(c17);
  float4 FC_Falloff_EdgePower : packoffset(c18);
  float4 FC_Falloff_HeightFade : packoffset(c19);
  float4 FC_HairSpecularParam0 : packoffset(c20);
  float4 FC_HairSpecularParam1 : packoffset(c21);
  float4 FC_HairSpecularParam2 : packoffset(c22);
  float4 FC_RimLightingParam : packoffset(c23);
  float4 FC_SAT_DUMMMY_P7_8 : packoffset(c24);
  float4 FC_SAT_DUMMMY_P7_9 : packoffset(c25);
  float4 FC_SAT_DUMMMY_P7_10 : packoffset(c26);
  float C_ARSN_cinder_snp_0_float_0 : packoffset(c27);
  float C_ARSN_cinder_snp_0_float_1 : packoffset(c28);
  float C_ARSN_cinder_snp_0_float_11 : packoffset(c29);
  float C_ARSN_cinder_snp_0_float_12 : packoffset(c30);
  float C_ARSN_cinder_snp_0_float_5 : packoffset(c31);
  float C_ARSN_cinder_snp_0_float_6 : packoffset(c32);
  float C_ARSN_cinder_snp_0_float_7 : packoffset(c33);
  float C_ARSN_cinder_snp_0_float_8 : packoffset(c34);
  float C_ARSN_cinder_snp_0_float_9 : packoffset(c35);
}

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 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);
Texture2D<float4> g_DiffuseTexture : register(t0);
Texture2D<float4> C_ARSN_cinder_snp_0_Texture2D_5 : register(t1);
Texture2D<float4> C_ARSN_cinder_snp_0_Texture2D_4 : register(t2);
Texture2D<float4> C_ARSN_cinder_snp_0_Texture2D_3 : register(t3);
Texture2D<float4> C_ARSN_cinder_snp_0_Texture2D_1 : register(t4);
Texture2D<float4> C_ARSN_cinder_snp_0_Texture2D_0 : register(t5);
Texture2D<float4> g_DitherTexture : register(t38);
Texture2D<float4> g_DecalDiffuseTexture : register(t41);
Texture2D<float4> g_DecalSpecularTexture : register(t42);


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


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

  float4 x0[16];
  r0.x = cmp(0 < FC_DitherEnable);
  r0.y = cmp(0 != FC_isDitherAlpha);
  r0.x = r0.y ? r0.x : 0;
  r0.yz = float2(0.25,0.25) * v0.xy;
  r0.y = g_DitherTexture.Sample(SS_WrapLinear_s, r0.yz).w;
  r0.y = -0.5 + r0.y;
  r0.z = round(v1.w);
  r0.z = (uint)r0.z;
  r0.z = (int)r0.z * 17;
  r0.w = r0.y * 0.999000013 + VC_InstanceData[r0.z].ditherFadeAlpha;
  r0.w = cmp(r0.w < 0.5);
  r0.x = r0.w ? r0.x : 0;
  r1.x = 1;
  r2.xyzw = g_DecalDiffuseTexture.Sample(SS_DiffuseMap_s, v4.zw).xyzw;
  r1.yz = v4.xy * FC_TextureTilingScale[5].xy + FC_TextureTilingScale[5].zw;
  r3.xyzw = C_ARSN_cinder_snp_0_Texture2D_5.Sample(SS_DiffuseMap_s, r1.yz).xyzw;
  r2.xyz = r3.xyz * r2.www + r2.xyz;
  r2.xyz = r2.xyz + -r3.xyz;
  r3.xyz = FC_BloodAmount * r2.xyz + r3.xyz;
  r1.w = r3.w;
  r1.xyzw = r3.xyzw * r1.xxxw;
  r0.y = r0.y * FC_AlphaRef.y + r1.w;
  r0.y = cmp(r0.y < FC_AlphaRef.x);
  r0.w = cmp(0 < FC_AlphaRef.x);
  r4.w = VC_InstanceData[r0.z].mulCol.w * r3.w;
  r1.w = cmp(r4.w == 0.000000);
  r0.w = r0.w ? r1.w : 0;
  r0.y = (int)r0.y | (int)r0.w;
  r0.x = (int)r0.x | (int)r0.y;
  r0.y = cmp(0.000000 == VC_InstanceData[r0.z].mulCol.w);
  r5.xyzw = cmp(float4(69,60,61,10) == FC_DebugOutputMode.xxxx);
  r0.x = r5.x ? r0.y : r0.x;
  if (r0.x != 0) discard;
  x0[0].xyz = float3(1,1,1);
  x0[1].xyz = float3(1,0,0);
  x0[2].xyz = float3(0,1,0);
  x0[3].xyz = float3(0,0,1);
  x0[4].xyz = float3(0.5,0.5,0.5);
  x0[5].xyz = float3(1,1,0);
  x0[6].xyz = float3(1,0,1);
  x0[7].xyz = float3(0,1,1);
  x0[8].xyz = float3(0.200000003,0.200000003,0.200000003);
  x0[9].xyz = float3(1,0.5,0);
  x0[10].xyz = float3(1,0,0.5);
  x0[11].xyz = float3(0,1,0.5);
  x0[12].xyz = float3(0.5,1,0);
  x0[13].xyz = float3(0.5,0,1);
  x0[14].xyz = float3(0,0.5,1);
  x0[15].xyz = float3(0,0,0);
  r0.y = g_DiffuseTexture.CalculateLevelOfDetailUnclamped(SS_DiffuseMap_s, v4.xy);
  r0.y = max(0, r0.y);
  r0.y = min(15, r0.y);
  r0.y = (int)r0.y;
  r2.xyz = x0[r0.y+0].xyz;
  r3.xyz = v2.yzx * v1.zxy;
  r3.xyz = v1.yzx * v2.zxy + -r3.xyz;
  r3.xyz = v2.www * r3.xyz;
  r0.y = dot(r3.xyz, r3.xyz);
  r0.y = rsqrt(r0.y);
  r3.xyz = r3.xyz * r0.yyy;
  r6.xyz = r3.xyz * float3(0.5,0.5,0.5) + float3(0.5,0.5,0.5);
  r0.y = dot(v1.xyz, v1.xyz);
  r0.y = rsqrt(r0.y);
  r7.xyz = v1.xyz * r0.yyy;
  r7.xyz = v6.xxx ? r7.xyz : -r7.xyz;
  r8.xyz = r7.xyz * float3(0.5,0.5,0.5) + float3(0.5,0.5,0.5);
  r0.y = dot(v2.xyz, v2.xyz);
  r0.y = rsqrt(r0.y);
  r9.xyz = v2.xyz * r0.yyy;
  r0.yw = v4.xy * FC_TextureTilingScale[4].xy + FC_TextureTilingScale[4].zw;
  r10.xyw = C_ARSN_cinder_snp_0_Texture2D_4.Sample(SS_BumpMap_s, r0.yw).xyz;
  r0.yw = r10.xy * float2(2,2) + float2(-1,-1);
  r11.xyz = r0.www * r9.xyz;
  r9.xyz = r9.xyz * float3(0.5,0.5,0.5) + float3(0.5,0.5,0.5);
  r3.xyz = r0.yyy * r3.xyz + r11.xyz;
  r0.y = dot(r0.yw, r0.yw);
  r0.y = min(1, r0.y);
  r0.y = 1 + -r0.y;
  r0.y = sqrt(r0.y);
  r3.xyz = r0.yyy * r7.xyz + r3.xyz;
  r0.y = dot(r3.xyz, r3.xyz);
  r0.y = rsqrt(r0.y);
  r7.xyz = r3.xyz * r0.yyy;
  r3.xyz = r7.xyz * float3(0.5,0.5,0.5) + float3(0.500488758,0.500488758,0.500488758);
  r0.y = (int)r5.y | (int)r0.x;
  r0.y = (int)r5.z | (int)r0.y;
  r3.xyz = r0.yyy ? float3(0,0,0) : r3.xyz;
  r3.xyz = r5.www ? r8.xyz : r3.xyz;
  r8.xyzw = cmp(float4(11,12,13,14) == FC_DebugOutputMode.xxxx);
  r3.xyz = r8.xxx ? float3(1,1,1) : r3.xyz;
  r3.xyz = r8.yyy ? r3.www : r3.xyz;
  r3.xyz = r8.zzz ? r9.xyz : r3.xyz;
  r3.xyz = r8.www ? r6.xyz : r3.xyz;
  r0.y = FC_DebugOutputMode.z + -FC_DebugOutputMode.y;
  r0.w = -FC_DebugOutputMode.y / r0.y;
  r6.xyzw = cmp(float4(17,16,31,51) == FC_DebugOutputMode.xxxx);
  r3.xyz = r6.xxx ? r0.www : r3.xyz;
  r0.w = -FC_DebugOutputMode.y + v3.w;
  r0.y = saturate(r0.w / r0.y);
  r3.xyz = r6.yyy ? r0.yyy : r3.xyz;
  r3.xyz = r6.zzz ? float3(1,1,1) : r3.xyz;
  r8.xyzw = cmp(float4(52,53,42,46) == FC_DebugOutputMode.xxxx);
  r0.y = (int)r6.w | (int)r8.x;
  r0.y = (int)r8.y | (int)r0.y;
  r0.y = (int)r8.z | (int)r0.y;
  r0.y = (int)r8.w | (int)r0.y;
  r6.xyzw = cmp(float4(47,48,50,57) == FC_DebugOutputMode.xxxx);
  r0.y = (int)r0.y | (int)r6.x;
  r0.y = (int)r6.y | (int)r0.y;
  r3.xyz = r0.yyy ? float3(0,0,0) : r3.xyz;
  r3.xyz = r6.zzz ? float3(0,0,1) : r3.xyz;
  r3.xyz = r6.www ? float3(0,0,0) : r3.xyz;
  r6.xyzw = cmp(float4(58,59,63,65) == FC_DebugOutputMode.xxxx);
  r0.y = (int)r6.y | (int)r6.x;
  r3.xyz = r0.yyy ? float3(1,1,1) : r3.xyz;
  r3.xyz = r6.zzz ? float3(0.5,0.5,0.5) : r3.xyz;
  r2.xyz = r6.www ? r2.xyz : r3.xyz;
  r3.xyzw = cmp(float4(66,67,68,75) == FC_DebugOutputMode.xxxx);
  r2.xyz = r3.xxx ? FC_DebugOutputMode.yyy : r2.xyz;
  r2.xyz = r3.yyy ? FC_DebugOutputMode.zzz : r2.xyz;
  r6.xyz = FC_DifColMul.xyz * FC_DifColMul.www;
  r8.xyz = r3.zzz ? r6.xyz : r2.xyz;
  r6.w = 1;
  r0.y = cmp(0 != FC_AlphaRef.z);
  r0.w = r0.y ? r4.w : 0;
  r8.w = r0.x ? 0 : r0.w;
  r5.xyzw = r5.xxxx ? r6.xyzw : r8.xyzw;
  r2.xy = v4.xy * FC_TextureTilingScale[1].xy + FC_TextureTilingScale[1].zw;
  r2.xyz = C_ARSN_cinder_snp_0_Texture2D_1.Sample(SS_WrapLinear_s, r2.xy).xyz;
  r0.w = FC_GlobalTime * C_ARSN_cinder_snp_0_float_0;
  r0.w = frac(r0.w);
  r6.xyz = r2.xyz * C_ARSN_cinder_snp_0_float_8 + r0.www;
  r2.xyz = r3.www ? r6.xyz : r5.xyz;
  o0.w = r5.w;
  r3.x = dot(v3.xyzw, FC_MatrixInvViewProj._m00_m10_m20_m30);
  r3.y = dot(v3.xyzw, FC_MatrixInvViewProj._m01_m11_m21_m31);
  r3.z = dot(v3.xyzw, FC_MatrixInvViewProj._m02_m12_m22_m32);
  r0.w = dot(v3.xyzw, FC_MatrixInvViewProj._m03_m13_m23_m33);
  r3.xyz = r3.xyz / r0.www;
  r5.x = FC_MatrixInvView._m30 + -r3.x;
  r5.y = FC_MatrixInvView._m31 + -r3.y;
  r5.z = FC_MatrixInvView._m32 + -r3.z;
  r0.w = dot(r5.xyz, r5.xyz);
  r0.w = rsqrt(r0.w);
  r3.xyz = r5.xyz * r0.www;
  r0.w = saturate(dot(r7.xyz, r3.xyz));
  r0.w = C_ARSN_cinder_snp_0_float_5 + r0.w;
  r0.w = log2(r0.w);
  r0.w = C_ARSN_cinder_snp_0_float_7 * r0.w;
  r0.w = exp2(r0.w);
  r0.w = 1 + -r0.w;
  r0.w = max(0, r0.w);
  r3.xy = cmp(float2(76,77) == FC_DebugOutputMode.xx);
  r2.xyz = r3.xxx ? r0.www : r2.xyz;
  o0.xyz = r3.yyy ? float3(0,0,0) : r2.xyz;
  r3.xw = g_DecalSpecularTexture.Sample(SS_SpecularMap_s, v4.zw).yx;
  r3.xyz = r3.xxx * r3.xxx;
  r2.xy = v4.xy * FC_TextureTilingScale[3].xy + FC_TextureTilingScale[3].zw;
  r10.xyz = C_ARSN_cinder_snp_0_Texture2D_3.Sample(SS_SpecularMap_s, r2.xy).xyz;
  r1.w = dot(r10.xyz, float3(0.298909992,0.586610019,0.114480004));
  r1.w = saturate(C_ARSN_cinder_snp_0_float_6 * r1.w);
  r1.w = 1 + -r1.w;
  r2.xyzw = r10.xyzw * r2.wwww + r3.xyzw;
  r2.xyzw = r2.xyzw + -r10.xyzw;
  r2.xyzw = FC_BloodAmount * r2.xyzw + r10.xyzw;
  r2.w = FC_GlobalShininessScale * r2.w;
  r3.x = FC_SpcParam.x * 0.00390625;
  r3.x = r3.x * r3.x;
  r2.w = r3.x * r2.w;
  o1.x = r0.x ? 0 : r2.w;
  o1.z = r0.x ? 0 : VC_InstanceData[r0.z].ShLightMask.x;
  r3.xw = r0.yy ? r4.ww : float2(0,1);
  o1.w = r0.x ? 0 : r3.x;
  o1.y = 0;
  r5.xyz = FC_GlobalAlbedoOffsetRGB.xyz * float3(0.00392156886,0.00392156886,0.00392156886);
  r1.xyz = r1.xyz * FC_DifMapMulCol.xyz + r5.xyz;
  r5.y = dot(float3(0.5,-0.419,-0.0810000002), r1.xyz);
  r5.z = dot(float3(-0.169,-0.331999987,0.5), r1.xyz);
  r1.x = dot(float3(0.298999995,0.587000012,0.114), r1.xyz);
  r5.x = FC_GlobalAlbedoOffset * 0.00392156886 + r1.x;
  r4.y = dot(float3(1,-0.713999987,-0.344000012), r5.xyz);
  r4.x = dot(float2(1,1.40199995), r5.xy);
  r4.z = dot(float2(1,1.77199996), r5.xz);
  o2.xyzw = r0.xxxx ? float4(0,0,0,0) : r4.xyzw;
  r1.x = FC_GlobalReflectanceScale * FC_GlobalReflectanceScale;
  r1.xyz = r2.xyz * r1.xxx;
  r2.xyz = FC_GlobalRefRectanceRGBScale.xyz * FC_GlobalRefRectanceRGBScale.xyz;
  r4.xyz = r2.xyz * r1.xyz;
  r1.xyz = -r1.xyz * r2.xyz + float3(1,1,1);
  r2.xyz = sqrt(r4.xyz);
  r4.x = (uint7)VC_InstanceData[r0.z].envData;
  r4.x = 0.00392156886 * r4.x;
  r2.w = r0.y ? r4.w : r4.x;
  r4.w = r0.y ? r4.w : FC_GlowScale.w;
  o3.xyzw = r0.xxxx ? float4(0,0,0,0) : r2.xyzw;
  r7.w = 1;
  r2.x = dot(r7.xyzw, VC_InstanceData[r0.z].aSh[0].xyzw);
  r2.y = dot(r7.xyzw, VC_InstanceData[r0.z].aSh[1].xyzw);
  r2.z = dot(r7.xyzw, VC_InstanceData[r0.z].aSh[2].xyzw);
  r2.xyz = max(float3(0,0,0), r2.xyz);
  r3.xyz = r2.xyz * r1.xyz;
  o4.xyzw = r0.xxxx ? float4(0,0,0,0) : r3.xyzw;
  r0.y = 1 + -v5.x;
  r0.y = C_ARSN_cinder_snp_0_float_9 * r0.y;
  r0.y = max(C_ARSN_cinder_snp_0_float_11, r0.y);
  r6.w = min(C_ARSN_cinder_snp_0_float_12, r0.y);
  r0.yz = r6.xw * FC_TextureTilingScale[0].xy + FC_TextureTilingScale[0].zw;
  r1.xyz = C_ARSN_cinder_snp_0_Texture2D_0.Sample(SS_WrapLinear_s, r0.yz).xyz;
  r0.y = C_ARSN_cinder_snp_0_float_1 * C_ARSN_cinder_snp_0_float_4_0;
  r1.xyz = r1.xyz * r0.yyy;
  r0.yzw = r1.xyz * r0.www;
  r4.xyz = r1.www * r0.yzw;
  o5.xyzw = r0.xxxx ? float4(0,0,0,0) : r4.xyzw;
  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
//   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 C_ARSN_cinder_snp_0_float_4_0;// Offset:  624 Size:     4
//
// }
//
// cbuffer cbMtdParam
// {
//
//   float4 FC_DifMapMulCol;            // Offset:    0 Size:    16
//   float4 FC_SpcMapMulCol;            // Offset:   16 Size:    16 [unused]
//   float4 FC_SpcParam;                // Offset:   32 Size:    16
//   float4 FC_SSAOParam;               // Offset:   48 Size:    16 [unused]
//   float3 FC_CDRFParam;               // Offset:   64 Size:    12 [unused]
//   float4 FC_AlphaRef;                // Offset:   80 Size:    16
//   float FC_BloodAmount;              // Offset:   96 Size:     4
//   float4 old_FC_ParallaxParam;       // Offset:  112 Size:    16 [unused]
//   float FC_IOR;                      // Offset:  128 Size:     4 [unused]
//   float4 FC_GlowScale;               // Offset:  144 Size:    16
//   float4 FC_GhostEdgeColor;          // Offset:  160 Size:    16 [unused]
//   float4 FC_GhostEdgeParam;          // Offset:  176 Size:    16 [unused]
//   float4 FC_BmpBlendParam0;          // Offset:  192 Size:    16 [unused]
//   float4 FC_BmpBlendParam1;          // Offset:  208 Size:    16 [unused]
//   float FC_UNUSED_SSS_ID;            // Offset:  224 Size:     4 [unused]
//   float4 FC_Falloff_InsideColor;     // Offset:  240 Size:    16 [unused]
//   float4 FC_Falloff_OutsideColor;    // Offset:  256 Size:    16 [unused]
//   float4 FC_Falloff_Offset;          // Offset:  272 Size:    16 [unused]
//   float4 FC_Falloff_EdgePower;       // Offset:  288 Size:    16 [unused]
//   float4 FC_Falloff_HeightFade;      // Offset:  304 Size:    16 [unused]
//   float4 FC_HairSpecularParam0;      // Offset:  320 Size:    16 [unused]
//   float4 FC_HairSpecularParam1;      // Offset:  336 Size:    16 [unused]
//   float4 FC_HairSpecularParam2;      // Offset:  352 Size:    16 [unused]
//   float4 FC_RimLightingParam;        // Offset:  368 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P7_8;         // Offset:  384 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P7_9;         // Offset:  400 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P7_10;        // Offset:  416 Size:    16 [unused]
//   float C_ARSN_cinder_snp_0_float_0; // Offset:  432 Size:     4
//   float C_ARSN_cinder_snp_0_float_1; // Offset:  448 Size:     4
//   float C_ARSN_cinder_snp_0_float_11;// Offset:  464 Size:     4
//   float C_ARSN_cinder_snp_0_float_12;// Offset:  480 Size:     4
//   float C_ARSN_cinder_snp_0_float_5; // Offset:  496 Size:     4
//   float C_ARSN_cinder_snp_0_float_6; // Offset:  512 Size:     4
//   float C_ARSN_cinder_snp_0_float_7; // Offset:  528 Size:     4
//   float C_ARSN_cinder_snp_0_float_8; // Offset:  544 Size:     4
//   float C_ARSN_cinder_snp_0_float_9; // Offset:  560 Size:     4
//
// }
//
// cbuffer cbSceneParam
// {
//
//   float4 FC_FarClipInfo;             // Offset:    0 Size:    16 [unused]
//   float4 FC_ScreenSize;              // Offset:   16 Size:    16 [unused]
//   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 [unused]
//   float4x4 FC_MatrixInvViewProj;     // Offset:  128 Size:    64
//   float4x4 FC_MatrixInvProj;         // Offset:  192 Size:    64 [unused]
//   float4x4 FC_MatrixProj;            // Offset:  256 Size:    64 [unused]
//   float4x4 FC_MatrixInvView;         // Offset:  320 Size:    64
//   float4x4 VC_MatrixViewProj;        // Offset:  384 Size:    64 [unused]
//   float4 FC_ShadowMapParam;          // Offset:  448 Size:    16 [unused]
//   float4 FC_ShadowColor;             // Offset:  464 Size:    16 [unused]
//   float4 FC_ShadowDir;               // Offset:  480 Size:    16 [unused]
//   float4x4 VC_ShadowMapMatrix;       // Offset:  496 Size:    64 [unused]
//   float FC_ShadowDepthRate;          // Offset:  560 Size:     4 [unused]
//   float FC_ShadowDepthScale;         // Offset:  564 Size:     4 [unused]
//   float FC_ShadowKernelScale;        // Offset:  568 Size:     4 [unused]
//   float FC_ShadowRandTexInvScale;    // Offset:  572 Size:     4 [unused]
//   float FC_ShadowTexInvScaleX;       // Offset:  576 Size:     4 [unused]
//   float FC_ShadowTexInvScaleY;       // Offset:  580 Size:     4 [unused]
//   float FC_ShadowDepthOffsetScale;   // Offset:  584 Size:     4 [unused]
//   float4 FC_ShadowViewKernelScale;   // Offset:  592 Size:    16 [unused]
//   float4x4 FC_ProjSpaceToShadowMatrix[4];// Offset:  608 Size:   256 [unused]
//   float4 FC_CascadeSelectDist;       // Offset:  864 Size:    16 [unused]
//   float FC_FrustumNear;              // Offset:  880 Size:     4 [unused]
//   float FC_FrustumSliceScale;        // Offset:  884 Size:     4 [unused]
//   float FC_FrustumSliceBias;         // Offset:  888 Size:     4 [unused]
//   uint FC_LightTile_Width;           // Offset:  896 Size:     4 [unused]
//   uint FC_LightTile_NumCellX;        // Offset:  900 Size:     4 [unused]
//   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
//   float4 FC_DebugParam2;             // Offset:   32 Size:    16 [unused]
//   float FC_GlobalSpecularMask;       // Offset:   48 Size:     4 [unused]
//   float FC_GlobalReflectanceScale;   // Offset:   52 Size:     4
//   float FC_GlobalShininessScale;     // Offset:   56 Size:     4
//   float FC_GlobalAlbedoOffset;       // Offset:   60 Size:     4
//   float4 FC_GlobalRefRectanceRGBScale;// Offset:   64 Size:    16
//   float4 FC_GlobalAlbedoOffsetRGB;   // Offset:   80 Size:    16
//   float4 FC_SnowDir;                 // Offset:   96 Size:    16 [unused]
//   float4 FC_SnowTilingScale;         // Offset:  112 Size:    16 [unused]
//   float4 FC_SnowAlbedo;              // Offset:  128 Size:    16 [unused]
//   float FC_SnowReflectance;          // Offset:  144 Size:     4 [unused]
//   float FC_GroundPlaneHeight;        // Offset:  148 Size:     4 [unused]
//   float FC_RcpSnowHeightRange;       // Offset:  152 Size:     4 [unused]
//   float FC_SnowNormalScale;          // Offset:  156 Size:     4 [unused]
//   float4 FC_SnowSpakleTinlingScale;  // Offset:  160 Size:    16 [unused]
//   float FC_GlobalTime;               // Offset:  176 Size:     4
//   float FC_DominantSharpnesMinValue; // Offset:  192 Size:     4 [unused]
//   float FC_DominantSharpnesOffset;   // Offset:  196 Size:     4 [unused]
//   float FC_DominantSharpnesExponent; // Offset:  200 Size:     4 [unused]
//   float FC_DominantColorScale;       // Offset:  204 Size:     4 [unused]
//   float4 FC_DominantRgbScale;        // Offset:  208 Size:    16 [unused]
//
// }
//
// cbuffer cbInstanceData
// {
//
//   struct PerInstanceData
//   {
//       
//       float4x3 mWorld;               // Offset:    0
//       float4 atlasUvScaleOffset;     // Offset:   48
//       float4 userClipPlane;          // Offset:   64
//       uint4 matricesData;            // Offset:   80
//       uint envData;                  // Offset:   96
//       bool dynamicLightDisable;      // Offset:  100
//       uint2 envPad;                  // Offset:  104
//       float4 mulCol;                 // Offset:  112
//       float4 aSh[3];                 // Offset:  128
//       float4 ShLightMask;            // Offset:  176
//       float4 vDominantRotateParam;   // Offset:  192
//       float4 parallaxCorrectedCubemapOrigin_envMapInterpRatio;// Offset:  208
//       float4 parallaxCorrectedCubemapAabbMin_envMapColorScale0;// Offset:  224
//       float4 parallaxCorrectedCubemapAabbMax_envMapColorScale1;// Offset:  240
//       float ditherFadeAlpha;         // Offset:  256
//
//   } VC_InstanceData[2];              // Offset:    0 Size:   532
//
// }
//
// cbuffer cbModelParam
// {
//
//   float4 FC_DifColMul;               // Offset:    0 Size:    16
//   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
//   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 [unused]
//   float4 FC_ParallaxCorrectedCubemapOriginB;// Offset:  144 Size:    16 [unused]
//   float4x4 FC_ParallaxCorrectedCubemapObbA;// Offset:  160 Size:    64 [unused]
//   float4x4 FC_ParallaxCorrectedCubemapInvObbA;// Offset:  224 Size:    64 [unused]
//   float4x4 FC_ParallaxCorrectedCubemapObbB;// Offset:  288 Size:    64 [unused]
//   float4x4 FC_ParallaxCorrectedCubemapInvObbB;// Offset:  352 Size:    64 [unused]
//   float FC_ParallaxCorrectedCubemapObbAEnable;// Offset:  416 Size:     4 [unused]
//   float FC_ParallaxCorrectedCubemapObbBEnable;// Offset:  420 Size:     4 [unused]
//
// }
//
//
// 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
// g_DiffuseTexture                  texture  float4          2d    0        1
// C_ARSN_cinder_snp_0_Texture2D_5    texture  float4          2d    1        1
// C_ARSN_cinder_snp_0_Texture2D_4    texture  float4          2d    2        1
// C_ARSN_cinder_snp_0_Texture2D_3    texture  float4          2d    3        1
// C_ARSN_cinder_snp_0_Texture2D_1    texture  float4          2d    4        1
// C_ARSN_cinder_snp_0_Texture2D_0    texture  float4          2d    5        1
// g_DitherTexture                   texture  float4          2d   38        1
// g_DecalDiffuseTexture             texture  float4          2d   41        1
// g_DecalSpecularTexture            texture  float4          2d   42        1
// cbTextureTilingScale              cbuffer      NA          NA    1        1
// cbMatDynParam                     cbuffer      NA          NA    2        1
// cbMtdParam                        cbuffer      NA          NA    3        1
// cbInstanceData                    cbuffer      NA          NA    4        1
// 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  
// NORMAL                   0   xyzw        1     NONE   float   xyzw
// TANGENT                  0   xyzw        2     NONE   float   xyzw
// POSITION                 1   xyzw        3     NONE   float   xyzw
// TEXCOORD                 0   xyzw        4     NONE   float   xyzw
// TEXCOORD                 2   xyzw        5     NONE   float   x   
// SV_ISFRONTFACE           0   x           6    FFACE    uint   x   
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
// SV_TARGET                1   xyzw        1   TARGET   float   xyzw
// SV_TARGET                2   xyzw        2   TARGET   float   xyzw
// SV_TARGET                3   xyzw        3   TARGET   float   xyzw
// SV_TARGET                4   xyzw        4   TARGET   float   xyzw
// SV_TARGET                5   xyzw        5   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[6], immediateIndexed
dcl_constantbuffer cb2[40], immediateIndexed
dcl_constantbuffer cb3[36], immediateIndexed
dcl_constantbuffer cb8[23], immediateIndexed
dcl_constantbuffer cb9[12], immediateIndexed
dcl_constantbuffer cb4[34], dynamicIndexed
dcl_constantbuffer cb7[3], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s8, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t38
dcl_resource_texture2d (float,float,float,float) t41
dcl_resource_texture2d (float,float,float,float) t42
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.xyzw
dcl_input_ps linear v5.x
dcl_input_ps_sgv v6.x, is_front_face
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_temps 12
dcl_indexableTemp x0[16], 4
lt r0.x, l(0.000000), cb7[2].x
ine r0.y, l(0), cb2[0].x
and r0.x, r0.y, r0.x
mul r0.yz, v0.xxyx, l(0.000000, 0.250000, 0.250000, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r0.y, r0.yzyy, t38.xwyz, s8
add r0.y, r0.y, l(-0.500000)
round_ne r0.z, v1.w
ftou r0.z, r0.z
imul null, r0.z, r0.z, l(17)
mad r0.w, r0.y, l(0.999000), cb4[r0.z + 16].x
lt r0.w, r0.w, l(0.500000)
and r0.x, r0.w, r0.x
mov r1.x, l(1.000000)
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, v4.zwzz, t41.xyzw, s0
mad r1.yz, v4.xxyx, cb1[5].xxyx, cb1[5].zzwz
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r1.yzyy, t1.xyzw, s0
mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx
add r2.xyz, -r3.xyzx, r2.xyzx
mad r3.xyz, cb3[6].xxxx, r2.xyzx, r3.xyzx
mov r1.w, r3.w
mul r1.xyzw, r1.xxxw, r3.xyzw
mad r0.y, r0.y, cb3[5].y, r1.w
lt r0.y, r0.y, cb3[5].x
lt r0.w, l(0.000000), cb3[5].x
mul r4.w, r3.w, cb4[r0.z + 7].w
eq r1.w, r4.w, l(0.000000)
and r0.w, r0.w, r1.w
or r0.y, r0.y, r0.w
or r0.x, r0.x, r0.y
eq r0.y, l(0.000000), cb4[r0.z + 7].w
eq r5.xyzw, l(69.000000, 60.000000, 61.000000, 10.000000), cb9[1].xxxx
movc r0.x, r5.x, r0.y, r0.x
discard_nz r0.x
mov x0[0].xyz, l(1.000000,1.000000,1.000000,0)
mov x0[1].xyz, l(1.000000,0,0,0)
mov x0[2].xyz, l(0,1.000000,0,0)
mov x0[3].xyz, l(0,0,1.000000,0)
mov x0[4].xyz, l(0.500000,0.500000,0.500000,0)
mov x0[5].xyz, l(1.000000,1.000000,0,0)
mov x0[6].xyz, l(1.000000,0,1.000000,0)
mov x0[7].xyz, l(0,1.000000,1.000000,0)
mov x0[8].xyz, l(0.200000,0.200000,0.200000,0)
mov x0[9].xyz, l(1.000000,0.500000,0,0)
mov x0[10].xyz, l(1.000000,0,0.500000,0)
mov x0[11].xyz, l(0,1.000000,0.500000,0)
mov x0[12].xyz, l(0.500000,1.000000,0,0)
mov x0[13].xyz, l(0.500000,0,1.000000,0)
mov x0[14].xyz, l(0,0.500000,1.000000,0)
mov x0[15].xyz, l(0,0,0,0)
lod r0.y, v4.xyxx, t0.y, s0
max r0.y, r0.y, l(0.000000)
min r0.y, r0.y, l(15.000000)
ftoi r0.y, r0.y
mov r2.xyz, x0[r0.y + 0].xyzx
mul r3.xyz, v1.zxyz, v2.yzxy
mad r3.xyz, v1.yzxy, v2.zxyz, -r3.xyzx
mul r3.xyz, r3.xyzx, v2.wwww
dp3 r0.y, r3.xyzx, r3.xyzx
rsq r0.y, r0.y
mul r3.xyz, r0.yyyy, r3.xyzx
mad r6.xyz, r3.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
dp3 r0.y, v1.xyzx, v1.xyzx
rsq r0.y, r0.y
mul r7.xyz, r0.yyyy, v1.xyzx
movc r7.xyz, v6.xxxx, r7.xyzx, -r7.xyzx
mad r8.xyz, r7.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
dp3 r0.y, v2.xyzx, v2.xyzx
rsq r0.y, r0.y
mul r9.xyz, r0.yyyy, v2.xyzx
mad r0.yw, v4.xxxy, cb1[4].xxxy, cb1[4].zzzw
sample_indexable(texture2d)(float,float,float,float) r10.xyw, r0.ywyy, t2.xywz, s2
mad r0.yw, r10.xxxy, l(0.000000, 2.000000, 0.000000, 2.000000), l(0.000000, -1.000000, 0.000000, -1.000000)
mul r11.xyz, r9.xyzx, r0.wwww
mad r9.xyz, r9.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
mad r3.xyz, r0.yyyy, r3.xyzx, r11.xyzx
dp2 r0.y, r0.ywyy, r0.ywyy
min r0.y, r0.y, l(1.000000)
add r0.y, -r0.y, l(1.000000)
sqrt r0.y, r0.y
mad r3.xyz, r0.yyyy, r7.xyzx, r3.xyzx
dp3 r0.y, r3.xyzx, r3.xyzx
rsq r0.y, r0.y
mul r7.xyz, r0.yyyy, r3.xyzx
mad r3.xyz, r7.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500489, 0.500489, 0.500489, 0.000000)
or r0.y, r5.y, r0.x
or r0.y, r5.z, r0.y
movc r3.xyz, r0.yyyy, l(0,0,0,0), r3.xyzx
movc r3.xyz, r5.wwww, r8.xyzx, r3.xyzx
eq r8.xyzw, l(11.000000, 12.000000, 13.000000, 14.000000), cb9[1].xxxx
movc r3.xyz, r8.xxxx, l(1.000000,1.000000,1.000000,0), r3.xyzx
movc r3.xyz, r8.yyyy, r3.wwww, r3.xyzx
movc r3.xyz, r8.zzzz, r9.xyzx, r3.xyzx
movc r3.xyz, r8.wwww, r6.xyzx, r3.xyzx
add r0.y, -cb9[1].y, cb9[1].z
div r0.w, -cb9[1].y, r0.y
eq r6.xyzw, l(17.000000, 16.000000, 31.000000, 51.000000), cb9[1].xxxx
movc r3.xyz, r6.xxxx, r0.wwww, r3.xyzx
add r0.w, v3.w, -cb9[1].y
div_sat r0.y, r0.w, r0.y
movc r3.xyz, r6.yyyy, r0.yyyy, r3.xyzx
movc r3.xyz, r6.zzzz, l(1.000000,1.000000,1.000000,0), r3.xyzx
eq r8.xyzw, l(52.000000, 53.000000, 42.000000, 46.000000), cb9[1].xxxx
or r0.y, r6.w, r8.x
or r0.y, r8.y, r0.y
or r0.y, r8.z, r0.y
or r0.y, r8.w, r0.y
eq r6.xyzw, l(47.000000, 48.000000, 50.000000, 57.000000), cb9[1].xxxx
or r0.y, r0.y, r6.x
or r0.y, r6.y, r0.y
movc r3.xyz, r0.yyyy, l(0,0,0,0), r3.xyzx
movc r3.xyz, r6.zzzz, l(0,0,1.000000,0), r3.xyzx
movc r3.xyz, r6.wwww, l(0,0,0,0), r3.xyzx
eq r6.xyzw, l(58.000000, 59.000000, 63.000000, 65.000000), cb9[1].xxxx
or r0.y, r6.y, r6.x
movc r3.xyz, r0.yyyy, l(1.000000,1.000000,1.000000,0), r3.xyzx
movc r3.xyz, r6.zzzz, l(0.500000,0.500000,0.500000,0), r3.xyzx
movc r2.xyz, r6.wwww, r2.xyzx, r3.xyzx
eq r3.xyzw, l(66.000000, 67.000000, 68.000000, 75.000000), cb9[1].xxxx
movc r2.xyz, r3.xxxx, cb9[1].yyyy, r2.xyzx
movc r2.xyz, r3.yyyy, cb9[1].zzzz, r2.xyzx
mul r6.xyz, cb7[0].wwww, cb7[0].xyzx
movc r8.xyz, r3.zzzz, r6.xyzx, r2.xyzx
mov r6.w, l(1.000000)
ne r0.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb3[5].z
and r0.w, r4.w, r0.y
movc r8.w, r0.x, l(0), r0.w
movc r5.xyzw, r5.xxxx, r6.xyzw, r8.xyzw
mad r2.xy, v4.xyxx, cb1[1].xyxx, cb1[1].zwzz
sample_indexable(texture2d)(float,float,float,float) r2.xyz, r2.xyxx, t4.xyzw, s8
mul r0.w, cb3[27].x, cb9[11].x
frc r0.w, r0.w
mad r6.xyz, r2.xyzx, cb3[34].xxxx, r0.wwww
movc r2.xyz, r3.wwww, r6.xyzx, r5.xyzx
mov o0.w, r5.w
dp4 r3.x, v3.xyzw, cb8[8].xyzw
dp4 r3.y, v3.xyzw, cb8[9].xyzw
dp4 r3.z, v3.xyzw, cb8[10].xyzw
dp4 r0.w, v3.xyzw, cb8[11].xyzw
div r3.xyz, r3.xyzx, r0.wwww
add r5.x, -r3.x, cb8[20].w
add r5.y, -r3.y, cb8[21].w
add r5.z, -r3.z, cb8[22].w
dp3 r0.w, r5.xyzx, r5.xyzx
rsq r0.w, r0.w
mul r3.xyz, r0.wwww, r5.xyzx
dp3_sat r0.w, r7.xyzx, r3.xyzx
add r0.w, r0.w, cb3[31].x
log r0.w, r0.w
mul r0.w, r0.w, cb3[33].x
exp r0.w, r0.w
add r0.w, -r0.w, l(1.000000)
max r0.w, r0.w, l(0.000000)
eq r3.xy, l(76.000000, 77.000000, 0.000000, 0.000000), cb9[1].xxxx
movc r2.xyz, r3.xxxx, r0.wwww, r2.xyzx
movc o0.xyz, r3.yyyy, l(0,0,0,0), r2.xyzx
sample_indexable(texture2d)(float,float,float,float) r3.xw, v4.zwzz, t42.yzwx, s1
mul r3.xyz, r3.xxxx, r3.xxxx
mad r2.xy, v4.xyxx, cb1[3].xyxx, cb1[3].zwzz
sample_indexable(texture2d)(float,float,float,float) r10.xyz, r2.xyxx, t3.xyzw, s1
dp3 r1.w, r10.xyzx, l(0.298910, 0.586610, 0.114480, 0.000000)
mul_sat r1.w, r1.w, cb3[32].x
add r1.w, -r1.w, l(1.000000)
mad r2.xyzw, r10.xyzw, r2.wwww, r3.xyzw
add r2.xyzw, -r10.xyzw, r2.xyzw
mad r2.xyzw, cb3[6].xxxx, r2.xyzw, r10.xyzw
mul r2.w, r2.w, cb9[3].z
mul r3.x, l(0.003906), cb3[2].x
mul r3.x, r3.x, r3.x
mul r2.w, r2.w, r3.x
movc o1.x, r0.x, l(0), r2.w
movc o1.z, r0.x, l(0), cb4[r0.z + 11].x
movc r3.xw, r0.yyyy, r4.wwww, l(0,0,0,1.000000)
movc o1.w, r0.x, l(0), r3.x
mov o1.y, l(0)
mul r5.xyz, l(0.003922, 0.003922, 0.003922, 0.000000), cb9[5].xyzx
mad r1.xyz, r1.xyzx, cb3[0].xyzx, r5.xyzx
dp3 r5.y, l(0.500000, -0.419000, -0.081000, 0.000000), r1.xyzx
dp3 r5.z, l(-0.169000, -0.332000, 0.500000, 0.000000), r1.xyzx
dp3 r1.x, l(0.299000, 0.587000, 0.114000, 0.000000), r1.xyzx
mad r5.x, cb9[3].w, l(0.003922), r1.x
dp3 r4.y, l(1.000000, -0.714000, -0.344000, 0.000000), r5.xyzx
dp2 r4.x, l(1.000000, 1.402000, 0.000000, 0.000000), r5.xyxx
dp2 r4.z, l(1.000000, 1.772000, 0.000000, 0.000000), r5.xzxx
movc o2.xyzw, r0.xxxx, l(0,0,0,0), r4.xyzw
mul r1.x, cb9[3].y, cb9[3].y
mul r1.xyz, r1.xxxx, r2.xyzx
mul r2.xyz, cb9[4].xyzx, cb9[4].xyzx
mul r4.xyz, r1.xyzx, r2.xyzx
mad r1.xyz, -r1.xyzx, r2.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
sqrt r2.xyz, r4.xyzx
utof r4.x, cb4[r0.z + 6].x
mul r4.x, r4.x, l(0.003922)
movc r2.w, r0.y, r4.w, r4.x
movc r4.w, r0.y, r4.w, cb3[9].w
movc o3.xyzw, r0.xxxx, l(0,0,0,0), r2.xyzw
mov r7.w, l(1.000000)
dp4 r2.x, r7.xyzw, cb4[r0.z + 8].xyzw
dp4 r2.y, r7.xyzw, cb4[r0.z + 9].xyzw
dp4 r2.z, r7.xyzw, cb4[r0.z + 10].xyzw
max r2.xyz, r2.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mul r3.xyz, r1.xyzx, r2.xyzx
movc o4.xyzw, r0.xxxx, l(0,0,0,0), r3.xyzw
add r0.y, -v5.x, l(1.000000)
mul r0.y, r0.y, cb3[35].x
max r0.y, r0.y, cb3[29].x
min r6.w, r0.y, cb3[30].x
mad r0.yz, r6.xxwx, cb1[0].xxyx, cb1[0].zzwz
sample_indexable(texture2d)(float,float,float,float) r1.xyz, r0.yzyy, t5.xyzw, s8
mul r0.y, cb2[39].x, cb3[28].x
mul r1.xyz, r0.yyyy, r1.xyzx
mul r0.yzw, r0.wwww, r1.xxyz
mul r4.xyz, r0.yzwy, r1.wwww
movc o5.xyzw, r0.xxxx, l(0,0,0,0), r4.xyzw
ret 
// Approximately 214 instruction slots used

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