// ANOTHER SSR

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

cbuffer cbMtdParam : register(b3)
{
  float4 FC_DifMapMulCol : packoffset(c0);
  float4 unused_FC_SpcMapMulCol : packoffset(c1);
  float4 unused_FC_SpcParam : packoffset(c2);
  float4 unused_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);
  float HC_BackFaceCull : packoffset(c15);
  float4 FC_HairSpecularParam0 : packoffset(c20);
  float4 FC_HairSpecularParam1 : packoffset(c21);
  float4 FC_HairSpecularParam2 : packoffset(c22);
  float4 FC_RimLightingParam : packoffset(c23);

  struct
  {
    float4 M_Interaction__Tessellation_PoisonWater_snp_0_color_0;
    float4 M_Interaction__Tessellation_PoisonWater_snp_0_color_1;
    float4 M_Interaction__Tessellation_PoisonWater_snp_0_color_2;
    float4 M_Interaction__Tessellation_PoisonWater_snp_0_color_3;
    float M_Interaction__Tessellation_PoisonWater_snp_0_float_0;
    float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_0_PADDING;
    float M_Interaction__Tessellation_PoisonWater_snp_0_float_1;
    float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_1_PADDING;
    float M_Interaction__Tessellation_PoisonWater_snp_0_float_10;
    float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_10_PADDING;
    float M_Interaction__Tessellation_PoisonWater_snp_0_float_11;
    float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_11_PADDING;
    float M_Interaction__Tessellation_PoisonWater_snp_0_float_13;
    float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_13_PADDING;
    float M_Interaction__Tessellation_PoisonWater_snp_0_float_14;
    float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_14_PADDING;
    float M_Interaction__Tessellation_PoisonWater_snp_0_float_2;
    float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_2_PADDING;
    float M_Interaction__Tessellation_PoisonWater_snp_0_float_22;
    float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_22_PADDING;
    float M_Interaction__Tessellation_PoisonWater_snp_0_float_27;
    float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_27_PADDING;
    float M_Interaction__Tessellation_PoisonWater_snp_0_float_3;
    float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_3_PADDING;
    float M_Interaction__Tessellation_PoisonWater_snp_0_float_32;
    float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_32_PADDING;
    float M_Interaction__Tessellation_PoisonWater_snp_0_float_33;
    float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_33_PADDING;
    float M_Interaction__Tessellation_PoisonWater_snp_0_float_36;
    float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_36_PADDING;
    float M_Interaction__Tessellation_PoisonWater_snp_0_float_37;
    float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_37_PADDING;
    float M_Interaction__Tessellation_PoisonWater_snp_0_float_38;
    float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_38_PADDING;
    float M_Interaction__Tessellation_PoisonWater_snp_0_float_4;
    float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_4_PADDING;
    float M_Interaction__Tessellation_PoisonWater_snp_0_float_5;
    float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_5_PADDING;
    float M_Interaction__Tessellation_PoisonWater_snp_0_float_9;
    float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_9_PADDING;
    float2 M_Interaction__Tessellation_PoisonWater_snp_0_float2_0;
    float2 M_Interaction__Tessellation_PoisonWater_snp_0_float2_0_PADDING;
    float2 M_Interaction__Tessellation_PoisonWater_snp_0_float2_1;
    float2 M_Interaction__Tessellation_PoisonWater_snp_0_float2_1_PADDING;
  } SAT_MtdParam : packoffset(c24);

}

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);
  bool FC_InsideWaterMode : packoffset(c59.z);
  bool FC_CameraFadeEnable : packoffset(c59.w);
  float4 FC_VelocityEncodeParam : packoffset(c60);
  float4 SC_RenderCameraPos : packoffset(c61);
  float SC_ScreenResolutionScale : packoffset(c62);
  float SC_ViewFrustumEpsilon : packoffset(c62.y);
  float SC_PreExposure : packoffset(c62.z);
  float SC_InvPreExposure : packoffset(c62.w);
  float4 SC_ViewFrustumPlanes[4] : packoffset(c63);
  float4 FC_VolumeFogParam[4] : packoffset(c67);
}

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_DebugMipLvViewColor[16] : packoffset(c6);
  float4 FC_AccShiftAmount : packoffset(c22);
  float FC_GlobalTime : packoffset(c27);
  float FC_TimeOfDay : packoffset(c27.y);
}

cbuffer cbPerScene : register(b0)
{
  float4x4 g_InvProjMatrix : packoffset(c0);
  float4x4 g_ProjMatrix : packoffset(c4);
  float4x4 g_ViewMatrix : packoffset(c8);
  float4x4 g_ReprojMatrix : packoffset(c12);
  float4 g_fadeParam : packoffset(c16);
  float4 g_vDepthComputeParam : packoffset(c17);
  float2 g_vScreenSize : packoffset(c18);
  float4 g_rayTraceParam : packoffset(c19);
  float4 rayTerminateInvDist : packoffset(c20);
  float4 g_DepthRejectParam : packoffset(c21);
  float2 g_FresnelRejectParam : packoffset(c22);
  float2 g_ShininessRejectParam : packoffset(c22.z);
  int binarySearchLoopCount : packoffset(c23);
  float stepCountSafetyMax : packoffset(c23.y);
  float2 rayTraceStepScaleMinMax : packoffset(c23.z);
  float4x4 g_CurViewToPrevProj : packoffset(c24);
  float2 viewTangent : packoffset(c28);
  int debugMode : packoffset(c28.z);
  float sceneMultiplyer : packoffset(c28.w);
  float2 dispMipScaleOffset : packoffset(c29);
  float4x4 g_CurViewToPrevView : packoffset(c30);
  float4x4 g_PrevProjMatrix : packoffset(c34);
  float displayMipOffset : packoffset(c38.w);
}

SamplerState SS_BumpMap_s : register(s2);
SamplerState SS_ClampPoint_s : register(s7);
SamplerState SS_WrapLinear_s : register(s8);
SamplerState SS_ClampLinear_s : register(s9);
Texture2D<float4> M_Interaction__Tessellation_PoisonWater_snp_0_Texture2D_0 : register(t0);
Texture2D<float4> M_Interaction__Tessellation_PoisonWater_snp_0_Texture2D_2 : register(t1);
Texture2D<float4> M_Interaction__Tessellation_PoisonWater_snp_0_Texture2D_3 : register(t2);
Texture2D<float4> g_PrevFrameTexture : register(t26);
Texture2D<float4> g_ConvertedDepthTexture : register(t27);
Texture2D<float4> g_DepthTexture : register(t56);


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


