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

cbuffer buffer2 : register(b2)
{
  bool FC_isDitherAlpha : packoffset(c0);
  float FC_TranslucencyScale : packoffset(c1);
  float4 FC_EmissiveColor : packoffset(c2);
  float4 FC_BlendMaskParam : packoffset(c3);
  float FC_PomHeightScale : packoffset(c4);
  float FC_PomHeightBias : packoffset(c4.y);
  float FC_PomMinSamples : packoffset(c4.z);
  float FC_PomMaxSamples : packoffset(c4.w);
  float FC_PomShadowSoftening : packoffset(c5);
  bool FC_bPomDisplayShadows : packoffset(c5.y);
  float4 FC_ParallaxParam : packoffset(c6);
  float FC_Pom2HeightScale : packoffset(c7);
  float FC_Pom2HeightBias : packoffset(c7.y);
  float FC_Pom2MinSamples : packoffset(c7.z);
  float FC_Pom2MaxSamples : packoffset(c7.w);
  bool VC_isEnableCloth : packoffset(c8);
  float FC_EnvMapDolBlendRate : packoffset(c9);
  float4 FC_SnowMaskParam : packoffset(c10);
  float FC_FROZEN_THRESHOLD : packoffset(c11);
  float FC_FROZEN_POW : packoffset(c11.y);
  float FC_BlendRate : packoffset(c12);
  float4 FC_FlowMapUvTiling : packoffset(c13);
  float4 FC_FlowMapIntencity : packoffset(c14);
  float4 FC_WaterNormalUvScrollSpeed : packoffset(c15);
  float4 FC_WaterDiffuseUvScrollSpeed : packoffset(c16);
  float4 FC_WaterMiddleUvScrollSpeed : packoffset(c17);
  float4 FC_WaterFogParam0 : packoffset(c18);
  float4 FC_WaterFogParam1 : packoffset(c19);
  float4 FC_WaterFresnel : packoffset(c20);
  float4 FC_WaterFadeParam : packoffset(c21);
  float4 FC_SAT_DUMMMY_P3_2 : packoffset(c22);
  float4 FC_SAT_DUMMMY_P3_3 : packoffset(c23);
  float4 FC_SAT_DUMMMY_P3_4 : packoffset(c24);
  float4 FC_SAT_DUMMMY_P3_5 : packoffset(c25);
  float4 FC_SAT_DUMMMY_P3_6 : packoffset(c26);
  float4 FC_SAT_DUMMMY_P3_7 : packoffset(c27);
  float4 FC_SAT_DUMMMY_P3_8 : packoffset(c28);
  float MultiBlend4_et1_p_snp_0_float_0_0 : packoffset(c29);
  float MultiBlend4_et1_p_snp_0_float_1_0 : packoffset(c29.y);
  float MultiBlend4_et1_p_snp_0_float_2_0 : packoffset(c29.z);
  float MultiBlend4_et1_p_snp_0_float_3_0 : packoffset(c29.w);
}

cbuffer buffer3 : 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);
  float3 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_SSS_ID : packoffset(c14);
  float4 FC_SAT_DUMMMY_P7_2 : packoffset(c15);
  float4 FC_SAT_DUMMMY_P7_3 : packoffset(c16);
  float4 FC_SAT_DUMMMY_P7_4 : packoffset(c17);
  float4 FC_SAT_DUMMMY_P7_5 : packoffset(c18);
  float4 FC_SAT_DUMMMY_P7_6 : packoffset(c19);
  float4 FC_SAT_DUMMMY_P7_6_1 : packoffset(c20);
  float4 FC_SAT_DUMMMY_P7_6_2 : packoffset(c21);
  float4 FC_SAT_DUMMMY_P7_6_3 : packoffset(c22);
  float4 FC_SAT_DUMMMY_P7_7 : 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 cbPerFrame : register(b9)
{
  float4 FC_DebugParam : packoffset(c0);
  float4 FC_DebugOutputMode : packoffset(c1);
  float4 FC_DebugParam2 : packoffset(c2);
  float FC_GlobalSpecularMask : packoffset(c3);
  float FC_GlobalReflectanceScale : packoffset(c3.y);
  float FC_GlobalShininessScale : packoffset(c3.z);
  float4 FC_SnowDir : packoffset(c4);
  float4 FC_SnowTilingScale : packoffset(c5);
  float4 FC_SnowAlbedo : packoffset(c6);
  float FC_SnowReflectance : packoffset(c7);
  float FC_GroundPlaneHeight : packoffset(c7.y);
  float FC_RcpSnowHeightRange : packoffset(c7.z);
  float FC_SnowNormalScale : packoffset(c7.w);
  float4 FC_SnowSpakleTinlingScale : packoffset(c8);
  float FC_GlobalTime : packoffset(c9);
  float FC_DominantSharpnesMinValue : packoffset(c10);
  float FC_DominantSharpnesOffset : packoffset(c10.y);
  float FC_DominantSharpnesExponent : packoffset(c10.z);
  float FC_DominantColorScale : packoffset(c10.w);
}

cbuffer cbInstanceData : register(b4)
{

  struct
  {
    float4x3 mWorld;
    float4 atlasUvScaleOffset;
    float4 userClipPlane;
    uint4 matricesData;
    uint4 envData;
    float4 mulCol;
    float envMapInterpRatio;
    float envMapColorScale0;
    float envMapColorScale1;
    float giOcclusionMask;
    float4 aSh[3];
  } VC_InstanceData[2] : packoffset(c0);

}

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

