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

cbuffer cbWave : register(b0)
{
  float4x4 g_world : packoffset(c0);
  float4x4 g_viewProjection : packoffset(c4);
  float4x4 g_invView : packoffset(c8);
  float4x4 g_invProjection : packoffset(c12);
  float4x4 g_invViewProjection : packoffset(c16);
  float4x4 g_terrainInvView : packoffset(c20);
  float4x4 g_terrainInvProjection : packoffset(c24);
  float4x4 g_cameraYRotation : packoffset(c28);
  float4 g_eyePosition : packoffset(c32);
  float4 g_eyePositionPushedBack : packoffset(c33);
  float4 g_meshCorner0 : packoffset(c34);
  float4 g_meshCorner1 : packoffset(c35);
  float4 g_meshCorner2 : packoffset(c36);
  float4 g_meshCorner3 : packoffset(c37);
  float g_cameraFovY : packoffset(c38);
  float g_cameraNearClip : packoffset(c38.y);
  float g_cameraFarClip : packoffset(c38.z);
  float g_terrainNearClip : packoffset(c38.w);
  float g_terrainFarClip : packoffset(c39);
  float g_time : packoffset(c39.y);
  float g_dt : packoffset(c39.z);
  float g_waveNum : packoffset(c39.w);
}

cbuffer cbWaveUserParam : register(b1)
{
  float4 g_shallowColor : packoffset(c0);
  float4 g_deepColor : packoffset(c1);
  float g_depthBorderFeed : packoffset(c2);
  float g_depthBorderBubble : packoffset(c2.y);
  float g_depthBeachEnd : packoffset(c2.z);
  float g_depthTransparent : packoffset(c2.w);
  float g_depthBlendBegin : packoffset(c3);
  float g_depthBlendEnd : packoffset(c3.y);
  float g_bumpMapTilingSize : packoffset(c3.z);
  float g_fftTexureTilingSize : packoffset(c3.w);
  float g_borderBobbleFlatScale : packoffset(c4);
  float g_borderWaveScale : packoffset(c4.y);
  float g_terrainGradient : packoffset(c4.z);
  float g_depthLimit : packoffset(c4.w);
  float g_vsLodBeginDistance : packoffset(c5);
  float g_vsLodEndDistance : packoffset(c5.y);
  float g_choppyScale : packoffset(c5.z);
  float g_bChoppy : packoffset(c5.w);
  float4 g_ambientSH[3] : packoffset(c6);
  float4 g_lightDirection : packoffset(c9);
  float4 g_lightDiffColor : packoffset(c10);
  float4 g_lightSpecColor : packoffset(c11);
  float g_sharpness : packoffset(c12);
  float g_bBlinnPhong : packoffset(c12.y);
  float4 g_terrainAreaCenter : packoffset(c13);
  float g_terrainAreaWidth : packoffset(c14);
  float g_terrainAreaDepth : packoffset(c14.y);
  float g_reflectMax : packoffset(c14.z);
  float g_reflectMin : packoffset(c14.w);
  float g_shininess : packoffset(c15);
  float g_reflectance : packoffset(c15.y);
  float g_reflectDistortionScale : packoffset(c15.z);
  float g_reflectDistortionScaleFar : packoffset(c15.w);
  float g_reflectDistortionFar : packoffset(c16);
}

cbuffer cbGarstnerWaveParam : register(b2)
{

  struct
  {
    float3 direction;
    float wavelength;
    float amplitude;
  } wave[2] : packoffset(c0);

}

SamplerState SS_WrapLinear_s : register(s8);
SamplerState SS_ClampLinear_s : register(s9);
Texture2D<float4> g_DiffuseTexture : register(t0);
Texture2D<float4> g_BumpmapTexture2 : register(t10);
Texture2D<float4> g_BlendMaskTexture : register(t14);
Texture2D<float4> g_ReflectionTexture : register(t54);
Texture2D<float4> g_RefractionTexture : register(t55);


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