void main(
  float4 v0 : SV_POSITION0,
  float4 v1 : POSITION1,
  float4 v2 : NORMAL0,
  float4 v3 : TANGENT0,
  float4 v4 : TEXCOORD0,
  float2 v5 : TEXCOORD2,
  uint v6 : SV_ISFRONTFACE0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xy = SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_float2_1.xy * v4.xy;
  r0.xy = r0.xy * FC_TextureTilingScale[1].xy + FC_TextureTilingScale[1].zw;
  r0.x = M_Interaction__Tessellation_PoisonWater_snp_0_Texture2D_2.Sample(SS_BumpMap_s, r0.xy).z;
  r0.yz = v4.xy * FC_TextureTilingScale[2].xy + FC_TextureTilingScale[2].zw;
  r0.yz = M_Interaction__Tessellation_PoisonWater_snp_0_Texture2D_3.Sample(SS_WrapLinear_s, r0.yz).xy;
  r0.w = FC_GlobalTime + FC_GlobalTime;
  r1.x = SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_float_4 * r0.w;
  r0.yz = r0.yz * float2(2,2) + float2(-1,-1);
  r0.yz = float2(0.25,0.25) * r0.yz;
  r2.xy = SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_float_3 * r0.yz;
  r1.y = r0.w * SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_float_4 + 0.5;
  r1.xy = frac(r1.xy);
  r2.zw = -r2.xx;
  r1.zw = r2.zy * r1.xx + v4.xy;
  r2.xy = r2.wy * r1.yy + v4.xy;
  r1.x = r1.x * 2 + -1;
  r1.yz = r1.zw * FC_TextureTilingScale[0].xy + FC_TextureTilingScale[0].zw;
  r2.xy = r2.xy * FC_TextureTilingScale[0].xy + FC_TextureTilingScale[0].zw;
  r3.xyzw = M_Interaction__Tessellation_PoisonWater_snp_0_Texture2D_0.Sample(SS_WrapLinear_s, r1.yz).xyzw;
  r2.xyzw = M_Interaction__Tessellation_PoisonWater_snp_0_Texture2D_0.Sample(SS_WrapLinear_s, r2.xy).xyzw;
  r2.xyzw = r2.xyzw + -r3.xyzw;
  r1.xyzw = abs(r1.xxxx) * r2.xyzw + r3.xyzw;
  r1.w = SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_float_5 * r1.w;
  r0.x = r1.w * r0.x;
  r2.xy = FC_ScreenSize.zw * v0.xy;
  r1.w = g_DepthTexture.Sample(SS_ClampPoint_s, r2.xy).x;
  r2.xy = SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_float2_0.xy * v4.xy;
  r2.xy = r2.xy * FC_TextureTilingScale[0].xy + FC_TextureTilingScale[0].zw;
  r2.x = M_Interaction__Tessellation_PoisonWater_snp_0_Texture2D_0.Sample(SS_WrapLinear_s, r2.xy).z;
  r2.y = SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_float_37 * r0.w;
  r3.xy = SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_float_36 * r0.yz;
  r0.y = frac(r2.y);
  r0.z = r0.w * SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_float_37 + 0.5;
  r0.z = frac(r0.z);
  r3.zw = -r3.xx;
  r2.yz = r3.zy * r0.yy + v4.xy;
  r0.zw = r3.wy * r0.zz + v4.xy;
  r0.y = r0.y * 2 + -1;
  r2.yz = r2.yz * FC_TextureTilingScale[1].xy + FC_TextureTilingScale[1].zw;
  r0.zw = r0.zw * FC_TextureTilingScale[1].xy + FC_TextureTilingScale[1].zw;
  r2.yzw = M_Interaction__Tessellation_PoisonWater_snp_0_Texture2D_2.Sample(SS_BumpMap_s, r2.yz).xyz;
  r3.xyz = M_Interaction__Tessellation_PoisonWater_snp_0_Texture2D_2.Sample(SS_BumpMap_s, r0.zw).xyz;
  r3.xyz = r3.xyz + -r2.yzw;
  r0.yzw = abs(r0.yyy) * r3.xyz + r2.yzw;
  r0.w = SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_float_11 + r0.w;
  r2.y = SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_float_13 + -r0.w;
  r0.w = saturate(r0.x * r2.y + r0.w);
  r2.y = cmp(r0.w < g_ShininessRejectParam.x);
  if (r2.y != 0) {
    o0.xyzw = float4(0,0,0,0);
  } else {
    r3.z = 1 / v1.w;
    r2.y = cmp(g_DepthRejectParam.y >= r3.z);
    if (r2.y != 0) {
      r4.xyzw = float4(0,0,0,0);
    }
    if (r2.y == 0) {
      r2.y = dot(v2.xyz, v2.xyz);
      r2.y = rsqrt(r2.y);
      r2.yzw = v2.xyz * r2.yyy;
      r5.xy = v1.xy / v1.ww;
      r6.x = dot(r2.yzw, g_ViewMatrix._m00_m10_m20);
      r6.y = dot(r2.yzw, g_ViewMatrix._m01_m11_m21);
      r6.z = dot(r2.yzw, g_ViewMatrix._m02_m12_m22);
      r5.zw = viewTangent.xy * r5.xy;
      r7.xy = v1.ww * r5.zw;
      r7.z = v1.w;
      r3.w = dot(r7.xyz, r7.xyz);
      r3.w = rsqrt(r3.w);
      r8.xyz = r7.xyz * r3.www;
      r3.w = dot(r8.xyz, r6.xyz);
      r3.w = r3.w + r3.w;
      r9.xyz = r6.xyz * -r3.www + r8.xyz;
      r3.w = dot(r9.xyz, r9.xyz);
      r3.w = rsqrt(r3.w);
      r5.z = r9.z * r3.w;
      r5.z = cmp(r5.z < g_fadeParam.x);
      if (r5.z != 0) {
        r4.xyzw = float4(0,0,0,0);
      }
      if (r5.z == 0) {
        r10.xyz = v3.yzx * v2.zxy;
        r10.xyz = v2.yzx * v3.zxy + -r10.xyz;
        r10.xyz = v3.www * r10.xyz;
        r5.z = dot(r10.xyz, r10.xyz);
        r5.z = rsqrt(r5.z);
        r10.xyz = r10.xyz * r5.zzz;
        r5.z = dot(v3.xyz, v3.xyz);
        r5.z = rsqrt(r5.z);
        r11.xyz = v3.xyz * r5.zzz;
        r12.x = dot(v1.xyzw, FC_MatrixInvViewProj._m00_m10_m20_m30);
        r12.y = dot(v1.xyzw, FC_MatrixInvViewProj._m01_m11_m21_m31);
        r12.z = dot(v1.xyzw, FC_MatrixInvViewProj._m02_m12_m22_m32);
        r5.z = dot(v1.xyzw, FC_MatrixInvViewProj._m03_m13_m23_m33);
        r12.xyz = r12.xyz / r5.zzz;
        r12.xyz = SC_RenderCameraPos.xyz + -r12.xyz;
        r1.w = FC_DepthComputeParam.x + -r1.w;
        r1.w = -FC_DepthComputeParam.z / r1.w;
        r1.w = -v1.w + r1.w;
        r1.w = min(SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_float_9, r1.w);
        r1.w = r1.w / SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_float_9;
        r1.w = saturate(1 + -r1.w);
        r1.w = saturate(r1.w * r2.x);
        r2.x = r1.w * -2 + 3;
        r1.w = r1.w * r1.w;
        r1.w = r2.x * r1.w;
        r13.xyz = r1.www * SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_color_1.xyz + SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_color_3.xyz;
        r14.xyz = SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_color_0.xyz + r1.zzz;
        r14.xyz = r14.xyz + -r13.xyz;
        r13.xyz = r0.xxx * r14.xyz + r13.xyz;
        r1.xy = r1.xy + -r0.yz;
        r0.xy = r0.xx * r1.xy + r0.yz;
        r0.xy = r0.xy * float2(2,2) + float2(-1,-1);
        r0.z = dot(r0.xy, r0.xy);
        r0.z = min(1, r0.z);
        r0.z = 1 + -r0.z;
        r0.z = sqrt(r0.z);
        r1.xyz = r0.yyy * r11.xyz;
        r1.xyz = r0.xxx * r10.xyz + r1.xyz;
        r0.xyz = r0.zzz * r2.yzw + r1.xyz;
        r1.x = dot(r0.xyz, r0.xyz);
        r1.x = rsqrt(r1.x);
        r0.xyz = r1.xxx * r0.xyz;
        r1.x = dot(r12.xyz, r12.xyz);
        r1.x = rsqrt(r1.x);
        r1.xyz = r12.xyz * r1.xxx;
        r0.x = dot(r1.xyz, r0.xyz);
        r0.x = saturate(-SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_float_2 + r0.x);
        r0.y = max(SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_float_0, 0.00100000005);
        r0.x = log2(r0.x);
        r0.x = r0.y * r0.x;
        r0.x = exp2(r0.x);
        r0.x = 1 + -r0.x;
        r0.y = max(SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_float_1, 0.00100000005);
        r0.x = log2(r0.x);
        r0.x = r0.y * r0.x;
        r0.x = exp2(r0.x);
        r1.xyz = -SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_color_2.xyz + r13.xyz;
        r0.xyz = r0.xxx * r1.xyz + SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_color_2.xyz;
        r0.xyz = saturate(r13.xyz * r0.xyz);
        r1.x = saturate(SAT_MtdParam.M_Interaction__Tessellation_PoisonWater_snp_0_float_10);
        r0.xyz = float3(-0.0299999993,-0.0299999993,-0.0299999993) + r0.xyz;
        r0.xyz = r1.xxx * r0.xyz + float3(0.0299999993,0.0299999993,0.0299999993);
        r1.x = dot(-r8.xyz, r6.xyz);
        r1.x = min(1, abs(r1.x));
        r1.x = 1 + -r1.x;
        r1.y = r1.x * r1.x;
        r1.y = r1.y * r1.y;
        r1.x = r1.x * r1.y;
        r0.y = max(r0.y, r0.z);
        r0.x = max(r0.x, r0.y);
        r0.y = 1 + -r0.x;
        r0.y = r0.y * r1.x;
        r0.z = r0.w * r0.w;
        r0.x = r0.y * r0.z + r0.x;
        r0.y = cmp(r0.x < g_FresnelRejectParam.x);
        if (r0.y != 0) {
          o0.xyzw = float4(0,0,0,0);
        } else {
          o0.xyzw = r4.xyzw;
        }
        if (r0.y == 0) {
          r3.xy = r5.xy * float2(0.5,-0.5) + float2(0.5,0.5);
          r0.y = saturate(r9.z * r3.w + -g_fadeParam.x);
          r0.y = r0.y * r0.y;
          r0.x = -g_FresnelRejectParam.x + r0.x;
          r0.x = saturate(10 * r0.x);
          r0.x = min(r0.y, r0.x);
          r0.y = g_DepthRejectParam.x + -v1.w;
          r0.y = saturate(g_DepthRejectParam.z * r0.y);
          r0.x = min(r0.x, r0.y);
          r1.xyz = r9.xyz * r3.www + r7.xyz;
          r1.w = 1;
          r2.x = dot(r1.xyzw, g_ProjMatrix._m00_m10_m20_m30);
          r2.y = dot(r1.xyzw, g_ProjMatrix._m01_m11_m21_m31);
          r0.y = dot(r1.xyzw, g_ProjMatrix._m03_m13_m23_m33);
          r2.xy = r2.xy / r0.yy;
          r2.z = 1 / r1.z;
          r0.yzw = r2.xyz + -r3.xyz;
          r1.xy = g_vScreenSize.xy * r0.yz;
          r1.x = dot(r1.xy, r1.xy);
          r1.x = sqrt(r1.x);
          r1.x = 9.99999975e-006 + r1.x;
          r0.yzw = r0.yzw / r1.xxx;
          r1.xyz = rayTraceStepScaleMinMax.xxx * r0.yzw;
          r2.xyz = cmp(float3(0,0,0) < r1.xyz);
          r5.xy = r2.xy ? float2(1,1) : 0;
          r5.z = r2.z ? rayTerminateInvDist.x : rayTerminateInvDist.y;
          r2.xyz = r5.xyz + -r3.xyz;
          r5.xyz = float3(1.00000001e-007,1.00000001e-007,1.00000001e-007) + abs(r1.xyz);
          r2.xyz = abs(r2.xyz) / r5.xyz;
          r1.z = min(r2.x, r2.y);
          r1.w = 2 + r2.z;
          r1.z = min(r1.z, r1.w);
          r1.z = min(stepCountSafetyMax, r1.z);
          r2.xyz = r0.yzw * rayTraceStepScaleMinMax.xxx + r3.xyz;
          r1.w = log2(rayTraceStepScaleMinMax.x);
          r1.w = 0.999000013 + r1.w;
          r1.zw = (int2)r1.zw;
          r2.w = dot(r1.xy, r1.xy);
          r2.w = rsqrt(r2.w);
          r1.xy = r2.ww * r1.xy;
          r5.z = 1;
          r6.xyz = float3(0,0,0);
          r7.xyz = r3.xyz;
          r2.w = 0;
          r3.w = 0;
          r6.w = r3.z;
          r8.xyz = r2.xyz;
          r7.w = -1;
          while (true) {
            r8.w = cmp((int)r3.w >= (int)r1.z);
            if (r8.w != 0) break;
            r8.w = g_ConvertedDepthTexture.SampleLevel(SS_ClampPoint_s, r8.xy, 0).x;
            r9.x = r8.z + -r8.w;
            r9.y = -g_rayTraceParam.y * r6.w + r8.w;
            r9.z = cmp(0 >= r9.x);
            r9.y = cmp(r9.y < 0);
            r9.y = r9.y ? r9.z : 0;
            r9.y = r9.y ? r7.w : 0;
            if (r9.y != 0) {
              r10.xyz = r8.xyz;
              r11.xyz = r7.xyz;
              r5.w = r8.w;
              r9.y = 0;
              while (true) {
                r9.z = cmp((int)r9.y >= (int)r1.w);
                if (r9.z != 0) break;
                r12.xyz = r11.xyz + r10.xyz;
                r13.xyz = float3(0.5,0.5,0.5) * r12.xyz;
                r11.w = g_ConvertedDepthTexture.SampleLevel(SS_ClampPoint_s, r13.xy, 0).x;
                r9.z = r12.z * 0.5 + -r11.w;
                r9.z = cmp(r9.z < 0);
                r10.xyz = r9.zzz ? r13.xyz : r10.xyz;
                r13.w = r5.w;
                r11.xyzw = r9.zzzz ? r11.xyzw : r13.xyzw;
                r9.y = (int)r9.y + 1;
                r5.w = r11.w;
              }
              r8.xyz = r10.xyz;
              r7.xyz = r11.xyz;
              r9.yz = r8.xy * float2(2,-2) + float2(-1,1);
              r5.xy = viewTangent.xy * r9.yz;
              r12.x = dot(r5.xyzw, g_CurViewToPrevProj._m00_m10_m20_m30);
              r12.y = dot(r5.xyzw, g_CurViewToPrevProj._m01_m11_m21_m31);
              r5.x = dot(r5.xyzw, g_CurViewToPrevProj._m03_m13_m23_m33);
              r5.xy = r12.xy / r5.xx;
              r6.xyz = g_PrevFrameTexture.SampleLevel(SS_ClampLinear_s, r5.xy, 0).xyz;
              r5.xy = float2(0.5,0.5) + -r5.xy;
              r5.xy = r5.xy + r5.xy;
              r9.yz = r5.xy * r5.xy;
              r9.yz = min(float2(1,1), r9.yz);
              r9.yz = float2(1,1) + -r9.yz;
              r9.y = r9.y * r9.z;
              r9.z = dot(r5.xy, r5.xy);
              r9.z = rsqrt(r9.z);
              r5.xy = r9.zz * r5.xy;
              r5.x = saturate(dot(-r5.xy, r1.xy));
              r5.x = r5.x * -2 + 4;
              r5.x = r9.y * r5.x;
              r5.x = min(1, r5.x);
              r5.x = r5.x * r5.x;
              r2.w = min(r5.x, r0.x);
              r3.w = r1.z;
              r7.w = -1;
            } else {
              r7.w = cmp(0 < r9.x);
              r3.w = (int)r3.w + 1;
              r9.xyz = r0.yzw * rayTraceStepScaleMinMax.xxx + r8.xyz;
              r7.xyz = r8.xyz;
              r6.w = r8.w;
              r8.xyz = r9.xyz;
            }
          }
          r0.xyz = r6.xyz * r2.www;
          o0.xyz = sceneMultiplyer * r0.xyz;
          o0.w = r2.w;
		  // Disable the SSR
		  o0.xyz = 0;
		  // Maintain some ambience
		  o0.w = 0.35;
        }
      } else {
        o0.xyzw = r4.xyzw;
      }
    } else {
      o0.xyzw = r4.xyzw;
    }
  }
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//   using 3Dmigoto v1.3.16 on Fri Mar 29 21:12:04 2019
//
//
// Buffer Definitions:
//
// cbuffer cbTextureTilingScale
// {
//
//   float4 FC_TextureTilingScale[25];  // Offset:    0 Size:   400
//
// }
//
// cbuffer cbMtdParam
// {
//
//   float4 FC_DifMapMulCol;            // Offset:    0 Size:    16 [unused]
//   float4 unused_FC_SpcMapMulCol;     // Offset:   16 Size:    16 [unused]
//   float4 unused_FC_SpcParam;         // Offset:   32 Size:    16 [unused]
//   float4 unused_FC_SSAOParam;        // Offset:   48 Size:    16 [unused]
//   float3 FC_CDRFParam;               // Offset:   64 Size:    12 [unused]
//   float4 FC_AlphaRef;                // Offset:   80 Size:    16 [unused]
//   float FC_BloodAmount;              // Offset:   96 Size:     4 [unused]
//   float4 old_FC_ParallaxParam;       // Offset:  112 Size:    16 [unused]
//   float FC_IOR;                      // Offset:  128 Size:     4 [unused]
//   float4 FC_GlowScale;               // Offset:  144 Size:    16 [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]
//   float HC_BackFaceCull;             // Offset:  240 Size:     4 [unused]
//   float4 FC_HairSpecularParam0;      // Offset:  320 Size:    16 [unused]
//   float4 FC_HairSpecularParam1;      // Offset:  336 Size:    16 [unused]
//   float4 FC_HairSpecularParam2;      // Offset:  352 Size:    16 [unused]
//   float4 FC_RimLightingParam;        // Offset:  368 Size:    16 [unused]
//
//   struct SAT_MTD_PARAM
//   {
//
//       float4 M_Interaction__Tessellation_PoisonWater_snp_0_color_0;// Offset:  384
//       float4 M_Interaction__Tessellation_PoisonWater_snp_0_color_1;// Offset:  400
//       float4 M_Interaction__Tessellation_PoisonWater_snp_0_color_2;// Offset:  416
//       float4 M_Interaction__Tessellation_PoisonWater_snp_0_color_3;// Offset:  432
//       float M_Interaction__Tessellation_PoisonWater_snp_0_float_0;// Offset:  448
//       float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_0_PADDING;// Offset:  452
//       float M_Interaction__Tessellation_PoisonWater_snp_0_float_1;// Offset:  464
//       float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_1_PADDING;// Offset:  468
//       float M_Interaction__Tessellation_PoisonWater_snp_0_float_10;// Offset:  480
//       float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_10_PADDING;// Offset:  484
//       float M_Interaction__Tessellation_PoisonWater_snp_0_float_11;// Offset:  496
//       float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_11_PADDING;// Offset:  500
//       float M_Interaction__Tessellation_PoisonWater_snp_0_float_13;// Offset:  512
//       float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_13_PADDING;// Offset:  516
//       float M_Interaction__Tessellation_PoisonWater_snp_0_float_14;// Offset:  528
//       float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_14_PADDING;// Offset:  532
//       float M_Interaction__Tessellation_PoisonWater_snp_0_float_2;// Offset:  544
//       float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_2_PADDING;// Offset:  548
//       float M_Interaction__Tessellation_PoisonWater_snp_0_float_22;// Offset:  560
//       float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_22_PADDING;// Offset:  564
//       float M_Interaction__Tessellation_PoisonWater_snp_0_float_27;// Offset:  576
//       float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_27_PADDING;// Offset:  580
//       float M_Interaction__Tessellation_PoisonWater_snp_0_float_3;// Offset:  592
//       float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_3_PADDING;// Offset:  596
//       float M_Interaction__Tessellation_PoisonWater_snp_0_float_32;// Offset:  608
//       float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_32_PADDING;// Offset:  612
//       float M_Interaction__Tessellation_PoisonWater_snp_0_float_33;// Offset:  624
//       float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_33_PADDING;// Offset:  628
//       float M_Interaction__Tessellation_PoisonWater_snp_0_float_36;// Offset:  640
//       float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_36_PADDING;// Offset:  644
//       float M_Interaction__Tessellation_PoisonWater_snp_0_float_37;// Offset:  656
//       float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_37_PADDING;// Offset:  660
//       float M_Interaction__Tessellation_PoisonWater_snp_0_float_38;// Offset:  672
//       float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_38_PADDING;// Offset:  676
//       float M_Interaction__Tessellation_PoisonWater_snp_0_float_4;// Offset:  688
//       float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_4_PADDING;// Offset:  692
//       float M_Interaction__Tessellation_PoisonWater_snp_0_float_5;// Offset:  704
//       float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_5_PADDING;// Offset:  708
//       float M_Interaction__Tessellation_PoisonWater_snp_0_float_9;// Offset:  720
//       float3 M_Interaction__Tessellation_PoisonWater_snp_0_float_9_PADDING;// Offset:  724
//       float2 M_Interaction__Tessellation_PoisonWater_snp_0_float2_0;// Offset:  736
//       float2 M_Interaction__Tessellation_PoisonWater_snp_0_float2_0_PADDING;// Offset:  744
//       float2 M_Interaction__Tessellation_PoisonWater_snp_0_float2_1;// Offset:  752
//       float2 M_Interaction__Tessellation_PoisonWater_snp_0_float2_1_PADDING;// Offset:  760
//
//   } SAT_MtdParam;                    // Offset:  384 Size:   384
//
// }
//
// cbuffer cbSceneParam
// {
//
//   float4 FC_FarClipInfo;             // Offset:    0 Size:    16 [unused]
//   float4 FC_ScreenSize;              // Offset:   16 Size:    16
//   float4 FC_DepthComputeParam;       // Offset:   32 Size:    16
//   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 [unused]
//   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]
//   bool FC_InsideWaterMode;           // Offset:  952 Size:     4 [unused]
//   bool FC_CameraFadeEnable;          // Offset:  956 Size:     4 [unused]
//   float4 FC_VelocityEncodeParam;     // Offset:  960 Size:    16 [unused]
//   float4 SC_RenderCameraPos;         // Offset:  976 Size:    16
//   float SC_ScreenResolutionScale;    // Offset:  992 Size:     4 [unused]
//   float SC_ViewFrustumEpsilon;       // Offset:  996 Size:     4 [unused]
//   float SC_PreExposure;              // Offset: 1000 Size:     4 [unused]
//   float SC_InvPreExposure;           // Offset: 1004 Size:     4 [unused]
//   float4 SC_ViewFrustumPlanes[4];    // Offset: 1008 Size:    64 [unused]
//   float4 FC_VolumeFogParam[4];       // Offset: 1072 Size:    64 [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 [unused]
//   float FC_GlobalAlbedoOffset;       // Offset:   60 Size:     4 [unused]
//   float4 FC_GlobalRefRectanceRGBScale;// Offset:   64 Size:    16 [unused]
//   float4 FC_GlobalAlbedoOffsetRGB;   // Offset:   80 Size:    16 [unused]
//   float4 FC_DebugMipLvViewColor[16]; // Offset:   96 Size:   256 [unused]
//   float4 FC_AccShiftAmount;          // Offset:  352 Size:    16 [unused]
//   float FC_GlobalTime;               // Offset:  432 Size:     4
//   float FC_TimeOfDay;                // Offset:  436 Size:     4 [unused]
//
// }
//
// cbuffer cbPerScene
// {
//
//   float4x4 g_InvProjMatrix;          // Offset:    0 Size:    64 [unused]
//   float4x4 g_ProjMatrix;             // Offset:   64 Size:    64
//   float4x4 g_ViewMatrix;             // Offset:  128 Size:    64
//   float4x4 g_ReprojMatrix;           // Offset:  192 Size:    64 [unused]
//   float4 g_fadeParam;                // Offset:  256 Size:    16
//   float4 g_vDepthComputeParam;       // Offset:  272 Size:    16 [unused]
//   float2 g_vScreenSize;              // Offset:  288 Size:     8
//   float4 g_rayTraceParam;            // Offset:  304 Size:    16
//   float4 rayTerminateInvDist;        // Offset:  320 Size:    16
//   float4 g_DepthRejectParam;         // Offset:  336 Size:    16
//   float2 g_FresnelRejectParam;       // Offset:  352 Size:     8
//   float2 g_ShininessRejectParam;     // Offset:  360 Size:     8
//   int binarySearchLoopCount;         // Offset:  368 Size:     4 [unused]
//   float stepCountSafetyMax;          // Offset:  372 Size:     4
//   float2 rayTraceStepScaleMinMax;    // Offset:  376 Size:     8
//   float4x4 g_CurViewToPrevProj;      // Offset:  384 Size:    64
//   float2 viewTangent;                // Offset:  448 Size:     8
//   int debugMode;                     // Offset:  456 Size:     4 [unused]
//   float sceneMultiplyer;             // Offset:  460 Size:     4
//   float2 dispMipScaleOffset;         // Offset:  464 Size:     8 [unused]
//   float4x4 g_CurViewToPrevView;      // Offset:  480 Size:    64 [unused]
//   float4x4 g_PrevProjMatrix;         // Offset:  544 Size:    64 [unused]
//   float displayMipOffset;            // Offset:  620 Size:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SS_BumpMap                        sampler      NA          NA    2        1
// SS_ClampPoint                     sampler      NA          NA    7        1
// SS_WrapLinear                     sampler      NA          NA    8        1
// SS_ClampLinear                    sampler      NA          NA    9        1
// M_Interaction__Tessellation_PoisonWater_snp_0_Texture2D_0    texture  float4          2d    0        1
// M_Interaction__Tessellation_PoisonWater_snp_0_Texture2D_2    texture  float4          2d    1        1
// M_Interaction__Tessellation_PoisonWater_snp_0_Texture2D_3    texture  float4          2d    2        1
// g_PrevFrameTexture                texture  float4          2d   26        1
// g_ConvertedDepthTexture           texture  float4          2d   27        1
// g_DepthTexture                    texture  float4          2d   56        1
// cbPerScene                        cbuffer      NA          NA    0        1
// cbTextureTilingScale              cbuffer      NA          NA    1        1
// cbMtdParam                        cbuffer      NA          NA    3        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
// POSITION                 1   xyzw        1     NONE   float   xyzw
// NORMAL                   0   xyzw        2     NONE   float   xyz
// TANGENT                  0   xyzw        3     NONE   float   xyzw
// TEXCOORD                 0   xyzw        4     NONE   float   xy
// TEXCOORD                 2   xy          5     NONE   float
// SV_ISFRONTFACE           0   x           6    FFACE    uint
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[3], immediateIndexed
dcl_constantbuffer cb3[48], immediateIndexed
dcl_constantbuffer cb8[62], immediateIndexed
dcl_constantbuffer cb9[28], immediateIndexed
dcl_constantbuffer cb0[29], immediateIndexed
dcl_sampler s2, mode_default
dcl_sampler s7, mode_default
dcl_sampler s8, mode_default
dcl_sampler s9, 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) t26
dcl_resource_texture2d (float,float,float,float) t27
dcl_resource_texture2d (float,float,float,float) t56
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xyz
dcl_input_ps linear v3.xyzw
dcl_input_ps linear v4.xy
dcl_output o0.xyzw
dcl_temps 15
mul r0.xy, v4.xyxx, cb3[47].xyxx
mad r0.xy, r0.xyxx, cb1[1].xyxx, cb1[1].zwzz
sample_indexable(texture2d)(float,float,float,float) r0.x, r0.xyxx, t1.zxyw, s2
mad r0.yz, v4.xxyx, cb1[2].xxyx, cb1[2].zzwz
sample_indexable(texture2d)(float,float,float,float) r0.yz, r0.yzyy, t2.zxyw, s8
add r0.w, cb9[27].x, cb9[27].x
mul r1.x, r0.w, cb3[43].x
mad r0.yz, r0.yyzy, l(0.000000, 2.000000, 2.000000, 0.000000), l(0.000000, -1.000000, -1.000000, 0.000000)
mul r0.yz, r0.yyzy, l(0.000000, 0.250000, 0.250000, 0.000000)
mul r2.xy, r0.yzyy, cb3[37].xxxx
mad r1.y, r0.w, cb3[43].x, l(0.500000)
frc r1.xy, r1.xyxx
mov r2.zw, -r2.xxxx
mad r1.zw, r2.zzzy, r1.xxxx, v4.xxxy
mad r2.xy, r2.wyww, r1.yyyy, v4.xyxx
mad r1.x, r1.x, l(2.000000), l(-1.000000)
mad r1.yz, r1.zzwz, cb1[0].xxyx, cb1[0].zzwz
mad r2.xy, r2.xyxx, cb1[0].xyxx, cb1[0].zwzz
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r1.yzyy, t0.xyzw, s8
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r2.xyxx, t0.xyzw, s8
add r2.xyzw, -r3.xyzw, r2.xyzw
mad r1.xyzw, |r1.xxxx|, r2.xyzw, r3.xyzw
mul r1.w, r1.w, cb3[44].x
mul r0.x, r0.x, r1.w
mul r2.xy, v0.xyxx, cb8[1].zwzz
sample_indexable(texture2d)(float,float,float,float) r1.w, r2.xyxx, t56.yzwx, s7
mul r2.xy, v4.xyxx, cb3[46].xyxx
mad r2.xy, r2.xyxx, cb1[0].xyxx, cb1[0].zwzz
sample_indexable(texture2d)(float,float,float,float) r2.x, r2.xyxx, t0.zxyw, s8
mul r2.y, r0.w, cb3[41].x
mul r3.xy, r0.yzyy, cb3[40].xxxx
frc r0.y, r2.y
mad r0.z, r0.w, cb3[41].x, l(0.500000)
frc r0.z, r0.z
mov r3.zw, -r3.xxxx
mad r2.yz, r3.zzyz, r0.yyyy, v4.xxyx
mad r0.zw, r3.wwwy, r0.zzzz, v4.xxxy
mad r0.y, r0.y, l(2.000000), l(-1.000000)
mad r2.yz, r2.yyzy, cb1[1].xxyx, cb1[1].zzwz
mad r0.zw, r0.zzzw, cb1[1].xxxy, cb1[1].zzzw
sample_indexable(texture2d)(float,float,float,float) r2.yzw, r2.yzyy, t1.wxyz, s2
sample_indexable(texture2d)(float,float,float,float) r3.xyz, r0.zwzz, t1.xyzw, s2
add r3.xyz, -r2.yzwy, r3.xyzx
mad r0.yzw, |r0.yyyy|, r3.xxyz, r2.yyzw
add r0.w, r0.w, cb3[31].x
add r2.y, -r0.w, cb3[32].x
mad_sat r0.w, r0.x, r2.y, r0.w
lt r2.y, r0.w, cb0[22].z
if_nz r2.y
  mov o0.xyzw, l(0,0,0,0)