SamplerState SS_DiffuseMap_s : register(s0);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_16 : register(t1);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_15 : register(t2);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_14 : register(t3);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_13 : register(t4);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_0 : register(t9);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_9 : register(t12);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_10 : register(t13);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_11 : register(t14);
Texture2D<float4> MultiBlend4_et1_p_snp_0_Texture2D_12 : register(t15);


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


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

  r0.xy = MultiBlend4_et1_p_snp_0_float_2_0 * v8.xy;
  r0.xy = r0.xy * FC_TextureTilingScale[0].xy + FC_TextureTilingScale[0].zw;
  r0.x = MultiBlend4_et1_p_snp_0_Texture2D_0.Sample(SS_DiffuseMap_s, r0.xy).x;
  r1.x = dot(v7.xyz, v4.xyz);
  r1.y = dot(v7.xyz, v3.xyz);
  r1.z = dot(v7.xyz, v2.xyz);
  r0.yz = v8.xy * FC_TextureTilingScale[14].xy + FC_TextureTilingScale[14].zw;
  r0.w = dot(-r1.xy, -r1.xy);
  r0.w = rsqrt(r0.w);
  r2.xy = -r1.xy * r0.ww;
  r0.w = dot(-r1.xyz, -r1.xyz);
  r0.w = -r1.z * r1.z + r0.w;
  r0.w = sqrt(r0.w);
  r0.w = r0.w / -r1.z;
  r1.xy = r2.xy * r0.ww;
  r1.xy = MultiBlend4_et1_p_snp_0_float_3_0 * r1.xy;
  r0.w = dot(-v7.xyz, -v7.xyz);
  r0.w = rsqrt(r0.w);
  r2.xyz = -v7.xyz * r0.www;
  r0.w = dot(v2.xyz, v2.xyz);
  r0.w = rsqrt(r0.w);
  r3.xyz = v2.xyz * r0.www;
  r1.zw = ddx_coarse(r0.yz);
  r4.xy = ddy_coarse(r0.yz);
  r4.zw = abs(r4.xy) + abs(r1.zw);
  MultiBlend4_et1_p_snp_0_Texture2D_14.GetDimensions(0, uiDest.x, uiDest.y, uiDest.z);
  r5.xy = uiDest.xy;
  r5.xy = (uint2)r5.xy;
  r4.zw = r5.xy * r4.zw;
  r0.w = max(r4.z, r4.w);
  r0.w = log2(r0.w);
  r0.w = max(0, r0.w);
  r2.w = cmp(4 >= r0.w);
  if (r2.w != 0) {
    r2.w = dot(r2.xyz, r3.xyz);
    r2.w = abs(r2.w) * -12 + 16;
    r3.w = (int)r2.w;
    r2.w = trunc(r2.w);
    r2.w = 1 / r2.w;
    r4.zw = r0.yz;
    r6.x = 0;
    r5.zw = float2(1,1);
    r7.xyzw = float4(0,0,0,0);
    while (true) {
      r6.y = cmp((int)r6.x >= (int)r3.w);
      if (r6.y != 0) break;
      r4.zw = -r2.ww * r1.xy + r4.zw;
      r6.y = MultiBlend4_et1_p_snp_0_Texture2D_14.SampleGrad(SS_DiffuseMap_s, r4.zw, r1.w, r4.y).w;
      r5.x = r5.z + -r2.w;
      r6.z = cmp(r5.x < r6.y);
      r6.w = r6.z ? r3.w : r6.x;
      r5.y = r6.y;
      r7.xyzw = r6.zzzz ? r5.xyzw : r7.xyzw;
      r6.x = (int)r6.w + 1;
      r5.w = r6.y;
      r5.z = r5.x;
    }
    r1.zw = r7.zx + -r7.wy;
    r2.w = r1.z + -r1.w;
    r1.w = r7.z * r1.w;
    r1.z = r7.x * r1.z + -r1.w;
    r1.z = r1.z / r2.w;
    r1.z = 1 + -r1.z;
    r1.zw = -r1.xy * r1.zz + r0.yz;
    r2.w = cmp(3 < r0.w);
    r3.w = trunc(r0.w);
    r0.w = -r3.w + r0.w;
    r4.xy = -r1.zw + r0.yz;
    r4.xy = r0.ww * r4.xy + r1.zw;
    r1.zw = r2.ww ? r4.xy : r1.zw;
  } else {
    r1.zw = r0.yz;
  }
  r0.yz = r1.zw + -r0.yz;
  r0.yz = v8.xy + r0.yz;
  r1.zw = v8.xy * FC_TextureTilingScale[13].xy + FC_TextureTilingScale[13].zw;
  r4.xy = ddx_coarse(r1.zw);
  r4.zw = ddy_coarse(r1.zw);
  r5.xy = abs(r4.xy) + abs(r4.zw);
  MultiBlend4_et1_p_snp_0_Texture2D_13.GetDimensions(0, uiDest.x, uiDest.y, uiDest.z);
  r5.zw = uiDest.xy;
  r5.zw = (uint2)r5.zw;
  r5.xy = r5.xy * r5.zw;
  r0.w = max(r5.x, r5.y);
  r0.w = log2(r0.w);
  r0.w = max(0, r0.w);
  r2.w = cmp(4 >= r0.w);
  if (r2.w != 0) {
    r2.w = dot(r2.xyz, r3.xyz);
    r2.w = abs(r2.w) * -12 + 16;
    r3.w = (int)r2.w;
    r2.w = trunc(r2.w);
    r2.w = 1 / r2.w;
    r5.xy = r1.zw;
    r5.z = 0;
    r6.zw = float2(1,1);
    r7.xyzw = float4(0,0,0,0);
    while (true) {
      r5.w = cmp((int)r5.z >= (int)r3.w);
      if (r5.w != 0) break;
      r5.xy = -r2.ww * r1.xy + r5.xy;
      r5.w = MultiBlend4_et1_p_snp_0_Texture2D_13.SampleGrad(SS_DiffuseMap_s, r5.xy, r4.x, r4.z).w;
      r6.x = r6.z + -r2.w;
      r8.x = cmp(r6.x < r5.w);
      r8.y = r8.x ? r3.w : r5.z;
      r6.y = r5.w;
      r7.xyzw = r8.xxxx ? r6.xyzw : r7.xyzw;
      r5.z = (int)r8.y + 1;
      r6.w = r5.w;
      r6.z = r6.x;
    }
    r2.w = r7.z + -r7.w;
    r3.w = r7.x + -r7.y;
    r4.x = -r3.w + r2.w;
    r3.w = r7.z * r3.w;
    r2.w = r7.x * r2.w + -r3.w;
    r2.w = r2.w / r4.x;
    r2.w = 1 + -r2.w;
    r4.xy = -r1.xy * r2.ww + r1.zw;
    r2.w = cmp(3 < r0.w);
    r3.w = trunc(r0.w);
    r0.w = -r3.w + r0.w;
    r4.zw = -r4.xy + r1.zw;
    r4.zw = r0.ww * r4.zw + r4.xy;
    r4.xy = r2.ww ? r4.zw : r4.xy;
  } else {
    r4.xy = r1.zw;
  }
  r1.zw = r4.xy + -r1.zw;
  r4.xy = v8.xy * FC_TextureTilingScale[16].xy + FC_TextureTilingScale[16].zw;
  r4.zw = ddx_coarse(r4.xy);
  r5.xy = ddy_coarse(r4.xy);
  r5.zw = abs(r5.xy) + abs(r4.zw);
  MultiBlend4_et1_p_snp_0_Texture2D_16.GetDimensions(0, uiDest.x, uiDest.y, uiDest.z);
  r6.xy = uiDest.xy;
  r6.xy = (uint2)r6.xy;
  r5.zw = r6.xy * r5.zw;
  r0.w = max(r5.z, r5.w);
  r0.w = log2(r0.w);
  r0.w = max(0, r0.w);
  r2.w = cmp(4 >= r0.w);
  if (r2.w != 0) {
    r2.w = dot(r2.xyz, r3.xyz);
    r2.w = abs(r2.w) * -12 + 16;
    r3.w = (int)r2.w;
    r2.w = trunc(r2.w);
    r2.w = 1 / r2.w;
    r5.zw = r4.xy;
    r7.x = 0;
    r6.zw = float2(1,1);
    r8.xyzw = float4(0,0,0,0);
    while (true) {
      r7.y = cmp((int)r7.x >= (int)r3.w);
      if (r7.y != 0) break;
      r5.zw = -r2.ww * r1.xy + r5.zw;
      r7.y = MultiBlend4_et1_p_snp_0_Texture2D_16.SampleGrad(SS_DiffuseMap_s, r5.zw, r4.w, r5.y).w;
      r6.x = r6.z + -r2.w;
      r7.z = cmp(r6.x < r7.y);
      r7.w = r7.z ? r3.w : r7.x;
      r6.y = r7.y;
      r8.xyzw = r7.zzzz ? r6.xyzw : r8.xyzw;
      r7.x = (int)r7.w + 1;
      r6.w = r7.y;
      r6.z = r6.x;
    }
    r2.w = r8.z + -r8.w;
    r3.w = r8.x + -r8.y;
    r4.z = -r3.w + r2.w;
    r3.w = r8.z * r3.w;
    r2.w = r8.x * r2.w + -r3.w;
    r2.w = r2.w / r4.z;
    r2.w = 1 + -r2.w;
    r4.zw = -r1.xy * r2.ww + r4.xy;
    r2.w = cmp(3 < r0.w);
    r3.w = trunc(r0.w);
    r0.w = -r3.w + r0.w;
    r5.xy = r4.xy + -r4.zw;
    r5.xy = r0.ww * r5.xy + r4.zw;
    r4.zw = r2.ww ? r5.xy : r4.zw;
  } else {
    r4.zw = r4.xy;
  }
  r4.xy = r4.zw + -r4.xy;
  r4.xy = v8.xy + r4.xy;
  r4.zw = v8.xy * FC_TextureTilingScale[15].xy + FC_TextureTilingScale[15].zw;
  r5.xy = ddx_coarse(r4.zw);
  r5.zw = ddy_coarse(r4.zw);
  r6.xy = abs(r5.xy) + abs(r5.zw);
  MultiBlend4_et1_p_snp_0_Texture2D_15.GetDimensions(0, uiDest.x, uiDest.y, uiDest.z);
  r6.zw = uiDest.xy;
  r6.zw = (uint2)r6.zw;
  r6.xy = r6.xy * r6.zw;
  r0.w = max(r6.x, r6.y);
  r0.w = log2(r0.w);
  r0.w = max(0, r0.w);
  r2.w = cmp(4 >= r0.w);
  if (r2.w != 0) {
    r2.x = dot(r2.xyz, r3.xyz);
    r2.x = abs(r2.x) * -12 + 16;
    r2.y = (int)r2.x;
    r2.x = trunc(r2.x);
    r2.x = 1 / r2.x;
    r2.zw = r4.zw;
    r6.x = 0;
    r3.zw = float2(1,1);
    r7.xyzw = float4(0,0,0,0);
    while (true) {
      r6.y = cmp((int)r6.x >= (int)r2.y);
      if (r6.y != 0) break;
      r2.zw = -r2.xx * r1.xy + r2.zw;
      r6.y = MultiBlend4_et1_p_snp_0_Texture2D_15.SampleGrad(SS_DiffuseMap_s, r2.zw, r5.y, r5.w).w;
      r3.x = r3.z + -r2.x;
      r6.z = cmp(r3.x < r6.y);
      r6.w = r6.z ? r2.y : r6.x;
      r3.y = r6.y;
      r7.xyzw = r6.zzzz ? r3.xyzw : r7.xyzw;
      r6.x = (int)r6.w + 1;
      r3.w = r6.y;
      r3.z = r3.x;
    }
    r2.xy = r7.zx + -r7.wy;
    r2.z = r2.x + -r2.y;
    r2.y = r7.z * r2.y;
    r2.x = r7.x * r2.x + -r2.y;
    r2.x = r2.x / r2.z;
    r2.x = 1 + -r2.x;
    r1.xy = -r1.xy * r2.xx + r4.zw;
    r2.x = cmp(3 < r0.w);
    r2.y = trunc(r0.w);
    r0.w = -r2.y + r0.w;
    r2.yz = r4.zw + -r1.xy;
    r2.yz = r0.ww * r2.yz + r1.xy;
    r1.xy = r2.xx ? r2.yz : r1.xy;
  } else {
    r1.xy = r4.zw;
  }
  r1.xy = r1.xy + -r4.zw;
  r1.xyzw = v8.xyxy + r1.xyzw;
  r2.xy = r1.zw * FC_TextureTilingScale[13].xy + FC_TextureTilingScale[13].zw;
  r2.xy = MultiBlend4_et1_p_snp_0_Texture2D_13.Sample(SS_DiffuseMap_s, r2.xy).xy;
  r2.xy = r2.xy * float2(2,2) + float2(-1,-1);
  r0.w = dot(r2.xy, r2.xy);
  r0.w = 1 + -r0.w;
  r0.w = max(0, r0.w);
  r0.w = sqrt(r0.w);
  r2.yzw = v3.xyz * r2.yyy;
  r2.xyz = r2.xxx * v4.xyz + r2.yzw;
  r2.xyz = r0.www * v2.xyz + r2.xyz;
  r0.w = dot(r2.xyz, r2.xyz);
  r0.w = rsqrt(r0.w);
  r2.xyz = r2.xyz * r0.www;
  r3.xy = r0.yz * FC_TextureTilingScale[14].xy + FC_TextureTilingScale[14].zw;
  r3.xy = MultiBlend4_et1_p_snp_0_Texture2D_14.Sample(SS_DiffuseMap_s, r3.xy).xy;
  r3.xy = r3.xy * float2(2,2) + float2(-1,-1);
  r0.w = dot(r3.xy, r3.xy);
  r0.w = 1 + -r0.w;
  r0.w = max(0, r0.w);
  r0.w = sqrt(r0.w);
  r3.yzw = v3.xyz * r3.yyy;
  r3.xyz = r3.xxx * v4.xyz + r3.yzw;
  r3.xyz = r0.www * v2.xyz + r3.xyz;
  r0.w = dot(r3.xyz, r3.xyz);
  r0.w = rsqrt(r0.w);
  r4.zw = r1.xy * FC_TextureTilingScale[15].xy + FC_TextureTilingScale[15].zw;
  r4.zw = MultiBlend4_et1_p_snp_0_Texture2D_15.Sample(SS_DiffuseMap_s, r4.zw).xy;
  r4.zw = r4.zw * float2(2,2) + float2(-1,-1);
  r2.w = dot(r4.zw, r4.zw);
  r2.w = 1 + -r2.w;
  r2.w = max(0, r2.w);
  r2.w = sqrt(r2.w);
  r5.xyz = v3.xyz * r4.www;
  r5.xyz = r4.zzz * v4.xyz + r5.xyz;
  r5.xyz = r2.www * v2.xyz + r5.xyz;
  r2.w = dot(r5.xyz, r5.xyz);
  r2.w = rsqrt(r2.w);
  r4.zw = r4.xy * FC_TextureTilingScale[16].xy + FC_TextureTilingScale[16].zw;
  r4.zw = MultiBlend4_et1_p_snp_0_Texture2D_16.Sample(SS_DiffuseMap_s, r4.zw).xy;
  r4.zw = r4.zw * float2(2,2) + float2(-1,-1);
  r3.w = dot(r4.zw, r4.zw);
  r3.w = 1 + -r3.w;
  r3.w = max(0, r3.w);
  r3.w = sqrt(r3.w);
  r6.xyz = v3.xyz * r4.www;
  r6.xyz = r4.zzz * v4.xyz + r6.xyz;
  r6.xyz = r3.www * v2.xyz + r6.xyz;
  r3.w = dot(r6.xyz, r6.xyz);
  r3.w = rsqrt(r3.w);
  r0.x = 0.00999999978 + r0.x;
  r0.x = MultiBlend4_et1_p_snp_0_float_0_0 * r0.x;
  r7.xyz = float3(1,1,1) + -v9.xyz;
  r7.xyz = -r0.xxx * r7.xyz + v9.xyz;
  r0.x = v1.w * MultiBlend4_et1_p_snp_0_float_1_0 + 1;
  r7.xyz = saturate(r7.xyz * r0.xxx);
  r3.xyz = r3.xyz * r0.www + -r2.xyz;
  r2.xyz = r7.xxx * r3.xyz + r2.xyz;
  r3.xyz = r5.xyz * r2.www + -r2.xyz;
  r2.xyz = r7.yyy * r3.xyz + r2.xyz;
  r3.xyz = r6.xyz * r3.www + -r2.xyz;
  r2.xyz = r7.zzz * r3.xyz + r2.xyz;
  r0.xw = r1.xy * FC_TextureTilingScale[11].xy + FC_TextureTilingScale[11].zw;
  r0.x = MultiBlend4_et1_p_snp_0_Texture2D_11.Sample(SS_DiffuseMap_s, r0.xw).x;
  r1.xy = r1.zw * FC_TextureTilingScale[9].xy + FC_TextureTilingScale[9].zw;
  r0.w = MultiBlend4_et1_p_snp_0_Texture2D_9.Sample(SS_DiffuseMap_s, r1.xy).x;
  r0.yz = r0.yz * FC_TextureTilingScale[10].xy + FC_TextureTilingScale[10].zw;
  r0.y = MultiBlend4_et1_p_snp_0_Texture2D_10.Sample(SS_DiffuseMap_s, r0.yz).x;
  r1.xy = r4.xy * FC_TextureTilingScale[12].xy + FC_TextureTilingScale[12].zw;
  r0.z = MultiBlend4_et1_p_snp_0_Texture2D_12.Sample(SS_DiffuseMap_s, r1.xy).x;
  r0.y = r0.y + -r0.w;
  r0.y = r7.x * r0.y + r0.w;
  r0.x = r0.x + -r0.y;
  r0.x = r7.y * r0.x + r0.y;
  r0.y = r0.z + -r0.x;
  r0.x = r7.z * r0.y + r0.x;
  r0.y = dot(r2.xyz, r2.xyz);
  r0.y = rsqrt(r0.y);
  r0.yzw = r2.xyz * r0.yyy;
  r1.x = FC_GlobalShininessScale * r0.x;
  o0.xyz = r0.yzw * float3(0.5,0.5,0.5) + float3(0.500488758,0.500488758,0.500488758);
  r0.x = cmp(0 != FC_AlphaRef.z);
  r1.yz = float2(1,0);
  r0.xy = r0.xx ? VC_InstanceData[0].mulCol.ww : r1.xy;
  o0.w = r0.x;
  r1.w = r0.y;
  o1.xyzw = r1.xzzw;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//
