// ---- Created with 3Dmigoto v1.2.35 on Tue Apr 26 22:31:30 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 MultiBlend2_et1_p_snp_0_float_0_0 : packoffset(c39);
  float MultiBlend2_et1_p_snp_0_float_1_0 : packoffset(c39.y);
  float MultiBlend2_et1_p_snp_0_float_2_0 : packoffset(c39.z);
  float MultiBlend2_et1_p_snp_0_float_3_0 : packoffset(c39.w);
  float MultiBlend2_et1_p_snp_0_float_4_0 : packoffset(c40);
  float MultiBlend2_et1_p_snp_0_float_5_0 : packoffset(c40.y);
  float MultiBlend2_et1_p_snp_0_float_6_0 : packoffset(c40.z);
}

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

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 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);
Texture2D<float4> MultiBlend2_et1_p_snp_0_Texture2D_6 : register(t2);
Texture2D<float4> MultiBlend2_et1_p_snp_0_Texture2D_5 : register(t3);
Texture2D<float4> MultiBlend2_et1_p_snp_0_Texture2D_2 : register(t4);
Texture2D<float4> MultiBlend2_et1_p_snp_0_Texture2D_14 : register(t5);
Texture2D<float4> MultiBlend2_et1_p_snp_0_Texture2D_13 : register(t6);
Texture2D<float4> MultiBlend2_et1_p_snp_0_Texture2D_1 : register(t8);
Texture2D<float4> MultiBlend2_et1_p_snp_0_Texture2D_0 : register(t9);
Texture2D<float4> g_DitherTexture : register(t38);


