// PreFix
// ---- Created with 3Dmigoto v1.2.29 on Mon Apr 04 23:03:55 2016

cbuffer _Globals : register(b0)
{
  row_major float4x4 m_shadow : packoffset(c0);
  row_major float3x4 m_sunmask : packoffset(c4);
  float4 RainDensity : packoffset(c7);
  float4 WorldX : packoffset(c8);
  float4 WorldZ : packoffset(c9);
}

cbuffer static_globals : register(b1)
{
  row_major float3x4 m_V : packoffset(c0);
  row_major float4x4 m_P : packoffset(c3);
  row_major float4x4 m_VP : packoffset(c7);
  float4 timers : packoffset(c11);
  float4 fog_plane : packoffset(c12);
  float4 fog_params : packoffset(c13);
  float4 fog_color : packoffset(c14);
  float4 L_ambient : packoffset(c15);
  float3 L_sun_color : packoffset(c16);
  float3 L_sun_dir_w : packoffset(c17);
  float4 L_hemi_color : packoffset(c18);
  float3 eye_position : packoffset(c19);
  float4 pos_decompression_params : packoffset(c20);
  float4 pos_decompression_params2 : packoffset(c21);
}

cbuffer dynamic_light : register(b2)
{
  float4 Ldynamic_color : packoffset(c0);
  float4 Ldynamic_pos : packoffset(c1);
  float4 Ldynamic_dir : packoffset(c2);
}

SamplerState smp_linear_s : register(s0);
SamplerState smp_base_s : register(s1);
SamplerComparisonState smp_smap_s : register(s2);
Texture2D<float4> s_smap : register(t0);
Texture2DMS<float4,2> s_position : register(t1);
Texture2DMS<float4,2> s_diffuse : register(t2);
Texture2D<float4> jitter0 : register(t3);
Texture2D<float4> jitter1 : register(t4);
Texture3D<float4> s_water : register(t5);
Texture2D<float4> s_waterFall : register(t6);


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