void main( 
  float4 v0 : SV_POSITION0,
  float3 v1 : POSITION0,
  float3 v2 : NORMAL0,
  float3 v3 : TANGENT0,
  float3 v4 : BINORMAL0,
  float2 v5 : DEPTH0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r7;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyzw = float4(-0.0700000003,-0,0.0490199998,-0.0285) * g_time;
  r1.x = 1 / g_bumpMapTilingSize;
  r1.xyzw = v1.xzxz * r1.xxxx;
  r0.xyzw = r1.zwzw * float4(0.0199999996,0.0199999996,0.0299999993,0.0299999993) + r0.xyzw;
  r2.xyz = g_BumpmapTexture2.Sample(SS_WrapLinear_s, r0.xy).xyz;
  r0.xyz = g_BumpmapTexture2.Sample(SS_WrapLinear_s, r0.zw).xyz;
  r0.xyz = r2.xzy + r0.xzy;
  r2.xyzw = float4(-0.0404199995,-0.0234999992,0.0259000007,0.0259000007) * g_time;
  r1.xyzw = r1.xyzw * float4(0.0500000007,0.0500000007,0.0700000003,0.0700000003) + r2.xyzw;
  r2.xyz = g_BumpmapTexture2.Sample(SS_WrapLinear_s, r1.xy).xyz;
  r1.xyz = g_BumpmapTexture2.Sample(SS_WrapLinear_s, r1.zw).xyz;
  r0.xyz = r2.xzy + r0.xyz;
  r0.xyz = r0.xyz + r1.xzy;
  r0.xyz = r0.xyz * float3(2,2,2) + float3(-3.29999995,-3.29999995,-3.29999995);
  r0.w = dot(r0.xyz, r0.xyz);
  r0.w = rsqrt(r0.w);
  r0.xyz = r0.xyz * r0.www;
  r1.xyz = v2.xyz * r0.yyy;
  r0.xyw = r0.xxx * v3.xyz + r1.xyz;
  r0.xyz = r0.zzz * v4.xyz + r0.xyw;
  r0.w = dot(r0.xyz, r0.xyz);
  r0.w = rsqrt(r0.w);
  r0.xyz = r0.xyz * r0.www;
  r1.xy = -r0.xz * r0.yy;
  r2.xyz = g_eyePosition.xyz + -v1.xyz;
  r1.z = dot(r2.xyz, r2.xyz);
  r1.w = sqrt(r1.z);
  r1.z = rsqrt(r1.z);
  r2.xyz = r2.xyz * r1.zzz;
  r1.z = g_cameraNearClip / r1.w;
  r1.w = saturate(r1.w / g_reflectDistortionFar);
  r1.xy = r1.xy * r1.zz;
  r2.w = 0.5 * g_cameraFovY;
  r2.w = sin(r2.w);
  r2.w = g_cameraNearClip * r2.w;
  r1.xy = r1.xy / r2.ww;
  r3.x = cmp(0 < abs(r2.w));
  r1.xy = r3.xx ? r1.xy : 0;
  r3.y = -g_world._m31 + v1.y;
  r3.yz = float2(0,-1) * r3.yy;
  r3.yz = r3.yz * r1.zz;
  r3.yz = r3.yz / r2.ww;
  r3.xy = r3.xx ? r3.yz : 0;
  r1.xy = r3.xy + r1.xy;
  r1.xy = float2(0.5,0.5) * r1.xy;
  r1.z = dot(r1.xy, r1.xy);
  r1.z = sqrt(r1.z);
  r2.w = cmp(0 < r1.z);
  r3.x = cmp(0 < g_reflectDistortionFar);
  r1.w = r3.x ? r1.w : 1;
  r3.x = g_reflectDistortionScaleFar + -g_reflectDistortionScale;
  r1.w = r1.w * r3.x + g_reflectDistortionScale;
  g_ReflectionTexture.GetDimensions(0, fDest.x, fDest.y, fDest.z);
  r3.xy = fDest.xy;
  r3.xy = r3.xy + r3.xy;
  r3.xy = v0.xy / r3.xy;
  r3.z = 1 + -r3.y;
  r1.xy = r1.xy * r1.ww + r3.xz;
  r3.zw = r3.xz + -r1.xy;
  r1.w = 1 + -r1.z;
  r4.xyzw = r1.zzxy + -r1.xyww;
  r5.xy = cmp(r1.xy >= r1.ww);
  r1.w = max(r4.x, r4.z);
  r1.w = max(r1.w, r4.y);
  r1.w = max(r1.w, r4.w);
  r1.w = saturate(r1.w / r1.z);
  r4.xy = cmp(r1.zz >= r1.xy);
  r1.z = r2.w ? r1.w : 1;
  r1.zw = r1.zz * r3.zw + r1.xy;
  r2.w = (int)r5.x | (int)r4.x;
  r2.w = (int)r4.y | (int)r2.w;
  r2.w = (int)r5.y | (int)r2.w;
  r1.xy = r2.ww ? r1.zw : r1.xy;
  r1.xyz = g_ReflectionTexture.Sample(SS_ClampLinear_s, r1.xy).xyz;
  r1.w = saturate(dot(r2.xyz, r0.xyz));
  r1.w = 1 + -r1.w;
  r2.w = r1.w * r1.w;
  r2.w = r2.w * r2.w;
  r1.w = r2.w * r1.w;
  r2.w = g_reflectMax + -g_reflectMin;
  r1.w = r1.w * r2.w + g_reflectMin;
  r1.xyz = r1.xyz * r1.www;
  r1.w = 1 + -r1.w;
  r2.w = dot(g_lightDirection.xyz, g_lightDirection.xyz);
  r2.w = rsqrt(r2.w);
  r4.xyz = g_lightDirection.xyz * r2.www + r2.xyz;
  r5.xyz = g_lightDirection.xyz * r2.www;
  r2.w = saturate(dot(r5.xyz, r0.xyz));
  r3.z = dot(r4.xyz, r4.xyz);
  r3.w = sqrt(r3.z);
  r3.z = rsqrt(r3.z);
  r5.xyz = r4.xyz * r3.zzz;
  r4.xyz = r4.xyz / r3.www;
  r3.z = cmp(0 < r3.w);
  r4.xyz = r3.zzz ? r4.xyz : float3(0,1,0);
  r3.z = saturate(dot(r2.xyz, r4.xyz));
  r3.z = 1 + -r3.z;
  r3.w = saturate(dot(r5.xyz, r0.xyz));
  r3.w = log2(r3.w);
  r4.x = r3.z * r3.z;
  r4.x = r4.x * r4.x;
  r3.z = r4.x * r3.z;
  r4.x = g_reflectance * g_reflectance;
  r4.y = -g_reflectance * g_reflectance + 1;
  r3.z = r3.z * r4.y + r4.x;
  r4.x = 13 * g_shininess;
  r4.x = exp2(r4.x);
  r4.z = g_sharpness * r4.x;
  r4.x = r4.x * 0.00999999978 + g_sharpness;
  r4.x = r4.z / r4.x;
  r4.x = max(1, r4.x);
  r3.w = r4.x * r3.w;
  r4.x = r4.x * 0.125 + 0.25;
  r3.w = exp2(r3.w);
  r3.z = r3.w * r3.z;
  r3.w = 16 * r2.w;
  r3.w = min(1, r3.w);
  r3.z = r3.z * r3.w;
  r5.xyz = g_lightSpecColor.xyz * g_lightSpecColor.www;
  r4.xzw = r5.xyz * r4.xxx;
  r1.xyz = r4.xzw * r3.zzz + r1.xyz;
  r3.z = dot(v2.xyz, v2.xyz);
  r3.z = rsqrt(r3.z);
  r4.xzw = v2.xyz * r3.zzz;
  r2.x = dot(r2.xyz, r4.xzw);
  r2.x = max(0, r2.x);
  r2.x = 1 + -r2.x;
  r4.xzw = g_deepColor.xyz * g_deepColor.www;
  r5.xyz = g_shallowColor.xyz * g_shallowColor.www + -r4.xzw;
  r2.xyz = r2.xxx * r5.xyz + r4.xzw;
  r3.zw = wave[0].direction.xz * g_time;
  r3.zw = float2(0,0.100000001) * r3.zw;
  r3.zw = v1.zx * float2(0.100000001,0.100000001) + r3.zw;
  r3.z = g_DiffuseTexture.Sample(SS_WrapLinear_s, r3.zw).z;
  r4.xzw = r3.zzz * float3(4,4,4) + -r2.xyz;
  r3.zw = float2(-0.5,-0.5) + r3.xy;
  r5.xyz = g_RefractionTexture.SampleLevel(SS_ClampLinear_s, r3.xy, 0).xyz;
  r3.x = r3.z + r3.z;
  r3.y = -2 * r3.w;
  r3.z = g_cameraFarClip + -g_cameraNearClip;
  r3.w = r3.z * v0.z + -g_cameraFarClip;
  r3.z = r3.z * r5.x + -g_cameraFarClip;
  r5.w = g_cameraNearClip * g_cameraFarClip;
  r6.w = -r5.w / r3.w;
  r7.w = -r5.w / r3.z;
  r6.xy = r6.ww * r3.xy;
  r7.xy = r7.ww * r3.xy;
  r6.z = v0.z * r6.w;
  r3.x = dot(r6.xyzw, g_invProjection._m00_m10_m20_m30);
  r3.y = dot(r6.xyzw, g_invProjection._m01_m11_m21_m31);
  r3.z = dot(r6.xyzw, g_invProjection._m02_m12_m22_m32);
  r3.w = 1;
  r6.x = dot(r3.xyzw, g_invView._m00_m10_m20_m30);
  r6.y = dot(r3.xyzw, g_invView._m01_m11_m21_m31);
  r6.z = dot(r3.xyzw, g_invView._m02_m12_m22_m32);
  r6.w = dot(r3.xyzw, g_invView._m03_m13_m23_m33);
  r7.z = r7.w * r5.x;
  r3.x = dot(r7.xyzw, g_invProjection._m00_m10_m20_m30);
  r3.y = dot(r7.xyzw, g_invProjection._m01_m11_m21_m31);
  r3.z = dot(r7.xyzw, g_invProjection._m02_m12_m22_m32);
  r3.w = 1;
  r7.x = dot(r3.xyzw, g_invView._m00_m10_m20_m30);
  r7.y = dot(r3.xyzw, g_invView._m01_m11_m21_m31);
  r7.z = dot(r3.xyzw, g_invView._m02_m12_m22_m32);
  r7.w = dot(r3.xyzw, g_invView._m03_m13_m23_m33);
  r3.xyzw = -r7.xyzw + r6.xyzw;
  r3.x = dot(r3.xyzw, r3.xyzw);
  r3.x = sqrt(r3.x);
  r3.y = cmp(0 >= v5.y);
  r3.z = v5.x + v1.y;
  r3.w = max(0, r3.z);
  r3.y = r3.y ? r3.x : r3.w;
  r3.xyzw = saturate(r3.xyzy / g_depthTransparent);
  r3.y = 1 + -r3.y;
  r6.xyz = cmp(float3(0,0,0) < g_depthTransparent);
  r3.y = r6.y ? r3.y : 0;
  r2.xyz = r3.yyy * r4.xzw + r2.xyz;
  r2.xyz = r2.xyz + -r5.xyz;
  r3.x = r6.x ? r3.x : 1;
  r2.xyz = r3.xxx * r2.xyz + r5.xyz;
  r0.w = 1;
  r7.x = dot(r0.xyzw, g_ambientSH[0].xyzw);
  r7.y = dot(r0.xyzw, g_ambientSH[1].xyzw);
  r7.z = dot(r0.xyzw, g_ambientSH[2].xyzw);
  r0.xyz = max(float3(0,0,0), r7.xyz);
  r0.xyz = r0.xyz * r1.www;
  r4.xzw = g_lightDiffColor.xyz * g_lightDiffColor.www;
  r4.xzw = r4.xzw * r2.www;
  r0.xyz = r4.xzw * r4.yyy + r0.xyz;
  r0.xyz = r2.xyz * r0.xyz + r1.xyz;
  r0.xyz = r0.xyz + -r5.xyz;
  r1.y = r6.y ? r3.z : 1;
  r0.w = r6.z ? r3.w : 1;
  r1.zw = float2(0,1) * wave[0].direction.yx;
  r1.zw = wave[0].direction.zy * float2(1,0) + -r1.zw;
  r2.x = dot(r1.zw, r1.zw);
  r2.x = rsqrt(r2.x);
  r1.zw = r2.xx * r1.zw;
  r1.z = dot(v1.xz, r1.zw);
  r1.z = 0.0399999991 * r1.z;
  r1.w = 1 / g_borderBobbleFlatScale;
  r1.x = r1.z * r1.w;
  r1.x = g_BlendMaskTexture.Sample(SS_WrapLinear_s, r1.xy).z;
  r1.x = 2 + -r1.x;
  r1.x = saturate(r1.x + -r3.y);
  r0.w = r1.x * r0.w;
  o0.xyz = r0.www * r0.xyz + r5.xyz;
  o0.w = 1;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//
// Buffer Definitions: 
//
// cbuffer cbWave
// {
//
//   float4x4 g_world;                  // Offset:    0 Size:    64
//   float4x4 g_viewProjection;         // Offset:   64 Size:    64 [unused]
//   float4x4 g_invView;                // Offset:  128 Size:    64
//   float4x4 g_invProjection;          // Offset:  192 Size:    64
//   float4x4 g_invViewProjection;      // Offset:  256 Size:    64 [unused]
//   float4x4 g_terrainInvView;         // Offset:  320 Size:    64 [unused]
//   float4x4 g_terrainInvProjection;   // Offset:  384 Size:    64 [unused]
//   float4x4 g_cameraYRotation;        // Offset:  448 Size:    64 [unused]
//   float4 g_eyePosition;              // Offset:  512 Size:    16
//   float4 g_eyePositionPushedBack;    // Offset:  528 Size:    16 [unused]
//   float4 g_meshCorner0;              // Offset:  544 Size:    16 [unused]
//   float4 g_meshCorner1;              // Offset:  560 Size:    16 [unused]
//   float4 g_meshCorner2;              // Offset:  576 Size:    16 [unused]
//   float4 g_meshCorner3;              // Offset:  592 Size:    16 [unused]
//   float g_cameraFovY;                // Offset:  608 Size:     4
//   float g_cameraNearClip;            // Offset:  612 Size:     4
//   float g_cameraFarClip;             // Offset:  616 Size:     4
//   float g_terrainNearClip;           // Offset:  620 Size:     4 [unused]
//   float g_terrainFarClip;            // Offset:  624 Size:     4 [unused]
//   float g_time;                      // Offset:  628 Size:     4
//   float g_dt;                        // Offset:  632 Size:     4 [unused]
//   float g_waveNum;                   // Offset:  636 Size:     4 [unused]
//
// }
//
// cbuffer cbWaveUserParam
// {
//
//   float4 g_shallowColor;             // Offset:    0 Size:    16
//   float4 g_deepColor;                // Offset:   16 Size:    16
//   float g_depthBorderFeed;           // Offset:   32 Size:     4
//   float g_depthBorderBubble;         // Offset:   36 Size:     4
//   float g_depthBeachEnd;             // Offset:   40 Size:     4 [unused]
//   float g_depthTransparent;          // Offset:   44 Size:     4
//   float g_depthBlendBegin;           // Offset:   48 Size:     4 [unused]
//   float g_depthBlendEnd;             // Offset:   52 Size:     4 [unused]
//   float g_bumpMapTilingSize;         // Offset:   56 Size:     4
//   float g_fftTexureTilingSize;       // Offset:   60 Size:     4 [unused]
//   float g_borderBobbleFlatScale;     // Offset:   64 Size:     4
//   float g_borderWaveScale;           // Offset:   68 Size:     4 [unused]
//   float g_terrainGradient;           // Offset:   72 Size:     4 [unused]
//   float g_depthLimit;                // Offset:   76 Size:     4 [unused]
//   float g_vsLodBeginDistance;        // Offset:   80 Size:     4 [unused]
//   float g_vsLodEndDistance;          // Offset:   84 Size:     4 [unused]
//   float g_choppyScale;               // Offset:   88 Size:     4 [unused]
//   float g_bChoppy;                   // Offset:   92 Size:     4 [unused]
//   float4 g_ambientSH[3];             // Offset:   96 Size:    48
//   float4 g_lightDirection;           // Offset:  144 Size:    16
//   float4 g_lightDiffColor;           // Offset:  160 Size:    16
//   float4 g_lightSpecColor;           // Offset:  176 Size:    16
//   float g_sharpness;                 // Offset:  192 Size:     4
//   float g_bBlinnPhong;               // Offset:  196 Size:     4 [unused]
//   float4 g_terrainAreaCenter;        // Offset:  208 Size:    16 [unused]
//   float g_terrainAreaWidth;          // Offset:  224 Size:     4 [unused]
//   float g_terrainAreaDepth;          // Offset:  228 Size:     4 [unused]
//   float g_reflectMax;                // Offset:  232 Size:     4
//   float g_reflectMin;                // Offset:  236 Size:     4
//   float g_shininess;                 // Offset:  240 Size:     4
//   float g_reflectance;               // Offset:  244 Size:     4
//   float g_reflectDistortionScale;    // Offset:  248 Size:     4
//   float g_reflectDistortionScaleFar; // Offset:  252 Size:     4
//   float g_reflectDistortionFar;      // Offset:  256 Size:     4
//
// }
//
// cbuffer cbGarstnerWaveParam
// {
//
//   struct GARSTNER_WAVE_PARAM
//   {
//       
//       float3 direction;              // Offset:    0
//       float wavelength;              // Offset:   12
//       float amplitude;               // Offset:   16
//
//   } wave[2];                         // Offset:    0 Size:    52
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SS_WrapLinear                     sampler      NA          NA    8        1
// SS_ClampLinear                    sampler      NA          NA    9        1
// g_DiffuseTexture                  texture  float4          2d    0        1
// g_BumpmapTexture2                 texture  float4          2d   10        1
// g_BlendMaskTexture                texture  float4          2d   14        1
// g_ReflectionTexture               texture  float4          2d   54        1
// g_RefractionTexture               texture  float4          2d   55        1
// cbWave                            cbuffer      NA          NA    0        1
// cbWaveUserParam                   cbuffer      NA          NA    1        1
// cbGarstnerWaveParam               cbuffer      NA          NA    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyz 
// POSITION                 0   xyz         1     NONE   float   xyz 
// NORMAL                   0   xyz         2     NONE   float   xyz 
// TANGENT                  0   xyz         3     NONE   float   xyz 
// BINORMAL                 0   xyz         4     NONE   float   xyz 
// DEPTH                    0   xy          5     NONE   float   xy  
//
//
// 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 cb0[40], immediateIndexed
dcl_constantbuffer cb1[17], immediateIndexed
dcl_constantbuffer cb2[1], immediateIndexed
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) t10
dcl_resource_texture2d (float,float,float,float) t14
dcl_resource_texture2d (float,float,float,float) t54
dcl_resource_texture2d (float,float,float,float) t55
dcl_input_ps_siv linear noperspective v0.xyz, position
dcl_input_ps linear v1.xyz
dcl_input_ps linear v2.xyz
dcl_input_ps linear v3.xyz
dcl_input_ps linear v4.xyz
dcl_input_ps linear v5.xy
dcl_output o0.xyzw
dcl_temps 8
mul r0.xyzw, cb0[39].yyyy, l(-0.070000, -0.000000, 0.049020, -0.028500)
div r1.x, l(1.000000, 1.000000, 1.000000, 1.000000), cb1[3].z
mul r1.xyzw, r1.xxxx, v1.xzxz
mad r0.xyzw, r1.zwzw, l(0.020000, 0.020000, 0.030000, 0.030000), r0.xyzw
sample_indexable(texture2d)(float,float,float,float) r2.xyz, r0.xyxx, t10.xyzw, s8
sample_indexable(texture2d)(float,float,float,float) r0.xyz, r0.zwzz, t10.xyzw, s8
add r0.xyz, r0.xzyx, r2.xzyx
mul r2.xyzw, cb0[39].yyyy, l(-0.040420, -0.023500, 0.025900, 0.025900)
mad r1.xyzw, r1.xyzw, l(0.050000, 0.050000, 0.070000, 0.070000), r2.xyzw
sample_indexable(texture2d)(float,float,float,float) r2.xyz, r1.xyxx, t10.xyzw, s8
sample_indexable(texture2d)(float,float,float,float) r1.xyz, r1.zwzz, t10.xyzw, s8
add r0.xyz, r0.xyzx, r2.xzyx
add r0.xyz, r1.xzyx, r0.xyzx
mad r0.xyz, r0.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-3.300000, -3.300000, -3.300000, 0.000000)
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
mul r1.xyz, r0.yyyy, v2.xyzx
mad r0.xyw, r0.xxxx, v3.xyxz, r1.xyxz
mad r0.xyz, r0.zzzz, v4.xyzx, r0.xywx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
mul r1.xy, r0.yyyy, -r0.xzxx
add r2.xyz, -v1.xyzx, cb0[32].xyzx
dp3 r1.z, r2.xyzx, r2.xyzx
sqrt r1.w, r1.z
rsq r1.z, r1.z
mul r2.xyz, r1.zzzz, r2.xyzx
div r1.z, cb0[38].y, r1.w
div_sat r1.w, r1.w, cb1[16].x
mul r1.xy, r1.zzzz, r1.xyxx
mul r2.w, cb0[38].x, l(0.500000)
sincos r2.w, null, r2.w
mul r2.w, r2.w, cb0[38].y
div r1.xy, r1.xyxx, r2.wwww
lt r3.x, l(0.000000), |r2.w|
and r1.xy, r1.xyxx, r3.xxxx
add r3.y, v1.y, -cb0[1].w
mul r3.yz, r3.yyyy, l(0.000000, 0.000000, -1.000000, 0.000000)
mul r3.yz, r1.zzzz, r3.yyzy
div r3.yz, r3.yyzy, r2.wwww
and r3.xy, r3.yzyy, r3.xxxx
add r1.xy, r1.xyxx, r3.xyxx
mul r1.xy, r1.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
dp2 r1.z, r1.xyxx, r1.xyxx
sqrt r1.z, r1.z
lt r2.w, l(0.000000), r1.z
lt r3.x, l(0.000000), cb1[16].x
movc r1.w, r3.x, r1.w, l(1.000000)
add r3.x, -cb1[15].z, cb1[15].w
mad r1.w, r1.w, r3.x, cb1[15].z
resinfo_indexable(texture2d)(float,float,float,float) r3.xy, l(0), t54.xyzw
add r3.xy, r3.xyxx, r3.xyxx
div r3.xy, v0.xyxx, r3.xyxx
add r3.z, -r3.y, l(1.000000)
mad r1.xy, r1.xyxx, r1.wwww, r3.xzxx
add r3.zw, -r1.xxxy, r3.xxxz
add r1.w, -r1.z, l(1.000000)
add r4.xyzw, -r1.xyww, r1.zzxy
ge r5.xy, r1.xyxx, r1.wwww
max r1.w, r4.z, r4.x
max r1.w, r4.y, r1.w
max r1.w, r4.w, r1.w
div_sat r1.w, r1.w, r1.z
ge r4.xy, r1.zzzz, r1.xyxx
movc r1.z, r2.w, r1.w, l(1.000000)
mad r1.zw, r1.zzzz, r3.zzzw, r1.xxxy
or r2.w, r5.x, r4.x
or r2.w, r4.y, r2.w
or r2.w, r5.y, r2.w
movc r1.xy, r2.wwww, r1.zwzz, r1.xyxx
sample_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyxx, t54.xyzw, s9
dp3_sat r1.w, r2.xyzx, r0.xyzx
add r1.w, -r1.w, l(1.000000)
mul r2.w, r1.w, r1.w
mul r2.w, r2.w, r2.w
mul r1.w, r1.w, r2.w
add r2.w, -cb1[14].w, cb1[14].z
mad r1.w, r1.w, r2.w, cb1[14].w
mul r1.xyz, r1.wwww, r1.xyzx
add r1.w, -r1.w, l(1.000000)
dp3 r2.w, cb1[9].xyzx, cb1[9].xyzx
rsq r2.w, r2.w
mad r4.xyz, cb1[9].xyzx, r2.wwww, r2.xyzx
mul r5.xyz, r2.wwww, cb1[9].xyzx
dp3_sat r2.w, r5.xyzx, r0.xyzx
dp3 r3.z, r4.xyzx, r4.xyzx
sqrt r3.w, r3.z
rsq r3.z, r3.z
mul r5.xyz, r3.zzzz, r4.xyzx
div r4.xyz, r4.xyzx, r3.wwww
lt r3.z, l(0.000000), r3.w
movc r4.xyz, r3.zzzz, r4.xyzx, l(0,1.000000,0,0)
dp3_sat r3.z, r2.xyzx, r4.xyzx
add r3.z, -r3.z, l(1.000000)
dp3_sat r3.w, r5.xyzx, r0.xyzx
log r3.w, r3.w
mul r4.x, r3.z, r3.z
mul r4.x, r4.x, r4.x
mul r3.z, r3.z, r4.x
mul r4.x, cb1[15].y, cb1[15].y
mad r4.y, -cb1[15].y, cb1[15].y, l(1.000000)
mad r3.z, r3.z, r4.y, r4.x
mul r4.x, cb1[15].x, l(13.000000)
exp r4.x, r4.x
mul r4.z, r4.x, cb1[12].x
mad r4.x, r4.x, l(0.010000), cb1[12].x
div r4.x, r4.z, r4.x
max r4.x, r4.x, l(1.000000)
mul r3.w, r3.w, r4.x
mad r4.x, r4.x, l(0.125000), l(0.250000)
exp r3.w, r3.w
mul r3.z, r3.z, r3.w
mul r3.w, r2.w, l(16.000000)
min r3.w, r3.w, l(1.000000)
mul r3.z, r3.w, r3.z
mul r5.xyz, cb1[11].wwww, cb1[11].xyzx
mul r4.xzw, r4.xxxx, r5.xxyz
mad r1.xyz, r4.xzwx, r3.zzzz, r1.xyzx
dp3 r3.z, v2.xyzx, v2.xyzx
rsq r3.z, r3.z
mul r4.xzw, r3.zzzz, v2.xxyz
dp3 r2.x, r2.xyzx, r4.xzwx
max r2.x, r2.x, l(0.000000)
add r2.x, -r2.x, l(1.000000)
mul r4.xzw, cb1[1].wwww, cb1[1].xxyz
mad r5.xyz, cb1[0].xyzx, cb1[0].wwww, -r4.xzwx
mad r2.xyz, r2.xxxx, r5.xyzx, r4.xzwx
mul r3.zw, cb0[39].yyyy, cb2[0].xxxz
mul r3.zw, r3.zzzw, l(0.000000, 0.000000, 0.000000, 0.100000)
mad r3.zw, v1.zzzx, l(0.000000, 0.000000, 0.100000, 0.100000), r3.zzzw
sample_indexable(texture2d)(float,float,float,float) r3.z, r3.zwzz, t0.xyzw, s8
mad r4.xzw, r3.zzzz, l(4.000000, 0.000000, 4.000000, 4.000000), -r2.xxyz
add r3.zw, r3.xxxy, l(0.000000, 0.000000, -0.500000, -0.500000)
sample_l_indexable(texture2d)(float,float,float,float) r5.xyz, r3.xyxx, t55.xyzw, s9, l(0.000000)
add r3.x, r3.z, r3.z
mul r3.y, r3.w, l(-2.000000)
add r3.z, -cb0[38].y, cb0[38].z
mad r3.w, r3.z, v0.z, -cb0[38].z
mad r3.z, r3.z, r5.x, -cb0[38].z
mul r5.w, cb0[38].z, cb0[38].y
div r6.w, -r5.w, r3.w
div r7.w, -r5.w, r3.z
mul r6.xy, r3.xyxx, r6.wwww
mul r7.xy, r3.xyxx, r7.wwww
mul r6.z, r6.w, v0.z
dp4 r3.x, r6.xyzw, cb0[12].xyzw
dp4 r3.y, r6.xyzw, cb0[13].xyzw
dp4 r3.z, r6.xyzw, cb0[14].xyzw
mov r3.w, l(1.000000)
dp4 r6.x, r3.xyzw, cb0[8].xyzw
dp4 r6.y, r3.xyzw, cb0[9].xyzw
dp4 r6.z, r3.xyzw, cb0[10].xyzw
dp4 r6.w, r3.xyzw, cb0[11].xyzw
mul r7.z, r5.x, r7.w
dp4 r3.x, r7.xyzw, cb0[12].xyzw
dp4 r3.y, r7.xyzw, cb0[13].xyzw
dp4 r3.z, r7.xyzw, cb0[14].xyzw
mov r3.w, l(1.000000)
dp4 r7.x, r3.xyzw, cb0[8].xyzw
dp4 r7.y, r3.xyzw, cb0[9].xyzw
dp4 r7.z, r3.xyzw, cb0[10].xyzw
dp4 r7.w, r3.xyzw, cb0[11].xyzw
add r3.xyzw, r6.xyzw, -r7.xyzw
dp4 r3.x, r3.xyzw, r3.xyzw
sqrt r3.x, r3.x
ge r3.y, l(0.000000), v5.y
add r3.z, v1.y, v5.x
max r3.w, r3.z, l(0.000000)
movc r3.y, r3.y, r3.x, r3.w
div_sat r3.xyzw, r3.xyzy, cb1[2].wyyx
add r3.y, -r3.y, l(1.000000)
lt r6.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), cb1[2].wyxw
and r3.y, r3.y, r6.y
mad r2.xyz, r3.yyyy, r4.xzwx, r2.xyzx
add r2.xyz, -r5.xyzx, r2.xyzx
movc r3.x, r6.x, r3.x, l(1.000000)
mad r2.xyz, r3.xxxx, r2.xyzx, r5.xyzx
mov r0.w, l(1.000000)
dp4 r7.x, r0.xyzw, cb1[6].xyzw
dp4 r7.y, r0.xyzw, cb1[7].xyzw
dp4 r7.z, r0.xyzw, cb1[8].xyzw
max r0.xyz, r7.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mul r0.xyz, r1.wwww, r0.xyzx
mul r4.xzw, cb1[10].wwww, cb1[10].xxyz
mul r4.xzw, r2.wwww, r4.xxzw
mad r0.xyz, r4.xzwx, r4.yyyy, r0.xyzx
mad r0.xyz, r2.xyzx, r0.xyzx, r1.xyzx
add r0.xyz, -r5.xyzx, r0.xyzx
movc r1.y, r6.y, r3.z, l(1.000000)
movc r0.w, r6.z, r3.w, l(1.000000)
mul r1.zw, cb2[0].yyyx, l(0.000000, 0.000000, 0.000000, 1.000000)
mad r1.zw, cb2[0].zzzy, l(0.000000, 0.000000, 1.000000, 0.000000), -r1.zzzw
dp2 r2.x, r1.zwzz, r1.zwzz
rsq r2.x, r2.x
mul r1.zw, r1.zzzw, r2.xxxx
dp2 r1.z, v1.xzxx, r1.zwzz
mul r1.z, r1.z, l(0.040000)
div r1.w, l(1.000000, 1.000000, 1.000000, 1.000000), cb1[4].x
mul r1.x, r1.w, r1.z
sample_indexable(texture2d)(float,float,float,float) r1.x, r1.xyxx, t14.zxyw, s8
add r1.x, -r1.x, l(2.000000)
add_sat r1.x, -r3.y, r1.x
mul r0.w, r0.w, r1.x
mad o0.xyz, r0.wwww, r0.xyzx, r5.xyzx
mov o0.w, l(1.000000)
ret 
// Approximately 208 instruction slots used

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