// Buffer Definitions: 
//
// cbuffer buffer2
// {
//
//   bool FC_isDitherAlpha;             // Offset:    0 Size:     4 [unused]
//   float FC_TranslucencyScale;        // Offset:   16 Size:     4 [unused]
//   float4 FC_EmissiveColor;           // Offset:   32 Size:    16 [unused]
//   float4 FC_BlendMaskParam;          // Offset:   48 Size:    16 [unused]
//   float FC_PomHeightScale;           // Offset:   64 Size:     4 [unused]
//   float FC_PomHeightBias;            // Offset:   68 Size:     4 [unused]
//   float FC_PomMinSamples;            // Offset:   72 Size:     4 [unused]
//   float FC_PomMaxSamples;            // Offset:   76 Size:     4 [unused]
//   float FC_PomShadowSoftening;       // Offset:   80 Size:     4 [unused]
//   bool FC_bPomDisplayShadows;        // Offset:   84 Size:     4 [unused]
//   float4 FC_ParallaxParam;           // Offset:   96 Size:    16 [unused]
//   float FC_Pom2HeightScale;          // Offset:  112 Size:     4 [unused]
//   float FC_Pom2HeightBias;           // Offset:  116 Size:     4 [unused]
//   float FC_Pom2MinSamples;           // Offset:  120 Size:     4 [unused]
//   float FC_Pom2MaxSamples;           // Offset:  124 Size:     4 [unused]
//   bool VC_isEnableCloth;             // Offset:  128 Size:     4 [unused]
//   float FC_EnvMapDolBlendRate;       // Offset:  144 Size:     4 [unused]
//   float4 FC_SnowMaskParam;           // Offset:  160 Size:    16 [unused]
//   float FC_FROZEN_THRESHOLD;         // Offset:  176 Size:     4 [unused]
//   float FC_FROZEN_POW;               // Offset:  180 Size:     4 [unused]
//   float FC_BlendRate;                // Offset:  192 Size:     4 [unused]
//   float4 FC_FlowMapUvTiling;         // Offset:  208 Size:    16 [unused]
//   float4 FC_FlowMapIntencity;        // Offset:  224 Size:    16 [unused]
//   float4 FC_WaterNormalUvScrollSpeed;// Offset:  240 Size:    16 [unused]
//   float4 FC_WaterDiffuseUvScrollSpeed;// Offset:  256 Size:    16 [unused]
//   float4 FC_WaterMiddleUvScrollSpeed;// Offset:  272 Size:    16 [unused]
//   float4 FC_WaterFogParam0;          // Offset:  288 Size:    16 [unused]
//   float4 FC_WaterFogParam1;          // Offset:  304 Size:    16 [unused]
//   float4 FC_WaterFresnel;            // Offset:  320 Size:    16 [unused]
//   float4 FC_WaterFadeParam;          // Offset:  336 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P3_2;         // Offset:  352 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P3_3;         // Offset:  368 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P3_4;         // Offset:  384 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P3_5;         // Offset:  400 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P3_6;         // Offset:  416 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P3_7;         // Offset:  432 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P3_8;         // Offset:  448 Size:    16 [unused]
//   float MultiBlend4_et1_p_snp_0_float_0_0;// Offset:  464 Size:     4
//   float MultiBlend4_et1_p_snp_0_float_1_0;// Offset:  468 Size:     4
//   float MultiBlend4_et1_p_snp_0_float_2_0;// Offset:  472 Size:     4
//   float MultiBlend4_et1_p_snp_0_float_3_0;// Offset:  476 Size:     4
//
// }
//
// cbuffer buffer3
// {
//
//   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]
//   float3 FC_AlphaRef;                // Offset:   80 Size:    12
//   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_SSS_ID;                   // Offset:  224 Size:     4 [unused]
//   float4 FC_SAT_DUMMMY_P7_2;         // Offset:  240 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P7_3;         // Offset:  256 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P7_4;         // Offset:  272 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P7_5;         // Offset:  288 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P7_6;         // Offset:  304 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P7_6_1;       // Offset:  320 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P7_6_2;       // Offset:  336 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P7_6_3;       // Offset:  352 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P7_7;         // 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 cbPerFrame
// {
//
//   float4 FC_DebugParam;              // Offset:    0 Size:    16 [unused]
//   float4 FC_DebugOutputMode;         // Offset:   16 Size:    16 [unused]
//   float4 FC_DebugParam2;             // Offset:   32 Size:    16 [unused]
//   float FC_GlobalSpecularMask;       // Offset:   48 Size:     4 [unused]
//   float FC_GlobalReflectanceScale;   // Offset:   52 Size:     4 [unused]
//   float FC_GlobalShininessScale;     // Offset:   56 Size:     4
//   float4 FC_SnowDir;                 // Offset:   64 Size:    16 [unused]
//   float4 FC_SnowTilingScale;         // Offset:   80 Size:    16 [unused]
//   float4 FC_SnowAlbedo;              // Offset:   96 Size:    16 [unused]
//   float FC_SnowReflectance;          // Offset:  112 Size:     4 [unused]
//   float FC_GroundPlaneHeight;        // Offset:  116 Size:     4 [unused]
//   float FC_RcpSnowHeightRange;       // Offset:  120 Size:     4 [unused]
//   float FC_SnowNormalScale;          // Offset:  124 Size:     4 [unused]
//   float4 FC_SnowSpakleTinlingScale;  // Offset:  128 Size:    16 [unused]
//   float FC_GlobalTime;               // Offset:  144 Size:     4 [unused]
//   float FC_DominantSharpnesMinValue; // Offset:  160 Size:     4 [unused]
//   float FC_DominantSharpnesOffset;   // Offset:  164 Size:     4 [unused]
//   float FC_DominantSharpnesExponent; // Offset:  168 Size:     4 [unused]
//   float FC_DominantColorScale;       // Offset:  172 Size:     4 [unused]
//
// }
//
// cbuffer cbInstanceData
// {
//
//   struct PerInstanceData
//   {
//       
//       float4x3 mWorld;               // Offset:    0
//       float4 atlasUvScaleOffset;     // Offset:   48
//       float4 userClipPlane;          // Offset:   64
//       uint4 matricesData;            // Offset:   80
//       uint4 envData;                 // Offset:   96
//       float4 mulCol;                 // Offset:  112
//       float envMapInterpRatio;       // Offset:  128
//       float envMapColorScale0;       // Offset:  132
//       float envMapColorScale1;       // Offset:  136
//       float giOcclusionMask;         // Offset:  140
//       float4 aSh[3];                 // Offset:  144
//
//   } VC_InstanceData[2];              // Offset:    0 Size:   384
//
// }
//
// cbuffer cbTextureTilingScale
// {
//
//   float4 FC_TextureTilingScale[25];  // Offset:    0 Size:   400
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SS_DiffuseMap                     sampler      NA          NA    0        1
// MultiBlend4_et1_p_snp_0_Texture2D_16    texture  float4          2d    1        1
// MultiBlend4_et1_p_snp_0_Texture2D_15    texture  float4          2d    2        1
// MultiBlend4_et1_p_snp_0_Texture2D_14    texture  float4          2d    3        1
// MultiBlend4_et1_p_snp_0_Texture2D_13    texture  float4          2d    4        1
// MultiBlend4_et1_p_snp_0_Texture2D_0    texture  float4          2d    9        1
// MultiBlend4_et1_p_snp_0_Texture2D_9    texture  float4          2d   12        1
// MultiBlend4_et1_p_snp_0_Texture2D_10    texture  float4          2d   13        1
// MultiBlend4_et1_p_snp_0_Texture2D_11    texture  float4          2d   14        1
// MultiBlend4_et1_p_snp_0_Texture2D_12    texture  float4          2d   15        1
// cbTextureTilingScale              cbuffer      NA          NA    1        1
// buffer2                           cbuffer      NA          NA    2        1
// buffer3                           cbuffer      NA          NA    3        1
// cbInstanceData                    cbuffer      NA          NA    4        1
// cbPerFrame                        cbuffer      NA          NA    9        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float       
// COLOR                    0   xyzw        1     NONE   float      w
// NORMAL                   0   xyz         2     NONE   float   xyz 
// TANGENT                  0   xyz         3     NONE   float   xyz 
// BINORMAL                 0   xyz         4     NONE   float   xyz 
// POSITION                 1   xyzw        5     NONE   float       
// POSITION                 2   xyzw        6     NONE   float       
// TEXCOORD                29   xyz         7     NONE   float   xyz 
// TEXCOORD                 0   xy          8     NONE   float   xy  
// TEXCOORD                17   xyz         9     NONE   float   xyz 
// SV_IsFrontFace           0   x          10    FFACE    uint       
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
// SV_Target                1   xyzw        1   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb2[30], immediateIndexed
dcl_constantbuffer cb3[6], immediateIndexed
dcl_constantbuffer cb9[4], immediateIndexed
dcl_constantbuffer cb4[8], immediateIndexed
dcl_constantbuffer cb1[17], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t9
dcl_resource_texture2d (float,float,float,float) t12
dcl_resource_texture2d (float,float,float,float) t13
dcl_resource_texture2d (float,float,float,float) t14
dcl_resource_texture2d (float,float,float,float) t15
dcl_input_ps linear v1.w
dcl_input_ps linear v2.xyz
dcl_input_ps linear v3.xyz
dcl_input_ps linear v4.xyz
dcl_input_ps linear v7.xyz
dcl_input_ps linear v8.xy
dcl_input_ps linear v9.xyz
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_temps 9
mul r0.xy, v8.xyxx, cb2[29].zzzz
mad r0.xy, r0.xyxx, cb1[0].xyxx, cb1[0].zwzz
sample_indexable(texture2d)(float,float,float,float) r0.x, r0.xyxx, t9.xyzw, s0
dp3 r1.x, v7.xyzx, v4.xyzx
dp3 r1.y, v7.xyzx, v3.xyzx
dp3 r1.z, v7.xyzx, v2.xyzx
mad r0.yz, v8.xxyx, cb1[14].xxyx, cb1[14].zzwz
dp2 r0.w, -r1.xyxx, -r1.xyxx
rsq r0.w, r0.w
mul r2.xy, r0.wwww, -r1.xyxx
dp3 r0.w, -r1.xyzx, -r1.xyzx
mad r0.w, -r1.z, r1.z, r0.w
sqrt r0.w, r0.w
div r0.w, r0.w, -r1.z
mul r1.xy, r0.wwww, r2.xyxx
mul r1.xy, r1.xyxx, cb2[29].wwww
dp3 r0.w, -v7.xyzx, -v7.xyzx
rsq r0.w, r0.w
mul r2.xyz, r0.wwww, -v7.xyzx
dp3 r0.w, v2.xyzx, v2.xyzx
rsq r0.w, r0.w
mul r3.xyz, r0.wwww, v2.xyzx
deriv_rtx_coarse r1.zw, r0.yyyz
deriv_rty_coarse r4.xy, r0.yzyy
add r4.zw, |r1.zzzw|, |r4.xxxy|
resinfo_indexable(texture2d)(float,float,float,float)_uint r5.xy, l(0), t3.xyzw
utof r5.xy, r5.xyxx
mul r4.zw, r4.zzzw, r5.xxxy
max r0.w, r4.w, r4.z
log r0.w, r0.w
max r0.w, r0.w, l(0.000000)
ge r2.w, l(4.000000), r0.w
if_nz r2.w
  dp3 r2.w, r2.xyzx, r3.xyzx
  mad r2.w, |r2.w|, l(-12.000000), l(16.000000)
  ftoi r3.w, r2.w
  round_z r2.w, r2.w
  div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w
  mov r4.zw, r0.yyyz
  mov r6.x, l(0)
  mov r5.zw, l(0,0,1.000000,1.000000)
  mov r7.xyzw, l(0,0,0,0)
  loop 
    ige r6.y, r6.x, r3.w
    breakc_nz r6.y
    mad r4.zw, -r2.wwww, r1.xxxy, r4.zzzw
    sample_d_indexable(texture2d)(float,float,float,float) r6.y, r4.zwzz, t3.xwyz, s0, r1.zwzz, r4.xyxx
    add r5.x, -r2.w, r5.z
    lt r6.z, r5.x, r6.y
    movc r6.w, r6.z, r3.w, r6.x
    mov r5.y, r6.y
    movc r7.xyzw, r6.zzzz, r5.xyzw, r7.xyzw
    iadd r6.x, r6.w, l(1)
    mov r5.w, r6.y
    mov r5.z, r5.x
  endloop 
  add r1.zw, -r7.wwwy, r7.zzzx
  add r2.w, -r1.w, r1.z
  mul r1.w, r1.w, r7.z
  mad r1.z, r7.x, r1.z, -r1.w
  div r1.z, r1.z, r2.w
  add r1.z, -r1.z, l(1.000000)
  mad r1.zw, -r1.xxxy, r1.zzzz, r0.yyyz
  lt r2.w, l(3.000000), r0.w
  round_z r3.w, r0.w
  add r0.w, r0.w, -r3.w
  add r4.xy, r0.yzyy, -r1.zwzz
  mad r4.xy, r0.wwww, r4.xyxx, r1.zwzz
  movc r1.zw, r2.wwww, r4.xxxy, r1.zzzw