void main( 
  float2 v0 : TEXCOORD0,
  float2 w0 : TEXCOORD1,
  float4 v1 : COLOR0,
  float4 v2 : SV_Position0,
  uint v3 : SV_SAMPLEINDEX0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xy = (int2)v2.xy;
  r0.zw = float2(0,0);
  r1.xyz = s_position.Load(r0.xy, v3.x).xyz;
  r0.xyz = s_diffuse.Load(r0.xy, v3.x).xyz;
  r0.x = dot(r0.xyz, float3(0.330000013,0.330000013,0.330000013));
  r2.x = abs(r1.y) * 2 + -1;
  r0.y = -r2.x * r2.x + 1;
  r0.y = -r1.x * r1.x + r0.y;
  r0.y = sqrt(abs(r0.y));
  r0.z = cmp(r1.y < 0);
  r0.z = r0.z ? -1 : 1;
  r2.y = r0.z * r0.y;
  r2.z = r1.x;
  r0.y = dot(r2.xyz, r2.xyz);
  r0.y = rsqrt(r0.y);
  r3.xyz = r2.xyz * r0.yyy;
  r4.x = dot(m_sunmask._m00_m01_m02, r3.xyz);
  r4.y = dot(m_sunmask._m20_m21_m22, r3.xyz);
  r0.z = dot(Ldynamic_dir.xyz, r3.xyz);
  r3.xy = float2(0.0350000001,0.0350000001) * r4.xy;
  r3.zw = v2.xy * pos_decompression_params.zw + -pos_decompression_params.xy;
  r1.xy = r3.zw * r1.zz;
float4 stereo = StereoParams.Load(0);
float4 params = IniParams.Load(0);
r1.x -= stereo.x * (r1.z - stereo.y)/m_P._m00;
  r0.w = -5 + r1.z;
  r0.w = saturate(0.0666666701 * r0.w);
  r1.w = 1;
  r5.x = dot(m_sunmask._m00_m01_m02_m03, r1.xyzw);
  r5.y = dot(m_sunmask._m20_m21_m22_m23, r1.xyzw);
  r3.xy = r5.xy * float2(1.10000002,1.10000002) + -r3.xy;
  r6.xyzw = jitter0.Sample(smp_linear_s, r3.xy).xyzw;
  r3.xyzw = jitter1.Sample(smp_linear_s, r3.xy).xyzw;
  r7.x = dot(m_shadow._m00_m01_m02_m03, r1.xyzw);
  r7.y = dot(m_shadow._m10_m11_m12_m13, r1.xyzw);
  r7.z = dot(m_shadow._m20_m21_m22_m23, r1.xyzw);
  r2.w = dot(m_shadow._m30_m31_m32_m33, r1.xyzw);
  r5.w = dot(m_sunmask._m10_m11_m12_m13, r1.xyzw);
  r1.x = dot(r1.xyz, r1.xyz);
  r1.x = sqrt(r1.x);
  r1.x = -0.800000012 + r1.x;
  r1.x = saturate(10 * r1.x);
  r8.xyz = float3(0.5,0.5,0.5) * r5.xwy;
  r1.yzw = r7.xyz / r2.www;
  r4.zw = r6.xy * float2(0.001953125,0.001953125) + r1.yz;
  r6.xy = r6.wz * float2(0.001953125,0.001953125) + r1.yz;
  r6.y = s_smap.SampleCmpLevelZero(smp_smap_s, r6.xy, r1.w).x;
  r6.x = s_smap.SampleCmpLevelZero(smp_smap_s, r4.zw, r1.w).x;
  r3.xy = r3.xy * float2(0.001953125,0.001953125) + r1.yz;
  r1.yz = r3.wz * float2(0.001953125,0.001953125) + r1.yz;
  r6.w = s_smap.SampleCmpLevelZero(smp_smap_s, r1.yz, r1.w).x;
  r6.z = s_smap.SampleCmpLevelZero(smp_smap_s, r3.xy, r1.w).x;
  r1.y = dot(r6.xyzw, float4(0.25,0.25,0.25,0.25));
  r1.z = r0.w * -2 + 3;
  r0.w = r0.w * r0.w;
  r0.w = -r1.z * r0.w + 1;
  r0.w = r0.w * r0.w;
  r0.w = r1.y * r0.w;
  r0.w = RainDensity.x * r0.w;
  r1.y = saturate(r0.z * -10 + 5.5);
  r0.z = max(0, -r0.z);
  r0.w = r1.y * r0.w;
  r1.y = r1.x * -2 + 3;
  r1.x = r1.x * r1.x;
  r1.x = r1.y * r1.x;
  r1.x = r1.x * r0.w;
  o0.w = r0.w * r0.x;
  r0.x = r1.x * r0.z;
  r1.xy = abs(r4.xy) * r1.xx;
  r0.z = 1 + -r0.z;
  r0.z = 10 * r0.z;
  r0.z = ceil(r0.z);
  r0.z = timers.x * r0.z;
  r8.w = r0.z * 0.0500000007 + r8.y;
  r5.z = 3 * timers.x;
  r0.zw = s_water.SampleBias(smp_base_s, r5.xyz, -3).zw;
  r0.zw = float2(-0.5,-0.5) + r0.wz;
  r0.zw = float2(6,6) * r0.zw;
  r3.xz = r0.zw * r0.xx;
  r3.y = 0;
  r4.x = 0;
  r0.xz = s_waterFall.Sample(smp_base_s, r8.zw).xy;
  r1.zw = s_waterFall.Sample(smp_base_s, r8.xw).xy;
  r1.zw = float2(-0.5,-0.5) + r1.wz;
  r1.zw = float2(0.600000024,0.600000024) * r1.zw;
  r5.xy = r1.zw * r1.yy;
  r0.xz = float2(-0.5,-0.5) + r0.xz;
  r4.yz = float2(0.600000024,0.600000024) * r0.xz;
  r0.xzw = r4.xyz * r1.xxx + r3.xyz;
  r5.z = 0;
  r0.xzw = r5.xyz + r0.xzw;
  r1.x = dot(m_V._m00_m01_m02, r0.xzw);
  r1.y = dot(m_V._m10_m11_m12, r0.xzw);
  r1.z = dot(m_V._m20_m21_m22, r0.xzw);
  r0.xyz = r2.xyz * r0.yyy + r1.xyz;
  r0.w = dot(r0.xyz, r0.xyz);
  r0.w = rsqrt(r0.w);
  o0.xyz = r0.xyz * r0.www;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.27.952.3022
//
//
// Buffer Definitions: 
//
// cbuffer $Globals
// {
//
//   row_major float4x4 m_shadow;       // Offset:    0 Size:    64
//   row_major float3x4 m_sunmask;      // Offset:   64 Size:    48
//   float4 RainDensity;                // Offset:  112 Size:    16
//   float4 WorldX;                     // Offset:  128 Size:    16 [unused]
//   float4 WorldZ;                     // Offset:  144 Size:    16 [unused]
//
// }
//
// cbuffer static_globals
// {
//
//   row_major float3x4 m_V;            // Offset:    0 Size:    48
//   row_major float4x4 m_P;            // Offset:   48 Size:    64 [unused]
//   row_major float4x4 m_VP;           // Offset:  112 Size:    64 [unused]
//   float4 timers;                     // Offset:  176 Size:    16
//   float4 fog_plane;                  // Offset:  192 Size:    16 [unused]
//   float4 fog_params;                 // Offset:  208 Size:    16 [unused]
//   float4 fog_color;                  // Offset:  224 Size:    16 [unused]
//   float4 L_ambient;                  // Offset:  240 Size:    16 [unused]
//   float3 L_sun_color;                // Offset:  256 Size:    12 [unused]
//   float3 L_sun_dir_w;                // Offset:  272 Size:    12 [unused]
//   float4 L_hemi_color;               // Offset:  288 Size:    16 [unused]
//   float3 eye_position;               // Offset:  304 Size:    12 [unused]
//   float4 pos_decompression_params;   // Offset:  320 Size:    16
//   float4 pos_decompression_params2;  // Offset:  336 Size:    16 [unused]
//
// }
//
// cbuffer dynamic_light
// {
//
//   float4 Ldynamic_color;             // Offset:    0 Size:    16 [unused]
//   float4 Ldynamic_pos;               // Offset:   16 Size:    16 [unused]
//   float4 Ldynamic_dir;               // Offset:   32 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// smp_linear                        sampler      NA          NA    0        1
// smp_base                          sampler      NA          NA    1        1
// smp_smap                        sampler_c      NA          NA    2        1
// s_smap                            texture  float4          2d    0        1
// s_position                        texture  float4       2dMS2    1        1
// s_diffuse                         texture  float4       2dMS2    2        1
// jitter0                           texture  float4          2d    3        1
// jitter1                           texture  float4          2d    4        1
// s_water                           texture  float4          3d    5        1
// s_waterFall                       texture  float4          2d    6        1
// $Globals                          cbuffer      NA          NA    0        1
// static_globals                    cbuffer      NA          NA    1        1
// dynamic_light                     cbuffer      NA          NA    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xy          0     NONE   float       
// TEXCOORD                 1     zw        0     NONE   float       
// COLOR                    0   xyzw        1     NONE   float       
// SV_Position              0   xyzw        2      POS   float   xy  
// SV_SAMPLEINDEX           0   x           3   SAMPLE    uint   x   
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
// Pixel Shader runs at sample frequency
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[8], immediateIndexed
dcl_constantbuffer cb1[21], immediateIndexed
dcl_constantbuffer cb2[3], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_comparison
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2dms(2) (float,float,float,float) t1
dcl_resource_texture2dms(2) (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture3d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_input_ps_siv linear noperspective v2.xy, position
dcl_input_ps_sgv v3.x, sampleIndex
dcl_output o0.xyzw
dcl_temps 9
ftoi r0.xy, v2.xyxx
mov r0.zw, l(0,0,0,0)
ldms_indexable(texture2dms)(float,float,float,float) r1.xyz, r0.xyww, t1.xyzw, v3.x
ldms_indexable(texture2dms)(float,float,float,float) r0.xyz, r0.xyzw, t2.xyzw, v3.x
dp3 r0.x, r0.xyzx, l(0.330000, 0.330000, 0.330000, 0.000000)
mad r2.x, |r1.y|, l(2.000000), l(-1.000000)
mad r0.y, -r2.x, r2.x, l(1.000000)
mad r0.y, -r1.x, r1.x, r0.y
sqrt r0.y, |r0.y|
lt r0.z, r1.y, l(0.000000)
movc r0.z, r0.z, l(-1.000000), l(1.000000)
mul r2.y, r0.y, r0.z
mov r2.z, r1.x
dp3 r0.y, r2.xyzx, r2.xyzx
rsq r0.y, r0.y
mul r3.xyz, r0.yyyy, r2.xyzx
dp3 r4.x, cb0[4].xyzx, r3.xyzx
dp3 r4.y, cb0[6].xyzx, r3.xyzx
dp3 r0.z, cb2[2].xyzx, r3.xyzx
mul r3.xy, r4.xyxx, l(0.035000, 0.035000, 0.000000, 0.000000)
mad r3.zw, v2.xxxy, cb1[20].zzzw, -cb1[20].xxxy
mul r1.xy, r1.zzzz, r3.zwzz
add r0.w, r1.z, l(-5.000000)
mul_sat r0.w, r0.w, l(0.066667)
mov r1.w, l(1.000000)
dp4 r5.x, cb0[4].xyzw, r1.xyzw
dp4 r5.y, cb0[6].xyzw, r1.xyzw
mad r3.xy, r5.xyxx, l(1.100000, 1.100000, 0.000000, 0.000000), -r3.xyxx
sample_indexable(texture2d)(float,float,float,float) r6.xyzw, r3.xyxx, t3.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r3.xyxx, t4.xyzw, s0
dp4 r7.x, cb0[0].xyzw, r1.xyzw
dp4 r7.y, cb0[1].xyzw, r1.xyzw
dp4 r7.z, cb0[2].xyzw, r1.xyzw
dp4 r2.w, cb0[3].xyzw, r1.xyzw
dp4 r5.w, cb0[5].xyzw, r1.xyzw
dp3 r1.x, r1.xyzx, r1.xyzx
sqrt r1.x, r1.x
add r1.x, r1.x, l(-0.800000)
mul_sat r1.x, r1.x, l(10.000000)
mul r8.xyz, r5.xwyx, l(0.500000, 0.500000, 0.500000, 0.000000)
div r1.yzw, r7.xxyz, r2.wwww
mad r4.zw, r6.xxxy, l(0.000000, 0.000000, 0.001953, 0.001953), r1.yyyz
mad r6.xy, r6.wzww, l(0.001953, 0.001953, 0.000000, 0.000000), r1.yzyy
sample_c_lz_indexable(texture2d)(float,float,float,float) r6.y, r6.xyxx, t0.xxxx, s2, r1.w
sample_c_lz_indexable(texture2d)(float,float,float,float) r6.x, r4.zwzz, t0.xxxx, s2, r1.w
mad r3.xy, r3.xyxx, l(0.001953, 0.001953, 0.000000, 0.000000), r1.yzyy
mad r1.yz, r3.wwzw, l(0.000000, 0.001953, 0.001953, 0.000000), r1.yyzy
sample_c_lz_indexable(texture2d)(float,float,float,float) r6.w, r1.yzyy, t0.xxxx, s2, r1.w
sample_c_lz_indexable(texture2d)(float,float,float,float) r6.z, r3.xyxx, t0.xxxx, s2, r1.w
dp4 r1.y, r6.xyzw, l(0.250000, 0.250000, 0.250000, 0.250000)
mad r1.z, r0.w, l(-2.000000), l(3.000000)
mul r0.w, r0.w, r0.w
mad r0.w, -r1.z, r0.w, l(1.000000)
mul r0.w, r0.w, r0.w
mul r0.w, r0.w, r1.y
mul r0.w, r0.w, cb0[7].x
mad_sat r1.y, r0.z, l(-10.000000), l(5.500000)
max r0.z, -r0.z, l(0.000000)
mul r0.w, r0.w, r1.y
mad r1.y, r1.x, l(-2.000000), l(3.000000)
mul r1.x, r1.x, r1.x
mul r1.x, r1.x, r1.y
mul r1.x, r0.w, r1.x
mul o0.w, r0.x, r0.w
mul r0.x, r0.z, r1.x
mul r1.xy, r1.xxxx, |r4.xyxx|
add r0.z, -r0.z, l(1.000000)
mul r0.z, r0.z, l(10.000000)
round_pi r0.z, r0.z
mul r0.z, r0.z, cb1[11].x
mad r8.w, r0.z, l(0.050000), r8.y
mul r5.z, cb1[11].x, l(3.000000)
sample_b_indexable(texture3d)(float,float,float,float) r0.zw, r5.xyzx, t5.xyzw, s1, l(-3.000000)
add r0.zw, r0.wwwz, l(0.000000, 0.000000, -0.500000, -0.500000)
mul r0.zw, r0.zzzw, l(0.000000, 0.000000, 6.000000, 6.000000)
mul r3.xz, r0.xxxx, r0.zzwz
mov r3.y, l(0)
mov r4.x, l(0)
sample_indexable(texture2d)(float,float,float,float) r0.xz, r8.zwzz, t6.xzyw, s1
sample_indexable(texture2d)(float,float,float,float) r1.zw, r8.xwxx, t6.zwxy, s1
add r1.zw, r1.wwwz, l(0.000000, 0.000000, -0.500000, -0.500000)
mul r1.zw, r1.zzzw, l(0.000000, 0.000000, 0.600000, 0.600000)
mul r5.xy, r1.yyyy, r1.zwzz
add r0.xz, r0.xxzx, l(-0.500000, 0.000000, -0.500000, 0.000000)
mul r4.yz, r0.xxzx, l(0.000000, 0.600000, 0.600000, 0.000000)
mad r0.xzw, r4.xxyz, r1.xxxx, r3.xxyz
mov r5.z, l(0)
add r0.xzw, r0.xxzw, r5.xxyz
dp3 r1.x, cb1[0].xyzx, r0.xzwx
dp3 r1.y, cb1[1].xyzx, r0.xzwx
dp3 r1.z, cb1[2].xyzx, r0.xzwx
mad r0.xyz, r2.xyzx, r0.yyyy, r1.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul o0.xyz, r0.wwww, r0.xyzx
ret 
// Approximately 96 instruction slots used

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


/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Recompiled ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20789
//
//   using 3Dmigoto v1.2.29 on Mon Apr 04 23:03:55 2016
//
//
// Buffer Definitions: 
//
// cbuffer _Globals
// {
//
//   row_major float4x4 m_shadow;       // Offset:    0 Size:    64
//   row_major float3x4 m_sunmask;      // Offset:   64 Size:    48
//   float4 RainDensity;                // Offset:  112 Size:    16
//   float4 WorldX;                     // Offset:  128 Size:    16 [unused]
//   float4 WorldZ;                     // Offset:  144 Size:    16 [unused]
//
// }
//
// cbuffer static_globals
// {
//
//   row_major float3x4 m_V;            // Offset:    0 Size:    48
//   row_major float4x4 m_P;            // Offset:   48 Size:    64 [unused]
//   row_major float4x4 m_VP;           // Offset:  112 Size:    64 [unused]
//   float4 timers;                     // Offset:  176 Size:    16
//   float4 fog_plane;                  // Offset:  192 Size:    16 [unused]
//   float4 fog_params;                 // Offset:  208 Size:    16 [unused]
//   float4 fog_color;                  // Offset:  224 Size:    16 [unused]
//   float4 L_ambient;                  // Offset:  240 Size:    16 [unused]
//   float3 L_sun_color;                // Offset:  256 Size:    12 [unused]
//   float3 L_sun_dir_w;                // Offset:  272 Size:    12 [unused]
//   float4 L_hemi_color;               // Offset:  288 Size:    16 [unused]
//   float3 eye_position;               // Offset:  304 Size:    12 [unused]
//   float4 pos_decompression_params;   // Offset:  320 Size:    16
//   float4 pos_decompression_params2;  // Offset:  336 Size:    16 [unused]
//
// }
//
// cbuffer dynamic_light
// {
//
//   float4 Ldynamic_color;             // Offset:    0 Size:    16 [unused]
//   float4 Ldynamic_pos;               // Offset:   16 Size:    16 [unused]
//   float4 Ldynamic_dir;               // Offset:   32 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// smp_linear_s                      sampler      NA          NA    0        1
// smp_base_s                        sampler      NA          NA    1        1
// smp_smap_s                      sampler_c      NA          NA    2        1
// s_smap                            texture  float4          2d    0        1
// s_position                        texture  float4       2dMS2    1        1
// s_diffuse                         texture  float4       2dMS2    2        1
// jitter0                           texture  float4          2d    3        1
// jitter1                           texture  float4          2d    4        1
// s_water                           texture  float4          3d    5        1
// s_waterFall                       texture  float4          2d    6        1
// _Globals                          cbuffer      NA          NA    0        1
// static_globals                    cbuffer      NA          NA    1        1
// dynamic_light                     cbuffer      NA          NA    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xy          0     NONE   float       
// TEXCOORD                 1     zw        0     NONE   float       
// COLOR                    0   xyzw        1     NONE   float       
// SV_Position              0   xyzw        2      POS   float   xy  
// SV_SAMPLEINDEX           0   x           3   SAMPLE    uint   x   
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
// Pixel Shader runs at sample frequency
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[8], immediateIndexed
dcl_constantbuffer cb1[21], immediateIndexed
dcl_constantbuffer cb2[3], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_comparison
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2dms(2) (float,float,float,float) t1
dcl_resource_texture2dms(2) (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture3d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_input_ps_siv linear noperspective v2.xy, position
dcl_input_ps_sgv v3.x, sampleIndex
dcl_output o0.xyzw
dcl_temps 9
round_z r0.xy, v2.xyxx
ftoi r0.xy, r0.xyxx
mov r0.zw, l(0,0,0,0)
ldms_indexable(texture2dms)(float,float,float,float) r1.xyz, r0.xyww, t1.xyzw, v3.x
ldms_indexable(texture2dms)(float,float,float,float) r0.xyz, r0.xyzw, t2.xyzw, v3.x
dp3 r0.x, r0.xyzx, l(0.330000, 0.330000, 0.330000, 0.000000)
mad r2.x, |r1.y|, l(2.000000), l(-1.000000)
mad r0.y, -r2.x, r2.x, l(1.000000)
mad r0.y, -r1.x, r1.x, r0.y
sqrt r0.y, |r0.y|
lt r0.z, r1.y, l(0.000000)
movc r0.z, r0.z, l(-1.000000), l(1.000000)
mul r2.y, r0.y, r0.z
mov r2.z, r1.x
dp3 r0.y, r2.xyzx, r2.xyzx
rsq r0.y, r0.y
mul r3.xyz, r0.yyyy, r2.xyzx
dp3 r4.x, cb0[4].xyzx, r3.xyzx
dp3 r4.y, cb0[6].xyzx, r3.xyzx
dp3 r0.z, cb2[2].xyzx, r3.xyzx
mul r3.xy, r4.xyxx, l(0.035000, 0.035000, 0.000000, 0.000000)
mad r3.zw, v2.xxxy, cb1[20].zzzw, -cb1[20].xxxy
mul r1.xy, r1.zzzz, r3.zwzz
add r0.w, r1.z, l(-5.000000)
mul_sat r0.w, r0.w, l(0.0666666701)
mov r1.w, l(1.000000)
dp4 r5.x, cb0[4].xyzw, r1.xyzw
dp4 r5.y, cb0[6].xyzw, r1.xyzw
mad r3.xy, r5.xyxx, l(1.100000, 1.100000, 0.000000, 0.000000), -r3.xyxx
sample_indexable(texture2d)(float,float,float,float) r6.xyzw, r3.xyxx, t3.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r3.xyxx, t4.xyzw, s0
dp4 r7.x, cb0[0].xyzw, r1.xyzw
dp4 r7.y, cb0[1].xyzw, r1.xyzw
dp4 r7.z, cb0[2].xyzw, r1.xyzw
dp4 r2.w, cb0[3].xyzw, r1.xyzw
dp4 r5.z, cb0[5].xyzw, r1.xyzw
dp3 r1.x, r1.xyzx, r1.xyzx
sqrt r1.x, r1.x
add r1.x, r1.x, l(-0.800000)
mul_sat r1.x, r1.x, l(10.000000)
mul r8.xyz, r5.xzyx, l(0.500000, 0.500000, 0.500000, 0.000000)
div r1.yzw, r7.xxyz, r2.wwww
mad r6.xyzw, r6.xywz, l(0.00195312500, 0.00195312500, 0.00195312500, 0.00195312500), r1.yzyz
sample_c_lz_indexable(texture2d)(float,float,float,float) r7.y, r6.zwzz, t0.xxxx, s2, r1.w
sample_c_lz_indexable(texture2d)(float,float,float,float) r7.x, r6.xyxx, t0.xxxx, s2, r1.w
mad r3.xyzw, r3.xywz, l(0.00195312500, 0.00195312500, 0.00195312500, 0.00195312500), r1.yzyz
sample_c_lz_indexable(texture2d)(float,float,float,float) r7.w, r3.zwzz, t0.xxxx, s2, r1.w
sample_c_lz_indexable(texture2d)(float,float,float,float) r7.z, r3.xyxx, t0.xxxx, s2, r1.w
dp4 r1.y, r7.xyzw, l(0.250000, 0.250000, 0.250000, 0.250000)
mad r1.z, r0.w, l(-2.000000), l(3.000000)
mul r0.w, r0.w, r0.w
mad r0.w, -r1.z, r0.w, l(1.000000)
mul r0.w, r0.w, r0.w
mul r0.w, r0.w, r1.y
mul r0.w, r0.w, cb0[7].x
mad_sat r1.y, r0.z, l(-10.000000), l(5.500000)
max r0.z, -r0.z, l(0.000000)
mul r0.w, r0.w, r1.y
mad r1.y, r1.x, l(-2.000000), l(3.000000)
mul r1.x, r1.x, r1.x
mul r1.x, r1.x, r1.y
mul r1.x, r0.w, r1.x
mul o0.w, r0.x, r0.w
mul r3.xy, r1.xxxx, |r4.xyxx|
mul r0.x, r0.z, r1.x
add r0.z, -r0.z, l(1.000000)
mul r0.z, r0.z, l(10.000000)
round_pi r0.z, r0.z
mul r0.z, r0.z, cb1[11].x
mad r8.w, r0.z, l(0.050000), r8.y
sample_indexable(texture2d)(float,float,float,float) r0.zw, r8.zwzz, t6.zwxy, s1
sample_indexable(texture2d)(float,float,float,float) r1.xy, r8.xwxx, t6.xyzw, s1
add r1.xy, r1.yxyy, l(-0.500000, -0.500000, 0.000000, 0.000000)
mul r1.xy, r1.xyxx, r3.yyyy
mul r1.xy, r1.xyxx, l(0.600000, 0.600000, 0.000000, 0.000000)
add r0.zw, r0.zzzw, l(0.000000, 0.000000, -0.500000, -0.500000)
mul r3.zw, r0.zzzw, r3.xxxx
mul r5.w, l(3.000000), cb1[11].x
sample_b_indexable(texture3d)(float,float,float,float) r0.zw, r5.xywx, t5.xyzw, s1, l(-3.000000)
add r0.zw, r0.wwwz, l(0.000000, 0.000000, -0.500000, -0.500000)
mul r0.xz, r0.zzwz, r0.xxxx
mul r4.xz, r0.xxzx, l(6.000000, 0.000000, 6.000000, 0.000000)
mov r4.y, l(0)
mad r0.xzw, r3.xxzw, l(0.000000, 0.000000, 0.600000, 0.600000), r4.xxyz
mov r1.z, l(0)
add r0.xzw, r0.xxzw, r1.xxyz
dp3 r1.x, cb1[0].xyzx, r0.xzwx
dp3 r1.y, cb1[1].xyzx, r0.xzwx
dp3 r1.z, cb1[2].xyzx, r0.xzwx
mad r0.xyz, r2.xyzx, r0.yyyy, r1.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul o0.xyz, r0.wwww, r0.xyzx
ret 
// Approximately 94 instruction slots used

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