// 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,
  out float4 o1 : SV_TARGET1,
  out float4 o2 : SV_TARGET2,
  out float4 o3 : SV_TARGET3,
  out float4 o4 : SV_TARGET4)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9;
  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.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;
  r4.x = FC_MatrixInvView._m30 + -r3.x;
  r4.y = FC_MatrixInvView._m31 + -r3.y;
  r4.z = FC_MatrixInvView._m32 + -r3.z;
  r3.x = dot(r4.xyz, r0.xyz);
  r3.y = dot(r4.xyz, r2.xyz);
  r3.z = dot(r4.xyz, r1.xyz);
  r5.xy = v5.xy * FC_TextureTilingScale[13].xy + FC_TextureTilingScale[13].zw;
  r0.w = dot(-r3.xy, -r3.xy);
  r0.w = rsqrt(r0.w);
  r5.zw = -r3.xy * r0.ww;
  r0.w = dot(-r3.xyz, -r3.xyz);
  r0.w = -r3.z * r3.z + r0.w;
  r0.w = sqrt(r0.w);
  r0.w = r0.w / -r3.z;
  r3.xy = r5.zw * r0.ww;
  r3.zw = MultiBlend2_et1_p_snp_0_float_3_0 * r3.xy;
  r0.w = dot(-r4.xyz, -r4.xyz);
  r0.w = rsqrt(r0.w);
  r4.xyz = -r4.xyz * r0.www;
  r0.w = dot(r1.xyz, r1.xyz);
  r0.w = rsqrt(r0.w);
  r6.xyz = r1.xyz * r0.www;
  r5.zw = ddx_coarse(r5.xy);
  r7.xy = ddy_coarse(r5.xy);
  r7.zw = abs(r7.xy) + abs(r5.zw);
  MultiBlend2_et1_p_snp_0_Texture2D_13.GetDimensions(0, uiDest.x, uiDest.y, uiDest.z);
  r8.xy = uiDest.xy;
  r8.xy = (uint2)r8.xy;
  r7.zw = r8.xy * r7.zw;
  r0.w = max(r7.z, r7.w);
  r0.w = log2(r0.w);
  r0.w = max(0, r0.w);
  r1.w = cmp(16 >= r0.w);
  r2.w = dot(r4.xyz, r6.xyz);
  r4.xy = trunc(MultiBlend2_et1_p_snp_0_float_5_0);
  r4.y = r4.y + -r4.x;
  r2.w = abs(r2.w) * r4.y + r4.x;
  r4.x = (int)r2.w;
  r2.w = trunc(r2.w);
  r2.w = 1 / r2.w;
  r4.yz = r5.xy;
  r4.w = 0;
  r6.zw = float2(1,1);
  r8.xyzw = float4(0,0,0,0);
  while (true) {
    r7.z = cmp((int)r4.w >= (int)r4.x);
    if (r7.z != 0) break;
    r4.yz = -r2.ww * r3.zw + r4.yz;
    r6.y = MultiBlend2_et1_p_snp_0_Texture2D_13.SampleGrad(SS_DiffuseMap_s, r4.yz, r5.w, r7.y).w;
    r6.x = r6.z + -r2.w;
    r7.z = cmp(r6.x < r6.y);
    r7.w = r7.z ? r4.x : r4.w;
    r8.xyzw = r7.zzzz ? r6.xyzw : r8.xyzw;
    r4.w = (int)r7.w + 1;
    r6.zw = r6.xy;
  }
  r4.yz = r8.zx + -r8.wy;
  r4.w = r4.y + -r4.z;
  r4.z = r8.z * r4.z;
  r4.y = r8.x * r4.y + -r4.z;
  r4.y = r4.y / r4.w;
  r4.y = 1 + -r4.y;
  r3.zw = -r3.zw * r4.yy + r5.xy;
  r4.y = cmp(15 < r0.w);
  r4.z = trunc(r0.w);
  r0.w = -r4.z + r0.w;
  r4.zw = r5.xy + -r3.zw;
  r4.zw = r0.ww * r4.zw + r3.zw;
  r3.zw = r4.yy ? r4.zw : r3.zw;
  r3.zw = r1.ww ? r3.zw : r5.xy;
  r3.zw = r3.zw + -r5.xy;
  r3.zw = r3.zw / FC_TextureTilingScale[13].xy;
  r3.zw = v5.xy + r3.zw;
  r4.yz = r3.zw * FC_TextureTilingScale[1].xy + FC_TextureTilingScale[1].zw;
  r4.yzw = MultiBlend2_et1_p_snp_0_Texture2D_1.Sample(SS_DiffuseMap_s, r4.yz).xyz;
  r5.xy = v5.xy * FC_TextureTilingScale[14].xy + FC_TextureTilingScale[14].zw;
  r3.xy = MultiBlend2_et1_p_snp_0_float_4_0 * r3.xy;
  r5.zw = ddx_coarse(r5.xy);
  r6.xy = ddy_coarse(r5.xy);
  r6.zw = abs(r6.xy) + abs(r5.zw);
  MultiBlend2_et1_p_snp_0_Texture2D_14.GetDimensions(0, uiDest.x, uiDest.y, uiDest.z);
  r7.xy = uiDest.xy;
  r7.xy = (uint2)r7.xy;
  r6.zw = r7.xy * r6.zw;
  r0.w = max(r6.z, r6.w);
  r0.w = log2(r0.w);
  r0.w = max(0, r0.w);
  r1.w = cmp(16 >= r0.w);
  r6.zw = r5.xy;
  r8.x = 0;
  r7.zw = float2(1,1);
  r9.xyzw = float4(0,0,0,0);
  while (true) {
    r8.y = cmp((int)r8.x >= (int)r4.x);
    if (r8.y != 0) break;
    r6.zw = -r2.ww * r3.xy + r6.zw;
    r7.y = MultiBlend2_et1_p_snp_0_Texture2D_14.SampleGrad(SS_DiffuseMap_s, r6.zw, r5.w, r6.y).w;
    r7.x = r7.z + -r2.w;
    r8.y = cmp(r7.x < r7.y);
    r8.z = r8.y ? r4.x : r8.x;
    r9.xyzw = r8.yyyy ? r7.xyzw : r9.xyzw;
    r8.x = (int)r8.z + 1;
    r7.zw = r7.xy;
  }
  r2.w = r9.z + -r9.w;
  r4.x = r9.x + -r9.y;
  r5.z = -r4.x + r2.w;
  r4.x = r9.z * r4.x;
  r2.w = r9.x * r2.w + -r4.x;
  r2.w = r2.w / r5.z;
  r2.w = 1 + -r2.w;
  r3.xy = -r3.xy * r2.ww + r5.xy;
  r2.w = cmp(15 < r0.w);
  r4.x = trunc(r0.w);
  r0.w = -r4.x + r0.w;
  r5.zw = r5.xy + -r3.xy;
  r5.zw = r0.ww * r5.zw + r3.xy;
  r3.xy = r2.ww ? r5.zw : r3.xy;
  r3.xy = r1.ww ? r3.xy : r5.xy;
  r3.xy = r3.xy + -r5.xy;
  r3.xy = r3.xy / FC_TextureTilingScale[14].xy;
  r3.xy = v5.xy + r3.xy;
  r5.xy = r3.xy * FC_TextureTilingScale[2].xy + FC_TextureTilingScale[2].zw;
  r5.xyz = MultiBlend2_et1_p_snp_0_Texture2D_2.Sample(SS_DiffuseMap_s, r5.xy).xyz;
  r6.xy = MultiBlend2_et1_p_snp_0_float_2_0 * r3.zw;
  r6.xy = r6.xy * FC_TextureTilingScale[0].xy + FC_TextureTilingScale[0].zw;
  r0.w = MultiBlend2_et1_p_snp_0_Texture2D_0.Sample(SS_DiffuseMap_s, r6.xy).x;
  r0.w = 0.00999999978 + r0.w;
  r0.w = MultiBlend2_et1_p_snp_0_float_0_0 * r0.w;
  r1.w = 1 + -v6.x;
  r0.w = -r0.w * r1.w + v6.x;
  r1.w = v4.w * MultiBlend2_et1_p_snp_0_float_1_0 + 1;
  r0.w = saturate(r1.w * r0.w);
  r5.xyz = r5.xyz + -r4.yzw;
  r4.xyz = r0.www * r5.xyz + r4.yzw;
  r5.xy = r3.zw * FC_TextureTilingScale[13].xy + FC_TextureTilingScale[13].zw;
  r5.xyz = MultiBlend2_et1_p_snp_0_Texture2D_13.Sample(SS_DiffuseMap_s, r5.xy).xyz;
  r6.xy = r3.xy * FC_TextureTilingScale[14].xy + FC_TextureTilingScale[14].zw;
  r6.xyz = MultiBlend2_et1_p_snp_0_Texture2D_14.Sample(SS_DiffuseMap_s, r6.xy).xyz;
  r6.xyz = r6.xyz + -r5.xyz;
  r5.xyz = r0.www * r6.xyz + r5.xyz;
  r5.xy = r5.xy * float2(2,2) + float2(-1,-1);
  r1.w = dot(r5.xy, r5.xy);
  r1.w = min(1, r1.w);
  r1.w = 1 + -r1.w;
  r1.w = sqrt(r1.w);
  r2.xyz = r5.yyy * r2.xyz;
  r0.xyz = r5.xxx * r0.xyz + r2.xyz;
  r0.xyz = r1.www * r1.xyz + r0.xyz;
  r1.x = dot(r0.xyz, r0.xyz);
  r1.x = rsqrt(r1.x);
  r1.xyz = r1.xxx * r0.xyz;
  r0.xy = r3.zw * FC_TextureTilingScale[5].xy + FC_TextureTilingScale[5].zw;
  r0.xyz = MultiBlend2_et1_p_snp_0_Texture2D_5.Sample(SS_DiffuseMap_s, r0.xy).xyz;
  r2.xy = r3.xy * FC_TextureTilingScale[6].xy + FC_TextureTilingScale[6].zw;
  r2.xyz = MultiBlend2_et1_p_snp_0_Texture2D_6.Sample(SS_DiffuseMap_s, r2.xy).xyz;
  r2.xyz = r2.xyz + -r0.xyz;
  r0.xyz = r0.www * r2.xyz + r0.xyz;
  r0.w = round(v1.w);
  r0.w = (uint)r0.w;
  r2.xy = float2(0.25,0.25) * v0.xy;
  r2.x = g_DitherTexture.Sample(SS_WrapLinear_s, r2.xy).w;
  r2.yzw = float3(1,1,1) + -r0.xyz;
  r0.w = (int)r0.w * 17;
  r1.w = 1;
  r3.x = dot(r1.xyzw, VC_InstanceData[r0.w].aSh[0].xyzw);
  r3.y = dot(r1.xyzw, VC_InstanceData[r0.w].aSh[1].xyzw);
  r3.z = dot(r1.xyzw, VC_InstanceData[r0.w].aSh[2].xyzw);
  r3.xyz = max(float3(0,0,0), r3.xyz);
  r3.xyz = r3.xyz * r2.yzw;
  r1.w = -0.5 + r2.x;
  r2.x = cmp(0 < FC_DitherEnable);
  r2.y = cmp(0 != FC_isDitherAlpha);
  r2.x = r2.y ? r2.x : 0;
  r2.y = r1.w * 0.999000013 + VC_InstanceData[r0.w].ditherFadeAlpha;
  r2.y = cmp(r2.y < 0.5);
  r2.x = r2.y ? r2.x : 0;
  r2.y = cmp(0 < FC_AlphaRef.x);
  r2.z = cmp(0.000000 == VC_InstanceData[r0.w].mulCol.w);
  r2.y = r2.z ? r2.y : 0;
  r1.w = r1.w * FC_AlphaRef.y + 1;
  r1.w = cmp(r1.w < FC_AlphaRef.x);
  r1.w = (int)r1.w | (int)r2.y;
  r1.w = (int)r2.x | (int)r1.w;
  if (r1.w != 0) discard;
  r2.xyz = r1.xyz * float3(0.5,0.5,0.5) + float3(0.500488758,0.500488758,0.500488758);
  r1.x = (uint7)VC_InstanceData[r0.w].envData;
  r1.y = 0.00392156886 * r1.x;
  r6.xyz = sqrt(r0.xyz);
  r0.x = cmp(0 != FC_AlphaRef.z);
  r1.xz = float2(0,1);
  r0.xyz = r0.xxx ? VC_InstanceData[r0.w].mulCol.www : r1.xyz;
  r2.w = r0.x;
  o0.xyzw = r1.wwww ? float4(0,0,0,0) : r2.xyzw;
  o1.x = r1.w ? 0 : r5.z;
  o1.y = 0;
  o1.z = r1.w ? 0 : VC_InstanceData[r0.w].ShLightMask.x;
  o1.w = r1.w ? 0 : r0.x;
  r4.w = VC_InstanceData[r0.w].mulCol.w;
  o2.xyzw = r1.wwww ? float4(0,0,0,0) : r4.xyzw;
  r6.w = r0.y;
  o3.xyzw = r1.wwww ? float4(0,0,0,0) : r6.xyzw;
  r3.w = r0.z;
  o4.xyzw = r1.wwww ? float4(0,0,0,0) : r3.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 MultiBlend2_et1_p_snp_0_float_0_0;// Offset:  624 Size:     4