else 
  mov r1.zw, r0.yyyz
endif 
add r0.yz, -r0.yyzy, r1.zzwz
add r0.yz, r0.yyzy, v8.xxyx
mad r1.zw, v8.xxxy, cb1[13].xxxy, cb1[13].zzzw
deriv_rtx_coarse r4.xy, r1.zwzz
deriv_rty_coarse r4.zw, r1.zzzw
add r5.xy, |r4.zwzz|, |r4.xyxx|
resinfo_indexable(texture2d)(float,float,float,float)_uint r5.zw, l(0), t4.zwxy
utof r5.zw, r5.zzzw
mul r5.xy, r5.zwzz, r5.xyxx
max r0.w, r5.y, r5.x
log r0.w, r0.w
max r0.w, r0.w, l(0.000000)
ge r2.w, l(4.000000), r0.w
if_nz r2.w
  dp3 r2.w, r2.xyzx, r3.xyzx
  mad r2.w, |r2.w|, l(-12.000000), l(16.000000)
  ftoi r3.w, r2.w
  round_z r2.w, r2.w
  div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w
  mov r5.xy, r1.zwzz
  mov r5.z, l(0)
  mov r6.zw, l(0,0,1.000000,1.000000)
  mov r7.xyzw, l(0,0,0,0)
  loop 
    ige r5.w, r5.z, r3.w
    breakc_nz r5.w
    mad r5.xy, -r2.wwww, r1.xyxx, r5.xyxx
    sample_d_indexable(texture2d)(float,float,float,float) r5.w, r5.xyxx, t4.xyzw, s0, r4.xyxx, r4.zwzz
    add r6.x, -r2.w, r6.z
    lt r8.x, r6.x, r5.w
    movc r8.y, r8.x, r3.w, r5.z
    mov r6.y, r5.w
    movc r7.xyzw, r8.xxxx, r6.xyzw, r7.xyzw
    iadd r5.z, r8.y, l(1)
    mov r6.w, r5.w
    mov r6.z, r6.x
  endloop 
  add r2.w, -r7.w, r7.z
  add r3.w, -r7.y, r7.x
  add r4.x, r2.w, -r3.w
  mul r3.w, r3.w, r7.z
  mad r2.w, r7.x, r2.w, -r3.w
  div r2.w, r2.w, r4.x
  add r2.w, -r2.w, l(1.000000)
  mad r4.xy, -r1.xyxx, r2.wwww, r1.zwzz
  lt r2.w, l(3.000000), r0.w
  round_z r3.w, r0.w
  add r0.w, r0.w, -r3.w
  add r4.zw, r1.zzzw, -r4.xxxy
  mad r4.zw, r0.wwww, r4.zzzw, r4.xxxy
  movc r4.xy, r2.wwww, r4.zwzz, r4.xyxx