else
  div r3.z, l(1.000000, 1.000000, 1.000000, 1.000000), v1.w
  ge r2.y, cb0[21].y, r3.z
  if_nz r2.y
    mov r4.xyzw, l(0,0,0,0)
  endif
  if_z r2.y
    dp3 r2.y, v2.xyzx, v2.xyzx
    rsq r2.y, r2.y
    mul r2.yzw, r2.yyyy, v2.xxyz
    div r5.xy, v1.xyxx, v1.wwww
    dp3 r6.x, r2.yzwy, cb0[8].xyzx
    dp3 r6.y, r2.yzwy, cb0[9].xyzx
    dp3 r6.z, r2.yzwy, cb0[10].xyzx
    mul r5.zw, r5.xxxy, cb0[28].xxxy
    mul r7.xy, r5.zwzz, v1.wwww
    mov r7.z, v1.w
    dp3 r3.w, r7.xyzx, r7.xyzx
    rsq r3.w, r3.w
    mul r8.xyz, r3.wwww, r7.xyzx
    dp3 r3.w, r8.xyzx, r6.xyzx
    add r3.w, r3.w, r3.w
    mad r9.xyz, r6.xyzx, -r3.wwww, r8.xyzx
    dp3 r3.w, r9.xyzx, r9.xyzx
    rsq r3.w, r3.w
    mul r5.z, r3.w, r9.z
    lt r5.z, r5.z, cb0[16].x
    if_nz r5.z
      mov r4.xyzw, l(0,0,0,0)
    endif
    if_z r5.z
      mul r10.xyz, v2.zxyz, v3.yzxy
      mad r10.xyz, v2.yzxy, v3.zxyz, -r10.xyzx
      mul r10.xyz, r10.xyzx, v3.wwww
      dp3 r5.z, r10.xyzx, r10.xyzx
      rsq r5.z, r5.z
      mul r10.xyz, r5.zzzz, r10.xyzx
      dp3 r5.z, v3.xyzx, v3.xyzx
      rsq r5.z, r5.z
      mul r11.xyz, r5.zzzz, v3.xyzx
      dp4 r12.x, v1.xyzw, cb8[8].xyzw
      dp4 r12.y, v1.xyzw, cb8[9].xyzw
      dp4 r12.z, v1.xyzw, cb8[10].xyzw
      dp4 r5.z, v1.xyzw, cb8[11].xyzw
      div r12.xyz, r12.xyzx, r5.zzzz
      add r12.xyz, -r12.xyzx, cb8[61].xyzx
      add r1.w, -r1.w, cb8[2].x
      div r1.w, -cb8[2].z, r1.w
      add r1.w, r1.w, -v1.w
      min r1.w, r1.w, cb3[45].x
      div r1.w, r1.w, cb3[45].x
      add_sat r1.w, -r1.w, l(1.000000)
      mul_sat r1.w, r2.x, r1.w
      mad r2.x, r1.w, l(-2.000000), l(3.000000)
      mul r1.w, r1.w, r1.w
      mul r1.w, r1.w, r2.x
      mad r13.xyz, r1.wwww, cb3[25].xyzx, cb3[27].xyzx
      add r14.xyz, r1.zzzz, cb3[24].xyzx
      add r14.xyz, -r13.xyzx, r14.xyzx
      mad r13.xyz, r0.xxxx, r14.xyzx, r13.xyzx
      add r1.xy, -r0.yzyy, r1.xyxx
      mad r0.xy, r0.xxxx, r1.xyxx, r0.yzyy
      mad r0.xy, r0.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
      dp2 r0.z, r0.xyxx, r0.xyxx
      min r0.z, r0.z, l(1.000000)
      add r0.z, -r0.z, l(1.000000)
      sqrt r0.z, r0.z
      mul r1.xyz, r11.xyzx, r0.yyyy
      mad r1.xyz, r0.xxxx, r10.xyzx, r1.xyzx
      mad r0.xyz, r0.zzzz, r2.yzwy, r1.xyzx
      dp3 r1.x, r0.xyzx, r0.xyzx
      rsq r1.x, r1.x
      mul r0.xyz, r0.xyzx, r1.xxxx
      dp3 r1.x, r12.xyzx, r12.xyzx
      rsq r1.x, r1.x
      mul r1.xyz, r1.xxxx, r12.xyzx
      dp3 r0.x, r1.xyzx, r0.xyzx
      add_sat r0.x, r0.x, -cb3[34].x
      max r0.y, l(0.001000), cb3[28].x
      log r0.x, r0.x
      mul r0.x, r0.x, r0.y
      exp r0.x, r0.x
      add r0.x, -r0.x, l(1.000000)
      max r0.y, l(0.001000), cb3[29].x
      log r0.x, r0.x
      mul r0.x, r0.x, r0.y
      exp r0.x, r0.x
      add r1.xyz, r13.xyzx, -cb3[26].xyzx
      mad r0.xyz, r0.xxxx, r1.xyzx, cb3[26].xyzx
      mul_sat r0.xyz, r0.xyzx, r13.xyzx
      mov_sat r1.x, cb3[30].x
      add r0.xyz, r0.xyzx, l(-0.030000, -0.030000, -0.030000, 0.000000)
      mad r0.xyz, r1.xxxx, r0.xyzx, l(0.030000, 0.030000, 0.030000, 0.000000)
      dp3 r1.x, -r8.xyzx, r6.xyzx
      min r1.x, |r1.x|, l(1.000000)
      add r1.x, -r1.x, l(1.000000)
      mul r1.y, r1.x, r1.x
      mul r1.y, r1.y, r1.y
      mul r1.x, r1.y, r1.x
      max r0.y, r0.z, r0.y
      max r0.x, r0.y, r0.x
      add r0.y, -r0.x, l(1.000000)
      mul r0.y, r1.x, r0.y
      mul r0.z, r0.w, r0.w
      mad r0.x, r0.y, r0.z, r0.x
      lt r0.y, r0.x, cb0[22].x
      if_nz r0.y
        mov o0.xyzw, l(0,0,0,0)
      else
        mov o0.xyzw, r4.xyzw
      endif
      if_z r0.y
        mad r3.xy, r5.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
        mad_sat r0.y, r9.z, r3.w, -cb0[16].x
        mul r0.y, r0.y, r0.y
        add r0.x, r0.x, -cb0[22].x
        mul_sat r0.x, r0.x, l(10.000000)
        min r0.x, r0.x, r0.y
        add r0.y, -v1.w, cb0[21].x
        mul_sat r0.y, r0.y, cb0[21].z
        min r0.x, r0.y, r0.x
        mad r1.xyz, r9.xyzx, r3.wwww, r7.xyzx
        mov r1.w, l(1.000000)
        dp4 r2.x, r1.xyzw, cb0[4].xyzw
        dp4 r2.y, r1.xyzw, cb0[5].xyzw
        dp4 r0.y, r1.xyzw, cb0[7].xyzw
        div r2.xy, r2.xyxx, r0.yyyy
        div r2.z, l(1.000000, 1.000000, 1.000000, 1.000000), r1.z
        add r0.yzw, -r3.xxyz, r2.xxyz
        mul r1.xy, r0.yzyy, cb0[18].xyxx
        dp2 r1.x, r1.xyxx, r1.xyxx
        sqrt r1.x, r1.x
        add r1.x, r1.x, l(0.000010)
        div r0.yzw, r0.yyzw, r1.xxxx
        mul r1.xyz, r0.yzwy, cb0[23].zzzz
        lt r2.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), r1.xyzx
        and r5.xy, r2.xyxx, l(0x3f800000, 0x3f800000, 0, 0)
        movc r5.z, r2.z, cb0[20].x, cb0[20].y
        add r2.xyz, -r3.xyzx, r5.xyzx
        add r5.xyz, |r1.xyzx|, l(1.000000012E-007, 1.000000012E-007, 1.000000012E-007, 0.000000)
        div r2.xyz, |r2.xyzx|, r5.xyzx
        min r1.z, r2.y, r2.x
        add r1.w, r2.z, l(2.000000)
        min r1.z, r1.w, r1.z
        min r1.z, r1.z, cb0[23].y
        mad r2.xyz, r0.yzwy, cb0[23].zzzz, r3.xyzx
        log r1.w, cb0[23].z
        add r1.w, r1.w, l(0.999000)
        ftoi r1.zw, r1.zzzw
        dp2 r2.w, r1.xyxx, r1.xyxx
        rsq r2.w, r2.w
        mul r1.xy, r1.xyxx, r2.wwww
        mov r5.z, l(1.000000)
        mov r6.xyz, l(0,0,0,0)
        mov r7.xyz, r3.xyzx
        mov r2.w, l(0)
        mov r3.w, l(0)
        mov r6.w, r3.z
        mov r8.xyz, r2.xyzx
        mov r7.w, l(-1)
        loop
          ige r8.w, r3.w, r1.z
          breakc_nz r8.w
          sample_l_indexable(texture2d)(float,float,float,float) r8.w, r8.xyxx, t27.yzwx, s7, l(0.000000)
          add r9.x, -r8.w, r8.z
          mad r9.y, -cb0[19].y, r6.w, r8.w
          ge r9.z, l(0.000000), r9.x
          lt r9.y, r9.y, l(0.000000)
          and r9.y, r9.y, r9.z
          and r9.y, r7.w, r9.y
          if_nz r9.y
            mov r10.xyz, r8.xyzx
            mov r11.xyz, r7.xyzx
            mov r5.w, r8.w
            mov r9.y, l(0)
            loop
              ige r9.z, r9.y, r1.w
              breakc_nz r9.z
              add r12.xyz, r10.xyzx, r11.xyzx
              mul r13.xyz, r12.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
              sample_l_indexable(texture2d)(float,float,float,float) r11.w, r13.xyxx, t27.yzwx, s7, l(0.000000)
              mad r9.z, r12.z, l(0.500000), -r11.w
              lt r9.z, r9.z, l(0.000000)
              movc r10.xyz, r9.zzzz, r13.xyzx, r10.xyzx
              mov r13.w, r5.w
              movc r11.xyzw, r9.zzzz, r11.xyzw, r13.xyzw
              iadd r9.y, r9.y, l(1)
              mov r5.w, r11.w
            endloop
            mov r8.xyz, r10.xyzx
            mov r7.xyz, r11.xyzx
            mad r9.yz, r8.xxyx, l(0.000000, 2.000000, -2.000000, 0.000000), l(0.000000, -1.000000, 1.000000, 0.000000)
            mul r5.xy, r9.yzyy, cb0[28].xyxx
            dp4 r12.x, r5.xyzw, cb0[24].xyzw
            dp4 r12.y, r5.xyzw, cb0[25].xyzw
            dp4 r5.x, r5.xyzw, cb0[27].xyzw
            div r5.xy, r12.xyxx, r5.xxxx
            sample_l_indexable(texture2d)(float,float,float,float) r6.xyz, r5.xyxx, t26.xyzw, s9, l(0.000000)
            add r5.xy, -r5.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
            add r5.xy, r5.xyxx, r5.xyxx
            mul r9.yz, r5.xxyx, r5.xxyx
            min r9.yz, r9.yyzy, l(0.000000, 1.000000, 1.000000, 0.000000)
            add r9.yz, -r9.yyzy, l(0.000000, 1.000000, 1.000000, 0.000000)
            mul r9.y, r9.z, r9.y
            dp2 r9.z, r5.xyxx, r5.xyxx
            rsq r9.z, r9.z
            mul r5.xy, r5.xyxx, r9.zzzz
            dp2_sat r5.x, -r5.xyxx, r1.xyxx
            mad r5.x, r5.x, l(-2.000000), l(4.000000)
            mul r5.x, r5.x, r9.y
            min r5.x, r5.x, l(1.000000)
            mul r5.x, r5.x, r5.x
            min r2.w, r0.x, r5.x
            mov r3.w, r1.z
            mov r7.w, l(-1)
          else
            lt r7.w, l(0.000000), r9.x
            iadd r3.w, r3.w, l(1)
            mad r9.xyz, r0.yzwy, cb0[23].zzzz, r8.xyzx
            mov r7.xyz, r8.xyzx
            mov r6.w, r8.w
            mov r8.xyz, r9.xyzx
          endif
        endloop
        mul r0.xyz, r2.wwww, r6.xyzx
        mul o0.xyz, r0.xyzx, cb0[28].wwww
        mov o0.w, r2.w
      endif
    else
      mov o0.xyzw, r4.xyzw
    endif
  else
    mov o0.xyzw, r4.xyzw
  endif
endif
ret
// Approximately 286 instruction slots used

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