//   float MultiBlend2_et1_p_snp_0_float_1_0;// Offset:  628 Size:     4
//   float MultiBlend2_et1_p_snp_0_float_2_0;// Offset:  632 Size:     4
//   float MultiBlend2_et1_p_snp_0_float_3_0;// Offset:  636 Size:     4
//   float MultiBlend2_et1_p_snp_0_float_4_0;// Offset:  640 Size:     4
//   float MultiBlend2_et1_p_snp_0_float_5_0;// Offset:  644 Size:     4
//   float MultiBlend2_et1_p_snp_0_float_6_0;// Offset:  648 Size:     4
//
// }
//
// cbuffer cbMtdParam
// {
//
//   float4 FC_DifMapMulCol;            // Offset:    0 Size:    16 [unused]
//   float4 FC_SpcMapMulCol;            // Offset:   16 Size:    16 [unused]
//   float4 FC_SpcParam;                // Offset:   32 Size:    16 [unused]
//   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 [unused]
//   float4 old_FC_ParallaxParam;       // Offset:  112 Size:    16 [unused]
//   float FC_IOR;                      // Offset:  128 Size:     4 [unused]
//   float4 FC_GlowScale;               // Offset:  144 Size:    16 [unused]
//   float4 FC_GhostEdgeColor;          // Offset:  160 Size:    16 [unused]
//   float4 FC_GhostEdgeParam;          // Offset:  176 Size:    16 [unused]
//   float4 FC_BmpBlendParam0;          // Offset:  192 Size:    16 [unused]
//   float4 FC_BmpBlendParam1;          // Offset:  208 Size:    16 [unused]
//   float FC_UNUSED_SSS_ID;            // Offset:  224 Size:     4 [unused]
//   float4 FC_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]
//
// }
//
// 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 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 [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
//   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_WrapLinear                     sampler      NA          NA    8        1
// MultiBlend2_et1_p_snp_0_Texture2D_6    texture  float4          2d    2        1
// MultiBlend2_et1_p_snp_0_Texture2D_5    texture  float4          2d    3        1
// MultiBlend2_et1_p_snp_0_Texture2D_2    texture  float4          2d    4        1
// MultiBlend2_et1_p_snp_0_Texture2D_14    texture  float4          2d    5        1
// MultiBlend2_et1_p_snp_0_Texture2D_13    texture  float4          2d    6        1
// MultiBlend2_et1_p_snp_0_Texture2D_1    texture  float4          2d    8        1
// MultiBlend2_et1_p_snp_0_Texture2D_0    texture  float4          2d    9        1
// g_DitherTexture                   texture  float4          2d   38        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
//
//
//
// 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   x   
// 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
// 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
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[15], immediateIndexed
dcl_constantbuffer cb2[41], immediateIndexed
dcl_constantbuffer cb3[6], immediateIndexed
dcl_constantbuffer cb8[23], immediateIndexed
dcl_constantbuffer cb4[34], dynamicIndexed
dcl_constantbuffer cb7[3], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s8, 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) t8
dcl_resource_texture2d (float,float,float,float) t9
dcl_resource_texture2d (float,float,float,float) t38
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.x
dcl_input_ps_sgv v7.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_temps 10
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
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 r4.x, -r3.x, cb8[20].w
add r4.y, -r3.y, cb8[21].w
add r4.z, -r3.z, cb8[22].w
dp3 r3.x, r4.xyzx, r0.xyzx
dp3 r3.y, r4.xyzx, r2.xyzx
dp3 r3.z, r4.xyzx, r1.xyzx
mad r5.xy, v5.xyxx, cb1[13].xyxx, cb1[13].zwzz
dp2 r0.w, -r3.xyxx, -r3.xyxx
rsq r0.w, r0.w
mul r5.zw, r0.wwww, -r3.xxxy
dp3 r0.w, -r3.xyzx, -r3.xyzx
mad r0.w, -r3.z, r3.z, r0.w
sqrt r0.w, r0.w
div r0.w, r0.w, -r3.z
mul r3.xy, r0.wwww, r5.zwzz
mul r3.zw, r3.xxxy, cb2[39].wwww
dp3 r0.w, -r4.xyzx, -r4.xyzx
rsq r0.w, r0.w
mul r4.xyz, r0.wwww, -r4.xyzx
dp3 r0.w, r1.xyzx, r1.xyzx
rsq r0.w, r0.w
mul r6.xyz, r0.wwww, r1.xyzx
deriv_rtx_coarse r5.zw, r5.xxxy
deriv_rty_coarse r7.xy, r5.xyxx
add r7.zw, |r5.zzzw|, |r7.xxxy|
resinfo_indexable(texture2d)(float,float,float,float)_uint r8.xy, l(0), t6.xyzw
utof r8.xy, r8.xyxx
mul r7.zw, r7.zzzw, r8.xxxy
max r0.w, r7.w, r7.z
log r0.w, r0.w
max r0.w, r0.w, l(0.000000)
ge r1.w, l(16.000000), r0.w
dp3 r2.w, r4.xyzx, r6.xyzx
round_z r4.xy, cb2[40].yzyy
add r4.y, -r4.x, r4.y
mad r2.w, |r2.w|, r4.y, r4.x
ftoi r4.x, r2.w
round_z r2.w, r2.w
div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w
mov r4.yz, r5.xxyx
mov r4.w, l(0)
mov r6.zw, l(0,0,1.000000,1.000000)
mov r8.xyzw, l(0,0,0,0)
loop 
  ige r7.z, r4.w, r4.x
  breakc_nz r7.z
  mad r4.yz, -r2.wwww, r3.zzwz, r4.yyzy
  sample_d_indexable(texture2d)(float,float,float,float) r6.y, r4.yzyy, t6.xwyz, s0, r5.zwzz, r7.xyxx
  add r6.x, -r2.w, r6.z
  lt r7.z, r6.x, r6.y
  movc r7.w, r7.z, r4.x, r4.w
  movc r8.xyzw, r7.zzzz, r6.xyzw, r8.xyzw
  iadd r4.w, r7.w, l(1)
  mov r6.zw, r6.xxxy