else 
  mov r4.xy, r1.zwzz
endif 
add r1.zw, -r1.zzzw, r4.xxxy
mad r4.xy, v8.xyxx, cb1[16].xyxx, cb1[16].zwzz
deriv_rtx_coarse r4.zw, r4.xxxy
deriv_rty_coarse r5.xy, r4.xyxx
add r5.zw, |r4.zzzw|, |r5.xxxy|
resinfo_indexable(texture2d)(float,float,float,float)_uint r6.xy, l(0), t1.xyzw
utof r6.xy, r6.xyxx
mul r5.zw, r5.zzzw, r6.xxxy
max r0.w, r5.w, r5.z
log r0.w, r0.w
max r0.w, r0.w, l(0.000000)
ge r2.w, l(4.000000), r0.w
if_nz r2.w
  dp3 r2.w, r2.xyzx, r3.xyzx
  mad r2.w, |r2.w|, l(-12.000000), l(16.000000)
  ftoi r3.w, r2.w
  round_z r2.w, r2.w
  div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w
  mov r5.zw, r4.xxxy
  mov r7.x, l(0)
  mov r6.zw, l(0,0,1.000000,1.000000)
  mov r8.xyzw, l(0,0,0,0)
  loop 
    ige r7.y, r7.x, r3.w
    breakc_nz r7.y
    mad r5.zw, -r2.wwww, r1.xxxy, r5.zzzw
    sample_d_indexable(texture2d)(float,float,float,float) r7.y, r5.zwzz, t1.xwyz, s0, r4.zwzz, r5.xyxx
    add r6.x, -r2.w, r6.z
    lt r7.z, r6.x, r7.y
    movc r7.w, r7.z, r3.w, r7.x
    mov r6.y, r7.y
    movc r8.xyzw, r7.zzzz, r6.xyzw, r8.xyzw
    iadd r7.x, r7.w, l(1)
    mov r6.w, r7.y
    mov r6.z, r6.x
  endloop 
  add r2.w, -r8.w, r8.z
  add r3.w, -r8.y, r8.x
  add r4.z, r2.w, -r3.w
  mul r3.w, r3.w, r8.z
  mad r2.w, r8.x, r2.w, -r3.w
  div r2.w, r2.w, r4.z
  add r2.w, -r2.w, l(1.000000)
  mad r4.zw, -r1.xxxy, r2.wwww, r4.xxxy
  lt r2.w, l(3.000000), r0.w
  round_z r3.w, r0.w
  add r0.w, r0.w, -r3.w
  add r5.xy, -r4.zwzz, r4.xyxx
  mad r5.xy, r0.wwww, r5.xyxx, r4.zwzz
  movc r4.zw, r2.wwww, r5.xxxy, r4.zzzw