endloop 
add r4.yz, -r8.wwyw, r8.zzxz
add r4.w, -r4.z, r4.y
mul r4.z, r4.z, r8.z
mad r4.y, r8.x, r4.y, -r4.z
div r4.y, r4.y, r4.w
add r4.y, -r4.y, l(1.000000)
mad r3.zw, -r3.zzzw, r4.yyyy, r5.xxxy
lt r4.y, l(15.000000), r0.w
round_z r4.z, r0.w
add r0.w, r0.w, -r4.z
add r4.zw, -r3.zzzw, r5.xxxy
mad r4.zw, r0.wwww, r4.zzzw, r3.zzzw
movc r3.zw, r4.yyyy, r4.zzzw, r3.zzzw
movc r3.zw, r1.wwww, r3.zzzw, r5.xxxy
add r3.zw, -r5.xxxy, r3.zzzw
div r3.zw, r3.zzzw, cb1[13].xxxy
add r3.zw, r3.zzzw, v5.xxxy
mad r4.yz, r3.zzwz, cb1[1].xxyx, cb1[1].zzwz
sample_indexable(texture2d)(float,float,float,float) r4.yzw, r4.yzyy, t8.wxyz, s0
mad r5.xy, v5.xyxx, cb1[14].xyxx, cb1[14].zwzz
mul r3.xy, r3.xyxx, cb2[40].xxxx
deriv_rtx_coarse r5.zw, r5.xxxy
deriv_rty_coarse r6.xy, r5.xyxx
add r6.zw, |r5.zzzw|, |r6.xxxy|
resinfo_indexable(texture2d)(float,float,float,float)_uint r7.xy, l(0), t5.xyzw
utof r7.xy, r7.xyxx
mul r6.zw, r6.zzzw, r7.xxxy
max r0.w, r6.w, r6.z
log r0.w, r0.w
max r0.w, r0.w, l(0.000000)
ge r1.w, l(16.000000), r0.w
mov r6.zw, r5.xxxy
mov r8.x, l(0)
mov r7.zw, l(0,0,1.000000,1.000000)
mov r9.xyzw, l(0,0,0,0)
loop 
  ige r8.y, r8.x, r4.x
  breakc_nz r8.y
  mad r6.zw, -r2.wwww, r3.xxxy, r6.zzzw
  sample_d_indexable(texture2d)(float,float,float,float) r7.y, r6.zwzz, t5.xwyz, s0, r5.zwzz, r6.xyxx
  add r7.x, -r2.w, r7.z
  lt r8.y, r7.x, r7.y
  movc r8.z, r8.y, r4.x, r8.x
  movc r9.xyzw, r8.yyyy, r7.xyzw, r9.xyzw
  iadd r8.x, r8.z, l(1)
  mov r7.zw, r7.xxxy
endloop 
add r2.w, -r9.w, r9.z
add r4.x, -r9.y, r9.x
add r5.z, r2.w, -r4.x
mul r4.x, r4.x, r9.z
mad r2.w, r9.x, r2.w, -r4.x
div r2.w, r2.w, r5.z
add r2.w, -r2.w, l(1.000000)
mad r3.xy, -r3.xyxx, r2.wwww, r5.xyxx
lt r2.w, l(15.000000), r0.w
round_z r4.x, r0.w
add r0.w, r0.w, -r4.x
add r5.zw, -r3.xxxy, r5.xxxy
mad r5.zw, r0.wwww, r5.zzzw, r3.xxxy
movc r3.xy, r2.wwww, r5.zwzz, r3.xyxx
movc r3.xy, r1.wwww, r3.xyxx, r5.xyxx
add r3.xy, -r5.xyxx, r3.xyxx
div r3.xy, r3.xyxx, cb1[14].xyxx
add r3.xy, r3.xyxx, v5.xyxx
mad r5.xy, r3.xyxx, cb1[2].xyxx, cb1[2].zwzz
sample_indexable(texture2d)(float,float,float,float) r5.xyz, r5.xyxx, t4.xyzw, s0
mul r6.xy, r3.zwzz, cb2[39].zzzz
mad r6.xy, r6.xyxx, cb1[0].xyxx, cb1[0].zwzz
sample_indexable(texture2d)(float,float,float,float) r0.w, r6.xyxx, t9.yzwx, s0
add r0.w, r0.w, l(0.010000)
mul r0.w, r0.w, cb2[39].x
add r1.w, -v6.x, l(1.000000)
mad r0.w, -r0.w, r1.w, v6.x
mad r1.w, v4.w, cb2[39].y, l(1.000000)
mul_sat r0.w, r0.w, r1.w
add r5.xyz, -r4.yzwy, r5.xyzx
mad r4.xyz, r0.wwww, r5.xyzx, r4.yzwy
mad r5.xy, r3.zwzz, cb1[13].xyxx, cb1[13].zwzz
sample_indexable(texture2d)(float,float,float,float) r5.xyz, r5.xyxx, t6.xyzw, s0
mad r6.xy, r3.xyxx, cb1[14].xyxx, cb1[14].zwzz
sample_indexable(texture2d)(float,float,float,float) r6.xyz, r6.xyxx, t5.xyzw, s0
add r6.xyz, -r5.xyzx, r6.xyzx
mad r5.xyz, r0.wwww, r6.xyzx, r5.xyzx
mad r5.xy, r5.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r1.w, r5.xyxx, r5.xyxx
min r1.w, r1.w, l(1.000000)
add r1.w, -r1.w, l(1.000000)
sqrt r1.w, r1.w
mul r2.xyz, r2.xyzx, r5.yyyy
mad r0.xyz, r5.xxxx, r0.xyzx, r2.xyzx
mad r0.xyz, r1.wwww, r1.xyzx, r0.xyzx
dp3 r1.x, r0.xyzx, r0.xyzx
rsq r1.x, r1.x
mul r1.xyz, r0.xyzx, r1.xxxx
mad r0.xy, r3.zwzz, cb1[5].xyxx, cb1[5].zwzz
sample_indexable(texture2d)(float,float,float,float) r0.xyz, r0.xyxx, t3.xyzw, s0
mad r2.xy, r3.xyxx, cb1[6].xyxx, cb1[6].zwzz
sample_indexable(texture2d)(float,float,float,float) r2.xyz, r2.xyxx, t2.xyzw, s0
add r2.xyz, -r0.xyzx, r2.xyzx
mad r0.xyz, r0.wwww, r2.xyzx, r0.xyzx
round_ne r0.w, v1.w
ftou r0.w, r0.w
mul r2.xy, v0.xyxx, l(0.250000, 0.250000, 0.000000, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r2.x, r2.xyxx, t38.wxyz, s8
add r2.yzw, -r0.xxyz, l(0.000000, 1.000000, 1.000000, 1.000000)
imul null, r0.w, r0.w, l(17)
mov r1.w, l(1.000000)
dp4 r3.x, r1.xyzw, cb4[r0.w + 8].xyzw
dp4 r3.y, r1.xyzw, cb4[r0.w + 9].xyzw
dp4 r3.z, r1.xyzw, cb4[r0.w + 10].xyzw
max r3.xyz, r3.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mul r3.xyz, r2.yzwy, r3.xyzx
add r1.w, r2.x, l(-0.500000)
lt r2.x, l(0.000000), cb7[2].x
ine r2.y, l(0), cb2[0].x
and r2.x, r2.y, r2.x
mad r2.y, r1.w, l(0.999000), cb4[r0.w + 16].x
lt r2.y, r2.y, l(0.500000)
and r2.x, r2.y, r2.x
lt r2.y, l(0.000000), cb3[5].x
eq r2.z, l(0.000000), cb4[r0.w + 7].w
and r2.y, r2.z, r2.y
mad r1.w, r1.w, cb3[5].y, l(1.000000)
lt r1.w, r1.w, cb3[5].x
or r1.w, r1.w, r2.y
or r1.w, r2.x, r1.w
discard_nz r1.w
mad r2.xyz, r1.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500489, 0.500489, 0.500489, 0.000000)
utof r1.x, cb4[r0.w + 6].x
mul r1.y, r1.x, l(0.003922)
sqrt r6.xyz, r0.xyzx
ne r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb3[5].z
mov r1.xz, l(0,0,1.000000,0)
movc r0.xyz, r0.xxxx, cb4[r0.w + 7].wwww, r1.xyzx
mov r2.w, r0.x
movc o0.xyzw, r1.wwww, l(0,0,0,0), r2.xyzw
movc o1.x, r1.w, l(0), r5.z
mov o1.y, l(0)
movc o1.z, r1.w, l(0), cb4[r0.w + 11].x
movc o1.w, r1.w, l(0), r0.x
mov r4.w, cb4[r0.w + 7].w
movc o2.xyzw, r1.wwww, l(0,0,0,0), r4.xyzw
mov r6.w, r0.y
movc o3.xyzw, r1.wwww, l(0,0,0,0), r6.xyzw
mov r3.w, r0.z
movc o4.xyzw, r1.wwww, l(0,0,0,0), r3.xyzw
ret 
// Approximately 221 instruction slots used

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