else 
  mov r4.zw, r4.xxxy
endif 
add r4.xy, -r4.xyxx, r4.zwzz
add r4.xy, r4.xyxx, v8.xyxx
mad r4.zw, v8.xxxy, cb1[15].xxxy, cb1[15].zzzw
deriv_rtx_coarse r5.xy, r4.zwzz
deriv_rty_coarse r5.zw, r4.zzzw
add r6.xy, |r5.zwzz|, |r5.xyxx|
resinfo_indexable(texture2d)(float,float,float,float)_uint r6.zw, l(0), t2.zwxy
utof r6.zw, r6.zzzw
mul r6.xy, r6.zwzz, r6.xyxx
max r0.w, r6.y, r6.x
log r0.w, r0.w
max r0.w, r0.w, l(0.000000)
ge r2.w, l(4.000000), r0.w
if_nz r2.w
  dp3 r2.x, r2.xyzx, r3.xyzx
  mad r2.x, |r2.x|, l(-12.000000), l(16.000000)
  ftoi r2.y, r2.x
  round_z r2.x, r2.x
  div r2.x, l(1.000000, 1.000000, 1.000000, 1.000000), r2.x
  mov r2.zw, r4.zzzw
  mov r6.x, l(0)
  mov r3.zw, l(0,0,1.000000,1.000000)
  mov r7.xyzw, l(0,0,0,0)
  loop 
    ige r6.y, r6.x, r2.y
    breakc_nz r6.y
    mad r2.zw, -r2.xxxx, r1.xxxy, r2.zzzw
    sample_d_indexable(texture2d)(float,float,float,float) r6.y, r2.zwzz, t2.xwyz, s0, r5.xyxx, r5.zwzz
    add r3.x, -r2.x, r3.z
    lt r6.z, r3.x, r6.y
    movc r6.w, r6.z, r2.y, r6.x
    mov r3.y, r6.y
    movc r7.xyzw, r6.zzzz, r3.xyzw, r7.xyzw
    iadd r6.x, r6.w, l(1)
    mov r3.w, r6.y
    mov r3.z, r3.x
  endloop 
  add r2.xy, -r7.wyww, r7.zxzz
  add r2.z, -r2.y, r2.x
  mul r2.y, r2.y, r7.z
  mad r2.x, r7.x, r2.x, -r2.y
  div r2.x, r2.x, r2.z
  add r2.x, -r2.x, l(1.000000)
  mad r1.xy, -r1.xyxx, r2.xxxx, r4.zwzz
  lt r2.x, l(3.000000), r0.w
  round_z r2.y, r0.w
  add r0.w, r0.w, -r2.y
  add r2.yz, -r1.xxyx, r4.zzwz
  mad r2.yz, r0.wwww, r2.yyzy, r1.xxyx
  movc r1.xy, r2.xxxx, r2.yzyy, r1.xyxx
else 
  mov r1.xy, r4.zwzz
endif 
add r1.xy, -r4.zwzz, r1.xyxx
add r1.xyzw, r1.xyzw, v8.xyxy
mad r2.xy, r1.zwzz, cb1[13].xyxx, cb1[13].zwzz
sample_indexable(texture2d)(float,float,float,float) r2.xy, r2.xyxx, t4.xyzw, s0
mad r2.xy, r2.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r0.w, r2.xyxx, r2.xyxx
add r0.w, -r0.w, l(1.000000)
max r0.w, r0.w, l(0.000000)
sqrt r0.w, r0.w
mul r2.yzw, r2.yyyy, v3.xxyz
mad r2.xyz, r2.xxxx, v4.xyzx, r2.yzwy
mad r2.xyz, r0.wwww, v2.xyzx, r2.xyzx
dp3 r0.w, r2.xyzx, r2.xyzx
rsq r0.w, r0.w
mul r2.xyz, r0.wwww, r2.xyzx
mad r3.xy, r0.yzyy, cb1[14].xyxx, cb1[14].zwzz
sample_indexable(texture2d)(float,float,float,float) r3.xy, r3.xyxx, t3.xyzw, s0
mad r3.xy, r3.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r0.w, r3.xyxx, r3.xyxx
add r0.w, -r0.w, l(1.000000)
max r0.w, r0.w, l(0.000000)
sqrt r0.w, r0.w
mul r3.yzw, r3.yyyy, v3.xxyz
mad r3.xyz, r3.xxxx, v4.xyzx, r3.yzwy
mad r3.xyz, r0.wwww, v2.xyzx, r3.xyzx
dp3 r0.w, r3.xyzx, r3.xyzx
rsq r0.w, r0.w
mad r4.zw, r1.xxxy, cb1[15].xxxy, cb1[15].zzzw
sample_indexable(texture2d)(float,float,float,float) r4.zw, r4.zwzz, t2.zwxy, s0
mad r4.zw, r4.zzzw, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
dp2 r2.w, r4.zwzz, r4.zwzz
add r2.w, -r2.w, l(1.000000)
max r2.w, r2.w, l(0.000000)
sqrt r2.w, r2.w
mul r5.xyz, r4.wwww, v3.xyzx
mad r5.xyz, r4.zzzz, v4.xyzx, r5.xyzx
mad r5.xyz, r2.wwww, v2.xyzx, r5.xyzx
dp3 r2.w, r5.xyzx, r5.xyzx
rsq r2.w, r2.w
mad r4.zw, r4.xxxy, cb1[16].xxxy, cb1[16].zzzw
sample_indexable(texture2d)(float,float,float,float) r4.zw, r4.zwzz, t1.zwxy, s0
mad r4.zw, r4.zzzw, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
dp2 r3.w, r4.zwzz, r4.zwzz
add r3.w, -r3.w, l(1.000000)
max r3.w, r3.w, l(0.000000)
sqrt r3.w, r3.w
mul r6.xyz, r4.wwww, v3.xyzx
mad r6.xyz, r4.zzzz, v4.xyzx, r6.xyzx
mad r6.xyz, r3.wwww, v2.xyzx, r6.xyzx
dp3 r3.w, r6.xyzx, r6.xyzx
rsq r3.w, r3.w
add r0.x, r0.x, l(0.010000)
mul r0.x, r0.x, cb2[29].x
add r7.xyz, -v9.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mad r7.xyz, -r0.xxxx, r7.xyzx, v9.xyzx
mad r0.x, v1.w, cb2[29].y, l(1.000000)
mul_sat r7.xyz, r0.xxxx, r7.xyzx
mad r3.xyz, r3.xyzx, r0.wwww, -r2.xyzx
mad r2.xyz, r7.xxxx, r3.xyzx, r2.xyzx
mad r3.xyz, r5.xyzx, r2.wwww, -r2.xyzx
mad r2.xyz, r7.yyyy, r3.xyzx, r2.xyzx
mad r3.xyz, r6.xyzx, r3.wwww, -r2.xyzx
mad r2.xyz, r7.zzzz, r3.xyzx, r2.xyzx
mad r0.xw, r1.xxxy, cb1[11].xxxy, cb1[11].zzzw
sample_indexable(texture2d)(float,float,float,float) r0.x, r0.xwxx, t14.xyzw, s0
mad r1.xy, r1.zwzz, cb1[9].xyxx, cb1[9].zwzz
sample_indexable(texture2d)(float,float,float,float) r0.w, r1.xyxx, t12.yzwx, s0
mad r0.yz, r0.yyzy, cb1[10].xxyx, cb1[10].zzwz
sample_indexable(texture2d)(float,float,float,float) r0.y, r0.yzyy, t13.yxzw, s0
mad r1.xy, r4.xyxx, cb1[12].xyxx, cb1[12].zwzz
sample_indexable(texture2d)(float,float,float,float) r0.z, r1.xyxx, t15.yzxw, s0
add r0.y, -r0.w, r0.y
mad r0.y, r7.x, r0.y, r0.w
add r0.x, -r0.y, r0.x
mad r0.x, r7.y, r0.x, r0.y
add r0.y, -r0.x, r0.z
mad r0.x, r7.z, r0.y, r0.x
dp3 r0.y, r2.xyzx, r2.xyzx
rsq r0.y, r0.y
mul r0.yzw, r0.yyyy, r2.xxyz
mul r1.x, r0.x, cb9[3].z
mad o0.xyz, r0.yzwy, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500489, 0.500489, 0.500489, 0.000000)
ne r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb3[5].z
mov r1.yz, l(0,1.000000,0,0)
movc r0.xy, r0.xxxx, cb4[7].wwww, r1.xyxx
mov o0.w, r0.x
mov r1.w, r0.y
mov o1.xyzw, r1.xzzw
ret 
// Approximately 321 instruction slots used

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